diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2013-11-12 00:46:22 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2013-11-14 09:23:19 +0100 |
commit | ebeff3f074dd94dce4ce6cc55abd0495103684bd (patch) | |
tree | 4ba353f7ad94480fccfed3e78e305b80c0e5627b /sw | |
parent | cd470c64f9b09bb94262c606cfc36c8d923ffc54 (diff) |
xub_StrLen to sal_Int32 in SwIndex and some related
Change-Id: I66735635a88844c30a7fa1c886d2c1df34008f4f
Diffstat (limited to 'sw')
140 files changed, 801 insertions, 833 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index cc8699030e50..47f41c70d732 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -191,7 +191,7 @@ private: in the same column */ long m_nLeftFrmPos; sal_uLong m_nAktNode; // save CursorPos at Start-Action - xub_StrLen m_nAktCntnt; + sal_Int32 m_nAktCntnt; sal_uInt16 m_nAktNdTyp; bool m_bAktSelection; diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index c30b23d9184a..2de669d02a18 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -619,7 +619,7 @@ private: SwFrmFmt* = 0 ); void CopyFlyInFlyImpl( const SwNodeRange& rRg, - const xub_StrLen nEndContentIndex, + const sal_Int32 nEndContentIndex, const SwNodeIndex& rStartIdx, const bool bCopyFlyAtFly = false ) const; sal_Int8 SetFlyFrmAnchor( SwFrmFmt& rFlyFmt, SfxItemSet& rSet, bool bNewFrms ); @@ -1072,7 +1072,7 @@ public: SwFrmFmt *pParent = 0 ); void CopyWithFlyInFly( const SwNodeRange& rRg, - const xub_StrLen nEndContentIndex, + const sal_Int32 nEndContentIndex, const SwNodeIndex& rInsPos, sal_Bool bMakeNewFrms = sal_True, sal_Bool bDelRedlines = sal_True, @@ -1932,7 +1932,7 @@ public: SwExtTextInput* CreateExtTextInput( const SwPaM& rPam ); void DeleteExtTextInput( SwExtTextInput* pDel ); SwExtTextInput* GetExtTextInput( const SwNode& rNd, - xub_StrLen nCntntPos = STRING_NOTFOUND) const; + sal_Int32 nCntntPos = -1) const; SwExtTextInput* GetExtTextInput() const; /// Interface for access to AutoComplete-List. diff --git a/sw/inc/hhcwrp.hxx b/sw/inc/hhcwrp.hxx index ded2c769d725..18e6f77c23cc 100644 --- a/sw/inc/hhcwrp.hxx +++ b/sw/inc/hhcwrp.hxx @@ -38,7 +38,7 @@ class SwHHCWrapper : public editeng::HangulHanjaConversion SwConversionArgs *m_pConvArgs; /**< object for arguments (and results) needed to find of next convertible text portion */ - xub_StrLen m_nLastPos; /**< starting position of the last found text part + sal_Int32 m_nLastPos; /**< starting position of the last found text part (needs to be sth that gets not moved like SwPaM or SwPosition by replace operations!) */ sal_Int32 m_nUnitOffset; diff --git a/sw/inc/hints.hxx b/sw/inc/hints.hxx index a2a268fc9530..f3f1dcbcaef1 100644 --- a/sw/inc/hints.hxx +++ b/sw/inc/hints.hxx @@ -76,10 +76,10 @@ public: class SwInsTxt: public SwMsgPoolItem { public: - xub_StrLen nPos; - xub_StrLen nLen; + sal_Int32 nPos; + sal_Int32 nLen; - SwInsTxt( xub_StrLen nP, xub_StrLen nL ); + SwInsTxt( sal_Int32 nP, sal_Int32 nL ); }; class SwDelChr: public SwMsgPoolItem diff --git a/sw/inc/index.hxx b/sw/inc/index.hxx index 65d40c5e56f9..01d07cc73244 100644 --- a/sw/inc/index.hxx +++ b/sw/inc/index.hxx @@ -27,9 +27,6 @@ #include <tools/rtti.hxx> #include <swdllapi.h> -// Maximum index in IndexArray (for testing on overflows). -#define INVALID_INDEX STRING_NOTFOUND - class SwIndex; class SwIndexReg; struct SwPosition; @@ -46,46 +43,46 @@ class SW_DLLPUBLIC SwIndex private: friend class SwIndexReg; - xub_StrLen m_nIndex; + sal_Int32 m_nIndex; SwIndexReg * m_pIndexReg; // doubly linked list of Indexes registered at m_pIndexReg SwIndex * m_pNext; SwIndex * m_pPrev; - SwIndex& ChgValue( const SwIndex& rIdx, xub_StrLen nNewValue ); - void Init(xub_StrLen const nIdx); + SwIndex& ChgValue( const SwIndex& rIdx, sal_Int32 nNewValue ); + void Init(sal_Int32 const nIdx); void Remove(); public: - explicit SwIndex(SwIndexReg *const pReg, xub_StrLen const nIdx = 0); + explicit SwIndex(SwIndexReg *const pReg, sal_Int32 const nIdx = 0); SwIndex( const SwIndex & ); SwIndex( const SwIndex &, short nDiff ); ~SwIndex() { Remove(); } - INLINE SwIndex& operator=( xub_StrLen const ); + INLINE SwIndex& operator=( sal_Int32 const ); SwIndex& operator=( const SwIndex & ); - INLINE xub_StrLen operator++(); - INLINE xub_StrLen operator--(); - INLINE xub_StrLen operator++(int); - INLINE xub_StrLen operator--(int); + INLINE sal_Int32 operator++(); + INLINE sal_Int32 operator--(); + INLINE sal_Int32 operator++(int); + INLINE sal_Int32 operator--(int); - INLINE xub_StrLen operator+=( xub_StrLen const ); - INLINE xub_StrLen operator-=( xub_StrLen const ); - INLINE xub_StrLen operator+=( const SwIndex& ); - INLINE xub_StrLen operator-=( const SwIndex& ); + INLINE sal_Int32 operator+=( sal_Int32 const ); + INLINE sal_Int32 operator-=( sal_Int32 const ); + INLINE sal_Int32 operator+=( const SwIndex& ); + INLINE sal_Int32 operator-=( const SwIndex& ); INLINE bool operator< ( const SwIndex& ) const; INLINE bool operator<=( const SwIndex& ) const; INLINE bool operator> ( const SwIndex& ) const; INLINE bool operator>=( const SwIndex& ) const; - bool operator< ( xub_StrLen const nVal ) const { return m_nIndex < nVal; } - bool operator<=( xub_StrLen const nVal ) const { return m_nIndex <= nVal; } - bool operator> ( xub_StrLen const nVal ) const { return m_nIndex > nVal; } - bool operator>=( xub_StrLen const nVal ) const { return m_nIndex >= nVal; } - bool operator==( xub_StrLen const nVal ) const { return m_nIndex == nVal; } - bool operator!=( xub_StrLen const nVal ) const { return m_nIndex != nVal; } + bool operator< ( sal_Int32 const nVal ) const { return m_nIndex < nVal; } + bool operator<=( sal_Int32 const nVal ) const { return m_nIndex <= nVal; } + bool operator> ( sal_Int32 const nVal ) const { return m_nIndex > nVal; } + bool operator>=( sal_Int32 const nVal ) const { return m_nIndex >= nVal; } + bool operator==( sal_Int32 const nVal ) const { return m_nIndex == nVal; } + bool operator!=( sal_Int32 const nVal ) const { return m_nIndex != nVal; } bool operator==( const SwIndex& rSwIndex ) const { @@ -99,10 +96,10 @@ public: || (m_pIndexReg != rSwIndex.m_pIndexReg); } - xub_StrLen GetIndex() const { return m_nIndex; } + sal_Int32 GetIndex() const { return m_nIndex; } // Assignments without creating a temporary object. - SwIndex &Assign(SwIndexReg *,xub_StrLen); + SwIndex &Assign(SwIndexReg *, sal_Int32); // Returns pointer to IndexArray (for RTTI at SwIndexReg). const SwIndexReg* GetIdxReg() const { return m_pIndexReg; } @@ -119,7 +116,7 @@ class SwIndexReg const SwIndex * m_pLast; protected: - virtual void Update( SwIndex const & rPos, const xub_StrLen nChangeLen, + virtual void Update( SwIndex const & rPos, const sal_Int32 nChangeLen, const bool bNegative = false, const bool bDelete = false ); void ChkArr(); @@ -140,40 +137,40 @@ public: #ifndef DBG_UTIL -inline xub_StrLen SwIndex::operator++() +inline sal_Int32 SwIndex::operator++() { return ChgValue( *this, m_nIndex+1 ).m_nIndex; } -inline xub_StrLen SwIndex::operator--() +inline sal_Int32 SwIndex::operator--() { return ChgValue( *this, m_nIndex-1 ).m_nIndex; } -inline xub_StrLen SwIndex::operator++(int) +inline sal_Int32 SwIndex::operator++(int) { - xub_StrLen const nOldIndex = m_nIndex; + sal_Int32 const nOldIndex = m_nIndex; ChgValue( *this, m_nIndex+1 ); return nOldIndex; } -inline xub_StrLen SwIndex::operator--(int) +inline sal_Int32 SwIndex::operator--(int) { - xub_StrLen const nOldIndex = m_nIndex; + sal_Int32 const nOldIndex = m_nIndex; ChgValue( *this, m_nIndex-1 ); return nOldIndex; } -inline xub_StrLen SwIndex::operator+=( xub_StrLen const nVal ) +inline sal_Int32 SwIndex::operator+=( sal_Int32 const nVal ) { return ChgValue( *this, m_nIndex + nVal ).m_nIndex; } -inline xub_StrLen SwIndex::operator-=( xub_StrLen const nVal ) +inline sal_Int32 SwIndex::operator-=( sal_Int32 const nVal ) { return ChgValue( *this, m_nIndex - nVal ).m_nIndex; } -inline xub_StrLen SwIndex::operator+=( const SwIndex& rIndex ) +inline sal_Int32 SwIndex::operator+=( const SwIndex& rIndex ) { return ChgValue( *this, m_nIndex + rIndex.m_nIndex ).m_nIndex; } -inline xub_StrLen SwIndex::operator-=( const SwIndex& rIndex ) +inline sal_Int32 SwIndex::operator-=( const SwIndex& rIndex ) { return ChgValue( *this, m_nIndex - rIndex.m_nIndex ).m_nIndex; } @@ -194,7 +191,7 @@ inline bool SwIndex::operator>=( const SwIndex& rIndex ) const { return m_nIndex >= rIndex.m_nIndex; } -inline SwIndex& SwIndex::operator= ( xub_StrLen const nVal ) +inline SwIndex& SwIndex::operator= ( sal_Int32 const nVal ) { if (m_nIndex != nVal) { diff --git a/sw/inc/ndhints.hxx b/sw/inc/ndhints.hxx index c08ebbb81cc2..91aebe985a0f 100644 --- a/sw/inc/ndhints.hxx +++ b/sw/inc/ndhints.hxx @@ -42,11 +42,11 @@ typedef enum { /// if COPY then pTxtNode must be given! SW_DLLPRIVATE SwTxtAttr * MakeTxtAttr( SwDoc & rDoc, SfxPoolItem & rNew, - xub_StrLen const nStt, xub_StrLen const nEnd, + sal_Int32 const nStt, sal_Int32 const nEnd, CopyOrNew_t const bIsCopy = NEW, SwTxtNode *const pTxtNode = 0); SW_DLLPRIVATE SwTxtAttr * MakeTxtAttr( SwDoc & rDoc, const SfxItemSet & rSet, - xub_StrLen nStt, xub_StrLen nEnd ); + sal_Int32 nStt, sal_Int32 nEnd ); /// create redline dummy text hint that must not be inserted into hints array SW_DLLPRIVATE SwTxtAttr* diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index 49b66e2c0e3f..923280e40917 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -222,7 +222,7 @@ public: virtual ~SwTxtNode(); - virtual xub_StrLen Len() const; + virtual sal_Int32 Len() const; /// Is in itratr. void GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMax, sal_uLong &rAbs, @@ -735,7 +735,7 @@ public: TYPEINFO(); // fuer rtti /// override SwIndexReg - virtual void Update( SwIndex const & rPos, const xub_StrLen nChangeLen, + virtual void Update( SwIndex const & rPos, const sal_Int32 nChangeLen, const bool bNegative = false, const bool bDelete = false ); /// change text to Upper/Lower/Hiragana/Katagana/... diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index 94908cc6c8a3..93ebc5cfd330 100644 --- a/sw/inc/node.hxx +++ b/sw/inc/node.hxx @@ -427,7 +427,7 @@ public: /** @return count of elements of node content. Default is 1. There are differences between text node and formula node. */ - virtual xub_StrLen Len() const; + virtual sal_Int32 Len() const; virtual SwCntntNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const = 0; diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx index 15e54c0d8b8b..6d543c1584c9 100644 --- a/sw/inc/pam.hxx +++ b/sw/inc/pam.hxx @@ -54,7 +54,7 @@ struct SW_DLLPUBLIC SwPosition SwPosition( const SwNodeIndex &rNode, const SwIndex &rCntnt ); explicit SwPosition( const SwNodeIndex &rNode ); explicit SwPosition( const SwNode& rNode ); - explicit SwPosition( SwCntntNode& rNode, const xub_StrLen nOffset = 0 ); + explicit SwPosition( SwCntntNode& rNode, const sal_Int32 nOffset = 0 ); SwPosition( const SwPosition & ); SwPosition &operator=(const SwPosition &); @@ -203,7 +203,7 @@ public: bool DoSearch( const com::sun::star::util::SearchOptions& rSearchOpt, utl::TextSearch& rSTxt, SwMoveFn fnMove, bool bSrchForward, bool bRegSearch, bool bChkEmptyPara, bool bChkParaEnd, - xub_StrLen &nStart, xub_StrLen &nEnde,xub_StrLen nTxtLen,SwNode* pNode, SwPaM* pPam); + sal_Int32 &nStart, sal_Int32 &nEnd, sal_Int32 nTxtLen, SwNode* pNode, SwPaM* pPam); inline bool IsInFrontOfLabel() const { return m_bIsInFrontOfLabel; } inline void _SetInFrontOfLabel( bool bNew ) { m_bIsInFrontOfLabel = bNew; } diff --git a/sw/inc/swbaslnk.hxx b/sw/inc/swbaslnk.hxx index 3d35fcae0cd7..5a93b5fcac23 100644 --- a/sw/inc/swbaslnk.hxx +++ b/sw/inc/swbaslnk.hxx @@ -74,8 +74,8 @@ public: void SetObjType( sal_uInt16 nType ) { SvBaseLink::SetObjType( nType ); } sal_Bool IsRecursion( const SwBaseLink* pChkLnk ) const; - virtual sal_Bool IsInRange( sal_uLong nSttNd, sal_uLong nEndNd, xub_StrLen nStt = 0, - xub_StrLen nEnd = STRING_NOTFOUND ) const; + virtual sal_Bool IsInRange( sal_uLong nSttNd, sal_uLong nEndNd, sal_Int32 nStt = 0, + sal_Int32 nEnd = -1 ) const; void SetNoDataFlag() { bNoDataFlag = sal_True; } sal_Bool ChkNoDataFlag() { sal_Bool bRet = bNoDataFlag; bNoDataFlag = sal_False; return bRet; } diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx index 46278503b16e..69f476ac72d6 100644 --- a/sw/inc/swcrsr.hxx +++ b/sw/inc/swcrsr.hxx @@ -240,7 +240,7 @@ public: struct _SwCursor_SavePos { sal_uLong nNode; - xub_StrLen nCntnt; + sal_Int32 nCntnt; _SwCursor_SavePos* pNext; _SwCursor_SavePos( const SwCursor& rCrsr ) @@ -260,7 +260,8 @@ class SwTableCursor : public virtual SwCursor protected: sal_uLong nTblPtNd, nTblMkNd; - xub_StrLen nTblPtCnt, nTblMkCnt; + sal_Int32 nTblPtCnt; + sal_Int32 nTblMkCnt; SwSelBoxes m_SelectedBoxes; sal_Bool bChg : 1; sal_Bool bParked : 1; // Table-cursor was parked. diff --git a/sw/inc/txatbase.hxx b/sw/inc/txatbase.hxx index a5836b5d9570..234110a3d615 100644 --- a/sw/inc/txatbase.hxx +++ b/sw/inc/txatbase.hxx @@ -44,7 +44,7 @@ class SwTxtAttr : private boost::noncopyable { private: SfxPoolItem * const m_pAttr; - xub_StrLen m_nStart; + sal_Int32 m_nStart; bool m_bDontExpand : 1; bool m_bLockExpandFlag : 1; @@ -59,7 +59,7 @@ private: bool m_bFormatIgnoreEnd : 1; ///< text formatting should ignore end protected: - SwTxtAttr( SfxPoolItem& rAttr, xub_StrLen nStart ); + SwTxtAttr( SfxPoolItem& rAttr, sal_Int32 nStart ); virtual ~SwTxtAttr(); void SetLockExpandFlag( bool bFlag ) { m_bLockExpandFlag = bFlag; } @@ -76,14 +76,14 @@ public: static void Destroy( SwTxtAttr * pToDestroy, SfxItemPool& rPool ); /// start position - xub_StrLen* GetStart() { return & m_nStart; } - const xub_StrLen* GetStart() const { return & m_nStart; } + sal_Int32* GetStart() { return & m_nStart; } + const sal_Int32* GetStart() const { return & m_nStart; } /// end position - virtual xub_StrLen* GetEnd(); - inline const xub_StrLen* GetEnd() const; + virtual sal_Int32* GetEnd(); + inline const sal_Int32* GetEnd() const; /// end (if available), else start - inline const xub_StrLen* GetAnyEnd() const; + inline const sal_Int32* GetAnyEnd() const; inline void SetDontExpand( bool bDontExpand ); bool DontExpand() const { return m_bDontExpand; } @@ -123,26 +123,26 @@ public: class SwTxtAttrEnd : public SwTxtAttr { protected: - xub_StrLen m_nEnd; + sal_Int32 m_nEnd; public: - SwTxtAttrEnd( SfxPoolItem& rAttr, xub_StrLen nStart, xub_StrLen nEnd ); + SwTxtAttrEnd( SfxPoolItem& rAttr, sal_Int32 nStart, sal_Int32 nEnd ); using SwTxtAttr::GetEnd; - virtual xub_StrLen* GetEnd(); + virtual sal_Int32* GetEnd(); }; // --------------- Inline Implementations ------------------------ -inline const xub_StrLen* SwTxtAttr::GetEnd() const +inline const sal_Int32* SwTxtAttr::GetEnd() const { return const_cast<SwTxtAttr * >(this)->GetEnd(); } -inline const xub_StrLen* SwTxtAttr::GetAnyEnd() const +inline const sal_Int32* SwTxtAttr::GetAnyEnd() const { - const xub_StrLen* pEnd = GetEnd(); + const sal_Int32* pEnd = GetEnd(); return pEnd ? pEnd : GetStart(); } diff --git a/sw/inc/txtfld.hxx b/sw/inc/txtfld.hxx index cffdd1f2a00b..3c98492733a0 100644 --- a/sw/inc/txtfld.hxx +++ b/sw/inc/txtfld.hxx @@ -32,7 +32,7 @@ class SwTxtFld : public SwTxtAttr SwTxtNode * m_pTxtNode; public: - SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStart, + SwTxtFld(SwFmtFld & rAttr, sal_Int32 const nStart, bool const bInClipboard); virtual ~SwTxtFld(); diff --git a/sw/inc/txtrfmrk.hxx b/sw/inc/txtrfmrk.hxx index 56e757ffde81..ae944f96f7ff 100644 --- a/sw/inc/txtrfmrk.hxx +++ b/sw/inc/txtrfmrk.hxx @@ -29,14 +29,14 @@ class SwTxtNode; class SwTxtRefMark : public SwTxtAttrEnd { SwTxtNode * m_pTxtNode; - xub_StrLen * m_pEnd; // end is optional (point reference) + sal_Int32 * m_pEnd; // end is optional (point reference) public: SwTxtRefMark( SwFmtRefMark& rAttr, - xub_StrLen const nStart, xub_StrLen const*const pEnd = 0); + sal_Int32 const nStart, sal_Int32 const*const pEnd = 0); - virtual xub_StrLen * GetEnd(); // SwTxtAttr - inline const xub_StrLen * GetEnd() const { return m_pEnd; } + virtual sal_Int32 * GetEnd(); // SwTxtAttr + inline const sal_Int32 * GetEnd() const { return m_pEnd; } // get and set TxtNode pointer inline const SwTxtNode& GetTxtNode() const; diff --git a/sw/inc/txttxmrk.hxx b/sw/inc/txttxmrk.hxx index 313f734ecbf3..ccc870743d4c 100644 --- a/sw/inc/txttxmrk.hxx +++ b/sw/inc/txttxmrk.hxx @@ -30,15 +30,15 @@ class SwDoc; class SwTxtTOXMark : public SwTxtAttrEnd { SwTxtNode * m_pTxtNode; - xub_StrLen * m_pEnd; // 0 if SwTOXMark without AlternativeText + sal_Int32 * m_pEnd; // 0 if SwTOXMark without AlternativeText public: SwTxtTOXMark( SwTOXMark& rAttr, - xub_StrLen const nStart, xub_StrLen const*const pEnd = 0); + sal_Int32 const nStart, sal_Int32 const*const pEnd = 0); virtual ~SwTxtTOXMark(); - virtual xub_StrLen *GetEnd(); // SwTxtAttr - inline const xub_StrLen* GetEnd() const { return m_pEnd; } + virtual sal_Int32 *GetEnd(); // SwTxtAttr + inline const sal_Int32* GetEnd() const { return m_pEnd; } void CopyTOXMark( SwDoc* pDestDoc ); diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx index 504e9e4819cf..c17ae9a9d6c5 100644 --- a/sw/qa/core/uwriter.cxx +++ b/sw/qa/core/uwriter.cxx @@ -230,7 +230,7 @@ void SwDocTest::testModelToViewHelper() m_pDoc->AppendTxtNode(*aPaM.GetPoint()); m_pDoc->InsertString(aPaM, OUString("AAAAA BBBBB ")); SwTxtNode* pTxtNode = aPaM.GetNode()->GetTxtNode(); - xub_StrLen nPos = aPaM.GetPoint()->nContent.GetIndex(); + sal_Int32 nPos = aPaM.GetPoint()->nContent.GetIndex(); pTxtNode->InsertItem(aFtn, nPos, nPos); m_pDoc->InsertString(aPaM, OUString(" CCCCC ")); nPos = aPaM.GetPoint()->nContent.GetIndex(); @@ -446,7 +446,7 @@ void SwDocTest::testSwScanner() m_pDoc->AppendTxtNode(*aPaM.GetPoint()); m_pDoc->InsertString(aPaM, OUString("Apple")); pTxtNode = aPaM.GetNode()->GetTxtNode(); - xub_StrLen nPos = aPaM.GetPoint()->nContent.GetIndex(); + sal_Int32 nPos = aPaM.GetPoint()->nContent.GetIndex(); SwFmtFtn aFtn; aFtn.SetNumStr(OUString("banana")); SwTxtAttr* pTA = pTxtNode->InsertItem(aFtn, nPos, nPos); @@ -456,7 +456,7 @@ void SwDocTest::testSwScanner() CPPUNIT_ASSERT(aDocStat.nWord == 1); CPPUNIT_ASSERT_MESSAGE("footnote should be expanded", aDocStat.nChar == 11); - xub_StrLen nNextPos = aPaM.GetPoint()->nContent.GetIndex(); + const sal_Int32 nNextPos = aPaM.GetPoint()->nContent.GetIndex(); CPPUNIT_ASSERT(nNextPos == nPos+1); SwFmtRefMark aRef(OUString("refmark")); pTA = pTxtNode->InsertItem(aRef, nNextPos, nNextPos); diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 8fd994724cb1..12c76b8a6af7 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -46,7 +46,7 @@ SwDoc* SwUiWriterTest::createDoc(const char* pName) //Replacement tests -static void lcl_selectCharacters(SwPaM& rPaM, int first, int end) +static void lcl_selectCharacters(SwPaM& rPaM, sal_Int32 first, sal_Int32 end) { rPaM.GetPoint()->nContent.Assign(rPaM.GetCntntNode(), first); rPaM.SetMark(); diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index daa821436525..b8a2ce56a8fa 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -505,11 +505,11 @@ class SwAccessibleEventMap_Impl: public _SwAccessibleEventMap_Impl struct SwAccessibleParaSelection { - xub_StrLen nStartOfSelection; - xub_StrLen nEndOfSelection; + sal_Int32 nStartOfSelection; + sal_Int32 nEndOfSelection; - SwAccessibleParaSelection( const xub_StrLen _nStartOfSelection, - const xub_StrLen _nEndOfSelection ) + SwAccessibleParaSelection( const sal_Int32 _nStartOfSelection, + const sal_Int32 _nEndOfSelection ) : nStartOfSelection( _nStartOfSelection ), nEndOfSelection( _nEndOfSelection ) {} @@ -2610,7 +2610,7 @@ SwAccessibleSelectedParas_Impl* SwAccessibleMap::_BuildSelectedParas() : 0, pTxtNode == &(pEndPos->nNode.GetNode()) ? pEndPos->nContent.GetIndex() - : STRING_LEN ); + : -1 ); SwAccessibleSelectedParas_Impl::value_type aEntry( xWeakAcc, aDataEntry ); if ( !pRetSelectedParas ) diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 566f1ba2a215..470525116f05 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -132,7 +132,7 @@ sal_Int32 SwAccessibleParagraph::GetCaretPos() { // same node? Then check whether it's also within 'our' part // of the paragraph - sal_uInt16 nIndex = pPoint->nContent.GetIndex(); + const sal_Int32 nIndex = pPoint->nContent.GetIndex(); if( GetPortionData().IsValidCorePosition( nIndex ) ) { // Yes, it's us! @@ -207,7 +207,7 @@ sal_Bool SwAccessibleParagraph::GetSelection( // selection starts in this node: // then check whether it's before or inside our part of // the paragraph, and if so, get the proper position - sal_uInt16 nCoreStart = pStart->nContent.GetIndex(); + const sal_Int32 nCoreStart = pStart->nContent.GetIndex(); if( nCoreStart < GetPortionData().GetFirstValidCorePosition() ) { @@ -243,7 +243,7 @@ sal_Bool SwAccessibleParagraph::GetSelection( // selection ends in this node: then select everything // before our part of the node - sal_uInt16 nCoreEnd = pEnd->nContent.GetIndex(); + const sal_Int32 nCoreEnd = pEnd->nContent.GetIndex(); if( nCoreEnd > GetPortionData().GetLastValidCorePosition() ) { @@ -559,8 +559,8 @@ SwXTextPortion* SwAccessibleParagraph::CreateUnoPortion( IsValidRange(nStartIndex, nEndIndex, GetString().getLength()), "please check parameters before calling this method" ); - sal_uInt16 nStart = GetPortionData().GetModelPosition( nStartIndex ); - sal_uInt16 nEnd = (nEndIndex == -1) ? (nStart + 1) : + const sal_Int32 nStart = GetPortionData().GetModelPosition( nStartIndex ); + const sal_Int32 nEnd = (nEndIndex == -1) ? (nStart + 1) : GetPortionData().GetModelPosition( nEndIndex ); // create UNO cursor @@ -1433,9 +1433,9 @@ void SwAccessibleParagraph::_getRunAttributesImpl( { const SwTxtNode* pTxtNode( GetTxtNode() ); SwPosition* pStartPos = new SwPosition( *pTxtNode ); - pStartPos->nContent.Assign( const_cast<SwTxtNode*>(pTxtNode), static_cast<sal_uInt16>(nIndex) ); + pStartPos->nContent.Assign( const_cast<SwTxtNode*>(pTxtNode), nIndex ); SwPosition* pEndPos = new SwPosition( *pTxtNode ); - pEndPos->nContent.Assign( const_cast<SwTxtNode*>(pTxtNode), static_cast<sal_uInt16>(nIndex+1) ); + pEndPos->nContent.Assign( const_cast<SwTxtNode*>(pTxtNode), nIndex+1 ); pPaM = new SwPaM( *pStartPos, *pEndPos ); @@ -1692,7 +1692,7 @@ sal_Int32 SwAccessibleParagraph::getIndexAtPoint( const awt::Point& rPoint ) sal_Bool bSuccess = pFrm->GetCrsrOfst( &aPos, aCorePoint, &aMoveState ); SwIndex aCntntIdx = aPos.nContent; - const xub_StrLen nIndex = aCntntIdx.GetIndex(); + const sal_Int32 nIndex = aCntntIdx.GetIndex(); if ( nIndex > 0 ) { SwRect aResultRect; @@ -2018,7 +2018,8 @@ sal_Bool SwAccessibleParagraph::replaceText( SwTxtNode* pNode = const_cast<SwTxtNode*>( GetTxtNode() ); // translate positions - sal_uInt16 nStart, nEnd; + sal_Int32 nStart; + sal_Int32 nEnd; sal_Bool bSuccess = GetPortionData().GetEditableRange( nStartIndex, nEndIndex, nStart, nEnd ); @@ -2196,8 +2197,8 @@ void SwAccessibleParagraph::deselectAccessibleChild( class SwHyperlinkIter_Impl { const SwpHints *pHints; - xub_StrLen nStt; - xub_StrLen nEnd; + sal_Int32 nStt; + sal_Int32 nEnd; sal_uInt16 nPos; public: @@ -2205,8 +2206,8 @@ public: const SwTxtAttr *next(); sal_uInt16 getCurrHintPos() const { return nPos-1; } - xub_StrLen startIdx() const { return nStt; } - xub_StrLen endIdx() const { return nEnd; } + sal_Int32 startIdx() const { return nStt; } + sal_Int32 endIdx() const { return nEnd; } }; SwHyperlinkIter_Impl::SwHyperlinkIter_Impl( const SwTxtFrm *pTxtFrm ) : @@ -2228,8 +2229,8 @@ const SwTxtAttr *SwHyperlinkIter_Impl::next() const SwTxtAttr *pHt = (*pHints)[nPos]; if( RES_TXTATR_INETFMT == pHt->Which() ) { - xub_StrLen nHtStt = *pHt->GetStart(); - xub_StrLen nHtEnd = *pHt->GetAnyEnd(); + const sal_Int32 nHtStt = *pHt->GetStart(); + const sal_Int32 nHtEnd = *pHt->GetAnyEnd(); if( nHtEnd > nHtStt && ( (nHtStt >= nStt && nHtStt < nEnd) || (nHtEnd > nStt && nHtEnd <= nEnd) ) ) @@ -2291,9 +2292,9 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL } if( !xRet.is() ) { - sal_Int32 nHStt= GetPortionData().GetAccessiblePosition( + const sal_Int32 nHStt= GetPortionData().GetAccessiblePosition( max( aHIter.startIdx(), *pHt->GetStart() ) ); - sal_Int32 nHEnd= GetPortionData().GetAccessiblePosition( + const sal_Int32 nHEnd= GetPortionData().GetAccessiblePosition( min( aHIter.endIdx(), *pHt->GetAnyEnd() ) ); xRet = new SwAccessibleHyperlink( aHIter.getCurrHintPos(), this, nHStt, nHEnd ); @@ -2335,7 +2336,7 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getHyperLinkIndex( sal_Int32 nCharInde const SwTxtFrm *pTxtFrm = static_cast<const SwTxtFrm*>( GetFrm() ); SwHyperlinkIter_Impl aHIter( pTxtFrm ); - xub_StrLen nIdx = GetPortionData().GetModelPosition( nCharIndex ); + const sal_Int32 nIdx = GetPortionData().GetModelPosition( nCharIndex ); sal_Int32 nPos = 0; const SwTxtAttr *pHt = aHIter.next(); while( pHt && !(nIdx >= *pHt->GetStart() && nIdx < *pHt->GetAnyEnd()) ) diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx index 4bedfca89b60..20c5d9a8b7c4 100644 --- a/sw/source/core/access/accportions.cxx +++ b/sw/source/core/access/accportions.cxx @@ -332,7 +332,7 @@ void SwAccessiblePortionData::GetLastLineBoundary( FillBoundary( rBound, aLineBreaks, nBreaks <= 3 ? 0 : nBreaks-4 ); } -sal_uInt16 SwAccessiblePortionData::GetModelPosition( sal_Int32 nPos ) const +sal_Int32 SwAccessiblePortionData::GetModelPosition( sal_Int32 nPos ) const { OSL_ENSURE( nPos >= 0, "illegal position" ); OSL_ENSURE( nPos <= sAccessibleString.getLength(), "illegal position" ); @@ -360,7 +360,7 @@ sal_uInt16 SwAccessiblePortionData::GetModelPosition( sal_Int32 nPos ) const OSL_ENSURE( (nStartPos >= 0) && (nStartPos < USHRT_MAX), "How can the SwTxtNode have so many characters?" ); - return static_cast<sal_uInt16>(nStartPos); + return nStartPos; } void SwAccessiblePortionData::FillBoundary( @@ -512,14 +512,13 @@ void SwAccessiblePortionData::GetAttributeBoundary( FindBreak( aAccessiblePositions, nPos ) ); } -sal_Int32 SwAccessiblePortionData::GetAccessiblePosition( sal_uInt16 nPos ) const +sal_Int32 SwAccessiblePortionData::GetAccessiblePosition( sal_Int32 nPos ) const { OSL_ENSURE( nPos <= pTxtNode->GetTxt().getLength(), "illegal position" ); // find the portion number // #i70538# - consider "empty" model portions - e.g. number portion - size_t nPortionNo = FindLastBreak( aModelPositions, - static_cast<sal_Int32>(nPos) ); + size_t nPortionNo = FindLastBreak( aModelPositions, nPos ); sal_Int32 nRet = aAccessiblePositions[nPortionNo]; @@ -643,25 +642,24 @@ sal_uInt16 SwAccessiblePortionData::FillSpecialPos( void SwAccessiblePortionData::AdjustAndCheck( sal_Int32 nPos, size_t& nPortionNo, - sal_uInt16& nCorePos, + sal_Int32& nCorePos, sal_Bool& bEdit) const { // find portion and get mode position nPortionNo = FindBreak( aAccessiblePositions, nPos ); - nCorePos = static_cast<sal_uInt16>( aModelPositions[ nPortionNo ] ); + nCorePos = aModelPositions[ nPortionNo ]; // for special portions, make sure we're on a portion boundary // for text portions, add the in-portion offset if( IsSpecialPortion( nPortionNo ) ) bEdit &= nPos == aAccessiblePositions[nPortionNo]; else - nCorePos = static_cast<sal_uInt16>( nCorePos + - nPos - aAccessiblePositions[nPortionNo] ); + nCorePos += nPos - aAccessiblePositions[nPortionNo]; } sal_Bool SwAccessiblePortionData::GetEditableRange( sal_Int32 nStart, sal_Int32 nEnd, - sal_uInt16& nCoreStart, sal_uInt16& nCoreEnd ) const + sal_Int32& nCoreStart, sal_Int32& nCoreEnd ) const { sal_Bool bIsEditable = sal_True; @@ -696,21 +694,21 @@ sal_Bool SwAccessiblePortionData::GetEditableRange( return bIsEditable; } -sal_Bool SwAccessiblePortionData::IsValidCorePosition( sal_uInt16 nPos ) const +sal_Bool SwAccessiblePortionData::IsValidCorePosition( sal_Int32 nPos ) const { // a position is valid its within the model positions that we know return ( aModelPositions[0] <= nPos ) && ( nPos <= aModelPositions[ aModelPositions.size()-1 ] ); } -sal_uInt16 SwAccessiblePortionData::GetFirstValidCorePosition() const +sal_Int32 SwAccessiblePortionData::GetFirstValidCorePosition() const { - return static_cast<sal_uInt16>( aModelPositions[0] ); + return aModelPositions[0]; } -sal_uInt16 SwAccessiblePortionData::GetLastValidCorePosition() const +sal_Int32 SwAccessiblePortionData::GetLastValidCorePosition() const { - return static_cast<sal_uInt16>( aModelPositions[ aModelPositions.size()-1 ] ); + return aModelPositions[ aModelPositions.size()-1 ]; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/access/accportions.hxx b/sw/source/core/access/accportions.hxx index a2efbe862cf0..25f1df840efa 100644 --- a/sw/source/core/access/accportions.hxx +++ b/sw/source/core/access/accportions.hxx @@ -87,7 +87,7 @@ class SwAccessiblePortionData : public SwPortionHandler // helper method for GetEditableRange(...): void AdjustAndCheck( sal_Int32 nPos, size_t& nPortionNo, - sal_uInt16& nCorePos, sal_Bool& bEdit ) const; + sal_Int32& nCorePos, sal_Bool& bEdit ) const; public: SwAccessiblePortionData( const SwTxtNode* pTxtNd, @@ -121,10 +121,10 @@ public: /// get the position in the model string for a given /// (accessibility) position - sal_uInt16 GetModelPosition( sal_Int32 nPos ) const; + sal_Int32 GetModelPosition( sal_Int32 nPos ) const; /// get the position in the accessibility string for a given model position - sal_Int32 GetAccessiblePosition( sal_uInt16 nPos ) const; + sal_Int32 GetAccessiblePosition( sal_Int32 nPos ) const; /// fill a SwSpecialPos structure, suitable for calling /// SwTxtFrm->GetCharRect @@ -148,16 +148,16 @@ public: /// or not at all. This can be used to test whether editing /// that range would be legal sal_Bool GetEditableRange( sal_Int32 nStart, sal_Int32 nEnd, - sal_uInt16& nCoreStart, sal_uInt16& nCoreEnd ) const; + sal_Int32& nCoreStart, sal_Int32& nCoreEnd ) const; /// Determine whether this core position is valid for these portions. /// (A paragraph may be split into several frames, e.g. at page /// boundaries. In this case, only part of a paragraph is represented /// through this object. This method determines whether one particular /// position is valid for this object or not.) - sal_Bool IsValidCorePosition( sal_uInt16 nPos ) const; - sal_uInt16 GetFirstValidCorePosition() const; - sal_uInt16 GetLastValidCorePosition() const; + sal_Bool IsValidCorePosition( sal_Int32 nPos ) const; + sal_Int32 GetFirstValidCorePosition() const; + sal_Int32 GetLastValidCorePosition() const; }; #endif diff --git a/sw/source/core/access/textmarkuphelper.cxx b/sw/source/core/access/textmarkuphelper.cxx index 989c6f68f8e8..3489cc8e106d 100644 --- a/sw/source/core/access/textmarkuphelper.cxx +++ b/sw/source/core/access/textmarkuphelper.cxx @@ -162,7 +162,7 @@ sal_Int32 SwTextMarkupHelper::getTextMarkupCount( const sal_Int32 nTextMarkupTyp // assumption: // value of <nCharIndex> is in range [0..length of accessible text) - const sal_uInt16 nCoreCharIndex = mrPortionData.GetModelPosition( nCharIndex ); + const sal_Int32 nCoreCharIndex = mrPortionData.GetModelPosition( nCharIndex ); // Handling of portions with core length == 0 at the beginning of the // paragraph - e.g. numbering portion. if ( mrPortionData.GetAccessiblePosition( nCoreCharIndex ) > nCharIndex ) diff --git a/sw/source/core/attr/hints.cxx b/sw/source/core/attr/hints.cxx index 734ba21e81ac..24254516d8ac 100644 --- a/sw/source/core/attr/hints.cxx +++ b/sw/source/core/attr/hints.cxx @@ -29,7 +29,7 @@ SwFmtChg::SwFmtChg( SwFmt* pFmt ) { } -SwInsTxt::SwInsTxt( xub_StrLen nP, xub_StrLen nL ) +SwInsTxt::SwInsTxt( sal_Int32 nP, sal_Int32 nL ) : SwMsgPoolItem( RES_INS_TXT ), nPos( nP ), nLen( nL ) { } diff --git a/sw/source/core/bastyp/index.cxx b/sw/source/core/bastyp/index.cxx index 7a3e68f13a3f..f3c0cc630752 100644 --- a/sw/source/core/bastyp/index.cxx +++ b/sw/source/core/bastyp/index.cxx @@ -30,7 +30,7 @@ TYPEINIT0(SwIndexReg); // SwIndex // ------- -SwIndex::SwIndex(SwIndexReg *const pReg, xub_StrLen const nIdx) +SwIndex::SwIndex(SwIndexReg *const pReg, sal_Int32 const nIdx) : m_nIndex( nIdx ) , m_pIndexReg( pReg ) , m_pNext( 0 ) @@ -56,7 +56,7 @@ SwIndex::SwIndex( const SwIndex& rIdx ) ChgValue( rIdx, rIdx.m_nIndex ); } -void SwIndex::Init(xub_StrLen const nIdx) +void SwIndex::Init(sal_Int32 const nIdx) { if (!m_pIndexReg) { @@ -79,7 +79,7 @@ void SwIndex::Init(xub_StrLen const nIdx) } } -SwIndex& SwIndex::ChgValue( const SwIndex& rIdx, xub_StrLen nNewValue ) +SwIndex& SwIndex::ChgValue( const SwIndex& rIdx, sal_Int32 nNewValue ) { assert(m_pIndexReg == rIdx.m_pIndexReg); if (!m_pIndexReg) @@ -197,7 +197,7 @@ SwIndex& SwIndex::operator=( const SwIndex& rIdx ) return *this; } -SwIndex& SwIndex::Assign( SwIndexReg* pArr, xub_StrLen nIdx ) +SwIndex& SwIndex::Assign( SwIndexReg* pArr, sal_Int32 nIdx ) { if (pArr != m_pIndexReg) // unregister! { @@ -227,14 +227,14 @@ SwIndexReg::~SwIndexReg() assert(!m_pFirst && !m_pLast); // There are still indices registered } -void SwIndexReg::Update( SwIndex const & rIdx, const xub_StrLen nDiff, +void SwIndexReg::Update( SwIndex const & rIdx, const sal_Int32 nDiff, const bool bNeg, const bool /* argument is only used in derived class*/ ) { SwIndex* pStt = const_cast<SwIndex*>(&rIdx); - xub_StrLen nNewVal = rIdx.m_nIndex; + const sal_Int32 nNewVal = rIdx.m_nIndex; if( bNeg ) { - xub_StrLen nLast = rIdx.GetIndex() + nDiff; + const sal_Int32 nLast = rIdx.GetIndex() + nDiff; while (pStt && pStt->m_nIndex == nNewVal) { pStt->m_nIndex = nNewVal; @@ -291,57 +291,57 @@ void SwIndexReg::MoveTo( SwIndexReg& rArr ) // SwIndex // ------- -xub_StrLen SwIndex::operator++(int) +sal_Int32 SwIndex::operator++(int) { - OSL_ASSERT( m_nIndex < INVALID_INDEX ); + OSL_ASSERT( m_nIndex < SAL_MAX_INT32 ); - xub_StrLen nOldIndex = m_nIndex; + const sal_Int32 nOldIndex = m_nIndex; ChgValue( *this, m_nIndex+1 ); return nOldIndex; } -xub_StrLen SwIndex::operator++() +sal_Int32 SwIndex::operator++() { - OSL_ASSERT( m_nIndex < INVALID_INDEX ); + OSL_ASSERT( m_nIndex < SAL_MAX_INT32 ); ChgValue( *this, m_nIndex+1 ); return m_nIndex; } -xub_StrLen SwIndex::operator--(int) +sal_Int32 SwIndex::operator--(int) { - OSL_ASSERT( m_nIndex ); + OSL_ASSERT( m_nIndex>0 ); - xub_StrLen nOldIndex = m_nIndex; + const sal_Int32 nOldIndex = m_nIndex; ChgValue( *this, m_nIndex-1 ); return nOldIndex; } -xub_StrLen SwIndex::operator--() +sal_Int32 SwIndex::operator--() { - OSL_ASSERT( m_nIndex ); + OSL_ASSERT( m_nIndex>0 ); return ChgValue( *this, m_nIndex-1 ).m_nIndex; } -xub_StrLen SwIndex::operator+=( xub_StrLen const nVal ) +sal_Int32 SwIndex::operator+=( sal_Int32 const nVal ) { - OSL_ASSERT( m_nIndex < INVALID_INDEX - nVal ); + OSL_ASSERT( m_nIndex <= SAL_MAX_INT32 - nVal ); return ChgValue( *this, m_nIndex + nVal ).m_nIndex; } -xub_StrLen SwIndex::operator-=( xub_StrLen const nVal ) +sal_Int32 SwIndex::operator-=( sal_Int32 const nVal ) { OSL_ASSERT( m_nIndex >= nVal ); return ChgValue( *this, m_nIndex - nVal ).m_nIndex; } -xub_StrLen SwIndex::operator+=( const SwIndex & rIndex ) +sal_Int32 SwIndex::operator+=( const SwIndex & rIndex ) { - OSL_ASSERT( m_nIndex < INVALID_INDEX - rIndex.m_nIndex ); + OSL_ASSERT( m_nIndex <= SAL_MAX_INT32 - rIndex.m_nIndex ); return ChgValue( *this, m_nIndex + rIndex.m_nIndex ).m_nIndex; } -xub_StrLen SwIndex::operator-=( const SwIndex & rIndex ) +sal_Int32 SwIndex::operator-=( const SwIndex & rIndex ) { OSL_ASSERT( m_nIndex >= rIndex.m_nIndex ); return ChgValue( *this, m_nIndex - rIndex.m_nIndex ).m_nIndex; @@ -375,7 +375,7 @@ bool SwIndex::operator>=( const SwIndex & rIndex ) const return m_nIndex >= rIndex.m_nIndex; } -SwIndex& SwIndex::operator= ( xub_StrLen const nVal ) +SwIndex& SwIndex::operator= ( sal_Int32 const nVal ) { if (m_nIndex != nVal) ChgValue( *this, nVal ); diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index 962f5268aa44..f09895aa2d30 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -72,7 +72,7 @@ namespace SwTxtNode const*const pEndTxtNode = rEnd.nNode.GetNode().GetTxtNode(); const sal_Unicode ch_start = ( rStart.nContent.GetIndex() >= pStartTxtNode->GetTxt().getLength() ) ? 0 : pStartTxtNode->GetTxt()[rStart.nContent.GetIndex()]; - xub_StrLen nEndPos = ( rEnd == rStart || rEnd.nContent.GetIndex() == 0 ) ? + const sal_Int32 nEndPos = ( rEnd == rStart || rEnd.nContent.GetIndex() == 0 ) ? rEnd.nContent.GetIndex() : rEnd.nContent.GetIndex() - 1; const sal_Unicode ch_end = nEndPos >= pEndTxtNode->GetTxt().getLength() ? 0 : pEndTxtNode->GetTxt()[nEndPos]; SwPaM aStartPaM(rStart); @@ -104,7 +104,7 @@ namespace SwTxtNode const*const pEndTxtNode = rEnd.nNode.GetNode().GetTxtNode(); const sal_Unicode ch_start = pStartTxtNode->GetTxt()[rStart.nContent.GetIndex()]; - xub_StrLen nEndPos = ( rEnd == rStart || rEnd.nContent.GetIndex() == 0 ) ? + const sal_Int32 nEndPos = ( rEnd == rStart || rEnd.nContent.GetIndex() == 0 ) ? rEnd.nContent.GetIndex() : rEnd.nContent.GetIndex() - 1; const sal_Unicode ch_end = pEndTxtNode->GetTxt()[nEndPos]; SwPaM aStartPaM(rStart); diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx index 04f616bb3978..4b22683d2313 100644 --- a/sw/source/core/crsr/callnk.cxx +++ b/sw/source/core/crsr/callnk.cxx @@ -36,7 +36,7 @@ #include <breakit.hxx> #include<vcl/window.hxx> -SwCallLink::SwCallLink( SwCrsrShell & rSh, sal_uLong nAktNode, xub_StrLen nAktCntnt, +SwCallLink::SwCallLink( SwCrsrShell & rSh, sal_uLong nAktNode, sal_Int32 nAktCntnt, sal_uInt8 nAktNdTyp, long nLRPos, bool bAktSelection ) : rShell( rSh ), nNode( nAktNode ), nCntnt( nAktCntnt ), nNdTyp( nAktNdTyp ), nLeftFrmPos( nLRPos ), @@ -127,7 +127,7 @@ SwCallLink::~SwCallLink() } lcl_notifyRow(pNode, rShell); - xub_StrLen nCmp, nAktCntnt = pCurCrsr->GetPoint()->nContent.GetIndex(); + sal_Int32 nCmp, nAktCntnt = pCurCrsr->GetPoint()->nContent.GetIndex(); sal_uInt16 nNdWhich = pCNd->GetNodeType(); sal_uLong nAktNode = pCurCrsr->GetPoint()->nNode.GetIndex(); @@ -165,8 +165,8 @@ SwCallLink::~SwCallLink() { const SwpHints &rHts = ((SwTxtNode*)pCNd)->GetSwpHints(); sal_uInt16 n; - xub_StrLen nStart; - const xub_StrLen *pEnd; + sal_Int32 nStart; + const sal_Int32 *pEnd; for( n = 0; n < rHts.Count(); n++ ) { @@ -235,7 +235,7 @@ SwCallLink::~SwCallLink() } } -long SwCallLink::getLayoutFrm( const SwRootFrm* pRoot, SwTxtNode& rNd, xub_StrLen nCntPos, sal_Bool bCalcFrm ) +long SwCallLink::getLayoutFrm( const SwRootFrm* pRoot, SwTxtNode& rNd, sal_Int32 nCntPos, sal_Bool bCalcFrm ) { SwTxtFrm* pFrm = (SwTxtFrm*)rNd.getLayoutFrm(pRoot,0,0,bCalcFrm), *pNext = pFrm; if ( pFrm && !pFrm->IsHiddenNow() ) diff --git a/sw/source/core/crsr/callnk.hxx b/sw/source/core/crsr/callnk.hxx index 3446a58d8e13..83a0270db791 100644 --- a/sw/source/core/crsr/callnk.hxx +++ b/sw/source/core/crsr/callnk.hxx @@ -31,18 +31,18 @@ class SwCallLink public: SwCrsrShell & rShell; sal_uLong nNode; - xub_StrLen nCntnt; + sal_Int32 nCntnt; sal_uInt8 nNdTyp; long nLeftFrmPos; bool bHasSelection; SwCallLink( SwCrsrShell & rSh ); - SwCallLink( SwCrsrShell & rSh, sal_uLong nAktNode, xub_StrLen nAktCntnt, + SwCallLink( SwCrsrShell & rSh, sal_uLong nAktNode, sal_Int32 nAktCntnt, sal_uInt8 nAktNdTyp, long nLRPos, bool bAktSelection ); ~SwCallLink(); - static long getLayoutFrm( const SwRootFrm*, SwTxtNode& rNd, xub_StrLen nCntPos, sal_Bool bCalcFrm ); + static long getLayoutFrm( const SwRootFrm*, SwTxtNode& rNd, sal_Int32 nCntPos, sal_Bool bCalcFrm ); }; #endif // INCLUDED_SW_SOURCE_CORE_CRSR_CALLNK_HXX diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 8bf37b11b326..4e75c86e3be9 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -2163,7 +2163,7 @@ OUString SwCrsrShell::GetSelTxt() const SwTxtNode* pTxtNd = m_pCurCrsr->GetNode()->GetTxtNode(); if( pTxtNd ) { - xub_StrLen nStt = m_pCurCrsr->Start()->nContent.GetIndex(); + const sal_Int32 nStt = m_pCurCrsr->Start()->nContent.GetIndex(); aTxt = pTxtNd->GetExpandTxt( nStt, m_pCurCrsr->End()->nContent.GetIndex() - nStt ); } @@ -2202,7 +2202,7 @@ sal_Unicode SwCrsrShell::GetChar( sal_Bool bEnd, long nOffset ) if( !pTxtNd ) return 0; - xub_StrLen nPos = pPos->nContent.GetIndex(); + const sal_Int32 nPos = pPos->nContent.GetIndex(); const OUString& rStr = pTxtNd->GetTxt(); sal_Unicode cCh = 0; @@ -2226,7 +2226,7 @@ sal_Bool SwCrsrShell::ExtendSelection( sal_Bool bEnd, xub_StrLen nCount ) SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode(); OSL_ENSURE( pTxtNd, "no text node; how should this then be extended?" ); - xub_StrLen nPos = pPos->nContent.GetIndex(); + sal_Int32 nPos = pPos->nContent.GetIndex(); if( bEnd ) { if ((nPos + nCount) <= pTxtNd->GetTxt().getLength()) @@ -2831,7 +2831,7 @@ sal_Bool SwCrsrShell::FindValidCntntNode( sal_Bool bOnlyText ) if( bOk ) { pCNd = rNdIdx.GetNode().GetCntntNode(); - xub_StrLen nCntnt = rNdIdx.GetIndex() < nNdIdx ? pCNd->Len() : 0; + const sal_Int32 nCntnt = rNdIdx.GetIndex() < nNdIdx ? pCNd->Len() : 0; m_pCurCrsr->GetPoint()->nContent.Assign( pCNd, nCntnt ); } else @@ -2926,11 +2926,11 @@ sal_Bool SwCrsrShell::IsSelFullPara() const if( m_pCurCrsr->GetPoint()->nNode.GetIndex() == m_pCurCrsr->GetMark()->nNode.GetIndex() && m_pCurCrsr == m_pCurCrsr->GetNext() ) { - xub_StrLen nStt = m_pCurCrsr->GetPoint()->nContent.GetIndex(), - nEnd = m_pCurCrsr->GetMark()->nContent.GetIndex(); + sal_Int32 nStt = m_pCurCrsr->GetPoint()->nContent.GetIndex(); + sal_Int32 nEnd = m_pCurCrsr->GetMark()->nContent.GetIndex(); if( nStt > nEnd ) { - xub_StrLen nTmp = nStt; + sal_Int32 nTmp = nStt; nStt = nEnd; nEnd = nTmp; } @@ -3233,7 +3233,7 @@ static void lcl_FillRecognizerData( uno::Sequence< OUString >& rSmartTagTypes, } static void lcl_FillTextRange( uno::Reference<text::XTextRange>& rRange, - SwTxtNode& rNode, xub_StrLen nBegin, xub_StrLen nLen ) + SwTxtNode& rNode, sal_Int32 nBegin, sal_Int32 nLen ) { // create SwPosition for nStartIndex SwIndex aIndex( &rNode, nBegin ); @@ -3264,9 +3264,9 @@ void SwCrsrShell::GetSmartTagTerm( uno::Sequence< OUString >& rSmartTagTypes, const SwWrongList *pSmartTagList = pNode->GetSmartTags(); if ( pSmartTagList ) { - xub_StrLen nCurrent = aPos.nContent.GetIndex(); - xub_StrLen nBegin = nCurrent; - xub_StrLen nLen = 1; + sal_Int32 nCurrent = aPos.nContent.GetIndex(); + sal_Int32 nBegin = nCurrent; + sal_Int32 nLen = 1; if( pSmartTagList->InWrongWord( nBegin, nLen ) && !pNode->IsSymbol(nBegin) ) { @@ -3308,9 +3308,9 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect, 0 != (pSmartTagList = pNode->GetSmartTags()) && !pNode->IsInProtectSect() ) { - xub_StrLen nCurrent = aPos.nContent.GetIndex(); - xub_StrLen nBegin = nCurrent; - xub_StrLen nLen = 1; + sal_Int32 nCurrent = aPos.nContent.GetIndex(); + sal_Int32 nBegin = nCurrent; + sal_Int32 nLen = 1; if( pSmartTagList->InWrongWord( nBegin, nLen ) && !pNode->IsSymbol(nBegin) ) { @@ -3331,9 +3331,9 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect, //save the start and end positons of the line and the starting point Push(); LeftMargin(); - xub_StrLen nLineStart = GetCrsr()->GetPoint()->nContent.GetIndex(); + const sal_Int32 nLineStart = GetCrsr()->GetPoint()->nContent.GetIndex(); RightMargin(); - xub_StrLen nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex(); + const sal_Int32 nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex(); Pop(sal_False); // make sure the selection build later from the data below does not @@ -3341,11 +3341,11 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect, // preserve those. Therefore count those "in words" in order to // modify the selection accordingly. const sal_Unicode* pChar = aText.getStr(); - xub_StrLen nLeft = 0; + sal_Int32 nLeft = 0; while (pChar && *pChar++ == CH_TXTATR_INWORD) ++nLeft; pChar = aText.getLength() ? aText.getStr() + aText.getLength() - 1 : 0; - xub_StrLen nRight = 0; + sal_Int32 nRight = 0; while (pChar && *pChar-- == CH_TXTATR_INWORD) ++nRight; @@ -3355,10 +3355,10 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect, pCrsr->SetMark(); ExtendSelection( sal_True, nLen - nLeft - nRight ); // do not determine the rectangle in the current line - xub_StrLen nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft; + const sal_Int32 nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft; // take one less than the line end - otherwise the next line would // be calculated - xub_StrLen nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd ? nLineEnd : (nBegin + nLen - nLeft - nRight); + const sal_Int32 nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd ? nLineEnd : (nBegin + nLen - nLeft - nRight); Push(); pCrsr->DeleteMark(); SwIndex& rContent = GetCrsr()->GetPoint()->nContent; diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 3fc909caa02b..8b33be1edb88 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -1053,9 +1053,9 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt, && !aTmpState.bFtnNoInfo ) { const SwWrongList* pSmartTagList = pTxtNd->GetSmartTags(); - xub_StrLen nCurrent = aPos.nContent.GetIndex(); - xub_StrLen nBegin = nCurrent; - xub_StrLen nLen = 1; + sal_Int32 nCurrent = aPos.nContent.GetIndex(); + const sal_Int32 nBegin = nCurrent; + sal_Int32 nLen = 1; if ( pSmartTagList && pSmartTagList->InWrongWord( nCurrent, nLen ) && !pTxtNd->IsSymbol(nBegin) ) { @@ -1257,7 +1257,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt, if( bRet ) { - const xub_StrLen* pEnd = pTxtAttr->GetEnd(); + const sal_Int32* pEnd = pTxtAttr->GetEnd(); if( pEnd ) rCntntAtPos.sStr = pTxtNd->GetExpandTxt( *pTxtAttr->GetStart(), @@ -1416,7 +1416,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt, #ifdef DBG_UTIL if( !bRet && SwContentAtPos::SW_CURR_ATTRS & rCntntAtPos.eCntntAtPos ) { - xub_StrLen n = aPos.nContent.GetIndex(); + const sal_Int32 n = aPos.nContent.GetIndex(); SfxItemSet aSet( GetDoc()->GetAttrPool(), POOLATTR_BEGIN, POOLATTR_END - 1 ); if( pTxtNd->GetpSwpHints() ) @@ -1424,7 +1424,7 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt, for( sal_uInt16 i = 0; i < pTxtNd->GetSwpHints().Count(); ++i ) { const SwTxtAttr* pHt = pTxtNd->GetSwpHints()[i]; - xub_StrLen nAttrStart = *pHt->GetStart(); + const sal_Int32 nAttrStart = *pHt->GetStart(); if( nAttrStart > n ) // over the section break; @@ -1624,7 +1624,7 @@ sal_Bool SwCrsrShell::SelectTxtAttr( sal_uInt16 nWhich, sal_Bool bExpand, m_pCurCrsr->DeleteMark(); rPos.nContent = *pTxtAttr->GetStart(); m_pCurCrsr->SetMark(); - const xub_StrLen* pEnd = pTxtAttr->GetEnd(); + const sal_Int32* pEnd = pTxtAttr->GetEnd(); rPos.nContent = pEnd ? *pEnd : *pTxtAttr->GetStart() + 1; if( !m_pCurCrsr->IsSelOvr() ) diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index 7aef37b180ac..a7ef07e42d19 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -111,10 +111,10 @@ const SwTxtAttr* GetBkwrdTxtHint( const SwpHints& rHtsArr, sal_uInt16& rPos, return 0; // invalid text attribute } -static void lcl_SetAttrPam( SwPaM& rPam, xub_StrLen nStart, const xub_StrLen* pEnd, +static void lcl_SetAttrPam( SwPaM& rPam, sal_Int32 nStart, const sal_Int32* pEnd, const sal_Bool bSaveMark ) { - xub_StrLen nCntntPos; + sal_Int32 nCntntPos; if( bSaveMark ) nCntntPos = rPam.GetMark()->nContent.GetIndex(); else @@ -175,10 +175,11 @@ static sal_Bool lcl_Search( const SwTxtNode& rTxtNd, SwPaM& rPam, struct _SwSrchChrAttr { sal_uInt16 nWhich; - xub_StrLen nStt, nEnd; + sal_Int32 nStt; + sal_Int32 nEnd; _SwSrchChrAttr( const SfxPoolItem& rItem, - xub_StrLen nStart, xub_StrLen nAnyEnd ) + sal_Int32 nStart, sal_Int32 nAnyEnd ) : nWhich( rItem.Which() ), nStt( nStart ), nEnd( nAnyEnd ) {} }; @@ -186,7 +187,8 @@ struct _SwSrchChrAttr class SwAttrCheckArr { _SwSrchChrAttr *pFndArr, *pStackArr; - xub_StrLen nNdStt, nNdEnd; + sal_Int32 nNdStt; + sal_Int32 nNdEnd; sal_uInt16 nArrStart, nArrLen; sal_uInt16 nFound, nStackCnt; SfxItemSet aCmpSet; @@ -204,11 +206,11 @@ public: int Found() const { return nFound == aCmpSet.Count(); } int CheckStack(); - xub_StrLen Start() const; - xub_StrLen End() const; + sal_Int32 Start() const; + sal_Int32 End() const; - xub_StrLen GetNdStt() const { return nNdStt; } - xub_StrLen GetNdEnd() const { return nNdEnd; } + sal_Int32 GetNdStt() const { return nNdStt; } + sal_Int32 GetNdEnd() const { return nNdEnd; } int SetAttrFwd( const SwTxtAttr& rAttr ); int SetAttrBwd( const SwTxtAttr& rAttr ); @@ -308,7 +310,7 @@ void SwAttrCheckArr::SetNewSet( const SwTxtNode& rTxtNd, const SwPaM& rPam ) } static bool -lcl_IsAttributeIgnorable(xub_StrLen const nNdStart, xub_StrLen const nNdEnd, +lcl_IsAttributeIgnorable(sal_Int32 const nNdStart, sal_Int32 const nNdEnd, _SwSrchChrAttr const& rTmp) { // #i115528#: if there is a paragraph attribute, it has been added by the @@ -626,9 +628,9 @@ int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr ) return Found(); } -xub_StrLen SwAttrCheckArr::Start() const +sal_Int32 SwAttrCheckArr::Start() const { - xub_StrLen nStart = nNdStt; + sal_Int32 nStart = nNdStt; _SwSrchChrAttr* pArrPtr = pFndArr; for( sal_uInt16 n = 0; n < nArrLen; ++n, ++pArrPtr ) if( pArrPtr->nWhich && pArrPtr->nStt > nStart ) @@ -637,10 +639,10 @@ xub_StrLen SwAttrCheckArr::Start() const return nStart; } -xub_StrLen SwAttrCheckArr::End() const +sal_Int32 SwAttrCheckArr::End() const { _SwSrchChrAttr* pArrPtr = pFndArr; - xub_StrLen nEnd = nNdEnd; + sal_Int32 nEnd = nNdEnd; for( sal_uInt16 n = 0; n < nArrLen; ++n, ++pArrPtr ) if( pArrPtr->nWhich && pArrPtr->nEnd < nEnd ) nEnd = pArrPtr->nEnd; @@ -654,7 +656,8 @@ int SwAttrCheckArr::CheckStack() return sal_False; sal_uInt16 n; - xub_StrLen nSttPos = Start(), nEndPos = End(); + const sal_Int32 nSttPos = Start(); + const sal_Int32 nEndPos = End(); _SwSrchChrAttr* pArrPtr; for( pArrPtr = pStackArr, n = 0; n < nArrLen; ++n, ++pArrPtr ) { @@ -684,7 +687,7 @@ int SwAttrCheckArr::CheckStack() static int lcl_SearchForward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr, SwPaM& rPam ) { - xub_StrLen nEndPos, nSttPos; + sal_Int32 nEndPos; rCmpArr.SetNewSet( rTxtNd, rPam ); if( !rTxtNd.HasHints() ) { @@ -725,6 +728,7 @@ static int lcl_SearchForward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr, } } + sal_Int32 nSttPos; for( ; nPos < rHtArr.Count(); ++nPos ) if( rCmpArr.SetAttrFwd( *( pAttr = rHtArr.GetStart( nPos )) ) ) { @@ -757,7 +761,7 @@ static int lcl_SearchForward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr, static int lcl_SearchBackward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr, SwPaM& rPam ) { - xub_StrLen nEndPos, nSttPos; + sal_Int32 nEndPos; rCmpArr.SetNewSet( rTxtNd, rPam ); if( !rTxtNd.HasHints() ) { @@ -771,6 +775,7 @@ static int lcl_SearchBackward( const SwTxtNode& rTxtNd, SwAttrCheckArr& rCmpArr, const SwpHints& rHtArr = rTxtNd.GetSwpHints(); const SwTxtAttr* pAttr; sal_uInt16 nPos = rHtArr.Count(); + sal_Int32 nSttPos; // if everything is already there then check with which it will be ended if( rCmpArr.Found() ) @@ -894,8 +899,7 @@ bool SwPaM::Find( const SfxPoolItem& rAttr, bool bValue, SwMoveFn fnMove, return false; } SwCntntNode *pNd = pPam->GetCntntNode(); - xub_StrLen nTmpPos = bSrchForward ? 0 : pNd->Len(); - pPam->GetPoint()->nContent.Assign( pNd, nTmpPos ); + pPam->GetPoint()->nContent.Assign( pNd, bSrchForward ? 0 : pNd->Len() ); } while( 0 != ( pNode = ::GetNode( *pPam, bFirst, fnMove, bInReadOnly ) ) ) @@ -985,8 +989,7 @@ bool SwPaM::Find( const SfxItemSet& rSet, bool bNoColls, SwMoveFn fnMove, return false; } SwCntntNode *pNd = pPam->GetCntntNode(); - xub_StrLen nTmpPos = bSrchForward ? 0 : pNd->Len(); - pPam->GetPoint()->nContent.Assign( pNd, nTmpPos ); + pPam->GetPoint()->nContent.Assign( pNd, bSrchForward ? 0 : pNd->Len() ); } @@ -1136,7 +1139,7 @@ int SwFindParaAttr::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion, const bool bRegExp( SearchAlgorithms_REGEXP == pSearchOpt->algorithmType); SwIndex& rSttCntIdx = pCrsr->Start()->nContent; - xub_StrLen nSttCnt = rSttCntIdx.GetIndex(); + const sal_Int32 nSttCnt = rSttCntIdx.GetIndex(); // add to shell-cursor-ring so that the regions will be moved enventually Ring *pPrevRing = 0; diff --git a/sw/source/core/crsr/findfmt.cxx b/sw/source/core/crsr/findfmt.cxx index 2da57d22874e..e9c30ebf8d45 100644 --- a/sw/source/core/crsr/findfmt.cxx +++ b/sw/source/core/crsr/findfmt.cxx @@ -38,8 +38,7 @@ bool SwPaM::Find( const SwFmt& rFmt, SwMoveFn fnMove, return false; } SwCntntNode *pNd = pPam->GetPoint()->nNode.GetNode().GetCntntNode(); - xub_StrLen nTmpPos = bSrchForward ? 0 : pNd->Len(); - pPam->GetPoint()->nContent.Assign( pNd, nTmpPos ); + pPam->GetPoint()->nContent.Assign( pNd, bSrchForward ? 0 : pNd->Len() ); } sal_Bool bFirst = sal_True; diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index 69013f8c4deb..bd76b300b71c 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -46,8 +46,8 @@ using namespace util; OUString *ReplaceBackReferences( const SearchOptions& rSearchOpt, SwPaM* pPam ); static OUString -lcl_CleanStr(const SwTxtNode& rNd, xub_StrLen const nStart, xub_StrLen& rEnd, - std::vector<xub_StrLen> &rArr, bool const bRemoveSoftHyphen) +lcl_CleanStr(const SwTxtNode& rNd, sal_Int32 const nStart, sal_Int32& rEnd, + std::vector<sal_Int32> &rArr, bool const bRemoveSoftHyphen) { OUStringBuffer buf(rNd.GetTxt()); rArr.clear(); @@ -56,18 +56,18 @@ lcl_CleanStr(const SwTxtNode& rNd, xub_StrLen const nStart, xub_StrLen& rEnd, sal_uInt16 n = 0; sal_Int32 nSoftHyphen = nStart; - xub_StrLen nHintStart = STRING_LEN; + sal_Int32 nHintStart = -1; bool bNewHint = true; bool bNewSoftHyphen = true; - const xub_StrLen nEnd = rEnd; - std::vector<sal_uInt16> aReplaced; + const sal_Int32 nEnd = rEnd; + std::vector<sal_Int32> aReplaced; do { if ( bNewHint ) nHintStart = pHts && n < pHts->Count() ? *(*pHts)[n]->GetStart() : - STRING_LEN; + -1; if ( bNewSoftHyphen ) { @@ -78,10 +78,10 @@ lcl_CleanStr(const SwTxtNode& rNd, xub_StrLen const nStart, xub_StrLen& rEnd, bNewHint = false; bNewSoftHyphen = false; - xub_StrLen nStt = 0; + sal_Int32 nStt = 0; // Check if next stop is a hint. - if ( STRING_LEN != nHintStart + if ( nHintStart>=0 && (-1 == nSoftHyphen || nHintStart < nSoftHyphen) && nHintStart < nEnd ) { @@ -104,7 +104,7 @@ lcl_CleanStr(const SwTxtNode& rNd, xub_StrLen const nStart, xub_StrLen& rEnd, else break; - const xub_StrLen nAkt = nStt - rArr.size(); + const sal_Int32 nAkt = nStt - rArr.size(); if ( bNewHint ) { @@ -165,7 +165,7 @@ lcl_CleanStr(const SwTxtNode& rNd, xub_StrLen const nStart, xub_StrLen& rEnd, for( sal_uInt16 i = aReplaced.size(); i; ) { - const xub_StrLen nTmp = aReplaced[ --i ]; + const sal_Int32 nTmp = aReplaced[ --i ]; if (nTmp == buf.getLength() - 1) { buf.truncate(nTmp); @@ -227,8 +227,6 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te sal_Bool bFirst = sal_True; SwCntntNode * pNode; - xub_StrLen nStart, nEnd, nTxtLen; - const bool bRegSearch = SearchAlgorithms_REGEXP == rSearchOpt.algorithmType; const bool bChkEmptyPara = bRegSearch && 2 == rSearchOpt.searchString.getLength() && ( rSearchOpt.searchString.equalsAscii( "^$" ) || @@ -240,12 +238,13 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te { if( pNode->IsTxtNode() ) { - nTxtLen = static_cast<SwTxtNode*>(pNode)->GetTxt().getLength(); + sal_Int32 nTxtLen = static_cast<SwTxtNode*>(pNode)->GetTxt().getLength(); + sal_Int32 nEnd; if( rNdIdx == pPam->GetMark()->nNode ) nEnd = pPam->GetMark()->nContent.GetIndex(); else nEnd = bSrchForward ? nTxtLen : 0; - nStart = rCntntIdx.GetIndex(); + sal_Int32 nStart = rCntntIdx.GetIndex(); /* #i80135# */ // if there are SwPostItFields inside our current node text, we @@ -260,18 +259,16 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te { if (!bSrchForward) { - xub_StrLen swap = nEnd; - nEnd = nStart; - nStart = swap; + std::swap(nStart, nEnd); } for( sal_Int32 i = 0; i < pHts->Count(); i++ ) { - xub_StrLen aPos = *(*pHts)[i]->GetStart(); const SwTxtAttr* pTxtAttr = (*pHts)[i]; if ( (pTxtAttr->Which()==RES_TXTATR_FIELD) && (pTxtAttr->GetFmtFld().GetField()->Which()==RES_POSTITFLD)) { + const sal_Int32 aPos = *pTxtAttr->GetStart(); if ( (aPos >= nStart) && (aPos <= nEnd) ) aNumberPostits++; else @@ -284,9 +281,7 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te if (!bSrchForward) { - xub_StrLen swap = nEnd; - nEnd = nStart; - nStart = swap; + std::swap(nStart, nEnd); } } @@ -324,8 +319,8 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te if (aNumberPostits) { // now we have to split - xub_StrLen nStartInside = 0; - xub_StrLen nEndInside = 0; + sal_Int32 nStartInside = 0; + sal_Int32 nEndInside = 0; sal_Int16 aLoop= bSrchForward ? aStart : aNumberPostits; while ( (aLoop>=0) && (aLoop<=aNumberPostits)) @@ -384,14 +379,14 @@ bool SwPaM::Find( const SearchOptions& rSearchOpt, bool bSearchInNotes , utl::Te bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt, SwMoveFn fnMove, bool bSrchForward, bool bRegSearch, bool bChkEmptyPara, bool bChkParaEnd, - xub_StrLen &nStart, xub_StrLen &nEnd, xub_StrLen nTxtLen, + sal_Int32 &nStart, sal_Int32 &nEnd, sal_Int32 nTxtLen, SwNode* pNode, SwPaM* pPam) { bool bFound = false; SwNodeIndex& rNdIdx = pPam->GetPoint()->nNode; const SwNode* pSttNd = &rNdIdx.GetNode(); OUString sCleanStr; - std::vector<xub_StrLen> aFltArr; + std::vector<sal_Int32> aFltArr; LanguageType eLastLang = 0; // if the search string contains a soft hypen, // we don't strip them from the text: @@ -433,7 +428,7 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt, nSearchScript = g_pBreakIt->GetRealScriptOfText( rSearchOpt.searchString, 0 ); } - xub_StrLen nStringEnd = nEnd; + const sal_Int32 nStringEnd = nEnd; bool bZeroMatch = false; // zero-length match, i.e. only $ anchor as regex while ( ((bSrchForward && nStart < nStringEnd) || (! bSrchForward && nStart > nStringEnd)) && !bZeroMatch ) @@ -480,18 +475,18 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt, // if backward search, switch positions temporarily if( !bSrchForward ) { std::swap(nStart, nEnd); } - xub_StrLen nNew(nStart); - for (size_t n = 0; - n < aFltArr.size() && aFltArr[ n ] <= nStart; - ++n, ++nNew ) - ; + sal_Int32 nNew = nStart; + for (size_t n = 0; n < aFltArr.size() && aFltArr[ n ] <= nStart; ++n ) + { + ++nNew; + } nStart = nNew; nNew = nEnd; - for(size_t n = 0; - n < aFltArr.size() && aFltArr[ n ] < nEnd; - ++n, ++nNew ) - ; + for( size_t n = 0; n < aFltArr.size() && aFltArr[ n ] < nEnd; ++n ) + { + ++nNew; + } nEnd = nNew; // if backward search, switch positions temporarily @@ -575,7 +570,7 @@ int SwFindParaText::Find( SwPaM* pCrsr, SwMoveFn fnMove, // use replace method in SwDoc const bool bRegExp(SearchAlgorithms_REGEXP == rSearchOpt.algorithmType); SwIndex& rSttCntIdx = pCrsr->Start()->nContent; - xub_StrLen nSttCnt = rSttCntIdx.GetIndex(); + const sal_Int32 nSttCnt = rSttCntIdx.GetIndex(); // add to shell-cursor-ring so that the regions will be moved enventually Ring *pPrev(0); if( bRegExp ) diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index 1ed0a95f481a..15168f6f424f 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -44,7 +44,7 @@ #include <xmloff/odffields.hxx> // for the dump "MSC-" compiler -inline xub_StrLen GetSttOrEnd( bool bCondition, const SwCntntNode& rNd ) +inline sal_Int32 GetSttOrEnd( bool bCondition, const SwCntntNode& rNd ) { return bCondition ? 0 : rNd.Len(); } @@ -64,7 +64,7 @@ SwPosition::SwPosition( const SwNode& rNode ) { } -SwPosition::SwPosition( SwCntntNode & rNode, const xub_StrLen nOffset ) +SwPosition::SwPosition( SwCntntNode & rNode, const sal_Int32 nOffset ) : nNode( rNode ), nContent( &rNode, nOffset ) { } @@ -924,8 +924,8 @@ sal_Bool GoCurrPara( SwPaM & rPam, SwPosPara aPosPara ) SwCntntNode * pNd = rPos.nNode.GetNode().GetCntntNode(); if( pNd ) { - xub_StrLen nOld = rPos.nContent.GetIndex(), - nNew = aPosPara == fnMoveForward ? 0 : pNd->Len(); + const sal_Int32 nOld = rPos.nContent.GetIndex(); + const sal_Int32 nNew = aPosPara == fnMoveForward ? 0 : pNd->Len(); // if already at beginning/end then to the next/previous if( nOld != nNew ) { @@ -1042,10 +1042,10 @@ OUString SwPaM::GetTxt() const { // Handle corner cases of start/end node(s) const sal_Int32 nStart = bIsStartNode - ? static_cast<sal_Int32>(Start()->nContent.GetIndex()) + ? Start()->nContent.GetIndex() : 0; const sal_Int32 nEnd = bIsEndNode - ? static_cast<sal_Int32>(End()->nContent.GetIndex()) + ? End()->nContent.GetIndex() : aTmpStr.getLength(); aResult += aTmpStr.copy(nStart, nEnd-nStart); diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index f9a1b2ecf1d6..54987224d453 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -242,7 +242,7 @@ sal_Bool SwCursor::IsSelOvr( int eFlags ) // set cursor to new position: SwNodeIndex aIdx( rPtIdx ); - xub_StrLen nCntntPos = pSavePos->nCntnt; + sal_Int32 nCntntPos = pSavePos->nCntnt; int bGoNxt = pSavePos->nNode < rPtIdx.GetIndex(); SwCntntNode* pCNd = bGoNxt ? rNds.GoNextSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections) @@ -275,7 +275,7 @@ sal_Bool SwCursor::IsSelOvr( int eFlags ) } // register ContentIndex: - xub_StrLen nTmpPos = bIsValidPos ? (bGoNxt ? 0 : pCNd->Len()) : nCntntPos; + const sal_Int32 nTmpPos = bIsValidPos ? (bGoNxt ? 0 : pCNd->Len()) : nCntntPos; GetPoint()->nContent.Assign( pCNd, nTmpPos ); if( !bIsValidPos || !bValidNodesRange || IsInProtectTable( sal_True ) ) @@ -355,8 +355,7 @@ sal_Bool SwCursor::IsSelOvr( int eFlags ) pNd = pCNd; // register ContentIndex: - xub_StrLen nTmpPos = bGoNxt ? 0 : pCNd->Len(); - GetPoint()->nContent.Assign( pCNd, nTmpPos ); + GetPoint()->nContent.Assign( pCNd, bGoNxt ? 0 : pCNd->Len() ); if( IsInProtectTable( sal_True ) ) pFrm = 0; @@ -461,8 +460,7 @@ sal_Bool SwCursor::IsSelOvr( int eFlags ) else { SwCntntNode* pCNd = (SwCntntNode*)pMyNd; - xub_StrLen nTmpPos = bSelTop ? pCNd->Len() : 0; - GetPoint()->nContent.Assign( pCNd, nTmpPos ); + GetPoint()->nContent.Assign( pCNd, bSelTop ? pCNd->Len() : 0 ); return sal_False; } } @@ -1050,10 +1048,7 @@ void SwCursor::FillFindPos( SwDocPositions ePos, SwPosition& rPos ) const if( pCNd ) { - xub_StrLen nCPos = 0; - if( !bIsStart ) - nCPos = pCNd->Len(); - rPos.nContent.Assign( pCNd, nCPos ); + rPos.nContent.Assign( pCNd, bIsStart ? 0 : pCNd->Len() ); } } @@ -1108,7 +1103,7 @@ sal_Bool SwCursor::IsStartWordWT( sal_Int16 nWordType ) const const SwTxtNode* pTxtNd = GetNode()->GetTxtNode(); if( pTxtNd && g_pBreakIt->GetBreakIter().is() ) { - xub_StrLen nPtPos = GetPoint()->nContent.GetIndex(); + const sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); bRet = g_pBreakIt->GetBreakIter()->isBeginWord( pTxtNd->GetTxt(), nPtPos, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos )), @@ -1123,7 +1118,7 @@ sal_Bool SwCursor::IsEndWordWT( sal_Int16 nWordType ) const const SwTxtNode* pTxtNd = GetNode()->GetTxtNode(); if( pTxtNd && g_pBreakIt->GetBreakIter().is() ) { - xub_StrLen nPtPos = GetPoint()->nContent.GetIndex(); + const sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); bRet = g_pBreakIt->GetBreakIter()->isEndWord( pTxtNd->GetTxt(), nPtPos, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ), @@ -1139,7 +1134,7 @@ sal_Bool SwCursor::IsInWordWT( sal_Int16 nWordType ) const const SwTxtNode* pTxtNd = GetNode()->GetTxtNode(); if( pTxtNd && g_pBreakIt->GetBreakIter().is() ) { - xub_StrLen nPtPos = GetPoint()->nContent.GetIndex(); + const sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); Boundary aBoundary = g_pBreakIt->GetBreakIter()->getWordBoundary( pTxtNd->GetTxt(), nPtPos, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ), @@ -1181,8 +1176,8 @@ sal_Bool SwCursor::GoStartWordWT( sal_Int16 nWordType ) if( pTxtNd && g_pBreakIt->GetBreakIter().is() ) { SwCrsrSaveState aSave( *this ); - xub_StrLen nPtPos = GetPoint()->nContent.GetIndex(); - nPtPos = (xub_StrLen)g_pBreakIt->GetBreakIter()->getWordBoundary( + sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); + nPtPos = g_pBreakIt->GetBreakIter()->getWordBoundary( pTxtNd->GetTxt(), nPtPos, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ), nWordType, @@ -1205,8 +1200,8 @@ sal_Bool SwCursor::GoEndWordWT( sal_Int16 nWordType ) if( pTxtNd && g_pBreakIt->GetBreakIter().is() ) { SwCrsrSaveState aSave( *this ); - xub_StrLen nPtPos = GetPoint()->nContent.GetIndex(); - nPtPos = (xub_StrLen)g_pBreakIt->GetBreakIter()->getWordBoundary( + sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); + nPtPos = g_pBreakIt->GetBreakIter()->getWordBoundary( pTxtNd->GetTxt(), nPtPos, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ), nWordType, @@ -1230,9 +1225,9 @@ sal_Bool SwCursor::GoNextWordWT( sal_Int16 nWordType ) if( pTxtNd && g_pBreakIt->GetBreakIter().is() ) { SwCrsrSaveState aSave( *this ); - xub_StrLen nPtPos = GetPoint()->nContent.GetIndex(); + sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); - nPtPos = (xub_StrLen)g_pBreakIt->GetBreakIter()->nextWord( + nPtPos = g_pBreakIt->GetBreakIter()->nextWord( pTxtNd->GetTxt(), nPtPos, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos, 1 ) ), nWordType ).startPos; @@ -1254,12 +1249,12 @@ sal_Bool SwCursor::GoPrevWordWT( sal_Int16 nWordType ) if( pTxtNd && g_pBreakIt->GetBreakIter().is() ) { SwCrsrSaveState aSave( *this ); - xub_StrLen nPtPos = GetPoint()->nContent.GetIndex(); - const xub_StrLen nPtStart = nPtPos; + sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); + const sal_Int32 nPtStart = nPtPos; if( nPtPos ) --nPtPos; - nPtPos = (xub_StrLen)g_pBreakIt->GetBreakIter()->previousWord( + nPtPos = g_pBreakIt->GetBreakIter()->previousWord( pTxtNd->GetTxt(), nPtStart, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos, 1 ) ), nWordType ).startPos; @@ -1315,7 +1310,7 @@ sal_Bool SwCursor::SelectWordWT( SwViewShell* pViewShell, sal_Int16 nWordType, c } else { - xub_StrLen nPtPos = GetPoint()->nContent.GetIndex(); + const sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); Boundary aBndry( g_pBreakIt->GetBreakIter()->getWordBoundary( pTxtNd->GetTxt(), nPtPos, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) ), @@ -1324,11 +1319,11 @@ sal_Bool SwCursor::SelectWordWT( SwViewShell* pViewShell, sal_Int16 nWordType, c if( aBndry.startPos != aBndry.endPos ) { - GetPoint()->nContent = (xub_StrLen)aBndry.endPos; + GetPoint()->nContent = aBndry.endPos; if( !IsSelOvr() ) { SetMark(); - GetMark()->nContent = (xub_StrLen)aBndry.startPos; + GetMark()->nContent = aBndry.startPos; if( !IsSelOvr() ) bRet = sal_True; } @@ -1386,41 +1381,41 @@ sal_Bool SwCursor::GoSentence( SentenceMoveType eMoveType ) OUString sNodeText( lcl_MaskDeletedRedlines( pTxtNd ) ); SwCrsrSaveState aSave( *this ); - xub_StrLen nPtPos = GetPoint()->nContent.GetIndex(); + sal_Int32 nPtPos = GetPoint()->nContent.GetIndex(); switch ( eMoveType ) { case START_SENT: /* when modifying: see also ExpandToSentenceBorders below! */ - nPtPos = (xub_StrLen)g_pBreakIt->GetBreakIter()->beginOfSentence( + nPtPos = g_pBreakIt->GetBreakIter()->beginOfSentence( sNodeText, nPtPos, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) )); break; case END_SENT: /* when modifying: see also ExpandToSentenceBorders below! */ - nPtPos = (xub_StrLen)g_pBreakIt->GetBreakIter()->endOfSentence( + nPtPos = g_pBreakIt->GetBreakIter()->endOfSentence( sNodeText, nPtPos, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) )); break; case NEXT_SENT: { - nPtPos = (xub_StrLen)g_pBreakIt->GetBreakIter()->endOfSentence( + nPtPos = g_pBreakIt->GetBreakIter()->endOfSentence( sNodeText, nPtPos, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) )); - while (nPtPos != (sal_uInt16) -1 && ++nPtPos < sNodeText.getLength() + while (nPtPos>=0 && ++nPtPos < sNodeText.getLength() && sNodeText[nPtPos] == ' ' /*isWhiteSpace( aTxt.GetChar(nPtPos)*/ ) ; break; } case PREV_SENT: - nPtPos = (xub_StrLen)g_pBreakIt->GetBreakIter()->beginOfSentence( + nPtPos = g_pBreakIt->GetBreakIter()->beginOfSentence( sNodeText, nPtPos, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) )); if (nPtPos == 0) return sal_False; // the previous sentence is not in this paragraph if (nPtPos > 0) - nPtPos = (xub_StrLen)g_pBreakIt->GetBreakIter()->beginOfSentence( + nPtPos = g_pBreakIt->GetBreakIter()->beginOfSentence( sNodeText, nPtPos - 1, g_pBreakIt->GetLocale( pTxtNd->GetLang( nPtPos ) )); @@ -1453,13 +1448,13 @@ sal_Bool SwCursor::ExpandToSentenceBorders() OUString sEndText( pStartNd == pEndNd? sStartText : lcl_MaskDeletedRedlines( pEndNd ) ); SwCrsrSaveState aSave( *this ); - xub_StrLen nStartPos = Start()->nContent.GetIndex(); - xub_StrLen nEndPos = End()->nContent.GetIndex(); + sal_Int32 nStartPos = Start()->nContent.GetIndex(); + sal_Int32 nEndPos = End()->nContent.GetIndex(); - nStartPos = (xub_StrLen)g_pBreakIt->GetBreakIter()->beginOfSentence( + nStartPos = g_pBreakIt->GetBreakIter()->beginOfSentence( sStartText, nStartPos, g_pBreakIt->GetLocale( pStartNd->GetLang( nStartPos ) ) ); - nEndPos = (xub_StrLen)g_pBreakIt->GetBreakIter()->endOfSentence( + nEndPos = g_pBreakIt->GetBreakIter()->endOfSentence( sEndText, nEndPos, g_pBreakIt->GetLocale( pEndNd->GetLang( nEndPos ) ) ); @@ -1502,7 +1497,7 @@ SwCursor::DoSetBidiLevelLeftRight( { const SwTxtNode& rTNd = *rNode.GetTxtNode(); SwIndex& rIdx = GetPoint()->nContent; - xub_StrLen nPos = rIdx.GetIndex(); + sal_Int32 nPos = rIdx.GetIndex(); const SvtCTLOptions& rCTLOptions = SW_MOD()->GetCTLOptions(); if ( bVisualAllowed && rCTLOptions.IsCTLFontEnabled() && @@ -1529,7 +1524,7 @@ SwCursor::DoSetBidiLevelLeftRight( const SwScriptInfo* pSI = SwScriptInfo::GetScriptInfo( rTNd ); if ( pSI ) { - const xub_StrLen nMoveOverPos = io_rbLeft ? + const sal_Int32 nMoveOverPos = io_rbLeft ? ( nPos ? nPos - 1 : 0 ) : nPos; SetCrsrBidiLevel( pSI->DirType( nMoveOverPos ) ); @@ -1595,8 +1590,7 @@ sal_Bool SwCursor::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode, SwCntntNode* pCntntNode = GetCntntNode(); if ( pCntntNode ) { - const xub_StrLen nTmpPos = bLeft ? pCntntNode->Len() : 0; - GetPoint()->nContent.Assign( pCntntNode, nTmpPos ); + GetPoint()->nContent.Assign( pCntntNode, bLeft ? pCntntNode->Len() : 0 ); // Redo the move: if ( !Move( fnMove, fnGo ) ) @@ -1629,8 +1623,7 @@ sal_Bool SwCursor::LeftRight( sal_Bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode, SwCntntNode* pCntntNode = GetCntntNode(); if ( pCntntNode ) { - const xub_StrLen nTmpPos = bLeft ? pCntntNode->Len() : 0; - GetPoint()->nContent.Assign( pCntntNode, nTmpPos ); + GetPoint()->nContent.Assign( pCntntNode, bLeft ? pCntntNode->Len() : 0 ); } } } @@ -1674,7 +1667,7 @@ void SwCursor::DoSetBidiLevelUpDown() if ( pSI ) { SwIndex& rIdx = GetPoint()->nContent; - xub_StrLen nPos = rIdx.GetIndex(); + const sal_Int32 nPos = rIdx.GetIndex(); if (nPos && nPos < static_cast<SwTxtNode&>(rNode).GetTxt().getLength()) @@ -1964,7 +1957,7 @@ sal_Bool SwCursor::MovePara(SwWhichPara fnWhichPara, SwPosPara fnPosPara ) const SwCntntNode* pCntntNd = pNd->GetCntntNode(); if ( pCntntNd ) { - const xub_StrLen nSttEnd = fnPosPara == fnMoveForward ? 0 : pCntntNd->Len(); + const sal_Int32 nSttEnd = fnPosPara == fnMoveForward ? 0 : pCntntNd->Len(); if ( GetPoint()->nContent.GetIndex() != nSttEnd ) bShortCut = true; } @@ -2011,7 +2004,7 @@ void SwCursor::RestoreSavePos() { GetPoint()->nNode = pSavePos->nNode; - xub_StrLen nIdx = 0; + sal_Int32 nIdx = 0; if ( GetCntntNode() ) { if ( pSavePos->nCntnt <= GetCntntNode()->Len() ) diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx index a22797da1f53..9b55a849115a 100644 --- a/sw/source/core/crsr/trvlfnfl.cxx +++ b/sw/source/core/crsr/trvlfnfl.cxx @@ -164,13 +164,13 @@ sal_Bool SwCrsrShell::GotoFtnAnchor() inline sal_Bool CmpLE( const SwTxtFtn& rFtn, sal_uLong nNd, xub_StrLen nCnt ) { - sal_uLong nTNd = rFtn.GetTxtNode().GetIndex(); + const sal_uLong nTNd = rFtn.GetTxtNode().GetIndex(); return nTNd < nNd || ( nTNd == nNd && *rFtn.GetStart() <= nCnt ); } -inline sal_Bool CmpL( const SwTxtFtn& rFtn, sal_uLong nNd, xub_StrLen nCnt ) +inline sal_Bool CmpL( const SwTxtFtn& rFtn, sal_uLong nNd, sal_Int32 nCnt ) { - sal_uLong nTNd = rFtn.GetTxtNode().GetIndex(); + const sal_uLong nTNd = rFtn.GetTxtNode().GetIndex(); return nTNd < nNd || ( nTNd == nNd && *rFtn.GetStart() < nCnt ); } @@ -186,7 +186,7 @@ sal_Bool SwCursor::GotoNextFtnAnchor() if( nPos < rFtnArr.size() ) { sal_uLong nNdPos = GetPoint()->nNode.GetIndex(); - xub_StrLen nCntPos = GetPoint()->nContent.GetIndex(); + const sal_Int32 nCntPos = GetPoint()->nContent.GetIndex(); pTxtFtn = rFtnArr[ nPos ]; // search forwards @@ -243,7 +243,7 @@ sal_Bool SwCursor::GotoPrevFtnAnchor() { // there is a footnote with this index, so search also for the next one sal_uLong nNdPos = GetPoint()->nNode.GetIndex(); - xub_StrLen nCntPos = GetPoint()->nContent.GetIndex(); + const sal_Int32 nCntPos = GetPoint()->nContent.GetIndex(); pTxtFtn = rFtnArr[ nPos ]; // search forwards diff --git a/sw/source/core/crsr/trvlreg.cxx b/sw/source/core/crsr/trvlreg.cxx index 519c492a7eb4..e123a5437400 100644 --- a/sw/source/core/crsr/trvlreg.cxx +++ b/sw/source/core/crsr/trvlreg.cxx @@ -159,8 +159,7 @@ sal_Bool GotoCurrRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, if( pCNd ) { pPos->nNode = *pCNd; - xub_StrLen nTmpPos = bMoveBackward ? pCNd->Len() : 0; - pPos->nContent.Assign( pCNd, nTmpPos ); + pPos->nContent.Assign( pCNd, bMoveBackward ? pCNd->Len() : 0 ); } return 0 != pCNd; } @@ -174,7 +173,7 @@ sal_Bool GotoCurrRegionAndSkip( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, return sal_False; SwPosition* pPos = rCurCrsr.GetPoint(); - xub_StrLen nCurrCnt = pPos->nContent.GetIndex(); + const sal_Int32 nCurrCnt = pPos->nContent.GetIndex(); bool bMoveBackward = fnPosRegion == fnMoveBackward; do { @@ -196,8 +195,7 @@ sal_Bool GotoCurrRegionAndSkip( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, pPos->nNode = aIdx; } - xub_StrLen nTmpPos = bMoveBackward ? pCNd->Len() : 0; - pPos->nContent.Assign( pCNd, nTmpPos ); + pPos->nContent.Assign( pCNd, bMoveBackward ? pCNd->Len() : 0 ); if( &pPos->nNode.GetNode() != pCurrNd || pPos->nContent.GetIndex() != nCurrCnt ) diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index 04808143fdb0..75a2f1b74198 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -648,7 +648,7 @@ sal_Bool SwCrsrShell::MoveTable( SwWhichTable fnWhichTbl, SwPosTable fnPosTbl ) bool bCheckPos; sal_Bool bRet; sal_uLong nPtNd = 0; - xub_StrLen nPtCnt = 0; + sal_Int32 nPtCnt = 0; if ( !m_pTblCrsr && m_pCurCrsr->HasMark() ) { diff --git a/sw/source/core/crsr/unocrsr.cxx b/sw/source/core/crsr/unocrsr.cxx index 230e33a4f713..efc0b56642c1 100644 --- a/sw/source/core/crsr/unocrsr.cxx +++ b/sw/source/core/crsr/unocrsr.cxx @@ -168,11 +168,7 @@ sal_Bool SwUnoCrsr::IsSelOvr( int eFlags ) if( bValidPos ) { SwCntntNode* pCNd = GetCntntNode(); - sal_uInt16 nCnt = 0; - if( pCNd && !bMoveDown ) - nCnt = pCNd->Len(); - - GetPoint()->nContent.Assign( pCNd, nCnt ); + GetPoint()->nContent.Assign( pCNd, (pCNd && !bMoveDown) ? pCNd->Len() : 0); } else { diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 600689e41352..93c4941bbd1e 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -779,7 +779,7 @@ bool SwDoc::SplitNode( const SwPosition &rPos, bool bChkTableStart ) // Update the rsid of the old and the new node unless // the old node is split at the beginning or at the end SwTxtNode *pTxtNode = rPos.nNode.GetNode().GetTxtNode(); - xub_StrLen nPos = rPos.nContent.GetIndex(); + const sal_Int32 nPos = rPos.nContent.GetIndex(); if( pTxtNode && nPos && nPos != pTxtNode->Len() ) { UpdateParRsid( pTxtNode ); @@ -973,7 +973,7 @@ bool SwDoc::InsertString( const SwPaM &rRg, const OUString &rStr, } CharClass const& rCC = GetAppCharClass(); - xub_StrLen nInsPos = rPos.nContent.GetIndex(); + sal_Int32 nInsPos = rPos.nContent.GetIndex(); if (!pUndo) { @@ -2598,8 +2598,8 @@ OUString SwDoc::GetPaMDescr(const SwPaM & rPam) const if (0 != pTxtNode) { - xub_StrLen nStart = rPam.Start()->nContent.GetIndex(); - xub_StrLen nEnd = rPam.End()->nContent.GetIndex(); + const sal_Int32 nStart = rPam.Start()->nContent.GetIndex(); + const sal_Int32 nEnd = rPam.End()->nContent.GetIndex(); aResult += SW_RES(STR_START_QUOTE); aResult += ShortenString(pTxtNode->GetTxt(). diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 5de01055da4b..ad9426a0b04c 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -982,7 +982,7 @@ namespace int nReturn = BEFORE_NODE; if( nIndex == nNode ) { - xub_StrLen nCntIdx = rPos.nContent.GetIndex(); + const sal_Int32 nCntIdx = rPos.nContent.GetIndex(); if( nCntIdx < nCntnt ) nReturn = BEFORE_SAME_NODE; else if( nCntIdx == nCntnt ) @@ -1091,7 +1091,10 @@ SaveBookmark::SaveBookmark( } } else - m_nNode2 = ULONG_MAX, m_nCntnt2 = STRING_NOTFOUND; + { + m_nNode2 = ULONG_MAX; + m_nCntnt2 = -1; + } } void SaveBookmark::SetInDoc( @@ -1211,8 +1214,7 @@ void _DelBookmarks( pCNd = pRStt->nNode.GetNode().GetCntntNode(); } } - xub_StrLen nTmp = bStt ? 0 : pCNd->Len(); - pRStt->nContent.Assign( pCNd, nTmp ); + pRStt->nContent.Assign( pCNd, bStt ? 0 : pCNd->Len() ); } } if( lcl_Greater( *pREnd, rStt, pSttIdx ) && lcl_Lower( *pREnd, rEnd, pEndIdx )) @@ -1234,8 +1236,7 @@ void _DelBookmarks( pCNd = pREnd->nNode.GetNode().GetCntntNode(); } } - xub_StrLen nTmp = bStt ? 0 : pCNd->Len(); - pREnd->nContent.Assign( pCNd, nTmp ); + pREnd->nContent.Assign( pCNd, bStt ? 0 : pCNd->Len() ); } } } diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 0432fdfd23c9..14ec7ce5cdd7 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -1872,7 +1872,7 @@ sal_uInt16 _SaveMergeRedlines::InsertRedline() ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); SwNodeIndex aSaveNd( pDestRedl->GetPoint()->nNode, -1 ); - xub_StrLen nSaveCnt = pDestRedl->GetPoint()->nContent.GetIndex(); + const sal_Int32 nSaveCnt = pDestRedl->GetPoint()->nContent.GetIndex(); RedlineMode_t eOld = pDoc->GetRedlineMode(); pDoc->SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE)); @@ -2107,15 +2107,15 @@ bool LineArrayComparator::Compare( int nIdx1, int nIdx2 ) const return false; } - int nPar1Len = pTxtNd1->Len(); - int nPar2Len = pTxtNd2->Len(); + const sal_Int32 nPar1Len = pTxtNd1->Len(); + const sal_Int32 nPar2Len = pTxtNd2->Len(); if( std::min( nPar1Len, nPar2Len ) * 3 < std::max( nPar1Len, nPar2Len ) ) { return false; } - int nBorderLen = ( nPar1Len + nPar2Len )/16; + sal_Int32 nBorderLen = ( nPar1Len + nPar2Len )/16; if( nBorderLen < 3 ) { @@ -2126,7 +2126,7 @@ bool LineArrayComparator::Compare( int nIdx1, int nIdx2 ) const unsigned nHash = 0; unsigned nMul = 251; unsigned nPow = 1; - int i; + sal_Int32 i; for( i = 0; i < nBorderLen - 1; i++ ) { diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx index 9dd757cc408e..07984d98692b 100644 --- a/sw/source/core/doc/doccorr.cxx +++ b/sw/source/core/doc/doccorr.cxx @@ -90,7 +90,7 @@ namespace static inline void lcl_PaMCorrRel1(SwPaM * pPam, SwNode const * const pOldNode, const SwPosition& rNewPos, - const xub_StrLen nCntIdx) + const sal_Int32 nCntIdx) { for(int nb = 0; nb < 2; ++nb) if(&((pPam)->GetBound(sal_Bool(nb)).nNode.GetNode()) == pOldNode) @@ -251,7 +251,7 @@ void PaMCorrRel( const SwNodeIndex &rOldNode, SwPosition aNewPos( rNewPos ); const SwDoc* pDoc = pOldNode->GetDoc(); - xub_StrLen nCntIdx = rNewPos.nContent.GetIndex() + nOffset; + const sal_Int32 nCntIdx = rNewPos.nContent.GetIndex() + nOffset; SwCrsrShell* pShell = pDoc->GetEditShell(); if( pShell ) diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 20f139cfb976..f4e32c723dfa 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -56,7 +56,8 @@ struct _SaveRedline { SwRedline* pRedl; sal_uInt32 nStt, nEnd; - xub_StrLen nSttCnt, nEndCnt; + sal_Int32 nSttCnt; + sal_Int32 nEndCnt; _SaveRedline( SwRedline* pR, const SwNodeIndex& rSttIdx ) : pRedl( pR ) @@ -144,7 +145,7 @@ static bool lcl_MayOverwrite( const SwTxtNode *pNode, const sal_Int32 nPos ) } } -static void lcl_SkipAttr( const SwTxtNode *pNode, SwIndex &rIdx, xub_StrLen &rStart ) +static void lcl_SkipAttr( const SwTxtNode *pNode, SwIndex &rIdx, sal_Int32 &rStart ) { if( !lcl_MayOverwrite( pNode, rStart ) ) { @@ -351,7 +352,7 @@ static bool lcl_SaveFtn( const SwNodeIndex& rSttNd, const SwNodeIndex& rEndNd, &( pSrch = rFtnArr[ nPos ] )->GetTxtNode())->GetIndex() <= rEndNd.GetIndex() ) { - xub_StrLen nFtnSttIdx = *pSrch->GetStart(); + const sal_Int32 nFtnSttIdx = *pSrch->GetStart(); if( ( pEndCnt && pSttCnt ) ? (( &rSttNd.GetNode() == pFtnNd && pSttCnt->GetIndex() > nFtnSttIdx) || @@ -384,7 +385,7 @@ static bool lcl_SaveFtn( const SwNodeIndex& rSttNd, const SwNodeIndex& rEndNd, while( nPos-- && ( pFtnNd = &( pSrch = rFtnArr[ nPos ] )-> GetTxtNode())->GetIndex() >= rSttNd.GetIndex() ) { - xub_StrLen nFtnSttIdx = *pSrch->GetStart(); + const sal_Int32 nFtnSttIdx = *pSrch->GetStart(); if( !pEndCnt || !pSttCnt || !( (( &rSttNd.GetNode() == pFtnNd && pSttCnt->GetIndex() > nFtnSttIdx ) || @@ -727,7 +728,7 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const OUString &rStr ) ? pNode->GetpSwpHints()->Count() : 0; SwDataChanged aTmp( rRg ); SwIndex& rIdx = rPt.nContent; - xub_StrLen nStart = 0; + sal_Int32 nStart = 0; bool bOldExpFlg = pNode->IsIgnoreDontExpand(); pNode->SetIgnoreDontExpand( true ); @@ -899,7 +900,7 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags ) ( rPos.nContent.GetIndex() || ( pTNd->Len() && bCorrSavePam )) ) { bSplit = sal_True; - xub_StrLen nMkCntnt = rPaM.GetMark()->nContent.GetIndex(); + const sal_Int32 nMkCntnt = rPaM.GetMark()->nContent.GetIndex(); std::vector<sal_uLong> aBkmkArr; _SaveCntntIdx( this, rPos.nNode.GetIndex(), rPos.nContent.GetIndex(), @@ -1398,15 +1399,15 @@ void sw_JoinText( SwPaM& rPam, sal_Bool bJoinPrev ) } static void -lcl_CalcBreaks( ::std::vector<xub_StrLen> & rBreaks, SwPaM const & rPam ) +lcl_CalcBreaks( ::std::vector<sal_Int32> & rBreaks, SwPaM const & rPam ) { SwTxtNode const * const pTxtNode( rPam.End()->nNode.GetNode().GetTxtNode() ); if (!pTxtNode) return; // left-overlap only possible at end of selection... - const xub_StrLen nStart(rPam.Start()->nContent.GetIndex()); - const xub_StrLen nEnd (rPam.End ()->nContent.GetIndex()); + const sal_Int32 nStart(rPam.Start()->nContent.GetIndex()); + const sal_Int32 nEnd (rPam.End ()->nContent.GetIndex()); if (nEnd == pTxtNode->Len()) return; // paragraph selected until the end @@ -1428,7 +1429,7 @@ lcl_CalcBreaks( ::std::vector<xub_StrLen> & rBreaks, SwPaM const & rPam ) static bool lcl_DoWithBreaks(SwDoc & rDoc, SwPaM & rPam, bool (SwDoc::*pFunc)(SwPaM&, bool), const bool bForceJoinNext = false) { - ::std::vector<xub_StrLen> Breaks; + ::std::vector<sal_Int32> Breaks; lcl_CalcBreaks(Breaks, rPam); @@ -1446,7 +1447,7 @@ static bool lcl_DoWithBreaks(SwDoc & rDoc, SwPaM & rPam, bool bRet( true ); // iterate from end to start, to avoid invalidating the offsets! - ::std::vector<xub_StrLen>::reverse_iterator iter( Breaks.rbegin() ); + ::std::vector<sal_Int32>::reverse_iterator iter( Breaks.rbegin() ); SwPaM aPam( rSelectionEnd, rSelectionEnd ); // end node! SwPosition & rEnd( *aPam.End() ); SwPosition & rStart( *aPam.Start() ); @@ -1592,8 +1593,8 @@ bool SwDoc::DeleteRangeImplImpl(SwPaM & rPam) SwpHints* pHts; if( pTxtNd && 0 != ( pHts = pTxtNd->GetpSwpHints()) && pHts->Count() ) { - const xub_StrLen *pEndIdx; - xub_StrLen nMkCntPos = rPam.GetMark()->nContent.GetIndex(); + const sal_Int32 *pEndIdx; + const sal_Int32 nMkCntPos = rPam.GetMark()->nContent.GetIndex(); for( sal_uInt16 n = pHts->Count(); n; ) { const SwTxtAttr* pAttr = (*pHts)[ --n ]; @@ -1612,7 +1613,7 @@ bool SwDoc::DeleteRangeImplImpl(SwPaM & rPam) if (GetIDocumentUndoRedo().DoesUndo() && pStt->nNode == pEnd->nNode && (pEnd->nContent.GetIndex() - pStt->nContent.GetIndex()) == 1) { SwTxtNode* pTxtNd = rPam.Start()->nNode.GetNode().GetTxtNode(); - xub_StrLen nIndex = rPam.Start()->nContent.GetIndex(); + const sal_Int32 nIndex = rPam.Start()->nContent.GetIndex(); // We may have a postit here. if (pTxtNd->GetTxt()[nIndex] == CH_TXTATR_INWORD) { @@ -1682,7 +1683,7 @@ bool SwDoc::DeleteRangeImplImpl(SwPaM & rPam) { // now move the Content to the new Node sal_Bool bOneNd = pStt->nNode == pEnd->nNode; - xub_StrLen nLen = ( bOneNd ? pEnd->nContent.GetIndex() + const sal_Int32 nLen = ( bOneNd ? pEnd->nContent.GetIndex() : pCNd->Len() ) - pStt->nContent.GetIndex(); @@ -1872,8 +1873,8 @@ uno::Any SwDoc::Spell( SwPaM& rPaM, ::SetProgressState( nStat, (SwDocShell*)GetDocShell() ); } //Spell() changes the pSpellArgs in case an error is found - xub_StrLen nBeginGrammarCheck = 0; - xub_StrLen nEndGrammarCheck = 0; + sal_Int32 nBeginGrammarCheck = 0; + sal_Int32 nEndGrammarCheck = 0; if( pSpellArgs && pSpellArgs->bIsGrammarCheck) { nBeginGrammarCheck = pSpellArgs->pStartNode == pNd ? pSpellArgs->pStartIdx->GetIndex() : 0; @@ -1896,7 +1897,7 @@ uno::Any SwDoc::Spell( SwPaM& rPaM, ->GetTxt().getLength(); } - xub_StrLen nSpellErrorPosition = + sal_Int32 nSpellErrorPosition = static_cast<SwTxtNode const*>(pNd)->GetTxt().getLength(); if( (!pConvArgs && ((SwTxtNode*)pNd)->Spell( pSpellArgs )) || @@ -1943,7 +1944,7 @@ uno::Any SwDoc::Spell( SwPaM& rPaM, if( aResult.nStartOfNextSentencePosition <= nBeginGrammarCheck ) break; // prepare next iteration - nBeginGrammarCheck = (xub_StrLen)aResult.nStartOfNextSentencePosition; + nBeginGrammarCheck = aResult.nStartOfNextSentencePosition; } while( nSpellErrorPosition > aResult.nBehindEndOfSentencePosition && !nGrammarErrors && aResult.nBehindEndOfSentencePosition < nEndGrammarCheck ); @@ -1957,8 +1958,8 @@ uno::Any SwDoc::Spell( SwPaM& rPaM, pEndPos->nNode = nCurrNd; pSpellArgs->pStartNode = ((SwTxtNode*)pNd); pSpellArgs->pEndNode = ((SwTxtNode*)pNd); - pSpellArgs->pStartIdx->Assign(((SwTxtNode*)pNd), (xub_StrLen)aConversionMap.ConvertToModelPosition( rError.nErrorStart ).mnPos ); - pSpellArgs->pEndIdx->Assign(((SwTxtNode*)pNd), (xub_StrLen)aConversionMap.ConvertToModelPosition( rError.nErrorStart + rError.nErrorLength ).mnPos ); + pSpellArgs->pStartIdx->Assign(((SwTxtNode*)pNd), aConversionMap.ConvertToModelPosition( rError.nErrorStart ).mnPos ); + pSpellArgs->pEndIdx->Assign(((SwTxtNode*)pNd), aConversionMap.ConvertToModelPosition( rError.nErrorStart + rError.nErrorLength ).mnPos ); nCurrNd = nEndNd; } } @@ -2003,8 +2004,8 @@ class SwHyphArgs : public SwInterHyphInfo sal_uInt16 *pPageSt; sal_uInt32 nNode; - xub_StrLen nPamStart; - xub_StrLen nPamLen; + sal_Int32 nPamStart; + sal_Int32 nPamLen; public: SwHyphArgs( const SwPaM *pPam, const Point &rPoint, @@ -2163,7 +2164,7 @@ bool SwDoc::ReplaceRange( SwPaM& rPam, const OUString& rStr, // unfortunately replace works slightly differently from delete, // so we cannot use lcl_DoWithBreaks here... - ::std::vector<xub_StrLen> Breaks; + ::std::vector<sal_Int32> Breaks; SwPaM aPam( *rPam.GetMark(), *rPam.GetPoint() ); aPam.Normalize(false); @@ -2199,7 +2200,7 @@ bool SwDoc::ReplaceRange( SwPaM& rPam, const OUString& rStr, bool bRet( true ); // iterate from end to start, to avoid invalidating the offsets! - ::std::vector<xub_StrLen>::reverse_iterator iter( Breaks.rbegin() ); + ::std::vector<sal_Int32>::reverse_iterator iter( Breaks.rbegin() ); OSL_ENSURE(aPam.GetPoint() == aPam.End(), "wrong!"); SwPosition & rEnd( *aPam.End() ); SwPosition & rStart( *aPam.Start() ); @@ -2262,8 +2263,8 @@ bool SwDoc::ReplaceRangeImpl( SwPaM& rPam, const OUString& rStr, // Own Undo? OUString sRepl( rStr ); SwTxtNode* pTxtNd = pStt->nNode.GetNode().GetTxtNode(); - xub_StrLen nStt = pStt->nContent.GetIndex(), - nEnd = bOneNode ? pEnd->nContent.GetIndex() + sal_Int32 nStt = pStt->nContent.GetIndex(); + sal_Int32 nEnd = bOneNode ? pEnd->nContent.GetIndex() : pTxtNd->GetTxt().getLength(); SwDataChanged aTmp( aDelPam ); @@ -2313,7 +2314,7 @@ bool SwDoc::ReplaceRangeImpl( SwPaM& rPam, const OUString& rStr, // Remember the End SwNodeIndex aPtNd( aDelPam.GetPoint()->nNode, -1 ); - xub_StrLen nPtCnt = aDelPam.GetPoint()->nContent.GetIndex(); + const sal_Int32 nPtCnt = aDelPam.GetPoint()->nContent.GetIndex(); bool bFirst = true; OUString sIns; @@ -2323,7 +2324,7 @@ bool SwDoc::ReplaceRangeImpl( SwPaM& rPam, const OUString& rStr, if( bFirst ) { SwNodeIndex aMkNd( aDelPam.GetMark()->nNode, -1 ); - xub_StrLen nMkCnt = aDelPam.GetMark()->nContent.GetIndex(); + const sal_Int32 nMkCnt = aDelPam.GetMark()->nContent.GetIndex(); SplitNode( *aDelPam.GetPoint(), false ); @@ -2405,7 +2406,7 @@ SetRedlineMode( eOld ); aDelPam.Exchange(); SwNodeIndex aPtNd( pStt->nNode, -1 ); - xub_StrLen nPtCnt = pStt->nContent.GetIndex(); + const sal_Int32 nPtCnt = pStt->nContent.GetIndex(); // Set the values again, if Frames or footnotes on the Text have been removed. nStt = nPtCnt; @@ -2629,8 +2630,8 @@ void SwDoc::TransliterateText( * pEnd = rPaM.End(); sal_uLong nSttNd = pStt->nNode.GetIndex(), nEndNd = pEnd->nNode.GetIndex(); - xub_StrLen nSttCnt = pStt->nContent.GetIndex(), - nEndCnt = pEnd->nContent.GetIndex(); + sal_Int32 nSttCnt = pStt->nContent.GetIndex(); + sal_Int32 nEndCnt = pEnd->nContent.GetIndex(); SwTxtNode* pTNd = pStt->nNode.GetNode().GetTxtNode(); if( pStt == pEnd && pTNd ) // no selection? @@ -2647,8 +2648,8 @@ void SwDoc::TransliterateText( if( aBndry.startPos < nSttCnt && nSttCnt < aBndry.endPos ) { - nSttCnt = (xub_StrLen)aBndry.startPos; - nEndCnt = (xub_StrLen)aBndry.endPos; + nSttCnt = aBndry.startPos; + nEndCnt = aBndry.endPos; } } @@ -2726,8 +2727,8 @@ void SwDoc::CountWords( const SwPaM& rPaM, SwDocStat& rStat ) const const sal_uLong nSttNd = pStt->nNode.GetIndex(); const sal_uLong nEndNd = pEnd->nNode.GetIndex(); - const xub_StrLen nSttCnt = pStt->nContent.GetIndex(); - const xub_StrLen nEndCnt = pEnd->nContent.GetIndex(); + const sal_Int32 nSttCnt = pStt->nContent.GetIndex(); + const sal_Int32 nEndCnt = pEnd->nContent.GetIndex(); const SwTxtNode* pTNd = pStt->nNode.GetNode().GetTxtNode(); if( pStt == pEnd && pTNd ) // no region ? diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 68cfd8d78058..cd9d9f204968 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -954,9 +954,9 @@ const SwNode* _SetGetExpFld::GetNodeFromCntnt() const return pRet; } -xub_StrLen _SetGetExpFld::GetCntPosFromCntnt() const +sal_Int32 _SetGetExpFld::GetCntPosFromCntnt() const { - sal_uInt16 nRet = 0; + sal_Int32 nRet = 0; if( CNTNT.pTxtFld ) switch( eSetGetExpFldType ) { diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index d5047d93fc73..13ac0a11523a 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -243,7 +243,7 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, bool bNewFrms const SwPosition *pPos = rOldAnch.GetCntntAnchor(); SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode(); OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." ); - const xub_StrLen nIdx = pPos->nContent.GetIndex(); + const sal_Int32 nIdx = pPos->nContent.GetIndex(); SwTxtAttr * const pHnt = pTxtNode->GetTxtAttrForCharAt( nIdx, RES_TXTATR_FLYCNT ); OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT, @@ -816,7 +816,7 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, // The TxtAttribut needs to be destroyed which, unfortunately, also // destroys the format. To avoid that, we disconnect the format from // the attribute. - const xub_StrLen nIndx( xOldAsCharAnchorPos->nContent.GetIndex() ); + const sal_Int32 nIndx( xOldAsCharAnchorPos->nContent.GetIndex() ); SwTxtNode* pTxtNode( xOldAsCharAnchorPos->nNode.GetNode().GetTxtNode() ); OSL_ENSURE( pTxtNode, "<SwDoc::ChgAnchor(..)> - missing previous anchor text node for as-character anchored object" ); OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." ); diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 223d48ccb387..d3f08d127b46 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -141,7 +141,7 @@ static bool lcl_RstTxtAttr( const SwNodePtr& rpNd, void* pArgs ) if( pTxtNode && pTxtNode->GetpSwpHints() ) { SwIndex aSt( pTxtNode, 0 ); - sal_uInt16 nEnd = pTxtNode->Len(); + sal_Int32 nEnd = pTxtNode->Len(); if( &pPara->pSttNd->nNode.GetNode() == pTxtNode && pPara->pSttNd->nContent.GetIndex() ) @@ -337,7 +337,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, pPam = new SwPaM( *rRg.GetPoint() ); SwIndex& rSt = pPam->GetPoint()->nContent; - sal_uInt16 nMkPos, nPtPos = rSt.GetIndex(); + sal_Int32 nMkPos, nPtPos = rSt.GetIndex(); // Special case: if the Crsr is located within a URL attribute, we take over it's area SwTxtAttr const*const pURLAttr( @@ -359,8 +359,8 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, if( aBndry.startPos < nPtPos && nPtPos < aBndry.endPos ) { - nMkPos = (xub_StrLen)aBndry.startPos; - nPtPos = (xub_StrLen)aBndry.endPos; + nMkPos = aBndry.startPos; + nPtPos = aBndry.endPos; } else { @@ -654,8 +654,8 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet, aTxtSet.Put( rChgSet ); if( aTxtSet.Count() ) { - sal_uInt16 nInsCnt = rSt.GetIndex(); - sal_uInt16 nEnd = pStt->nNode == pEnd->nNode + const sal_Int32 nInsCnt = rSt.GetIndex(); + const sal_Int32 nEnd = pStt->nNode == pEnd->nNode ? pEnd->nContent.GetIndex() : pNode->Len(); SwRegHistory history( pNode, *pNode, pHistory ); @@ -787,7 +787,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet, { SwTxtNode* pTxtNd = static_cast<SwTxtNode*>(pNode); const SwIndex& rSt = pStt->nContent; - sal_uInt16 nMkPos, nPtPos = rSt.GetIndex(); + sal_Int32 nMkPos, nPtPos = rSt.GetIndex(); const OUString& rStr = pTxtNd->GetTxt(); // Special case: if the Crsr is located within a URL attribute, we take over it's area @@ -810,8 +810,8 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet, if( aBndry.startPos < nPtPos && nPtPos < aBndry.endPos ) { - nMkPos = (xub_StrLen)aBndry.startPos; - nPtPos = (xub_StrLen)aBndry.endPos; + nMkPos = aBndry.startPos; + nPtPos = aBndry.endPos; } else nPtPos = nMkPos = rSt.GetIndex(); @@ -878,7 +878,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet, if( pNode ) { - sal_uInt16 nLen = pNode->Len(); + const sal_Int32 nLen = pNode->Len(); if( pStt->nNode != pEnd->nNode ) aCntEnd.Assign( pNode, nLen ); @@ -943,8 +943,7 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet, pNode = pEnd->nNode.GetNode().GetCntntNode(); if(pNode) { - sal_uInt16 nLen = pNode->Len(); - if( aCntEnd.GetIndex() != nLen ) + if( aCntEnd.GetIndex() != pNode->Len() ) { // the SwRegHistory inserts the attribute into the TxtNode! if( pNode->IsTxtNode() && pCharSet && pCharSet->Count() ) @@ -1110,7 +1109,7 @@ bool SwDoc::UpdateRsid( const SwPaM &rRg, const xub_StrLen nLen ) { return false; } - xub_StrLen const nStart(rRg.GetPoint()->nContent.GetIndex() - nLen); + const sal_Int32 nStart(rRg.GetPoint()->nContent.GetIndex() - nLen); SvxRsidItem aRsid( mnRsid, RES_CHRATR_RSID ); SfxItemSet aSet(GetAttrPool(), RES_CHRATR_RSID, RES_CHRATR_RSID); @@ -2464,7 +2463,7 @@ void SwDoc::SetFmtItemByAutoFmt( const SwPaM& rPam, const SfxItemSet& rSet ) SetRedlineMode_intern( (RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE)); } - xub_StrLen const nEnd(rPam.End()->nContent.GetIndex()); + const sal_Int32 nEnd(rPam.End()->nContent.GetIndex()); std::vector<sal_uInt16> whichIds; SfxItemIter iter(rSet); for (SfxPoolItem const* pItem = iter.FirstItem(); diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx index 1360539200b8..e9ce943092a8 100644 --- a/sw/source/core/doc/docftn.cxx +++ b/sw/source/core/doc/docftn.cxx @@ -398,9 +398,9 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const OUString& rNumStr, const SwPosition* pStt = rPam.Start(), *pEnd = rPam.End(); const sal_uLong nSttNd = pStt->nNode.GetIndex(); - const xub_StrLen nSttCnt = pStt->nContent.GetIndex(); + const sal_Int32 nSttCnt = pStt->nContent.GetIndex(); const sal_uLong nEndNd = pEnd->nNode.GetIndex(); - const xub_StrLen nEndCnt = pEnd->nContent.GetIndex(); + const sal_Int32 nEndCnt = pEnd->nContent.GetIndex(); sal_uInt16 nPos; rFtnArr.SeekEntry( pStt->nNode, &nPos ); diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 443f21bbd69b..2ea2fb95d1fd 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -625,7 +625,7 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos, if ( FLY_AS_CHAR == eAnchorId ) { - xub_StrLen nStt = rAnchPos.nContent.GetIndex(); + const sal_Int32 nStt = rAnchPos.nContent.GetIndex(); SwTxtNode * pTxtNode = rAnchPos.nNode.GetNode().GetTxtNode(); OSL_ENSURE(pTxtNode!= 0, "There should be a SwTxtNode!"); @@ -668,7 +668,7 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos, if (GetIDocumentUndoRedo().DoesUndo()) { sal_uLong nNodeIdx = rAnchPos.nNode.GetIndex(); - xub_StrLen nCntIdx = rAnchPos.nContent.GetIndex(); + const sal_Int32 nCntIdx = rAnchPos.nContent.GetIndex(); GetIDocumentUndoRedo().AppendUndo( new SwUndoInsLayFmt( pFmt, nNodeIdx, nCntIdx )); } @@ -923,7 +923,7 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg, // For Draws anchored as character we set the attribute in the paragraph if ( FLY_AS_CHAR == eAnchorId ) { - xub_StrLen nStt = rRg.GetPoint()->nContent.GetIndex(); + const sal_Int32 nStt = rRg.GetPoint()->nContent.GetIndex(); SwFmtFlyCnt aFmt( pFmt ); bool const bSuccess( // may fail if there's no space left rRg.GetPoint()->nNode.GetNode().GetTxtNode()->InsertItem( @@ -981,8 +981,8 @@ static bool lcl_TstFlyRange( const SwPaM* pPam, const SwPosition* pFlyPos, (nPamEndIndex > nFlyIndex)); else { - xub_StrLen nFlyContentIndex = pFlyPos->nContent.GetIndex(); - xub_StrLen nPamEndContentIndex = pPaMEnd->nContent.GetIndex(); + const sal_Int32 nFlyContentIndex = pFlyPos->nContent.GetIndex(); + const sal_Int32 nPamEndContentIndex = pPaMEnd->nContent.GetIndex(); bOk = (nPamStartIndex < nFlyIndex && (( nPamEndIndex > nFlyIndex )|| ((nPamEndIndex == nFlyIndex) && @@ -1293,7 +1293,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl, const SwPosition *pPos = rAnchor.GetCntntAnchor(); SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode(); OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." ); - const xub_StrLen nIdx = pPos->nContent.GetIndex(); + const sal_Int32 nIdx = pPos->nContent.GetIndex(); SwTxtAttr * const pHnt = pTxtNode->GetTxtAttrForCharAt(nIdx, RES_TXTATR_FLYCNT); @@ -1598,7 +1598,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl, const SwPosition *pPos = rAnchor.GetCntntAnchor(); SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode(); OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." ); - const xub_StrLen nIdx = pPos->nContent.GetIndex(); + const sal_Int32 nIdx = pPos->nContent.GetIndex(); SwTxtAttr * const pHnt = pTxtNode->GetTxtAttrForCharAt( nIdx, RES_TXTATR_FLYCNT ); diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index c6be76504127..07d55ddbe6df 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -1950,8 +1950,7 @@ bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, bool bIsOutlMv ) // We need to remove the last empty Node again aIdx = aInsPos.nNode; SwCntntNode* pCNd = GetNodes().GoPrevious( &aInsPos.nNode ); - xub_StrLen nCLen = 0; if( pCNd ) nCLen = pCNd->Len(); - aInsPos.nContent.Assign( pCNd, nCLen ); + aInsPos.nContent.Assign( pCNd, pCNd ? pCNd->Len() : 0 ); // All, that are in the to-be-deleted Node, need to be // moved to the next Node @@ -2055,8 +2054,7 @@ bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, bool bIsOutlMv ) { pREnd->nNode = nRedlEndNd; SwCntntNode* pCNd = pREnd->nNode.GetNode().GetCntntNode(); - xub_StrLen nL = 0; if( pCNd ) nL = pCNd->Len(); - pREnd->nContent.Assign( pCNd, nL ); + pREnd->nContent.Assign( pCNd, pCNd ? pCNd->Len() : 0 ); } } diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 3e737b0e94c2..6dd4e5b00922 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -3232,13 +3232,13 @@ void SwRedline::InvalidateRange() // trigger the Layout { sal_uLong nSttNd = GetMark()->nNode.GetIndex(), nEndNd = GetPoint()->nNode.GetIndex(); - sal_uInt16 nSttCnt = GetMark()->nContent.GetIndex(), - nEndCnt = GetPoint()->nContent.GetIndex(); + sal_Int32 nSttCnt = GetMark()->nContent.GetIndex(); + sal_Int32 nEndCnt = GetPoint()->nContent.GetIndex(); if( nSttNd > nEndNd || ( nSttNd == nEndNd && nSttCnt > nEndCnt )) { sal_uLong nTmp = nSttNd; nSttNd = nEndNd; nEndNd = nTmp; - nTmp = nSttCnt; nSttCnt = nEndCnt; nEndCnt = (sal_uInt16)nTmp; + sal_Int32 nTmp2 = nSttCnt; nSttCnt = nEndCnt; nEndCnt = nTmp2; } SwUpdateAttr aHt( 0, 0, RES_FMT_CHG ); @@ -3591,7 +3591,7 @@ void SwRedline::MoveFromSection() ? pCNd->GetFmtColl() : 0; SwNodeIndex aNdIdx( GetPoint()->nNode, -1 ); - sal_uInt16 nPos = GetPoint()->nContent.GetIndex(); + const sal_Int32 nPos = GetPoint()->nContent.GetIndex(); SwPosition aPos( *GetPoint() ); if( bDelLastPara && *aPam.GetPoint() == *aPam.GetMark() ) diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx index 2f3dc2623afc..52b990b9d786 100644 --- a/sw/source/core/doc/docruby.cxx +++ b/sw/source/core/doc/docruby.cxx @@ -185,7 +185,8 @@ sal_Bool SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, sal_ SwPosition* pPos = rPam.GetPoint(); const SwTxtNode* pTNd = pPos->nNode.GetNode().GetTxtNode(); OUString const& rTxt = pTNd->GetTxt(); - xub_StrLen nStart = pPos->nContent.GetIndex(), nEnd = rTxt.getLength(); + sal_Int32 nStart = pPos->nContent.GetIndex(); + sal_Int32 nEnd = rTxt.getLength(); sal_Bool bHasMark = rPam.HasMark(); if( bHasMark ) @@ -194,7 +195,7 @@ sal_Bool SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, sal_ if( rPam.GetMark()->nNode == pPos->nNode ) { // then use that end - xub_StrLen nTEnd = rPam.GetMark()->nContent.GetIndex(); + const sal_Int32 nTEnd = rPam.GetMark()->nContent.GetIndex(); if( nTEnd < nEnd ) nEnd = nTEnd; } @@ -229,20 +230,20 @@ sal_Bool SwDoc::_SelectNextRubyChars( SwPaM& rPam, SwRubyListEntry& rEntry, sal_ if( !bHasMark && nStart && ( !pAttr || nStart != *pAttr->GetStart()) ) { // skip to the word begin! - long nWordStt = g_pBreakIt->GetBreakIter()->getWordBoundary( + const sal_Int32 nWordStt = g_pBreakIt->GetBreakIter()->getWordBoundary( rTxt, nStart, g_pBreakIt->GetLocale( pTNd->GetLang( nStart )), WordType::ANYWORD_IGNOREWHITESPACES, sal_True ).startPos; if( nWordStt < nStart && -1 != nWordStt ) { - nStart = (xub_StrLen)nWordStt; + nStart = nWordStt; pPos->nContent = nStart; } } bool bAlphaNum = false; - long nWordEnd = nEnd; + sal_Int32 nWordEnd = nEnd; CharClass& rCC = GetAppCharClass(); while( nStart < nEnd ) { diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index f272f4fab1a2..0d8b894fc7c7 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -354,7 +354,7 @@ bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) pRedlPam->GetPoint()->nNode.Assign( aEndIdx.GetNode() ); pCNd = pRedlPam->GetCntntNode( sal_True ); - xub_StrLen nCLen = 0; + sal_Int32 nCLen = 0; if( !pCNd && 0 != (pCNd = GetNodes()[ aEndIdx.GetIndex()-1 ]->GetCntntNode())) { diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index a502668684ce..a9641dd9f4bd 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -126,10 +126,10 @@ sal_uInt16 SwDoc::GetCurTOXMark( const SwPosition& rPos, const SwpHints & rHts = *pTxtNd->GetpSwpHints(); const SwTxtAttr* pHt; - xub_StrLen nSttIdx; - const xub_StrLen *pEndIdx; + sal_Int32 nSttIdx; + const sal_Int32 *pEndIdx; - xub_StrLen nAktPos = rPos.nContent.GetIndex(); + const sal_Int32 nAktPos = rPos.nContent.GetIndex(); for( sal_uInt16 n = 0; n < rHts.Count(); ++n ) { @@ -725,7 +725,7 @@ bool SwTOXBaseSection::SetPosAtStartEnd( SwPosition& rPos, bool bAtStart ) const if( pSectNd ) { SwCntntNode* pCNd; - xub_StrLen nC = 0; + sal_Int32 nC = 0; if( bAtStart ) { rPos.nNode = *pSectNd; diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx index 92075ab48979..e5acc7b1ce7c 100644 --- a/sw/source/core/doc/extinput.cxx +++ b/sw/source/core/doc/extinput.cxx @@ -55,8 +55,8 @@ SwExtTextInput::~SwExtTextInput() if( pTNd ) { SwIndex& rIdx = GetPoint()->nContent; - xub_StrLen nSttCnt = rIdx.GetIndex(), - nEndCnt = GetMark()->nContent.GetIndex(); + sal_Int32 nSttCnt = rIdx.GetIndex(); + sal_Int32 nEndCnt = GetMark()->nContent.GetIndex(); if( nEndCnt != nSttCnt ) { if( nEndCnt < nSttCnt ) @@ -133,8 +133,8 @@ void SwExtTextInput::SetInputData( const CommandExtTextInputData& rData ) SwTxtNode* pTNd = GetPoint()->nNode.GetNode().GetTxtNode(); if( pTNd ) { - xub_StrLen nSttCnt = GetPoint()->nContent.GetIndex(), - nEndCnt = GetMark()->nContent.GetIndex(); + sal_Int32 nSttCnt = GetPoint()->nContent.GetIndex(); + sal_Int32 nEndCnt = GetMark()->nContent.GetIndex(); if( nEndCnt < nSttCnt ) { std::swap(nSttCnt, nEndCnt); @@ -211,8 +211,8 @@ void SwExtTextInput::SetOverwriteCursor( sal_Bool bFlag ) const SwTxtNode *const pTNd = GetPoint()->nNode.GetNode().GetTxtNode(); if (pTNd) { - xub_StrLen nSttCnt = GetPoint()->nContent.GetIndex(), - nEndCnt = GetMark()->nContent.GetIndex(); + const sal_Int32 nSttCnt = GetPoint()->nContent.GetIndex(); + const sal_Int32 nEndCnt = GetMark()->nContent.GetIndex(); sOverwriteText = pTNd->GetTxt().copy( std::min(nSttCnt, nEndCnt) ); if( !sOverwriteText.isEmpty() ) { @@ -257,7 +257,7 @@ void SwDoc::DeleteExtTextInput( SwExtTextInput* pDel ) } SwExtTextInput* SwDoc::GetExtTextInput( const SwNode& rNd, - xub_StrLen nCntntPos ) const + sal_Int32 nCntntPos ) const { SwExtTextInput* pRet = 0; if( mpExtInputRing ) @@ -267,17 +267,17 @@ SwExtTextInput* SwDoc::GetExtTextInput( const SwNode& rNd, do { sal_uLong nPt = pTmp->GetPoint()->nNode.GetIndex(), nMk = pTmp->GetMark()->nNode.GetIndex(); - xub_StrLen nPtCnt = pTmp->GetPoint()->nContent.GetIndex(), - nMkCnt = pTmp->GetMark()->nContent.GetIndex(); + sal_Int32 nPtCnt = pTmp->GetPoint()->nContent.GetIndex(); + sal_Int32 nMkCnt = pTmp->GetMark()->nContent.GetIndex(); if( nPt < nMk || ( nPt == nMk && nPtCnt < nMkCnt )) { sal_uLong nTmp = nMk; nMk = nPt; nPt = nTmp; - nTmp = nMkCnt; nMkCnt = nPtCnt; nPtCnt = (xub_StrLen)nTmp; + sal_Int32 nTmp2 = nMkCnt; nMkCnt = nPtCnt; nPtCnt = nTmp2; } if( nMk <= nNdIdx && nNdIdx <= nPt && - ( STRING_NOTFOUND == nCntntPos || + ( nCntntPos<0 || ( nMkCnt <= nCntntPos && nCntntPos <= nPtCnt ))) { pRet = pTmp; diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx index 708c118907a9..8554cdfee69c 100644 --- a/sw/source/core/doc/swserv.cxx +++ b/sw/source/core/doc/swserv.cxx @@ -188,8 +188,8 @@ void SwServerObject::SendDataChanged( const SwPaM& rRange ) sal_Bool SwServerObject::IsLinkInServer( const SwBaseLink* pChkLnk ) const { sal_uLong nSttNd = 0, nEndNd = 0; - xub_StrLen nStt = 0; - xub_StrLen nEnd = 0; + sal_Int32 nStt = 0; + sal_Int32 nEnd = 0; const SwNode* pNd = 0; const SwNodes* pNds = 0; @@ -220,7 +220,8 @@ sal_Bool SwServerObject::IsLinkInServer( const SwBaseLink* pChkLnk ) const { nSttNd = pNd->GetIndex(); nEndNd = pNd->EndOfSectionIndex(); - nStt = 0, nEnd = USHRT_MAX; + nStt = 0; + nEnd = -1; pNds = &pNd->GetNodes(); } diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx index 7a8f76cba5fa..b08e4b595005 100644 --- a/sw/source/core/docnode/ndcopy.cxx +++ b/sw/source/core/docnode/ndcopy.cxx @@ -106,7 +106,7 @@ namespace sal_uLong nNdOff = rOrigPos.nNode.GetIndex(); nNdOff -= rOrigStt.nNode.GetIndex(); nNdOff -= nDelCount; - xub_StrLen nCntntPos = rOrigPos.nContent.GetIndex(); + sal_Int32 nCntntPos = rOrigPos.nContent.GetIndex(); // Always adjust <nNode> at to be changed <SwPosition> instance <rChgPos> rChgPos.nNode = nNdOff + rCpyStt.nNode.GetIndex(); @@ -963,7 +963,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos, } else if( !bOneNode || bColumnSel ) { - xub_StrLen nCntntEnd = pEnd->nContent.GetIndex(); + const sal_Int32 nCntntEnd = pEnd->nContent.GetIndex(); { ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo()); pDoc->SplitNode( rPos, false ); @@ -1029,7 +1029,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos, if( !bCopyOk ) { - const xub_StrLen nCpyLen = ( (bOneNode) + const sal_Int32 nCpyLen = ( (bOneNode) ? pEnd->nContent.GetIndex() : pSttTxtNd->GetTxt().getLength()) - pStt->nContent.GetIndex(); @@ -1090,7 +1090,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos, // (and joined from undo) bStartIsTxtNode = sal_True; - xub_StrLen nCntntEnd = pEnd->nContent.GetIndex(); + const sal_Int32 nCntntEnd = pEnd->nContent.GetIndex(); { ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo()); pDoc->SplitNode( rPos, false ); @@ -1312,7 +1312,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos, } // Copy method from SwDoc - "copy Flys in Flys" -void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndContentIndex, +void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg, const sal_Int32 nEndContentIndex, const SwNodeIndex& rInsPos, sal_Bool bMakeNewFrms, sal_Bool bDelRedlines, sal_Bool bCopyFlyAtFly ) const { @@ -1387,7 +1387,7 @@ static void lcl_ChainFmts( SwFlyFrmFmt *pSrc, SwFlyFrmFmt *pDest ) } void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg, - const xub_StrLen nEndContentIndex, const SwNodeIndex& rStartIdx, + const sal_Int32 nEndContentIndex, const SwNodeIndex& rStartIdx, const bool bCopyFlyAtFly ) const { // First collect all Flys, sort them according to their ordering number, diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 9609bf84b408..f45e37450499 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -259,7 +259,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, const SwCntntNode* pCNd = pEndPos->nNode.GetNode().GetCntntNode(); if( pCNd && pCNd->Len() != pEndPos->nContent.GetIndex() ) { - xub_StrLen nCntnt = pSttPos->nContent.GetIndex(); + sal_Int32 nCntnt = pSttPos->nContent.GetIndex(); SplitNode( *pEndPos, false ); SwTxtNode* pTNd; diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 5683c1fe57fb..887dc9cba3f7 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -1523,7 +1523,7 @@ static void lcl_DelBox( SwTableBox* pBox, _DelTabPara* pDelPara ) aCntIdx.GetIndex() ); std::vector<sal_uLong> aBkmkArr; - xub_StrLen nOldTxtLen = aCntIdx.GetIndex(); + const sal_Int32 nOldTxtLen = aCntIdx.GetIndex(); _SaveCntntIdx( pDoc, nNdIdx, pCurTxtNd->GetTxt().getLength(), aBkmkArr ); diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 15a3e52b1be0..6dee261bf79b 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -1045,7 +1045,7 @@ SwRect SwCntntNode::FindPageFrmRect( const sal_Bool bPrtArea, const Point* pPoin return aRet; } -xub_StrLen SwCntntNode::Len() const { return 0; } +sal_Int32 SwCntntNode::Len() const { return 0; } SwFmtColl *SwCntntNode::ChgFmtColl( SwFmtColl *pNewColl ) { @@ -1093,14 +1093,14 @@ sal_Bool SwCntntNode::GoNext(SwIndex * pIdx, sal_uInt16 nMode ) const else { const SwTxtNode& rTNd = *GetTxtNode(); - xub_StrLen nPos = pIdx->GetIndex(); + sal_Int32 nPos = pIdx->GetIndex(); if( g_pBreakIt->GetBreakIter().is() ) { sal_Int32 nDone = 0; sal_uInt16 nItrMode = ( CRSR_SKIP_CELLS & nMode ) ? CharacterIteratorMode::SKIPCELL : CharacterIteratorMode::SKIPCONTROLCHARACTER; - nPos = (xub_StrLen)g_pBreakIt->GetBreakIter()->nextCharacters( rTNd.GetTxt(), nPos, + nPos = g_pBreakIt->GetBreakIter()->nextCharacters( rTNd.GetTxt(), nPos, g_pBreakIt->GetLocale( rTNd.GetLang( nPos ) ), nItrMode, 1, nDone ); @@ -1140,14 +1140,14 @@ sal_Bool SwCntntNode::GoPrevious(SwIndex * pIdx, sal_uInt16 nMode ) const else { const SwTxtNode& rTNd = *GetTxtNode(); - xub_StrLen nPos = pIdx->GetIndex(); + sal_Int32 nPos = pIdx->GetIndex(); if( g_pBreakIt->GetBreakIter().is() ) { sal_Int32 nDone = 0; sal_uInt16 nItrMode = ( CRSR_SKIP_CELLS & nMode ) ? CharacterIteratorMode::SKIPCELL : CharacterIteratorMode::SKIPCONTROLCHARACTER; - nPos = (xub_StrLen)g_pBreakIt->GetBreakIter()->previousCharacters( rTNd.GetTxt(), nPos, + nPos = g_pBreakIt->GetBreakIter()->previousCharacters( rTNd.GetTxt(), nPos, g_pBreakIt->GetLocale( rTNd.GetLang( nPos ) ), nItrMode, 1, nDone ); diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx index fc3c7f179fef..482aac808296 100644 --- a/sw/source/core/docnode/nodedump.cxx +++ b/sw/source/core/docnode/nodedump.cxx @@ -103,6 +103,7 @@ void WriterHelper::writeFormatAttribute( const char* attribute, const char* form // Hack: somehow conversion from "..." to va_list does // bomb on two string litterals in the format. static const char* TMP_FORMAT = "%" SAL_PRIuUINTPTR; +static const char* TMP_FORMAT_I32 = "%" SAL_PRIdINT32; } @@ -132,9 +133,9 @@ void MarkManager::dumpAsXml( xmlTextWriterPtr w ) pMark_t pMark = *it; writer.startElement("fieldmark"); writer.writeFormatAttribute("startNode", TMP_FORMAT, pMark->GetMarkStart().nNode.GetIndex()); - writer.writeFormatAttribute("startOffset", "%d", pMark->GetMarkStart().nContent.GetIndex()); + writer.writeFormatAttribute("startOffset", TMP_FORMAT_I32, pMark->GetMarkStart().nContent.GetIndex()); writer.writeFormatAttribute("endNode", TMP_FORMAT, pMark->GetMarkEnd().nNode.GetIndex()); - writer.writeFormatAttribute("endOffset", "%d", pMark->GetMarkEnd().nContent.GetIndex()); + writer.writeFormatAttribute("endOffset", TMP_FORMAT_I32, pMark->GetMarkEnd().nContent.GetIndex()); OString txt8 = OUStringToOString(pMark->GetName(), RTL_TEXTENCODING_UTF8); writer.writeFormatAttribute("name", "%s", BAD_CAST( txt8.getStr())); writer.endElement(); diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index f38390291088..bd59984216fd 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -1472,7 +1472,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) // move the content into the new node bool bOneNd = pStt->nNode == pEnd->nNode; - const xub_StrLen nLen = + const sal_Int32 nLen = ( (bOneNd) ? pEnd->nContent.GetIndex() : pSrcNd->Len() ) - pStt->nContent.GetIndex(); diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index afdaa8c02216..79839c6bc7d9 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -76,8 +76,8 @@ public: const OUString& rMimeType, const ::com::sun::star::uno::Any & rValue ); virtual const SwNode* GetAnchor() const; - virtual sal_Bool IsInRange( sal_uLong nSttNd, sal_uLong nEndNd, xub_StrLen nStt = 0, - xub_StrLen nEnd = STRING_NOTFOUND ) const; + virtual sal_Bool IsInRange( sal_uLong nSttNd, sal_uLong nEndNd, sal_Int32 nStt = 0, + sal_Int32 nEnd = -1 ) const; inline SwSectionNode* GetSectNode() { @@ -1588,7 +1588,7 @@ const SwNode* SwIntrnlSectRefLink::GetAnchor() const } sal_Bool SwIntrnlSectRefLink::IsInRange( sal_uLong nSttNd, sal_uLong nEndNd, - xub_StrLen , xub_StrLen ) const + sal_Int32 , sal_Int32 ) const { SwStartNode* pSttNd = rSectFmt.GetSectionNode( sal_False ); return pSttNd && diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index 6db9c6de6388..9f8e0ca57a7f 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -473,7 +473,7 @@ sal_Bool SwBaseLink::IsRecursion( const SwBaseLink* pChkLnk ) const return sal_False; } -sal_Bool SwBaseLink::IsInRange( sal_uLong, sal_uLong, xub_StrLen, xub_StrLen ) const +sal_Bool SwBaseLink::IsInRange( sal_uLong, sal_uLong, sal_Int32, sal_Int32 ) const { // Not Graphic or OLE Links // Fields or Sections have their own derivation! diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 5c724dbaa539..6f543a6fb025 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -1684,7 +1684,7 @@ void SwDrawContact::DisconnectObjFromLayout( SdrObject* _pDrawObj ) } static SwTxtFrm* lcl_GetFlyInCntntAnchor( SwTxtFrm* _pProposedAnchorFrm, - const xub_StrLen _nTxtOfs ) + const sal_Int32 _nTxtOfs ) { SwTxtFrm* pAct = _pProposedAnchorFrm; SwTxtFrm* pTmp; diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx index 1d909a92a1cf..f4ff5e0be6c1 100644 --- a/sw/source/core/edit/acorrect.cxx +++ b/sw/source/core/edit/acorrect.cxx @@ -464,7 +464,7 @@ void SwDontExpandItem::SaveDontExpandItems( const SwPosition& rPos ) { pDontExpItems = new SfxItemSet( ((SwDoc*)pTxtNd->GetDoc())->GetAttrPool(), aCharFmtSetRange ); - xub_StrLen n = rPos.nContent.GetIndex(); + const sal_Int32 n = rPos.nContent.GetIndex(); if( !pTxtNd->GetAttr( *pDontExpItems, n, n, n != pTxtNd->GetTxt().getLength() )) delete pDontExpItems, pDontExpItems = 0; @@ -476,7 +476,7 @@ void SwDontExpandItem::RestoreDontExpandItems( const SwPosition& rPos ) SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode(); if( pTxtNd ) { - xub_StrLen nStart = rPos.nContent.GetIndex(); + const sal_Int32 nStart = rPos.nContent.GetIndex(); if( nStart == pTxtNd->GetTxt().getLength() ) pTxtNd->FmtToTxtAttr( pTxtNd ); @@ -484,8 +484,8 @@ void SwDontExpandItem::RestoreDontExpandItems( const SwPosition& rPos ) { const sal_uInt16 nSize = pTxtNd->GetpSwpHints()->Count(); sal_uInt16 n; - xub_StrLen nAttrStart; - const xub_StrLen* pAttrEnd; + sal_Int32 nAttrStart; + const sal_Int32* pAttrEnd; for( n = 0; n < nSize; ++n ) { diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 12522f816f44..6fb456a16549 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -165,7 +165,7 @@ class SwAutoFormat sal_Bool IsEnumericChar( const SwTxtNode&) const; sal_Bool IsBlanksInString( const SwTxtNode&) const; sal_uInt16 CalcLevel( const SwTxtNode&, sal_uInt16 *pDigitLvl = 0 ) const; - xub_StrLen GetBigIndent( xub_StrLen& rAktSpacePos ) const; + sal_Int32 GetBigIndent( sal_Int32& rAktSpacePos ) const; OUString DelLeadingBlanks(const OUString& rStr) const; OUString& DelTrailingBlanks( OUString& rStr ) const; @@ -173,7 +173,7 @@ class SwAutoFormat xub_StrLen GetTrailingBlanks( const OUString& rStr ) const; bool IsFirstCharCapital( const SwTxtNode& rNd ) const; - sal_uInt16 GetDigitLevel( const SwTxtNode& rTxtNd, xub_StrLen& rPos, + sal_uInt16 GetDigitLevel( const SwTxtNode& rTxtNd, sal_Int32& rPos, OUString* pPreFix = 0, OUString* pPostFix = 0, OUString* pNumTypes = 0 ) const; /// get the FORMATED TextFrame @@ -394,8 +394,8 @@ sal_Bool SwAutoFormat::IsEnumericChar( const SwTxtNode& rNd ) const { const OUString& rTxt = rNd.GetTxt(); OUString sTmp( rTxt ); - xub_StrLen nBlnks = GetLeadingBlanks( sTmp ); - xub_StrLen nLen = rTxt.getLength() - nBlnks; + sal_Int32 nBlnks = GetLeadingBlanks( sTmp ); + const sal_Int32 nLen = rTxt.getLength() - nBlnks; if( !nLen ) return sal_False; @@ -459,7 +459,7 @@ sal_uInt16 SwAutoFormat::CalcLevel( const SwTxtNode& rNd, sal_uInt16 *pDigitLvl ++nLvl; } - for( xub_StrLen n = 0, nEnd = rTxt.getLength(); n < nEnd; ++n ) + for (sal_Int32 n = 0, nEnd = rTxt.getLength(); n < nEnd; ++n) { switch (rTxt[n]) { @@ -478,7 +478,7 @@ sal_uInt16 SwAutoFormat::CalcLevel( const SwTxtNode& rNd, sal_uInt16 *pDigitLvl return nLvl; } -xub_StrLen SwAutoFormat::GetBigIndent( xub_StrLen& rAktSpacePos ) const +sal_Int32 SwAutoFormat::GetBigIndent( sal_Int32& rAktSpacePos ) const { SwTxtFrmInfo aFInfo( GetFrm( *pAktTxtNd ) ); const SwTxtFrm* pNxtFrm = 0; @@ -735,12 +735,12 @@ bool SwAutoFormat::IsFirstCharCapital( const SwTxtNode& rNd ) const return false; } -sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, xub_StrLen& rPos, +sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, sal_Int32& rPos, OUString* pPreFix, OUString* pPostFix, OUString* pNumTypes ) const { // check for 1.) / 1. / 1.1.1 / (1). / (1) / .... const OUString& rTxt = rNd.GetTxt(); - xub_StrLen nPos = rPos; + sal_Int32 nPos = rPos; int eScan = NONE; sal_uInt16 nStart = 0; @@ -1012,7 +1012,7 @@ bool SwAutoFormat::HasSelBlanks( SwPaM& rPam ) const // Is there a Blank at the beginning or end? // Do not delete it, it will be inserted again. SwPosition * pPos = rPam.End(); - xub_StrLen nBlnkPos = pPos->nContent.GetIndex(); + sal_Int32 nBlnkPos = pPos->nContent.GetIndex(); SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode(); if (nBlnkPos && nBlnkPos-- < pTxtNd->GetTxt().getLength() && (' ' == pTxtNd->GetTxt()[nBlnkPos])) @@ -1072,7 +1072,7 @@ void SwAutoFormat::DeleteCurrentParagraph( bool bStart, bool bEnd ) // delete blanks at the end of the current and at the beginning of the next one aDelPam.DeleteMark(); aDelPam.GetPoint()->nNode = aNdIdx; - xub_StrLen nPos(0); + sal_Int32 nPos(0); if( bStart && 0 != ( nPos = GetLeadingBlanks( pAktTxtNd->GetTxt() ))) { aDelPam.GetPoint()->nContent.Assign( pAktTxtNd, 0 ); @@ -1406,7 +1406,8 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) // replace bullet character with defined one const OUString& rStr = pAktTxtNd->GetTxt(); - xub_StrLen nTxtStt = 0, nOrigTxtStt = 0; + sal_Int32 nTxtStt = 0; + const sal_Int32 nOrigTxtStt = 0; const sal_Unicode* pFndBulletChr; if( aFlags.bChgEnumNum && 2 < rStr.getLength() && @@ -1680,7 +1681,8 @@ void SwAutoFormat::BuildNegIndent( SwTwips nSpaces ) // read all succeeding paragraphs that belong to this enumeration bool bBreak = true; - xub_StrLen nSpacePos, nTxtPos = GetBigIndent( nSpacePos ); + sal_Int32 nSpacePos = 0; + const sal_Int32 nTxtPos = GetBigIndent( nSpacePos ); if( bMoreLines ) DelMoreLinesBlanks( true ); else diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index 29209197b36e..557c0abd5f82 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -109,8 +109,8 @@ sal_Bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet, sal_uLong nSttNd = pPaM->GetMark()->nNode.GetIndex(), nEndNd = pPaM->GetPoint()->nNode.GetIndex(); - xub_StrLen nSttCnt = pPaM->GetMark()->nContent.GetIndex(), - nEndCnt = pPaM->GetPoint()->nContent.GetIndex(); + sal_Int32 nSttCnt = pPaM->GetMark()->nContent.GetIndex(); + sal_Int32 nEndCnt = pPaM->GetPoint()->nContent.GetIndex(); if( nSttNd > nEndNd || ( nSttNd == nEndNd && nSttCnt > nEndCnt )) { @@ -134,8 +134,8 @@ sal_Bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet, { case ND_TEXTNODE: { - xub_StrLen const nStt = (n == nSttNd) ? nSttCnt : 0; - xub_StrLen const nEnd = (n == nEndNd) + const sal_Int32 nStt = (n == nSttNd) ? nSttCnt : 0; + const sal_Int32 nEnd = (n == nEndNd) ? nEndCnt : static_cast<SwTxtNode*>(pNd)->GetTxt().getLength(); @@ -511,15 +511,14 @@ static bool lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, sal_Int32 nPos, } } - sal_Int32 nEnd = sExp.getLength(); + const sal_Int32 nEnd = sExp.getLength(); if ( nEnd ) { - xub_StrLen n; if( bInSelection ) { sal_uInt16 nScript; - for( n = 0; n < nEnd; n = (xub_StrLen) - g_pBreakIt->GetBreakIter()->endOfScript( sExp, n, nScript )) + for( sal_Int32 n = 0; n < nEnd; + n = g_pBreakIt->GetBreakIter()->endOfScript( sExp, n, nScript )) { nScript = g_pBreakIt->GetBreakIter()->getScriptType( sExp, n ); rScrpt |= lcl_SetScriptFlags( nScript ); @@ -553,7 +552,7 @@ sal_uInt16 SwEditShell::GetScriptType() const // try to get SwScriptInfo const SwScriptInfo* pScriptInfo = SwScriptInfo::GetScriptInfo( *pTNd ); - xub_StrLen nPos = pStt->nContent.GetIndex(); + sal_Int32 nPos = pStt->nContent.GetIndex(); //Task 90448: we need the scripttype of the previous // position, if no selection exist! if( nPos ) @@ -591,10 +590,10 @@ sal_uInt16 SwEditShell::GetScriptType() const // try to get SwScriptInfo const SwScriptInfo* pScriptInfo = SwScriptInfo::GetScriptInfo( *pTNd ); - xub_StrLen nChg = aIdx == pStt->nNode + sal_Int32 nChg = aIdx == pStt->nNode ? pStt->nContent.GetIndex() - : 0, - nEndPos = aIdx == nEndIdx + : 0; + sal_Int32 nEndPos = aIdx == nEndIdx ? pEnd->nContent.GetIndex() : rTxt.getLength(); @@ -623,7 +622,7 @@ sal_uInt16 SwEditShell::GetScriptType() const nChg = pScriptInfo ? pScriptInfo->NextScriptChg( nChg ) : - (xub_StrLen)g_pBreakIt->GetBreakIter()->endOfScript( + g_pBreakIt->GetBreakIter()->endOfScript( rTxt, nChg, nScript ); nFldPos = rTxt.indexOf( @@ -657,7 +656,7 @@ sal_uInt16 SwEditShell::GetCurLang() const { //JP 24.9.2001: if exist no selection, then get the language before // the current character! - xub_StrLen nPos = rPos.nContent.GetIndex(); + sal_Int32 nPos = rPos.nContent.GetIndex(); if( nPos && !pCrsr->HasMark() ) --nPos; nLang = pTNd->GetLang( nPos ); @@ -677,14 +676,13 @@ sal_uInt16 SwEditShell::GetScalingOfSelectedText() const sal_uInt16 nScaleWidth; if( pTNd ) { - xub_StrLen nStt = pStt->nContent.GetIndex(), nEnd; const SwPosition* pEnd = pStt == pCrsr->GetPoint() ? pCrsr->GetMark() : pCrsr->GetPoint(); - if( pStt->nNode == pEnd->nNode ) - nEnd = pEnd->nContent.GetIndex(); - else - nEnd = pTNd->GetTxt().getLength(); + const sal_Int32 nStt = pStt->nContent.GetIndex(); + const sal_Int32 nEnd = pStt->nNode == pEnd->nNode + ? pEnd->nContent.GetIndex() + : pTNd->GetTxt().getLength(); nScaleWidth = pTNd->GetScalingOfSelectedText( nStt, nEnd ); } else diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx index 5434de3b2ff9..e94ea3bc43af 100644 --- a/sw/source/core/edit/eddel.cxx +++ b/sw/source/core/edit/eddel.cxx @@ -188,7 +188,7 @@ long SwEditShell::Copy( SwEditShell* pDestShell ) sal_Bool bRet = sal_False; bool bFirstMove = true; SwNodeIndex aSttNdIdx( pDestShell->GetDoc()->GetNodes() ); - xub_StrLen nSttCntIdx = 0; + sal_Int32 nSttCntIdx = 0; // For block selection this list is filled with the insert positions std::list< boost::shared_ptr<SwPosition> >::iterator pNextInsert = aInsertList.begin(); diff --git a/sw/source/core/edit/edfmt.cxx b/sw/source/core/edit/edfmt.cxx index 532e2b23ebb8..5ec043b0caf8 100644 --- a/sw/source/core/edit/edfmt.cxx +++ b/sw/source/core/edit/edfmt.cxx @@ -63,7 +63,8 @@ void SwEditShell::FillByEx(SwCharFmt* pCharFmt, sal_Bool bReset) if( pCNd->IsTxtNode() ) { SwTxtNode const*const pTxtNode(static_cast<SwTxtNode const*>(pCNd)); - xub_StrLen nStt, nEnd; + sal_Int32 nStt; + sal_Int32 nEnd; if( pPam->HasMark() ) { const SwPosition* pPtPos = pPam->GetPoint(); diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 14710ae0d9b2..3d6f72ebd2af 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -123,8 +123,8 @@ void SwEditShell::Insert2(const OUString &rStr, const bool bForceExpandHints ) if ( rNode.IsTxtNode() ) { SwIndex& rIdx = pTmpCrsr->GetPoint()->nContent; - xub_StrLen nPos = rIdx.GetIndex(); - xub_StrLen nPrevPos = nPos; + sal_Int32 nPos = rIdx.GetIndex(); + sal_Int32 nPrevPos = nPos; if ( nPrevPos ) --nPrevPos; @@ -532,7 +532,7 @@ OUString SwEditShell::Calculate() if(pTxtNd) { const SwPosition *pStart = pPaM->Start(), *pEnd = pPaM->End(); - xub_StrLen nStt = pStart->nContent.GetIndex(); + const sal_Int32 nStt = pStart->nContent.GetIndex(); OUString aStr = pTxtNd->GetExpandTxt( nStt, pEnd->nContent. GetIndex() - nStt ); @@ -1019,11 +1019,11 @@ void SwEditShell::SetExtTextInputData( const CommandExtTextInputData& rData ) pInput->SetInputData( rData ); // position cursor const SwPosition& rStt = *pInput->Start(); - xub_StrLen nNewCrsrPos = rStt.nContent.GetIndex() + rData.GetCursorPos(); + const sal_Int32 nNewCrsrPos = rStt.nContent.GetIndex() + rData.GetCursorPos(); // ugly but works ShowCrsr(); - long nDiff = nNewCrsrPos - rPos.nContent.GetIndex(); + const sal_Int32 nDiff = nNewCrsrPos - rPos.nContent.GetIndex(); if( 0 > nDiff ) Left( (xub_StrLen)-nDiff, CRSR_SKIP_CHARS ); else if( 0 < nDiff ) diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 0e5540e15f95..ccdadbfdc721 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 { - xub_StrLen nLeft; - xub_StrLen nRight; + sal_Int32 nLeft; + sal_Int32 nRight; }; typedef std::vector<SpellContentPosition> SpellContentPositions; @@ -168,7 +168,7 @@ public: uno::Any Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt ); sal_Bool IsAuto(); - void InsertSoftHyph( const xub_StrLen nHyphPos ); + void InsertSoftHyph( const sal_Int32 nHyphPos ); void ShowSelection(); }; @@ -524,13 +524,13 @@ void SwHyphIter::Ignore() void SwHyphIter::DelSoftHyph( SwPaM &rPam ) { const SwPosition* pStt = rPam.Start(); - const xub_StrLen nStart = pStt->nContent.GetIndex(); - const xub_StrLen nEnd = rPam.End()->nContent.GetIndex(); + const sal_Int32 nStart = pStt->nContent.GetIndex(); + const sal_Int32 nEnd = rPam.End()->nContent.GetIndex(); SwTxtNode *pNode = pStt->nNode.GetNode().GetTxtNode(); pNode->DelSoftHyph( nStart, nEnd ); } -void SwHyphIter::InsertSoftHyph( const xub_StrLen nHyphPos ) +void SwHyphIter::InsertSoftHyph( const sal_Int32 nHyphPos ) { SwEditShell *pMySh = GetSh(); OSL_ENSURE( pMySh, "SwHyphIter::InsertSoftHyph: missing HyphStart()"); @@ -541,7 +541,7 @@ void SwHyphIter::InsertSoftHyph( const xub_StrLen nHyphPos ) SwPosition* pSttPos = pCrsr->Start(); SwPosition* pEndPos = pCrsr->End(); - xub_StrLen nLastHyphLen = GetEnd()->nContent.GetIndex() - + const sal_Int32 nLastHyphLen = GetEnd()->nContent.GetIndex() - pSttPos->nContent.GetIndex(); if( pSttPos->nNode != pEndPos->nNode || !nLastHyphLen ) @@ -835,8 +835,8 @@ uno::Reference< XSpellAlternatives > 0 != (pWrong = pNode->GetWrong()) && !pNode->IsInProtectSect() ) { - xub_StrLen nBegin = aPos.nContent.GetIndex(); - xub_StrLen nLen = 1; + sal_Int32 nBegin = aPos.nContent.GetIndex(); + sal_Int32 nLen = 1; if( pWrong->InWrongWord(nBegin,nLen) && !pNode->IsSymbol(nBegin) ) { const OUString aText(pNode->GetTxt().copy(nBegin, nLen)); @@ -874,9 +874,9 @@ uno::Reference< XSpellAlternatives > // save the start and end positons of the line and the starting point Push(); LeftMargin(); - xub_StrLen nLineStart = GetCrsr()->GetPoint()->nContent.GetIndex(); + const sal_Int32 nLineStart = GetCrsr()->GetPoint()->nContent.GetIndex(); RightMargin(); - xub_StrLen nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex(); + const sal_Int32 nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex(); Pop(sal_False); // make sure the selection build later from the data below does @@ -884,11 +884,11 @@ uno::Reference< XSpellAlternatives > // preserve those. Therefore count those "in words" in order to // modify the selection accordingly. const sal_Unicode* pChar = aText.getStr(); - xub_StrLen nLeft = 0; + sal_Int32 nLeft = 0; while (pChar && *pChar++ == CH_TXTATR_INWORD) ++nLeft; pChar = aText.getLength() ? aText.getStr() + aText.getLength() - 1 : 0; - xub_StrLen nRight = 0; + sal_Int32 nRight = 0; while (pChar && *pChar-- == CH_TXTATR_INWORD) ++nRight; @@ -898,9 +898,9 @@ uno::Reference< XSpellAlternatives > pCrsr->SetMark(); ExtendSelection( sal_True, nLen - nLeft - nRight ); // don't determine the rectangle in the current line - xub_StrLen nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft; + const sal_Int32 nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft; // take one less than the line end - otherwise the next line would be calculated - xub_StrLen nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd + const sal_Int32 nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd ? nLineEnd : (nBegin + nLen - nLeft - nRight); Push(); pCrsr->DeleteMark(); @@ -947,8 +947,8 @@ bool SwEditShell::GetGrammarCorrection( 0 != (pWrong = pNode->GetGrammarCheck()) && !pNode->IsInProtectSect() ) { - xub_StrLen nBegin = aPos.nContent.GetIndex(); - xub_StrLen nLen = 1; + sal_Int32 nBegin = aPos.nContent.GetIndex(); + sal_Int32 nLen = 1; if (pWrong->InWrongWord(nBegin, nLen)) { const OUString aText(pNode->GetTxt().copy(nBegin, nLen)); @@ -1000,9 +1000,9 @@ bool SwEditShell::GetGrammarCorrection( // save the start and end positons of the line and the starting point Push(); LeftMargin(); - xub_StrLen nLineStart = GetCrsr()->GetPoint()->nContent.GetIndex(); + const sal_Int32 nLineStart = GetCrsr()->GetPoint()->nContent.GetIndex(); RightMargin(); - xub_StrLen nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex(); + const sal_Int32 nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex(); Pop(sal_False); // make sure the selection build later from the data below does @@ -1010,11 +1010,11 @@ bool SwEditShell::GetGrammarCorrection( // order to preserve those. Therefore count those "in words" in // order to modify the selection accordingly. const sal_Unicode* pChar = aText.getStr(); - xub_StrLen nLeft = 0; + sal_Int32 nLeft = 0; while (pChar && *pChar++ == CH_TXTATR_INWORD) ++nLeft; pChar = aText.getLength() ? aText.getStr() + aText.getLength() - 1 : 0; - xub_StrLen nRight = 0; + sal_Int32 nRight = 0; while (pChar && *pChar-- == CH_TXTATR_INWORD) ++nRight; @@ -1024,9 +1024,9 @@ bool SwEditShell::GetGrammarCorrection( pCrsr->SetMark(); ExtendSelection( sal_True, nLen - nLeft - nRight ); // don't determine the rectangle in the current line - xub_StrLen nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft; + const sal_Int32 nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft; // take one less than the line end - otherwise the next line would be calculated - xub_StrLen nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd + const sal_Int32 nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd ? nLineEnd : (nBegin + nLen - nLeft - nRight); Push(); pCrsr->DeleteMark(); @@ -1263,7 +1263,7 @@ static SpellContentPositions lcl_CollectDeletedRedlines(SwEditShell* pSh) const SwTxtNode* pTxtNode = pCrsr->GetNode()->GetTxtNode(); sal_uInt16 nAct = pDoc->GetRedlinePos( *pTxtNode, USHRT_MAX ); - const xub_StrLen nStartIndex = pStartPos->nContent.GetIndex(); + const sal_Int32 nStartIndex = pStartPos->nContent.GetIndex(); for ( ; nAct < pDoc->GetRedlineTbl().size(); nAct++ ) { const SwRedline* pRed = pDoc->GetRedlineTbl()[ nAct ]; @@ -1273,8 +1273,10 @@ static SpellContentPositions lcl_CollectDeletedRedlines(SwEditShell* pSh) if( nsRedlineType_t::REDLINE_DELETE == pRed->GetType() ) { - xub_StrLen nStart, nEnd; - pRed->CalcStartEnd( pTxtNode->GetIndex(), nStart, nEnd ); + xub_StrLen nStart_, nEnd_; + pRed->CalcStartEnd( pTxtNode->GetIndex(), nStart_, nEnd_ ); + sal_Int32 nStart = nStart_; + sal_Int32 nEnd = nEnd_; if(nStart >= nStartIndex || nEnd >= nStartIndex) { SpellContentPosition aAdd; @@ -1295,7 +1297,7 @@ static void lcl_CutRedlines( SpellContentPositions& aDeletedRedlines, SwEditShel { SwPaM *pCrsr = pSh->GetCrsr(); const SwPosition* pEndPos = pCrsr->End(); - xub_StrLen nEnd = pEndPos->nContent.GetIndex(); + const sal_Int32 nEnd = pEndPos->nContent.GetIndex(); while(!aDeletedRedlines.empty() && aDeletedRedlines.back().nLeft > nEnd) { @@ -1306,10 +1308,10 @@ static void lcl_CutRedlines( SpellContentPositions& aDeletedRedlines, SwEditShel static SpellContentPosition lcl_FindNextDeletedRedline( const SpellContentPositions& rDeletedRedlines, - xub_StrLen nSearchFrom ) + sal_Int32 nSearchFrom ) { SpellContentPosition aRet; - aRet.nLeft = aRet.nRight = STRING_MAXLEN; + aRet.nLeft = aRet.nRight = SAL_MAX_INT32; if(!rDeletedRedlines.empty()) { SpellContentPositions::const_iterator aIter = rDeletedRedlines.begin(); @@ -1425,7 +1427,8 @@ bool SwSpellIter::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammar { const ModelToViewHelper aConversionMap(*(SwTxtNode*)pCrsr->GetNode()); OUString aExpandText = aConversionMap.getViewText(); - xub_StrLen nSentenceEnd = (xub_StrLen)aConversionMap.ConvertToViewPosition( aGrammarResult.nBehindEndOfSentencePosition ); + sal_Int32 nSentenceEnd = static_cast<sal_Int32>( + aConversionMap.ConvertToViewPosition( aGrammarResult.nBehindEndOfSentencePosition )); // remove trailing space if( aExpandText[nSentenceEnd - 1] == ' ' ) --nSentenceEnd; @@ -1623,7 +1626,7 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt, if( aNextRedline.nLeft == aStart.nContent.GetIndex() ) { // select until the end of the current redline - xub_StrLen nEnd = aEnd.nContent.GetIndex() < aNextRedline.nRight ? + const sal_Int32 nEnd = aEnd.nContent.GetIndex() < aNextRedline.nRight ? aEnd.nContent.GetIndex() : aNextRedline.nRight; pCrsr->GetPoint()->nContent.Assign( pTxtNode, nEnd ); CreatePortion(xAlt, pGrammarResult, false, true); @@ -1694,7 +1697,7 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt, { *pCrsr->GetMark() = *pCrsr->GetPoint(); // select until the end of the current redline - xub_StrLen nEnd = aEnd.nContent.GetIndex() < aNextRedline.nRight ? + const sal_Int32 nEnd = aEnd.nContent.GetIndex() < aNextRedline.nRight ? aEnd.nContent.GetIndex() : aNextRedline.nRight; pCrsr->GetPoint()->nContent.Assign( pTxtNode, nEnd ); CreatePortion(xAlt, pGrammarResult, false, true); diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx index 977a43cb58ec..67b9883ad48a 100644 --- a/sw/source/core/edit/edws.cxx +++ b/sw/source/core/edit/edws.cxx @@ -274,7 +274,7 @@ sal_Bool SwEditShell::GetPrevAutoCorrWord( SvxAutoCorrect& rACorr, OUString& rWo sal_Bool bRet; SwPaM* pCrsr = getShellCrsr( true ); - xub_StrLen nPos = pCrsr->GetPoint()->nContent.GetIndex(); + const sal_Int32 nPos = pCrsr->GetPoint()->nContent.GetIndex(); SwTxtNode* pTNd = pCrsr->GetNode()->GetTxtNode(); if( pTNd && nPos ) { diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index 0227b24087d5..dc072498eb2d 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -152,7 +152,7 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const const sal_Unicode Char = bOK ? sTxt[nSttPos] : 0; if ( bOK && (Char==CH_TXTATR_BREAKWORD || Char==CH_TXTATR_INWORD) ) { - SwIndex aIdx( pTxtNd, static_cast<xub_StrLen>(nSttPos) ); + SwIndex aIdx( pTxtNd, nSttPos ); SwTxtFld * const pTxtFld = static_cast<SwTxtFld*>( pTxtNd->GetTxtAttrForCharAt(aIdx.GetIndex(), RES_TXTATR_FIELD)); if( !pTxtFld ) diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx index 8ed394cd0366..9b0bf972161a 100644 --- a/sw/source/core/fields/ddefld.cxx +++ b/sw/source/core/fields/ddefld.cxx @@ -49,8 +49,8 @@ public: const OUString& rMimeType, const ::com::sun::star::uno::Any & rValue ); virtual const SwNode* GetAnchor() const; - virtual sal_Bool IsInRange( sal_uLong nSttNd, sal_uLong nEndNd, xub_StrLen nStt = 0, - xub_StrLen nEnd = STRING_NOTFOUND ) const; + virtual sal_Bool IsInRange( sal_uLong nSttNd, sal_uLong nEndNd, sal_Int32 nStt = 0, + sal_Int32 nEnd = -1 ) const; }; ::sfx2::SvBaseLink::UpdateResult SwIntrnlRefLink::DataChanged( const OUString& rMimeType, @@ -190,7 +190,7 @@ const SwNode* SwIntrnlRefLink::GetAnchor() const } sal_Bool SwIntrnlRefLink::IsInRange( sal_uLong nSttNd, sal_uLong nEndNd, - xub_StrLen nStt, xub_StrLen nEnd ) const + sal_Int32 nStt, sal_Int32 nEnd ) const { // here, any anchor of the normal NodesArray should be sufficient SwNodes* pNds = &rFldType.GetDoc()->GetNodes(); diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 3f4d19ce2815..c13dd1285af3 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -342,27 +342,25 @@ sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir ) { SwPosition *pPos = (SwPosition*)aAnch.GetCntntAnchor(); SwTxtNode* pTxtNd = ((SwTxtFrm*)pOld)->GetTxtNode(); - xub_StrLen nAct = pPos->nContent.GetIndex(); + const sal_Int32 nAct = pPos->nContent.GetIndex(); if( SW_MOVE_LEFT == nDir ) { bRet = sal_True; if( nAct ) { - --nAct; - pPos->nContent.Assign( pTxtNd, nAct ); + pPos->nContent.Assign( pTxtNd, nAct-1 ); } else nDir = SW_MOVE_UP; } else { - xub_StrLen nMax = + const sal_Int32 nMax = static_cast<SwTxtFrm*>(pOld)->GetTxtNode()->GetTxt().getLength(); if( nAct < nMax ) { - ++nAct; bRet = sal_True; - pPos->nContent.Assign( pTxtNd, nAct ); + pPos->nContent.Assign( pTxtNd, nAct+1 ); } else nDir = SW_MOVE_DOWN; @@ -381,7 +379,7 @@ sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir ) SwPosition *pPos = (SwPosition*)aAnch.GetCntntAnchor(); SwTxtNode* pTxtNd = ((SwTxtFrm*)pNew)->GetTxtNode(); pPos->nNode = *pTxtNd; - xub_StrLen nTmp = 0; + sal_Int32 nTmp = 0; if( bRet ) { nTmp = static_cast<SwTxtFrm*>(pNew)->GetTxtNode()->GetTxt().getLength(); diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 73c78151fb51..a7f32a457f3a 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -580,7 +580,7 @@ sal_Bool SwFEShell::Sort(const SwSortOptions& rOpt) SwNodeIndex aPrevIdx( pStart->nNode, -1 ); sal_uLong nOffset = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex(); - xub_StrLen nCntStt = pStart->nContent.GetIndex(); + const sal_Int32 nCntStt = pStart->nContent.GetIndex(); // Sorting bRet = mpDoc->SortText(*pPam, rOpt) ? sal_True : sal_False; @@ -589,7 +589,7 @@ sal_Bool SwFEShell::Sort(const SwSortOptions& rOpt) pPam->DeleteMark(); pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 ); SwCntntNode* pCNd = pPam->GetCntntNode(); - xub_StrLen nLen = pCNd->Len(); + sal_Int32 nLen = pCNd->Len(); if( nLen > nCntStt ) nLen = nCntStt; pPam->GetPoint()->nContent.Assign(pCNd, nLen ); diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index deb0be2dc6e3..4042d6a26d21 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -1352,8 +1352,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, aPam.GetPoint()->nNode.Assign( *rPt.pSelBox->GetSttNd()-> EndOfSectionNode(), -1 ); SwCntntNode* pCNd = aPam.GetCntntNode(); - sal_uInt16 nL = pCNd ? pCNd->Len() : 0; - aPam.GetPoint()->nContent.Assign( pCNd, nL ); + aPam.GetPoint()->nContent.Assign( pCNd, pCNd ? pCNd->Len() : 0 ); SwNodeIndex aSttNdIdx( *rPt.pSelBox->GetSttNd(), 1 ); // one node should be kept in the box (otherwise the diff --git a/sw/source/core/inc/acorrect.hxx b/sw/source/core/inc/acorrect.hxx index b6ae8f8f3717..c0224995cf2a 100644 --- a/sw/source/core/inc/acorrect.hxx +++ b/sw/source/core/inc/acorrect.hxx @@ -91,13 +91,13 @@ class SwAutoCorrExceptWord { OUString sWord; sal_uLong nFlags, nNode; - xub_StrLen nCntnt; + sal_Int32 nCntnt; sal_Unicode cChar; LanguageType eLanguage; sal_Bool bDeleted; public: - SwAutoCorrExceptWord( sal_uLong nAFlags, sal_uLong nNd, xub_StrLen nContent, + SwAutoCorrExceptWord( sal_uLong nAFlags, sal_uLong nNd, sal_Int32 nContent, const OUString& rWord, sal_Unicode cChr, LanguageType eLang ) : sWord(rWord), nFlags(nAFlags), nNode(nNd), nCntnt(nContent), diff --git a/sw/source/core/inc/docfld.hxx b/sw/source/core/inc/docfld.hxx index d4597aef76a7..d98b8cd760c1 100644 --- a/sw/source/core/inc/docfld.hxx +++ b/sw/source/core/inc/docfld.hxx @@ -42,7 +42,7 @@ struct SwPosition; class _SetGetExpFld { sal_uLong nNode; - xub_StrLen nCntnt; + sal_Int32 nCntnt; union { const SwTxtFld* pTxtFld; const SwSection* pSection; @@ -105,7 +105,7 @@ public: void GetPosOfContent( SwPosition& rPos ) const; const SwNode* GetNodeFromCntnt() const; - xub_StrLen GetCntPosFromCntnt() const; + sal_Int32 GetCntPosFromCntnt() const; void SetBodyPos( const SwCntntFrm& rFrm ); }; diff --git a/sw/source/core/inc/frminf.hxx b/sw/source/core/inc/frminf.hxx index b6bb3ce377ac..6af9e7db6107 100644 --- a/sw/source/core/inc/frminf.hxx +++ b/sw/source/core/inc/frminf.hxx @@ -62,7 +62,7 @@ public: { pFrm = pNew; return *this; } // Is it a comparison? Returns position in frame. - sal_uInt16 GetBigIndent( xub_StrLen& rFndPos, + sal_Int32 GetBigIndent( sal_Int32& rFndPos, const SwTxtFrm *pNextFrm = 0 ) const; }; diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx index 6ad480c53cc1..1cf3c6fd906b 100644 --- a/sw/source/core/inc/mvsave.hxx +++ b/sw/source/core/inc/mvsave.hxx @@ -66,8 +66,8 @@ namespace sw { namespace mark IDocumentMarkAccess::MarkType m_eOrigBkmType; sal_uLong m_nNode1; sal_uLong m_nNode2; - xub_StrLen m_nCntnt1; - xub_StrLen m_nCntnt2; + sal_Int32 m_nCntnt1; + sal_Int32 m_nCntnt2; ::boost::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndo; }; }} @@ -120,7 +120,7 @@ class SwDataChanged const SwPosition* pPos; SwDoc* pDoc; sal_uLong nNode; - xub_StrLen nCntnt; + sal_Int32 nCntnt; public: SwDataChanged( const SwPaM& rPam ); @@ -128,7 +128,7 @@ public: ~SwDataChanged(); sal_uLong GetNode() const { return nNode; } - xub_StrLen GetCntnt() const { return nCntnt; } + sal_Int32 GetCntnt() const { return nCntnt; } }; diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index bc0559bba8ea..02d91005bea9 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -296,7 +296,7 @@ public: // Prepares the cursor position for a visual cursor move (BiDi). // The behaviour is different for insert and overwrite cursors - void PrepareVisualMove( xub_StrLen& nPos, sal_uInt8& nCrsrLevel, + void PrepareVisualMove( sal_Int32& nPos, sal_uInt8& nCrsrLevel, sal_Bool& bRight, sal_Bool bInsertCrsr ); // Methoden zur Verwaltung von FolgeFrames diff --git a/sw/source/core/inc/wrong.hxx b/sw/source/core/inc/wrong.hxx index 2c06e5384482..c04c3ecfc57a 100644 --- a/sw/source/core/inc/wrong.hxx +++ b/sw/source/core/inc/wrong.hxx @@ -223,7 +223,7 @@ public: sal_uInt16 GetWrongPos( xub_StrLen nValue ) const; sal_Bool Check( xub_StrLen &rChk, xub_StrLen &rLn ) const; - sal_Bool InWrongWord( xub_StrLen &rChk, xub_StrLen &rLn ) const; + sal_Bool InWrongWord( sal_Int32 &rChk, sal_Int32 &rLn ) const; xub_StrLen NextWrong( xub_StrLen nChk ) const; void Move( xub_StrLen nPos, long nDiff ); diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx index be3728d8672a..c41aedfbc288 100644 --- a/sw/source/core/table/swnewtable.cxx +++ b/sw/source/core/table/swnewtable.cxx @@ -879,8 +879,7 @@ bool SwTable::PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes, SwPaM aPam( aInsPos ); aPam.GetPoint()->nNode.Assign( *pBox->GetSttNd()->EndOfSectionNode(), -1 ); SwCntntNode* pCNd = aPam.GetCntntNode(); - sal_uInt16 nL = pCNd ? pCNd->Len() : 0; - aPam.GetPoint()->nContent.Assign( pCNd, nL ); + aPam.GetPoint()->nContent.Assign( pCNd, pCNd ? pCNd->Len() : 0 ); SwNodeIndex aSttNdIdx( *pBox->GetSttNd(), 1 ); bool const bUndo = pDoc->GetIDocumentUndoRedo().DoesUndo(); if( pUndo ) diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 9c89884a85a2..b51ee42305a2 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -2088,7 +2088,7 @@ void ChgTextToNum( SwTableBox& rBox, const OUString& rTxt, const Color* pCol, { // Exchange text. Bugfix to keep Tabs (front and back!) const OUString& rOrig = pTNd->GetTxt(); - xub_StrLen n; + sal_Int32 n; for( n = 0; n < rOrig.getLength() && '\x9' == rOrig[n]; ++n ) ; diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx index a8a96769749d..7f4151f1cde0 100644 --- a/sw/source/core/text/frmcrsr.cxx +++ b/sw/source/core/text/frmcrsr.cxx @@ -67,7 +67,7 @@ SwTxtFrm *GetAdjFrmAtPos( SwTxtFrm *pFrm, const SwPosition &rPos, const sal_Bool bRightMargin, const sal_Bool bNoScroll = sal_True ) { // RightMargin in the last master line - const xub_StrLen nOffset = rPos.nContent.GetIndex(); + const sal_Int32 nOffset = rPos.nContent.GetIndex(); SwTxtFrm *pFrmAtPos = pFrm; if( !bNoScroll || pFrm->GetFollow() ) { @@ -75,7 +75,7 @@ SwTxtFrm *GetAdjFrmAtPos( SwTxtFrm *pFrm, const SwPosition &rPos, if( nOffset < pFrmAtPos->GetOfst() && !pFrmAtPos->IsFollow() ) { - xub_StrLen nNew = nOffset; + sal_Int32 nNew = nOffset; if( nNew < MIN_OFFSET_STEP ) nNew = 0; else @@ -270,8 +270,8 @@ sal_Bool SwTxtFrm::GetCharRect( SwRect& rOrig, const SwPosition &rPos, nMaxY = pFrm->SwitchVerticalToHorizontal( nMaxY ); bool bGoOn = true; - xub_StrLen nOffset = rPos.nContent.GetIndex(); - xub_StrLen nNextOfst; + const sal_Int32 nOffset = rPos.nContent.GetIndex(); + sal_Int32 nNextOfst; do { @@ -372,7 +372,7 @@ sal_Bool SwTxtFrm::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const if( IsHiddenNow() ) return sal_False; - xub_StrLen nOffset = rPos.nContent.GetIndex(); + const sal_Int32 nOffset = rPos.nContent.GetIndex(); SwTxtFrm* pFrm = &(const_cast<SwTxtFrm*>(this)->GetFrmAtOfst( nOffset )); pFrm->GetFormatted(); @@ -460,7 +460,7 @@ bool SwTxtFrm::GetTopOfLine( SwTwips& _onTopOfLine, bool bRet = true; // get position offset - xub_StrLen nOffset = _rPos.nContent.GetIndex(); + const sal_Int32 nOffset = _rPos.nContent.GetIndex(); if ( GetTxt().getLength() < nOffset ) { @@ -805,7 +805,7 @@ sal_Bool SwTxtFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset, } ((SwTxtFrm*)this)->GetFormatted(); - const xub_StrLen nPos = pPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nPos = pPam->GetPoint()->nContent.GetIndex(); SwRect aCharBox; if( !IsEmpty() && !IsHiddenNow() ) @@ -932,7 +932,7 @@ sal_Bool SwTxtFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset, // bLeft: whether the break iterator has to add or subtract from the // current position static void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, sal_Int32 nIdx, - xub_StrLen& nPos, sal_Bool& bRight, + sal_Int32& nPos, sal_Bool& bRight, sal_uInt8& nCrsrLevel, sal_uInt8 nDefaultDir ) { const SwLinePortion* pPor = rCurrLine.GetFirstPortion(); @@ -986,7 +986,7 @@ static void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, sal_Int32 nI if ( bRecurse ) { const SwLineLayout& rLine = ((SwMultiPortion*)pPor)->GetRoot(); - xub_StrLen nTmpPos = nPos - nIdx; + sal_Int32 nTmpPos = nPos - nIdx; sal_Bool bTmpForward = ! bRight; sal_uInt8 nTmpCrsrLevel = nCrsrLevel; lcl_VisualMoveRecursion( rLine, 0, nTmpPos, bTmpForward, @@ -1045,7 +1045,7 @@ static void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, sal_Int32 nI if ( bRecurse ) { const SwLineLayout& rLine = ((SwMultiPortion*)pPor)->GetRoot(); - xub_StrLen nTmpPos = nPos - nIdx; + sal_Int32 nTmpPos = nPos - nIdx; sal_Bool bTmpForward = ! bRight; sal_uInt8 nTmpCrsrLevel = nCrsrLevel; lcl_VisualMoveRecursion( rLine, 0, nTmpPos, bTmpForward, @@ -1076,7 +1076,7 @@ static void lcl_VisualMoveRecursion( const SwLineLayout& rCurrLine, sal_Int32 nI } } -void SwTxtFrm::PrepareVisualMove( xub_StrLen& nPos, sal_uInt8& nCrsrLevel, +void SwTxtFrm::PrepareVisualMove( sal_Int32& nPos, sal_uInt8& nCrsrLevel, sal_Bool& bForward, sal_Bool bInsertCrsr ) { if( IsEmpty() || IsHiddenNow() ) @@ -1093,8 +1093,8 @@ void SwTxtFrm::PrepareVisualMove( xub_StrLen& nPos, sal_uInt8& nCrsrLevel, aLine.Top(); const SwLineLayout* pLine = aLine.GetCurr(); - const xub_StrLen nStt = aLine.GetStart(); - const xub_StrLen nLen = pLine->GetLen(); + const sal_Int32 nStt = aLine.GetStart(); + const sal_Int32 nLen = pLine->GetLen(); // We have to distinguish between an insert and overwrite cursor: // The insert cursor position depends on the cursor level: @@ -1125,12 +1125,12 @@ void SwTxtFrm::PrepareVisualMove( xub_StrLen& nPos, sal_uInt8& nCrsrLevel, UBiDi* pBidi = ubidi_openSized( nLen, 0, &nError ); ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(pLineString), nLen, nDefaultDir, NULL, &nError ); // UChar != sal_Unicode in MinGW - xub_StrLen nTmpPos; + sal_Int32 nTmpPos = 0; bool bOutOfBounds = false; if ( nPos < nStt + nLen ) { - nTmpPos = (xub_StrLen)ubidi_getVisualIndex( pBidi, nPos, &nError ); + nTmpPos = ubidi_getVisualIndex( pBidi, nPos, &nError ); // visual indices are always LTR aligned if ( bVisualRight ) @@ -1161,7 +1161,7 @@ void SwTxtFrm::PrepareVisualMove( xub_StrLen& nPos, sal_uInt8& nCrsrLevel, if ( ! bOutOfBounds ) { - nPos = (xub_StrLen)ubidi_getLogicalIndex( pBidi, nTmpPos, &nError ); + nPos = ubidi_getLogicalIndex( pBidi, nTmpPos, &nError ); if ( bForward ) { @@ -1197,7 +1197,7 @@ sal_Bool SwTxtFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset, return SwCntntFrm::UnitDown( pPam, nOffset, bSetInReadOnly ); } ((SwTxtFrm*)this)->GetFormatted(); - const xub_StrLen nPos = pPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nPos = pPam->GetPoint()->nContent.GetIndex(); SwRect aCharBox; const SwCntntFrm *pTmpFollow = 0; diff --git a/sw/source/core/text/frminf.cxx b/sw/source/core/text/frminf.cxx index 4df500fe3f0f..3094dbf80069 100644 --- a/sw/source/core/text/frminf.cxx +++ b/sw/source/core/text/frminf.cxx @@ -304,7 +304,7 @@ SwTwips SwTxtFrmInfo::GetFirstIndent() const * SwTxtFrmInfo::GetBigIndent() *************************************************************************/ -KSHORT SwTxtFrmInfo::GetBigIndent( xub_StrLen& rFndPos, +sal_Int32 SwTxtFrmInfo::GetBigIndent( sal_Int32& rFndPos, const SwTxtFrm *pNextFrm ) const { SwTxtSizeInfo aInf( (SwTxtFrm*)pFrm ); @@ -355,7 +355,7 @@ KSHORT SwTxtFrmInfo::GetBigIndent( xub_StrLen& rFndPos, SwRect aRect; return aLine.GetCharRect( &aRect, rFndPos ) - ? KSHORT( aRect.Left() - pFrm->Frm().Left() - pFrm->Prt().Left()) + ? static_cast<sal_Int32>(aRect.Left() - pFrm->Frm().Left() - pFrm->Prt().Left()) : 0; } diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index 47c99f9153a7..6a608f4a88e8 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -337,7 +337,7 @@ xub_StrLen SwAttrIter::GetNextAttr( ) const } if (m_pTxtNode!=NULL) { //TODO maybe use hints like FieldHints for this instead of looking at the text... - xub_StrLen l=(nNext<m_pTxtNode->Len()?nNext:m_pTxtNode->Len()); + const sal_Int32 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 @@ -1030,7 +1030,7 @@ sal_uInt16 SwTxtNode::GetWidthOfLeadingTabs() const { sal_uInt16 nRet = 0; - xub_StrLen nIdx = 0; + sal_Int32 nIdx = 0; sal_Unicode cCh; while ( nIdx < GetTxt().getLength() && diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index 9c1d30901a7f..a2478fb5ebd4 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -1821,7 +1821,7 @@ bool SwTxtFrm::FillSelection( SwSelectionList& rSelList, const SwRect& rRect ) c } else if( aRect.HasArea() ) { - xub_StrLen nOld = STRING_LEN; + sal_Int32 nOld = -1; SwPosition aPosR( aPosL ); Point aPoint; SwTxtInfo aInf( const_cast<SwTxtFrm*>(this) ); diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx index fc6278ca2e2c..7d076302ae33 100644 --- a/sw/source/core/text/porfly.cxx +++ b/sw/source/core/text/porfly.cxx @@ -158,7 +158,7 @@ void SwTxtFrm::MoveFlyInCnt( SwTxtFrm *pNew, xub_StrLen nStart, xub_StrLen nEnd if (rAnch.GetAnchorId() == FLY_AS_CHAR) { const SwPosition* pPos = rAnch.GetCntntAnchor(); - xub_StrLen nIdx = pPos->nContent.GetIndex(); + const sal_Int32 nIdx = pPos->nContent.GetIndex(); if ( nIdx >= nStart && nEnd > nIdx ) { if ( pAnchoredObj->ISA(SwFlyFrm) ) diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx index 675ae619cbc2..01196b4f53e3 100644 --- a/sw/source/core/text/redlnitr.cxx +++ b/sw/source/core/text/redlnitr.cxx @@ -137,7 +137,7 @@ void SwAttrIter::CtorInitAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf, S if( pExtInp || MSHRT_MAX != nRedlPos ) { const std::vector<sal_uInt16> *pArr = 0; - xub_StrLen nInputStt = 0; + sal_Int32 nInputStt = 0; if( pExtInp ) { pArr = &pExtInp->GetAttrs(); diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 474cd818a203..41ff7e915763 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -570,7 +570,7 @@ void SwTxtFrm::HideAndShowObjects() // #120729# - hotfix // under certain conditions const RndStdIds eAnchorType( pContact->GetAnchorId() ); - const xub_StrLen nObjAnchorPos = pContact->GetCntntAnchorIndex().GetIndex(); + const sal_Int32 nObjAnchorPos = pContact->GetCntntAnchorIndex().GetIndex(); if ((eAnchorType != FLY_AT_CHAR) || sw_HideObj( *this, eAnchorType, nObjAnchorPos, (*GetDrawObjs())[i] )) @@ -607,7 +607,7 @@ void SwTxtFrm::HideAndShowObjects() { xub_StrLen nHiddenStart; xub_StrLen nHiddenEnd; - xub_StrLen nObjAnchorPos = pContact->GetCntntAnchorIndex().GetIndex(); + const sal_Int32 nObjAnchorPos = pContact->GetCntntAnchorIndex().GetIndex(); SwScriptInfo::GetBoundsOfHiddenRange( rNode, nObjAnchorPos, nHiddenStart, nHiddenEnd, 0 ); // #120729# - hotfix // under certain conditions @@ -951,7 +951,8 @@ void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) // Dies spart Stack, man muss nur aufpassen, // dass sie Variablen gesetzt werden. - xub_StrLen nPos, nLen; + sal_Int32 nPos; + sal_Int32 nLen; bool bSetFldsDirty = false; bool bRecalcFtnFlag = false; diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx index 59ce856f3560..00930b0d5767 100644 --- a/sw/source/core/text/wrong.cxx +++ b/sw/source/core/text/wrong.cxx @@ -112,10 +112,10 @@ void SwWrongList::ClearList() * sal_Bool SwWrongList::InWrongWord() gibt den Anfang und die Laenge des * Wortes zurueck, wenn es als falsch markiert ist. *************************************************************************/ -sal_Bool SwWrongList::InWrongWord( xub_StrLen &rChk, xub_StrLen &rLn ) const +sal_Bool SwWrongList::InWrongWord( sal_Int32 &rChk, sal_Int32 &rLn ) const { MSHORT nPos = GetWrongPos( rChk ); - xub_StrLen nWrPos; + sal_Int32 nWrPos; if( nPos < Count() && ( nWrPos = Pos( nPos ) ) <= rChk ) { rLn = Len( nPos ); diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index 1b72333fed13..127206b88d94 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -300,10 +300,10 @@ void SwFrm::dumpAsXml( xmlTextWriterPtr writer ) { xmlTextWriterStartElement(writer, BAD_CAST("swpam")); xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("pointNodeIndex"), "%ld", pPaM->GetPoint()->nNode.GetIndex()); - xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("pointContentIndex"), "%d", pPaM->GetPoint()->nContent.GetIndex()); + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("pointContentIndex"), "%" SAL_PRIdINT32, pPaM->GetPoint()->nContent.GetIndex()); xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("markNodeIndex"), "%ld", pPaM->GetMark()->nNode.GetIndex()); - xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("markContentIndex"), "%d", pPaM->GetMark()->nContent.GetIndex()); + xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("markContentIndex"), "%" SAL_PRIdINT32, pPaM->GetMark()->nContent.GetIndex()); xmlTextWriterEndElement(writer); pPaM = static_cast<SwPaM*>(pPaM->GetNext()); } diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index 45c6a6cb764e..b9369b363ef3 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -218,11 +218,11 @@ OUString SwTOXMark::GetText() const if( pTxtAttr && pTxtAttr->GetpTxtNd() ) { - xub_StrLen* pEndIdx = pTxtAttr->GetEnd(); + sal_Int32* pEndIdx = pTxtAttr->GetEnd(); OSL_ENSURE( pEndIdx, "TOXMark without mark!"); if( pEndIdx ) { - const xub_StrLen nStt = *pTxtAttr->GetStart(); + const sal_Int32 nStt = *pTxtAttr->GetStart(); return pTxtAttr->GetpTxtNd()->GetExpandTxt( nStt, *pEndIdx-nStt ); } } diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index 7e08f1d6ffa8..4739d3188ae0 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -213,8 +213,8 @@ bool SwTOXSortTabBase::operator==( const SwTOXSortTabBase& rCmp ) { // Both pointers exist -> compare text // else -> compare AlternativeText - const xub_StrLen *pEnd = pTxtMark->GetEnd(), - *pEndCmp = rCmp.pTxtMark->GetEnd(); + const sal_Int32 *pEnd = pTxtMark->GetEnd(); + const sal_Int32 *pEndCmp = rCmp.pTxtMark->GetEnd(); bRet = ( ( pEnd && pEndCmp ) || ( !pEnd && !pEndCmp ) ) && pTOXIntl->IsEqual( GetTxt(), GetLocale(), @@ -248,8 +248,8 @@ bool SwTOXSortTabBase::operator<( const SwTOXSortTabBase& rCmp ) if( *pTxtMark->GetStart() == *rCmp.pTxtMark->GetStart() ) { - const xub_StrLen *pEnd = pTxtMark->GetEnd(), - *pEndCmp = rCmp.pTxtMark->GetEnd(); + const sal_Int32 *pEnd = pTxtMark->GetEnd(); + const sal_Int32 *pEndCmp = rCmp.pTxtMark->GetEnd(); // Both pointers exist -> compare text // else -> compare AlternativeText @@ -381,7 +381,7 @@ TextAndReading SwTOXIndex::GetText_Impl() const void SwTOXIndex::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 ) const { - const xub_StrLen* pEnd = pTxtMark->GetEnd(); + const sal_Int32* pEnd = pTxtMark->GetEnd(); TextAndReading aRet; if( pEnd && !pTxtMark->GetTOXMark().IsAlternativeText() && @@ -478,7 +478,7 @@ SwTOXContent::SwTOXContent( const SwTxtNode& rNd, const SwTxtTOXMark* pMark, TextAndReading SwTOXContent::GetText_Impl() const { - const xub_StrLen* pEnd = pTxtMark->GetEnd(); + const sal_Int32* pEnd = pTxtMark->GetEnd(); if( pEnd && !pTxtMark->GetTOXMark().IsAlternativeText() ) { return TextAndReading( @@ -493,7 +493,7 @@ TextAndReading SwTOXContent::GetText_Impl() const void SwTOXContent::FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 ) const { - const xub_StrLen* pEnd = pTxtMark->GetEnd(); + const sal_Int32* pEnd = pTxtMark->GetEnd(); if( pEnd && !pTxtMark->GetTOXMark().IsAlternativeText() ) ((SwTxtNode*)aTOXSources[0].pNd)->GetExpandTxt( rNd, &rInsPos, *pTxtMark->GetStart(), diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index 872d89826848..aac8a0476baa 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -277,7 +277,7 @@ sal_Bool SwFmtFld::IsProtect() const |* *************************************************************************/ -SwTxtFld::SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStartPos, +SwTxtFld::SwTxtFld(SwFmtFld & rAttr, sal_Int32 const nStartPos, bool const bInClipboard) : SwTxtAttr( rAttr, nStartPos ) // fdo#39694 the ExpandField here may not give the correct result in all cases, diff --git a/sw/source/core/txtnode/atrref.cxx b/sw/source/core/txtnode/atrref.cxx index 04c8d4a15f99..9c4196efccb1 100644 --- a/sw/source/core/txtnode/atrref.cxx +++ b/sw/source/core/txtnode/atrref.cxx @@ -65,7 +65,7 @@ SfxPoolItem* SwFmtRefMark::Clone( SfxItemPool* ) const // Attribut fuer Inhalts-/Positions-Referenzen im Text SwTxtRefMark::SwTxtRefMark( SwFmtRefMark& rAttr, - xub_StrLen const nStartPos, xub_StrLen const*const pEnd) + sal_Int32 const nStartPos, sal_Int32 const*const pEnd) : SwTxtAttrEnd( rAttr, nStartPos, nStartPos ) , m_pTxtNode( 0 ) , m_pEnd( 0 ) @@ -84,7 +84,7 @@ SwTxtRefMark::SwTxtRefMark( SwFmtRefMark& rAttr, SetOverlapAllowedAttr( true ); } -xub_StrLen* SwTxtRefMark::GetEnd() +sal_Int32* SwTxtRefMark::GetEnd() { return m_pEnd; } diff --git a/sw/source/core/txtnode/atrtox.cxx b/sw/source/core/txtnode/atrtox.cxx index 0c60b94fc6c2..9cdaa14f2a3d 100644 --- a/sw/source/core/txtnode/atrtox.cxx +++ b/sw/source/core/txtnode/atrtox.cxx @@ -24,7 +24,7 @@ #include <ndtxt.hxx> SwTxtTOXMark::SwTxtTOXMark( SwTOXMark& rAttr, - xub_StrLen const nStartPos, xub_StrLen const*const pEnd) + sal_Int32 const nStartPos, sal_Int32 const*const pEnd) : SwTxtAttrEnd( rAttr, nStartPos, nStartPos ) , m_pTxtNode( 0 ) , m_pEnd( 0 ) @@ -47,7 +47,7 @@ SwTxtTOXMark::~SwTxtTOXMark() { } -xub_StrLen* SwTxtTOXMark::GetEnd() +sal_Int32* SwTxtTOXMark::GetEnd() { return m_pEnd; } diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index e46354809e05..12e467d10643 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -266,7 +266,7 @@ SwCntntFrm *SwTxtNode::MakeFrm( SwFrm* pSib ) return pFrm; } -xub_StrLen SwTxtNode::Len() const +sal_Int32 SwTxtNode::Len() const { return m_Text.getLength(); } @@ -357,7 +357,7 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos ) bool parentIsOutline = IsOutline(); // create a node "in front" of me - const xub_StrLen nSplitPos = rPos.nContent.GetIndex(); + const sal_Int32 nSplitPos = rPos.nContent.GetIndex(); const sal_Int32 nTxtLen = m_Text.getLength(); SwTxtNode* const pNode = _MakeNewTxtNode( rPos.nNode, sal_False, nSplitPos==nTxtLen ); @@ -451,7 +451,7 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos ) } else if ( pHt->DontExpand() ) { - const xub_StrLen* const pEnd = pHt->GetEnd(); + const sal_Int32* const pEnd = pHt->GetEnd(); if (pEnd && *pHt->GetStart() == *pEnd ) { // delete it! @@ -534,7 +534,7 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos ) for ( sal_uInt16 j = m_pSwpHints->Count(); j; ) { SwTxtAttr* const pHt = m_pSwpHints->GetTextHint( --j ); - const xub_StrLen* const pEnd = pHt->GetEnd(); + const sal_Int32* const pEnd = pHt->GetEnd(); if ( pHt->DontExpand() && pEnd && (*pHt->GetStart() == *pEnd) ) { // delete it! @@ -596,7 +596,7 @@ void SwTxtNode::MoveTxtAttr_To_AttrSet() if( *pHt->GetStart() ) break; - const xub_StrLen* pHtEndIdx = pHt->GetEnd(); + const sal_Int32* pHtEndIdx = pHt->GetEnd(); if( !pHtEndIdx ) continue; @@ -720,7 +720,7 @@ SwCntntNode *SwTxtNode::JoinPrev() std::vector<sal_uLong> aBkmkArr; _SaveCntntIdx( pDoc, aIdx.GetIndex(), USHRT_MAX, aBkmkArr, SAVEFLY ); SwTxtNode *pTxtNode = aIdx.GetNode().GetTxtNode(); - xub_StrLen nLen = pTxtNode->Len(); + const sal_Int32 nLen = pTxtNode->Len(); SwWrongList *pList = pTxtNode->GetWrong(); if( pList ) @@ -829,23 +829,23 @@ void SwTxtNode::NewAttrSet( SwAttrPool& rPool ) // override SwIndexReg::Update => text hints do not need SwIndex for start/end! -void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen, +void SwTxtNode::Update( SwIndex const & rPos, const sal_Int32 nChangeLen, const bool bNegative, const bool bDelete ) { SetAutoCompleteWordDirty( sal_True ); ::std::auto_ptr<SwpHts> pCollector; - const xub_StrLen nChangePos = rPos.GetIndex(); + const sal_Int32 nChangePos = rPos.GetIndex(); if ( HasHints() ) { if ( bNegative ) { - const xub_StrLen nChangeEnd = nChangePos + nChangeLen; + const sal_Int32 nChangeEnd = nChangePos + nChangeLen; for ( sal_uInt16 n = 0; n < m_pSwpHints->Count(); ++n ) { SwTxtAttr * const pHint = m_pSwpHints->GetTextHint(n); - xub_StrLen * const pStart = pHint->GetStart(); + sal_Int32 * const pStart = pHint->GetStart(); if ( *pStart > nChangePos ) { if ( *pStart > nChangeEnd ) @@ -858,7 +858,7 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen, } } - xub_StrLen * const pEnd = pHint->GetEnd(); + sal_Int32 * const pEnd = pHint->GetEnd(); if (pEnd) { if ( *pEnd > nChangePos ) @@ -891,8 +891,8 @@ void SwTxtNode::Update( SwIndex const & rPos, const xub_StrLen nChangeLen, for ( sal_uInt16 n = 0; n < m_pSwpHints->Count(); ++n ) { SwTxtAttr * const pHint = m_pSwpHints->GetTextHint(n); - xub_StrLen * const pStart = pHint->GetStart(); - xub_StrLen * const pEnd = pHint->GetEnd(); + sal_Int32 * const pStart = pHint->GetStart(); + sal_Int32 * const pEnd = pHint->GetEnd(); if ( *pStart >= nChangePos ) { *pStart = *pStart + nChangeLen; @@ -1109,7 +1109,7 @@ void SwTxtNode::_ChgTxtCollUpdateNum( const SwTxtFmtColl *pOldColl, bool SwTxtNode::DontExpandFmt( const SwIndex& rIdx, bool bFlag, bool bFmtToTxtAttributes ) { - const xub_StrLen nIdx = rIdx.GetIndex(); + const sal_Int32 nIdx = rIdx.GetIndex(); if (bFmtToTxtAttributes && nIdx == m_Text.getLength()) { FmtToTxtAttr( this ); @@ -1123,7 +1123,7 @@ bool SwTxtNode::DontExpandFmt( const SwIndex& rIdx, bool bFlag, while( nPos ) { SwTxtAttr *pTmp = m_pSwpHints->GetEnd( --nPos ); - xub_StrLen *pEnd = pTmp->GetEnd(); + sal_Int32 *pEnd = pTmp->GetEnd(); if( !pEnd || *pEnd > nIdx ) continue; if( nIdx != *pEnd ) @@ -1161,7 +1161,7 @@ lcl_GetTxtAttrs( enum SwTxtNode::GetTxtAttrMode const eMode) { sal_uInt16 const nSize = (pSwpHints) ? pSwpHints->Count() : 0; - xub_StrLen nPreviousIndex(0); // index of last hint with nWhich + sal_Int32 nPreviousIndex(0); // index of last hint with nWhich bool (*pMatchFunc)(sal_Int32, sal_Int32, sal_Int32)=0; switch (eMode) { @@ -1174,7 +1174,7 @@ lcl_GetTxtAttrs( for( sal_uInt16 i = 0; i < nSize; ++i ) { SwTxtAttr *const pHint = pSwpHints->GetTextHint(i); - xub_StrLen const nHintStart( *(pHint->GetStart()) ); + sal_Int32 const nHintStart( *(pHint->GetStart()) ); if (nIndex < nHintStart) { return; // hints are sorted by start, so we are done... @@ -1185,7 +1185,7 @@ lcl_GetTxtAttrs( continue; } - xub_StrLen const*const pEndIdx = pHint->GetEnd(); + sal_Int32 const*const pEndIdx = pHint->GetEnd(); // cannot have hint with no end and no dummy char assert(pEndIdx || pHint->HasDummyChar()); // Wenn bExpand gesetzt ist, wird das Verhalten bei Eingabe @@ -1397,11 +1397,11 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const xub_StrLen nTxtStartIdx, for ( sal_uInt16 i = 0; i < m_pSwpHints->Count(); i++ ) { SwTxtAttr *const pHt = m_pSwpHints->GetTextHint(i); - xub_StrLen const nAttrStartIdx = *pHt->GetStart(); + sal_Int32 const nAttrStartIdx = *pHt->GetStart(); if ( nTxtStartIdx < nAttrStartIdx ) break; // ueber das Textende, da nLen == 0 - const xub_StrLen *const pEndIdx = pHt->GetEnd(); + const sal_Int32 *const pEndIdx = pHt->GetEnd(); if ( pEndIdx && !pHt->HasDummyChar() ) { if( ( *pEndIdx > nTxtStartIdx || @@ -1466,8 +1466,8 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest, xub_StrLen nLen, const bool bForceCopyOfAllAttrs ) { - xub_StrLen nTxtStartIdx = rStart.GetIndex(); - xub_StrLen nDestStart = rDestStart.GetIndex(); // alte Pos merken + sal_Int32 nTxtStartIdx = rStart.GetIndex(); + sal_Int32 nDestStart = rDestStart.GetIndex(); // alte Pos merken if (pDest->GetDoc()->IsClipBoard() && this->GetNum()) { @@ -1563,7 +1563,7 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest, // Ende erst jetzt holen, weil beim Kopieren in sich selbst der // Start-Index und alle Attribute vorher aktualisiert werden. nTxtStartIdx = rStart.GetIndex(); - const xub_StrLen nEnd = nTxtStartIdx + nLen; + const sal_Int32 nEnd = nTxtStartIdx + nLen; // 2. Attribute kopieren // durch das Attribute-Array, bis der Anfang des Geltungsbereiches @@ -1582,12 +1582,12 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest, //Achtung: kann ungueltig sein!! for (sal_uInt16 n = 0; ( n < nSize ); ++n) { - const xub_StrLen nAttrStartIdx = *(*m_pSwpHints)[n]->GetStart(); + const sal_Int32 nAttrStartIdx = *(*m_pSwpHints)[n]->GetStart(); if (!( nAttrStartIdx < nEnd)) break; SwTxtAttr * const pHt = m_pSwpHints->GetTextHint(n); - const xub_StrLen * const pEndIdx = pHt->GetEnd(); + const sal_Int32 * const pEndIdx = pHt->GetEnd(); const sal_uInt16 nWhich = pHt->Which(); // JP 26.04.94: REFMARK's werden nie kopiert. Hat das Refmark aber @@ -1606,8 +1606,8 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest, continue; } - xub_StrLen nAttrStt; - xub_StrLen nAttrEnd; + sal_Int32 nAttrStt = 0; + sal_Int32 nAttrEnd = 0; if( nAttrStartIdx < nTxtStartIdx ) { @@ -1712,8 +1712,8 @@ OUString SwTxtNode::InsertText( const OUString & rStr, const SwIndex & rIdx, { assert(rIdx <= m_Text.getLength()); // invalid index - xub_StrLen aPos = rIdx.GetIndex(); - xub_StrLen nLen = m_Text.getLength() - aPos; + const sal_Int32 aPos = rIdx.GetIndex(); + sal_Int32 nLen = m_Text.getLength() - aPos; sal_Int32 const nOverflow( m_Text.getLength() + rStr.getLength() - TXTNODE_MAX); SAL_WARN_IF(nOverflow > 0, "sw.core", @@ -1753,7 +1753,7 @@ OUString SwTxtNode::InsertText( const OUString & rStr, const SwIndex & rIdx, rIdx >= *(*m_pSwpHints)[i]->GetStart(); ++i ) { SwTxtAttr * const pHt = m_pSwpHints->GetTextHint( i ); - xub_StrLen * const pEndIdx = pHt->GetEnd(); + sal_Int32 * const pEndIdx = pHt->GetEnd(); if( !pEndIdx ) continue; @@ -1883,8 +1883,8 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart, return; } - xub_StrLen nTxtStartIdx = rStart.GetIndex(); - xub_StrLen nDestStart = rDestStart.GetIndex(); // alte Pos merken + sal_Int32 nTxtStartIdx = rStart.GetIndex(); + sal_Int32 nDestStart = rDestStart.GetIndex(); // alte Pos merken const sal_Int32 nInitSize = pDest->m_Text.getLength(); // wird in sich selbst verschoben, muss es gesondert behandelt werden !! @@ -1898,7 +1898,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart, nTxtStartIdx + ((nDestStart < nTxtStartIdx) ? nLen : 0), nLen); m_Text = buf.makeStringAndClear(); - const xub_StrLen nEnd = rStart.GetIndex() + nLen; + const sal_Int32 nEnd = rStart.GetIndex() + nLen; // dann suche mal alle Attribute zusammen, die im verschobenen // Bereich liegen. Diese werden in das extra Array verschoben, @@ -1912,10 +1912,10 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart, while ( m_pSwpHints && nAttrCnt < m_pSwpHints->Count() ) { SwTxtAttr * const pHt = m_pSwpHints->GetTextHint(nAttrCnt); - const xub_StrLen nAttrStartIdx = *pHt->GetStart(); + const sal_Int32 nAttrStartIdx = *pHt->GetStart(); if (!( nAttrStartIdx < nEnd )) break; - const xub_StrLen * const pEndIdx = pHt->GetEnd(); + const sal_Int32 * const pEndIdx = pHt->GetEnd(); const sal_uInt16 nWhich = pHt->Which(); SwTxtAttr *pNewHt = 0; @@ -1993,7 +1993,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart, { SwTxtAttr *const pNewHt = aArr[n]; *pNewHt->GetStart() = nDestStart + *pNewHt->GetStart(); - xub_StrLen * const pEndIdx = pNewHt->GetEnd(); + sal_Int32 * const pEndIdx = pNewHt->GetEnd(); if ( pEndIdx ) { *pEndIdx = nDestStart + *pEndIdx; @@ -2023,7 +2023,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart, CHECK_SWPHINTS(pDest); - const xub_StrLen nEnd = rStart.GetIndex() + nLen; + const sal_Int32 nEnd = rStart.GetIndex() + nLen; SwDoc* const pOtherDoc = (pDest->GetDoc() != GetDoc()) ? pDest->GetDoc() : 0; bool const bUndoNodes = !pOtherDoc @@ -2064,10 +2064,10 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart, while ( m_pSwpHints && (nAttrCnt < m_pSwpHints->Count()) ) { SwTxtAttr * const pHt = m_pSwpHints->GetTextHint(nAttrCnt); - const xub_StrLen nAttrStartIdx = *pHt->GetStart(); + const sal_Int32 nAttrStartIdx = *pHt->GetStart(); if (!( nAttrStartIdx < nEnd )) break; - const xub_StrLen * const pEndIdx = pHt->GetEnd(); + const sal_Int32 * const pEndIdx = pHt->GetEnd(); const sal_uInt16 nWhich = pHt->Which(); SwTxtAttr *pNewHt = 0; @@ -2161,7 +2161,7 @@ void SwTxtNode::CutImpl( SwTxtNode * const pDest, const SwIndex & rDestStart, SwTxtAttr * const pHt = m_pSwpHints->GetTextHint(nAttrCnt); if ( nEnd != *pHt->GetStart() ) break; - const xub_StrLen * const pEndIdx = pHt->GetEnd(); + const sal_Int32 * const pEndIdx = pHt->GetEnd(); if ( pEndIdx && *pEndIdx == nEnd ) { aArr.push_back( pHt ); @@ -2209,10 +2209,10 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount, { assert(rIdx <= m_Text.getLength()); // invalid index - const xub_StrLen nStartIdx = rIdx.GetIndex(); - const xub_StrLen nCnt = (STRING_LEN == nCount) + const sal_Int32 nStartIdx = rIdx.GetIndex(); + const sal_Int32 nCnt = (STRING_LEN == nCount) ? m_Text.getLength() - nStartIdx : nCount; - const xub_StrLen nEndIdx = nStartIdx + nCnt; + const sal_Int32 nEndIdx = nStartIdx + nCnt; m_Text = m_Text.replaceAt(nStartIdx, nCnt, ""); /* GCAttr(); alle leeren weggwerfen ist zu brutal. @@ -2224,7 +2224,7 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount, { SwTxtAttr *pHt = m_pSwpHints->GetTextHint(i); - const xub_StrLen nHintStart = *pHt->GetStart(); + const sal_Int32 nHintStart = *pHt->GetStart(); if ( nHintStart < nStartIdx ) continue; @@ -2232,7 +2232,7 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount, if ( nHintStart > nEndIdx ) break; // hints are sorted by end, so break here - const xub_StrLen* pHtEndIdx = pHt->GetEnd(); + const sal_Int32* pHtEndIdx = pHt->GetEnd(); const sal_uInt16 nWhich = pHt->Which(); if( !pHtEndIdx ) @@ -2320,8 +2320,8 @@ void SwTxtNode::GCAttr() return; bool bChanged = false; - xub_StrLen nMin = m_Text.getLength(), - nMax = 0; + sal_Int32 nMin = m_Text.getLength(); + sal_Int32 nMax = 0; bool bAll = nMin != 0; // Bei leeren Absaetzen werden nur die // INet-Formate entfernt. @@ -2330,7 +2330,7 @@ void SwTxtNode::GCAttr() SwTxtAttr * const pHt = m_pSwpHints->GetTextHint(i); // wenn Ende und Start gleich sind --> loeschen - const xub_StrLen * const pEndIdx = pHt->GetEnd(); + const sal_Int32 * const pEndIdx = pHt->GetEnd(); if (pEndIdx && !pHt->HasDummyChar() && (*pEndIdx == *pHt->GetStart()) && ( bAll || pHt->Which() == RES_TXTATR_INETFMT ) ) { @@ -3054,7 +3054,7 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx, SwIndex aDestIdx(&rDestNd, rDestNd.GetTxt().getLength()); if( pDestIdx ) aDestIdx = *pDestIdx; - xub_StrLen nDestStt = aDestIdx.GetIndex(); + const sal_Int32 nDestStt = aDestIdx.GetIndex(); // Text einfuegen OUStringBuffer buf(GetTxt()); @@ -3076,7 +3076,7 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx, // alle FontAttribute mit CHARSET Symbol in dem Bereich setzen if ( HasHints() ) { - xub_StrLen nInsPos = nDestStt - nIdx; + sal_Int32 nInsPos = nDestStt - nIdx; for ( sal_uInt16 i = 0; i < m_pSwpHints->Count(); i++ ) { const SwTxtAttr* pHt = (*m_pSwpHints)[i]; @@ -3085,7 +3085,7 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx, if (nIdx + nLen <= nAttrStartIdx) break; // ueber das Textende - const xub_StrLen *pEndIdx = pHt->GetEnd(); + const sal_Int32 *pEndIdx = pHt->GetEnd(); if( pEndIdx && *pEndIdx > nIdx && ( RES_CHRATR_FONT == nWhich || RES_TXTATR_CHARFMT == nWhich || @@ -3205,7 +3205,7 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx, } assert(-1 != nStartDelete); // without delete range, would have contined rDestNd.EraseText( - SwIndex(&rDestNd, static_cast<xub_StrLen>(nStartDelete)), + SwIndex(&rDestNd, nStartDelete), aDestIdx.GetIndex() - nStartDelete); assert(aDestIdx.GetIndex() == nStartDelete); nStartDelete = -1; // reset @@ -3290,7 +3290,7 @@ ModelToViewHelper::ModelToViewHelper(const SwTxtNode &rNode, int eMode) const SwTxtAttr* pAttr = (*pSwpHints2)[i]; if (pAttr->HasDummyChar()) { - xub_StrLen nDummyCharPos = *pAttr->GetStart(); + const sal_Int32 nDummyCharPos = *pAttr->GetStart(); if (aHiddenMulti.IsSelected(nDummyCharPos)) continue; std::vector<block>::iterator aFind = std::find_if(aBlocks.begin(), aBlocks.end(), containsPos(nDummyCharPos)); @@ -3319,7 +3319,7 @@ ModelToViewHelper::ModelToViewHelper(const SwTxtNode &rNode, int eMode) for (std::vector<const SwTxtAttr*>::iterator j = i->m_aAttrs.begin(); j != i->m_aAttrs.end(); ++j) { const SwTxtAttr* pAttr = *j; - xub_StrLen nFieldPos = *pAttr->GetStart(); + const sal_Int32 nFieldPos = *pAttr->GetStart(); OUString aExpand; switch (pAttr->Which()) { @@ -3352,7 +3352,7 @@ ModelToViewHelper::ModelToViewHelper(const SwTxtNode &rNode, int eMode) OUString SwTxtNode::GetRedlineTxt( xub_StrLen nIdx, xub_StrLen nLen, sal_Bool bExpandFlds, sal_Bool bWithNum ) const { - std::vector<sal_uInt16> aRedlArr; + std::vector<sal_Int32> aRedlArr; const SwDoc* pDoc = GetDoc(); sal_uInt16 nRedlPos = pDoc->GetRedlinePos( *this, nsRedlineType_t::REDLINE_DELETE ); if( USHRT_MAX != nRedlPos ) @@ -3373,7 +3373,7 @@ OUString SwTxtNode::GetRedlineTxt( xub_StrLen nIdx, xub_StrLen nLen, else if( pREnd->nNode == nNdIdx ) { // von 0 bis nContent ist alles geloescht - aRedlArr.push_back( xub_StrLen(0) ); + aRedlArr.push_back( 0 ); aRedlArr.push_back( pREnd->nContent.GetIndex() ); } } @@ -3400,15 +3400,16 @@ OUString SwTxtNode::GetRedlineTxt( xub_StrLen nIdx, xub_StrLen nLen, : GetTxt().copy(nIdx, nLen)); sal_Int32 nTxtStt = nIdx, nIdxEnd = nIdx + aTxt.getLength(); - for( sal_uInt16 n = 0; n < aRedlArr.size(); n += 2 ) + for( size_t n = 0; n < aRedlArr.size(); n += 2 ) { - xub_StrLen nStt = aRedlArr[ n ], nEnd = aRedlArr[ n+1 ]; + sal_Int32 nStt = aRedlArr[ n ]; + sal_Int32 nEnd = aRedlArr[ n+1 ]; if( ( nIdx <= nStt && nStt <= nIdxEnd ) || ( nIdx <= nEnd && nEnd <= nIdxEnd )) { if( nStt < nIdx ) nStt = nIdx; if( nIdxEnd < nEnd ) nEnd = nIdxEnd; - xub_StrLen nDelCnt = nEnd - nStt; + const sal_Int32 nDelCnt = nEnd - nStt; aTxt.remove(nStt - nTxtStt, nDelCnt); Replace0xFF(*this, aTxt, nTxtStt, nStt - nTxtStt, bExpandFlds); nTxtStt = nTxtStt + nDelCnt; @@ -3444,9 +3445,9 @@ void SwTxtNode::ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen, return; // nothing to do } - const xub_StrLen nStartPos = rStart.GetIndex(); - xub_StrLen nEndPos = nStartPos + nDelLen; - xub_StrLen nLen = nDelLen; + const sal_Int32 nStartPos = rStart.GetIndex(); + sal_Int32 nEndPos = nStartPos + nDelLen; + sal_Int32 nLen = nDelLen; for( sal_Int32 nPos = nStartPos; nPos < nEndPos; ++nPos ) { if ((CH_TXTATR_BREAKWORD == m_Text[nPos]) || diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index cf280a86a80a..3e9b5f992e22 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -418,7 +418,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint ) // should be corrected because it may lead to problems // in SwXMeta::createEnumeration // SplitNew is sorted, so this is the first split - xub_StrLen *const pStart(SplitNew.front()->GetStart()); + sal_Int32 *const pStart(SplitNew.front()->GetStart()); OSL_ENSURE(*pStart == nNewStart, "how did that happen?"); *pStart = nNewStart + 1; } @@ -578,8 +578,8 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, { const sal_uInt16 nWhich = rNewHint.Which(); - const xub_StrLen nThisStart = *rNewHint.GetStart(); - const xub_StrLen nThisEnd = *rNewHint.GetEnd(); + const sal_Int32 nThisStart = *rNewHint.GetStart(); + const sal_Int32 nThisEnd = *rNewHint.GetEnd(); const bool bNoLengthAttribute = nThisStart == nThisEnd; std::vector<SwTxtAttr*> aInsDelHints; @@ -603,8 +603,8 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, RES_TXTATR_AUTOFMT != pOther->Which() ) continue; - xub_StrLen nOtherStart = *pOther->GetStart(); - const xub_StrLen nOtherEnd = *pOther->GetEnd(); + sal_Int32 nOtherStart = *pOther->GetStart(); + const sal_Int32 nOtherEnd = *pOther->GetEnd(); // Check if start of new attribute overlaps with pOther: // Split pOther if necessary: @@ -655,7 +655,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, // // 4. Split rNewHint into 1 ... n new hints: // - std::set<xub_StrLen> aBounds; + std::set<sal_Int32> aBounds; aBounds.insert( nThisStart ); aBounds.insert( nThisEnd ); @@ -669,17 +669,17 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, RES_TXTATR_AUTOFMT != pOther->Which() ) continue; - const xub_StrLen nOtherStart = *pOther->GetStart(); - const xub_StrLen nOtherEnd = *pOther->GetEnd(); + const sal_Int32 nOtherStart = *pOther->GetStart(); + const sal_Int32 nOtherEnd = *pOther->GetEnd(); aBounds.insert( nOtherStart ); aBounds.insert( nOtherEnd ); } } - std::set<xub_StrLen>::iterator aStartIter = aBounds.lower_bound( nThisStart ); - std::set<xub_StrLen>::iterator aEndIter = aBounds.upper_bound( nThisEnd ); - xub_StrLen nPorStart = *aStartIter; + std::set<sal_Int32>::iterator aStartIter = aBounds.lower_bound( nThisStart ); + std::set<sal_Int32>::iterator aEndIter = aBounds.upper_bound( nThisEnd ); + sal_Int32 nPorStart = *aStartIter; ++aStartIter; bool bDestroyHint = true; @@ -690,7 +690,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, { OSL_ENSURE( bNoLengthAttribute || nPorStart < *aStartIter, "AUTOSTYLES: BuildPortion trouble" ); - const xub_StrLen nPorEnd = bNoLengthAttribute ? nPorStart : *aStartIter; + const sal_Int32 nPorEnd = bNoLengthAttribute ? nPorStart : *aStartIter; aInsDelHints.clear(); // Get all hints that are in [nPorStart, nPorEnd[: @@ -702,7 +702,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, RES_TXTATR_AUTOFMT != pOther->Which() ) continue; - const xub_StrLen nOtherStart = *pOther->GetStart(); + const sal_Int32 nOtherStart = *pOther->GetStart(); if ( nOtherStart > nPorStart ) break; @@ -975,7 +975,7 @@ SwTxtAttr* MakeRedlineTxtAttr( SwDoc & rDoc, SfxPoolItem & rAttr ) // create new text attribute SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr, - xub_StrLen const nStt, xub_StrLen const nEnd, + sal_Int32 const nStt, sal_Int32 const nEnd, CopyOrNew_t const bIsCopy, SwTxtNode *const pTxtNode) { if ( isCHRATR(rAttr.Which()) ) @@ -1071,7 +1071,7 @@ SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr, } SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, const SfxItemSet& rSet, - xub_StrLen nStt, xub_StrLen nEnd ) + sal_Int32 nStt, sal_Int32 nEnd ) { IStyleAccess& rStyleAccess = rDoc.GetIStyleAccess(); const StylePool::SfxItemSet_Pointer_t pAutoStyle = rStyleAccess.getAutomaticStyle( rSet, IStyleAccess::AUTO_STYLE_CHAR ); @@ -1452,7 +1452,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) } // adjust end of hint to account for inserted CH_TXTATR - xub_StrLen * const pEnd(pAttr->GetEnd()); + sal_Int32 * const pEnd(pAttr->GetEnd()); if (pEnd) { *pEnd = *pEnd + 1; @@ -1536,7 +1536,7 @@ void SwTxtNode::DeleteAttributes( const sal_uInt16 nWhich, for ( sal_uInt16 nPos = 0; m_pSwpHints && nPos < m_pSwpHints->Count(); nPos++ ) { SwTxtAttr * const pTxtHt = m_pSwpHints->GetTextHint( nPos ); - const xub_StrLen nHintStart = *(pTxtHt->GetStart()); + const sal_Int32 nHintStart = *(pTxtHt->GetStart()); if (nStart < nHintStart) { break; // sorted by start @@ -1567,7 +1567,7 @@ void SwTxtNode::DeleteAttributes( const sal_uInt16 nWhich, // so it shouldn't need to care about ignore start/end flags } - xub_StrLen const * const pEndIdx = pTxtHt->GetEnd(); + sal_Int32 const * const pEndIdx = pTxtHt->GetEnd(); if ( pTxtHt->HasDummyChar() ) { @@ -1937,11 +1937,11 @@ sal_Bool SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd, for (sal_uInt16 n = 0; n < nSize; ++n) { const SwTxtAttr* pHt = (*m_pSwpHints)[n]; - const xub_StrLen nAttrStart = *pHt->GetStart(); + const sal_Int32 nAttrStart = *pHt->GetStart(); if( nAttrStart > nEnd ) // ueber den Bereich hinaus break; - const xub_StrLen* pAttrEnd = pHt->GetEnd(); + const sal_Int32* pAttrEnd = pHt->GetEnd(); if ( ! pAttrEnd ) // no attributes without end continue; @@ -1964,11 +1964,11 @@ sal_Bool SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd, for (sal_uInt16 n = 0; n < nSize; ++n) { const SwTxtAttr* pHt = (*m_pSwpHints)[n]; - const xub_StrLen nAttrStart = *pHt->GetStart(); + const sal_Int32 nAttrStart = *pHt->GetStart(); if( nAttrStart > nEnd ) // ueber den Bereich hinaus break; - const xub_StrLen* pAttrEnd = pHt->GetEnd(); + const sal_Int32* pAttrEnd = pHt->GetEnd(); if ( ! pAttrEnd ) // no attributes without end continue; @@ -2007,7 +2007,7 @@ sal_Bool SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd, else pItem = &pHt->GetAttr(); - const sal_uInt16 nHintEnd = *pAttrEnd; + const sal_Int32 nHintEnd = *pAttrEnd; while ( pItem ) { @@ -2823,7 +2823,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode, // sollen sie nicht zu einem verschmolzen werden. // Wir koennen also auf die while-Schleife verzichten - xub_StrLen *pHtEnd = pHint->GetEnd(); + sal_Int32 *pHtEnd = pHint->GetEnd(); sal_uInt16 nWhich = pHint->Which(); switch( nWhich ) @@ -2946,7 +2946,8 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode, { // search for a reference with the same name SwTxtAttr* pTmpHt; - xub_StrLen *pTmpHtEnd, *pTmpHintEnd; + sal_Int32 *pTmpHtEnd; + sal_Int32 *pTmpHintEnd; for( sal_uInt16 n = 0, nEnd = Count(); n < nEnd; ++n ) { if (RES_TXTATR_REFMARK == (pTmpHt = GetTextHint(n))->Which() && @@ -3012,7 +3013,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode, // Sie werden natuerlich in das Array insertet, aber sie werden nicht // in die pPrev/Next/On/Off-Verkettung aufgenommen. // Der Formatierer erkennt diese TxtHints an dem CH_TXTATR_.. im Text ! - xub_StrLen nHtStart = *pHint->GetStart(); + sal_Int32 nHtStart = *pHint->GetStart(); if( !pHtEnd ) { SwpHintsArray::Insert( pHint ); @@ -3045,7 +3046,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode, } // I need this value later on for notification but the pointer may become invalid - const xub_StrLen nHintEnd = *pHtEnd; + const sal_Int32 nHintEnd = *pHtEnd; const bool bNoHintAdjustMode = (nsSetAttrMode::SETATTR_NOHINTADJUST & nMode); // handle nesting attributes: inserting may fail due to overlap! @@ -3214,12 +3215,12 @@ sal_uInt16 SwTxtNode::GetLang( const xub_StrLen nBegin, const xub_StrLen nLen, if ( HasHints() ) { - const xub_StrLen nEnd = nBegin + nLen; + const sal_Int32 nEnd = nBegin + nLen; for ( sal_uInt16 i = 0, nSize = m_pSwpHints->Count(); i < nSize; ++i ) { // ist der Attribut-Anfang schon groesser als der Idx ? const SwTxtAttr *pHt = m_pSwpHints->operator[](i); - const xub_StrLen nAttrStart = *pHt->GetStart(); + const sal_Int32 nAttrStart = *pHt->GetStart(); if( nEnd < nAttrStart ) break; @@ -3228,7 +3229,7 @@ sal_uInt16 SwTxtNode::GetLang( const xub_StrLen nBegin, const xub_StrLen nLen, if( nWhichId == nWhich || ( ( pHt->IsCharFmtAttr() || RES_TXTATR_AUTOFMT == nWhich ) && CharFmt::IsItemIncluded( nWhichId, pHt ) ) ) { - const xub_StrLen *pEndIdx = pHt->GetEnd(); + const sal_Int32 *pEndIdx = pHt->GetEnd(); // Ueberlappt das Attribut den Bereich? if( pEndIdx && diff --git a/sw/source/core/txtnode/txatbase.cxx b/sw/source/core/txtnode/txatbase.cxx index e59e969d78b6..3a1f590dab3c 100644 --- a/sw/source/core/txtnode/txatbase.cxx +++ b/sw/source/core/txtnode/txatbase.cxx @@ -22,7 +22,7 @@ #include <fmtfld.hxx> #include <docufld.hxx> -SwTxtAttr::SwTxtAttr( SfxPoolItem& rAttr, xub_StrLen nStart ) +SwTxtAttr::SwTxtAttr( SfxPoolItem& rAttr, sal_Int32 nStart ) : m_pAttr( &rAttr ) , m_nStart( nStart ) , m_bDontExpand( false ) @@ -43,7 +43,7 @@ SwTxtAttr::~SwTxtAttr( ) { } -xub_StrLen* SwTxtAttr::GetEnd() +sal_Int32* SwTxtAttr::GetEnd() { return 0; } @@ -62,12 +62,12 @@ int SwTxtAttr::operator==( const SwTxtAttr& rAttr ) const } SwTxtAttrEnd::SwTxtAttrEnd( SfxPoolItem& rAttr, - xub_StrLen nStart, xub_StrLen nEnd ) : + sal_Int32 nStart, sal_Int32 nEnd ) : SwTxtAttr( rAttr, nStart ), m_nEnd( nEnd ) { } -xub_StrLen* SwTxtAttrEnd::GetEnd() +sal_Int32* SwTxtAttrEnd::GetEnd() { return & m_nEnd; } diff --git a/sw/source/core/txtnode/txatritr.cxx b/sw/source/core/txtnode/txatritr.cxx index c824a3be7002..6ca629fa9519 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 xub_StrLen* pEnd = pHt->GetEnd(); - const xub_StrLen nHtStt = *pHt->GetStart(); + const sal_Int32* pEnd = pHt->GetEnd(); + const sal_Int32 nHtStt = *pHt->GetStart(); if( nHtStt < nStt && ( !pEnd || *pEnd <= nStt )) continue; diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 1c9ee697afff..a10b0d3595b7 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -379,14 +379,14 @@ void SwTxtNode::RstAttr( if ( !GetpSwpHints() ) return; - const xub_StrLen nStt = rIdx.GetIndex(); - const xub_StrLen nEnd = nStt + nLen; + const sal_Int32 nStt = rIdx.GetIndex(); + const sal_Int32 nEnd = nStt + nLen; bool bChanged = false; // nMin and nMax initialized to maximum / minimum (inverse) sal_Int32 nMin = m_Text.getLength(); - xub_StrLen nMax = nStt; + sal_Int32 nMax = nStt; const bool bNoLen = nMin == 0; // We have to remember the "new" attributes, that have @@ -397,7 +397,7 @@ void SwTxtNode::RstAttr( // iterate over attribute array until start of attribute is behind // deletion range sal_uInt16 i = 0; - xub_StrLen nAttrStart; + sal_Int32 nAttrStart; SwTxtAttr *pHt = NULL; while ((i < m_pSwpHints->Count()) && ((( nAttrStart = *(*m_pSwpHints)[i]->GetStart()) < nEnd ) || nLen==0) ) @@ -406,7 +406,7 @@ void SwTxtNode::RstAttr( // attributes without end stay in! // but consider <bInclRefToxMark> used by Undo - xub_StrLen* const pAttrEnd = pHt->GetEnd(); + sal_Int32* const pAttrEnd = pHt->GetEnd(); const bool bKeepAttrWithoutEnd = pAttrEnd == NULL && ( !bInclRefToxMark @@ -465,7 +465,7 @@ void SwTxtNode::RstAttr( if( nStt <= nAttrStart ) // Faelle: 1,3,5 { - const xub_StrLen nAttrEnd = pAttrEnd != NULL + const sal_Int32 nAttrEnd = pAttrEnd != NULL ? *pAttrEnd : nAttrStart; if( nEnd > nAttrStart @@ -534,7 +534,7 @@ void SwTxtNode::RstAttr( nMax = *pAttrEnd; bChanged = true; - const xub_StrLen nAttrEnd = *pAttrEnd; + const sal_Int32 nAttrEnd = *pAttrEnd; m_pSwpHints->NoteInHistory( pHt ); *pAttrEnd = nStt; @@ -556,7 +556,7 @@ void SwTxtNode::RstAttr( if ( nMax < *pAttrEnd ) nMax = *pAttrEnd; bChanged = true; - xub_StrLen nTmpEnd = *pAttrEnd; + const sal_Int32 nTmpEnd = *pAttrEnd; m_pSwpHints->NoteInHistory( pHt ); *pAttrEnd = nStt; m_pSwpHints->NoteInHistory( pHt, sal_True ); @@ -897,8 +897,6 @@ sal_uInt16 SwTxtNode::Spell(SwSpellArgs* pArgs) // Die Aehnlichkeiten zu SwTxtFrm::_AutoSpell sind beabsichtigt ... // ACHTUNG: Ev. Bugs in beiden Routinen fixen! - xub_StrLen nBegin, nEnd; - // modify string according to redline information and hidden text const OUString aOldTxt( m_Text ); OUStringBuffer buf(m_Text); @@ -909,12 +907,11 @@ sal_uInt16 SwTxtNode::Spell(SwSpellArgs* pArgs) m_Text = buf.makeStringAndClear(); } - if ( pArgs->pStartNode != this ) - nBegin = 0; - else - nBegin = pArgs->pStartIdx->GetIndex(); + sal_Int32 nBegin = ( pArgs->pStartNode != this ) + ? 0 + : pArgs->pStartIdx->GetIndex(); - nEnd = ( pArgs->pEndNode != this ) + sal_Int32 nEnd = ( pArgs->pEndNode != this ) ? m_Text.getLength() : pArgs->pEndIdx->GetIndex(); @@ -995,11 +992,11 @@ sal_uInt16 SwTxtNode::Spell(SwSpellArgs* pArgs) // count those "in words" in order to modify the // selection accordingly. const sal_Unicode* pChar = rWord.getStr(); - xub_StrLen nLeft = 0; + sal_Int32 nLeft = 0; while (pChar && *pChar++ == CH_TXTATR_INWORD) ++nLeft; pChar = rWord.getLength() ? rWord.getStr() + rWord.getLength() - 1 : 0; - xub_StrLen nRight = 0; + sal_Int32 nRight = 0; while (pChar && *pChar-- == CH_TXTATR_INWORD) ++nRight; @@ -1062,22 +1059,13 @@ sal_uInt16 SwTxtNode::Convert( SwConversionArgs &rArgs ) // get range of text within node to be converted // (either all the text or the text within the selection // when the conversion was started) - sal_Int32 nTextBegin, nTextEnd; - // - if ( rArgs.pStartNode != this ) - { - nTextBegin = 0; - } - else - nTextBegin = rArgs.pStartIdx->GetIndex(); - if (nTextBegin > m_Text.getLength()) - { - nTextBegin = m_Text.getLength(); - } + const sal_Int32 nTextBegin = ( rArgs.pStartNode == this ) + ? ::std::min(rArgs.pStartIdx->GetIndex(), m_Text.getLength()) + : 0; - nTextEnd = ( rArgs.pEndNode != this ) - ? m_Text.getLength() - : ::std::min<xub_StrLen>(rArgs.pEndIdx->GetIndex(), m_Text.getLength()); + const sal_Int32 nTextEnd = ( rArgs.pEndNode == this ) + ? ::std::min(rArgs.pEndIdx->GetIndex(), m_Text.getLength()) + : m_Text.getLength(); rArgs.aConvText = OUString(); @@ -1313,8 +1301,8 @@ SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rV if( !xSpell->isValid( rWord, eActLang, Sequence< PropertyValue >() ) ) { - xub_StrLen nSmartTagStt = nBegin; - xub_StrLen nDummy = 1; + sal_Int32 nSmartTagStt = nBegin; + sal_Int32 nDummy = 1; if ( !pNode->GetSmartTags() || !pNode->GetSmartTags()->InWrongWord( nSmartTagStt, nDummy ) ) { if( !pNode->GetWrong() ) diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index 1fd3aa28f230..45f6460b65ce 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -1218,13 +1218,12 @@ void SwHistory::CopyAttr( SwpHints* pHts, sal_uLong nNodeIdx, // copy all attributes of the TextNode in the area from nStart to nEnd SwTxtAttr* pHt; - xub_StrLen nAttrStt; - const xub_StrLen * pEndIdx; + const sal_Int32 * pEndIdx; for( sal_uInt16 n = 0; n < pHts->Count(); n++ ) { // nAttrStt must even be set when !pEndIdx pHt = pHts->GetTextHint(n); - nAttrStt = *pHt->GetStart(); + const sal_Int32 nAttrStt = *pHt->GetStart(); if( 0 != ( pEndIdx = pHt->GetEnd() ) && nAttrStt > nEnd ) break; diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index e4e35cbbb6db..a6cbbda229b0 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -510,7 +510,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) const SwPosition *pPos = rOldAnch.GetCntntAnchor(); SwTxtNode *pTxtNode = (SwTxtNode*)&pPos->nNode.GetNode(); OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." ); - const xub_StrLen nIdx = pPos->nContent.GetIndex(); + const sal_Int32 nIdx = pPos->nContent.GetIndex(); SwTxtAttr * const pHnt = pTxtNode->GetTxtAttrForCharAt( nIdx, RES_TXTATR_FLYCNT ); OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT, diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 1807d44ce9c7..920856670479 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -492,7 +492,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, &( pSrch = rFtnArr[ nPos ] )->GetTxtNode())->GetIndex() <= pEnd->nNode.GetIndex() ) { - xub_StrLen nFtnSttIdx = *pSrch->GetStart(); + const sal_Int32 nFtnSttIdx = *pSrch->GetStart(); if( (nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType ) ? (&pEnd->nNode.GetNode() == pFtnNd ) : (( &pStt->nNode.GetNode() == pFtnNd && @@ -522,7 +522,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, while( nPos-- && ( pFtnNd = &( pSrch = rFtnArr[ nPos ] )-> GetTxtNode())->GetIndex() >= pStt->nNode.GetIndex() ) { - xub_StrLen nFtnSttIdx = *pSrch->GetStart(); + const sal_Int32 nFtnSttIdx = *pSrch->GetStart(); if( !(nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType) && ( ( &pStt->nNode.GetNode() == pFtnNd && pStt->nContent.GetIndex() > nFtnSttIdx ) || diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx index afa735ee37fa..9a18d6fb2293 100644 --- a/sw/source/core/undo/undobj1.cxx +++ b/sw/source/core/undo/undobj1.cxx @@ -568,7 +568,7 @@ void SwUndoSetFlyFmt::UndoImpl(::sw::UndoRedoContext & rContext) const SwPosition *pPos = rOldAnch.GetCntntAnchor(); SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode(); OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." ); - const xub_StrLen nIdx = pPos->nContent.GetIndex(); + const sal_Int32 nIdx = pPos->nContent.GetIndex(); SwTxtAttr * pHnt = pTxtNode->GetTxtAttrForCharAt( nIdx, RES_TXTATR_FLYCNT ); OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT, diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index cc182b23a9a2..f71d3f592493 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -234,7 +234,7 @@ void SwUndoInsert::UndoImpl(::sw::UndoRedoContext & rContext) else { sal_uLong nNd = nNode; - xub_StrLen nCnt = nCntnt; + sal_Int32 nCnt = nCntnt; if( nLen ) { SwNodeIndex aNd( pTmpDoc->GetNodes(), nNode); @@ -672,7 +672,7 @@ SwUndoReplace::Impl::Impl( if( !pHistory->Count() ) delete pHistory, pHistory = 0; - xub_StrLen nECnt = m_bSplitNext ? pNd->GetTxt().getLength() + const sal_Int32 nECnt = m_bSplitNext ? pNd->GetTxt().getLength() : pEnd->nContent.GetIndex(); m_sOld = pNd->GetTxt().copy( m_nSttCnt, nECnt - m_nSttCnt ); } diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx index fd7525d9640f..e2b4c7079cd8 100644 --- a/sw/source/core/undo/unredln.cxx +++ b/sw/source/core/undo/unredln.cxx @@ -283,14 +283,14 @@ void SwUndoRedlineSort::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) SwNodeIndex aPrevIdx( pStart->nNode, -1 ); sal_uLong nOffsetTemp = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex(); - xub_StrLen nCntStt = pStart->nContent.GetIndex(); + const sal_Int32 nCntStt = pStart->nContent.GetIndex(); rDoc.SortText(rPam, *pOpt); pPam->DeleteMark(); pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 ); SwCntntNode* pCNd = pPam->GetCntntNode(); - xub_StrLen nLen = pCNd->Len(); + sal_Int32 nLen = pCNd->Len(); if( nLen > nCntStt ) nLen = nCntStt; pPam->GetPoint()->nContent.Assign(pCNd, nLen ); diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx index f923feda523a..5db8247e3fd1 100644 --- a/sw/source/core/undo/untblk.cxx +++ b/sw/source/core/undo/untblk.cxx @@ -206,10 +206,7 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) SwNodeIndex aDelIdx( rIdx ); ++rIdx; SwCntntNode* pCNd = rIdx.GetNode().GetCntntNode(); - xub_StrLen nCnt = 0; - if( pCNd ) - nCnt = pCNd->Len(); - pPam->GetPoint()->nContent.Assign( pCNd, nCnt ); + pPam->GetPoint()->nContent.Assign( pCNd, pCNd ? pCNd->Len() : 0 ); pPam->SetMark(); pPam->DeleteMark(); diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index db3d841a713f..b294aace08ab 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -1080,7 +1080,7 @@ void InsertFile(SwUnoCrsr* pUnoCrsr, pDoc->DeleteAndJoin(*pUnoCrsr); SwNodeIndex aSave( pUnoCrsr->GetPoint()->nNode, -1 ); - xub_StrLen nCntnt = pUnoCrsr->GetPoint()->nContent.GetIndex(); + sal_Int32 nCntnt = pUnoCrsr->GetPoint()->nContent.GetIndex(); sal_uInt32 nErrno = pRdr->Read( *pRead ); // and paste the document diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index f6ecc4f4033b..7b6cbe4bd9fa 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -1193,7 +1193,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a const SwPosition *pPos = aAnchor.GetCntntAnchor(); SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode(); SAL_WARN_IF( !pTxtNode->HasHints(), "sw.uno", "Missing FlyInCnt-Hint." ); - const xub_StrLen nIdx = pPos->nContent.GetIndex(); + const sal_Int32 nIdx = pPos->nContent.GetIndex(); SwTxtAttr * const pHnt = pTxtNode->GetTxtAttrForCharAt( nIdx, RES_TXTATR_FLYCNT ); @@ -1295,7 +1295,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a const SwPosition *pPos = rOldAnchor.GetCntntAnchor(); SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode(); SAL_WARN_IF( !pTxtNode->HasHints(), "sw.uno", "Missing FlyInCnt-Hint." ); - const xub_StrLen nIdx = pPos->nContent.GetIndex(); + const sal_Int32 nIdx = pPos->nContent.GetIndex(); SwTxtAttr * const pHnt = pTxtNode->GetTxtAttrForCharAt( nIdx, RES_TXTATR_FLYCNT ); @@ -2088,7 +2088,7 @@ void SwXShape::dispose(void) throw( uno::RuntimeException ) { const SwPosition &rPos = *(pFmt->GetAnchor().GetCntntAnchor()); SwTxtNode *pTxtNode = rPos.nNode.GetNode().GetTxtNode(); - const xub_StrLen nIdx = rPos.nContent.GetIndex(); + const sal_Int32 nIdx = rPos.nContent.GetIndex(); pTxtNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIdx ); } else diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 9d8290189843..9e308fdc8f3a 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2059,7 +2059,7 @@ void SwXFrame::dispose(void) throw( uno::RuntimeException ) { const SwPosition &rPos = *(pFmt->GetAnchor().GetCntntAnchor()); SwTxtNode *pTxtNode = rPos.nNode.GetNode().GetTxtNode(); - const xub_StrLen nIdx = rPos.nContent.GetIndex(); + const sal_Int32 nIdx = rPos.nContent.GetIndex(); pTxtNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIdx, nIdx ); } else diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 77a8025e7af5..844f374fb035 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -1277,7 +1277,7 @@ SwXTextCursor::gotoNextWord(sal_Bool Expand) throw (uno::RuntimeException) // in specific cases... SwPosition *const pPoint = rUnoCursor.GetPoint(); SwNode *const pOldNode = &pPoint->nNode.GetNode(); - xub_StrLen const nOldIndex = pPoint->nContent.GetIndex(); + sal_Int32 const nOldIndex = pPoint->nContent.GetIndex(); SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); // end of paragraph @@ -1321,7 +1321,7 @@ SwXTextCursor::gotoPreviousWord(sal_Bool Expand) throw (uno::RuntimeException) sal_Bool bRet = sal_False; SwPosition *const pPoint = rUnoCursor.GetPoint(); SwNode *const pOldNode = &pPoint->nNode.GetNode(); - xub_StrLen const nOldIndex = pPoint->nContent.GetIndex(); + sal_Int32 const nOldIndex = pPoint->nContent.GetIndex(); SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); // start of paragraph? @@ -1360,7 +1360,7 @@ SwXTextCursor::gotoEndOfWord(sal_Bool Expand) throw (uno::RuntimeException) sal_Bool bRet = sal_False; SwPosition *const pPoint = rUnoCursor.GetPoint(); SwNode & rOldNode = pPoint->nNode.GetNode(); - xub_StrLen const nOldIndex = pPoint->nContent.GetIndex(); + sal_Int32 const nOldIndex = pPoint->nContent.GetIndex(); const sal_Int16 nWordType = i18n::WordType::DICTIONARY_WORD; SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); @@ -1396,7 +1396,7 @@ SwXTextCursor::gotoStartOfWord(sal_Bool Expand) throw (uno::RuntimeException) sal_Bool bRet = sal_False; SwPosition *const pPoint = rUnoCursor.GetPoint(); SwNode & rOldNode = pPoint->nNode.GetNode(); - xub_StrLen const nOldIndex = pPoint->nContent.GetIndex(); + sal_Int32 const nOldIndex = pPoint->nContent.GetIndex(); const sal_Int16 nWordType = i18n::WordType::DICTIONARY_WORD; SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); @@ -2964,7 +2964,7 @@ throw (uno::RuntimeException) SwNodeIndex aPrevIdx( rStart.nNode, -1 ); const sal_uLong nOffset = rEnd.nNode.GetIndex() - rStart.nNode.GetIndex(); - const xub_StrLen nCntStt = rStart.nContent.GetIndex(); + const sal_Int32 nCntStt = rStart.nContent.GetIndex(); rUnoCursor.GetDoc()->SortText(rUnoCursor, aSortOpt); @@ -2972,7 +2972,7 @@ throw (uno::RuntimeException) rUnoCursor.DeleteMark(); rUnoCursor.GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 ); SwCntntNode *const pCNd = rUnoCursor.GetCntntNode(); - xub_StrLen nLen = pCNd->Len(); + sal_Int32 nLen = pCNd->Len(); if (nLen > nCntStt) { nLen = nCntStt; diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index de3772c0c786..fd57634d6681 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -189,7 +189,7 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx, { // create SwDepend and insert into array SwDepend* pNewDepend = new SwDepend( &rClnt, &rFmt ); - xub_StrLen idx = + const sal_Int32 idx = rFmt.GetAnchor().GetCntntAnchor()->nContent.GetIndex(); sal_uInt32 nOrder = rFmt.GetAnchor().GetOrder(); @@ -218,7 +218,7 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx, // OD 2004-05-07 #i28701# - determine insert position for // sorted <rFrameArr> - xub_StrLen nIndex = pAnchorPos->nContent.GetIndex(); + const sal_Int32 nIndex = pAnchorPos->nContent.GetIndex(); sal_uInt32 nOrder = rAnchor.GetOrder(); FrameDependSortListEntry entry(nIndex, nOrder, pNewDepend); @@ -370,9 +370,9 @@ void SwUnoCursorHelper::GetCrsrAttr(SwPaM & rPam, { case ND_TEXTNODE: { - const xub_StrLen nStart = (n == nSttNd) + const sal_Int32 nStart = (n == nSttNd) ? rStart.nContent.GetIndex() : 0; - const xub_StrLen nEnd = (n == nEndNd) + const sal_Int32 nEnd = (n == nEndNd) ? rEnd.nContent.GetIndex() : static_cast<SwTxtNode*>(pNd)->GetTxt().getLength(); static_cast<SwTxtNode*>(pNd)->GetAttr( diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index 0c817e5e7656..e1db767f22e6 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -202,7 +202,7 @@ throw( uno::RuntimeException ) SwTxtNode* pTxtNd = pUnoCrsr->GetNode()->GetTxtNode(); if ( pTxtNd ) { - xub_StrLen nStt = pUnoCrsr->Start()->nContent.GetIndex(); + const sal_Int32 nStt = pUnoCrsr->Start()->nContent.GetIndex(); aTxt = pTxtNd->GetExpandTxt( nStt, pUnoCrsr->End()->nContent.GetIndex() - nStt ); } diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index e87ebdf73a79..0e9634a7be69 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -329,7 +329,7 @@ lcl_ExportFieldMark( uno::Reference<text::XTextRange> xRef; SwDoc* pDoc = pUnoCrsr->GetDoc(); //flr: maybe it's a good idea to add a special hint to the hints array and rely on the hint segmentation.... - const xub_StrLen start = pUnoCrsr->Start()->nContent.GetIndex(); + const sal_Int32 start = pUnoCrsr->Start()->nContent.GetIndex(); OSL_ENSURE(pUnoCrsr->End()->nContent.GetIndex() == start, "hmm --- why is this different"); @@ -1103,7 +1103,7 @@ lcl_CreatePortions( } SwpHints * const pHints = pTxtNode->GetpSwpHints(); - const xub_StrLen nCurrentIndex = + const sal_Int32 nCurrentIndex = pUnoCrsr->GetPoint()->nContent.GetIndex(); // this contains the portion which consumes the character in the // text at nCurrentIndex; i.e. it must be set _once_ per iteration diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 0312b2c03948..f8867d972494 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -1391,7 +1391,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) if (!rText.isEmpty()) { - const xub_StrLen nContentPos = pCursor->GetPoint()->nContent.GetIndex(); + const sal_Int32 nContentPos = pCursor->GetPoint()->nContent.GetIndex(); SwUnoCursorHelper::DocInsertStringSplitCR( *m_pImpl->m_pDoc, *pCursor, rText, false); SwUnoCursorHelper::SelectPam(*pCursor, true); @@ -1842,7 +1842,7 @@ void SwXText::Impl::ConvertCell( SwPaM aNewStartPaM(pCorrectedRange->aStart, 0); aStartCellPam = aNewStartPaM; - xub_StrLen nEndLen = 0; + sal_Int32 nEndLen = 0; SwTxtNode * pTxtNode = pCorrectedRange->aEnd.GetNode().GetTxtNode(); if (pTxtNode != NULL) nEndLen = pTxtNode->Len(); diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx index 1b1b6519d659..e129c9cf9a0d 100644 --- a/sw/source/filter/ascii/ascatr.cxx +++ b/sw/source/filter/ascii/ascatr.cxx @@ -147,8 +147,9 @@ static Writer& OutASC_SwTxtNode( Writer& rWrt, SwCntntNode& rNode ) { const SwTxtNode& rNd = (SwTxtNode&)rNode; - xub_StrLen nStrPos = rWrt.pCurPam->GetPoint()->nContent.GetIndex(); - xub_StrLen nNodeEnde = rNd.Len(), nEnde = nNodeEnde; + sal_Int32 nStrPos = rWrt.pCurPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nNodeEnde = rNd.Len(); + sal_Int32 nEnde = nNodeEnde; bool bLastNd = rWrt.pCurPam->GetPoint()->nNode == rWrt.pCurPam->GetMark()->nNode; if( bLastNd ) nEnde = rWrt.pCurPam->GetMark()->nContent.GetIndex(); @@ -173,7 +174,7 @@ static Writer& OutASC_SwTxtNode( Writer& rWrt, SwCntntNode& rNode ) RTL_TEXTENCODING_UTF8 == rWrt.GetAsciiOptions().GetCharSet(); do { - xub_StrLen nNextAttr = aAttrIter.WhereNext(); + sal_Int32 nNextAttr = aAttrIter.WhereNext(); if( nNextAttr > nEnde ) nNextAttr = nEnde; diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx index 058e67a78943..9a994fdcf683 100644 --- a/sw/source/filter/ascii/parasc.cxx +++ b/sw/source/filter/ascii/parasc.cxx @@ -144,7 +144,7 @@ sal_uLong SwASCIIParser::CallParser() ::StartProgress( STR_STATSTR_W4WREAD, 0, nFileSize, pDoc->GetDocShell() ); SwPaM* pInsPam = 0; - xub_StrLen nSttCntnt = 0; + sal_Int32 nSttCntnt = 0; if (!bNewDoc) { const SwNodeIndex& rTmp = pPam->GetPoint()->nNode; diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index a81df40f893e..622b4b753d24 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -164,12 +164,12 @@ sal_uLong SwReader::Read( const Reader& rOptions ) pDoc->GetSpzFrmFmts()->end(), std::back_inserter(aFlyFrmArr)); } - xub_StrLen nSttCntnt = pPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nSttCntnt = pPam->GetPoint()->nContent.GetIndex(); // damit fuer alle Reader die Ende-Position immer stimmt, hier // pflegen. SwCntntNode* pCNd = pPam->GetCntntNode(); - xub_StrLen nEndCntnt = pCNd ? pCNd->Len() - nSttCntnt : 0; + sal_Int32 nEndCntnt = pCNd ? pCNd->Len() - nSttCntnt : 0; SwNodeIndex aEndPos( pPam->GetPoint()->nNode, 1 ); pDoc->SetRedlineMode_intern( eOld ); @@ -189,7 +189,7 @@ sal_uLong SwReader::Read( const Reader& rOptions ) pCNd = pDoc->GetNodes().GoNext( &aEndPos ); pPam->GetPoint()->nNode = aEndPos; - xub_StrLen nLen = pCNd->Len(); + const sal_Int32 nLen = pCNd->Len(); if( nLen < nEndCntnt ) nEndCntnt = 0; else diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index db24efe7f3f1..e51fdf9a2fac 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -2031,7 +2031,7 @@ void SwHTMLParser::SetAnchorAndAdjustment( const SfxItemSet & /*rItemSet*/, // der Absatz noch leer ist und sonst auto-gebunden. // Auto-gebundene Rahmen werden zunaechst an der Position davor // eingefuegt und erst spaeter verschoben. - xub_StrLen nCntnt = pPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nCntnt = pPam->GetPoint()->nContent.GetIndex(); if( nCntnt ) { aAnchor.SetType( FLY_AT_CHAR ); @@ -2288,7 +2288,7 @@ void SwHTMLParser::EndContextAttrs( _HTMLAttrContext *pContext, sal_Bool bRemove // Fuer DropCaps noch die Anzahl der Zeichen anpassen. Wenn // es am Ende 0 sind, wird das Attribut invalidiert und dann // von _SetAttr gar nicht erst gesetzt. - xub_StrLen nChars = pPam->GetPoint()->nContent.GetIndex(); + sal_Int32 nChars = pPam->GetPoint()->nContent.GetIndex(); if( nChars < 1 ) pAttr->Invalidate(); else if( nChars > MAX_DROPCAP_CHARS ) diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx index 0ee58263a8a1..00c7a43b153c 100644 --- a/sw/source/filter/html/htmlfld.cxx +++ b/sw/source/filter/html/htmlfld.cxx @@ -613,7 +613,7 @@ void SwHTMLParser::InsertComment( const OUString& rComment, const sal_Char *pTag // MIB 24.06.97: Wenn ein PostIt nach einen Space eingefuegt // werden soll, fuegen wir es vor dem Space ein. Dann gibt es // weniger Probleme beim Formatieren (bug #40483#) - xub_StrLen nPos = pPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nPos = pPam->GetPoint()->nContent.GetIndex(); SwTxtNode *pTxtNd = pPam->GetNode()->GetTxtNode(); sal_Bool bMoveFwd = sal_False; if (nPos>0 && pTxtNd && (' ' == pTxtNd->GetTxt()[nPos-1])) @@ -621,7 +621,7 @@ void SwHTMLParser::InsertComment( const OUString& rComment, const sal_Char *pTag bMoveFwd = sal_True; sal_uLong nNodeIdx = pPam->GetPoint()->nNode.GetIndex(); - xub_StrLen nIdx = pPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nIdx = pPam->GetPoint()->nContent.GetIndex(); for( sal_uInt16 i = aSetAttrTab.size(); i > 0; ) { _HTMLAttr *pAttr = aSetAttrTab[--i]; diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index b720d4bb1376..221b9674800f 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -247,7 +247,7 @@ void SwHTMLParser::SetAnchorAndAdjustment( sal_Int16 eVertOri, } // Vertikale Ausrichtung und Verankerung bestimmen. - xub_StrLen nCntnt = pPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nCntnt = pPam->GetPoint()->nContent.GetIndex(); if( nCntnt ) { aAnchor.SetType( FLY_AT_CHAR ); @@ -1392,7 +1392,7 @@ void SwHTMLParser::StripTrailingPara() bSetSmallFont = sal_True; SwTxtNode* pTxtNd = pCNd->GetTxtNode(); - xub_StrLen nPos = pPam->GetPoint()->nContent.GetIndex(); + sal_Int32 nPos = pPam->GetPoint()->nContent.GetIndex(); while( bSetSmallFont && nPos>0 ) { --nPos; diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 04cf2e53acff..d67816c6058c 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -2942,15 +2942,15 @@ xub_StrLen SwHTMLParser::StripTrailingLF() { xub_StrLen nStripped = 0; - xub_StrLen nLen = pPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nLen = pPam->GetPoint()->nContent.GetIndex(); if( nLen ) { SwTxtNode* pTxtNd = pPam->GetPoint()->nNode.GetNode().GetTxtNode(); // vorsicht, wenn Kommentare nicht uebrlesen werden!!! if( pTxtNd ) { - xub_StrLen nPos = nLen; - xub_StrLen nLFCount = 0; + sal_Int32 nPos = nLen; + sal_Int32 nLFCount = 0; while (nPos && ('\x0a' == pTxtNd->GetTxt()[--nPos])) nLFCount++; diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 6b60889e9271..064dbb7d4ed6 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -689,7 +689,7 @@ void SwHTMLParser::Continue( int nToken ) SwNodeIndex aNxtIdx( *pSttNdIdx ); if( pTxtNode && pTxtNode->CanJoinNext( &aNxtIdx )) { - sal_Int32 nStt = pTxtNode->GetTxt().getLength(); + const sal_Int32 nStt = pTxtNode->GetTxt().getLength(); // wenn der Cursor noch in dem Node steht, dann setze in an das Ende if( pPam->GetPoint()->nNode == aNxtIdx ) { @@ -706,13 +706,13 @@ OSL_ENSURE( pSttNdIdx->GetIndex()+1 != pPam->GetBound( sal_False ).nNode.GetInde if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( sal_True ).nNode.GetIndex() ) { - xub_StrLen nCntPos = pPam->GetBound( sal_True ).nContent.GetIndex(); + const sal_Int32 nCntPos = pPam->GetBound( sal_True ).nContent.GetIndex(); pPam->GetBound( sal_True ).nContent.Assign( pTxtNode, pTxtNode->GetTxt().getLength() + nCntPos ); } if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( sal_False ).nNode.GetIndex() ) { - xub_StrLen nCntPos = pPam->GetBound( sal_False ).nContent.GetIndex(); + const sal_Int32 nCntPos = pPam->GetBound( sal_False ).nContent.GetIndex(); pPam->GetBound( sal_False ).nContent.Assign( pTxtNode, pTxtNode->GetTxt().getLength() + nCntPos ); } @@ -1447,7 +1447,7 @@ void SwHTMLParser::NextToken( int nToken ) // insert string without spanning attributes at the end. if( !aToken.isEmpty() && ' '==aToken[0] && !IsReadPRE() ) { - xub_StrLen nPos = pPam->GetPoint()->nContent.GetIndex(); + sal_Int32 nPos = pPam->GetPoint()->nContent.GetIndex(); if( nPos ) { const OUString& rText = @@ -2137,7 +2137,7 @@ sal_Bool SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, sal_Bool bUpdateNu // Zeichen-Attribute aufspalten und ggf keine setzen, die ueber den // ganzen Absatz gesetzt sind const SwNodeIndex& rEndIdx = aOldPos.nNode; - xub_StrLen nEndCnt = aOldPos.nContent.GetIndex(); + const sal_Int32 nEndCnt = aOldPos.nContent.GetIndex(); const SwPosition& rPos = *pPam->GetPoint(); _HTMLAttr** pTbl = (_HTMLAttr**)&aAttrTab; @@ -2179,7 +2179,7 @@ sal_Bool SwHTMLParser::AppendTxtNode( SwHTMLAppendMode eMode, sal_Bool bUpdateNu sal_uInt16 nScriptTxt = g_pBreakIt->GetBreakIter()->getScriptType( rText, pAttr->GetSttCnt() ); - xub_StrLen nScriptEnd = (xub_StrLen)g_pBreakIt->GetBreakIter() + sal_Int32 nScriptEnd = g_pBreakIt->GetBreakIter() ->endOfScript( rText, nStt, nScriptTxt ); while( nScriptEnd < nEndCnt ) { @@ -2648,7 +2648,7 @@ void SwHTMLParser::_SetAttr( sal_Bool bChkEnd, sal_Bool bBeforeTable, { SwPaM* pAttrPam = new SwPaM( *pPam->GetPoint() ); const SwNodeIndex& rEndIdx = pPam->GetPoint()->nNode; - xub_StrLen nEndCnt = pPam->GetPoint()->nContent.GetIndex(); + const sal_Int32 nEndCnt = pPam->GetPoint()->nContent.GetIndex(); _HTMLAttr* pAttr; SwCntntNode* pCNd; sal_uInt16 n; @@ -3006,7 +3006,7 @@ void SwHTMLParser::EndAttr( _HTMLAttr* pAttr, _HTMLAttr **ppDepAttr, // die aktuelle Position als Ende-Position merken const SwNodeIndex* pEndIdx = &pPam->GetPoint()->nNode; - xub_StrLen nEndCnt = pPam->GetPoint()->nContent.GetIndex(); + sal_Int32 nEndCnt = pPam->GetPoint()->nContent.GetIndex(); // WIrd das zueltzt gestartete oder ein frueher gestartetes Attribut // beendet? @@ -3068,7 +3068,7 @@ void SwHTMLParser::EndAttr( _HTMLAttr* pAttr, _HTMLAttr **ppDepAttr, const OUString& rText = pTxtNd->GetTxt(); sal_uInt16 nScriptTxt = g_pBreakIt->GetBreakIter()->getScriptType( rText, pAttr->GetSttCnt() ); - xub_StrLen nScriptEnd = (xub_StrLen)g_pBreakIt->GetBreakIter() + sal_Int32 nScriptEnd = g_pBreakIt->GetBreakIter() ->endOfScript( rText, pAttr->GetSttCnt(), nScriptTxt ); while( nScriptEnd < nEndCnt ) { @@ -3266,8 +3266,8 @@ void SwHTMLParser::SplitAttrTab( _HTMLAttrTable& rNewAttrTab, _HTMLAttr** pTbl = (_HTMLAttr**)&aAttrTab; _HTMLAttr** pSaveTbl = (_HTMLAttr**)&rNewAttrTab; sal_Bool bSetAttr = sal_True; - xub_StrLen nSttCnt = pPam->GetPoint()->nContent.GetIndex(); - xub_StrLen nEndCnt = nSttCnt; + const sal_Int32 nSttCnt = pPam->GetPoint()->nContent.GetIndex(); + sal_Int32 nEndCnt = nSttCnt; if( bMoveEndBack ) { @@ -3375,7 +3375,7 @@ void SwHTMLParser::RestoreAttrTab( const _HTMLAttrTable& rNewAttrTab, const SwPosition *pPos = pPam->GetPoint(); const SwNodeIndex& rSttPara = pPos->nNode; - xub_StrLen nSttCnt = pPos->nContent.GetIndex(); + const sal_Int32 nSttCnt = pPos->nContent.GetIndex(); *pTbl = *pSaveTbl; diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx index ca8170345884..88b00191fe85 100644 --- a/sw/source/filter/inc/fltshell.hxx +++ b/sw/source/filter/inc/fltshell.hxx @@ -59,7 +59,7 @@ struct SW_DLLPUBLIC SwFltPosition { public: SwNodeIndex m_nNode; - xub_StrLen m_nCntnt; + sal_Int32 m_nCntnt; public: SwFltPosition(const SwFltPosition &rOther) : m_nNode(rOther.m_nNode) diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx index dfd1490cd51b..f207b30803bc 100644 --- a/sw/source/filter/ww1/fltshell.cxx +++ b/sw/source/filter/ww1/fltshell.cxx @@ -1045,8 +1045,7 @@ SwFltShell::SwFltShell(SwDoc* pDoc, SwPaM& rPaM, const OUString& rBaseURL, sal_B // evtl. Zeilen eingefuegt / aufgebrochen werden const SwPosition* pPos = pPaM->GetPoint(); const SwTxtNode* pSttNd = pPos->nNode.GetNode().GetTxtNode(); - sal_uInt16 nCntPos = pPos->nContent.GetIndex(); - if (nCntPos && !pSttNd->GetTxt().isEmpty()) + if (pPos->nContent.GetIndex() && !pSttNd->GetTxt().isEmpty()) // EinfuegePos nicht in leerer Zeile pDoc->SplitNode( *pPos, false ); // neue Zeile erzeugen if (!pSttNd->GetTxt().isEmpty()) diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 126e3ef31e33..2df1a600d538 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -133,8 +133,8 @@ void DocxExport::AppendBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xu { IMark* pMark = (*it); - xub_StrLen nStart = pMark->GetMarkStart().nContent.GetIndex(); - xub_StrLen nEnd = pMark->GetMarkEnd().nContent.GetIndex(); + const sal_Int32 nStart = pMark->GetMarkStart().nContent.GetIndex(); + const sal_Int32 nEnd = pMark->GetMarkEnd().nContent.GetIndex(); if ( nStart == nAktPos ) aStarts.push_back( pMark->GetName() ); diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index b4501ccf8790..e061d1a49583 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -136,8 +136,8 @@ void RtfExport::AppendBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub it != end; ++it ) { IMark* pMark = (*it); - xub_StrLen nStart = pMark->GetMarkStart().nContent.GetIndex(); - xub_StrLen nEnd = pMark->GetMarkEnd().nContent.GetIndex(); + const sal_Int32 nStart = pMark->GetMarkStart().nContent.GetIndex(); + const sal_Int32 nEnd = pMark->GetMarkEnd().nContent.GetIndex(); if ( nStart == nAktPos ) aStarts.push_back( pMark->GetName() ); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 3df10ff6529d..acc30ffe5fef 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -417,7 +417,7 @@ void SwWW8AttrIter::OutAttr( xub_StrLen nSwPos, bool bRuby ) for( sal_Int32 i = 0; i < pTxtAttrs->Count(); ++i ) { const SwTxtAttr* pHt = (*pTxtAttrs)[i]; - const xub_StrLen* pEnd = pHt->GetEnd(); + const sal_Int32* pEnd = pHt->GetEnd(); if (pEnd ? ( nSwPos >= *pHt->GetStart() && nSwPos < *pEnd) : nSwPos == *pHt->GetStart() ) @@ -522,7 +522,7 @@ void SwWW8AttrIter::OutFlys(xub_StrLen nSwPos) while ( maFlyIter != maFlyFrms.end() ) { const SwPosition &rAnchor = maFlyIter->GetPosition(); - xub_StrLen nPos = rAnchor.nContent.GetIndex(); + const sal_Int32 nPos = rAnchor.nContent.GetIndex(); if ( nPos != nSwPos ) break; @@ -597,7 +597,7 @@ const SfxPoolItem* SwWW8AttrIter::HasTextItem( sal_uInt16 nWhich ) const { const SwTxtAttr* pHt = (*pTxtAttrs)[i]; const SfxPoolItem* pItem = &pHt->GetAttr(); - const xub_StrLen* pAtrEnd = 0; + const sal_Int32* pAtrEnd = 0; if( 0 != ( pAtrEnd = pHt->GetEnd() ) && // only Attr with an end nTmpSwPos >= *pHt->GetStart() && nTmpSwPos < *pAtrEnd ) { @@ -1068,7 +1068,7 @@ void AttributeOutputBase::TOXMark( const SwTxtNode& rNode, const SwTOXMark& rAtt ww::eField eType = ww::eNONE; const SwTxtTOXMark& rTxtTOXMark = *rAttr.GetTxtTOXMark(); - const xub_StrLen* pTxtEnd = rTxtTOXMark.GetEnd(); + const sal_Int32* pTxtEnd = rTxtTOXMark.GetEnd(); if ( pTxtEnd ) // has range? { sTxt = rNode.GetExpandTxt( *rTxtTOXMark.GetStart(), @@ -1122,7 +1122,7 @@ int SwWW8AttrIter::OutAttrWithRange(xub_StrLen nPos) if ( const SwpHints* pTxtAttrs = rNd.GetpSwpHints() ) { m_rExport.m_aCurrentCharPropStarts.push( nPos ); - const xub_StrLen* pEnd; + const sal_Int32* pEnd; for ( sal_uInt16 i = 0; i < pTxtAttrs->Count(); ++i ) { const SwTxtAttr* pHt = (*pTxtAttrs)[i]; @@ -1652,8 +1652,8 @@ class CompareMarksEnd : public std::binary_function < const IMark *, const IMark public: inline bool operator() ( const IMark * pOneB, const IMark * pTwoB ) const { - xub_StrLen nOEnd = pOneB->GetMarkEnd().nContent.GetIndex(); - xub_StrLen nTEnd = pTwoB->GetMarkEnd().nContent.GetIndex(); + const sal_Int32 nOEnd = pOneB->GetMarkEnd().nContent.GetIndex(); + const sal_Int32 nTEnd = pTwoB->GetMarkEnd().nContent.GetIndex(); return nOEnd < nTEnd; } @@ -1704,8 +1704,8 @@ void MSWordExportBase::GetSortedBookmarks( const SwTxtNode& rNode, xub_StrLen nA IMark* pMark = (*it); // Remove the positions egals to the current pos - xub_StrLen nStart = pMark->GetMarkStart().nContent.GetIndex(); - xub_StrLen nEnd = pMark->GetMarkEnd().nContent.GetIndex(); + const sal_Int32 nStart = pMark->GetMarkStart().nContent.GetIndex(); + const sal_Int32 nEnd = pMark->GetMarkEnd().nContent.GetIndex(); if ( nStart > nAktPos && ( pMark->GetMarkStart().nNode == rNode.GetIndex()) ) aSortedStart.push_back( pMark ); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 59dbb043421d..c4d72b965201 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1508,7 +1508,7 @@ const SfxPoolItem* SwWW8FltControlStack::GetFmtAttr(const SwPosition& rPos, */ if (pNd->IsTxtNode()) { - xub_StrLen nPos = rPos.nContent.GetIndex(); + const sal_Int32 nPos = rPos.nContent.GetIndex(); SfxItemSet aSet(pDoc->GetAttrPool(), nWhich, nWhich); if (static_cast<const SwTxtNode*>(pNd)->GetAttr(aSet, nPos, nPos)) pItem = aSet.GetItem(nWhich); @@ -2505,7 +2505,7 @@ bool SwWW8ImplReader::SetSpacing(SwPaM &rMyPam, int nSpace, bool bIsUpper ) else aUL.SetLower( static_cast< sal_uInt16 >(nSpace) ); - xub_StrLen nEnd = pSpacingPos->nContent.GetIndex(); + const sal_Int32 nEnd = pSpacingPos->nContent.GetIndex(); rMyPam.GetPoint()->nContent.Assign(rMyPam.GetCntntNode(), 0); pCtrlStck->NewAttr(*pSpacingPos, aUL); rMyPam.GetPoint()->nContent.Assign(rMyPam.GetCntntNode(), nEnd); @@ -5171,7 +5171,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos) for( sal_uInt16 nHintPos = 0; pHints && nHintPos < pHints->Count(); ++nHintPos) { const SwTxtAttr *pHt = (*pHints)[nHintPos]; - const xub_StrLen st = *(pHt->GetStart()); + const sal_Int32 st = *(pHt->GetStart()); if( pHt && pHt->Which() == RES_TXTATR_FLYCNT && (st >= ppBkmk->get()->GetMarkStart().nContent.GetIndex()) ) diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 26499cadc20d..4d454e14c0d6 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -289,7 +289,7 @@ sal_uInt16 SwWW8ImplReader::End_Ftn() //Get the footnote character and remove it from the txtnode. We'll //replace it with the footnote SwTxtNode* pTxt = pPaM->GetNode()->GetTxtNode(); - xub_StrLen nPos = pPaM->GetPoint()->nContent.GetIndex(); + sal_Int32 nPos = pPaM->GetPoint()->nContent.GetIndex(); OUString sChar; SwTxtAttr* pFN = 0; @@ -2904,7 +2904,7 @@ bool WW8TabDesc::SetPamInCell(short nWwCol, bool bPam) SwPosition* pGridPos = pIo->pPaM->GetPoint(); - xub_StrLen nEnd = pGridPos->nContent.GetIndex(); + const sal_Int32 nEnd = pGridPos->nContent.GetIndex(); pGridPos->nContent.Assign(pIo->pPaM->GetCntntNode(), 0); pIo->pCtrlStck->NewAttr(*pGridPos, aGridItem); pGridPos->nContent.Assign(pIo->pPaM->GetCntntNode(), nEnd); diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index ee7c9c075972..4c35f4e5bb35 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -3088,9 +3088,9 @@ SwFrmFmt *SwWW8ImplReader::ContainsSingleInlineGraphic(const SwPaM &rRegion) */ SwFrmFmt *pRet=0; SwNodeIndex aBegin(rRegion.Start()->nNode); - xub_StrLen nBegin(rRegion.Start()->nContent.GetIndex()); + const sal_Int32 nBegin(rRegion.Start()->nContent.GetIndex()); SwNodeIndex aEnd(rRegion.End()->nNode); - xub_StrLen nEnd(rRegion.End()->nContent.GetIndex()); + const sal_Int32 nEnd(rRegion.End()->nContent.GetIndex()); const SwTxtNode* pTNd; const SwTxtAttr* pTFlyAttr; if ( diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 51a94811dee6..c49a4635107c 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -773,7 +773,7 @@ void SwXMLImport::endDocument( void ) if( pSttNdIdx->GetIndex()+1 == pPaM->GetBound( sal_True ).nNode.GetIndex() ) { - sal_uInt16 nCntPos = + const sal_Int32 nCntPos = pPaM->GetBound( sal_True ).nContent.GetIndex(); pPaM->GetBound( sal_True ).nContent.Assign( pTxtNode, pTxtNode->GetTxt().getLength() + nCntPos ); @@ -781,7 +781,7 @@ void SwXMLImport::endDocument( void ) if( pSttNdIdx->GetIndex()+1 == pPaM->GetBound( sal_False ).nNode.GetIndex() ) { - sal_uInt16 nCntPos = + const sal_Int32 nCntPos = pPaM->GetBound( sal_False ).nContent.GetIndex(); pPaM->GetBound( sal_False ).nContent.Assign( pTxtNode, pTxtNode->GetTxt().getLength() + nCntPos ); diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 2ddd993552a5..bec282a160cf 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -708,8 +708,7 @@ sal_Bool SwEditWin::IsInputSequenceCheckingRequired( const OUString &rText, cons !rCTLOptions.IsCTLSequenceChecking() ) return sal_False; - const xub_StrLen nFirstPos = rCrsr.Start()->nContent.GetIndex(); - if ( 0 == nFirstPos ) /* first char needs not to be checked */ + if ( 0 == rCrsr.Start()->nContent.GetIndex() ) /* first char needs not to be checked */ return sal_False; SwBreakIt *pBreakIter = SwBreakIt::Get(); @@ -917,7 +916,7 @@ void SwEditWin::FlushInBuffer() // if text prior to the original selection needs to be changed // as well, we now expand the selection accordingly. SwPaM &rCrsr = *rSh.GetCrsr(); - xub_StrLen nCrsrStartPos = rCrsr.Start()->nContent.GetIndex(); + const sal_Int32 nCrsrStartPos = rCrsr.Start()->nContent.GetIndex(); OSL_ENSURE( nCrsrStartPos >= nExpandSelection, "cannot expand selection as specified!!" ); if (nExpandSelection && nCrsrStartPos >= nExpandSelection) { @@ -5304,9 +5303,9 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) if( pCrsr ) { sal_uLong nPosNodeIdx = pCrsr->GetPoint()->nNode.GetIndex(); - xub_StrLen nPosIdx = pCrsr->GetPoint()->nContent.GetIndex(); + const sal_Int32 nPosIdx = pCrsr->GetPoint()->nContent.GetIndex(); sal_uLong nMarkNodeIdx = pCrsr->GetMark()->nNode.GetIndex(); - xub_StrLen nMarkIdx = pCrsr->GetMark()->nContent.GetIndex(); + const sal_Int32 nMarkIdx = pCrsr->GetMark()->nContent.GetIndex(); if( !rSh.GetCrsr()->HasMark() ) rSh.GetCrsr()->SetMark(); @@ -6020,7 +6019,7 @@ OUString SwEditWin::GetSurroundingText() const else if( !rSh.HasSelection() ) { SwPosition *pPos = rSh.GetCrsr()->GetPoint(); - xub_StrLen nPos = pPos->nContent.GetIndex(); + const sal_Int32 nPos = pPos->nContent.GetIndex(); // get the sentence around the cursor rSh.HideCrsr(); @@ -6051,11 +6050,11 @@ Selection SwEditWin::GetSurroundingTextSelection() const // Return the position of the visible cursor in the sentence // around the visible cursor. SwPosition *pPos = rSh.GetCrsr()->GetPoint(); - xub_StrLen nPos = pPos->nContent.GetIndex(); + const sal_Int32 nPos = pPos->nContent.GetIndex(); rSh.HideCrsr(); rSh.GoStartSentence(); - xub_StrLen nStartPos = rSh.GetCrsr()->GetPoint()->nContent.GetIndex(); + const sal_Int32 nStartPos = rSh.GetCrsr()->GetPoint()->nContent.GetIndex(); pPos->nContent = nPos; rSh.ClearMark(); diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx index 7a0c07086bc7..b53f2d101c3c 100644 --- a/sw/source/ui/lingu/hhcwrp.cxx +++ b/sw/source/ui/lingu/hhcwrp.cxx @@ -609,7 +609,7 @@ void SwHHCWrapper::Convert() else { OUString aText( m_pConvArgs->pStartNode->GetTxt() ); - long nPos = m_pConvArgs->pStartIdx->GetIndex(); + const sal_Int32 nPos = m_pConvArgs->pStartIdx->GetIndex(); Boundary aBoundary( g_pBreakIt->GetBreakIter()-> getWordBoundary( aText, nPos, g_pBreakIt->GetLocale( m_pConvArgs->nConvSrcLang ), WordType::DICTIONARY_WORD, sal_True ) ); diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx index b11a08bacb83..85e30b529e30 100644 --- a/sw/source/ui/shells/langhelper.cxx +++ b/sw/source/ui/shells/langhelper.cxx @@ -557,10 +557,9 @@ namespace SwLangHelper aText = pNode->GetTxt(); if (!aText.isEmpty()) { - xub_StrLen nStt = 0; - xub_StrLen nEnd = pCrsr->GetPoint()->nContent.GetIndex(); + sal_Int32 nEnd = pCrsr->GetPoint()->nContent.GetIndex(); // at most 100 chars to the left... - nStt = nEnd > 100 ? nEnd - 100 : 0; + const sal_Int32 nStt = nEnd > 100 ? nEnd - 100 : 0; // ... and 100 to the right of the cursor position nEnd = aText.getLength() - nEnd > 100 ? nEnd + 100 : aText.getLength(); aText = aText.copy( nStt, nEnd - nStt ); diff --git a/sw/source/ui/uiview/viewling.cxx b/sw/source/ui/uiview/viewling.cxx index b0dcfd387326..5bc5146e4ebb 100644 --- a/sw/source/ui/uiview/viewling.cxx +++ b/sw/source/ui/uiview/viewling.cxx @@ -175,7 +175,7 @@ void SwView::ExecLingu(SfxRequest &rReq) const SwPosition *pPoint = m_pWrtShell->GetCrsr()->GetPoint(); sal_Bool bRestoreCursor = pPoint->nNode.GetNode().IsTxtNode(); const SwNodeIndex aPointNodeIndex( pPoint->nNode ); - xub_StrLen nPointIndex = pPoint->nContent.GetIndex(); + sal_Int32 nPointIndex = pPoint->nContent.GetIndex(); // since this conversion is not interactive the whole converted // document should be undone in a single undo step. @@ -517,11 +517,11 @@ void SwView::InsertThesaurusSynonym( const OUString &rSynonmText, const OUString // preserve those. Therefore count those "in words" in order to modify // the selection accordingly. const sal_Unicode* pChar = rLookUpText.getStr(); - xub_StrLen nLeft = 0; + sal_Int32 nLeft = 0; while (pChar && *pChar++ == CH_TXTATR_INWORD) ++nLeft; pChar = rLookUpText.getLength() ? rLookUpText.getStr() + rLookUpText.getLength() - 1 : 0; - xub_StrLen nRight = 0; + sal_Int32 nRight = 0; while (pChar && *pChar-- == CH_TXTATR_INWORD) ++nRight; |