summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2013-11-25 16:20:19 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2013-12-02 23:11:41 +0100
commit20c91a72a190bbe071d85e38fd9d4d1023b78b59 (patch)
tree4713526eb3cba2f7688383591eae47e49bdb1dd0
parent4420650bb08794506bcc476994e628986d079991 (diff)
xub_StrLen to sal_Int32
Change-Id: Ie2c18baa3ab6a3a7c6f2ac83b6d2d5bd8ecf5811
-rw-r--r--sw/inc/reffld.hxx2
-rw-r--r--sw/source/core/crsr/crstrvl.cxx2
-rw-r--r--sw/source/core/fields/reffld.cxx23
3 files changed, 14 insertions, 13 deletions
diff --git a/sw/inc/reffld.hxx b/sw/inc/reffld.hxx
index 6fded12d815b..0738e21eb433 100644
--- a/sw/inc/reffld.hxx
+++ b/sw/inc/reffld.hxx
@@ -74,7 +74,7 @@ public:
static SwTxtNode* FindAnchor( SwDoc* pDoc, const OUString& rRefMark,
sal_uInt16 nSubType, sal_uInt16 nSeqNo,
- sal_uInt16* pStt, sal_uInt16* pEnd = 0 );
+ sal_Int32* pStt, sal_Int32* pEnd = 0 );
};
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 33d77d2174f7..1d5f42e47ab3 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1096,7 +1096,7 @@ sal_Bool SwCrsrShell::GotoRefMark( const OUString& rRefMark, sal_uInt16 nSubType
SwCallLink aLk( *this ); // watch Crsr-Moves
SwCrsrSaveState aSaveState( *m_pCurCrsr );
- sal_uInt16 nPos;
+ sal_Int32 nPos = -1;
SwTxtNode* pTxtNd = SwGetRefFieldType::FindAnchor( GetDoc(), rRefMark,
nSubType, nSeqNo, &nPos );
if( pTxtNd && pTxtNd->GetNodes().IsDocNodes() )
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 6189446c63f5..9351441e3838 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -239,7 +239,7 @@ bool SwGetRefField::IsRefToNumItemCrossRefBookmark() const
const SwTxtNode* SwGetRefField::GetReferencedTxtNode() const
{
SwDoc* pDoc = dynamic_cast<SwGetRefFieldType*>(GetTyp())->GetDoc();
- sal_uInt16 nDummy = USHRT_MAX;
+ sal_Int32 nDummy = -1;
return SwGetRefFieldType::FindAnchor( pDoc, sSetRefName, nSubType, nSeqNo, &nDummy );
}
@@ -274,7 +274,8 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
SwDoc* pDoc = ((SwGetRefFieldType*)GetTyp())->GetDoc();
// finding the reference target (the number)
- sal_uInt16 nNumStart, nNumEnd;
+ sal_Int32 nNumStart = -1;
+ sal_Int32 nNumEnd = -1;
SwTxtNode* pTxtNd = SwGetRefFieldType::FindAnchor(
pDoc, sSetRefName, nSubType, nSeqNo, &nNumStart, &nNumEnd
);
@@ -314,8 +315,8 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
// "Category and Number"
case REF_ONLYNUMBER:
if (bHasCat) {
- nStart = std::min<unsigned>(nNumStart, nCatStart);
- nEnd = std::max<unsigned>(nNumEnd, nCatEnd);
+ nStart = std::min(nNumStart, nCatStart);
+ nEnd = std::max(nNumEnd, nCatEnd);
} else {
nStart = nNumStart;
nEnd = nNumEnd;
@@ -329,14 +330,14 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
pTxtNd->GetTxtAttrForCharAt(nNumStart, RES_TXTATR_FIELD)
) {
// start searching from nFrom
- const sal_Int32 nFrom = bHasCat ?
- std::max<unsigned>(nNumStart + 1, nCatEnd) : nNumStart + 1;
+ const sal_Int32 nFrom = bHasCat
+ ? std::max(nNumStart + 1, nCatEnd)
+ : nNumStart + 1;
nStart = SwGetExpField::GetReferenceTextPos(
pTxtAttr->GetFmtFld(), *pDoc, nFrom
);
} else {
- nStart = bHasCat ?
- std::max<unsigned>(nNumEnd, nCatEnd) : nNumEnd;
+ nStart = bHasCat ? std::max(nNumEnd, nCatEnd) : nNumEnd;
}
nEnd = nLen;
break;
@@ -360,7 +361,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
nStart = nNumStart;
// Text steht ueber verschiedene Nodes verteilt.
// Gesamten Text oder nur bis zum Ende vom Node?
- nEnd = nNumEnd == USHRT_MAX ? nLen : nNumEnd;
+ nEnd = nNumEnd<0 ? nLen : nNumEnd;
break;
case REF_OUTLINE:
@@ -815,7 +816,7 @@ void SwGetRefFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark,
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?" );
@@ -885,7 +886,7 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark,
else if(pBkmk->GetOtherMarkPos().nNode == pBkmk->GetMarkPos().nNode)
*pEnd = pBkmk->GetMarkEnd().nContent.GetIndex();
else
- *pEnd = USHRT_MAX;
+ *pEnd = -1;
}
}
}