diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-09-09 23:19:59 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-09-12 09:09:58 +0100 |
commit | 64a377efa5ecf685ddd4c2e2be8bcf782b6485f2 (patch) | |
tree | 8d796cd8950b0ac0493bcd8169f5d62aa9e5712c /sw | |
parent | 108dabd57649312c1f418b8349cbde26b7a15478 (diff) |
factor out code for copying compatability options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/doc.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/doc/docnew.cxx | 64 |
2 files changed, 36 insertions, 31 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index c9eaca9b4e5b..be85f2cd706f 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1276,6 +1276,9 @@ public: // Replace all property defaults with those from rSource. void ReplaceDefaults( const SwDoc& rSource ); + // Replace all compatability options with those from rSource. + void ReplaceCompatabilityOptions(const SwDoc& rSource); + // Query if style (paragraph- / character- / frame- / page-) is used. sal_Bool IsUsed( const SwModify& ) const; sal_Bool IsUsed( const SwNumRule& ) const; diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 1153bcc041cc..aa8aa3a85bfd 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -1079,44 +1079,46 @@ void SwDoc::ReplaceDefaults(const SwDoc& rSource) SetDefault(aNewDefaults); } +void SwDoc::ReplaceCompatabilityOptions(const SwDoc& rSource) +{ + n32DummyCompatabilityOptions1 = rSource.n32DummyCompatabilityOptions1; + n32DummyCompatabilityOptions2 = rSource.n32DummyCompatabilityOptions2; + mbParaSpaceMax = rSource.mbParaSpaceMax; + mbParaSpaceMaxAtPages = rSource.mbParaSpaceMaxAtPages; + mbTabCompat = rSource.mbTabCompat; + mbUseVirtualDevice = rSource.mbUseVirtualDevice; + mbAddExternalLeading = rSource.mbAddExternalLeading; + mbOldLineSpacing = rSource.mbOldLineSpacing; + mbAddParaSpacingToTableCells = rSource.mbAddParaSpacingToTableCells; + mbUseFormerObjectPos = rSource.mbUseFormerObjectPos; + mbUseFormerTextWrapping = rSource.mbUseFormerTextWrapping; + mbConsiderWrapOnObjPos = rSource.mbConsiderWrapOnObjPos; + mbAddFlyOffsets = rSource.mbAddFlyOffsets; + mbOldNumbering = rSource.mbOldNumbering; + mbUseHiResolutionVirtualDevice = rSource.mbUseHiResolutionVirtualDevice; + mbIgnoreFirstLineIndentInNumbering = rSource.mbIgnoreFirstLineIndentInNumbering; + mbDoNotJustifyLinesWithManualBreak = rSource.mbDoNotJustifyLinesWithManualBreak; + mbDoNotResetParaAttrsForNumFont = rSource.mbDoNotResetParaAttrsForNumFont; + mbOutlineLevelYieldsOutlineRule = rSource.mbOutlineLevelYieldsOutlineRule; + mbTableRowKeep = rSource.mbTableRowKeep; + mbIgnoreTabsAndBlanksForLineCalculation = rSource.mbIgnoreTabsAndBlanksForLineCalculation; + mbDoNotCaptureDrawObjsOnPage = rSource.mbDoNotCaptureDrawObjsOnPage; + mbClipAsCharacterAnchoredWriterFlyFrames = rSource.mbClipAsCharacterAnchoredWriterFlyFrames; + mbUnixForceZeroExtLeading = rSource.mbUnixForceZeroExtLeading; + mbOldPrinterMetrics = rSource.mbOldPrinterMetrics; + mbTabRelativeToIndent = rSource.mbTabRelativeToIndent; + mbTabAtLeftIndentForParagraphsInList = rSource.mbTabAtLeftIndentForParagraphsInList; +} + SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const { SwDoc* pRet = new SwDoc; pRet->ReplaceDefaults(*this); - pRet->n32DummyCompatabilityOptions1 = n32DummyCompatabilityOptions1; - pRet->n32DummyCompatabilityOptions2 = n32DummyCompatabilityOptions2; - pRet->mbParaSpaceMax = mbParaSpaceMax ; - pRet->mbParaSpaceMaxAtPages = mbParaSpaceMaxAtPages ; - pRet->mbTabCompat = mbTabCompat ; - pRet->mbUseVirtualDevice = mbUseVirtualDevice ; - pRet->mbAddExternalLeading = mbAddExternalLeading ; - pRet->mbOldLineSpacing = mbOldLineSpacing ; - pRet->mbAddParaSpacingToTableCells = mbAddParaSpacingToTableCells ; - pRet->mbUseFormerObjectPos = mbUseFormerObjectPos ; - pRet->mbUseFormerTextWrapping = mbUseFormerTextWrapping ; - pRet->mbConsiderWrapOnObjPos = mbConsiderWrapOnObjPos ; - pRet->mbAddFlyOffsets = mbAddFlyOffsets ; - pRet->mbOldNumbering = mbOldNumbering ; - pRet->mbUseHiResolutionVirtualDevice = mbUseHiResolutionVirtualDevice ; - pRet->mbIgnoreFirstLineIndentInNumbering = mbIgnoreFirstLineIndentInNumbering ; - pRet->mbDoNotJustifyLinesWithManualBreak = mbDoNotJustifyLinesWithManualBreak ; - pRet->mbDoNotResetParaAttrsForNumFont = mbDoNotResetParaAttrsForNumFont ; - pRet->mbOutlineLevelYieldsOutlineRule = mbOutlineLevelYieldsOutlineRule ; - pRet->mbTableRowKeep = mbTableRowKeep ; - pRet->mbIgnoreTabsAndBlanksForLineCalculation = mbIgnoreTabsAndBlanksForLineCalculation ; - pRet->mbDoNotCaptureDrawObjsOnPage = mbDoNotCaptureDrawObjsOnPage ; - pRet->mbClipAsCharacterAnchoredWriterFlyFrames= mbClipAsCharacterAnchoredWriterFlyFrames; - pRet->mbUnixForceZeroExtLeading = mbUnixForceZeroExtLeading ; - pRet->mbOldPrinterMetrics = mbOldPrinterMetrics ; - pRet->mbTabRelativeToIndent = mbTabRelativeToIndent ; - pRet->mbTabAtLeftIndentForParagraphsInList = mbTabAtLeftIndentForParagraphsInList ; + pRet->ReplaceCompatabilityOptions(*this); - // - // COMPATIBILITY FLAGS END - // - pRet->ReplaceStyles( *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 ) |