xub_StrLen to sal_Int32

Change-Id: Ie2c18baa3ab6a3a7c6f2ac83b6d2d5bd8ecf5811
This commit is contained in:
Matteo Casalin
2013-11-25 16:20:19 +01:00
parent 4420650bb0
commit 20c91a72a1
3 changed files with 14 additions and 13 deletions

View File

@@ -74,7 +74,7 @@ public:
static SwTxtNode* FindAnchor( SwDoc* pDoc, const OUString& rRefMark, static SwTxtNode* FindAnchor( SwDoc* pDoc, const OUString& rRefMark,
sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_uInt16 nSubType, sal_uInt16 nSeqNo,
sal_uInt16* pStt, sal_uInt16* pEnd = 0 ); sal_Int32* pStt, sal_Int32* pEnd = 0 );
}; };

View File

@@ -1096,7 +1096,7 @@ sal_Bool SwCrsrShell::GotoRefMark( const OUString& rRefMark, sal_uInt16 nSubType
SwCallLink aLk( *this ); // watch Crsr-Moves SwCallLink aLk( *this ); // watch Crsr-Moves
SwCrsrSaveState aSaveState( *m_pCurCrsr ); SwCrsrSaveState aSaveState( *m_pCurCrsr );
sal_uInt16 nPos; sal_Int32 nPos = -1;
SwTxtNode* pTxtNd = SwGetRefFieldType::FindAnchor( GetDoc(), rRefMark, SwTxtNode* pTxtNd = SwGetRefFieldType::FindAnchor( GetDoc(), rRefMark,
nSubType, nSeqNo, &nPos ); nSubType, nSeqNo, &nPos );
if( pTxtNd && pTxtNd->GetNodes().IsDocNodes() ) if( pTxtNd && pTxtNd->GetNodes().IsDocNodes() )

View File

@@ -239,7 +239,7 @@ bool SwGetRefField::IsRefToNumItemCrossRefBookmark() const
const SwTxtNode* SwGetRefField::GetReferencedTxtNode() const const SwTxtNode* SwGetRefField::GetReferencedTxtNode() const
{ {
SwDoc* pDoc = dynamic_cast<SwGetRefFieldType*>(GetTyp())->GetDoc(); SwDoc* pDoc = dynamic_cast<SwGetRefFieldType*>(GetTyp())->GetDoc();
sal_uInt16 nDummy = USHRT_MAX; sal_Int32 nDummy = -1;
return SwGetRefFieldType::FindAnchor( pDoc, sSetRefName, nSubType, nSeqNo, &nDummy ); return SwGetRefFieldType::FindAnchor( pDoc, sSetRefName, nSubType, nSeqNo, &nDummy );
} }
@@ -274,7 +274,8 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
SwDoc* pDoc = ((SwGetRefFieldType*)GetTyp())->GetDoc(); SwDoc* pDoc = ((SwGetRefFieldType*)GetTyp())->GetDoc();
// finding the reference target (the number) // finding the reference target (the number)
sal_uInt16 nNumStart, nNumEnd; sal_Int32 nNumStart = -1;
sal_Int32 nNumEnd = -1;
SwTxtNode* pTxtNd = SwGetRefFieldType::FindAnchor( SwTxtNode* pTxtNd = SwGetRefFieldType::FindAnchor(
pDoc, sSetRefName, nSubType, nSeqNo, &nNumStart, &nNumEnd pDoc, sSetRefName, nSubType, nSeqNo, &nNumStart, &nNumEnd
); );
@@ -314,8 +315,8 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
// "Category and Number" // "Category and Number"
case REF_ONLYNUMBER: case REF_ONLYNUMBER:
if (bHasCat) { if (bHasCat) {
nStart = std::min<unsigned>(nNumStart, nCatStart); nStart = std::min(nNumStart, nCatStart);
nEnd = std::max<unsigned>(nNumEnd, nCatEnd); nEnd = std::max(nNumEnd, nCatEnd);
} else { } else {
nStart = nNumStart; nStart = nNumStart;
nEnd = nNumEnd; nEnd = nNumEnd;
@@ -329,14 +330,14 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
pTxtNd->GetTxtAttrForCharAt(nNumStart, RES_TXTATR_FIELD) pTxtNd->GetTxtAttrForCharAt(nNumStart, RES_TXTATR_FIELD)
) { ) {
// start searching from nFrom // start searching from nFrom
const sal_Int32 nFrom = bHasCat ? const sal_Int32 nFrom = bHasCat
std::max<unsigned>(nNumStart + 1, nCatEnd) : nNumStart + 1; ? std::max(nNumStart + 1, nCatEnd)
: nNumStart + 1;
nStart = SwGetExpField::GetReferenceTextPos( nStart = SwGetExpField::GetReferenceTextPos(
pTxtAttr->GetFmtFld(), *pDoc, nFrom pTxtAttr->GetFmtFld(), *pDoc, nFrom
); );
} else { } else {
nStart = bHasCat ? nStart = bHasCat ? std::max(nNumEnd, nCatEnd) : nNumEnd;
std::max<unsigned>(nNumEnd, nCatEnd) : nNumEnd;
} }
nEnd = nLen; nEnd = nLen;
break; break;
@@ -360,7 +361,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
nStart = nNumStart; nStart = nNumStart;
// Text steht ueber verschiedene Nodes verteilt. // Text steht ueber verschiedene Nodes verteilt.
// Gesamten Text oder nur bis zum Ende vom Node? // Gesamten Text oder nur bis zum Ende vom Node?
nEnd = nNumEnd == USHRT_MAX ? nLen : nNumEnd; nEnd = nNumEnd<0 ? nLen : nNumEnd;
break; break;
case REF_OUTLINE: case REF_OUTLINE:
@@ -815,7 +816,7 @@ void SwGetRefFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark, SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark,
sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_uInt16 nSubType, sal_uInt16 nSeqNo,
sal_uInt16* pStt, sal_uInt16* pEnd ) sal_Int32* pStt, sal_Int32* pEnd )
{ {
OSL_ENSURE( pStt, "Why did noone check the StartPos?" ); OSL_ENSURE( pStt, "Why did noone check the StartPos?" );
@@ -885,7 +886,7 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark,
else if(pBkmk->GetOtherMarkPos().nNode == pBkmk->GetMarkPos().nNode) else if(pBkmk->GetOtherMarkPos().nNode == pBkmk->GetMarkPos().nNode)
*pEnd = pBkmk->GetMarkEnd().nContent.GetIndex(); *pEnd = pBkmk->GetMarkEnd().nContent.GetIndex();
else else
*pEnd = USHRT_MAX; *pEnd = -1;
} }
} }
} }