diff options
Diffstat (limited to 'sw/source/core/doc/docruby.cxx')
-rw-r--r-- | sw/source/core/doc/docruby.cxx | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx index 759002c3ac4e..564e8d7e6989 100644 --- a/sw/source/core/doc/docruby.cxx +++ b/sw/source/core/doc/docruby.cxx @@ -29,14 +29,16 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include <string.h> // fuer strchr() -#include <hintids.hxx> #include <com/sun/star/i18n/UnicodeType.hdl> #include <com/sun/star/i18n/WordType.hdl> + #include <unotools/charclass.hxx> + +#include <hintids.hxx> #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <docary.hxx> #include <mvsave.hxx> // Strukturen zum Sichern beim Move/Delete #include <ndtxt.hxx> @@ -44,7 +46,6 @@ #include <rubylist.hxx> #include <pam.hxx> #include <swundo.hxx> // fuer die UndoIds -#include <undobj.hxx> #include <breakit.hxx> #include <crsskip.hxx> @@ -60,12 +61,12 @@ using namespace ::com::sun::star::i18n; * * */ -USHORT SwDoc::FillRubyList( const SwPaM& rPam, SwRubyList& rList, - USHORT nMode ) +sal_uInt16 SwDoc::FillRubyList( const SwPaM& rPam, SwRubyList& rList, + sal_uInt16 nMode ) { const SwPaM *_pStartCrsr = (SwPaM*)rPam.GetNext(), *__pStartCrsr = _pStartCrsr; - BOOL bCheckEmpty = &rPam != _pStartCrsr; + sal_Bool bCheckEmpty = &rPam != _pStartCrsr; do { const SwPosition* pStt = _pStartCrsr->Start(), * pEnd = pStt == _pStartCrsr->GetPoint() @@ -106,18 +107,18 @@ USHORT SwDoc::FillRubyList( const SwPaM& rPam, SwRubyList& rList, return rList.Count(); } -USHORT SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList, - USHORT nMode ) +sal_uInt16 SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList, + sal_uInt16 nMode ) { - StartUndo( UNDO_SETRUBYATTR, NULL ); + GetIDocumentUndoRedo().StartUndo( UNDO_SETRUBYATTR, NULL ); SvUShortsSort aDelArr; aDelArr.Insert( RES_TXTATR_CJK_RUBY ); - USHORT nListEntry = 0; + sal_uInt16 nListEntry = 0; const SwPaM *_pStartCrsr = (SwPaM*)rPam.GetNext(), *__pStartCrsr = _pStartCrsr; - BOOL bCheckEmpty = &rPam != _pStartCrsr; + sal_Bool bCheckEmpty = &rPam != _pStartCrsr; do { const SwPosition* pStt = _pStartCrsr->Start(), * pEnd = pStt == _pStartCrsr->GetPoint() @@ -146,7 +147,7 @@ USHORT SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList, } else { - ResetAttrs( aPam, TRUE, &aDelArr ); + ResetAttrs( aPam, sal_True, &aDelArr ); } } @@ -190,12 +191,12 @@ USHORT SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList, } while( 30 > rList.Count() && (_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) != __pStartCrsr ); - EndUndo( UNDO_SETRUBYATTR, NULL ); + GetIDocumentUndoRedo().EndUndo( UNDO_SETRUBYATTR, NULL ); return nListEntry; } -BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT ) +sal_Bool SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, sal_uInt16 ) { // Point must be the startposition, Mark is optional the end position SwPosition* pPos = rPam.GetPoint(); @@ -203,7 +204,7 @@ BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT ) const String* pTxt = &pTNd->GetTxt(); xub_StrLen nStart = pPos->nContent.GetIndex(), nEnd = pTxt->Len(); - BOOL bHasMark = rPam.HasMark(); + sal_Bool bHasMark = rPam.HasMark(); if( bHasMark ) { // in the same node? @@ -219,7 +220,7 @@ BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT ) // ----- search the start // --- look where a ruby attribut starts - USHORT nHtIdx = USHRT_MAX; + sal_uInt16 nHtIdx = USHRT_MAX; const SwpHints* pHts = pTNd->GetpSwpHints(); const SwTxtAttr* pAttr = 0; if( pHts ) @@ -249,7 +250,7 @@ BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT ) *pTxt, nStart, pBreakIt->GetLocale( pTNd->GetLang( nStart )), WordType::ANYWORD_IGNOREWHITESPACES, - TRUE ).startPos; + sal_True ).startPos; if( nWordStt < nStart && -1 != nWordStt ) { nStart = (xub_StrLen)nWordStt; @@ -257,7 +258,7 @@ BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT ) } } - BOOL bAlphaNum = FALSE; + sal_Bool bAlphaNum = sal_False; long nWordEnd = nEnd; CharClass& rCC = GetAppCharClass(); while( nStart < nEnd ) @@ -277,14 +278,14 @@ BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT ) } sal_Int32 nChType = rCC.getType( *pTxt, nStart ); - BOOL bIgnoreChar = FALSE, bIsAlphaNum = FALSE, bChkNxtWrd = FALSE; + sal_Bool bIgnoreChar = sal_False, bIsAlphaNum = sal_False, bChkNxtWrd = sal_False; switch( nChType ) { case UnicodeType::UPPERCASE_LETTER: case UnicodeType::LOWERCASE_LETTER: case UnicodeType::TITLECASE_LETTER: case UnicodeType::DECIMAL_DIGIT_NUMBER: - bChkNxtWrd = bIsAlphaNum = TRUE; + bChkNxtWrd = bIsAlphaNum = sal_True; break; case UnicodeType::SPACE_SEPARATOR: @@ -292,15 +293,15 @@ BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT ) /*??*/ case UnicodeType::PRIVATE_USE: case UnicodeType::START_PUNCTUATION: case UnicodeType::END_PUNCTUATION: - bIgnoreChar = TRUE; + bIgnoreChar = sal_True; break; case UnicodeType::OTHER_LETTER: - bChkNxtWrd = TRUE; + bChkNxtWrd = sal_True; default: - bIsAlphaNum = FALSE; + bIsAlphaNum = sal_False; break; } @@ -320,7 +321,7 @@ BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT ) *pTxt, nStart, pBreakIt->GetLocale( pTNd->GetLang( nStart )), WordType::ANYWORD_IGNOREWHITESPACES, - TRUE ).endPos; + sal_True ).endPos; if( 0 > nWordEnd || nWordEnd > nEnd || nWordEnd == nStart ) nWordEnd = nEnd; } |