diff options
-rw-r--r-- | cppcanvas/source/mtfrenderer/implrenderer.cxx | 1 | ||||
-rw-r--r-- | editeng/source/items/svxfont.cxx | 1 | ||||
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 1 | ||||
-rw-r--r-- | include/vcl/outdev.hxx | 12 | ||||
-rw-r--r-- | sc/source/ui/docshell/impex.cxx | 1 | ||||
-rw-r--r-- | slideshow/source/engine/shapes/gdimtftools.cxx | 1 | ||||
-rw-r--r-- | svx/source/accessibility/AccessibleTextHelper.cxx | 1 | ||||
-rw-r--r-- | sw/source/core/inc/scriptinfo.hxx | 64 | ||||
-rw-r--r-- | sw/source/core/text/itradj.cxx | 46 | ||||
-rw-r--r-- | sw/source/core/text/porlay.cxx | 127 | ||||
-rw-r--r-- | sw/source/core/text/porlay.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/text/portxt.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/txtnode/fntcache.cxx | 6 | ||||
-rw-r--r-- | vcl/inc/pch/precompiled_vcl.hxx | 1 | ||||
-rw-r--r-- | vcl/source/gdi/outdev3.cxx | 12 |
15 files changed, 144 insertions, 135 deletions
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index d44567cc5c57..8d92f519fd33 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -79,6 +79,7 @@ #include "mtftools.hxx" #include "outdevstate.hxx" #include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <tools/string.hxx> using namespace ::com::sun::star; diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx index cd379cf06202..b873c596d457 100644 --- a/editeng/source/items/svxfont.cxx +++ b/editeng/source/items/svxfont.cxx @@ -22,6 +22,7 @@ #include <vcl/print.hxx> #include <tools/gen.hxx> #include <tools/poly.hxx> +#include <tools/string.hxx> #include <unotools/charclass.hxx> #include <editeng/unolingu.hxx> #include <com/sun/star/i18n/KCharacterType.hpp> diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 7ec4f1d71867..5522d648db75 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -24,6 +24,7 @@ #include <vector> #include <osl/endian.h> #include <tools/solar.h> +#include <tools/string.hxx> #include <rtl/math.hxx> #include <comphelper/classids.hxx> diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 6fd0331644be..824af87fe58d 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -21,7 +21,6 @@ #define INCLUDED_VCL_OUTDEV_HXX #include <tools/gen.hxx> -#include <tools/string.hxx> #include <tools/solar.h> #include <vcl/dllapi.h> #include <tools/rc.hxx> @@ -1095,12 +1094,11 @@ public: // i60594 // validate kashida positions against the current font // returns count of invalid kashida positions - xub_StrLen ValidateKashidas ( const OUString& rTxt, - xub_StrLen nIdx, xub_StrLen nLen, - xub_StrLen nKashCount, // number of suggested kashida positions (in) - const xub_StrLen* pKashidaPos, // suggested kashida positions (in) - xub_StrLen* pKashidaPosDropped // invalid kashida positions (out) - ) const; + sal_Int32 ValidateKashidas(const OUString& rTxt, sal_Int32 nIdx, sal_Int32 nLen, + sal_Int32 nKashCount, // number of suggested kashida positions (in) + const sal_Int32* pKashidaPos, // suggested kashida positions (in) + sal_Int32* pKashidaPosDropped // invalid kashida positions (out) + ) const; sal_uInt16 GetBitCount() const; diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 93e4bfa327df..c6ebff140c34 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -23,6 +23,7 @@ #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" diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx index 9ea6336c3895..3988cfbe8f5e 100644 --- a/slideshow/source/engine/shapes/gdimtftools.cxx +++ b/slideshow/source/engine/shapes/gdimtftools.cxx @@ -21,6 +21,7 @@ // must be first #include <canvas/debug.hxx> #include <tools/diagnose_ex.h> +#include <tools/string.hxx> #include <gdimtftools.hxx> #include <com/sun/star/document/XExporter.hpp> diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index 8bbef5811351..6aa63bc2c6e3 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -47,6 +47,7 @@ #include <vcl/unohelp.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/viewsh.hxx> +#include <tools/string.hxx> //------------------------------------------------------------------------ // diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx index 090f6db4d99e..dc9d766f23dc 100644 --- a/sw/source/core/inc/scriptinfo.hxx +++ b/sw/source/core/inc/scriptinfo.hxx @@ -59,10 +59,10 @@ private: inline DirectionChangeInfo(xub_StrLen pos, sal_uInt8 typ) : position(pos), type(typ) {}; }; std::vector<DirectionChangeInfo> aDirectionChanges; - std::deque< xub_StrLen > aKashida; - std::deque< xub_StrLen > aKashidaInvalid; - std::deque< xub_StrLen > aNoKashidaLine; - std::deque< xub_StrLen > aNoKashidaLineEnd; + std::deque< sal_Int32 > aKashida; + std::deque< sal_Int32 > aKashidaInvalid; + std::deque< sal_Int32 > aNoKashidaLine; + std::deque< sal_Int32 > aNoKashidaLineEnd; std::deque< xub_StrLen > aHiddenChg; //! Records a single change in compression. struct CompressionChangeInfo @@ -78,11 +78,11 @@ private: void UpdateBidiInfo( const OUString& rTxt ); - sal_Bool IsKashidaValid ( xub_StrLen nKashPos ) const; - void MarkKashidaInvalid ( xub_StrLen nKashPos ); - void ClearKashidaInvalid ( xub_StrLen nKashPos ); - bool MarkOrClearKashidaInvalid( xub_StrLen nStt, xub_StrLen nLen, bool bMark, xub_StrLen nMarkCount ); - bool IsKashidaLine ( xub_StrLen nCharIdx ) const; + bool IsKashidaValid(sal_Int32 nKashPos) const; + void MarkKashidaInvalid(sal_Int32 nKashPos); + void ClearKashidaInvalid(sal_Int32 nKashPos); + bool MarkOrClearKashidaInvalid(sal_Int32 nStt, sal_Int32 nLen, bool bMark, sal_Int32 nMarkCount); + bool IsKashidaLine(sal_Int32 nCharIdx) const; public: enum CompType { KANA, SPECIAL_LEFT, SPECIAL_RIGHT, NONE }; @@ -110,8 +110,16 @@ public: inline xub_StrLen GetDirChg( const size_t nCnt ) const; inline sal_uInt8 GetDirType( const size_t nCnt ) const; - inline size_t CountKashida() const; - inline xub_StrLen GetKashida( const size_t nCnt ) const; + size_t CountKashida() const + { + return aKashida.size(); + } + + sal_Int32 GetKashida(const size_t nCnt) const + { + OSL_ENSURE( nCnt < aKashida.size(),"No Kashidas today!"); + return aKashida[nCnt]; + } inline size_t CountCompChg() const; inline xub_StrLen GetCompStart( const size_t nCnt ) const; @@ -233,24 +241,28 @@ public: The value which has to be added to a kashida opportunity. @return The number of kashida opportunities in the given range */ - sal_uInt16 KashidaJustify( sal_Int32* pKernArray, sal_Int32* pScrArray, - xub_StrLen nStt, xub_StrLen nLen, - long nSpaceAdd = 0) const; + sal_Int32 KashidaJustify( sal_Int32* pKernArray, sal_Int32* pScrArray, + sal_Int32 nStt, sal_Int32 nLen, long nSpaceAdd = 0) const; /** Clears array of kashidas marked as invalid */ - inline void ClearKashidaInvalid ( xub_StrLen nStt, xub_StrLen nLen ) { MarkOrClearKashidaInvalid( nStt, nLen, false, 0 ); } + void ClearKashidaInvalid(sal_Int32 nStt, sal_Int32 nLen) + { + MarkOrClearKashidaInvalid(nStt, nLen, false, 0); + } /** Marks nCnt kashida positions as invalid pKashidaPositions: array of char indices relative to the paragraph */ - bool MarkKashidasInvalid ( xub_StrLen nCnt, xub_StrLen* pKashidaPositions ); + bool MarkKashidasInvalid(sal_Int32 nCnt, sal_Int32* pKashidaPositions); /** Marks nCnt kashida positions as invalid in the given text range */ - inline bool MarkKashidasInvalid ( xub_StrLen nCnt, xub_StrLen nStt, xub_StrLen nLen ) - { return MarkOrClearKashidaInvalid( nStt, nLen, true, nCnt ); } + bool MarkKashidasInvalid(sal_Int32 nCnt, sal_Int32 nStt, sal_Int32 nLen) + { + return MarkOrClearKashidaInvalid(nStt, nLen, true, nCnt); + } /** retrieves kashida opportunities for a given text range. returns the number of kashida positions in the given text range @@ -258,9 +270,8 @@ public: pKashidaPositions: buffer to reveive the char indices of the kashida opportunties relative to the paragraph */ - sal_uInt16 GetKashidaPositions ( xub_StrLen nStt, xub_StrLen nLen, - xub_StrLen* pKashidaPosition ); - + sal_Int32 GetKashidaPositions(sal_Int32 nStt, sal_Int32 nLen, + sal_Int32* pKashidaPosition); @@ -268,13 +279,13 @@ public: nStt Start char index of the line referring to the paragraph. nLen Number of characters in the line */ - void SetNoKashidaLine ( xub_StrLen nStt, xub_StrLen nLen ); + void SetNoKashidaLine(sal_Int32 nStt, sal_Int32 nLen); /** Clear forced blank justification for a given line. nStt Start char index of the line referring to the paragraph. nLen Number of characters in the line */ - void ClearNoKashidaLine ( xub_StrLen nStt, xub_StrLen nLen ); + void ClearNoKashidaLine(sal_Int32 nStt, sal_Int32 nLen); /** Checks if text is Arabic text. @@ -345,13 +356,6 @@ inline sal_uInt8 SwScriptInfo::GetDirType( const size_t nCnt ) const return aDirectionChanges[ nCnt ].type; } -inline size_t SwScriptInfo::CountKashida() const { return aKashida.size(); } -inline xub_StrLen SwScriptInfo::GetKashida( const size_t nCnt ) const -{ - OSL_ENSURE( nCnt < aKashida.size(),"No Kashidas today!"); - return aKashida[ nCnt ]; -} - inline size_t SwScriptInfo::CountCompChg() const { return aCompressionChanges.size(); }; inline xub_StrLen SwScriptInfo::GetCompStart( const size_t nCnt ) const { diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx index 1fd18c3cabdd..7c9fb8571dd8 100644 --- a/sw/source/core/text/itradj.cxx +++ b/sw/source/core/text/itradj.cxx @@ -117,7 +117,7 @@ void SwTxtAdjuster::FormatBlock( ) * lcl_CheckKashidaPositions() *************************************************************************/ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTxtSizeInfo& rInf, SwTxtIter& rItr, - xub_StrLen& nKashidas, xub_StrLen& nGluePortion ) + sal_Int32& rKashidas, xub_StrLen& nGluePortion ) { // i60594 validate Kashida justification xub_StrLen nIdx = rItr.GetStart(); @@ -128,18 +128,18 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTxtSizeInfo& rInf, S // total number of kashida positions, or the number of kashida positions after some positions // have been dropped. // Here we want the clean total, which is OK: We have called ClearKashidaInvalid() before. - nKashidas = rSI.KashidaJustify ( 0, 0, rItr.GetStart(), rItr.GetLength(), 0 ); + rKashidas = rSI.KashidaJustify ( 0, 0, rItr.GetStart(), rItr.GetLength(), 0 ); - if (!nKashidas) // nothing to do + if (rKashidas <= 0) // nothing to do return true; // kashida positions found in SwScriptInfo are not necessarily valid in every font // if two characters are replaced by a ligature glyph, there will be no place for a kashida - xub_StrLen* pKashidaPos = new xub_StrLen [ nKashidas ]; - xub_StrLen* pKashidaPosDropped = new xub_StrLen [ nKashidas ]; + sal_Int32* pKashidaPos = new sal_Int32[ rKashidas ]; + sal_Int32* pKashidaPosDropped = new sal_Int32[ rKashidas ]; rSI.GetKashidaPositions ( nIdx, rItr.GetLength(), pKashidaPos ); - xub_StrLen nKashidaIdx = 0; - while ( nKashidas && nIdx < nEnd ) + sal_Int32 nKashidaIdx = 0; + while ( rKashidas && nIdx < nEnd ) { rItr.SeekAndChgAttrIter( nIdx, rInf.GetOut() ); xub_StrLen nNext = rItr.GetNextAttr(); @@ -152,8 +152,8 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTxtSizeInfo& rInf, S if ( nNext == STRING_LEN || nNext > nEnd ) nNext = nEnd; - xub_StrLen nKashidasInAttr = rSI.KashidaJustify ( 0, 0, nIdx, nNext - nIdx ); - if ( nKashidasInAttr ) + sal_Int32 nKashidasInAttr = rSI.KashidaJustify ( 0, 0, nIdx, nNext - nIdx ); + if (nKashidasInAttr > 0) { // Kashida glyph looks suspicious, skip Kashida justification if ( rInf.GetOut()->GetMinKashida() <= 0 ) @@ -163,11 +163,11 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTxtSizeInfo& rInf, S return false; } - xub_StrLen nKashidasDropped = 0; + sal_Int32 nKashidasDropped = 0; if ( !SwScriptInfo::IsArabicText( rInf.GetTxt(), nIdx, nNext - nIdx ) ) { nKashidasDropped = nKashidasInAttr; - nKashidas -= nKashidasDropped; + rKashidas -= nKashidasDropped; } else { @@ -179,8 +179,8 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTxtSizeInfo& rInf, S rInf.GetOut()->SetLayoutMode ( nOldLayout ); if ( nKashidasDropped ) { - rSI.MarkKashidasInvalid ( nKashidasDropped, pKashidaPosDropped ); - nKashidas -= nKashidasDropped; + rSI.MarkKashidasInvalid(nKashidasDropped, pKashidaPosDropped); + rKashidas -= nKashidasDropped; nGluePortion -= nKashidasDropped; } } @@ -192,20 +192,20 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTxtSizeInfo& rInf, S delete[] pKashidaPosDropped; // return false if all kashidas have been eliminated - return (nKashidas > 0); + return (rKashidas > 0); } /************************************************************************* * lcl_CheckKashidaWidth() *************************************************************************/ -static bool lcl_CheckKashidaWidth ( SwScriptInfo& rSI, SwTxtSizeInfo& rInf, SwTxtIter& rItr, xub_StrLen& nKashidas, +static bool lcl_CheckKashidaWidth ( SwScriptInfo& rSI, SwTxtSizeInfo& rInf, SwTxtIter& rItr, sal_Int32& rKashidas, xub_StrLen& nGluePortion, const long nGluePortionWidth, long& nSpaceAdd ) { // check kashida width // if width is smaller than minimal kashida width allowed by fonts in the current line // drop one kashida after the other until kashida width is OK bool bAddSpaceChanged; - while ( nKashidas ) + while (rKashidas) { bAddSpaceChanged = false; xub_StrLen nIdx = rItr.GetStart(); @@ -223,20 +223,20 @@ static bool lcl_CheckKashidaWidth ( SwScriptInfo& rSI, SwTxtSizeInfo& rInf, SwTx if ( nNext == STRING_LEN || nNext > nEnd ) nNext = nEnd; - xub_StrLen nKashidasInAttr = rSI.KashidaJustify ( 0, 0, nIdx, nNext - nIdx ); + sal_Int32 nKashidasInAttr = rSI.KashidaJustify ( 0, 0, nIdx, nNext - nIdx ); long nFontMinKashida = rInf.GetOut()->GetMinKashida(); - if ( nFontMinKashida && nKashidasInAttr && SwScriptInfo::IsArabicText( rInf.GetTxt(), nIdx, nNext - nIdx ) ) + if ( nFontMinKashida && nKashidasInAttr > 0 && SwScriptInfo::IsArabicText( rInf.GetTxt(), nIdx, nNext - nIdx ) ) { - xub_StrLen nKashidasDropped = 0; - while ( nKashidas && nGluePortion && nKashidasInAttr && + sal_Int32 nKashidasDropped = 0; + while ( rKashidas && nGluePortion && nKashidasInAttr > 0 && nSpaceAdd / SPACING_PRECISION_FACTOR < nFontMinKashida ) { --nGluePortion; - --nKashidas; + --rKashidas; --nKashidasInAttr; ++nKashidasDropped; - if( !nKashidas || !nGluePortion ) // nothing left, return false to + if( !rKashidas || !nGluePortion ) // nothing left, return false to return false; // do regular blank justification nSpaceAdd = nGluePortionWidth / nGluePortion; @@ -349,7 +349,7 @@ void SwTxtAdjuster::CalcNewBlock( SwLineLayout *pCurrent, const long nGluePortionWidth = static_cast<SwGluePortion*>(pPos)->GetPrtGlue() * SPACING_PRECISION_FACTOR; - xub_StrLen nKashidas = 0; + sal_Int32 nKashidas = 0; if( nGluePortion && rSI.CountKashida() && !bSkipKashida ) { // kashida positions found in SwScriptInfo are not necessarily valid in every font diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 4acd55198c10..8b234b10f6d1 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -1735,41 +1735,41 @@ long SwScriptInfo::Compress( sal_Int32* pKernArray, xub_StrLen nIdx, xub_StrLen // total number of kashida positions, or the number of kashida positions after some positions // have been dropped, depending on the state of the aKashidaInvalid array. -sal_uInt16 SwScriptInfo::KashidaJustify( sal_Int32* pKernArray, +sal_Int32 SwScriptInfo::KashidaJustify( sal_Int32* pKernArray, sal_Int32* pScrArray, - xub_StrLen nStt, - xub_StrLen nLen, + sal_Int32 nStt, + sal_Int32 nLen, long nSpaceAdd ) const { SAL_WARN_IF( !nLen, "sw.core", "Kashida justification without text?!" ); if( !IsKashidaLine(nStt)) - return STRING_LEN; + return -1; // evaluate kashida information in collected in SwScriptInfo - sal_uInt16 nCntKash = 0; + size_t nCntKash = 0; while( nCntKash < CountKashida() ) { if ( nStt <= GetKashida( nCntKash ) ) break; else - nCntKash++; + ++nCntKash; } - const xub_StrLen nEnd = nStt + nLen; + const sal_Int32 nEnd = nStt + nLen; - sal_uInt16 nCntKashEnd = nCntKash; + size_t nCntKashEnd = nCntKash; while ( nCntKashEnd < CountKashida() ) { if ( nEnd <= GetKashida( nCntKashEnd ) ) break; else - nCntKashEnd++; + ++nCntKashEnd; } - sal_uInt16 nActualKashCount = nCntKashEnd - nCntKash; - for ( sal_uInt16 i = nCntKash; i < nCntKashEnd; ++i ) + size_t nActualKashCount = nCntKashEnd - nCntKash; + for (size_t i = nCntKash; i < nCntKashEnd; ++i) { if ( nActualKashCount && !IsKashidaValid ( i ) ) --nActualKashCount; @@ -1785,13 +1785,13 @@ sal_uInt16 SwScriptInfo::KashidaJustify( sal_Int32* pKernArray, while ( ! IsKashidaValid ( nCntKash ) && nCntKash < nCntKashEnd ) ++nCntKash; - xub_StrLen nKashidaPos = GetKashida( nCntKash ); - xub_StrLen nIdx = nKashidaPos; + sal_Int32 nKashidaPos = GetKashida( nCntKash ); + sal_Int32 nIdx = nKashidaPos; long nKashAdd = nSpaceAdd; while ( nIdx < nEnd ) { - sal_uInt16 nArrayPos = nIdx - nStt; + sal_Int32 nArrayPos = nIdx - nStt; // next kashida position ++nCntKash; @@ -1802,7 +1802,7 @@ sal_uInt16 SwScriptInfo::KashidaJustify( sal_Int32* pKernArray, if ( nIdx > nEnd ) nIdx = nEnd; - const sal_uInt16 nArrayEnd = nIdx - nStt; + const sal_Int32 nArrayEnd = nIdx - nStt; while ( nArrayPos < nArrayEnd ) { @@ -1861,7 +1861,7 @@ bool SwScriptInfo::IsArabicText( const OUString& rTxt, sal_Int32 nStt, sal_Int32 return false; } -sal_Bool SwScriptInfo::IsKashidaValid ( xub_StrLen nKashPos ) const +bool SwScriptInfo::IsKashidaValid(sal_Int32 nKashPos) const { for ( size_t i = 0; i < aKashidaInvalid.size(); ++i ) { @@ -1871,7 +1871,7 @@ sal_Bool SwScriptInfo::IsKashidaValid ( xub_StrLen nKashPos ) const return true; } -void SwScriptInfo::ClearKashidaInvalid ( xub_StrLen nKashPos ) +void SwScriptInfo::ClearKashidaInvalid(sal_Int32 nKashPos) { for ( size_t i = 0; i < aKashidaInvalid.size(); ++i ) { @@ -1893,9 +1893,10 @@ void SwScriptInfo::ClearKashidaInvalid ( xub_StrLen nKashPos ) * clears all kashida invalid flags in the given text range *************************************************************************/ -bool SwScriptInfo::MarkOrClearKashidaInvalid ( xub_StrLen nStt, xub_StrLen nLen, bool bMark, xub_StrLen nMarkCount ) +bool SwScriptInfo::MarkOrClearKashidaInvalid(sal_Int32 nStt, sal_Int32 nLen, + bool bMark, sal_Int32 nMarkCount) { - sal_uInt16 nCntKash = 0; + size_t nCntKash = 0; while( nCntKash < CountKashida() ) { if ( nStt <= GetKashida( nCntKash ) ) @@ -1904,7 +1905,7 @@ bool SwScriptInfo::MarkOrClearKashidaInvalid ( xub_StrLen nStt, xub_StrLen nLen, nCntKash++; } - const xub_StrLen nEnd = nStt + nLen; + const sal_Int32 nEnd = nStt + nLen; while ( nCntKash < CountKashida() ) { @@ -1918,7 +1919,7 @@ bool SwScriptInfo::MarkOrClearKashidaInvalid ( xub_StrLen nStt, xub_StrLen nLen, { MarkKashidaInvalid ( nCntKash ); --nMarkCount; - if(!nMarkCount) + if (!nMarkCount) return true; } } @@ -1932,9 +1933,9 @@ bool SwScriptInfo::MarkOrClearKashidaInvalid ( xub_StrLen nStt, xub_StrLen nLen, return false; } -void SwScriptInfo::MarkKashidaInvalid ( xub_StrLen nKashPos ) +void SwScriptInfo::MarkKashidaInvalid(sal_Int32 nKashPos) { - aKashidaInvalid.push_back( nKashPos ); + aKashidaInvalid.push_back(nKashPos); } /************************************************************************* @@ -1942,10 +1943,10 @@ void SwScriptInfo::MarkKashidaInvalid ( xub_StrLen nKashPos ) * retrieve the kashida positions in the given text range *************************************************************************/ -sal_uInt16 SwScriptInfo::GetKashidaPositions ( xub_StrLen nStt, xub_StrLen nLen, - xub_StrLen* pKashidaPosition ) +sal_Int32 SwScriptInfo::GetKashidaPositions(sal_Int32 nStt, sal_Int32 nLen, + sal_Int32* pKashidaPosition) { - sal_uInt16 nCntKash = 0; + size_t nCntKash = 0; while( nCntKash < CountKashida() ) { if ( nStt <= GetKashida( nCntKash ) ) @@ -1954,9 +1955,9 @@ sal_uInt16 SwScriptInfo::GetKashidaPositions ( xub_StrLen nStt, xub_StrLen nLen, nCntKash++; } - const xub_StrLen nEnd = nStt + nLen; + const sal_Int32 nEnd = nStt + nLen; - sal_uInt16 nCntKashEnd = nCntKash; + size_t nCntKashEnd = nCntKash; while ( nCntKashEnd < CountKashida() ) { if ( nEnd <= GetKashida( nCntKashEnd ) ) @@ -1970,7 +1971,7 @@ sal_uInt16 SwScriptInfo::GetKashidaPositions ( xub_StrLen nStt, xub_StrLen nLen, return nCntKashEnd - nCntKash; } -void SwScriptInfo::SetNoKashidaLine ( xub_StrLen nStt, xub_StrLen nLen ) +void SwScriptInfo::SetNoKashidaLine(sal_Int32 nStt, sal_Int32 nLen) { aNoKashidaLine.push_back( nStt ); aNoKashidaLineEnd.push_back( nStt+nLen ); @@ -1981,29 +1982,29 @@ void SwScriptInfo::SetNoKashidaLine ( xub_StrLen nStt, xub_StrLen nLen ) * determines if the line uses kashida justification *************************************************************************/ -bool SwScriptInfo::IsKashidaLine ( xub_StrLen nCharIdx ) const +bool SwScriptInfo::IsKashidaLine(sal_Int32 nCharIdx) const { - for( size_t i = 0; i < aNoKashidaLine.size(); ++i ) + for (size_t i = 0; i < aNoKashidaLine.size(); ++i) { - if( nCharIdx >= aNoKashidaLine[ i ] && nCharIdx < aNoKashidaLineEnd[ i ]) - return false; + if (nCharIdx >= aNoKashidaLine[ i ] && nCharIdx < aNoKashidaLineEnd[ i ]) + return false; } - return true; + return true; } -void SwScriptInfo::ClearNoKashidaLine ( xub_StrLen nStt, xub_StrLen nLen ) +void SwScriptInfo::ClearNoKashidaLine(sal_Int32 nStt, sal_Int32 nLen) { - size_t i = 0; - while( i < aNoKashidaLine.size()) - { - if( nStt + nLen >= aNoKashidaLine[ i ] && nStt < aNoKashidaLineEnd [ i ] ) - { - aNoKashidaLine.erase(aNoKashidaLine.begin() + i); - aNoKashidaLineEnd.erase(aNoKashidaLineEnd.begin() + i); - } - else - ++i; - } + size_t i = 0; + while( i < aNoKashidaLine.size()) + { + if( nStt + nLen >= aNoKashidaLine[ i ] && nStt < aNoKashidaLineEnd [ i ] ) + { + aNoKashidaLine.erase(aNoKashidaLine.begin() + i); + aNoKashidaLineEnd.erase(aNoKashidaLineEnd.begin() + i); + } + else + ++i; + } } /************************************************************************* @@ -2012,30 +2013,30 @@ void SwScriptInfo::ClearNoKashidaLine ( xub_StrLen nStt, xub_StrLen nLen ) * mark the given character indices as invalid kashida positions ************************************************************************/ -bool SwScriptInfo::MarkKashidasInvalid ( xub_StrLen nCnt, xub_StrLen* pKashidaPositions ) +bool SwScriptInfo::MarkKashidasInvalid(sal_Int32 nCnt, sal_Int32* pKashidaPositions) { - SAL_WARN_IF( !pKashidaPositions || nCnt == 0, "sw.core", "Where are kashidas?" ); + SAL_WARN_IF( !pKashidaPositions || nCnt == 0, "sw.core", "Where are kashidas?" ); - sal_uInt16 nCntKash = 0; - xub_StrLen nKashidaPosIdx = 0; + size_t nCntKash = 0; + sal_Int32 nKashidaPosIdx = 0; - while ( nCntKash < CountKashida() && nKashidaPosIdx < nCnt ) + while (nCntKash < CountKashida() && nKashidaPosIdx < nCnt) { - if ( pKashidaPositions [nKashidaPosIdx] > GetKashida( nCntKash ) ) - { - nCntKash++; - continue; - } + if ( pKashidaPositions [nKashidaPosIdx] > GetKashida( nCntKash ) ) + { + ++nCntKash; + continue; + } if ( pKashidaPositions [nKashidaPosIdx] == GetKashida( nCntKash ) && IsKashidaValid ( nCntKash ) ) - { + { MarkKashidaInvalid ( nCntKash ); - } - else - return false; // something is wrong - nKashidaPosIdx++; - } - return true; + } + else + return false; // something is wrong + nKashidaPosIdx++; + } + return true; } sal_Int32 SwScriptInfo::ThaiJustify( const OUString& rTxt, sal_Int32* pKernArray, diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx index ccfa12d7cb81..869cb5468b9d 100644 --- a/sw/source/core/text/porlay.hxx +++ b/sw/source/core/text/porlay.hxx @@ -20,6 +20,7 @@ #define INCLUDED_SW_SOURCE_CORE_TEXT_PORLAY_HXX #include <tools/fract.hxx> +#include <tools/string.hxx> #include <scriptinfo.hxx> #include "swrect.hxx" diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index 815ea8f96271..0d9d85143fd1 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -118,10 +118,10 @@ static sal_Int32 lcl_AddSpace( const SwTxtSizeInfo &rInf, const OUString* pStr, { if ( SwScriptInfo::IsArabicText( *pStr, nPos, nEnd - nPos ) && pSI->CountKashida() ) { - const sal_uInt16 nKashRes = pSI->KashidaJustify( 0, 0, nPos, nEnd - nPos ); + const sal_Int32 nKashRes = pSI->KashidaJustify( 0, 0, nPos, nEnd - nPos ); // i60591: need to check result of KashidaJustify // determine if kashida justification is applicable - if( nKashRes != STRING_LEN ) + if (nKashRes != -1) return nKashRes; } } diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index bc71e1344a25..9cb6ba4cde00 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -1312,7 +1312,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) { if ( pSI && pSI->CountKashida() && pSI->KashidaJustify( pKernArray, 0, rInf.GetIdx(), - rInf.GetLen(), nSpaceAdd ) != STRING_LEN ) + rInf.GetLen(), nSpaceAdd ) != -1 ) { bSpecialJust = true; nSpaceAdd = 0; @@ -1523,7 +1523,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) { if ( pSI && pSI->CountKashida() && pSI->KashidaJustify( pKernArray, pScrArray, rInf.GetIdx(), - rInf.GetLen(), nSpaceAdd ) != STRING_LEN ) + rInf.GetLen(), nSpaceAdd ) != -1 ) nSpaceAdd = 0; else bNoHalfSpace = true; @@ -2083,7 +2083,7 @@ xub_StrLen SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf ) { if ( pSI && pSI->CountKashida() && pSI->KashidaJustify( pKernArray, 0, rInf.GetIdx(), rInf.GetLen(), - nSpaceAdd ) != STRING_LEN ) + nSpaceAdd ) != -1 ) nSpaceAdd = 0; } } diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx index 263a40a67032..0c33fb5e51ef 100644 --- a/vcl/inc/pch/precompiled_vcl.hxx +++ b/vcl/inc/pch/precompiled_vcl.hxx @@ -370,7 +370,6 @@ #include <tools/rtti.hxx> #include <tools/solar.h> #include <tools/stream.hxx> -#include <tools/string.hxx> #include <tools/tenccvt.hxx> #include <tools/time.hxx> #include <tools/tools.h> diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 0509349f076d..f1d4b4955e7d 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -7155,17 +7155,17 @@ long OutputDevice::GetMinKashida() const return ImplDevicePixelToLogicWidth( pMetric->mnMinKashida ); } -xub_StrLen OutputDevice::ValidateKashidas ( const OUString& rTxt, - xub_StrLen nIdx, xub_StrLen nLen, - xub_StrLen nKashCount, - const xub_StrLen* pKashidaPos, - xub_StrLen* pKashidaPosDropped ) const +sal_Int32 OutputDevice::ValidateKashidas ( const OUString& rTxt, + sal_Int32 nIdx, sal_Int32 nLen, + sal_Int32 nKashCount, + const sal_Int32* pKashidaPos, + sal_Int32* pKashidaPosDropped ) const { // do layout SalLayout* pSalLayout = ImplLayout( rTxt, nIdx, nLen ); if( !pSalLayout ) return 0; - xub_StrLen nDropped = 0; + sal_Int32 nDropped = 0; for( int i = 0; i < nKashCount; ++i ) { if( !pSalLayout->IsKashidaPosValid( pKashidaPos[ i ] )) |