diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-01-15 15:14:25 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-01-15 15:36:23 +0000 |
commit | 878dcbee6488f2a3dfbc1f86abc8857cf6608d20 (patch) | |
tree | 8a55581e7cb73f7eb31edc835bacdb13855cdfa2 | |
parent | 838c8889491b7e5b08f681b7f85740784c0c1a3b (diff) |
more xub_Strlen->sal_Int32
Change-Id: I9bab4c8c0e5b62eace308b90a43800c21c9cba41
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 5 | ||||
-rw-r--r-- | svx/source/dialog/fntctrl.cxx | 18 | ||||
-rw-r--r-- | svx/source/dialog/srchdlg.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdotextpathdecomposition.cxx | 28 |
4 files changed, 27 insertions, 28 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index e7a67faa93ef..9f131f1fea14 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -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; diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index 55eac726544d..cf0a96974fc3 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -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 ) { diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index e5df140ff1f5..07a07b681ef1 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -1394,10 +1394,10 @@ 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(); + nAttrTxtLen = m_pSearchAttrText->GetText().getLength(); else nAttrTxtLen = pImpl->m_pSearchFormats->GetText().getLength(); diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx index a849d17f44fa..fbbbba71744d 100644 --- a/svx/source/svdraw/svdotextpathdecomposition.cxx +++ b/svx/source/svdraw/svdotextpathdecomposition.cxx @@ -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; |