| Summary: | FILEOPEN: DOCX: URL in comment imported as plain text | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | Justin L <jluth> |
| Component: | Writer | Assignee: | Justin L <jluth> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | jluth, kelemeng, libreoffice, nemeth, raal |
| Priority: | medium | Keywords: | filter:docx |
| Version: | Inherited From OOo | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: | https://bugs.documentfoundation.org/show_bug.cgi?id=104707 | ||
| Whiteboard: | target:6.4.0 | ||
| Crash report or crash signature: | Regression By: | ||
| Bug Depends on: | |||
| Bug Blocks: | 112916, 125611 | ||
| Attachments: | tdf104707_urlComment.odt: ODT master for creating .doc and .docx copies. | ||
|
Description
Justin L
2018-01-05 17:24:25 UTC
I can confirm with Version: 6.1.0.0.alpha0+ Build ID: 88f6ffeb9e0c0b942c2b0bc9d60af7bb7a6caaf8 CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk3; Repro 6.3+ with ODT attachment 138904 [details]. MSO 2016 opens DOCX fine.
(In reply to Justin L from comment #0) > The same code is used for setting the URL property in regular > text and works fine there. Normal text uses SwTextCursor, while the draw-based cursor uses SvxUnoTextRangeBase. Since .doc format worked, I found that it uses Draw to ImportAsOutliner m_pDrawEditEngine->QuickInsertField(SvxFieldItem(aURL, EE_FEATURE_FIELD), aSel); That suggests doing something like this #include <editeng/flditem.hxx> #include <editeng/unotext.hxx> SvxUnoTextRangeBase* pDrawText = dynamic_cast<SvxUnoTextRangeBase*>(xCrsr.get()); if ( pDrawText ) pDrawText->attachField( std::make_unique<SvxURLField>(pContext->GetHyperlinkURL(), "the displayed text", SvxURLFormat::AppDefault) ); proposed fix at https://gerrit.libreoffice.org/77108 Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/75b10a6c36267c30ae01c850b2a2f9ee99b74e43%5E%21 tdf#114854 writerfilter: EditEng URLs import different from SW URLs It will be available in 6.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. |