summaryrefslogtreecommitdiff
path: root/sw/source/uibase/shells/textfld.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-10-07 11:16:10 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-10-29 12:36:19 +0100
commita9d7ac5c8f7af0051b0df1c8a298f9823cd134aa (patch)
tree3e900977d34e36f4fc982b39af8670d7fe7fb2b7 /sw/source/uibase/shells/textfld.cxx
parent4692b33314669515a973f69cddd27b688327ca99 (diff)
Allow replies with rich text content from command arguments
Change-Id: I46d200048bdfef767882e94c7544f40f2e0b3c8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174593 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 3eae55420d1d8daee6efad456f651a9ff189723b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175752 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source/uibase/shells/textfld.cxx')
-rw-r--r--sw/source/uibase/shells/textfld.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx
index 7a7e410590f7..554ccb610a7c 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -27,6 +27,7 @@
#include <txtfld.hxx>
#include <svl/itempool.hxx>
#include <svl/numformat.hxx>
+#include <editeng/editobj.hxx>
#include <tools/lineend.hxx>
#include <svl/whiter.hxx>
#include <svl/eitem.hxx>
@@ -513,6 +514,15 @@ void SwTextShell::ExecField(SfxRequest &rReq)
auto pWin = pMgr->GetAnnotationWin(pIdItem->GetValue().toUInt32());
if(pWin)
{
+ if (const SvxPostItTextItem* pHtmlItem = rReq.GetArg<SvxPostItTextItem>(SID_ATTR_POSTIT_HTML))
+ {
+ SwDocShell* pDocSh = GetView().GetDocShell();
+ Outliner aOutliner(&pDocSh->GetPool(), OutlinerMode::TextObject);
+ SwPostItHelper::ImportHTML(aOutliner, pHtmlItem->GetValue());
+ if (std::optional<OutlinerParaObject> oPara = aOutliner.CreateParaObject())
+ pMgr->RegisterAnswer(oPara.value());
+ }
+
OUString sText;
if(const auto pTextItem = rReq.GetArg<SvxPostItTextItem>(SID_ATTR_POSTIT_TEXT))
sText = pTextItem->GetValue();