summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/acmplwrd.cxx
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2011-02-09 09:49:44 +0100
committerMathias Bauer <mba@openoffice.org>2011-02-09 09:49:44 +0100
commit3e9a7ad4c59837fb9ae0b943c7ab81a66c86dd08 (patch)
tree68560aae0c0deb753b9afb0cc86b11d28b6b9d26 /sw/source/core/doc/acmplwrd.cxx
parentb2fd62ed23dbca199482bc068290f9c1735ff6ed (diff)
parent82465a4c98927c4df1360c5f29c51c9d4e6a09a7 (diff)
CWS swlayoutrefactoring: resync to m100
Diffstat (limited to 'sw/source/core/doc/acmplwrd.cxx')
-rw-r--r--sw/source/core/doc/acmplwrd.cxx58
1 files changed, 29 insertions, 29 deletions
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index 05d8b813e9..6bda643531 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -57,7 +57,7 @@ class SwAutoCompleteClient : public SwClient
SwAutoCompleteWord* pAutoCompleteWord;
SwDoc* pDoc;
#ifdef DBG_UTIL
- static ULONG nSwAutoCompleteClientCount;
+ static sal_uLong nSwAutoCompleteClientCount;
#endif
public:
SwAutoCompleteClient(SwAutoCompleteWord& rToTell, SwDoc& rSwDoc);
@@ -68,7 +68,7 @@ public:
const SwDoc& GetDoc(){return *pDoc;}
#ifdef DBG_UTIL
- static ULONG GetElementCount() {return nSwAutoCompleteClientCount;}
+ static sal_uLong GetElementCount() {return nSwAutoCompleteClientCount;}
#endif
protected:
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
@@ -97,7 +97,7 @@ typedef std::vector<SwDocPtr> SwDocPtrVector;
class SwAutoCompleteString : public String
{
#ifdef DBG_UTIL
- static ULONG nSwAutoCompleteStringCount;
+ static sal_uLong nSwAutoCompleteStringCount;
#endif
SwDocPtrVector aSourceDocs;
public:
@@ -108,12 +108,12 @@ class SwAutoCompleteString : public String
//returns true if last document reference has been removed
sal_Bool RemoveDocument(const SwDoc& rDoc);
#ifdef DBG_UTIL
- static ULONG GetElementCount() {return nSwAutoCompleteStringCount;}
+ static sal_uLong GetElementCount() {return nSwAutoCompleteStringCount;}
#endif
};
#ifdef DBG_UTIL
- ULONG SwAutoCompleteClient::nSwAutoCompleteClientCount = 0;
- ULONG SwAutoCompleteString::nSwAutoCompleteStringCount = 0;
+ sal_uLong SwAutoCompleteClient::nSwAutoCompleteClientCount = 0;
+ sal_uLong SwAutoCompleteString::nSwAutoCompleteStringCount = 0;
#endif
/* -----------------------------06.08.2002 08:57------------------------------
@@ -258,18 +258,18 @@ sal_Bool SwAutoCompleteString::RemoveDocument(const SwDoc& rDoc)
/* ---------------------------------------------------------------------------
---------------------------------------------------------------------------*/
-SwAutoCompleteWord::SwAutoCompleteWord( USHORT nWords, USHORT nMWrdLen )
+SwAutoCompleteWord::SwAutoCompleteWord( sal_uInt16 nWords, sal_uInt16 nMWrdLen )
: aWordLst( 0, 255 ), aLRULst( 0, 255 ),
pImpl(new SwAutoCompleteWord_Impl(*this)),
nMaxCount( nWords ),
nMinWrdLen( nMWrdLen ),
- bLockWordLst( FALSE )
+ bLockWordLst( sal_False )
{
}
SwAutoCompleteWord::~SwAutoCompleteWord()
{
- for(USHORT nPos = aWordLst.Count(); nPos; nPos--)
+ for(sal_uInt16 nPos = aWordLst.Count(); nPos; nPos--)
{
SwAutoCompleteString* pCurrent = (SwAutoCompleteString*)aWordLst[ nPos - 1 ];
aWordLst.Remove( nPos - 1 );
@@ -277,13 +277,13 @@ SwAutoCompleteWord::~SwAutoCompleteWord()
}
delete pImpl;
#ifdef DBG_UTIL
- ULONG nStrings = SwAutoCompleteString::GetElementCount();
- ULONG nClients = SwAutoCompleteClient::GetElementCount();
+ sal_uLong nStrings = SwAutoCompleteString::GetElementCount();
+ sal_uLong nClients = SwAutoCompleteClient::GetElementCount();
DBG_ASSERT(!nStrings && !nClients, "AutoComplete: clients or string count mismatch");
#endif
}
-BOOL SwAutoCompleteWord::InsertWord( const String& rWord, SwDoc& rDoc )
+sal_Bool SwAutoCompleteWord::InsertWord( const String& rWord, SwDoc& rDoc )
{
SwDocShell* pDocShell = rDoc.GetDocShell();
SfxMedium* pMedium = pDocShell ? pDocShell->GetMedium() : 0;
@@ -300,7 +300,7 @@ BOOL SwAutoCompleteWord::InsertWord( const String& rWord, SwDoc& rDoc )
aNewWord.EraseAllChars( CH_TXTATR_BREAKWORD );
pImpl->AddDocument(rDoc);
- BOOL bRet = FALSE;
+ sal_Bool bRet = sal_False;
xub_StrLen nWrdLen = aNewWord.Len();
while( nWrdLen && '.' == aNewWord.GetChar( nWrdLen-1 ))
--nWrdLen;
@@ -310,10 +310,10 @@ BOOL SwAutoCompleteWord::InsertWord( const String& rWord, SwDoc& rDoc )
SwAutoCompleteString* pAutoString;
StringPtr pNew = pAutoString = new SwAutoCompleteString( aNewWord, 0, nWrdLen );
pAutoString->AddDocument(rDoc);
- USHORT nInsPos;
+ sal_uInt16 nInsPos;
if( aWordLst.Insert( pNew, nInsPos ) )
{
- bRet = TRUE;
+ bRet = sal_True;
if( aLRULst.Count() < nMaxCount )
aLRULst.Insert( pNew, 0 );
else
@@ -353,15 +353,15 @@ BOOL SwAutoCompleteWord::InsertWord( const String& rWord, SwDoc& rDoc )
return bRet;
}
-void SwAutoCompleteWord::SetMaxCount( USHORT nNewMax )
+void SwAutoCompleteWord::SetMaxCount( sal_uInt16 nNewMax )
{
if( nNewMax < nMaxCount && aLRULst.Count() > nNewMax )
{
// dann die unten ueberhaengenden entfernen
- USHORT nLRUIndex = nNewMax-1;
+ sal_uInt16 nLRUIndex = nNewMax-1;
while( nNewMax < aWordLst.Count() && nLRUIndex < aLRULst.Count())
{
- USHORT nPos = aWordLst.GetPos( (String*)aLRULst[ nLRUIndex++ ] );
+ sal_uInt16 nPos = aWordLst.GetPos( (String*)aLRULst[ nLRUIndex++ ] );
ASSERT( USHRT_MAX != nPos, "String nicht gefunden" );
void * pDel = aWordLst[nPos];
aWordLst.Remove(nPos);
@@ -372,7 +372,7 @@ void SwAutoCompleteWord::SetMaxCount( USHORT nNewMax )
nMaxCount = nNewMax;
}
-void SwAutoCompleteWord::SetMinWordLen( USHORT n )
+void SwAutoCompleteWord::SetMinWordLen( sal_uInt16 n )
{
// will man wirklich alle Worte, die kleiner als die neue Min Laenge
// sind entfernen?
@@ -381,13 +381,13 @@ void SwAutoCompleteWord::SetMinWordLen( USHORT n )
// JP 11.03.99 - mal testhalber eingebaut
if( n < nMinWrdLen )
{
- for( USHORT nPos = 0; nPos < aWordLst.Count(); ++nPos )
+ for( sal_uInt16 nPos = 0; nPos < aWordLst.Count(); ++nPos )
if( aWordLst[ nPos ]->Len() < n )
{
void* pDel = aWordLst[ nPos ];
aWordLst.Remove(nPos);
- USHORT nDelPos = aLRULst.GetPos( pDel );
+ sal_uInt16 nDelPos = aLRULst.GetPos( pDel );
ASSERT( USHRT_MAX != nDelPos, "String nicht gefunden" );
aLRULst.Remove( nDelPos );
--nPos;
@@ -398,8 +398,8 @@ void SwAutoCompleteWord::SetMinWordLen( USHORT n )
nMinWrdLen = n;
}
-BOOL SwAutoCompleteWord::GetRange( const String& rWord, USHORT& rStt,
- USHORT& rEnd ) const
+sal_Bool SwAutoCompleteWord::GetRange( const String& rWord, sal_uInt16& rStt,
+ sal_uInt16& rEnd ) const
{
const StringPtr pStr = (StringPtr)&rWord;
aWordLst.Seek_Entry( pStr, &rStt );
@@ -414,8 +414,8 @@ BOOL SwAutoCompleteWord::GetRange( const String& rWord, USHORT& rStt,
void SwAutoCompleteWord::CheckChangedList( const SvStringsISortDtor& rNewLst )
{
- USHORT nMyLen = aWordLst.Count(), nNewLen = rNewLst.Count();
- USHORT nMyPos = 0, nNewPos = 0;
+ sal_uInt16 nMyLen = aWordLst.Count(), nNewLen = rNewLst.Count();
+ sal_uInt16 nMyPos = 0, nNewPos = 0;
for( ; nMyPos < nMyLen && nNewPos < nNewLen; ++nMyPos, ++nNewPos )
{
@@ -425,7 +425,7 @@ void SwAutoCompleteWord::CheckChangedList( const SvStringsISortDtor& rNewLst )
void* pDel = aWordLst[ nMyPos ];
aWordLst.Remove(nMyPos);
- USHORT nPos = aLRULst.GetPos( pDel );
+ sal_uInt16 nPos = aLRULst.GetPos( pDel );
ASSERT( USHRT_MAX != nPos, "String nicht gefunden" );
aLRULst.Remove( nPos );
delete (SwAutoCompleteString*)pDel;
@@ -440,7 +440,7 @@ void SwAutoCompleteWord::CheckChangedList( const SvStringsISortDtor& rNewLst )
for( ; nNewPos < nMyLen; ++nNewPos )
{
void* pDel = aWordLst[ nNewPos ];
- USHORT nPos = aLRULst.GetPos( pDel );
+ sal_uInt16 nPos = aLRULst.GetPos( pDel );
ASSERT( USHRT_MAX != nPos, "String nicht gefunden" );
aLRULst.Remove( nPos );
delete (SwAutoCompleteString*)pDel;
@@ -458,13 +458,13 @@ void SwAutoCompleteWord::DocumentDying(const SwDoc& rDoc)
SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
const sal_Bool bDelete = !pACorr->GetSwFlags().bAutoCmpltKeepList;
- for(USHORT nPos = aWordLst.Count(); nPos; nPos--)
+ for(sal_uInt16 nPos = aWordLst.Count(); nPos; nPos--)
{
SwAutoCompleteString* pCurrent = (SwAutoCompleteString*)aWordLst[ nPos - 1 ];
if(pCurrent->RemoveDocument(rDoc) && bDelete)
{
aWordLst.Remove( nPos - 1 );
- USHORT nLRUPos = aLRULst.GetPos( (void*)pCurrent );
+ sal_uInt16 nLRUPos = aLRULst.GetPos( (void*)pCurrent );
DBG_ASSERT(nLRUPos < USHRT_MAX, "word not found in LRU list" );
aLRULst.Remove( nLRUPos );
delete pCurrent;