summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-01-03 09:05:09 +0000
committerMichael Stahl <mstahl@redhat.com>2012-01-05 15:06:11 +0100
commit44091b94ded66836b33e380afe04b73ece0cd318 (patch)
treebfb0ea2aa78193f509c29ef7f428bedd9036d663
parentbbf5ee6d3bf825656e8b0246dc3baf85ce6b63e0 (diff)
Related: fdo#43867 header styles contain content like document body
If we have to acquire before inserting content into a document, then we also need to acquire before copying styles into a document, seeing as header styles contain content, so whatever can happen during content insertion can happen during the content insertion of the contents of a header style. (cherry picked from commit 7dc25878c1310a1de6d3c87c88404b151bad21fc) Signed-off-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sw/source/core/doc/docnew.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index cba769405977..cdf5def2dff7 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -1110,14 +1110,9 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const
{
SwDoc* pRet = new SwDoc;
- pRet->ReplaceDefaults(*this);
-
- pRet->ReplaceCompatabilityOptions(*this);
-
- pRet->ReplaceStyles(*this);
-
- // we have to use pointer here, since the callee has to decide whether SfxObjectShellLock or SfxObjectShellRef should be used
- // sometimes the object will be returned with refcount set to 0 ( if no DoInitNew is done )
+ // we have to use pointer here, since the callee has to decide whether
+ // SfxObjectShellLock or SfxObjectShellRef should be used sometimes the
+ // object will be returned with refcount set to 0 ( if no DoInitNew is done )
SfxObjectShell* pRetShell = new SwDocShell( pRet, SFX_CREATE_MODE_STANDARD );
if( bCallInitNew )
{
@@ -1127,6 +1122,12 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const
pRet->acquire();
+ pRet->ReplaceDefaults(*this);
+
+ pRet->ReplaceCompatabilityOptions(*this);
+
+ pRet->ReplaceStyles(*this);
+
//copy content
pRet->Paste( *this );