diff options
Diffstat (limited to 'sw/source/core/doc/docnew.cxx')
-rw-r--r-- | sw/source/core/doc/docnew.cxx | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 5c18528525f7..85f3b33ae9c9 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -356,6 +356,7 @@ SwDoc::SwDoc() mbTabAtLeftIndentForParagraphsInList = false; // hidden #i89181# mbInvertBorderSpacing = false; // hidden mbCollapseEmptyCellPara = true; // hidden + mbSmallCapsPercentage66 = false; // hidden // // COMPATIBILITY FLAGS END @@ -1047,6 +1048,7 @@ void SwDoc::InitTOXTypes() SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const { SwDoc* pRet = new SwDoc; + //copy settings sal_uInt16 aRangeOfDefaults[] = { RES_FRMATR_BEGIN, RES_FRMATR_END-1, @@ -1057,22 +1059,24 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const 0 }; - SfxItemSet aNewDefaults( pRet->GetAttrPool(), aRangeOfDefaults ); - - sal_uInt16 nWhich; - sal_uInt16 nRange = 0; - while( aRangeOfDefaults[nRange] != 0) { - for( nWhich = aRangeOfDefaults[nRange]; nWhich < aRangeOfDefaults[nRange + 1]; ++nWhich ) + SfxItemSet aNewDefaults( pRet->GetAttrPool(), aRangeOfDefaults ); + + sal_uInt16 nWhich; + sal_uInt16 nRange = 0; + while( aRangeOfDefaults[nRange] != 0) { - const SfxPoolItem& rSourceAttr = mpAttrPool->GetDefaultItem( nWhich ); - if( rSourceAttr != pRet->mpAttrPool->GetDefaultItem( nWhich ) ) - aNewDefaults.Put( rSourceAttr ); + for( nWhich = aRangeOfDefaults[nRange]; nWhich < aRangeOfDefaults[nRange + 1]; ++nWhich ) + { + const SfxPoolItem& rSourceAttr = mpAttrPool->GetDefaultItem( nWhich ); + if( rSourceAttr != pRet->mpAttrPool->GetDefaultItem( nWhich ) ) + aNewDefaults.Put( rSourceAttr ); + } + nRange += 2; } - nRange += 2; + if( aNewDefaults.Count() ) + pRet->SetDefault( aNewDefaults ); } - if( aNewDefaults.Count() ) - pRet->SetDefault( aNewDefaults ); pRet->n32DummyCompatabilityOptions1 = n32DummyCompatabilityOptions1; pRet->n32DummyCompatabilityOptions2 = n32DummyCompatabilityOptions2; @@ -1116,12 +1120,16 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const pRetShell->DoInitNew(); } + pRet->acquire(); + //copy content pRet->Paste( *this ); // remove the temporary shell if it is there as it was done before pRet->SetTmpDocShell( (SfxObjectShell*)NULL ); + pRet->release(); + return pRetShell; } |