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?
Code pointer: http://opengrok.libreoffice.org/xref/core/sw/source/core/unocore/unoflatpara.cxx#76
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.
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
Created attachment 115147 [details] Example script in a document
hmm getPropertySetInfo is less optional than i thought fixed on master
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.
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.
Migrating Whiteboard tags to Keywords: (bibisected) [NinjaEdit]