diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-10-18 16:21:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-18 16:27:44 +0100 |
commit | 9567fbdff6141a605f54df77ddcae173467d5cba (patch) | |
tree | 88dbbdfa826c70fd1e9a7eda9a199d1c177141d7 | |
parent | fdf85819c33abe5a81d19a94b3bac0800b6cda30 (diff) |
disambiguate GetScriptType that return different value types
Change-Id: I694d81d17fac5fbd964937dc654ebd764af90842
-rw-r--r-- | editeng/source/editeng/editeng.cxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 8 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 8 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 14 | ||||
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 10 |
5 files changed, 22 insertions, 22 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 6b7538d636b5..dfc9713403bd 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -511,7 +511,7 @@ sal_uInt16 EditEngine::GetScriptType( const ESelection& rSelection ) const { DBG_CHKTHIS( EditEngine, 0 ); EditSelection aSel( pImpEditEngine->CreateSel( rSelection ) ); - return pImpEditEngine->GetScriptType( aSel ); + return pImpEditEngine->GetItemScriptType( aSel ); } LanguageType EditEngine::GetLanguage(const EditPaM& rPaM) const @@ -739,7 +739,7 @@ const ParaPortion* EditEngine::GetPrevVisPortion(const ParaPortion* pCurPortion) sal_uInt16 EditEngine::GetScriptType(const EditSelection& rSel) const { - return pImpEditEngine->GetScriptType(rSel); + return pImpEditEngine->GetItemScriptType(rSel); } void EditEngine::RemoveParaPortion(sal_Int32 nNode) diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 2ded5c5f6fb2..1cd40de99bea 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -592,10 +592,10 @@ private: void InitScriptTypes( sal_Int32 nPara ); - sal_uInt16 GetScriptType( const EditPaM& rPaM, sal_uInt16* pEndPos = NULL ) const; - sal_uInt16 GetScriptType( const EditSelection& rSel ) const; - sal_Bool IsScriptChange( const EditPaM& rPaM ) const; - sal_Bool HasScriptType( sal_Int32 nPara, sal_uInt16 nType ) const; + sal_uInt16 GetI18NScriptType( const EditPaM& rPaM, sal_uInt16* pEndPos = NULL ) const; + sal_uInt16 GetItemScriptType( const EditSelection& rSel ) const; + sal_Bool IsScriptChange( const EditPaM& rPaM ) const; + sal_Bool HasScriptType( sal_Int32 nPara, sal_uInt16 nType ) const; sal_Bool ImplCalcAsianCompression( ContentNode* pNode, TextPortion* pTextPortion, sal_uInt16 nStartPos, sal_Int32* pDXArray, sal_uInt16 n100thPercentFromMax, sal_Bool bManipulateDXArray ); void ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* pParaPortion, long nRemainingWidth ); diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index a9b69a7caef0..e8cf38d41413 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -1757,7 +1757,7 @@ private: } -sal_uInt16 ImpEditEngine::GetScriptType( const EditPaM& rPaM, sal_uInt16* pEndPos ) const +sal_uInt16 ImpEditEngine::GetI18NScriptType( const EditPaM& rPaM, sal_uInt16* pEndPos ) const { sal_uInt16 nScriptType = 0; @@ -1785,7 +1785,7 @@ sal_uInt16 ImpEditEngine::GetScriptType( const EditPaM& rPaM, sal_uInt16* pEndPo return nScriptType ? nScriptType : GetI18NScriptTypeOfLanguage( GetDefaultLanguage() ); } -sal_uInt16 ImpEditEngine::GetScriptType( const EditSelection& rSel ) const +sal_uInt16 ImpEditEngine::GetItemScriptType( const EditSelection& rSel ) const { EditSelection aSel( rSel ); aSel.Adjust( aEditDoc ); @@ -1827,7 +1827,7 @@ sal_uInt16 ImpEditEngine::GetScriptType( const EditSelection& rSel ) const if (bStartInRange || bEndInRange) { if ( rTypes[n].nScriptType != i18n::ScriptType::WEAK ) - nScriptType |= GetItemScriptType ( rTypes[n].nScriptType ); + nScriptType |= ::GetItemScriptType( rTypes[n].nScriptType ); } } } @@ -3775,7 +3775,7 @@ sal_uInt16 ImpEditEngine::GetChar( if ( nChar && ( nChar < pParaPortion->GetNode()->Len() ) ) { EditPaM aPaM( pParaPortion->GetNode(), nChar+1 ); - sal_uInt16 nScriptType = GetScriptType( aPaM ); + sal_uInt16 nScriptType = GetI18NScriptType( aPaM ); if ( nScriptType == i18n::ScriptType::COMPLEX ) { uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() ); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 8e66ec1b330d..d10010918764 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -1095,8 +1095,8 @@ sal_Bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) if( bScriptSpace && ( _nPortionEnd < pNode->Len() ) && ( nTmpWidth < nXWidth ) && IsScriptChange( EditPaM( pNode, _nPortionEnd ) ) ) { sal_Bool bAllow = sal_False; - sal_uInt16 nScriptTypeLeft = GetScriptType( EditPaM( pNode, _nPortionEnd ) ); - sal_uInt16 nScriptTypeRight = GetScriptType( EditPaM( pNode, _nPortionEnd+1 ) ); + sal_uInt16 nScriptTypeLeft = GetI18NScriptType( EditPaM( pNode, _nPortionEnd ) ); + sal_uInt16 nScriptTypeRight = GetI18NScriptType( EditPaM( pNode, _nPortionEnd+1 ) ); if ( ( nScriptTypeLeft == i18n::ScriptType::ASIAN ) || ( nScriptTypeRight == i18n::ScriptType::ASIAN ) ) bAllow = sal_True; @@ -2002,7 +2002,7 @@ void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, { EditPaM aPaM( pNode, nChar+1 ); LanguageType eLang = GetLanguage(aPaM); - sal_uInt16 nScript = GetScriptType(aPaM); + sal_uInt16 nScript = GetI18NScriptType(aPaM); if ( MsLangId::getPrimaryLanguage( eLang) == LANGUAGE_ARABIC_PRIMARY_ONLY ) // Arabic script is handled later. continue; @@ -2556,7 +2556,7 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_uInt16 nPos, SvxFont& rF rFont = pNode->GetCharAttribs().GetDefFont(); - short nScriptType = GetScriptType( EditPaM( pNode, nPos ) ); + short nScriptType = GetI18NScriptType( EditPaM( pNode, nPos ) ); if ( ( nScriptType == i18n::ScriptType::ASIAN ) || ( nScriptType == i18n::ScriptType::COMPLEX ) ) { const SvxFontItem& rFontItem = (const SvxFontItem&)pNode->GetContentAttribs().GetItem( GetScriptItemId( EE_CHAR_FONTINFO, nScriptType ) ); @@ -3012,7 +3012,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt aTmpFont.SetFillColor( COL_LIGHTGRAY ); aTmpFont.SetTransparent( sal_False ); } - else if ( GetScriptType( EditPaM( pPortion->GetNode(), nIndex+1 ) ) == i18n::ScriptType::COMPLEX ) + else if ( GetI18NScriptType( EditPaM( pPortion->GetNode(), nIndex+1 ) ) == i18n::ScriptType::COMPLEX ) { aTmpFont.SetFillColor( COL_LIGHTCYAN ); aTmpFont.SetTransparent( sal_False ); @@ -4303,7 +4303,7 @@ void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, sal_Int32 nPara, else { ContentNode* pNode = GetEditDoc().GetObject( nPara ); - short nScriptType = GetScriptType( EditPaM( pNode, nIndex+1 ) ); + short nScriptType = GetI18NScriptType( EditPaM( pNode, nIndex+1 ) ); bCTL = nScriptType == i18n::ScriptType::COMPLEX; // this change was discussed in issue 37190 bR2L = GetRightToLeft( nPara, nIndex + 1) % 2 ? sal_True : sal_False; @@ -4385,7 +4385,7 @@ sal_Bool ImpEditEngine::ImplCalcAsianCompression( ContentNode* pNode, TextPortio sal_Bool bCompressed = sal_False; - if ( GetScriptType( EditPaM( pNode, nStartPos+1 ) ) == i18n::ScriptType::ASIAN ) + if ( GetI18NScriptType( EditPaM( pNode, nStartPos+1 ) ) == i18n::ScriptType::ASIAN ) { long nNewPortionWidth = pTextPortion->GetSize().Width(); sal_uInt16 nPortionLen = pTextPortion->GetLen(); diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index d04545d26b8d..3ec19db12ef4 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -598,7 +598,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) if ( nStartPos != 0 ) { aAttribItems.Clear(); - lcl_FindValidAttribs( aAttribItems, pNode, nStartPos, GetScriptType( EditPaM( pNode, 0 ) ) ); + lcl_FindValidAttribs( aAttribItems, pNode, nStartPos, GetI18NScriptType( EditPaM( pNode, 0 ) ) ); if ( aAttribItems.Count() ) { // These attributes may not apply to the entire paragraph: @@ -634,7 +634,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) else { aAttribItems.Clear(); - sal_uInt16 nScriptType = GetScriptType( EditPaM( pNode, nIndex+1 ) ); + sal_uInt16 nScriptType = GetI18NScriptType( EditPaM( pNode, nIndex+1 ) ); if ( !n || IsScriptChange( EditPaM( pNode, nIndex ) ) ) { SfxItemSet aAttribs = GetAttribs( nNode, nIndex+1, nIndex+1 ); @@ -1029,7 +1029,7 @@ EditTextObject* ImpEditEngine::CreateTextObject( EditSelection aSel, SfxItemPool // Templates are not saved! // (Only the name and family, template itself must be in App!) - pTxtObj->mpImpl->SetScriptType(GetScriptType(aSel)); + pTxtObj->mpImpl->SetScriptType(GetItemScriptType(aSel)); // iterate over the paragraphs ... sal_Int32 nNode; @@ -1414,7 +1414,7 @@ void ImpEditEngine::SetAllMisspellRanges( const std::vector<editeng::MisspellRan LanguageType ImpEditEngine::GetLanguage( const EditPaM& rPaM, sal_uInt16* pEndPos ) const { - short nScriptType = GetScriptType( rPaM, pEndPos ); // pEndPos will be valid now, pointing to ScriptChange or NodeLen + short nScriptType = GetI18NScriptType( rPaM, pEndPos ); // pEndPos will be valid now, pointing to ScriptChange or NodeLen sal_uInt16 nLangId = GetScriptItemId( EE_CHAR_LANGUAGE, nScriptType ); const SvxLanguageItem* pLangItem = &(const SvxLanguageItem&)rPaM.GetNode()->GetContentAttribs().GetItem( nLangId ); const EditCharAttrib* pAttr = rPaM.GetNode()->GetCharAttribs().FindAttrib( nLangId, rPaM.GetIndex() ); @@ -1750,7 +1750,7 @@ void ImpEditEngine::ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang, // check script type to the right of the start of the current portion EditPaM aPaM( CreateEditPaM( EPaM(aCurStart.nPara, nLangIdx) ) ); - sal_Bool bIsAsianScript = (i18n::ScriptType::ASIAN == GetScriptType( aPaM )); + sal_Bool bIsAsianScript = (i18n::ScriptType::ASIAN == GetI18NScriptType( aPaM )); // not yet processed text part with for conversion // not suitable language found that needs to be changed? if (bAllowImplicitChangesForNotConvertibleText && |