summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-12-03 14:39:34 +0200
committerNoel Grandin <noel@peralex.com>2013-12-04 08:55:35 +0200
commiteb56848029a3b26a9d4f07a55364749e9e7d8339 (patch)
tree24251c1b0ffba038e03da356991f851fd4aa23f0
parente7c10fba9083e8ec9498a1fee4ef3ce31eb3e8d1 (diff)
convert SwInterHyphInfo from xub_StrLen->sal_Int32
Change-Id: Ie5a877fb90c360506f05d0417524966e137e5d77
-rw-r--r--sw/inc/splargs.hxx39
-rw-r--r--sw/source/core/doc/docedt.cxx2
-rw-r--r--sw/source/core/text/txthyph.cxx6
-rw-r--r--sw/source/core/txtnode/txtedt.cxx2
4 files changed, 23 insertions, 26 deletions
diff --git a/sw/inc/splargs.hxx b/sw/inc/splargs.hxx
index 45fc34d41bf8..0210ad52fb0d 100644
--- a/sw/inc/splargs.hxx
+++ b/sw/inc/splargs.hxx
@@ -126,43 +126,40 @@ struct SwSpellArgs : SwArgsBase
class SwInterHyphInfo
{
- ::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XHyphenatedWord > xHyphWord;
- const Point aCrsrPos;
+ ::css::uno::Reference< ::css::linguistic2::XHyphenatedWord > xHyphWord;
+ const Point aCrsrPos;
sal_Bool bNoLang : 1;
sal_Bool bCheck : 1;
public:
- xub_StrLen nStart;
- xub_StrLen nLen;
- xub_StrLen nWordStart;
- xub_StrLen nWordLen;
- xub_StrLen nHyphPos;
+ sal_Int32 nStart;
+ sal_Int32 nEnd;
+ sal_Int32 nWordStart;
+ sal_Int32 nWordLen;
+ sal_Int32 nHyphPos;
sal_uInt16 nMinTrail;
inline SwInterHyphInfo( const Point &rCrsrPos,
- const sal_uInt16 nStartPos = 0,
- const sal_uInt16 nLength = USHRT_MAX )
+ sal_Int32 nStartPos = 0,
+ sal_Int32 nLength = SAL_MAX_INT32 )
: aCrsrPos( rCrsrPos ),
bNoLang(sal_False), bCheck(sal_False),
- nStart(nStartPos), nLen(nLength),
+ nStart(nStartPos),
+ nEnd( std::max(SAL_MAX_INT32, nStartPos + nLength) ),
nWordStart(0), nWordLen(0),
nHyphPos(0), nMinTrail(0)
{ }
- inline xub_StrLen GetEnd() const
- { return STRING_LEN == nLen ? nLen : nStart + nLen; }
+ inline sal_Int32 GetEnd() const
+ { return nEnd; }
inline const Point *GetCrsrPos() const
- { return aCrsrPos.X() || aCrsrPos.Y() ? &aCrsrPos : 0; }
+ { return aCrsrPos.X() || aCrsrPos.Y() ? &aCrsrPos : 0; }
inline sal_Bool IsCheck() const { return bCheck; }
inline void SetCheck( const sal_Bool bNew ) { bCheck = bNew; }
inline void SetNoLang( const sal_Bool bNew ) { bNoLang = bNew; }
- inline void
- SetHyphWord(const ::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XHyphenatedWord > &rxHW)
- { xHyphWord = rxHW; }
- inline ::com::sun::star::uno::Reference<
- ::com::sun::star::linguistic2::XHyphenatedWord >
- GetHyphWord() { return xHyphWord; }
+ inline void SetHyphWord(const ::css::uno::Reference< ::css::linguistic2::XHyphenatedWord > &rxHW)
+ { xHyphWord = rxHW; }
+ inline ::css::uno::Reference< ::css::linguistic2::XHyphenatedWord > GetHyphWord()
+ { return xHyphWord; }
};
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 79fbd4390bd0..a1d3e2ef219e 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -2047,7 +2047,7 @@ SwHyphArgs::SwHyphArgs( const SwPaM *pPam, const Point &rCrsrPos,
inline void SwHyphArgs::SetRange( const SwNode *pNew )
{
nStart = pStart == pNew ? nPamStart : 0;
- nLen = pEnd == pNew ? nPamLen : STRING_NOTFOUND;
+ nEnd = pEnd == pNew ? nPamStart + nPamLen : SAL_MAX_INT32;
}
void SwHyphArgs::SetPam( SwPaM *pPam ) const
diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx
index 909f2ad42469..4aa235e01ea7 100644
--- a/sw/source/core/text/txthyph.cxx
+++ b/sw/source/core/text/txthyph.cxx
@@ -100,7 +100,7 @@ sal_Bool SwTxtFrm::Hyphenate( SwInterHyphInfo &rHyphInf )
aLine.Next();
}
- const xub_StrLen nEnd = rHyphInf.GetEnd();
+ const sal_Int32 nEnd = rHyphInf.GetEnd();
while( !bRet && aLine.GetStart() < nEnd )
{
bRet = aLine.Hyphenate( rHyphInf );
@@ -177,9 +177,9 @@ sal_Bool SwTxtFormatter::Hyphenate( SwInterHyphInfo &rHyphInf )
// Bereich.
SwLinePortion *pPos = pCurr->GetPortion();
- const xub_StrLen nPamStart = rHyphInf.nStart;
+ const sal_Int32 nPamStart = rHyphInf.nStart;
nWrdStart = nStart;
- const xub_StrLen nEnd = rHyphInf.GetEnd();
+ const sal_Int32 nEnd = rHyphInf.GetEnd();
while( pPos )
{
// Entweder wir liegen drueber oder wir laufen gerade auf eine
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 4a31aef47c5e..900419c193f8 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1611,7 +1611,7 @@ sal_Bool SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
pFrm = (SwTxtFrm*)(pFrm->GetFollow());
if( pFrm )
{
- rHyphInf.nLen = rHyphInf.nLen - (pFrm->GetOfst() - rHyphInf.nStart);
+ rHyphInf.nEnd = rHyphInf.nEnd - (pFrm->GetOfst() - rHyphInf.nStart);
rHyphInf.nStart = pFrm->GetOfst();
}
}