summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2014-02-02 22:16:48 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-02-03 07:44:28 +0000
commit3cbfcee36dd16e451d76c561eaaaee0ff29b01a5 (patch)
tree7377a9e1d8cd56279104429abce73aec334569d5 /sc/source
parent5c39b6b997ddc85e6848efc230a427a124b97264 (diff)
xub_StrLen and tools/string.hxx final straw
Thre is still some 0xffff limit left and possibly some less than gracefully handled overflow/error cases Change-Id: I00957ee3a30b02f73918ea49d7353056263dc638 Reviewed-on: https://gerrit.libreoffice.org/7787 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/attrib.cxx2
-rw-r--r--sc/source/core/data/column3.cxx2
-rw-r--r--sc/source/core/data/documen4.cxx2
-rw-r--r--sc/source/core/data/documen8.cxx2
-rw-r--r--sc/source/core/data/funcdesc.cxx2
-rw-r--r--sc/source/core/data/table3.cxx4
-rw-r--r--sc/source/core/inc/interpre.hxx3
-rw-r--r--sc/source/core/tool/address.cxx9
-rw-r--r--sc/source/core/tool/compiler.cxx17
-rw-r--r--sc/source/core/tool/ddelink.cxx2
-rw-r--r--sc/source/core/tool/editutil.cxx14
-rw-r--r--sc/source/core/tool/interpr1.cxx22
-rw-r--r--sc/source/core/tool/interpr2.cxx10
-rw-r--r--sc/source/core/tool/interpr4.cxx2
-rw-r--r--sc/source/core/tool/rangenam.cxx4
-rw-r--r--sc/source/core/tool/token.cxx6
-rw-r--r--sc/source/filter/excel/tokstack.cxx2
-rw-r--r--sc/source/filter/excel/xehelper.cxx16
-rw-r--r--sc/source/filter/excel/xepivot.cxx2
-rw-r--r--sc/source/filter/excel/xicontent.cxx2
-rw-r--r--sc/source/filter/excel/xistring.cxx6
-rw-r--r--sc/source/filter/excel/xltools.cxx2
-rw-r--r--sc/source/filter/html/htmlexp.cxx10
-rw-r--r--sc/source/filter/inc/xistring.hxx4
-rw-r--r--sc/source/filter/inc/xlpivot.hxx2
-rw-r--r--sc/source/ui/app/inputhdl.cxx48
-rw-r--r--sc/source/ui/app/inputwin.cxx4
-rw-r--r--sc/source/ui/dbgui/scuiimoptdlg.cxx8
-rw-r--r--sc/source/ui/docshell/arealink.cxx2
-rw-r--r--sc/source/ui/docshell/docsh.cxx2
-rw-r--r--sc/source/ui/docshell/docsh8.cxx4
-rw-r--r--sc/source/ui/docshell/impex.cxx21
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx11
-rw-r--r--sc/source/ui/inc/csvcontrol.hxx4
-rw-r--r--sc/source/ui/inc/rfindlst.hxx6
-rw-r--r--sc/source/ui/navipi/navipi.cxx2
-rw-r--r--sc/source/ui/pagedlg/scuitphfedit.cxx10
-rw-r--r--sc/source/ui/unoobj/fielduno.cxx17
-rw-r--r--sc/source/ui/view/editsh.cxx2
-rw-r--r--sc/source/ui/view/output2.cxx8
-rw-r--r--sc/source/ui/view/viewfun4.cxx2
41 files changed, 147 insertions, 153 deletions
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx
index da9a3e4b45be..fa3e209f3282 100644
--- a/sc/source/core/data/attrib.cxx
+++ b/sc/source/core/data/attrib.cxx
@@ -748,7 +748,7 @@ static void lcl_SetSpace( OUString& rStr, const ESelection& rSel )
{
// Text replaced by a space to ensure they are positions:
- xub_StrLen nLen = rSel.nEndPos-rSel.nStartPos;
+ sal_Int32 nLen = rSel.nEndPos-rSel.nStartPos;
rStr = rStr.replaceAt( rSel.nStartPos, nLen, " " );
}
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 542fa88b5b58..fb6518e1db9d 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2680,7 +2680,7 @@ public:
}
-xub_StrLen ScColumn::GetMaxNumberStringLen(
+sal_Int32 ScColumn::GetMaxNumberStringLen(
sal_uInt16& nPrecision, SCROW nRowStart, SCROW nRowEnd ) const
{
nPrecision = pDocument->GetDocOptions().GetStdPrecision();
diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index ed496961c38b..23be5e520cd7 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -596,7 +596,7 @@ sal_Int32 ScDocument::GetMaxStringLen( SCTAB nTab, SCCOL nCol,
return 0;
}
-xub_StrLen ScDocument::GetMaxNumberStringLen( sal_uInt16& nPrecision, SCTAB nTab,
+sal_Int32 ScDocument::GetMaxNumberStringLen( sal_uInt16& nPrecision, SCTAB nTab,
SCCOL nCol,
SCROW nRowStart, SCROW nRowEnd ) const
{
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 4f13f68d8202..aed55b6bb1f8 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1280,7 +1280,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp
sal_Int32 nLastPar = pEngine->GetParagraphCount();
if (nLastPar)
--nLastPar;
- xub_StrLen nTxtLen = pEngine->GetTextLen(nLastPar);
+ sal_Int32 nTxtLen = pEngine->GetTextLen(nLastPar);
ESelection aSelAll( 0, 0, nLastPar, nTxtLen );
pEngine->TransliterateText( aSelAll, nType );
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index 1262925e0dcc..3d709f82456e 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -390,7 +390,7 @@ ScFunctionList::ScFunctionList() :
nMaxFuncNameLen ( 0 )
{
ScFuncDesc* pDesc = NULL;
- xub_StrLen nStrLen = 0;
+ sal_Int32 nStrLen = 0;
::std::list<ScFuncDesc*> tmpFuncList;
sal_uInt16 nDescBlock[] =
{
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 16ed68dd7de6..5b51ac246437 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1449,7 +1449,7 @@ public:
OUString aQuer( mpTransliteration->transliterate(
aQueryStr, ScGlobal::eLnge, 0, aQueryStr.getLength(),
NULL ) );
- xub_StrLen nIndex = (rEntry.eOp == SC_ENDS_WITH
+ sal_Int32 nIndex = (rEntry.eOp == SC_ENDS_WITH
|| rEntry.eOp == SC_DOES_NOT_END_WITH) ? (aCell.getLength()-aQuer.getLength()) : 0;
sal_Int32 nStrPos = aCell.indexOf( aQuer, nIndex );
switch (rEntry.eOp)
@@ -2299,7 +2299,7 @@ sal_Int32 ScTable::GetMaxStringLen( SCCOL nCol, SCROW nRowStart,
return 0;
}
-xub_StrLen ScTable::GetMaxNumberStringLen(
+sal_Int32 ScTable::GetMaxNumberStringLen(
sal_uInt16& nPrecision, SCCOL nCol, SCROW nRowStart, SCROW nRowEnd ) const
{
if ( ValidCol(nCol) )
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 4e017c4dfe1e..43b5e02fb1f5 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -23,7 +23,6 @@
#include <math.h>
#include <rtl/math.hxx>
#include <rtl/ustring.hxx>
-#include <tools/string.hxx>
#include "formula/errorcodes.hxx"
#include "formula/tokenarray.hxx"
#include "scdll.hxx"
@@ -906,7 +905,7 @@ inline bool ScInterpreter::MustHaveParamCountMin( short nAct, short nMin )
inline bool ScInterpreter::CheckStringResultLen( OUString& rResult, const OUString& rAdd )
{
- if ( (sal_uLong) rResult.getLength() + rAdd.getLength() > STRING_MAXLEN )
+ if ( rResult.getLength() + rAdd.getLength() > SAL_MAX_UINT16 )
{
SetError( errStringOverflow );
rResult = "";
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 6f37a7182e8f..710fa29f74f4 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -32,7 +32,6 @@
#include <com/sun/star/sheet/ExternalLinkType.hpp>
#include <comphelper/string.hxx>
#include <sfx2/objsh.hxx>
-#include <tools/string.hxx>
#include <tools/urlobj.hxx>
using namespace ::com::sun::star;
@@ -280,7 +279,7 @@ lcl_XL_ParseSheetRef( const sal_Unicode* start,
if (*++p == '\'')
{
aTabName += OUString( pCurrentStart,
- sal::static_int_cast<xub_StrLen>( p - pCurrentStart));
+ sal::static_int_cast<sal_Int32>( p - pCurrentStart));
pCurrentStart = ++p;
}
}
@@ -292,7 +291,7 @@ lcl_XL_ParseSheetRef( const sal_Unicode* start,
++p;
}
if (pCurrentStart < p)
- aTabName += OUString( pCurrentStart, sal::static_int_cast<xub_StrLen>( p - pCurrentStart));
+ aTabName += OUString( pCurrentStart, sal::static_int_cast<sal_Int32>( p - pCurrentStart));
if (aTabName.isEmpty())
return NULL;
if (p == pMsoxlQuoteStop)
@@ -364,7 +363,7 @@ lcl_XL_ParseSheetRef( const sal_Unicode* start,
if( *p != '!' && ( !allow_3d || *p != ':' ) )
return (!allow_3d && *p == ':') ? p : start;
- aTabName += OUString( start, sal::static_int_cast<xub_StrLen>( p - start ) );
+ aTabName += OUString( start, sal::static_int_cast<sal_Int32>( p - start ) );
}
rExternTabName = aTabName;
@@ -465,7 +464,7 @@ const sal_Unicode* ScRange::Parse_XL_Header(
p = ScGlobal::UnicodeStrChr( start+1, ']' );
if( p == NULL )
return start;
- rExternDocName += OUString( start+1, sal::static_int_cast<xub_StrLen>( p-(start+1) ) );
+ rExternDocName += OUString( start+1, sal::static_int_cast<sal_Int32>( p-(start+1) ) );
}
++p;
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 62a37a7d2949..d5ea15621dc2 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -28,7 +28,6 @@
#include <sal/macros.h>
#include <tools/rcid.h>
#include <tools/solar.h>
-#include <tools/string.hxx>
#include <unotools/charclass.hxx>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/sheet/FormulaOpCodeMapEntry.hpp>
@@ -468,7 +467,7 @@ static bool lcl_parseExternalName(
aEndTabName, nFlags, true, pExternalLinks );
if (!p || p == pStart)
return false;
- i = xub_StrLen(p - pStart);
+ i = sal_Int32(p - pStart);
cPrev = *(p-1);
}
for ( ; i < nLen; ++i, ++p)
@@ -1727,7 +1726,7 @@ static sal_Unicode* lcl_UnicodeStrNCpy( sal_Unicode* pDst, const sal_Unicode* pS
// | Sonst | Symbol=Symbol+Zeichen | GetString
//---------------+-------------------+-----------------------+---------------
-xub_StrLen ScCompiler::NextSymbol(bool bInArray)
+sal_Int32 ScCompiler::NextSymbol(bool bInArray)
{
cSymbol[MAXSTRLEN-1] = 0; // Stopper
sal_Unicode* pSym = cSymbol;
@@ -1739,7 +1738,7 @@ xub_StrLen ScCompiler::NextSymbol(bool bInArray)
bool bQuote = false;
mnRangeOpPosInSymbol = -1;
ScanState eState = ssGetChar;
- xub_StrLen nSpaces = 0;
+ sal_Int32 nSpaces = 0;
sal_Unicode cSep = mxSymbols->getSymbolChar( ocSep);
sal_Unicode cArrayColSep = mxSymbols->getSymbolChar( ocArrayColSep);
sal_Unicode cArrayRowSep = mxSymbols->getSymbolChar( ocArrayRowSep);
@@ -2488,7 +2487,7 @@ bool ScCompiler::IsString()
const sal_Unicode* p = cSymbol;
while ( *p )
p++;
- xub_StrLen nLen = sal::static_int_cast<xub_StrLen>( p - cSymbol - 1 );
+ sal_Int32 nLen = sal::static_int_cast<sal_Int32>( p - cSymbol - 1 );
bool bQuote = ((cSymbol[0] == '"') && (cSymbol[nLen] == '"'));
if ((bQuote ? nLen-2 : nLen) > MAXSTRLEN-1)
{
@@ -3254,8 +3253,8 @@ void ScCompiler::AutoCorrectParsedSymbol()
OUString aSym, aTmp2;
bool bLastAlp, bNextNum;
bLastAlp = bNextNum = true;
- xub_StrLen nStrip = 0;
- xub_StrLen nCount = nRefs;
+ sal_Int32 nStrip = 0;
+ sal_Int32 nCount = nRefs;
for ( sal_Int32 j=1; j<nCount; j++ )
{
aTmp2 = aSymbol.getToken( 0, ':', nIndex );
@@ -3383,7 +3382,7 @@ static inline bool lcl_UpperAsciiOrI18n( OUString& rUpper, const OUString& rOrg,
bool ScCompiler::NextNewToken( bool bInArray )
{
bool bAllowBooleans = bInArray;
- xub_StrLen nSpaces = NextSymbol(bInArray);
+ sal_Int32 nSpaces = NextSymbol(bInArray);
if (!cSymbol[0])
return false;
@@ -4058,7 +4057,7 @@ void ScCompiler::MoveRelWrap( ScTokenArray& rArr, ScDocument* pDoc, const ScAddr
}
bool ScCompiler::IsCharFlagAllConventions(
- OUString const & rStr, xub_StrLen nPos, sal_uLong nFlags, bool bTestLetterNumeric )
+ OUString const & rStr, sal_Int32 nPos, sal_uLong nFlags, bool bTestLetterNumeric )
{
sal_Unicode c = rStr[ nPos ];
sal_Unicode cLast = nPos > 0 ? rStr[ nPos-1 ] : 0;
diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx
index 522ec5ddb9da..a66931eb40da 100644
--- a/sc/source/core/tool/ddelink.cxx
+++ b/sc/source/core/tool/ddelink.cxx
@@ -181,7 +181,7 @@ sfx2::SvBaseLink::UpdateResult ScDdeLink::DataChanged(
aLine = aLinkStr.getToken( (sal_Int32) nR, '\n' );
for (SCSIZE nC=0; nC<nCols; nC++)
{
- aEntry = aLine.getToken( (xub_StrLen) nC, '\t' );
+ aEntry = aLine.getToken( (sal_Int32) nC, '\t' );
sal_uInt32 nIndex = nStdFormat;
double fVal = double();
if ( nMode != SC_DDE_TEXT && pFormatter->IsNumberFormat( aEntry, nIndex, fVal ) )
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index 27fdf8911862..832fa77804e0 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -649,16 +649,16 @@ void ScEditEngineDefaulter::RemoveParaAttribs()
if ( pCharItems )
{
- std::vector<sal_uInt16> aPortions;
+ std::vector<sal_Int32> aPortions;
GetPortions( nPar, aPortions );
// loop through the portions of the paragraph, and set only those items
// that are not overridden by existing character attributes
- sal_uInt16 nStart = 0;
- for ( std::vector<sal_uInt16>::const_iterator it(aPortions.begin()); it != aPortions.end(); ++it )
+ sal_Int32 nStart = 0;
+ for ( std::vector<sal_Int32>::const_iterator it(aPortions.begin()); it != aPortions.end(); ++it )
{
- sal_uInt16 nEnd = *it;
+ sal_Int32 nEnd = *it;
ESelection aSel( nPar, nStart, nPar, nEnd );
SfxItemSet aOldCharAttrs = GetAttribs( aSel );
SfxItemSet aNewCharAttrs = *pCharItems;
@@ -800,7 +800,7 @@ ScHeaderEditEngine::ScHeaderEditEngine( SfxItemPool* pEnginePoolP, sal_Bool bDel
}
OUString ScHeaderEditEngine::CalcFieldValue( const SvxFieldItem& rField,
- sal_Int32 /* nPara */, sal_uInt16 /* nPos */,
+ sal_Int32 /* nPara */, sal_Int32 /* nPos */,
Color*& /* rTxtColor */, Color*& /* rFldColor */ )
{
const SvxFieldData* pFieldData = rField.GetField();
@@ -868,7 +868,7 @@ ScFieldEditEngine::ScFieldEditEngine(
}
OUString ScFieldEditEngine::CalcFieldValue( const SvxFieldItem& rField,
- sal_Int32 /* nPara */, sal_uInt16 /* nPos */,
+ sal_Int32 /* nPara */, sal_Int32 /* nPos */,
Color*& rTxtColor, Color*& /* rFldColor */ )
{
const SvxFieldData* pFieldData = rField.GetField();
@@ -879,7 +879,7 @@ OUString ScFieldEditEngine::CalcFieldValue( const SvxFieldItem& rField,
return ScEditUtil::GetCellFieldValue(*pFieldData, mpDoc, &rTxtColor);
}
-void ScFieldEditEngine::FieldClicked( const SvxFieldItem& rField, sal_Int32, sal_uInt16 )
+void ScFieldEditEngine::FieldClicked( const SvxFieldItem& rField, sal_Int32, sal_Int32 )
{
const SvxFieldData* pFld = rField.GetField();
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 5f13a4381895..bbc71100d1e4 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -7676,8 +7676,8 @@ void ScInterpreter::ScReplace()
double fCount = ::rtl::math::approxFloor( GetDouble());
double fPos = ::rtl::math::approxFloor( GetDouble());
OUString aOldStr = GetString().getString();
- if (fPos < 1.0 || fPos > static_cast<double>(STRING_MAXLEN)
- || fCount < 0.0 || fCount > static_cast<double>(STRING_MAXLEN))
+ if (fPos < 1.0 || fPos > static_cast<double>(SAL_MAX_UINT16)
+ || fCount < 0.0 || fCount > static_cast<double>(SAL_MAX_UINT16))
PushIllegalArgument();
else
{
@@ -7801,7 +7801,7 @@ void ScInterpreter::ScLeft()
if (nParamCount == 2)
{
double nVal = ::rtl::math::approxFloor(GetDouble());
- if ( nVal < 0.0 || nVal > STRING_MAXLEN )
+ if ( nVal < 0.0 || nVal > SAL_MAX_UINT16 )
{
PushIllegalArgument();
return ;
@@ -7909,7 +7909,7 @@ void ScInterpreter::ScRightB()
if (nParamCount == 2)
{
double nVal = ::rtl::math::approxFloor(GetDouble());
- if ( nVal < 0.0 || nVal > STRING_MAXLEN )
+ if ( nVal < 0.0 || nVal > SAL_MAX_UINT16 )
{
PushIllegalArgument();
return ;
@@ -7960,7 +7960,7 @@ void ScInterpreter::ScLeftB()
if (nParamCount == 2)
{
double nVal = ::rtl::math::approxFloor(GetDouble());
- if ( nVal < 0.0 || nVal > STRING_MAXLEN )
+ if ( nVal < 0.0 || nVal > SAL_MAX_UINT16 )
{
PushIllegalArgument();
return ;
@@ -7981,7 +7981,7 @@ void ScInterpreter::ScMidB()
double fAnz = ::rtl::math::approxFloor(GetDouble());
double fAnfang = ::rtl::math::approxFloor(GetDouble());
OUString aStr = GetString().getString();
- if (fAnfang < 1.0 || fAnz < 0.0 || fAnfang > double(STRING_MAXLEN) || fAnz > double(STRING_MAXLEN))
+ if (fAnfang < 1.0 || fAnz < 0.0 || fAnfang > double(SAL_MAX_UINT16) || fAnz > double(SAL_MAX_UINT16))
PushIllegalArgument();
else
{
@@ -8003,7 +8003,7 @@ void ScInterpreter::ScRight()
if (nParamCount == 2)
{
double nVal = ::rtl::math::approxFloor(GetDouble());
- if ( nVal < 0.0 || nVal > STRING_MAXLEN )
+ if ( nVal < 0.0 || nVal > SAL_MAX_UINT16 )
{
PushIllegalArgument();
return ;
@@ -8030,7 +8030,7 @@ void ScInterpreter::ScSearch()
if (nParamCount == 3)
{
fAnz = ::rtl::math::approxFloor(GetDouble());
- if (fAnz > double(STRING_MAXLEN))
+ if (fAnz > double(SAL_MAX_UINT16))
{
PushIllegalArgument();
return;
@@ -8067,7 +8067,7 @@ void ScInterpreter::ScMid()
double fAnz = ::rtl::math::approxFloor(GetDouble());
double fAnfang = ::rtl::math::approxFloor(GetDouble());
OUString aStr = GetString().getString();
- if (fAnfang < 1.0 || fAnz < 0.0 || fAnfang > double(STRING_MAXLEN) || fAnz > double(STRING_MAXLEN))
+ if (fAnfang < 1.0 || fAnz < 0.0 || fAnfang > double(SAL_MAX_UINT16) || fAnz > double(SAL_MAX_UINT16))
PushIllegalArgument();
else
{
@@ -8163,7 +8163,7 @@ void ScInterpreter::ScSubstitute()
if (nParamCount == 4)
{
double fAnz = ::rtl::math::approxFloor(GetDouble());
- if( fAnz < 1 || fAnz > STRING_MAXLEN )
+ if( fAnz < 1 || fAnz > SAL_MAX_UINT16 )
{
PushIllegalArgument();
return;
@@ -8216,7 +8216,7 @@ void ScInterpreter::ScRept()
OUString aStr = GetString().getString();
if ( fAnz < 0.0 )
PushIllegalArgument();
- else if ( fAnz * aStr.getLength() > STRING_MAXLEN )
+ else if ( fAnz * aStr.getLength() > SAL_MAX_UINT16 )
{
PushError( errStringOverflow );
}
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index d13f1e68c992..fa8f21bfce13 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -2111,12 +2111,12 @@ void ScInterpreter::ScBase()
0
};
static const int nDigits = (sizeof (pDigits)/sizeof(pDigits[0]))-1;
- xub_StrLen nMinLen;
+ sal_Int32 nMinLen;
if ( nParamCount == 3 )
{
double fLen = ::rtl::math::approxFloor( GetDouble() );
- if ( 1.0 <= fLen && fLen < STRING_MAXLEN )
- nMinLen = (xub_StrLen) fLen;
+ if ( 1.0 <= fLen && fLen < SAL_MAX_UINT16 )
+ nMinLen = (sal_Int32) fLen;
else if ( fLen == 0.0 )
nMinLen = 1;
else
@@ -2129,12 +2129,12 @@ void ScInterpreter::ScBase()
double fChars = ((fVal > 0.0 && fBase > 0.0) ?
(ceil( log( fVal ) / log( fBase ) ) + 2.0) :
2.0);
- if ( fChars >= STRING_MAXLEN )
+ if ( fChars >= SAL_MAX_UINT16 )
nMinLen = 0; // Error
if ( !nGlobalError && nMinLen && 2 <= fBase && fBase <= nDigits && 0 <= fVal )
{
- const xub_StrLen nConstBuf = 128;
+ const sal_Int32 nConstBuf = 128;
sal_Unicode aBuf[nConstBuf];
sal_Int32 nBuf = std::max<sal_Int32>( fChars, nMinLen + 1 );
sal_Unicode* pBuf = (nBuf <= nConstBuf ? aBuf : new sal_Unicode[nBuf]);
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 7d22ea9b330a..1fa293e6ffec 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -694,7 +694,7 @@ bool ScInterpreter::CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
osl_getThreadTextEncoding()));
// In case the xub_StrLen will be longer than USHORT
// one day, and room for pad byte check.
- if ( aTmp.getLength() > ((sal_uInt16)(~0)) - 2 )
+ if ( aTmp.getLength() > SAL_MAX_UINT16 - 2 )
return false;
// Append a 0-pad-byte if string length is odd
//! MUST be sal_uInt16 and not xub_StrLen
diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index d91e69c1fba7..d5b576f67d50 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -432,7 +432,7 @@ void ScRangeData::MakeValidName( OUString& rName )
{
// strip leading invalid characters
- xub_StrLen nPos = 0;
+ sal_Int32 nPos = 0;
sal_Int32 nLen = rName.getLength();
while ( nPos < nLen && !ScCompiler::IsCharFlagAllConventions( rName, nPos, SC_COMPILER_C_NAME) )
++nPos;
@@ -479,7 +479,7 @@ bool ScRangeData::IsNameValid( const OUString& rName, ScDocument* pDoc )
sal_Char a('.');
if (rName.indexOf(a) != -1)
return false;
- xub_StrLen nPos = 0;
+ sal_Int32 nPos = 0;
sal_Int32 nLen = rName.getLength();
if ( !nLen || !ScCompiler::IsCharFlagAllConventions( rName, nPos++, SC_COMPILER_C_CHAR_NAME ) )
return false;
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 7d12e224afab..6bb060b33902 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -128,14 +128,14 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ScDoubleRefToken )
// --- class ScRawToken -----------------------------------------------------
-xub_StrLen ScRawToken::GetStrLen( const sal_Unicode* pStr )
+sal_Int32 ScRawToken::GetStrLen( const sal_Unicode* pStr )
{
if ( !pStr )
return 0;
const sal_Unicode* p = pStr;
while ( *p )
p++;
- return sal::static_int_cast<xub_StrLen>( p - pStr );
+ return sal::static_int_cast<sal_Int32>( p - pStr );
}
@@ -278,7 +278,7 @@ void ScRawToken::SetExternal( const sal_Unicode* pStr )
{
eOp = ocExternal;
eType = svExternal;
- xub_StrLen nLen = GetStrLen( pStr ) + 1;
+ sal_Int32 nLen = GetStrLen( pStr ) + 1;
if( nLen >= MAXSTRLEN )
nLen = MAXSTRLEN-1;
// Platz fuer Byte-Parameter lassen!
diff --git a/sc/source/filter/excel/tokstack.cxx b/sc/source/filter/excel/tokstack.cxx
index 55034093ced2..aec31a924b42 100644
--- a/sc/source/filter/excel/tokstack.cxx
+++ b/sc/source/filter/excel/tokstack.cxx
@@ -685,7 +685,7 @@ const TokenId TokenPool::Store( const OUString& rString )
if (ppP_Str[ nP_StrAkt ])
{
- DBG_ASSERT( sizeof( xub_StrLen ) <= 2, "*TokenPool::Store(): StrLen doesn't match!" );
+ /* attention trucate to 16 bits */
pSize[ nElementAkt ] = ( sal_uInt16 ) ppP_Str[ nP_StrAkt ]->getLength();
}
diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx
index efdc6d80c15c..b46c5fe243fe 100644
--- a/sc/source/filter/excel/xehelper.cxx
+++ b/sc/source/filter/excel/xehelper.cxx
@@ -388,7 +388,7 @@ XclExpStringRef lclCreateFormattedString(
SvxFont aFont( XclExpFontHelper::GetFontFromItemSet( rRoot, rItemSet, nScript ) );
// Excel start position of this portion
- sal_uInt16 nXclPortionStart = xString->Len();
+ sal_Int32 nXclPortionStart = xString->Len();
// add portion text to Excel string
XclExpStringHelper::AppendString( *xString, rRoot, aOUText.copy( nPortionPos, nPortionEnd - nPortionPos ) );
if( nXclPortionStart < xString->Len() )
@@ -446,13 +446,13 @@ XclExpStringRef lclCreateFormattedString(
ESelection aSel( nPara, 0 );
OUString aParaText( rEE.GetText( nPara ) );
- std::vector<sal_uInt16> aPosList;
+ std::vector<sal_Int32> aPosList;
rEE.GetPortions( nPara, aPosList );
// process all portions in the paragraph
- for( std::vector<sal_uInt16>::const_iterator it(aPosList.begin()); it != aPosList.end(); ++it )
+ for( std::vector<sal_Int32>::const_iterator it(aPosList.begin()); it != aPosList.end(); ++it )
{
- aSel.nEndPos = static_cast< xub_StrLen >( *it );
+ aSel.nEndPos = *it;
OUString aXclPortionText = aParaText.copy( aSel.nStartPos, aSel.nEndPos - aSel.nStartPos );
aItemSet.ClearItem();
@@ -488,7 +488,7 @@ XclExpStringRef lclCreateFormattedString(
}
// Excel start position of this portion
- sal_uInt16 nXclPortionStart = xString->Len();
+ sal_Int32 nXclPortionStart = xString->Len();
// add portion text to Excel string
XclExpStringHelper::AppendString( *xString, rRoot, aXclPortionText );
if( (nXclPortionStart < xString->Len()) || (aParaText.isEmpty()) )
@@ -719,12 +719,12 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico
ESelection aSel( nPara, 0 );
OUString aParaText;
sal_Int32 nParaHeight = 0;
- std::vector<sal_uInt16> aPosList;
+ std::vector<sal_Int32> aPosList;
mrEE.GetPortions( nPara, aPosList );
- for( std::vector<sal_uInt16>::const_iterator it( aPosList.begin() ); it != aPosList.end(); ++it )
+ for( std::vector<sal_Int32>::const_iterator it( aPosList.begin() ); it != aPosList.end(); ++it )
{
- aSel.nEndPos = static_cast< xub_StrLen >( *it );
+ aSel.nEndPos = *it;
if( aSel.nStartPos < aSel.nEndPos )
{
diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx
index f29cc2479631..e03cbf1218ce 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -471,7 +471,7 @@ void XclExpPCField::InsertOrigTextItem( const OUString& rText )
size_t nPos = 0;
bool bFound = false;
// #i76047# maximum item text length in pivot cache is 255
- OUString aShortText = rText.copy( 0, ::std::min( static_cast<sal_uInt16>(rText.getLength()), EXC_PC_MAXSTRLEN ) );
+ OUString aShortText = rText.copy( 0, ::std::min(rText.getLength(), EXC_PC_MAXSTRLEN ) );
for( size_t nSize = maOrigItemList.GetSize(); !bFound && (nPos < nSize); ++nPos )
if( (bFound = maOrigItemList.GetRecord( nPos )->EqualsText( aShortText )) == true )
InsertItemArrayIndex( nPos );
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 09a9c5c474a3..552dc2626427 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -933,7 +933,7 @@ void XclImpWebQuery::ReadWqtables( XclImpStream& rStrm )
const sal_Unicode cSep = ';';
OUString aQuotedPairs( "\"\"" );
- xub_StrLen nTokenCnt = ScStringUtil::GetQuotedTokenCount( aTables, aQuotedPairs, ',' );
+ sal_Int32 nTokenCnt = ScStringUtil::GetQuotedTokenCount( aTables, aQuotedPairs, ',' );
maTables = "";
sal_Int32 nStringIx = 0;
for( sal_Int32 nToken = 0; nToken < nTokenCnt; ++nToken )
diff --git a/sc/source/filter/excel/xistring.cxx b/sc/source/filter/excel/xistring.cxx
index 6bb003f33d68..d44057514670 100644
--- a/sc/source/filter/excel/xistring.cxx
+++ b/sc/source/filter/excel/xistring.cxx
@@ -166,7 +166,7 @@ XclImpStringIterator::XclImpStringIterator( const XclImpString& rString ) :
if( !mrFormats.empty() && (mrFormats.front().mnChar == 0) )
++mnFormatsEnd;
// find end position of the first portion
- mnTextEnd = static_cast< xub_StrLen >( (mnFormatsEnd < mrFormats.size()) ?
+ mnTextEnd = (mnFormatsEnd < mrFormats.size() ?
mrFormats[ mnFormatsEnd ].mnChar : mrText.getLength() );
}
@@ -194,8 +194,8 @@ XclImpStringIterator& XclImpStringIterator::operator++()
++mnFormatsEnd;
// character positions of next portion
mnTextBeg = mnTextEnd;
- mnTextEnd = static_cast< xub_StrLen >( (mnFormatsEnd < mrFormats.size()) ?
- mrFormats[ mnFormatsEnd ].mnChar : mrText.getLength() );
+ mnTextEnd = (mnFormatsEnd < mrFormats.size()) ?
+ mrFormats[ mnFormatsEnd ].mnChar : mrText.getLength();
}
while( Is() && (mnTextBeg == mnTextEnd) );
}
diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx
index 7da57ce532b4..d12a85aa793d 100644
--- a/sc/source/filter/excel/xltools.cxx
+++ b/sc/source/filter/excel/xltools.cxx
@@ -512,7 +512,7 @@ sal_Unicode XclTools::GetBuiltInDefNameIndex( const OUString& rDefName )
if( rDefName.matchIgnoreAsciiCase( aBuiltInName, nPrefixLen ) )
{
// name can be followed by underline or space character
- xub_StrLen nNextCharPos = nPrefixLen + nBuiltInLen;
+ sal_Int32 nNextCharPos = nPrefixLen + nBuiltInLen;
sal_Unicode cNextChar = (rDefName.getLength() > nNextCharPos) ? rDefName[nNextCharPos] : '\0';
if( (cNextChar == '\0') || (cNextChar == ' ') || (cNextChar == '_') )
return cBuiltIn;
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 84619233b924..fe372e480921 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -1146,7 +1146,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
}
else
{
- xub_StrLen nStartPos = 0;
+ sal_Int32 nStartPos = 0;
do
{
OUString aSingleLine = aStr.copy( nStartPos, nPos - nStartPos );
@@ -1195,12 +1195,12 @@ bool ScHTMLExport::WriteFieldText( const EditTextObject* pData )
{
if ( nPar > 0 )
TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak );
- std::vector<sal_uInt16> aPortions;
+ std::vector<sal_Int32> aPortions;
rEngine.GetPortions( nPar, aPortions );
- sal_uInt16 nStart = 0;
- for ( std::vector<sal_uInt16>::const_iterator it(aPortions.begin()); it != aPortions.end(); ++it )
+ sal_Int32 nStart = 0;
+ for ( std::vector<sal_Int32>::const_iterator it(aPortions.begin()); it != aPortions.end(); ++it )
{
- sal_uInt16 nEnd = *it;
+ sal_Int32 nEnd = *it;
ESelection aSel( nPar, nStart, nPar, nEnd );
sal_Bool bUrl = false;
// fields are single characters
diff --git a/sc/source/filter/inc/xistring.hxx b/sc/source/filter/inc/xistring.hxx
index 974af8dffce3..9b7613f5bdb1 100644
--- a/sc/source/filter/inc/xistring.hxx
+++ b/sc/source/filter/inc/xistring.hxx
@@ -101,8 +101,8 @@ private:
const OUString& mrText; /// The processed string.
const XclFormatRunVec& mrFormats; /// The vector of formatting runs.
size_t mnPortion; /// Current text portion.
- xub_StrLen mnTextBeg; /// First character of current portion.
- xub_StrLen mnTextEnd; /// First character of next portion.
+ sal_Int32 mnTextBeg; /// First character of current portion.
+ sal_Int32 mnTextEnd; /// First character of next portion.
size_t mnFormatsBeg; /// Formatting run index for current portion.
size_t mnFormatsEnd; /// Formatting run index for next portion.
};
diff --git a/sc/source/filter/inc/xlpivot.hxx b/sc/source/filter/inc/xlpivot.hxx
index 2f14e1c15fa3..cd8fccbbbdf6 100644
--- a/sc/source/filter/inc/xlpivot.hxx
+++ b/sc/source/filter/inc/xlpivot.hxx
@@ -50,7 +50,7 @@ const sal_uInt16 EXC_PT_MAXSTRLEN = 0xFFFE;
// pivot cache fields
const size_t EXC_PC_MAXFIELDCOUNT = 0xFFFE;
const sal_uInt16 EXC_PC_NOFIELD = 0xFFFF;
-const xub_StrLen EXC_PC_MAXSTRLEN = 255;
+const sal_Int32 EXC_PC_MAXSTRLEN = 255;
// pivot cache items
const size_t EXC_PC_MAXITEMCOUNT = 32500;
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 6b710231e8df..531a2443103a 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -315,7 +315,7 @@ static void lcl_Replace( EditView* pView, const OUString& rNewStr, const ESelect
// dafuer muss oben die Selektion aufgehoben werden (vor QuickInsertText)
pView->InsertText( EMPTY_OUSTRING, false );
- xub_StrLen nLen = pEngine->GetTextLen(0);
+ sal_Int32 nLen = pEngine->GetTextLen(0);
ESelection aSel( 0, nLen, 0, nLen );
pView->SetSelection( aSel ); // Cursor ans Ende
}
@@ -327,8 +327,8 @@ void ScInputHandler::UpdateRange( sal_uInt16 nIndex, const ScRange& rNew )
if ( pDocView && pRangeFindList && nIndex < pRangeFindList->Count() )
{
ScRangeFindData* pData = pRangeFindList->GetObject( nIndex );
- xub_StrLen nOldStart = pData->nSelStart;
- xub_StrLen nOldEnd = pData->nSelEnd;
+ sal_Int32 nOldStart = pData->nSelStart;
+ sal_Int32 nOldEnd = pData->nSelEnd;
ScRange aJustified = rNew;
aJustified.Justify(); // Ref in der Formel immer richtigherum anzeigen
@@ -349,14 +349,14 @@ void ScInputHandler::UpdateRange( sal_uInt16 nIndex, const ScRange& rNew )
long nDiff = aNewStr.getLength() - (long)(nOldEnd-nOldStart);
pData->aRef = rNew;
- pData->nSelEnd = (xub_StrLen)(pData->nSelEnd + nDiff);
+ pData->nSelEnd = pData->nSelEnd + nDiff;
sal_uInt16 nCount = (sal_uInt16) pRangeFindList->Count();
for (sal_uInt16 i=nIndex+1; i<nCount; i++)
{
ScRangeFindData* pNext = pRangeFindList->GetObject( i );
- pNext->nSelStart = (xub_StrLen)(pNext->nSelStart + nDiff);
- pNext->nSelEnd = (xub_StrLen)(pNext->nSelEnd + nDiff);
+ pNext->nSelStart = pNext->nSelStart + nDiff;
+ pNext->nSelEnd = pNext->nSelEnd + nDiff;
}
}
else
@@ -395,7 +395,7 @@ static void lcl_RemoveLineEnd(OUString& rStr)
removeChars(rStr, '\n');
}
-static sal_Int32 lcl_MatchParenthesis( const OUString& rStr, xub_StrLen nPos )
+static sal_Int32 lcl_MatchParenthesis( const OUString& rStr, sal_Int32 nPos )
{
int nDir;
sal_Unicode c1, c2 = 0;
@@ -820,10 +820,10 @@ void ScInputHandler::ShowTipCursor()
{
if ( aFormula.getLength() < aSel.nEndPos )
return;
- xub_StrLen nPos = aSel.nEndPos;
+ sal_Int32 nPos = aSel.nEndPos;
OUString aSelText = aFormula.copy( 0, nPos );
sal_Int32 nNextFStart = 0;
- xub_StrLen nArgPos = 0;
+ sal_Int32 nArgPos = 0;
const IFunctionDescription* ppFDesc;
::std::vector< OUString> aArgs;
sal_uInt16 nArgs;
@@ -856,7 +856,7 @@ void ScInputHandler::ShowTipCursor()
sal_uInt16 nActive = 0;
for( sal_uInt16 i=0; i < nArgs; i++ )
{
- xub_StrLen nLength = static_cast<xub_StrLen>(aArgs[i].getLength());
+ sal_Int32 nLength = aArgs[i].getLength();
if( nArgPos <= aSelText.getLength()-1 )
{
nActive = i+1;
@@ -953,7 +953,7 @@ void ScInputHandler::ShowTipCursor()
}
else
{
- sal_uInt16 nPosition = 0;
+ sal_Int32 nPosition = 0;
OUString aText = pEngine->GetWord( 0, aSel.nEndPos-1 );
/* XXX: dubious, what is this condition supposed to exactly match? */
if (aSel.nEndPos <= aText.getLength() && aText[ aSel.nEndPos-1 ] == '=')
@@ -1055,11 +1055,11 @@ void ScInputHandler::UseFormulaData()
if ( aSel.nEndPos > 0 )
{
- xub_StrLen nPos = aSel.nEndPos;
+ sal_Int32 nPos = aSel.nEndPos;
OUString aFormula = aTotal.copy( 0, nPos );;
sal_Int32 nLeftParentPos = 0;
sal_Int32 nNextFStart = 0;
- xub_StrLen nArgPos = 0;
+ sal_Int32 nArgPos = 0;
const IFunctionDescription* ppFDesc;
::std::vector< OUString> aArgs;
sal_uInt16 nArgs;
@@ -1107,7 +1107,7 @@ void ScInputHandler::UseFormulaData()
sal_uInt16 nActive = 0;
for( sal_uInt16 i=0; i < nArgs; i++ )
{
- xub_StrLen nLength = static_cast<xub_StrLen>(aArgs[i].getLength());
+ sal_Int32 nLength = aArgs[i].getLength();
if( nArgPos <= aFormula.getLength()-1 )
{
nActive = i+1;
@@ -1237,7 +1237,7 @@ static void lcl_CompleteFunction( EditView* pView, const OUString& rInsert, bool
pView->SelectCurrentWord();
OUString aInsStr = rInsert;
- xub_StrLen nInsLen = aInsStr.getLength();
+ sal_Int32 nInsLen = aInsStr.getLength();
bool bDoParen = ( nInsLen > 1 && aInsStr[nInsLen-2] == '('
&& aInsStr[nInsLen-1] == ')' );
if ( bDoParen )
@@ -1409,7 +1409,7 @@ void ScInputHandler::PasteManualTip()
if (!pActiveView->HasSelection())
{
// nichts selektiert -> alles selektieren
- xub_StrLen nOldLen = pEngine->GetTextLen(0);
+ sal_Int32 nOldLen = pEngine->GetTextLen(0);
ESelection aAllSel( 0, 0, 0, nOldLen );
if ( pTopView )
pTopView->SetSelection( aAllSel );
@@ -1427,7 +1427,7 @@ void ScInputHandler::PasteManualTip()
// alles selektiert -> Anfuehrungszeichen weglassen
if ( aInsert[0] == '"' )
aInsert = aInsert.copy(1);
- xub_StrLen nInsLen = aInsert.getLength();
+ sal_Int32 nInsLen = aInsert.getLength();
if ( aInsert.endsWith("\"") )
aInsert = aInsert.copy( 0, nInsLen-1 );
}
@@ -1473,7 +1473,7 @@ bool ScInputHandler::CursorAtClosingPar()
if ( pActiveView && !pActiveView->HasSelection() && bFormulaMode )
{
ESelection aSel = pActiveView->GetSelection();
- xub_StrLen nPos = aSel.nStartPos;
+ sal_Int32 nPos = aSel.nStartPos;
OUString aFormula = pEngine->GetText(0);
if ( nPos < aFormula.getLength() && aFormula[nPos] == ')' )
return true;
@@ -1545,7 +1545,7 @@ void ScInputHandler::UseColData() // beim Tippen
sal_Int32 nParCnt = pEngine->GetParagraphCount();
if ( aSel.nEndPara+1 == nParCnt )
{
- xub_StrLen nParLen = pEngine->GetTextLen( aSel.nEndPara );
+ sal_Int32 nParLen = pEngine->GetTextLen( aSel.nEndPara );
if ( aSel.nEndPos == nParLen )
{
OUString aText = GetEditText(pEngine);
@@ -1621,8 +1621,8 @@ void ScInputHandler::NextAutoEntry( bool bBack )
if ( aSel.nEndPara+1 == nParCnt && aSel.nStartPara == aSel.nEndPara )
{
OUString aText = GetEditText(pEngine);
- xub_StrLen nSelLen = aSel.nEndPos - aSel.nStartPos;
- xub_StrLen nParLen = pEngine->GetTextLen( aSel.nEndPara );
+ sal_Int32 nSelLen = aSel.nEndPos - aSel.nStartPos;
+ sal_Int32 nParLen = pEngine->GetTextLen( aSel.nEndPara );
if ( aSel.nEndPos == nParLen && aText.getLength() == aAutoSearch.getLength() + nSelLen )
{
OUString aNew;
@@ -1689,7 +1689,7 @@ void ScInputHandler::UpdateParenthesis()
{
// Das Zeichen links vom Cursor wird angeschaut
- xub_StrLen nPos = aSel.nStartPos - 1;
+ sal_Int32 nPos = aSel.nStartPos - 1;
OUString aFormula = pEngine->GetText(0);
sal_Unicode c = aFormula[nPos];
if ( c == '(' || c == ')' )
@@ -2093,7 +2093,7 @@ static void lcl_SetTopSelection( EditView* pEditView, ESelection& rSel )
sal_Int32 nCount = pEngine->GetParagraphCount();
if (nCount > 1)
{
- xub_StrLen nParLen = pEngine->GetTextLen(rSel.nStartPara);
+ sal_Int32 nParLen = pEngine->GetTextLen(rSel.nStartPara);
while (rSel.nStartPos > nParLen && rSel.nStartPara+1 < nCount)
{
rSel.nStartPos -= nParLen + 1; // incl. Leerzeichen vom Umbruch
@@ -3794,7 +3794,7 @@ bool ScInputHandler::GetTextAndFields( ScEditEngineDefaulter& rDestEngine )
while ( nParCnt > 1 )
{
- xub_StrLen nLen = rDestEngine.GetTextLen( 0 );
+ sal_Int32 nLen = rDestEngine.GetTextLen( 0 );
ESelection aSel( 0,nLen, 1,0 );
rDestEngine.QuickInsertText( OUString(' '), aSel ); // Umbruch durch Space ersetzen
--nParCnt;
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 3bc555c6122d..b823146aba71 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -483,7 +483,7 @@ void ScInputWindow::Select()
//! SetSelection am InputHandler ???
//! bSelIsRef setzen ???
const sal_Int32 nOpen = aFormula.indexOf('(');
- const xub_StrLen nLen = aFormula.getLength();
+ const sal_Int32 nLen = aFormula.getLength();
if ( nOpen != -1 && nLen > nOpen )
{
sal_uInt8 nAdd(1);
@@ -758,7 +758,7 @@ void ScInputWindow::SwitchToTextWin()
if (pView)
{
sal_Int32 nPara = pView->GetEditEngine()->GetParagraphCount() ? ( pView->GetEditEngine()->GetParagraphCount() - 1 ) : 0;
- xub_StrLen nLen = pView->GetEditEngine()->GetTextLen( nPara );
+ sal_Int32 nLen = pView->GetEditEngine()->GetTextLen( nPara );
ESelection aSel( nPara, nLen, nPara, nLen );
pView->SetSelection( aSel ); // set cursor to end of text
}
diff --git a/sc/source/ui/dbgui/scuiimoptdlg.cxx b/sc/source/ui/dbgui/scuiimoptdlg.cxx
index 1fba5ba2fb26..dbb4205bef19 100644
--- a/sc/source/ui/dbgui/scuiimoptdlg.cxx
+++ b/sc/source/ui/dbgui/scuiimoptdlg.cxx
@@ -53,8 +53,8 @@ public:
private:
const OUString theDelTab;
const sal_Unicode cSep;
- const xub_StrLen nCount;
- xub_StrLen nIter;
+ const sal_Int32 nCount;
+ sal_Int32 nIter;
};
//------------------------------------------------------------------------
@@ -65,7 +65,7 @@ sal_uInt16 ScDelimiterTable::GetCode( const OUString& rDel ) const
if ( nCount >= 2 )
{
- xub_StrLen i = 0;
+ sal_Int32 i = 0;
while ( i<nCount )
{
if ( rDel == theDelTab.getToken( i, cSep ) )
@@ -89,7 +89,7 @@ OUString ScDelimiterTable::GetDelimiter( sal_Unicode nCode ) const
if ( nCount >= 2 )
{
- xub_StrLen i = 0;
+ sal_Int32 i = 0;
while ( i<nCount )
{
if ( nCode == (sal_Unicode) theDelTab.getToken( i+1, cSep ).toInt32() )
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index c2bf54e1bd89..c3def988b08b 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -280,7 +280,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
SCROW nHeight = 0;
sal_Int32 nTokenCnt = comphelper::string::getTokenCount(aTempArea, ';');
sal_Int32 nStringIx = 0;
- xub_StrLen nToken;
+ sal_Int32 nToken;
for( nToken = 0; nToken < nTokenCnt; nToken++ )
{
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 5c4e7285927a..101332d1807a 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -323,7 +323,7 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet)
if( *pNameBuffer == SC_COMPILER_FILE_TAB_SEP ) // after the last quote of the docname should be the # char
{
- xub_StrLen nIndex = nNameLength - nLinkTabNameLength;
+ sal_Int32 nIndex = nNameLength - nLinkTabNameLength;
INetURLObject aINetURLObject(aDocURLBuffer.makeStringAndClear());
if(aName == aLinkTabName.copy(nIndex, nLinkTabNameLength) &&
(aName[nIndex - 1] == '#') && // before the table name should be the # char
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index f8585b4179f9..0e97eda57cd4 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -656,7 +656,7 @@ void lcl_GetColumnTypes(
}
else if ( nDbType == sdbc::DataType::DECIMAL )
{ // maximale Feldbreite und Nachkommastellen bestimmen
- xub_StrLen nLen;
+ sal_Int32 nLen;
sal_uInt16 nPrec;
nLen = pDoc->GetMaxNumberStringLen( nPrec, nTab, nCol,
nFirstDataRow, nLastRow );
@@ -668,7 +668,7 @@ void lcl_GetColumnTypes(
if ( bPrecDefined && nPrecision != nPrec )
{ // Laenge auf vorgegebene Nachkommastellen anpassen
if ( nPrecision )
- nLen = sal::static_int_cast<xub_StrLen>( nLen + ( nPrecision - nPrec ) );
+ nLen = nLen + ( nPrecision - nPrec );
else
nLen -= nPrec+1; // auch den . mit raus
}
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index d6ce4f3058d3..737ec547d6a4 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -23,7 +23,6 @@
#include <i18nlangtag/languagetag.hxx>
#include <sot/formats.hxx>
#include <sfx2/mieclip.hxx>
-#include <tools/string.hxx>
#include <com/sun/star/i18n/CalendarFieldIndex.hpp>
#include "global.hxx"
@@ -62,7 +61,7 @@
// times maximum cell content length, 2*1024*64K=128M, and because it's
// sal_Unicode that's 256MB. If it's 2GB of data without LF we're out of luck
// anyway.
-static const sal_Int32 nArbitraryLineLengthLimit = 2 * MAXCOLCOUNT * STRING_MAXLEN;
+static const sal_Int32 nArbitraryLineLengthLimit = 2 * MAXCOLCOUNT * 65536;
namespace
{
@@ -354,7 +353,7 @@ bool ScImportExport::ExportByteString( OString& rText, rtl_TextEncoding eEnc, sa
eEnc = osl_getThreadTextEncoding();
if (!nSizeLimit)
- nSizeLimit = STRING_MAXLEN;
+ nSizeLimit = SAL_MAX_UINT16;
SvMemoryStream aStrm;
aStrm.SetStreamCharSet( eEnc );
@@ -365,7 +364,7 @@ bool ScImportExport::ExportByteString( OString& rText, rtl_TextEncoding eEnc, sa
aStrm.WriteChar( (sal_Char) 0 );
aStrm.Seek( STREAM_SEEK_TO_END );
// Sicherheits-Check:
- if( aStrm.Tell() <= (sal_uLong) STRING_MAXLEN )
+ if( aStrm.Tell() <= nSizeLimit )
{
rText = (const sal_Char*) aStrm.GetData();
return true;
@@ -623,15 +622,15 @@ static QuoteType lcl_isEscapedOrFieldEndQuote( sal_Int32 nQuotes, const sal_Unic
*/
static bool lcl_appendLineData( OUString& rField, const sal_Unicode* p1, const sal_Unicode* p2 )
{
- OSL_ENSURE( rField.getLength() + (p2 - p1) <= STRING_MAXLEN, "lcl_appendLineData: data overflow");
- if (rField.getLength() + (p2 - p1) <= STRING_MAXLEN)
+ OSL_ENSURE( rField.getLength() + (p2 - p1) <= SAL_MAX_UINT16, "lcl_appendLineData: data overflow");
+ if (rField.getLength() + (p2 - p1) <= SAL_MAX_UINT16)
{
rField += OUString( p1, sal::static_int_cast<sal_Int32>( p2 - p1 ) );
return true;
}
else
{
- rField += OUString( p1, STRING_MAXLEN - rField.getLength() );
+ rField += OUString( p1, SAL_MAX_UINT16 - rField.getLength() );
return false;
}
}
@@ -1247,26 +1246,26 @@ static OUString lcl_GetFixed( const OUString& rLine, sal_Int32 nStart, sal_Int32
rbIsQuoted = (pStr[nStart] == '"' && pStr[nSpace-1] == '"');
if (rbIsQuoted)
{
- bool bFits = (nSpace - nStart - 3 <= STRING_MAXLEN);
+ bool bFits = (nSpace - nStart - 3 <= SAL_MAX_UINT16);
OSL_ENSURE( bFits, "lcl_GetFixed: line doesn't fit into data");
if (bFits)
return rLine.copy(nStart+1, nSpace-nStart-2);
else
{
rbOverflowCell = true;
- return rLine.copy(nStart+1, STRING_MAXLEN);
+ return rLine.copy(nStart+1, SAL_MAX_UINT16);
}
}
else
{
- bool bFits = (nSpace - nStart <= STRING_MAXLEN);
+ bool bFits = (nSpace - nStart <= SAL_MAX_UINT16);
OSL_ENSURE( bFits, "lcl_GetFixed: line doesn't fit into data");
if (bFits)
return rLine.copy(nStart, nSpace-nStart);
else
{
rbOverflowCell = true;
- return rLine.copy(nStart, STRING_MAXLEN);
+ return rLine.copy(nStart, SAL_MAX_UINT16);
}
}
}
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 6d6206ecb916..627182442f4f 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -601,7 +601,7 @@ static void lcl_RemoveFields( OutlinerView& rOutView )
ESelection aOldSel = rOutView.GetSelection();
ESelection aSel = aOldSel;
aSel.Adjust();
- xub_StrLen nNewEnd = aSel.nEndPos;
+ sal_Int32 nNewEnd = aSel.nEndPos;
sal_Bool bUpdate = pOutliner->GetUpdateMode();
sal_Bool bChanged = false;
@@ -613,15 +613,14 @@ static void lcl_RemoveFields( OutlinerView& rOutView )
for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
if ( nPar >= aSel.nStartPara && nPar <= aSel.nEndPara )
{
- std::vector<sal_uInt16> aPortions;
+ std::vector<sal_Int32> aPortions;
rEditEng.GetPortions( nPar, aPortions );
- //! GetPortions should use xub_StrLen instead of USHORT
for ( size_t nPos = aPortions.size(); nPos; )
{
--nPos;
- sal_uInt16 nEnd = aPortions[ nPos ];
- sal_uInt16 nStart = nPos ? aPortions[ nPos - 1 ] : 0;
+ sal_Int32 nEnd = aPortions[ nPos ];
+ sal_Int32 nStart = nPos ? aPortions[ nPos - 1 ] : 0;
// fields are single characters
if ( nEnd == nStart+1 &&
( nPar > aSel.nStartPara || nStart >= aSel.nStartPos ) &&
@@ -644,7 +643,7 @@ static void lcl_RemoveFields( OutlinerView& rOutView )
pOutliner->QuickInsertText( aFieldText, aFieldSel );
if ( nPar == aSel.nEndPara )
{
- nNewEnd = sal::static_int_cast<xub_StrLen>( nNewEnd + aFieldText.getLength() );
+ nNewEnd = nNewEnd + aFieldText.getLength();
--nNewEnd;
}
}
diff --git a/sc/source/ui/inc/csvcontrol.hxx b/sc/source/ui/inc/csvcontrol.hxx
index bbea8e1386a7..6898bd2252ad 100644
--- a/sc/source/ui/inc/csvcontrol.hxx
+++ b/sc/source/ui/inc/csvcontrol.hxx
@@ -41,7 +41,7 @@ namespace com { namespace sun { namespace star { namespace accessibility {
/** Minimum character count for a column in separators mode. */
const sal_Int32 CSV_MINCOLWIDTH = 8;
/** Maximum length of a cell string. */
-const xub_StrLen CSV_MAXSTRLEN = 0x7FFF;
+const sal_Int32 CSV_MAXSTRLEN = 0x7FFF;
/** Transparency for header color of selected columns. */
const sal_uInt16 CSV_HDR_TRANSPARENCY = 85;
/** Minimum distance to border for auto scroll. */
@@ -78,7 +78,7 @@ struct ScCsvExpData
sal_uInt8 mnType; /// External type of the column.
inline ScCsvExpData() : mnIndex( 0 ), mnType( SC_COL_STANDARD ) {}
- inline ScCsvExpData( xub_StrLen nIndex, sal_uInt8 nType ) :
+ inline ScCsvExpData( sal_Int32 nIndex, sal_uInt8 nType ) :
mnIndex( nIndex ), mnType( nType ) {}
};
diff --git a/sc/source/ui/inc/rfindlst.hxx b/sc/source/ui/inc/rfindlst.hxx
index ba20555699e1..090ea65603c7 100644
--- a/sc/source/ui/inc/rfindlst.hxx
+++ b/sc/source/ui/inc/rfindlst.hxx
@@ -30,10 +30,10 @@ struct ScRangeFindData
{
ScRange aRef;
sal_uInt16 nFlags;
- xub_StrLen nSelStart;
- xub_StrLen nSelEnd;
+ sal_Int32 nSelStart;
+ sal_Int32 nSelEnd;
- ScRangeFindData( const ScRange& rR, sal_uInt16 nF, xub_StrLen nS, xub_StrLen nE ) :
+ ScRangeFindData( const ScRange& rR, sal_uInt16 nF, sal_Int32 nS, sal_Int32 nE ) :
aRef(rR), nFlags(nF), nSelStart(nS), nSelEnd(nE) {}
};
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 4263a618d89d..b1e3e51e6bee 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -57,7 +57,7 @@
// maximum values for UI
#define SCNAV_MAXCOL (MAXCOLCOUNT)
// macro is sufficient since only used in ctor
-#define SCNAV_COLDIGITS (static_cast<xub_StrLen>( floor( log10( static_cast<double>(SCNAV_MAXCOL)))) + 1) // 1...256...18278
+#define SCNAV_COLDIGITS (static_cast<sal_Int32>( floor( log10( static_cast<double>(SCNAV_MAXCOL)))) + 1) // 1...256...18278
// precomputed constant because it is used in every change of spin button field
static const sal_Int32 SCNAV_COLLETTERS = ::ScColToAlpha(SCNAV_MAXCOL).getLength(); // A...IV...ZZZ
diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx
index 2a71c5d42668..ba6140272ac1 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -495,7 +495,7 @@ bool ScHFEditPage::IsPageEntry(EditEngine*pEngine, EditTextObject* pTextObj)
if(!pTextObj->IsFieldObject())
{
- std::vector<sal_uInt16> aPosList;
+ std::vector<sal_Int32> aPosList;
pEngine->GetPortions(0,aPosList);
if(aPosList.size() == 2)
{
@@ -601,7 +601,7 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling)
OUString aPageOfEntry(" " + m_pFtOf->GetText() + " ");
m_pWndCenter->GetEditEngine()->QuickInsertText(aPageOfEntry,ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
- aSel.nEndPos = sal::static_int_cast<xub_StrLen>( aSel.nEndPos + aPageOfEntry.getLength() );
+ aSel.nEndPos = aSel.nEndPos + aPageOfEntry.getLength();
m_pWndCenter->GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
pTextObj.reset(m_pWndCenter->GetEditEngine()->CreateTextObject());
m_pWndCenter->SetText(*pTextObj);
@@ -641,7 +641,7 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling)
OUString aPageEntry(", " + m_pFtPage->GetText() + " ");
m_pWndCenter->GetEditEngine()->QuickInsertText(aPageEntry, ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
aSel.nStartPos = aSel.nEndPos;
- aSel.nEndPos = sal::static_int_cast<xub_StrLen>( aSel.nEndPos + aPageEntry.getLength() );
+ aSel.nEndPos = aSel.nEndPos + aPageEntry.getLength();
m_pWndCenter->GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
pTextObj.reset(m_pWndCenter->GetEditEngine()->CreateTextObject());
m_pWndCenter->SetText(*pTextObj);
@@ -670,7 +670,7 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling)
OUString aCommaSpace(", ");
m_pWndCenter->GetEditEngine()->QuickInsertText(aCommaSpace,ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
- aSel.nEndPos = sal::static_int_cast<xub_StrLen>( aSel.nEndPos + aCommaSpace.getLength() );
+ aSel.nEndPos = aSel.nEndPos + aCommaSpace.getLength();
m_pWndCenter->GetEditEngine()->QuickInsertField( SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
pTextObj.reset(m_pWndCenter->GetEditEngine()->CreateTextObject());
m_pWndCenter->SetText(*pTextObj);
@@ -690,7 +690,7 @@ void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling)
++aSel.nEndPos;
OUString aCommaSpace(", ");
m_pWndCenter->GetEditEngine()->QuickInsertText(aCommaSpace,ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
- aSel.nEndPos = sal::static_int_cast<xub_StrLen>( aSel.nEndPos + aCommaSpace.getLength() );
+ aSel.nEndPos = aSel.nEndPos + aCommaSpace.getLength();
m_pWndCenter->GetEditEngine()->QuickInsertField( SvxFieldItem(SvxFileField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos));
pTextObj.reset(m_pWndCenter->GetEditEngine()->CreateTextObject());
m_pWndCenter->SetText(*pTextObj);
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx
index 6f77905e6a25..c10cc72a3625 100644
--- a/sc/source/ui/unoobj/fielduno.cxx
+++ b/sc/source/ui/unoobj/fielduno.cxx
@@ -173,23 +173,22 @@ class ScUnoEditEngine : public ScEditEngineDefaulter
sal_Int32 mnFieldType;
SvxFieldData* pFound; // lokale Kopie
sal_Int32 nFieldPar;
- xub_StrLen nFieldPos;
+ sal_Int32 nFieldPos;
sal_uInt16 nFieldIndex;
public:
ScUnoEditEngine(ScEditEngineDefaulter* pSource);
~ScUnoEditEngine();
- //! nPos should be xub_StrLen
- virtual OUString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos,
+ virtual OUString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos,
Color*& rTxtColor, Color*& rFldColor );
sal_uInt16 CountFields();
SvxFieldData* FindByIndex(sal_uInt16 nIndex);
- SvxFieldData* FindByPos(sal_Int32 nPar, xub_StrLen nPos, sal_Int32 nType);
+ SvxFieldData* FindByPos(sal_Int32 nPar, sal_Int32 nPos, sal_Int32 nType);
sal_Int32 GetFieldPar() const { return nFieldPar; }
- xub_StrLen GetFieldPos() const { return nFieldPos; }
+ sal_Int32 GetFieldPos() const { return nFieldPos; }
};
ScUnoEditEngine::ScUnoEditEngine(ScEditEngineDefaulter* pSource) :
@@ -213,7 +212,7 @@ ScUnoEditEngine::~ScUnoEditEngine()
}
OUString ScUnoEditEngine::CalcFieldValue( const SvxFieldItem& rField,
- sal_Int32 nPara, sal_uInt16 nPos, Color*& rTxtColor, Color*& rFldColor )
+ sal_Int32 nPara, sal_Int32 nPos, Color*& rTxtColor, Color*& rFldColor )
{
OUString aRet(EditEngine::CalcFieldValue( rField, nPara, nPos, rTxtColor, rFldColor ));
if (eMode != SC_UNO_COLLECT_NONE)
@@ -265,7 +264,7 @@ SvxFieldData* ScUnoEditEngine::FindByIndex(sal_uInt16 nIndex)
return pFound;
}
-SvxFieldData* ScUnoEditEngine::FindByPos(sal_Int32 nPar, xub_StrLen nPos, sal_Int32 nType)
+SvxFieldData* ScUnoEditEngine::FindByPos(sal_Int32 nPar, sal_Int32 nPos, sal_Int32 nType)
{
eMode = SC_UNO_COLLECT_FINDPOS;
nFieldPar = nPar;
@@ -343,7 +342,7 @@ uno::Reference<text::XTextField> ScCellFieldsObj::GetObjectByIndex_Impl(sal_Int3
return uno::Reference<text::XTextField>();
sal_Int32 nPar = aTempEngine.GetFieldPar();
- xub_StrLen nPos = aTempEngine.GetFieldPos();
+ sal_Int32 nPos = aTempEngine.GetFieldPos();
ESelection aSelection( nPar, nPos, nPar, nPos+1 ); // Feld ist 1 Zeichen
sal_Int32 eType = pData->GetClassId();
@@ -524,7 +523,7 @@ uno::Reference<text::XTextField> ScHeaderFieldsObj::GetObjectByIndex_Impl(sal_In
xTextRange = xTemp;
sal_Int32 nPar = aTempEngine.GetFieldPar();
- xub_StrLen nPos = aTempEngine.GetFieldPos();
+ sal_Int32 nPos = aTempEngine.GetFieldPos();
ESelection aSelection( nPar, nPos, nPar, nPos+1 ); // Field is 1 character
sal_Int32 eRealType = pData->GetClassId();
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 16398a2aeabb..67d18419cf8e 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -309,7 +309,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
sal_Int32 nPar = pEngine->GetParagraphCount();
if (nPar)
{
- xub_StrLen nLen = pEngine->GetTextLen(nPar-1);
+ sal_Int32 nLen = pEngine->GetTextLen(nPar-1);
pTableView->SetSelection(ESelection(0,0,nPar-1,nLen));
if (pTopView)
pTopView->SetSelection(ESelection(0,0,nPar-1,nLen));
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 8d55bb9a8e19..38b1e08ec6f8 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -2138,13 +2138,13 @@ static void lcl_ScaleFonts( EditEngine& rEngine, long nPercent )
sal_Int32 nParCount = rEngine.GetParagraphCount();
for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
{
- std::vector<sal_uInt16> aPortions;
+ std::vector<sal_Int32> aPortions;
rEngine.GetPortions( nPar, aPortions );
- sal_uInt16 nStart = 0;
- for ( std::vector<sal_uInt16>::const_iterator it(aPortions.begin()); it != aPortions.end(); ++it )
+ sal_Int32 nStart = 0;
+ for ( std::vector<sal_Int32>::const_iterator it(aPortions.begin()); it != aPortions.end(); ++it )
{
- sal_uInt16 nEnd = *it;
+ sal_Int32 nEnd = *it;
ESelection aSel( nPar, nStart, nPar, nEnd );
SfxItemSet aAttribs = rEngine.GetAttribs( aSel );
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 3269d1cb000b..eb7504d3f84c 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -737,7 +737,7 @@ void ScViewFunc::InsertBookmark( const OUString& rDescription, const OUString& r
sal_Int32 nPara = aEngine.GetParagraphCount();
if (nPara)
--nPara;
- xub_StrLen nTxtLen = aEngine.GetTextLen(nPara);
+ sal_Int32 nTxtLen = aEngine.GetTextLen(nPara);
ESelection aInsSel( nPara, nTxtLen, nPara, nTxtLen );
if ( bTryReplace && HasBookmarkAtCursor( NULL ) )