summaryrefslogtreecommitdiff
path: root/sw/source/core
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/core
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/core')
-rw-r--r--sw/source/core/doc/docnew.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 72182b7435d0..72798b019e15 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -28,6 +28,7 @@
#include <doc.hxx>
#include <proofreadingiterator.hxx>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/text/XFlatParagraphIteratorProvider.hpp>
#include <com/sun/star/linguistic2/XProofreadingIterator.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
@@ -906,6 +907,14 @@ SfxObjectShell* SwDoc::CreateCopy( bool bCallInitNew, bool bEmpty ) const
xRet->ReplaceStyles(*this);
+ uno::Reference<beans::XPropertySet> const xThisSet(
+ GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW);
+ uno::Reference<beans::XPropertySet> const xRetSet(
+ pRetShell->GetBaseModel(), uno::UNO_QUERY_THROW);
+ uno::Sequence<beans::PropertyValue> aInteropGrabBag;
+ xThisSet->getPropertyValue("InteropGrabBag") >>= aInteropGrabBag;
+ xRetSet->setPropertyValue("InteropGrabBag", uno::Any(aInteropGrabBag));
+
if( !bEmpty )
{
#ifdef DBG_UTIL