summaryrefslogtreecommitdiff
path: root/sw/source/core/txtnode/txtedt.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/txtnode/txtedt.cxx')
-rw-r--r--sw/source/core/txtnode/txtedt.cxx239
1 files changed, 124 insertions, 115 deletions
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 6ab9545e451e..bfb76e8a552d 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -62,7 +62,7 @@
#include <txttypes.hxx>
#include <breakit.hxx>
#include <crstate.hxx>
-#include <undobj.hxx>
+#include <UndoOverwrite.hxx>
#include <txatritr.hxx>
#include <redline.hxx> // SwRedline
#include <docary.hxx> // SwRedlineTbl
@@ -111,14 +111,14 @@ bool lcl_IsSkippableWhiteSpace( xub_Unicode cCh )
* only for deleted redlines
*/
-USHORT lcl_MaskRedlines( const SwTxtNode& rNode, XubString& rText,
+sal_uInt16 lcl_MaskRedlines( const SwTxtNode& rNode, XubString& rText,
const xub_StrLen nStt, const xub_StrLen nEnd,
const xub_Unicode cChar )
{
- USHORT nNumOfMaskedRedlines = 0;
+ sal_uInt16 nNumOfMaskedRedlines = 0;
const SwDoc& rDoc = *rNode.GetDoc();
- USHORT nAct = rDoc.GetRedlinePos( rNode, USHRT_MAX );
+ sal_uInt16 nAct = rDoc.GetRedlinePos( rNode, USHRT_MAX );
for ( ; nAct < rDoc.GetRedlineTbl().Count(); nAct++ )
{
@@ -156,13 +156,13 @@ USHORT lcl_MaskRedlines( const SwTxtNode& rNode, XubString& rText,
* Used for spell checking. Deleted redlines and hidden characters are masked
*/
-USHORT lcl_MaskRedlinesAndHiddenText( const SwTxtNode& rNode, XubString& rText,
+sal_uInt16 lcl_MaskRedlinesAndHiddenText( const SwTxtNode& rNode, XubString& rText,
const xub_StrLen nStt, const xub_StrLen nEnd,
const xub_Unicode cChar = CH_TXTATR_INWORD,
bool bCheckShowHiddenChar = true )
{
- USHORT nRedlinesMasked = 0;
- USHORT nHiddenCharsMasked = 0;
+ sal_uInt16 nRedlinesMasked = 0;
+ sal_uInt16 nHiddenCharsMasked = 0;
const SwDoc& rDoc = *rNode.GetDoc();
const bool bShowChg = 0 != IDocumentRedlineAccess::IsShowChanges( rDoc.GetRedlineMode() );
@@ -258,13 +258,13 @@ static SwRect lcl_CalculateRepaintRect( SwTxtFrm& rTxtFrm, xub_StrLen nChgStart,
delete pSt2Pos;
}
- BOOL bSameFrame = TRUE;
+ sal_Bool bSameFrame = sal_True;
if( rTxtFrm.HasFollow() )
{
if( pEndFrm != pStartFrm )
{
- bSameFrame = FALSE;
+ bSameFrame = sal_False;
SwRect aStFrm( pStartFrm->PaintArea() );
{
SWRECTFN( pStartFrm )
@@ -280,7 +280,7 @@ static SwRect lcl_CalculateRepaintRect( SwTxtFrm& rTxtFrm, xub_StrLen nChgStart,
(aRect.*fnRect->fnSetRight)( (aStFrm.*fnRect->fnGetRight)() );
}
aRect.Union( aTmp );
- while( TRUE )
+ while( sal_True )
{
pStartFrm = pStartFrm->GetFollow();
if( pStartFrm == pEndFrm )
@@ -315,7 +315,7 @@ static SwRect lcl_CalculateRepaintRect( SwTxtFrm& rTxtFrm, xub_StrLen nChgStart,
static bool lcl_HaveCommonAttributes( IStyleAccess& rStyleAccess,
const SfxItemSet* pSet1,
- USHORT nWhichId,
+ sal_uInt16 nWhichId,
const SfxItemSet& rSet2,
boost::shared_ptr<SfxItemSet>& pStyleHandle )
{
@@ -326,9 +326,9 @@ static bool lcl_HaveCommonAttributes( IStyleAccess& rStyleAccess,
if ( !pSet1 )
{
OSL_ENSURE( nWhichId, "lcl_HaveCommonAttributes not used correctly" );
- if ( SFX_ITEM_SET == rSet2.GetItemState( nWhichId, FALSE ) )
+ if ( SFX_ITEM_SET == rSet2.GetItemState( nWhichId, sal_False ) )
{
- pNewSet = rSet2.Clone( TRUE );
+ pNewSet = rSet2.Clone( sal_True );
pNewSet->ClearItem( nWhichId );
}
}
@@ -336,12 +336,12 @@ static bool lcl_HaveCommonAttributes( IStyleAccess& rStyleAccess,
{
SfxItemIter aIter( *pSet1 );
const SfxPoolItem* pItem = aIter.GetCurItem();
- while( TRUE )
+ while( sal_True )
{
- if ( SFX_ITEM_SET == rSet2.GetItemState( pItem->Which(), FALSE ) )
+ if ( SFX_ITEM_SET == rSet2.GetItemState( pItem->Which(), sal_False ) )
{
if ( !pNewSet )
- pNewSet = rSet2.Clone( TRUE );
+ pNewSet = rSet2.Clone( sal_True );
pNewSet->ClearItem( pItem->Which() );
}
@@ -363,12 +363,12 @@ static bool lcl_HaveCommonAttributes( IStyleAccess& rStyleAccess,
return bRet;
}
-inline BOOL InRange(xub_StrLen nIdx, xub_StrLen nStart, xub_StrLen nEnd) {
+inline sal_Bool InRange(xub_StrLen nIdx, xub_StrLen nStart, xub_StrLen nEnd) {
return ((nIdx >=nStart) && (nIdx <= nEnd));
}
/*
- * void SwTxtNode::RstAttr(const SwIndex &rIdx, USHORT nLen)
+ * void SwTxtNode::RstAttr(const SwIndex &rIdx, sal_uInt16 nLen)
*
* Deletes all attributes, starting at position rIdx, for length nLen.
*/
@@ -388,26 +388,26 @@ inline BOOL InRange(xub_StrLen nIdx, xub_StrLen nStart, xub_StrLen nEnd) {
* -> nothing to do
*/
-void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich,
- const SfxItemSet* pSet, BOOL bInclRefToxMark )
+void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, sal_uInt16 nWhich,
+ const SfxItemSet* pSet, sal_Bool bInclRefToxMark )
{
// Attribute?
if ( !GetpSwpHints() )
return;
- USHORT i = 0;
+ sal_uInt16 i = 0;
xub_StrLen nStt = rIdx.GetIndex();
xub_StrLen nEnd = nStt + nLen;
xub_StrLen nAttrStart;
SwTxtAttr *pHt;
- BOOL bChanged = FALSE;
+ sal_Bool bChanged = sal_False;
// nMin and nMax initialized to maximum / minimum (inverse)
xub_StrLen nMin = m_Text.Len();
xub_StrLen nMax = nStt;
- const BOOL bNoLen = !nMin;
+ const sal_Bool bNoLen = !nMin;
// We have to remember the "new" attributes, which have
// been introduced by splitting surrounding attributes (case 4).
@@ -436,7 +436,7 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich,
// 1. case: We want to reset only the attributes listed in pSet:
if ( pSet )
{
- bSkipAttr = SFX_ITEM_SET != pSet->GetItemState( pHt->Which(), FALSE );
+ bSkipAttr = SFX_ITEM_SET != pSet->GetItemState( pHt->Which(), sal_False );
if ( bSkipAttr && RES_TXTATR_AUTOFMT == pHt->Which() )
{
// if the current attribute is an autostyle, we have to check if the autostyle
@@ -517,7 +517,7 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich,
{
m_pSwpHints->NoteInHistory( pHt );
*pHt->GetStart() = nEnd;
- m_pSwpHints->NoteInHistory( pHt, TRUE );
+ m_pSwpHints->NoteInHistory( pHt, sal_True );
if ( pStyleHandle.get() && nAttrStart < nEnd )
{
@@ -526,7 +526,7 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich,
InsertHint( pNew, nsSetAttrMode::SETATTR_NOHINTADJUST );
}
- bChanged = TRUE;
+ bChanged = sal_True;
}
}
}
@@ -539,13 +539,13 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich,
nMin = nAttrStart;
if ( nMax < *pAttrEnd )
nMax = *pAttrEnd;
- bChanged = TRUE;
+ bChanged = sal_True;
const xub_StrLen nAttrEnd = *pAttrEnd;
m_pSwpHints->NoteInHistory( pHt );
*pAttrEnd = nStt;
- m_pSwpHints->NoteInHistory( pHt, TRUE );
+ m_pSwpHints->NoteInHistory( pHt, sal_True );
if ( pStyleHandle.get() )
{
@@ -561,11 +561,11 @@ void SwTxtNode::RstAttr(const SwIndex &rIdx, xub_StrLen nLen, USHORT nWhich,
nMin = nAttrStart;
if ( nMax < *pAttrEnd )
nMax = *pAttrEnd;
- bChanged = TRUE;
+ bChanged = sal_True;
xub_StrLen nTmpEnd = *pAttrEnd;
m_pSwpHints->NoteInHistory( pHt );
*pAttrEnd = nStt;
- m_pSwpHints->NoteInHistory( pHt, TRUE );
+ m_pSwpHints->NoteInHistory( pHt, sal_True );
if ( pStyleHandle.get() && nStt < nEnd )
{
@@ -637,13 +637,13 @@ XubString SwTxtNode::GetCurWord( xub_StrLen nPos ) const
sal_Int16 nWordType = WordType::DICTIONARY_WORD;
lang::Locale aLocale( pBreakIt->GetLocale( GetLang( nPos ) ) );
#ifdef DEBUG
- BOOL bBegin = rxBreak->isBeginWord( m_Text, nPos, aLocale, nWordType );
- BOOL bEnd = rxBreak->isEndWord ( m_Text, nPos, aLocale, nWordType );
+ sal_Bool bBegin = rxBreak->isBeginWord( m_Text, nPos, aLocale, nWordType );
+ sal_Bool bEnd = rxBreak->isEndWord ( m_Text, nPos, aLocale, nWordType );
(void)bBegin;
(void)bEnd;
#endif
aBndry =
- rxBreak->getWordBoundary( m_Text, nPos, aLocale, nWordType, TRUE );
+ rxBreak->getWordBoundary( m_Text, nPos, aLocale, nWordType, sal_True );
// if no word was found use previous word (if any)
if (aBndry.startPos == aBndry.endPos)
@@ -663,7 +663,7 @@ XubString SwTxtNode::GetCurWord( xub_StrLen nPos ) const
SwScanner::SwScanner( const SwTxtNode& rNd, const String& rTxt, const LanguageType* pLang,
const ModelToViewHelper::ConversionMap* pConvMap,
- USHORT nType, xub_StrLen nStart, xub_StrLen nEnde, BOOL bClp )
+ sal_uInt16 nType, xub_StrLen nStart, xub_StrLen nEnde, sal_Bool bClp )
: rNode( rNd ), rText( rTxt), pLanguage( pLang ), pConversionMap( pConvMap ), nLen( 0 ), nWordType( nType ), bClip( bClp )
{
OSL_ENSURE( rText.Len(), "SwScanner: EmptyString" );
@@ -682,7 +682,7 @@ SwScanner::SwScanner( const SwTxtNode& rNd, const String& rTxt, const LanguageTy
}
}
-BOOL SwScanner::NextWord()
+sal_Bool SwScanner::NextWord()
{
nBegin = nBegin + nLen;
Boundary aBound;
@@ -699,7 +699,7 @@ BOOL SwScanner::NextWord()
{
if ( !pLanguage )
{
- const USHORT nNextScriptType = pBreakIt->GetBreakIter()->getScriptType( rText, nBegin );
+ const sal_uInt16 nNextScriptType = pBreakIt->GetBreakIter()->getScriptType( rText, nBegin );
ModelToViewHelper::ModelPosition aModelBeginPos = ModelToViewHelper::ConvertToModelPosition( pConversionMap, nBegin );
const xub_StrLen nBeginModelPos = (xub_StrLen)aModelBeginPos.mnPos;
aCurrLang = rNode.GetLang( nBeginModelPos, 1, nNextScriptType );
@@ -718,15 +718,16 @@ BOOL SwScanner::NextWord()
}
if ( nBegin >= rText.Len() || nBegin >= nEndPos )
- return FALSE;
+ return sal_False;
// get the word boundaries
aBound = pBreakIt->GetBreakIter()->getWordBoundary( rText, nBegin,
pBreakIt->GetLocale( aCurrLang ), nWordType, sal_True );
+ OSL_ENSURE( aBound.endPos >= aBound.startPos, "broken aBound result" );
//no word boundaries could be found
if(aBound.endPos == aBound.startPos)
- return FALSE;
+ return sal_False;
//if a word before is found it has to be searched for the next
if(aBound.endPos == nBegin)
@@ -737,46 +738,54 @@ BOOL SwScanner::NextWord()
rCC.setLocale( aOldLocale );
- // we have to differenciate between these cases:
- if ( aBound.startPos <= nBegin )
+ // #i89042, as discussed with HDU: don't evaluate script changes for word count. Use whole word.
+ if ( nWordType == i18n::WordType::WORD_COUNT )
{
+ nBegin = Max( static_cast< xub_StrLen >(aBound.startPos), nBegin );
+ nLen = 0;
+ if (static_cast< xub_StrLen >(aBound.endPos) > nBegin)
+ nLen = static_cast< xub_StrLen >(aBound.endPos) - nBegin;
+ }
+ else
+ {
+ // we have to differenciate between these cases:
+ if ( aBound.startPos <= nBegin )
+ {
OSL_ENSURE( aBound.endPos >= nBegin, "Unexpected aBound result" );
- // restrict boundaries to script boundaries and nEndPos
- const USHORT nCurrScript =
- pBreakIt->GetBreakIter()->getScriptType( rText, nBegin );
+ // restrict boundaries to script boundaries and nEndPos
+ const sal_uInt16 nCurrScript = pBreakIt->GetBreakIter()->getScriptType( rText, nBegin );
+ XubString aTmpWord = rText.Copy( nBegin, static_cast<xub_StrLen>(aBound.endPos - nBegin) );
+ const sal_Int32 nScriptEnd = nBegin +
+ pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript );
+ const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd );
- XubString aTmpWord = rText.Copy( nBegin, static_cast<xub_StrLen>(aBound.endPos - nBegin) );
- const sal_Int32 nScriptEnd = nBegin +
- pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript );
- const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd );
+ // restrict word start to last script change position
+ sal_Int32 nScriptBegin = 0;
+ if ( aBound.startPos < nBegin )
+ {
+ // search from nBegin backwards until the next script change
+ aTmpWord = rText.Copy( static_cast<xub_StrLen>(aBound.startPos),
+ static_cast<xub_StrLen>(nBegin - aBound.startPos + 1) );
+ nScriptBegin = aBound.startPos +
+ pBreakIt->GetBreakIter()->beginOfScript( aTmpWord, nBegin - aBound.startPos,
+ nCurrScript );
+ }
- // restrict word start to last script change position
- sal_Int32 nScriptBegin = 0;
- if ( aBound.startPos < nBegin )
+ nBegin = (xub_StrLen)Max( aBound.startPos, nScriptBegin );
+ nLen = (xub_StrLen)(nEnd - nBegin);
+ }
+ else
{
- // search from nBegin backwards until the next script change
- aTmpWord = rText.Copy( static_cast<xub_StrLen>(aBound.startPos),
- static_cast<xub_StrLen>(nBegin - aBound.startPos + 1) );
- nScriptBegin = aBound.startPos +
- pBreakIt->GetBreakIter()->beginOfScript( aTmpWord, nBegin - aBound.startPos,
- nCurrScript );
+ const sal_uInt16 nCurrScript = pBreakIt->GetBreakIter()->getScriptType( rText, aBound.startPos );
+ XubString aTmpWord = rText.Copy( static_cast<xub_StrLen>(aBound.startPos),
+ static_cast<xub_StrLen>(aBound.endPos - aBound.startPos) );
+ const sal_Int32 nScriptEnd = aBound.startPos +
+ pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript );
+ const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd );
+ nBegin = (xub_StrLen)aBound.startPos;
+ nLen = (xub_StrLen)(nEnd - nBegin);
}
-
- nBegin = (xub_StrLen)Max( aBound.startPos, nScriptBegin );
- nLen = (xub_StrLen)(nEnd - nBegin);
- }
- else
- {
- const USHORT nCurrScript =
- pBreakIt->GetBreakIter()->getScriptType( rText, aBound.startPos );
- XubString aTmpWord = rText.Copy( static_cast<xub_StrLen>(aBound.startPos),
- static_cast<xub_StrLen>(aBound.endPos - aBound.startPos) );
- const sal_Int32 nScriptEnd = aBound.startPos +
- pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript );
- const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd );
- nBegin = (xub_StrLen)aBound.startPos;
- nLen = (xub_StrLen)(nEnd - nBegin);
}
// optionally clip the result of getWordBoundaries:
@@ -789,14 +798,14 @@ BOOL SwScanner::NextWord()
}
if( ! nLen )
- return FALSE;
+ return sal_False;
aWord = rText.Copy( nBegin, nLen );
- return TRUE;
+ return sal_True;
}
-USHORT SwTxtNode::Spell(SwSpellArgs* pArgs)
+sal_uInt16 SwTxtNode::Spell(SwSpellArgs* pArgs)
{
// Die Aehnlichkeiten zu SwTxtFrm::_AutoSpell sind beabsichtigt ...
// ACHTUNG: Ev. Bugs in beiden Routinen fixen!
@@ -924,8 +933,8 @@ USHORT SwTxtNode::Spell(SwSpellArgs* pArgs)
}
void SwTxtNode::SetLanguageAndFont( const SwPaM &rPaM,
- LanguageType nLang, USHORT nLangWhichId,
- const Font *pFont, USHORT nFontWhichId )
+ LanguageType nLang, sal_uInt16 nLangWhichId,
+ const Font *pFont, sal_uInt16 nFontWhichId )
{
sal_uInt16 aRanges[] = {
nLangWhichId, nLangWhichId,
@@ -958,7 +967,7 @@ void SwTxtNode::SetLanguageAndFont( const SwPaM &rPaM,
}
-USHORT SwTxtNode::Convert( SwConversionArgs &rArgs )
+sal_uInt16 SwTxtNode::Convert( SwConversionArgs &rArgs )
{
// get range of text within node to be converted
// (either all the text or the the text within the selection
@@ -1089,7 +1098,7 @@ SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rV
{
SwRect aRect;
#if OSL_DEBUG_LEVEL > 1
- static BOOL bStop = FALSE;
+ static sal_Bool bStop = sal_False;
if ( bStop )
return aRect;
#endif
@@ -1144,7 +1153,7 @@ SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rV
Boundary aBound =
pBreakIt->GetBreakIter()->getWordBoundary( pNode->GetTxt(), nBegin,
pBreakIt->GetLocale( eActLang ),
- WordType::DICTIONARY_WORD, TRUE );
+ WordType::DICTIONARY_WORD, sal_True );
nBegin = xub_StrLen(aBound.startPos);
}
@@ -1158,7 +1167,7 @@ SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rV
nInsertPos++;
}
- BOOL bFresh = nBegin < nEnd;
+ sal_Bool bFresh = nBegin < nEnd;
if( nBegin < nEnd )
{
@@ -1184,8 +1193,8 @@ SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rV
// within the word
LanguageType eActLang = aScanner.GetCurrentLanguage();
- BOOL bSpell = TRUE;
- bSpell = xSpell.is() ? xSpell->hasLanguage( eActLang ) : FALSE;
+ sal_Bool bSpell = sal_True;
+ bSpell = xSpell.is() ? xSpell->hasLanguage( eActLang ) : sal_False;
if( bSpell && rWord.Len() > 0 )
{
// check for: bAlter => xHyphWord.is()
@@ -1304,16 +1313,16 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/
}
}
- const USHORT nNumberOfEntries = pSmartTagList ? pSmartTagList->Count() : 0;
- USHORT nNumberOfRemovedEntries = 0;
- USHORT nNumberOfInsertedEntries = 0;
+ const sal_uInt16 nNumberOfEntries = pSmartTagList ? pSmartTagList->Count() : 0;
+ sal_uInt16 nNumberOfRemovedEntries = 0;
+ sal_uInt16 nNumberOfInsertedEntries = 0;
// clear smart tag list between nBegin and nEnd:
if ( 0 != nNumberOfEntries )
{
xub_StrLen nChgStart = STRING_LEN;
xub_StrLen nChgEnd = 0;
- const USHORT nCurrentIndex = pSmartTagList->GetWrongPos( nBegin );
+ const sal_uInt16 nCurrentIndex = pSmartTagList->GetWrongPos( nBegin );
pSmartTagList->Fresh( nChgStart, nChgEnd, nBegin, nEnd - nBegin, nCurrentIndex, STRING_LEN );
nNumberOfRemovedEntries = nNumberOfEntries - pSmartTagList->Count();
}
@@ -1354,7 +1363,7 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/
pSmartTagList = pNode->GetSmartTags();
- const USHORT nNumberOfEntriesAfterRecognize = pSmartTagList ? pSmartTagList->Count() : 0;
+ const sal_uInt16 nNumberOfEntriesAfterRecognize = pSmartTagList ? pSmartTagList->Count() : 0;
nNumberOfInsertedEntries = nNumberOfEntriesAfterRecognize - ( nNumberOfEntries - nNumberOfRemovedEntries );
}
@@ -1373,7 +1382,7 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/
// Calculate repaint area:
//
#if OSL_DEBUG_LEVEL > 1
- const USHORT nNumberOfEntriesAfterRecognize2 = pSmartTagList->Count();
+ const sal_uInt16 nNumberOfEntriesAfterRecognize2 = pSmartTagList->Count();
(void) nNumberOfEntriesAfterRecognize2;
#endif
if ( nBegin < nEnd && ( 0 != nNumberOfRemovedEntries ||
@@ -1401,11 +1410,11 @@ void SwTxtFrm::CollectAutoCmplWrds( SwCntntNode* pActNode, xub_StrLen nActPos )
xub_StrLen nBegin = 0;
xub_StrLen nEnd = pNode->GetTxt().Len();
xub_StrLen nLen;
- BOOL bACWDirty = FALSE, bAnyWrd = FALSE;
+ sal_Bool bACWDirty = sal_False, bAnyWrd = sal_False;
if( nBegin < nEnd )
{
- USHORT nCnt = 200;
+ sal_uInt16 nCnt = 200;
SwScanner aScanner( *pNode, pNode->GetTxt(), 0, 0,
WordType::DICTIONARY_WORD, nBegin, nEnd );
while( aScanner.NextWord() )
@@ -1420,10 +1429,10 @@ void SwTxtFrm::CollectAutoCmplWrds( SwCntntNode* pActNode, xub_StrLen nActPos )
{
if( rACW.GetMinWordLen() <= rWord.Len() )
rACW.InsertWord( rWord, *pDoc );
- bAnyWrd = TRUE;
+ bAnyWrd = sal_True;
}
else
- bACWDirty = TRUE;
+ bACWDirty = sal_True;
}
if( !--nCnt )
{
@@ -1435,7 +1444,7 @@ void SwTxtFrm::CollectAutoCmplWrds( SwCntntNode* pActNode, xub_StrLen nActPos )
}
if( bAnyWrd && !bACWDirty )
- pNode->SetAutoCompleteWordDirty( FALSE );
+ pNode->SetAutoCompleteWordDirty( sal_False );
}
/*************************************************************************
@@ -1443,15 +1452,15 @@ void SwTxtFrm::CollectAutoCmplWrds( SwCntntNode* pActNode, xub_StrLen nActPos )
*************************************************************************/
// Findet den TxtFrm und sucht dessen CalcHyph
-BOOL SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
+sal_Bool SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
{
// Abkuerzung: am Absatz ist keine Sprache eingestellt:
- if ( LANGUAGE_NONE == USHORT( GetSwAttrSet().GetLanguage().GetLanguage() )
+ if ( LANGUAGE_NONE == sal_uInt16( GetSwAttrSet().GetLanguage().GetLanguage() )
&& USHRT_MAX == GetLang( 0, m_Text.Len() ) )
{
if( !rHyphInf.IsCheck() )
- rHyphInf.SetNoLang( TRUE );
- return FALSE;
+ rHyphInf.SetNoLang( sal_True );
+ return sal_False;
}
if( pLinguNode != this )
@@ -1470,7 +1479,7 @@ BOOL SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
#if OSL_DEBUG_LEVEL > 1
OSL_ENSURE( pFrm, "!SwTxtNode::Hyphenate: can't find any frame" );
#endif
- return FALSE;
+ return sal_False;
}
while( pFrm )
@@ -1481,7 +1490,7 @@ BOOL SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
// (7821, 7662, 7408); vgl. layact.cxx,
// SwLayAction::_TurboAction(), if( !pCnt->IsValid() ...
pFrm->SetCompletePaint();
- return TRUE;
+ return sal_True;
}
pFrm = (SwTxtFrm*)(pFrm->GetFollow());
if( pFrm )
@@ -1490,7 +1499,7 @@ BOOL SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
rHyphInf.nStart = pFrm->GetOfst();
}
}
- return FALSE;
+ return sal_False;
}
struct TransliterationChgData
@@ -1535,12 +1544,12 @@ void SwTxtNode::TransliterateText(
GetTxt(), nStt,
pBreakIt->GetLocale( GetLang( nStt ) ),
nWordType,
- TRUE /*prefer forward direction*/);
+ sal_True /*prefer forward direction*/);
aEndBndry = pBreakIt->GetBreakIter()->getWordBoundary(
GetTxt(), nEnd,
pBreakIt->GetLocale( GetLang( nEnd ) ),
nWordType,
- FALSE /*prefer backward direction*/);
+ sal_False /*prefer backward direction*/);
// prevent backtracking to the previous word if selection is at word boundary
if (aSttBndry.endPos <= nStt)
@@ -1756,7 +1765,7 @@ void SwTxtNode::ReplaceTextOnly( xub_StrLen nPos, xub_StrLen nLen,
while( nI + nCnt < nTLen && nOff == pOffsets[ nI + nCnt ] )
++nCnt;
- Update( SwIndex( this, nMyOff ), nCnt, FALSE );
+ Update( SwIndex( this, nMyOff ), nCnt, sal_False );
nMyOff = nOff;
//nMyOff -= nCnt;
nI += nCnt - 1;
@@ -1764,13 +1773,13 @@ void SwTxtNode::ReplaceTextOnly( xub_StrLen nPos, xub_StrLen nLen,
else if( nOff > nMyOff )
{
// something is deleted
- Update( SwIndex( this, nMyOff+1 ), nOff - nMyOff, TRUE );
+ Update( SwIndex( this, nMyOff+1 ), nOff - nMyOff, sal_True );
nMyOff = nOff;
}
}
if( nMyOff < nLen )
// something is deleted at the end
- Update( SwIndex( this, nMyOff ), nLen - nMyOff, TRUE );
+ Update( SwIndex( this, nMyOff ), nLen - nMyOff, sal_True );
// notify the layout!
SwDelTxt aDelHint( nPos, nTLen );
@@ -1809,7 +1818,7 @@ void SwTxtNode::CountWords( SwDocStat& rStat,
// mask out the redlined and hidden text with ' '
const xub_Unicode cChar(' ');
- const USHORT nNumOfMaskedChars = lcl_MaskRedlinesAndHiddenText( *this, rTextCopy, nStt, nEnd, cChar, false );
+ const sal_uInt16 nNumOfMaskedChars = lcl_MaskRedlinesAndHiddenText( *this, rTextCopy, nStt, nEnd, cChar, false );
// expand text into pConversionMap for scanner
rtl::OUString aExpandText;
@@ -1916,9 +1925,9 @@ struct SwParaIdleData_Impl
SwWrongList* pWrong; // for spell checking
SwGrammarMarkUp* pGrammarCheck; // for grammar checking / proof reading
SwWrongList* pSmartTags;
- ULONG nNumberOfWords;
- ULONG nNumberOfChars;
- ULONG nNumberOfCharsExcludingSpaces;
+ sal_uLong nNumberOfWords;
+ sal_uLong nNumberOfChars;
+ sal_uLong nNumberOfCharsExcludingSpaces;
bool bWordCountDirty;
bool bWrongDirty; // Ist das Wrong-Feld auf invalid?
bool bGrammarCheckDirty;
@@ -2016,25 +2025,25 @@ SwWrongList* SwTxtNode::GetSmartTags()
return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->pSmartTags : 0;
}
-void SwTxtNode::SetParaNumberOfWords( ULONG nNew ) const
+void SwTxtNode::SetParaNumberOfWords( sal_uLong nNew ) const
{
if ( m_pParaIdleData_Impl )
{
m_pParaIdleData_Impl->nNumberOfWords = nNew;
}
}
-ULONG SwTxtNode::GetParaNumberOfWords() const
+sal_uLong SwTxtNode::GetParaNumberOfWords() const
{
return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->nNumberOfWords : 0;
}
-void SwTxtNode::SetParaNumberOfChars( ULONG nNew ) const
+void SwTxtNode::SetParaNumberOfChars( sal_uLong nNew ) const
{
if ( m_pParaIdleData_Impl )
{
m_pParaIdleData_Impl->nNumberOfChars = nNew;
}
}
-ULONG SwTxtNode::GetParaNumberOfChars() const
+sal_uLong SwTxtNode::GetParaNumberOfChars() const
{
return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->nNumberOfChars : 0;
}
@@ -2046,12 +2055,12 @@ void SwTxtNode::SetWordCountDirty( bool bNew ) const
}
}
-ULONG SwTxtNode::GetParaNumberOfCharsExcludingSpaces() const
+sal_uLong SwTxtNode::GetParaNumberOfCharsExcludingSpaces() const
{
return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->nNumberOfCharsExcludingSpaces : 0;
}
-void SwTxtNode::SetParaNumberOfCharsExcludingSpaces( ULONG nNew ) const
+void SwTxtNode::SetParaNumberOfCharsExcludingSpaces( sal_uLong nNew ) const
{
if ( m_pParaIdleData_Impl )
{