summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-01-03 09:05:09 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-01-05 09:18:19 +0000
commit7dc25878c1310a1de6d3c87c88404b151bad21fc (patch)
tree819e058a5653d7b2806d8bace656e83797c43078
parent91724b930fcb1dc5f1919ac4d2d05521d10225fa (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.
-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 294a4d49ae74..27a8286625a8 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -1119,14 +1119,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 )
{
@@ -1136,6 +1131,12 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const
pRet->acquire();
+ pRet->ReplaceDefaults(*this);
+
+ pRet->ReplaceCompatabilityOptions(*this);
+
+ pRet->ReplaceStyles(*this);
+
//copy content
pRet->Paste( *this );