summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/doc.hxx2
-rw-r--r--sw/source/core/doc/docfmt.cxx48
-rwxr-xr-xsw/source/ui/dochdl/swdtflvr.cxx2
3 files changed, 32 insertions, 20 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 8165a57b5b72..29be2a7c28e2 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -1275,7 +1275,7 @@ public:
SwGrfFmtColl* CopyGrfColl( const SwGrfFmtColl& rColl );
// Replace all styles with those from rSource.
- void ReplaceStyles( const SwDoc& rSource );
+ void ReplaceStyles( const SwDoc& rSource, bool bIncludePageStyles = true );
// Replace all property defaults with those from rSource.
void ReplaceDefaults( const SwDoc& rSource );
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 10cd5f7e4824..54a970721fda 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -2135,7 +2135,7 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
}
}
-void SwDoc::ReplaceStyles( const SwDoc& rSource )
+void SwDoc::ReplaceStyles( const SwDoc& rSource, bool bIncludePageStyles )
{
::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
@@ -2146,26 +2146,38 @@ void SwDoc::ReplaceStyles( const SwDoc& rSource )
CopyFmtArr( *rSource.pTxtFmtCollTbl, *pTxtFmtCollTbl,
&SwDoc::_MakeTxtFmtColl, *pDfltTxtFmtColl );
- // and now the page templates
- sal_uInt16 nCnt = rSource.aPageDescs.Count();
- if( nCnt )
- {
- // a different Doc -> Number formatter needs to be merged
- SwTblNumFmtMerge aTNFM( rSource, *this );
+ sal_uInt16 nCnt;
- // 1st step: Create all formats (skip the 0th - it's the default!)
- while( nCnt )
+ //To-Do:
+ // a) in rtf export don't export our hideous pgdsctbl
+ // extension to rtf anymore
+ // b) in sd rtf import (View::InsertData) don't use
+ // a super-fragile test for mere presence of \trowd to
+ // indicate import of rtf into a table
+ // c) then drop use of bIncludePageStyles
+ if (bIncludePageStyles)
+ {
+ // and now the page templates
+ nCnt = rSource.aPageDescs.Count();
+ if( nCnt )
{
- SwPageDesc *pSrc = rSource.aPageDescs[ --nCnt ];
- if( 0 == ::lcl_FindPageDesc( aPageDescs, pSrc->GetName() ) )
- MakePageDesc( pSrc->GetName() );
- }
+ // a different Doc -> Number formatter needs to be merged
+ SwTblNumFmtMerge aTNFM( rSource, *this );
- // 2nd step: Copy all attributes, set the right parents
- for( nCnt = rSource.aPageDescs.Count(); nCnt; )
- {
- SwPageDesc *pSrc = rSource.aPageDescs[ --nCnt ];
- CopyPageDesc( *pSrc, *::lcl_FindPageDesc( aPageDescs, pSrc->GetName() ));
+ // 1st step: Create all formats (skip the 0th - it's the default!)
+ while( nCnt )
+ {
+ SwPageDesc *pSrc = rSource.aPageDescs[ --nCnt ];
+ if( 0 == ::lcl_FindPageDesc( aPageDescs, pSrc->GetName() ) )
+ MakePageDesc( pSrc->GetName() );
+ }
+
+ // 2nd step: Copy all attributes, set the right parents
+ for( nCnt = rSource.aPageDescs.Count(); nCnt; )
+ {
+ SwPageDesc *pSrc = rSource.aPageDescs[ --nCnt ];
+ CopyPageDesc( *pSrc, *::lcl_FindPageDesc( aPageDescs, pSrc->GetName() ));
+ }
}
}
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index e5fdd55a98fc..dfa85ed489d3 100755
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -379,7 +379,7 @@ namespace
//It would probably make most sense here to only insert the styles used
//by the selection, e.g. apply SwDoc::IsUsed on styles ?
- rDest.ReplaceStyles(rSrc);
+ rDest.ReplaceStyles(rSrc, false);
rSrcWrtShell.Copy(&rDest);
}