diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-11-08 15:32:06 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-11-08 17:18:31 +0000 |
commit | 02f80eef3c60385582f1bc2d8f2fbccb8d55b7ff (patch) | |
tree | 1da118bb39f378a885a5b491b42edbf9377d2048 /sw | |
parent | 3fa85c871637ee378450c12f10219f94dd692525 (diff) |
longparas: these sal_uInt16s are really xub_StrLens
Change-Id: I54ecd08c4073f1de6dd28e7d6824d8cfde98254a
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/expfld.hxx | 2 | ||||
-rw-r--r-- | sw/inc/txatbase.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/crsr/findtxt.cxx | 15 | ||||
-rw-r--r-- | sw/source/core/edit/edlingu.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/inc/txtfrm.hxx | 20 | ||||
-rw-r--r-- | sw/source/core/text/itratr.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/txtnode/txatritr.cxx | 4 |
8 files changed, 27 insertions, 26 deletions
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx index 978a89140afb..4599911f7006 100644 --- a/sw/inc/expfld.hxx +++ b/sw/inc/expfld.hxx @@ -124,7 +124,7 @@ public: virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); - static sal_uInt16 GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc, unsigned nHint = 0); + static xub_StrLen GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc, unsigned nHint = 0); // #i82544# void SetLateInitialization() { bLateInitialization = true;} }; diff --git a/sw/inc/txatbase.hxx b/sw/inc/txatbase.hxx index 2b14a2ebddbd..a5836b5d9570 100644 --- a/sw/inc/txatbase.hxx +++ b/sw/inc/txatbase.hxx @@ -126,7 +126,7 @@ protected: xub_StrLen m_nEnd; public: - SwTxtAttrEnd( SfxPoolItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); + SwTxtAttrEnd( SfxPoolItem& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); using SwTxtAttr::GetEnd; virtual xub_StrLen* GetEnd(); diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index f6a1c70ff66f..2770ab1ea13b 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -469,8 +469,8 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt, (rSTxt.*fnMove->fnSearch)( sCleanStr, &nProxyStart, &nProxyEnd, 0 ) && !(bZeroMatch = (nProxyStart == nProxyEnd))) { - nStart = (sal_uInt16)nProxyStart; - nEnd = (sal_uInt16)nProxyEnd; + nStart = (xub_StrLen)nProxyStart; + nEnd = (xub_StrLen)nProxyEnd; // set section correctly *GetPoint() = *pPam->GetPoint(); SetMark(); @@ -478,24 +478,25 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt, // adjust start and end if( !aFltArr.empty() ) { - xub_StrLen n, nNew; // if backward search, switch positions temporarily - if( !bSrchForward ) { n = nStart; nStart = nEnd; nEnd = n; } + if( !bSrchForward ) { std::swap(nStart, nEnd); } - for( n = 0, nNew = nStart; + xub_StrLen nNew(nStart); + for (size_t n = 0; n < aFltArr.size() && aFltArr[ n ] <= nStart; ++n, ++nNew ) ; nStart = nNew; - for( n = 0, nNew = nEnd; + nNew = nEnd; + for(size_t n = 0; n < aFltArr.size() && aFltArr[ n ] < nEnd; ++n, ++nNew ) ; nEnd = nNew; // if backward search, switch positions temporarily - if( !bSrchForward ) { n = nStart; nStart = nEnd; nEnd = n; } + if( !bSrchForward ) { std::swap(nStart, nEnd); } } GetMark()->nContent = nStart; GetPoint()->nContent = nEnd; diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 11c9a110c41b..0e5540e15f95 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -100,8 +100,8 @@ public: // the content positions of each portion need to be saved struct SpellContentPosition { - sal_uInt16 nLeft; - sal_uInt16 nRight; + xub_StrLen nLeft; + xub_StrLen nRight; }; typedef std::vector<SpellContentPosition> SpellContentPositions; diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index 6bde38bd2038..bc0559bba8ea 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -51,7 +51,7 @@ class SwTxtFrm: public SwCntntFrm friend class SwTestFormat; friend class WidowsAndOrphans; friend class SwTxtFrmLocker; // duerfen Lock()/Unlock() - friend bool sw_ChangeOffset( SwTxtFrm* pFrm, sal_uInt16 nNew ); + friend bool sw_ChangeOffset( SwTxtFrm* pFrm, xub_StrLen nNew ); static SwCache *pTxtCache; //Pointer auf den Line-Cache static long nMinPrtLine; //Diese Linie darf beim Drucken nicht @@ -219,11 +219,11 @@ public: void Init(); // Wird von FormatSpelling( ) gerufen - SwRect _AutoSpell( const SwCntntNode*, const SwViewOption&, sal_uInt16 ); + SwRect _AutoSpell( const SwCntntNode*, const SwViewOption&, xub_StrLen ); // is called from the FormatSpelling( ) method - SwRect SmartTagScan( SwCntntNode* , sal_uInt16 ); + SwRect SmartTagScan( SwCntntNode* , xub_StrLen ); // Wird vom CollectAutoCmplWords gerufen - void CollectAutoCmplWrds( SwCntntNode* , sal_uInt16 ); + void CollectAutoCmplWrds( SwCntntNode* , xub_StrLen ); // Returns the screen position of rPos. The values are relative to the upper // left position of the page frame. @@ -302,10 +302,10 @@ public: // Methoden zur Verwaltung von FolgeFrames SwCntntFrm *SplitFrm( const xub_StrLen nTxtPos ); SwCntntFrm *JoinFrm(); - inline sal_uInt16 GetOfst() const { return nOfst; } - void _SetOfst( const sal_uInt16 nNewOfst ); - inline void SetOfst ( const sal_uInt16 nNewOfst ); - inline void ManipOfst ( const sal_uInt16 nNewOfst ){ nOfst = nNewOfst; } + inline xub_StrLen GetOfst() const { return nOfst; } + void _SetOfst( const xub_StrLen nNewOfst ); + inline void SetOfst ( const xub_StrLen nNewOfst ); + inline void ManipOfst ( const xub_StrLen nNewOfst ){ nOfst = nNewOfst; } SwTxtFrm *GetFrmAtPos ( const SwPosition &rPos); inline const SwTxtFrm *GetFrmAtPos ( const SwPosition &rPos) const; // OD 07.10.2003 #110978# - return <reference> instead of <pointer> @@ -503,10 +503,10 @@ public: sal_uInt16 FirstLineHeight() const; // Haengt FlyInCntFrm um, wenn nEnd > Index >= nStart ist. - void MoveFlyInCnt( SwTxtFrm *pNew, sal_uInt16 nStart, sal_uInt16 nEnd ); + void MoveFlyInCnt( SwTxtFrm *pNew, xub_StrLen nStart, xub_StrLen nEnd ); // Berechnet die Position von FlyInCntFrms - sal_uInt16 CalcFlyPos( SwFrmFmt* pSearch ); + xub_StrLen CalcFlyPos( SwFrmFmt* pSearch ); // Ermittelt die Startposition und Schrittweite des Registers sal_Bool FillRegister( SwTwips& rRegStart, sal_uInt16& rRegDiff ); diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index 9fc42da5e128..47c99f9153a7 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -337,8 +337,8 @@ xub_StrLen SwAttrIter::GetNextAttr( ) const } if (m_pTxtNode!=NULL) { //TODO maybe use hints like FieldHints for this instead of looking at the text... - int l=(nNext<m_pTxtNode->Len()?nNext:m_pTxtNode->Len()); - sal_uInt16 p=nPos; + xub_StrLen l=(nNext<m_pTxtNode->Len()?nNext:m_pTxtNode->Len()); + xub_StrLen p=nPos; while (p<l && m_pTxtNode->GetTxt()[p] != CH_TXT_ATR_FIELDSTART && m_pTxtNode->GetTxt()[p] != CH_TXT_ATR_FIELDEND && m_pTxtNode->GetTxt()[p] != CH_TXT_ATR_FORMELEMENT) diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 8dfa6a389375..e46354809e05 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -2320,7 +2320,7 @@ void SwTxtNode::GCAttr() return; bool bChanged = false; - sal_uInt16 nMin = m_Text.getLength(), + xub_StrLen nMin = m_Text.getLength(), nMax = 0; bool bAll = nMin != 0; // Bei leeren Absaetzen werden nur die // INet-Formate entfernt. diff --git a/sw/source/core/txtnode/txatritr.cxx b/sw/source/core/txtnode/txatritr.cxx index 6223046b709e..c824a3be7002 100644 --- a/sw/source/core/txtnode/txatritr.cxx +++ b/sw/source/core/txtnode/txatritr.cxx @@ -205,8 +205,8 @@ void SwTxtAttrIterator::SearchNextChg() for( ; nAttrPos < pHts->Count(); ++nAttrPos ) { const SwTxtAttr* pHt = (*pHts)[ nAttrPos ]; - const sal_uInt16* pEnd = pHt->GetEnd(); - const sal_uInt16 nHtStt = *pHt->GetStart(); + const xub_StrLen* pEnd = pHt->GetEnd(); + const xub_StrLen nHtStt = *pHt->GetStart(); if( nHtStt < nStt && ( !pEnd || *pEnd <= nStt )) continue; |