See the bugreport from AOO bugzilla: https://issues.apache.org/ooo/show_bug.cgi?id=79611 We do not support this; but should be reasonably straight-forward to implement. In essence, you need to make sure that in SvxFieldData::Create() from editeng/source/items/flditem.cxx, none of the xPropSet->getPropertyValue(...); throws. To achieve that, you want to extend the XMLSenderFieldImportContext::PrepareField() from xmloff/source/text/txtfldi.cxx so that it fills all the appropriate properties during load, like for example: aAny <<= text::textfield::Type::EXTENDED_TIME; rPropSet->setPropertyValue(UNO_TC_PROP_TEXTFIELD_TYPE, aAny); for date/time.
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility. see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
adding LibreOffice developer list as CC to unresolved Writer EasyHacks for better visibility. see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
I cannot reproduce the bug on Ubuntu 14.04, 64-bit. Both files attached in the AOO report open fine on a freshly built copy of LO, and on my OS-supplied copy, "Version 4.2.7.2, Build ID 420m0(Build:2)". Should this be closed?
Well, not really. The "import" works (not crash), but there are two bookmarks in the aoo bug document. 1) called "Bezugszeichen" and 2) called "Anrede" Anrede is shown in the navigator, but the Bezugszeichen-Bookmark which is located before the date "7. Oktober 2005" is not visible in the navigator.
OK, I see. Can I take this bug?
any update?
Sorry, I realised that my C++ was rustier than I'd imagined and then forgot all about this bug. I've unassigned myself.
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyInteresting SkillCpp) [NinjaEdit]
JanI is default CC for Easy Hacks (Add Jan; remove LibreOffice Dev List from CC) [NinjaEdit]
I can see two things from the document, 1) <draw:text-box fo:min-height="0.01pt"> <text:p text:style-name="P2"><text:s/><text:span text:style-name="T1">•</text:span><text:s/><text:span text:style-name="T2"><text:sender-street>Steinmetzstraße 57</text:sender-street></text:span><text:span text:style-name="T2"/><text:span text:style-name="T1">•</text:span><text:s/><text:span text:style-name="T2"><text:sender-postal-code>10783</text:sender-postal-code></text:span><text:span text:style-name="T2"/><text:span text:style-name="T2"><text:sender-city>Berlin</text:sender-city></text:span></text:p> </draw:text-box> part doesn't load which might be what Jan is referring too. 2) The bookmark doesn't show up in the Navigator as Dennis mentions. Also, <text:bookmark text:name="Bezugszeichen"/> and <text:date style:data-style-name="N1"/> seem to be throwing too as I counted 5 in SvxFieldData* SvxFieldData::Create() with three being the 'sender' ones from above. Firstly, I need to figure out how to make part (1) from the above work. I think its from XMLSenderFieldImportContext::PrepareField() as Jan says, but I still don't get exactly what to change even after I've been working on this for a day. Adding the lines aAny <<= text::textfield::Type::EXTENDED_TIME; rPropSet->setPropertyValue(UNO_TC_PROP_TEXTFIELD_TYPE, aAny); anywhere inside XMLSenderFieldImportContext::PrepareField() leads to an error. By 'appropriate properties during load' am I right to assume it means everything from <http://opengrok.libreoffice.org/xref/core/offapi/com/sun/star/text/textfield/Type.idl> ? Please give some pointers on how to proceed.
Hi kendy, Do I have to do something along the lines of making something like XMLExtendedTimeFieldImportContext (like XMLSenderFieldImportContext) for each of the 15 constants in type.idl (EXTENDED_TIME is one amongst the 15), make it inherit from XMLTextFieldImport context and have a PrepareField() with the lines aAny <<= text::textfield::Type::EXTENDED_TIME; rPropSet->setPropertyValue(UNO_TC_PROP_TEXTFIELD_TYPE, aAny); that you've mentioned in comment 1? I spoke to Dennis regarding this and he thinks likewise too.. Thanks.
Dipankar: To get a better idea where to code, you need to open LibreOffice in a debugger, set breakpoint in editeng/source/items/flditem.cxx 's SvxFieldData::Create(). Then run the import of the document, and when the breakpoint is reached, set your debugger to stop on a throw (in gdb, it would be the 'catch throw' command), and continue the execution. Then you'll see what exactly throws and where, and from that point, you'll hopefully have a better idea what to add.
From the debugger I could get the following locations about the exceptions being thrown: When I REMOVED <draw:frame draw:name="Rahmen4" draw:style-name="fr2" svg:x="70.8379179942pt" svg:y="289.1627056658pt" text:anchor-type="page" text:anchor-page-number="1" draw:z-index="6" svg:width="496.0638515pt" svg:height="14.0882133826pt"> <draw:text-box fo:min-height="0.01pt"> <text:p text:style-name="P5"><text:bookmark text:name="Bezugszeichen"/><text:tab text:tab-ref="1"/>7. Oktober 2005<text:tab text:tab-ref="2"/><text:tab text:tab-ref="3"/><text:span><text:date style:data-style-name="N1"/></text:span></text:p> </draw:text-box> </draw:frame> from content.xml from the given test odt file, there were 6 exceptions thrown: - throw beans::UnknownPropertyException( "Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); line 2322 from unofield.cxx (This unofield.cxx is from module sw) - throw lang::IllegalArgumentException(); line 1942 from unotext.cxx (module editeng) The second one looks to be thrown because the first is thrown. (Direct consequence I guess). We can get this from the stack trace. And the above two get repeated 3 times for a total of 6 exceptions thrown. This is probably because there are three sender fields - 'sender-city', 'sender-postal-code' and 'sender-street' in the content.xml
When I REMOVED <draw:frame draw:name="Rahmen1" draw:style-name="fr1" svg:x="70.8379179942pt" svg:y="127.5592761pt" text:anchor-type="page" text:anchor-page-number="1" draw:z-index="2" svg:width="212.5421004884pt" svg:height="14.0882133826pt"> <draw:text-box fo:min-height="0.01pt"> <text:p text:style-name="P2"><text:s/><text:span text:style-name="T1">•</text:span><text:s/><text:span text:style-name="T2"><text:sender-street>Steinmetzstraße 57</text:sender-street></text:span><text:span text:style-name="T2"/><text:span text:style-name="T1">•</text:span><text:s/><text:span text:style-name="T2"><text:sender-postal-code>10783</text:sender-postal-code></text:span><text:span text:style-name="T2"/><text:span text:style-name="T2"><text:sender-city>Berlin</text:sender-city></text:span></text:p> </draw:text-box> </draw:frame> from content.xml from the given test odt file, these were exceptions thrown: - throw lang::IllegalArgumentException(); line 1942 from unotext.cxx (module editeng) - throw beans::UnknownPropertyException( "Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); line 2322 from unofield.cxx (This unofield.cxx is from module sw) - throw lang::IllegalArgumentException(); line 1942 from unotext.cxx (module editeng) in the given order. This and the exceptions from the above comment are thrown when there is a breakpoint at SvxFieldData::Create() from editeng/source/items/flditem.cxx So these exceptions are related to the bookmark within the frame.
(In reply to Dipankar Niranjan from comment #14) > So these exceptions are related to the bookmark within the frame. these meaning the ones in comment 14 and not from comment 13 Comment 13 is related to 'sender'
As far as I gathered after two days of looking into this, and looking at XMLSenderFieldImportContext::PrepareField() and other of XMLSenderFieldImportContext's methods and <opengrok.libreoffice.org/xref/core/offapi/com/sun/star/text/textfield/ExtendedUser.idl> I can say that we may need something along the lines of XML-UNO_TC_PROP_TEXTFIELD_TYPE-FieldImportContext with the 15 constants from <http://opengrok.libreoffice.org/xref/core/offapi/com/sun/star/text/textfield/Type.idl> being defined along the lines of how 'sender-city', 'sender-zip', etc. are related to XMLSenderFieldImportContext. Please look into libreoffice/workdir/UnoApiHeadersTarget/offapi/normal/com/sun/star/text/textfield directory too. Any pointers will be of great help. I've been on this for 2-3 days now and I really want to fix this up.
The bookmark called "Bezugszeichen" is still not visible in: Version: 7.2.0.0.alpha1+ / LibreOffice Community Build ID: e2970060121824650f95421d8d2411840a40311f CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-05-28_08:38:25 Calc: threaded Discontinued KWord has seen its final release in 2011, but I guess we still want to support and import legacy documents as much as possible - one of the strong suits of LibreOffice. Or are we simply talking about LO not respecting some aspect(s) of the ODF specification? Maybe the this report's title needs to be updated?