summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2013-11-25 15:35:08 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2013-12-02 23:11:41 +0100
commit4420650bb08794506bcc476994e628986d079991 (patch)
treeba864274844f9f4f4d98a7f9ffbae8ab2c6bee4d /sw
parent8a4c452058001c99ce06464af8357832aaa8f019 (diff)
xub_StrLen/unsigned to sal_Int32
Change-Id: I6d89f19ef2ee3aa83f3e74a416c41cd42dd448fa
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/expfld.hxx2
-rw-r--r--sw/source/core/fields/expfld.cxx4
-rw-r--r--sw/source/core/fields/reffld.cxx18
3 files changed, 12 insertions, 12 deletions
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx
index 2944589c42e4..65b9beb99120 100644
--- a/sw/inc/expfld.hxx
+++ b/sw/inc/expfld.hxx
@@ -124,7 +124,7 @@ public:
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
- static xub_StrLen GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc, unsigned nHint = 0);
+ static sal_Int32 GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc, sal_Int32 nHint = 0);
// #i82544#
void SetLateInitialization() { bLateInitialization = true;}
};
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index e25dd31f13eb..bb5a398aad73 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -866,13 +866,13 @@ void SwGetExpField::SetValue( const double& rAny )
* @param nHint search starting position after the current field (or 0 if default)
* @return
*/
-xub_StrLen SwGetExpField::GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc, unsigned nHint)
+sal_Int32 SwGetExpField::GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc, sal_Int32 nHint)
{
//
const SwTxtFld* pTxtFld = rFmt.GetTxtFld();
const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode();
//
- xub_StrLen nRet = nHint ? nHint : *pTxtFld->GetStart() + 1;
+ sal_Int32 nRet = nHint ? nHint : *pTxtFld->GetStart() + 1;
OUString sNodeText = rTxtNode.GetTxt();
if(nRet<sNodeText.getLength())
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 96de7834e448..6189446c63f5 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -285,14 +285,13 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
return ;
}
// where is the category name (e.g. "Illustration")?
- OUString const Text = pTxtNd->GetTxt();
- unsigned const nCatStart = Text.indexOf(sSetRefName);
- unsigned const nCatEnd = nCatStart == unsigned(-1) ?
- unsigned(-1) : nCatStart + sSetRefName.getLength();
- bool const bHasCat = nCatStart != unsigned(-1);
+ OUString const sText = pTxtNd->GetTxt();
+ const sal_Int32 nCatStart = sText.indexOf(sSetRefName);
+ const bool bHasCat = nCatStart>=0;
+ const sal_Int32 nCatEnd = bHasCat ? nCatStart + sSetRefName.getLength() : -1;
// length of the referenced text
- unsigned const nLen = Text.getLength();
+ const sal_Int32 nLen = sText.getLength();
// which format?
switch( GetFormat() )
@@ -303,7 +302,8 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
case REF_ONLYSEQNO:
{
// needed part of Text
- unsigned nStart, nEnd;
+ sal_Int32 nStart;
+ sal_Int32 nEnd;
switch( nSubType )
{
@@ -329,7 +329,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
pTxtNd->GetTxtAttrForCharAt(nNumStart, RES_TXTATR_FIELD)
) {
// start searching from nFrom
- unsigned const nFrom = bHasCat ?
+ const sal_Int32 nFrom = bHasCat ?
std::max<unsigned>(nNumStart + 1, nCatEnd) : nNumStart + 1;
nStart = SwGetExpField::GetReferenceTextPos(
pTxtAttr->GetFmtFld(), *pDoc, nFrom
@@ -345,7 +345,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
// "Numbering"
case REF_ONLYSEQNO:
nStart = nNumStart;
- nEnd = std::min<unsigned>(nStart + 1, nLen);
+ nEnd = std::min(nStart + 1, nLen);
break;
// "Reference" (whole Text)