diff options
Diffstat (limited to 'sw/source/core/doc/docglbl.cxx')
-rw-r--r-- | sw/source/core/doc/docglbl.cxx | 71 |
1 files changed, 36 insertions, 35 deletions
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index 5ae6629a5715..26d9c75e2140 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -43,6 +43,7 @@ #include <fmtinfmt.hxx> #include <fmtanchr.hxx> #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <docary.hxx> #include <pam.hxx> #include <ndtxt.hxx> @@ -66,32 +67,32 @@ enum SwSplitDocType SPLITDOC_TO_HTML }; -BOOL SwDoc::GenerateGlobalDoc( const String& rPath, +sal_Bool SwDoc::GenerateGlobalDoc( const String& rPath, const SwTxtFmtColl* pSplitColl ) { return SplitDoc( SPLITDOC_TO_GLOBALDOC, rPath, pSplitColl ); } //#outline level,add by zhaojianwei -BOOL SwDoc::GenerateGlobalDoc( const String& rPath, int nOutlineLevel ) +sal_Bool SwDoc::GenerateGlobalDoc( const String& rPath, int nOutlineLevel ) { return SplitDoc( SPLITDOC_TO_GLOBALDOC, rPath, nOutlineLevel ); } -BOOL SwDoc::GenerateHTMLDoc( const String& rPath, int nOutlineLevel ) +sal_Bool SwDoc::GenerateHTMLDoc( const String& rPath, int nOutlineLevel ) { return SplitDoc( SPLITDOC_TO_HTML, rPath, nOutlineLevel ); } //<-end,zhaojianwei -BOOL SwDoc::GenerateHTMLDoc( const String& rPath, +sal_Bool SwDoc::GenerateHTMLDoc( const String& rPath, const SwTxtFmtColl* pSplitColl ) { #ifdef JP_TEST if( !pSplitColl ) { - BYTE nLvl = 1; + sal_uInt8 nLvl = 1; const SwTxtFmtColls& rFmtColls =*GetTxtFmtColls(); - for( USHORT n = rFmtColls.Count(); n; ) + for( sal_uInt16 n = rFmtColls.Count(); n; ) //if( nLvl == rFmtColls[ --n ]->GetOutlineLevel() )//#outline level,zhaojianwei if( nLvl == rFmtColls[ --n ]->GetAttrOutlineLevel() -1 )//<-end,zhaojianwei 0814 { @@ -107,7 +108,7 @@ BOOL SwDoc::GenerateHTMLDoc( const String& rPath, return SplitDoc( SPLITDOC_TO_HTML, rPath, pSplitColl ); } -BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, +sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, const SwTxtFmtColl* pSplitColl ) { // ueber alle Node der Vorlage Iterieren und dafuer einzelne @@ -118,9 +119,9 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, // Am Ende wird dieses Doc als GlobalDoc/HTML-Doc gespreichert. if( !pDocShell || !pDocShell->GetMedium() || ( SPLITDOC_TO_GLOBALDOC == eDocType && get(IDocumentSettingAccess::GLOBAL_DOCUMENT) ) ) - return FALSE; + return sal_False; - USHORT nOutl = 0; + sal_uInt16 nOutl = 0; SwOutlineNodes* pOutlNds = (SwOutlineNodes*)&GetNodes().GetOutLineNds(); SwNodePtr pSttNd; @@ -140,7 +141,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, if( !pOutlNds->Count() ) { delete pOutlNds; - return FALSE; + return sal_False; } } } @@ -148,7 +149,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, { // dann suche die Gliederungs - Vorlage, der 1. Ebene const SwTxtFmtColls& rFmtColls =*GetTxtFmtColls(); - for( USHORT n = rFmtColls.Count(); n; ) + for( sal_uInt16 n = rFmtColls.Count(); n; ) //if( !rFmtColls[ --n ]->GetOutlineLevel() )//#outline level,zhaojianwei if ( rFmtColls[ --n ]->GetAttrOutlineLevel() == 1 )//<-end,zhaojianwei { @@ -157,7 +158,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, } if( !pSplitColl ) - return FALSE; + return sal_False; } const SfxFilter* pFilter; @@ -177,10 +178,10 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, } if( !pFilter ) - return FALSE; + return sal_False; // Undo/Redline aufjedenfall abschalten - DoUndo( FALSE ); + GetIDocumentUndoRedo().DoUndo(false); SetRedlineMode_intern( (RedlineMode_t)(GetRedlineMode() & ~nsRedlineMode_t::REDLINE_ON)); String sExt( pFilter->GetSuffixes().GetToken(0, ',') ); @@ -253,7 +254,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, String sFileName; if( pSttNd->GetIndex() + 1 < aEndIdx.GetIndex() ) { - SfxObjectShellRef xDocSh( new SwDocShell( SFX_CREATE_MODE_INTERNAL )); + SfxObjectShellLock xDocSh( new SwDocShell( SFX_CREATE_MODE_INTERNAL )); if( xDocSh->DoInitNew( 0 ) ) { SwDoc* pDoc = ((SwDocShell*)(&xDocSh))->GetDoc(); @@ -290,7 +291,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, SwNodeRange aRg( *pSttNd, 0, aEndIdx.GetNode() ); SwNodeIndex aTmpIdx( pDoc->GetNodes().GetEndOfContent() ); - GetNodes()._Copy( aRg, aTmpIdx, FALSE ); + GetNodes()._Copy( aRg, aTmpIdx, sal_False ); // den initialen TextNode loeschen SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfExtras(), 2 ); @@ -308,7 +309,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, utl::TempFile aTempFile2(sLeading,&sExt,&sPath ); sFileName = aTempFile2.GetURL(); SfxMedium* pTmpMed = new SfxMedium( sFileName, - STREAM_STD_READWRITE, TRUE ); + STREAM_STD_READWRITE, sal_True ); pTmpMed->SetFilter( pFilter ); // fuer den HTML-Filter mussen wir aber ein Layout @@ -339,7 +340,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, { // loesche alle Nodes im Bereich und setze im "Start- // Node" den Link auf das gespeicherte Doc - ULONG nNodeDiff = aEndIdx.GetIndex() - + sal_uLong nNodeDiff = aEndIdx.GetIndex() - pSttNd->GetIndex() - 1; if( nNodeDiff ) { @@ -356,14 +357,14 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, aTmp.Exchange(); if( !aTmp.Move( fnMoveBackward, fnGoNode )) { - ASSERT( FALSE, "kein Node mehr vorhanden" ); + ASSERT( sal_False, "kein Node mehr vorhanden" ); } } // Bookmarks usw. verschieben - CorrAbs( aSIdx, aEIdx, *aTmp.GetPoint(), TRUE); + CorrAbs( aSIdx, aEIdx, *aTmp.GetPoint(), sal_True); // stehen noch FlyFrames rum, loesche auch diese - for( USHORT n = 0; n < GetSpzFrmFmts()->Count(); ++n ) + for( sal_uInt16 n = 0; n < GetSpzFrmFmts()->Count(); ++n ) { SwFrmFmt* pFly = (*GetSpzFrmFmts())[n]; const SwFmtAnchor* pAnchor = &pFly->GetAnchor(); @@ -420,7 +421,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, if( pSectNd->GetIndex() + 1 == pSttNd->GetIndex() ) { - BOOL bMvIdx = aEndIdx == *pSectEnd; + sal_Bool bMvIdx = aEndIdx == *pSectEnd; DelSectionFmt( pSectNd->GetSection().GetFmt() ); if( bMvIdx ) aEndIdx--; @@ -511,13 +512,13 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, } //#outline level,add by zhaojianwei -BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel ) +sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, int nOutlineLevel ) { if( !pDocShell || !pDocShell->GetMedium() || ( SPLITDOC_TO_GLOBALDOC == eDocType && get(IDocumentSettingAccess::GLOBAL_DOCUMENT) ) ) - return FALSE; + return sal_False; - USHORT nOutl = 0; + sal_uInt16 nOutl = 0; SwOutlineNodes* pOutlNds = (SwOutlineNodes*)&GetNodes().GetOutLineNds(); SwNodePtr pSttNd; @@ -538,10 +539,10 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel ) } if( !pFilter ) - return FALSE; + return sal_False; // Undo/Redline aufjedenfall abschalten - DoUndo( FALSE ); + GetIDocumentUndoRedo().DoUndo(false); SetRedlineMode_intern( (RedlineMode_t)(GetRedlineMode() & ~nsRedlineMode_t::REDLINE_ON)); String sExt( pFilter->GetSuffixes().GetToken(0, ',') ); @@ -604,7 +605,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel ) String sFileName; if( pSttNd->GetIndex() + 1 < aEndIdx.GetIndex() ) { - SfxObjectShellRef xDocSh( new SwDocShell( SFX_CREATE_MODE_INTERNAL )); + SfxObjectShellLock xDocSh( new SwDocShell( SFX_CREATE_MODE_INTERNAL )); if( xDocSh->DoInitNew( 0 ) ) { SwDoc* pDoc = ((SwDocShell*)(&xDocSh))->GetDoc(); @@ -641,7 +642,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel ) SwNodeRange aRg( *pSttNd, 0, aEndIdx.GetNode() ); SwNodeIndex aTmpIdx( pDoc->GetNodes().GetEndOfContent() ); - GetNodes()._Copy( aRg, aTmpIdx, FALSE ); + GetNodes()._Copy( aRg, aTmpIdx, sal_False ); // den initialen TextNode loeschen SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfExtras(), 2 ); @@ -659,7 +660,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel ) utl::TempFile aTempFile2(sLeading,&sExt,&sPath ); sFileName = aTempFile2.GetURL(); SfxMedium* pTmpMed = new SfxMedium( sFileName, - STREAM_STD_READWRITE, TRUE ); + STREAM_STD_READWRITE, sal_True ); pTmpMed->SetFilter( pFilter ); // fuer den HTML-Filter mussen wir aber ein Layout @@ -690,7 +691,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel ) { // loesche alle Nodes im Bereich und setze im "Start- // Node" den Link auf das gespeicherte Doc - ULONG nNodeDiff = aEndIdx.GetIndex() - + sal_uLong nNodeDiff = aEndIdx.GetIndex() - pSttNd->GetIndex() - 1; if( nNodeDiff ) { @@ -707,14 +708,14 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel ) aTmp.Exchange(); if( !aTmp.Move( fnMoveBackward, fnGoNode )) { - ASSERT( FALSE, "kein Node mehr vorhanden" ); + ASSERT( sal_False, "kein Node mehr vorhanden" ); } } // Bookmarks usw. verschieben - CorrAbs( aSIdx, aEIdx, *aTmp.GetPoint(), TRUE); + CorrAbs( aSIdx, aEIdx, *aTmp.GetPoint(), sal_True); // stehen noch FlyFrames rum, loesche auch diese - for( USHORT n = 0; n < GetSpzFrmFmts()->Count(); ++n ) + for( sal_uInt16 n = 0; n < GetSpzFrmFmts()->Count(); ++n ) { SwFrmFmt* pFly = (*GetSpzFrmFmts())[n]; const SwFmtAnchor* pAnchor = &pFly->GetAnchor(); @@ -771,7 +772,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel ) if( pSectNd->GetIndex() + 1 == pSttNd->GetIndex() ) { - BOOL bMvIdx = aEndIdx == *pSectEnd; + sal_Bool bMvIdx = aEndIdx == *pSectEnd; DelSectionFmt( pSectNd->GetSection().GetFmt() ); if( bMvIdx ) aEndIdx--; |