diff options
Diffstat (limited to 'sw/source/core/edit/edtox.cxx')
-rw-r--r-- | sw/source/core/edit/edtox.cxx | 100 |
1 files changed, 51 insertions, 49 deletions
diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index 90fb4ad5cc81..b09b57d50b9a 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -27,38 +27,40 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include <com/sun/star/util/SearchOptions.hpp> #include <com/sun/star/util/SearchFlags.hpp> #include <com/sun/star/i18n/TransliterationModules.hpp> - #include <tools/urlobj.hxx> -#include <svtools/txtcmp.hxx> -#ifndef SVTOOLS_FSTATHELPER_HXX + #include <svl/fstathelper.hxx> -#endif + +#include <svtools/txtcmp.hxx> + #include <sfx2/docfile.hxx> -#include "editeng/unolingu.hxx" + +#include <xmloff/odffields.hxx> + +#include <editeng/unolingu.hxx> + #include <swtypes.hxx> #include <editsh.hxx> #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <pam.hxx> #include <viewopt.hxx> #include <ndtxt.hxx> #include <errhdl.hxx> #include <swundo.hxx> -#include <undobj.hxx> #include <txttxmrk.hxx> #include <edimp.hxx> #include <tox.hxx> #include <doctxm.hxx> #include <docary.hxx> #include <mdiexp.hxx> -#ifndef _STATSTR_HRC #include <statstr.hrc> -#endif #include <bookmrk.hxx> -#include <xmloff/odffields.hxx> using namespace ::com::sun::star; @@ -73,7 +75,7 @@ using namespace ::com::sun::star::util; void SwEditShell::Insert(const SwTOXMark& rMark) { - BOOL bInsAtPos = rMark.IsAlternativeText(); + sal_Bool bInsAtPos = rMark.IsAlternativeText(); StartAllAction(); FOREACHPAM_START(this) @@ -111,7 +113,7 @@ void SwEditShell::DeleteTOXMark( SwTOXMark* pMark ) Beschreibung: Alle Verzeichnismarkierungen am SPoint zusammensuchen --------------------------------------------------------------------*/ -USHORT SwEditShell::GetCurTOXMarks(SwTOXMarks& rMarks) const +sal_uInt16 SwEditShell::GetCurTOXMarks(SwTOXMarks& rMarks) const { return GetDoc()->GetCurTOXMark( *GetCrsr()->Start(), rMarks ); } @@ -119,7 +121,7 @@ USHORT SwEditShell::GetCurTOXMarks(SwTOXMarks& rMarks) const /* -----------------01.09.99 16:05------------------- --------------------------------------------------*/ -BOOL SwEditShell::IsTOXBaseReadonly(const SwTOXBase& rTOXBase) const +sal_Bool SwEditShell::IsTOXBaseReadonly(const SwTOXBase& rTOXBase) const { ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" ); const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase; @@ -128,7 +130,7 @@ BOOL SwEditShell::IsTOXBaseReadonly(const SwTOXBase& rTOXBase) const /* -----------------18.10.99 15:53------------------- --------------------------------------------------*/ -void SwEditShell::SetTOXBaseReadonly(const SwTOXBase& rTOXBase, BOOL bReadonly) +void SwEditShell::SetTOXBaseReadonly(const SwTOXBase& rTOXBase, sal_Bool bReadonly) { ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" ); const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase; @@ -143,7 +145,7 @@ void SwEditShell::SetTOXBaseReadonly(const SwTOXBase& rTOXBase, BOOL bReadonly) /* -----------------02.09.99 07:47------------------- --------------------------------------------------*/ -const SwTOXBase* SwEditShell::GetDefaultTOXBase( TOXTypes eTyp, BOOL bCreate ) +const SwTOXBase* SwEditShell::GetDefaultTOXBase( TOXTypes eTyp, sal_Bool bCreate ) { return GetDoc()->GetDefaultTOXBase( eTyp, bCreate ); } @@ -170,7 +172,7 @@ void SwEditShell::InsertTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet ) // Einfuegen des Verzeichnisses const SwTOXBaseSection* pTOX = pDoc->InsertTableOf( - *GetCrsr()->GetPoint(), rTOX, pSet, TRUE ); + *GetCrsr()->GetPoint(), rTOX, pSet, sal_True ); ASSERT(pTOX, "Kein aktuelles Verzeichnis"); // Formatierung anstossen @@ -191,9 +193,9 @@ void SwEditShell::InsertTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet ) Beschreibung: Verzeichnisinhalt erneuern --------------------------------------------------------------------*/ -BOOL SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet ) +sal_Bool SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; ASSERT( rTOX.ISA( SwTOXBaseSection ), "keine TOXBaseSection!" ); SwTOXBaseSection* pTOX = (SwTOXBaseSection*)&rTOX; @@ -204,14 +206,14 @@ BOOL SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet ) SwDoc* pMyDoc = GetDoc(); SwDocShell* pDocSh = pMyDoc->GetDocShell(); - BOOL bInIndex = pTOX == GetCurTOX(); + sal_Bool bInIndex = pTOX == GetCurTOX(); SET_CURR_SHELL( this ); StartAllAction(); ::StartProgress( STR_STATSTR_TOX_UPDATE, 0, 0, pDocSh ); ::SetProgressText( STR_STATSTR_TOX_UPDATE, pDocSh ); - pMyDoc->StartUndo(UNDO_TOXCHANGE, NULL); + pMyDoc->GetIDocumentUndoRedo().StartUndo(UNDO_TOXCHANGE, NULL); // Verzeichnisrumpf erzeugen pTOX->Update(pSet); @@ -226,7 +228,7 @@ BOOL SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet ) // Seitennummern eintragen pTOX->UpdatePageNum(); - pMyDoc->EndUndo(UNDO_TOXCHANGE, NULL); + pMyDoc->GetIDocumentUndoRedo().EndUndo(UNDO_TOXCHANGE, NULL); ::EndProgress( pDocSh ); EndAllAction(); @@ -244,7 +246,7 @@ const SwTOXBase* SwEditShell::GetCurTOX() const return GetDoc()->GetCurTOX( *GetCrsr()->GetPoint() ); } -BOOL SwEditShell::DeleteTOX( const SwTOXBase& rTOXBase, BOOL bDelNodes ) +sal_Bool SwEditShell::DeleteTOX( const SwTOXBase& rTOXBase, sal_Bool bDelNodes ) { return GetDoc()->DeleteTOX( (SwTOXBase&)rTOXBase, bDelNodes ); } @@ -253,7 +255,7 @@ BOOL SwEditShell::DeleteTOX( const SwTOXBase& rTOXBase, BOOL bDelNodes ) Beschreibung: Typen der Verzeichnisse verwalten --------------------------------------------------------------------*/ -const SwTOXType* SwEditShell::GetTOXType(TOXTypes eTyp, USHORT nId) const +const SwTOXType* SwEditShell::GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const { return pDoc->GetTOXType(eTyp, nId); } @@ -262,17 +264,17 @@ const SwTOXType* SwEditShell::GetTOXType(TOXTypes eTyp, USHORT nId) const Beschreibung: Schluessel fuer Stichwortverzeichnisse verwalten --------------------------------------------------------------------*/ -USHORT SwEditShell::GetTOIKeys( SwTOIKeyType eTyp, SvStringsSort& rArr ) const +sal_uInt16 SwEditShell::GetTOIKeys( SwTOIKeyType eTyp, SvStringsSort& rArr ) const { return GetDoc()->GetTOIKeys( eTyp, rArr ); } -USHORT SwEditShell::GetTOXCount() const +sal_uInt16 SwEditShell::GetTOXCount() const { const SwSectionFmts& rFmts = GetDoc()->GetSections(); - USHORT nRet = 0; - for( USHORT n = rFmts.Count(); n; ) + sal_uInt16 nRet = 0; + for( sal_uInt16 n = rFmts.Count(); n; ) { const SwSection* pSect = rFmts[ --n ]->GetSection(); if( TOX_CONTENT_SECTION == pSect->GetType() && @@ -283,10 +285,10 @@ USHORT SwEditShell::GetTOXCount() const } -const SwTOXBase* SwEditShell::GetTOX( USHORT nPos ) const +const SwTOXBase* SwEditShell::GetTOX( sal_uInt16 nPos ) const { const SwSectionFmts& rFmts = GetDoc()->GetSections(); - for( USHORT n = 0, nCnt = 0; n < rFmts.Count(); ++n ) + for( sal_uInt16 n = 0, nCnt = 0; n < rFmts.Count(); ++n ) { const SwSection* pSect = rFmts[ n ]->GetSection(); if( TOX_CONTENT_SECTION == pSect->GetType() && @@ -302,13 +304,13 @@ const SwTOXBase* SwEditShell::GetTOX( USHORT nPos ) const // nach einlesen einer Datei alle Verzeichnisse updaten -void SwEditShell::SetUpdateTOX( BOOL bFlag ) +void SwEditShell::SetUpdateTOX( sal_Bool bFlag ) { GetDoc()->SetUpdateTOX( bFlag ); } -BOOL SwEditShell::IsUpdateTOX() const +sal_Bool SwEditShell::IsUpdateTOX() const { return GetDoc()->IsUpdateTOX(); } @@ -333,8 +335,8 @@ void SwEditShell::SetTOIAutoMarkURL(const String& rSet) void SwEditShell::ApplyAutoMark() { StartAllAction(); - BOOL bDoesUndo = DoesUndo(); - DoUndo(FALSE); + sal_Bool bDoesUndo = DoesUndo(); + DoUndo(sal_False); //1. remove all automatic generated index entries if AutoMarkURL has a // length and the file exists //2. load file @@ -358,7 +360,7 @@ void SwEditShell::ApplyAutoMark() } //2. - SfxMedium aMedium( sAutoMarkURL, STREAM_STD_READ, TRUE ); + SfxMedium aMedium( sAutoMarkURL, STREAM_STD_READ, sal_True ); SvStream& rStrm = *aMedium.GetInStream(); const String sZero('0'); Push(); @@ -369,16 +371,16 @@ void SwEditShell::ApplyAutoMark() // //SearchAlgorithms eSrchType = SearchAlgorithms_ABSOLUTE; //OUString aSrchStr = rText; - BOOL bCaseSensitive = TRUE; - BOOL bWordOnly = FALSE; - BOOL bSrchInSel = FALSE; - BOOL bLEV_Relaxed = TRUE; - INT32 nLEV_Other = 2; // -> changedChars; - INT32 nLEV_Longer = 3; //! -> deletedChars; - INT32 nLEV_Shorter = 1; //! -> insertedChars; - INT32 nTransliterationFlags = 0; + sal_Bool bCaseSensitive = sal_True; + sal_Bool bWordOnly = sal_False; + sal_Bool bSrchInSel = sal_False; + sal_Bool bLEV_Relaxed = sal_True; + sal_Int32 nLEV_Other = 2; // -> changedChars; + sal_Int32 nLEV_Longer = 3; //! -> deletedChars; + sal_Int32 nLEV_Shorter = 1; //! -> insertedChars; + sal_Int32 nTransliterationFlags = 0; // - INT32 nSrchFlags = 0; + sal_Int32 nSrchFlags = 0; if (!bCaseSensitive) { nSrchFlags |= SearchFlags::ALL_IGNORE_CASE; @@ -447,13 +449,13 @@ void SwEditShell::ApplyAutoMark() aSearchOpt.searchString = sToSelect; KillPams(); - BOOL bCancel; + sal_Bool bCancel; // todo/mba: assuming that notes shouldn't be searched - BOOL bSearchInNotes = FALSE; - ULONG nRet = Find( aSearchOpt, bSearchInNotes, DOCPOS_START, DOCPOS_END, bCancel, + sal_Bool bSearchInNotes = sal_False; + sal_uLong nRet = Find( aSearchOpt, bSearchInNotes, DOCPOS_START, DOCPOS_END, bCancel, (FindRanges)(FND_IN_SELALL|FND_IN_BODYONLY), - FALSE ); + sal_False ); if(nRet) { @@ -466,8 +468,8 @@ void SwEditShell::ApplyAutoMark() } if(sAlternative.Len()) pTmpMark->SetAlternativeText(sAlternative); - pTmpMark->SetMainEntry(FALSE); - pTmpMark->SetAutoGenerated(TRUE); + pTmpMark->SetMainEntry(sal_False); + pTmpMark->SetAutoGenerated(sal_True); //4. SwEditShell::Insert(*pTmpMark); } @@ -475,7 +477,7 @@ void SwEditShell::ApplyAutoMark() } } KillPams(); - Pop(FALSE); + Pop(sal_False); } DoUndo(bDoesUndo); EndAllAction(); |