Bug 89794 - Exception in GetFirstPara method call (SwXFlatParagraph::getPropertySetInfo(): not implemented)
Summary: Exception in GetFirstPara method call (SwXFlatParagraph::getPropertySetInfo()...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3.0.4 release
Hardware: Other All
: medium normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:5.0.0 target:4.4.4
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2015-03-03 07:49 UTC by Oleg
Modified: 2015-12-17 08:47 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example script in a document (11.33 KB, application/vnd.oasis.opendocument.text)
2015-04-28 02:36 UTC, Matthew Francis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oleg 2015-03-03 07:49:39 UTC
I have a following vbs script which I want to use with LibreOffice 4.4.1:
''''''''''''''''''''''''''''''''''''''''''''''
Set objServiceManager= WScript.CreateObject("com.sun.star.ServiceManager")
Set objDesktop= objServiceManager.createInstance("com.sun.star.frame.Desktop")

Set objDocument = objDesktop.getCurrentComponent

Set paraIterator = objDocument.getFlatParagraphIterator(1, False)
Set oPara = paraIterator.GetFirstPara ' Error happens here
Set keyMap = oPara.getMarkupInfoContainer

Set s = oPara.getText
oPara.commitStringMarkup 1, "test", 0, s.Length, keyMap
''''''''''''''''''''''''''''''''''''''''''''''

When GetFirstPara is called, a following exception is thrown:

---------------------------
Windows Script Host
---------------------------
Scenario:   C:\Users\Oleg\Desktop\bugdemo.vbs
String: 7
Symbol: 1
Error:  [automation bridge]UnoConversionUtilities<T>::anyToVariant 
Unexpected exception occurred. Message: SwXFlatParagraph::getPropertySetInfo(): not implemented
Code:   800A03E9
Source:     [automation bridge] 

---------------------------
ОК   
---------------------------

Am I doing something wrong (are there any alternatives?) or it is really a bug?
Comment 2 Oleg 2015-03-04 08:16:26 UTC
And here is the revision (07-Apr-2014) when getPropertySetInfo method was first added: http://opengrok.libreoffice.org/xref/core/sw/source/core/unocore/unoflatpara.cxx?r=d477ff4a81ecba8a77ead5ff1a33d3e3ceed622e

Seems was added when fixing this:
https://bugs.documentfoundation.org/show_bug.cgi?id=69416


This might explain why my script worked for version 4.2.
Comment 3 Matthew Francis 2015-04-28 02:35:04 UTC
If it actually dies of the exception on Windows then that's a Windows-specific side effect, but the original failure is a cross-platform regression which began exactly at the commit mentioned in comment 2.

Adding Cc: to mstahl@redhat.com; Could you possibly take a look at this one? Thanks

commit d477ff4a81ecba8a77ead5ff1a33d3e3ceed622e
Author: Michael Stahl <mstahl@redhat.com>
Date:   Mon Apr 7 23:22:22 2014 +0200

    fdo#69416: make footnote positions available to XProofreader
    
    - ModelToViewHelper: add new flag REPLACEMODE, which causes fields and
      footnotes to be replaced with ZWSP instead of expanding them
    - SwXFlatParagraph: add FootnotePositions and FieldPositions properties
    - GrammarCheckingIterator: invoke XProofreader::doProofreading with
      properties FootnotePositions and FieldPositions
    
    Change-Id: I9b66a37aac94f940546e812d8b85a35aebd8181a
Comment 4 Matthew Francis 2015-04-28 02:36:29 UTC
Created attachment 115147 [details]
Example script in a document
Comment 5 Michael Stahl (allotropia) 2015-05-18 19:15:11 UTC
hmm getPropertySetInfo is less optional than i thought

fixed on master
Comment 6 Commit Notification 2015-05-18 19:15:59 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a4c121aa4a2f68d36f1ce41e94e8275230ec0866

tdf#89794: sw: implement SwXFlatParagraph::getPropertySetInfo()

It will be available in 5.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2015-05-20 14:08:10 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=421adf500c0723126a293b7fbd51f22e1471f3cf&h=libreoffice-4-4

tdf#89794: sw: implement SwXFlatParagraph::getPropertySetInfo()

It will be available in 4.4.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 8 Robinson Tryon (qubit) 2015-12-17 08:47:53 UTC
Migrating Whiteboard tags to Keywords: (bibisected)
[NinjaEdit]