summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-05-20 20:56:56 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2022-05-23 10:54:16 +0200
commit123d3a9301c90925c23cfb4806d7b0be01b975d6 (patch)
tree3ee20a4395fb2051125642e6d01a5b1b53b4a4af /sw/source/ui
parent1b8c42f8b007d690a85676f260b28b44639fc79a (diff)
sw: copy grab bags in mail merge
Otherwise formatting may get lost when the result is stored as DOCX. Change-Id: I62cbeb1fc9f120dd9c424daf5dc0471686715537 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134694 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/dbui/mmresultdialogs.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx
index b2db4782bd6c..9ff6315eefb0 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -682,6 +682,14 @@ IMPL_LINK_NOARG(SwMMResultSaveDialog, SaveOutputHdl_Impl, weld::Button&, void)
pTempView->GetDocShell()->GetDoc()->ReplaceDefaults( *pTargetView->GetDocShell()->GetDoc());
pTempView->GetDocShell()->GetDoc()->ReplaceDocumentProperties( *pTargetView->GetDocShell()->GetDoc(), true );
+ uno::Reference<beans::XPropertySet> const xThisSet(
+ pTargetView->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW);
+ uno::Reference<beans::XPropertySet> const xRetSet(
+ pTempView->GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW);
+ uno::Sequence<beans::PropertyValue> aInteropGrabBag;
+ xThisSet->getPropertyValue("InteropGrabBag") >>= aInteropGrabBag;
+ xRetSet->setPropertyValue("InteropGrabBag", uno::Any(aInteropGrabBag));
+
pTargetView->GetWrtShell().PastePages(
pTempView->GetWrtShell(), documentStartPageNumber(xConfigItem.get(), nDoc, false),
documentEndPageNumber(xConfigItem.get(), nDoc, false));