summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editeng/source/editeng/impedit2.cxx23
1 files changed, 13 insertions, 10 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 9e4072636e9a..71295dfe7022 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -1759,18 +1759,21 @@ sal_uInt16 ImpEditEngine::GetI18NScriptType( const EditPaM& rPaM, sal_Int32* pEn
{
sal_Int32 nPara = GetEditDoc().GetPos( rPaM.GetNode() );
const ParaPortion* pParaPortion = GetParaPortions().SafeGetObject( nPara );
- if ( pParaPortion->aScriptInfos.empty() )
- const_cast<ImpEditEngine*>(this)->InitScriptTypes( nPara );
+ if (pParaPortion)
+ {
+ if ( pParaPortion->aScriptInfos.empty() )
+ const_cast<ImpEditEngine*>(this)->InitScriptTypes( nPara );
- const ScriptTypePosInfos& rTypes = pParaPortion->aScriptInfos;
+ const ScriptTypePosInfos& rTypes = pParaPortion->aScriptInfos;
- const sal_Int32 nPos = rPaM.GetIndex();
- ScriptTypePosInfos::const_iterator itr = std::find_if(rTypes.begin(), rTypes.end(), FindByPos(nPos));
- if(itr != rTypes.end())
- {
- nScriptType = itr->nScriptType;
- if( pEndPos )
- *pEndPos = itr->nEndPos;
+ const sal_Int32 nPos = rPaM.GetIndex();
+ ScriptTypePosInfos::const_iterator itr = std::find_if(rTypes.begin(), rTypes.end(), FindByPos(nPos));
+ if(itr != rTypes.end())
+ {
+ nScriptType = itr->nScriptType;
+ if( pEndPos )
+ *pEndPos = itr->nEndPos;
+ }
}
}
return nScriptType ? nScriptType : SvtLanguageOptions::GetI18NScriptTypeOfLanguage( GetDefaultLanguage() );