Kaydet (Commit) 93c2f81e authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide: static functions of SwScriptInfo

Some of these are only called with TextFrameIndex, so just convert the
parameter types to that for simplicity.

Change-Id: I73d418bd42ec95b15548b3df44736de0092ad87d
üst 70c9d2fc
...@@ -332,7 +332,7 @@ public: ...@@ -332,7 +332,7 @@ public:
Start index of the text Start index of the text
@return Returns if the language is an Arabic language @return Returns if the language is an Arabic language
*/ */
static bool IsArabicText( const OUString& rText, sal_Int32 nStt, sal_Int32 nLen ); static bool IsArabicText(const OUString& rText, TextFrameIndex nStt, TextFrameIndex nLen);
/** Performs a thai justification on the kerning array /** Performs a thai justification on the kerning array
...@@ -352,16 +352,18 @@ public: ...@@ -352,16 +352,18 @@ public:
The value which has to be added to the cells. The value which has to be added to the cells.
@return The number of extra spaces in the given range @return The number of extra spaces in the given range
*/ */
static sal_Int32 ThaiJustify( const OUString& rText, long* pKernArray, static TextFrameIndex ThaiJustify( const OUString& rText, long* pKernArray,
long* pScrArray, sal_Int32 nIdx, long* pScrArray, TextFrameIndex nIdx,
sal_Int32 nLen, sal_Int32 nNumberOfBlanks = 0, TextFrameIndex nLen,
TextFrameIndex nNumberOfBlanks = TextFrameIndex(0),
long nSpaceAdd = 0 ); long nSpaceAdd = 0 );
static sal_Int32 CountCJKCharacters( const OUString &rText, sal_Int32 nPos, sal_Int32 nEnd, LanguageType aLang); static TextFrameIndex CountCJKCharacters(const OUString &rText,
TextFrameIndex nPos, TextFrameIndex nEnd, LanguageType aLang);
static void CJKJustify( const OUString& rText, long* pKernArray, static void CJKJustify( const OUString& rText, long* pKernArray,
long* pScrArray, sal_Int32 nStt, long* pScrArray, TextFrameIndex nStt,
sal_Int32 nLen, LanguageType aLang, TextFrameIndex nLen, LanguageType aLang,
long nSpaceAdd, bool bIsSpaceStop ); long nSpaceAdd, bool bIsSpaceStop );
static SwScriptInfo* GetScriptInfo( const SwTextNode& rNode, static SwScriptInfo* GetScriptInfo( const SwTextNode& rNode,
......
...@@ -1803,7 +1803,8 @@ sal_Int32 SwScriptInfo::KashidaJustify( long* pKernArray, ...@@ -1803,7 +1803,8 @@ sal_Int32 SwScriptInfo::KashidaJustify( long* pKernArray,
// Checks if the current text is 'Arabic' text. Note that only the first // Checks if the current text is 'Arabic' text. Note that only the first
// character has to be checked because a ctl portion only contains one // character has to be checked because a ctl portion only contains one
// script, see NewTextPortion // script, see NewTextPortion
bool SwScriptInfo::IsArabicText( const OUString& rText, sal_Int32 nStt, sal_Int32 nLen ) bool SwScriptInfo::IsArabicText(const OUString& rText,
TextFrameIndex const nStt, TextFrameIndex const nLen)
{ {
using namespace ::com::sun::star::i18n; using namespace ::com::sun::star::i18n;
static const ScriptTypeList typeList[] = { static const ScriptTypeList typeList[] = {
...@@ -1989,9 +1990,10 @@ void SwScriptInfo::MarkKashidasInvalid(sal_Int32 const nCnt, ...@@ -1989,9 +1990,10 @@ void SwScriptInfo::MarkKashidasInvalid(sal_Int32 const nCnt,
} }
} }
sal_Int32 SwScriptInfo::ThaiJustify( const OUString& rText, long* pKernArray, TextFrameIndex SwScriptInfo::ThaiJustify( const OUString& rText, long* pKernArray,
long* pScrArray, sal_Int32 nStt, long* pScrArray, TextFrameIndex const nStt,
sal_Int32 nLen, sal_Int32 nNumberOfBlanks, TextFrameIndex const nLen,
TextFrameIndex nNumberOfBlanks,
long nSpaceAdd ) long nSpaceAdd )
{ {
SAL_WARN_IF( nStt + nLen > rText.getLength(), "sw.core", "String in ThaiJustify too small" ); SAL_WARN_IF( nStt + nLen > rText.getLength(), "sw.core", "String in ThaiJustify too small" );
...@@ -2236,7 +2238,8 @@ void SwScriptInfo::CalcHiddenRanges( const SwTextNode& rNode, MultiSelection& rH ...@@ -2236,7 +2238,8 @@ void SwScriptInfo::CalcHiddenRanges( const SwTextNode& rNode, MultiSelection& rH
rNode.SetHiddenCharAttribute( bNewHiddenCharsHidePara, bNewContainsHiddenChars ); rNode.SetHiddenCharAttribute( bNewHiddenCharsHidePara, bNewContainsHiddenChars );
} }
sal_Int32 SwScriptInfo::CountCJKCharacters( const OUString &rText, sal_Int32 nPos, sal_Int32 nEnd, LanguageType aLang) TextFrameIndex SwScriptInfo::CountCJKCharacters(const OUString &rText,
TextFrameIndex nPos, TextFrameIndex const nEnd, LanguageType aLang)
{ {
sal_Int32 nCount = 0; sal_Int32 nCount = 0;
if (nEnd > nPos) if (nEnd > nPos)
...@@ -2258,8 +2261,8 @@ sal_Int32 SwScriptInfo::CountCJKCharacters( const OUString &rText, sal_Int32 nPo ...@@ -2258,8 +2261,8 @@ sal_Int32 SwScriptInfo::CountCJKCharacters( const OUString &rText, sal_Int32 nPo
} }
void SwScriptInfo::CJKJustify( const OUString& rText, long* pKernArray, void SwScriptInfo::CJKJustify( const OUString& rText, long* pKernArray,
long* pScrArray, sal_Int32 nStt, long* pScrArray, TextFrameIndex const nStt,
sal_Int32 nLen, LanguageType aLang, TextFrameIndex const nLen, LanguageType aLang,
long nSpaceAdd, bool bIsSpaceStop ) long nSpaceAdd, bool bIsSpaceStop )
{ {
assert( pKernArray != nullptr && nStt >= 0 ); assert( pKernArray != nullptr && nStt >= 0 );
......
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