Kaydet (Commit) eb568480 authored tarafından Noel Grandin's avatar Noel Grandin

convert SwInterHyphInfo from xub_StrLen->sal_Int32

Change-Id: Ie5a877fb90c360506f05d0417524966e137e5d77
üst e7c10fba
......@@ -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; }
};
......
......@@ -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
......
......@@ -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
......
......@@ -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();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment