Kaydet (Commit) 878dcbee authored tarafından Caolán McNamara's avatar Caolán McNamara

more xub_Strlen->sal_Int32

Change-Id: I9bab4c8c0e5b62eace308b90a43800c21c9cba41
üst 838c8889
......@@ -230,9 +230,8 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F
nScriptType = xBI->getScriptType( rText, 0 );
if( i18n::ScriptType::WEAK == nScriptType )
{
sal_uInt16 nChg = 0;
nChg = (xub_StrLen)xBI->endOfScript( rText, nChg, nScriptType );
if( nChg < rText.getLength() )
sal_Int32 nChg = xBI->endOfScript( rText, nChg, nScriptType );
if (nChg < rText.getLength() && nChg >= 0)
nScriptType = xBI->getScriptType( rText, nChg );
else
nScriptType = i18n::ScriptType::LATIN;
......
......@@ -138,7 +138,7 @@ class FontPrevWin_Impl
Reference < XBreakIterator > xBreak;
std::vector<sal_uIntPtr> aTextWidth;
std::deque<xub_StrLen> aScriptChg;
std::deque<sal_Int32> aScriptChg;
std::vector<sal_uInt16> aScriptType;
SvxFont aCJKFont;
SvxFont aCTLFont;
......@@ -246,11 +246,11 @@ void FontPrevWin_Impl::CheckScript()
xBreak = BreakIterator::create(xContext);
}
sal_uInt16 nScript = xBreak->getScriptType( aText, 0 );
sal_uInt16 nChg = 0;
sal_Int32 nChg = 0;
if( com::sun::star::i18n::ScriptType::WEAK == nScript )
{
nChg = (xub_StrLen)xBreak->endOfScript( aText, nChg, nScript );
if( nChg < aText.getLength() )
nChg = xBreak->endOfScript( aText, nChg, nScript );
if (nChg < aText.getLength() && nChg >= 0)
nScript = xBreak->getScriptType( aText, nChg );
else
nScript = com::sun::star::i18n::ScriptType::LATIN;
......@@ -258,7 +258,7 @@ void FontPrevWin_Impl::CheckScript()
do
{
nChg = (xub_StrLen)xBreak->endOfScript( aText, nChg, nScript );
nChg = xBreak->endOfScript( aText, nChg, nScript );
if (nChg < aText.getLength() && nChg > 0 &&
(com::sun::star::i18n::ScriptType::WEAK ==
xBreak->getScriptType(aText, nChg - 1)))
......@@ -303,8 +303,8 @@ Size FontPrevWin_Impl::CalcTextSize( OutputDevice* pWin, OutputDevice* _pPrinter
{
sal_uInt16 nScript;
sal_uInt16 nIdx = 0;
xub_StrLen nStart = 0;
xub_StrLen nEnd;
sal_Int32 nStart = 0;
sal_Int32 nEnd;
size_t nCnt = aScriptChg.size();
if( nCnt )
{
......@@ -385,8 +385,8 @@ void FontPrevWin_Impl::DrawPrev( OutputDevice* pWin, Printer* _pPrinter,
Font aOldFont = _pPrinter->GetFont();
sal_uInt16 nScript;
sal_uInt16 nIdx = 0;
xub_StrLen nStart = 0;
xub_StrLen nEnd;
sal_Int32 nStart = 0;
sal_Int32 nEnd;
size_t nCnt = aScriptChg.size();
if( nCnt )
{
......
......@@ -1394,7 +1394,7 @@ IMPL_LINK( SvxSearchDialog, ModifyHdl_Impl, ComboBox *, pEd )
sal_Int32 nReplTxtLen = 0;
if (bAllowEmptySearch)
nReplTxtLen = m_pReplaceLB->GetText().getLength();
xub_StrLen nAttrTxtLen = 0;
sal_Int32 nAttrTxtLen = 0;
if ( !pImpl->bMultiLineEdit )
nAttrTxtLen = m_pSearchAttrText->GetText().getLength();
......
......@@ -72,8 +72,8 @@ namespace
{
basegfx::B2DVector maOffset;
OUString maText;
xub_StrLen mnTextStart;
xub_StrLen mnTextLength;
sal_Int32 mnTextStart;
sal_Int32 mnTextLength;
sal_Int32 mnParagraph;
SvxFont maFont;
::std::vector< double > maDblDXArray; // double DXArray, font size independent -> unit coordinate system
......@@ -122,15 +122,15 @@ namespace
}
const OUString& getText() const { return maText; }
xub_StrLen getTextStart() const { return mnTextStart; }
xub_StrLen getTextLength() const { return mnTextLength; }
sal_Int32 getTextStart() const { return mnTextStart; }
sal_Int32 getTextLength() const { return mnTextLength; }
sal_Int32 getParagraph() const { return mnParagraph; }
const SvxFont& getFont() const { return maFont; }
bool isRTL() const { return mbRTL; }
const ::std::vector< double >& getDoubleDXArray() const { return maDblDXArray; }
const ::com::sun::star::lang::Locale& getLocale() const { return maLocale; }
xub_StrLen getPortionIndex(xub_StrLen nIndex, xub_StrLen nLength) const
sal_Int32 getPortionIndex(sal_Int32 nIndex, sal_Int32 nLength) const
{
if(mbRTL)
{
......@@ -142,7 +142,7 @@ namespace
}
}
double getDisplayLength(xub_StrLen nIndex, xub_StrLen nLength) const
double getDisplayLength(sal_Int32 nIndex, sal_Int32 nLength) const
{
drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
double fRetval(0.0);
......@@ -233,14 +233,14 @@ namespace
return fRetval;
}
xub_StrLen getNextGlyphLen(const impPathTextPortion* pCandidate, xub_StrLen nPosition, const ::com::sun::star::lang::Locale& rFontLocale)
sal_Int32 getNextGlyphLen(const impPathTextPortion* pCandidate, sal_Int32 nPosition, const ::com::sun::star::lang::Locale& rFontLocale)
{
xub_StrLen nNextGlyphLen(1);
sal_Int32 nNextGlyphLen(1);
if(mxBreak.is())
{
sal_Int32 nDone(0L);
nNextGlyphLen = (xub_StrLen)mxBreak->nextCharacters(pCandidate->getText(), nPosition,
nNextGlyphLen = mxBreak->nextCharacters(pCandidate->getText(), nPosition,
rFontLocale, CharacterIteratorMode::SKIPCELL, 1, nDone) - nPosition;
}
......@@ -353,11 +353,11 @@ namespace
drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
aTextLayouter.setFont(pCandidate->getFont());
xub_StrLen nUsedTextLength(0);
sal_Int32 nUsedTextLength(0);
while(nUsedTextLength < pCandidate->getTextLength() && fPolyStart < fPolyEnd)
{
xub_StrLen nNextGlyphLen(getNextGlyphLen(pCandidate, pCandidate->getTextStart() + nUsedTextLength, pCandidate->getLocale()));
sal_Int32 nNextGlyphLen(getNextGlyphLen(pCandidate, pCandidate->getTextStart() + nUsedTextLength, pCandidate->getLocale()));
// prepare portion length. Takes RTL sections into account.
double fPortionLength(pCandidate->getDisplayLength(nUsedTextLength, nNextGlyphLen));
......@@ -479,7 +479,7 @@ namespace
if(!pCandidate->getText().isEmpty() && nNextGlyphLen)
{
const xub_StrLen nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen));
const sal_Int32 nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen));
::std::vector< double > aNewDXArray;
if(nNextGlyphLen > 1 && pCandidate->getDoubleDXArray().size())
......@@ -548,8 +548,8 @@ namespace
}
}
// consume from portion // no += here, xub_StrLen is sal_uInt16 and the compiler will generate a warning here
nUsedTextLength = nUsedTextLength + nNextGlyphLen;
// consume from portion
nUsedTextLength += nNextGlyphLen;
// consume from polygon
fPolyStart += fPortionLength;
......
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