diff options
Diffstat (limited to 'sw/source/core/doc/docruby.cxx')
-rw-r--r-- | sw/source/core/doc/docruby.cxx | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx index 4a707e1fb1af..c8703ab6adcb 100644 --- a/sw/source/core/doc/docruby.cxx +++ b/sw/source/core/doc/docruby.cxx @@ -28,18 +28,16 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include <string.h> // fuer strchr() -#include <hintids.hxx> -#ifndef _COM_SUN_STAR_I18N_UNICODETYPE_HDL #include <com/sun/star/i18n/UnicodeType.hdl> -#endif -#ifndef _COM_SUN_STAR_I18N_WORDTYPE_HDL #include <com/sun/star/i18n/WordType.hdl> -#endif + #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> @@ -47,7 +45,6 @@ #include <rubylist.hxx> #include <pam.hxx> #include <swundo.hxx> // fuer die UndoIds -#include <undobj.hxx> #include <breakit.hxx> #include <crsskip.hxx> @@ -63,12 +60,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() @@ -109,18 +106,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() @@ -149,7 +146,7 @@ USHORT SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList, } else { - ResetAttrs( aPam, TRUE, &aDelArr ); + ResetAttrs( aPam, sal_True, &aDelArr ); } } @@ -193,12 +190,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(); @@ -206,7 +203,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? @@ -222,7 +219,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 ) @@ -252,7 +249,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; @@ -260,7 +257,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 ) @@ -280,14 +277,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: @@ -295,12 +292,12 @@ 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; // no break! // case UnicodeType::UNASSIGNED: // case UnicodeType::MODIFIER_LETTER: @@ -324,7 +321,7 @@ BOOL SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, USHORT ) // case UnicodeType::INITIAL_PUNCTUATION: // case UnicodeType::FINAL_PUNCTUATION: default: - bIsAlphaNum = FALSE; + bIsAlphaNum = sal_False; break; } @@ -344,7 +341,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; } |