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 ...@@ -126,43 +126,40 @@ struct SwSpellArgs : SwArgsBase
class SwInterHyphInfo class SwInterHyphInfo
{ {
::com::sun::star::uno::Reference< ::css::uno::Reference< ::css::linguistic2::XHyphenatedWord > xHyphWord;
::com::sun::star::linguistic2::XHyphenatedWord > xHyphWord; const Point aCrsrPos;
const Point aCrsrPos;
sal_Bool bNoLang : 1; sal_Bool bNoLang : 1;
sal_Bool bCheck : 1; sal_Bool bCheck : 1;
public: public:
xub_StrLen nStart; sal_Int32 nStart;
xub_StrLen nLen; sal_Int32 nEnd;
xub_StrLen nWordStart; sal_Int32 nWordStart;
xub_StrLen nWordLen; sal_Int32 nWordLen;
xub_StrLen nHyphPos; sal_Int32 nHyphPos;
sal_uInt16 nMinTrail; sal_uInt16 nMinTrail;
inline SwInterHyphInfo( const Point &rCrsrPos, inline SwInterHyphInfo( const Point &rCrsrPos,
const sal_uInt16 nStartPos = 0, sal_Int32 nStartPos = 0,
const sal_uInt16 nLength = USHRT_MAX ) sal_Int32 nLength = SAL_MAX_INT32 )
: aCrsrPos( rCrsrPos ), : aCrsrPos( rCrsrPos ),
bNoLang(sal_False), bCheck(sal_False), bNoLang(sal_False), bCheck(sal_False),
nStart(nStartPos), nLen(nLength), nStart(nStartPos),
nEnd( std::max(SAL_MAX_INT32, nStartPos + nLength) ),
nWordStart(0), nWordLen(0), nWordStart(0), nWordLen(0),
nHyphPos(0), nMinTrail(0) nHyphPos(0), nMinTrail(0)
{ } { }
inline xub_StrLen GetEnd() const inline sal_Int32 GetEnd() const
{ return STRING_LEN == nLen ? nLen : nStart + nLen; } { return nEnd; }
inline const Point *GetCrsrPos() const 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 sal_Bool IsCheck() const { return bCheck; }
inline void SetCheck( const sal_Bool bNew ) { bCheck = bNew; } inline void SetCheck( const sal_Bool bNew ) { bCheck = bNew; }
inline void SetNoLang( const sal_Bool bNew ) { bNoLang = bNew; } inline void SetNoLang( const sal_Bool bNew ) { bNoLang = bNew; }
inline void inline void SetHyphWord(const ::css::uno::Reference< ::css::linguistic2::XHyphenatedWord > &rxHW)
SetHyphWord(const ::com::sun::star::uno::Reference< { xHyphWord = rxHW; }
::com::sun::star::linguistic2::XHyphenatedWord > &rxHW) inline ::css::uno::Reference< ::css::linguistic2::XHyphenatedWord > GetHyphWord()
{ xHyphWord = rxHW; } { return xHyphWord; }
inline ::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XHyphenatedWord >
GetHyphWord() { return xHyphWord; }
}; };
......
...@@ -2047,7 +2047,7 @@ SwHyphArgs::SwHyphArgs( const SwPaM *pPam, const Point &rCrsrPos, ...@@ -2047,7 +2047,7 @@ SwHyphArgs::SwHyphArgs( const SwPaM *pPam, const Point &rCrsrPos,
inline void SwHyphArgs::SetRange( const SwNode *pNew ) inline void SwHyphArgs::SetRange( const SwNode *pNew )
{ {
nStart = pStart == pNew ? nPamStart : 0; 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 void SwHyphArgs::SetPam( SwPaM *pPam ) const
......
...@@ -100,7 +100,7 @@ sal_Bool SwTxtFrm::Hyphenate( SwInterHyphInfo &rHyphInf ) ...@@ -100,7 +100,7 @@ sal_Bool SwTxtFrm::Hyphenate( SwInterHyphInfo &rHyphInf )
aLine.Next(); aLine.Next();
} }
const xub_StrLen nEnd = rHyphInf.GetEnd(); const sal_Int32 nEnd = rHyphInf.GetEnd();
while( !bRet && aLine.GetStart() < nEnd ) while( !bRet && aLine.GetStart() < nEnd )
{ {
bRet = aLine.Hyphenate( rHyphInf ); bRet = aLine.Hyphenate( rHyphInf );
...@@ -177,9 +177,9 @@ sal_Bool SwTxtFormatter::Hyphenate( SwInterHyphInfo &rHyphInf ) ...@@ -177,9 +177,9 @@ sal_Bool SwTxtFormatter::Hyphenate( SwInterHyphInfo &rHyphInf )
// Bereich. // Bereich.
SwLinePortion *pPos = pCurr->GetPortion(); SwLinePortion *pPos = pCurr->GetPortion();
const xub_StrLen nPamStart = rHyphInf.nStart; const sal_Int32 nPamStart = rHyphInf.nStart;
nWrdStart = nStart; nWrdStart = nStart;
const xub_StrLen nEnd = rHyphInf.GetEnd(); const sal_Int32 nEnd = rHyphInf.GetEnd();
while( pPos ) while( pPos )
{ {
// Entweder wir liegen drueber oder wir laufen gerade auf eine // Entweder wir liegen drueber oder wir laufen gerade auf eine
......
...@@ -1611,7 +1611,7 @@ sal_Bool SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf ) ...@@ -1611,7 +1611,7 @@ sal_Bool SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
pFrm = (SwTxtFrm*)(pFrm->GetFollow()); pFrm = (SwTxtFrm*)(pFrm->GetFollow());
if( pFrm ) if( pFrm )
{ {
rHyphInf.nLen = rHyphInf.nLen - (pFrm->GetOfst() - rHyphInf.nStart); rHyphInf.nEnd = rHyphInf.nEnd - (pFrm->GetOfst() - rHyphInf.nStart);
rHyphInf.nStart = pFrm->GetOfst(); 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