[Libreoffice-bugs] [Bug 114854] FILEOPEN: DOCX: URL in comment imported as plain text

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue Aug 6 15:51:22 UTC 2019


https://bugs.documentfoundation.org/show_bug.cgi?id=114854

--- Comment #3 from Justin L <jluth at mail.com> ---
(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) );

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20190806/243a473d/attachment.html>


More information about the Libreoffice-bugs mailing list