[Libreoffice-commits] core.git: 2 commits - editeng/source sw/inc sw/qa sw/source
Matteo Casalin
matteo.casalin at yahoo.com
Thu Nov 14 00:23:58 PST 2013
editeng/source/editeng/textconv.cxx | 18 +---
sw/inc/crsrsh.hxx | 2
sw/inc/doc.hxx | 6 -
sw/inc/hhcwrp.hxx | 2
sw/inc/hints.hxx | 6 -
sw/inc/index.hxx | 69 +++++++---------
sw/inc/ndhints.hxx | 4
sw/inc/ndtxt.hxx | 4
sw/inc/node.hxx | 2
sw/inc/pam.hxx | 4
sw/inc/swbaslnk.hxx | 4
sw/inc/swcrsr.hxx | 5 -
sw/inc/txatbase.hxx | 26 +++---
sw/inc/txtfld.hxx | 2
sw/inc/txtrfmrk.hxx | 8 -
sw/inc/txttxmrk.hxx | 8 -
sw/qa/core/uwriter.cxx | 6 -
sw/qa/extras/uiwriter/uiwriter.cxx | 2
sw/source/core/access/accmap.cxx | 10 +-
sw/source/core/access/accpara.cxx | 37 ++++----
sw/source/core/access/accportions.cxx | 28 +++---
sw/source/core/access/accportions.hxx | 14 +--
sw/source/core/access/textmarkuphelper.cxx | 2
sw/source/core/attr/hints.cxx | 2
sw/source/core/bastyp/index.cxx | 48 +++++------
sw/source/core/crsr/bookmrk.cxx | 4
sw/source/core/crsr/callnk.cxx | 10 +-
sw/source/core/crsr/callnk.hxx | 6 -
sw/source/core/crsr/crsrsh.cxx | 40 ++++-----
sw/source/core/crsr/crstrvl.cxx | 14 +--
sw/source/core/crsr/findattr.cxx | 47 +++++-----
sw/source/core/crsr/findfmt.cxx | 3
sw/source/core/crsr/findtxt.cxx | 67 +++++++--------
sw/source/core/crsr/pam.cxx | 12 +-
sw/source/core/crsr/swcrsr.cxx | 83 ++++++++-----------
sw/source/core/crsr/trvlfnfl.cxx | 10 +-
sw/source/core/crsr/trvlreg.cxx | 8 -
sw/source/core/crsr/trvltbl.cxx | 2
sw/source/core/crsr/unocrsr.cxx | 6 -
sw/source/core/doc/doc.cxx | 8 -
sw/source/core/doc/docbm.cxx | 13 +--
sw/source/core/doc/doccomp.cxx | 10 +-
sw/source/core/doc/doccorr.cxx | 4
sw/source/core/doc/docedt.cxx | 73 ++++++++--------
sw/source/core/doc/docfld.cxx | 4
sw/source/core/doc/docfly.cxx | 4
sw/source/core/doc/docfmt.cxx | 27 +++---
sw/source/core/doc/docftn.cxx | 4
sw/source/core/doc/doclay.cxx | 14 +--
sw/source/core/doc/docnum.cxx | 6 -
sw/source/core/doc/docredln.cxx | 8 -
sw/source/core/doc/docruby.cxx | 11 +-
sw/source/core/doc/docsort.cxx | 2
sw/source/core/doc/doctxm.cxx | 8 -
sw/source/core/doc/extinput.cxx | 22 ++---
sw/source/core/doc/swserv.cxx | 7 -
sw/source/core/docnode/ndcopy.cxx | 12 +-
sw/source/core/docnode/ndsect.cxx | 2
sw/source/core/docnode/ndtbl.cxx | 2
sw/source/core/docnode/node.cxx | 10 +-
sw/source/core/docnode/nodedump.cxx | 5 -
sw/source/core/docnode/nodes.cxx | 2
sw/source/core/docnode/section.cxx | 6 -
sw/source/core/docnode/swbaslnk.cxx | 2
sw/source/core/draw/dcontact.cxx | 2
sw/source/core/edit/acorrect.cxx | 8 -
sw/source/core/edit/autofmt.cxx | 26 +++---
sw/source/core/edit/edattr.cxx | 36 +++-----
sw/source/core/edit/eddel.cxx | 2
sw/source/core/edit/edfmt.cxx | 3
sw/source/core/edit/editsh.cxx | 10 +-
sw/source/core/edit/edlingu.cxx | 67 ++++++++-------
sw/source/core/edit/edws.cxx | 2
sw/source/core/fields/cellfml.cxx | 2
sw/source/core/fields/ddefld.cxx | 6 -
sw/source/core/frmedt/feshview.cxx | 12 +-
sw/source/core/frmedt/fews.cxx | 4
sw/source/core/frmedt/tblsel.cxx | 3
sw/source/core/inc/acorrect.hxx | 4
sw/source/core/inc/docfld.hxx | 4
sw/source/core/inc/frminf.hxx | 2
sw/source/core/inc/mvsave.hxx | 8 -
sw/source/core/inc/txtfrm.hxx | 2
sw/source/core/inc/wrong.hxx | 2
sw/source/core/table/swnewtable.cxx | 3
sw/source/core/table/swtable.cxx | 2
sw/source/core/text/frmcrsr.cxx | 34 +++----
sw/source/core/text/frminf.cxx | 4
sw/source/core/text/itratr.cxx | 4
sw/source/core/text/itrcrsr.cxx | 2
sw/source/core/text/porfly.cxx | 2
sw/source/core/text/redlnitr.cxx | 2
sw/source/core/text/txtfrm.cxx | 7 -
sw/source/core/text/wrong.cxx | 4
sw/source/core/text/xmldump.cxx | 4
sw/source/core/tox/tox.cxx | 4
sw/source/core/tox/txmsrt.cxx | 14 +--
sw/source/core/txtnode/atrfld.cxx | 2
sw/source/core/txtnode/atrref.cxx | 4
sw/source/core/txtnode/atrtox.cxx | 4
sw/source/core/txtnode/ndtxt.cxx | 125 ++++++++++++++---------------
sw/source/core/txtnode/thints.cxx | 61 +++++++-------
sw/source/core/txtnode/txatbase.cxx | 8 -
sw/source/core/txtnode/txatritr.cxx | 4
sw/source/core/txtnode/txtedt.cxx | 56 +++++-------
sw/source/core/undo/rolbck.cxx | 5 -
sw/source/core/undo/unattr.cxx | 2
sw/source/core/undo/undobj.cxx | 4
sw/source/core/undo/undobj1.cxx | 2
sw/source/core/undo/unins.cxx | 4
sw/source/core/undo/unredln.cxx | 4
sw/source/core/undo/untblk.cxx | 5 -
sw/source/core/unocore/unocrsrhelper.cxx | 2
sw/source/core/unocore/unodraw.cxx | 6 -
sw/source/core/unocore/unoframe.cxx | 2
sw/source/core/unocore/unoobj.cxx | 12 +-
sw/source/core/unocore/unoobj2.cxx | 8 -
sw/source/core/unocore/unoport.cxx | 2
sw/source/core/unocore/unoportenum.cxx | 4
sw/source/core/unocore/unotext.cxx | 4
sw/source/filter/ascii/ascatr.cxx | 7 -
sw/source/filter/ascii/parasc.cxx | 2
sw/source/filter/basflt/shellio.cxx | 6 -
sw/source/filter/html/htmlcss1.cxx | 4
sw/source/filter/html/htmlfld.cxx | 4
sw/source/filter/html/htmlgrin.cxx | 4
sw/source/filter/html/htmltab.cxx | 6 -
sw/source/filter/html/swhtml.cxx | 24 ++---
sw/source/filter/inc/fltshell.hxx | 2
sw/source/filter/ww1/fltshell.cxx | 3
sw/source/filter/ww8/docxexport.cxx | 4
sw/source/filter/ww8/rtfexport.cxx | 4
sw/source/filter/ww8/wrtw8nds.cxx | 18 ++--
sw/source/filter/ww8/ww8par.cxx | 6 -
sw/source/filter/ww8/ww8par2.cxx | 4
sw/source/filter/ww8/ww8par6.cxx | 4
sw/source/filter/xml/xmlimp.cxx | 4
sw/source/ui/docvw/edtwin.cxx | 15 +--
sw/source/ui/lingu/hhcwrp.cxx | 2
sw/source/ui/shells/langhelper.cxx | 5 -
sw/source/ui/uiview/viewling.cxx | 6 -
141 files changed, 809 insertions(+), 843 deletions(-)
New commits:
commit ebeff3f074dd94dce4ce6cc55abd0495103684bd
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date: Tue Nov 12 00:46:22 2013 +0100
xub_StrLen to sal_Int32 in SwIndex and some related
Change-Id: I66735635a88844c30a7fa1c886d2c1df34008f4f
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index cc86990..47f41c7 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 c30b23d..2de669d 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 ded2c76..18e6f77 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 a2a268f..f3f1dcb 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 65d40c5..01d07cc 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 c08ebbb..91aebe9 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 49b66e2..923280e 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 94908cc..93ebc5c 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 15e54c0..6d543c1 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 3d35fca..5a93b5f 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 4627850..69f476a 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 a5836b5..234110a 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 cffdd1f..3c98492 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 56e757f..ae944f9 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 313f734..ccc8707 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 504e9e4..c17ae9a 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 8fd9947..12c76b8 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 daa8214..b8a2ce5 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 566f1ba..4705251 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 4bedfca..20c5d9a8 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 a2efbe8..25f1df8 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 989c6f6..3489cc8 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 734ba21..2425451 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 7a3e68f..f3c0cc6 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 962f526..f09895a 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 04f616b..4b22683 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 3446a58..83a0270 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 8bf37b1..4e75c86 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 3fc909c..8b33be1 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 7aef37b..a7ef07e 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 2da57d2..e9c30eb 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 69013f8..bd76b30 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 1ed0a95..15168f6 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 f9a1b2e..5498722 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 a22797d..9b55a84 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 519c492..e123a54 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 0480814..75a2f1b 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 230e33a..efc0b56 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 600689e..93c4941 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 5de0105..ad9426a 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 0432fdf..14ec7ce 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 9dd757c..07984d9 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 20f139c..f4e32c7 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.
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list