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/inc | |
parent | cd470c64f9b09bb94262c606cfc36c8d923ffc54 (diff) |
xub_StrLen to sal_Int32 in SwIndex and some related
Change-Id: I66735635a88844c30a7fa1c886d2c1df34008f4f
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/crsrsh.hxx | 2 | ||||
-rw-r--r-- | sw/inc/doc.hxx | 6 | ||||
-rw-r--r-- | sw/inc/hhcwrp.hxx | 2 | ||||
-rw-r--r-- | sw/inc/hints.hxx | 6 | ||||
-rw-r--r-- | sw/inc/index.hxx | 69 | ||||
-rw-r--r-- | sw/inc/ndhints.hxx | 4 | ||||
-rw-r--r-- | sw/inc/ndtxt.hxx | 4 | ||||
-rw-r--r-- | sw/inc/node.hxx | 2 | ||||
-rw-r--r-- | sw/inc/pam.hxx | 4 | ||||
-rw-r--r-- | sw/inc/swbaslnk.hxx | 4 | ||||
-rw-r--r-- | sw/inc/swcrsr.hxx | 5 | ||||
-rw-r--r-- | sw/inc/txatbase.hxx | 26 | ||||
-rw-r--r-- | sw/inc/txtfld.hxx | 2 | ||||
-rw-r--r-- | sw/inc/txtrfmrk.hxx | 8 | ||||
-rw-r--r-- | sw/inc/txttxmrk.hxx | 8 |
15 files changed, 75 insertions, 77 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 ); |