[Libreoffice-commits] core.git: 2 commits - editeng/source svx/source
Caolán McNamara
caolanm at redhat.com
Fri Oct 23 08:13:40 UTC 2015
editeng/source/misc/svxacorr.cxx | 32 +++++++++++++++++++-------------
svx/source/svdraw/svdmrkv.cxx | 8 ++++----
2 files changed, 23 insertions(+), 17 deletions(-)
New commits:
commit a1ff0745cc4f78777e8dba1e7bb52d18386d7394
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 23 09:11:56 2015 +0100
Resolves: tdf#76964 fall back to primary language via getLanguage
instead of bittwiddling which ends up trying to resolve the
system language
Change-Id: I545bd5e39f99003ddedf3c90031e8b818edc1de2
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index c0fe685..93c56bb 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1717,10 +1717,8 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList(
}
// If it still could not be found here, then keep on searching
-
LanguageType eLang = aLanguageTag.getLanguageType();
- LanguageType nTmpKey1 = eLang & 0x7ff, // the main language in many cases DE
- nTmpKey2 = eLang & 0x3ff; // otherwise for example EN
+ LanguageType nTmpKey1 = eLang & 0x7ff; // the main language in many cases DE
if(nTmpKey1 != eLang && (m_pLangTable->find(aLanguageTag.reset(nTmpKey1)) != m_pLangTable->end() ||
CreateLanguageFile(aLanguageTag, false)))
{
@@ -1734,8 +1732,12 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList(
}
}
- if (nTmpKey2 != eLang && (m_pLangTable->find(aLanguageTag.reset(nTmpKey2)) != m_pLangTable->end() ||
- CreateLanguageFile(aLanguageTag, false)))
+ // otherwise for example EN
+ aLanguageTag.reset(aLanguageTag.getLanguage());
+ LanguageType nTmpKey2 = aLanguageTag.getLanguageType(false);
+ if (nTmpKey2 != eLang && nTmpKey2 != LANGUAGE_UNDETERMINED &&
+ (m_pLangTable->find(aLanguageTag) != m_pLangTable->end() ||
+ CreateLanguageFile(aLanguageTag, false)))
{
//the language is available - so bring it on
std::unique_ptr<SvxAutoCorrectLanguageLists> const& pList = m_pLangTable->find(aLanguageTag)->second;
@@ -1771,8 +1773,7 @@ bool SvxAutoCorrect::FindInWrdSttExceptList( LanguageType eLang,
// First search for eLang, then US-English -> English
// and last in LANGUAGE_UNDETERMINED
- LanguageType nTmpKey1 = eLang & 0x7ff, // the main language in many cases DE
- nTmpKey2 = eLang & 0x3ff; // otherwise for example EN
+ LanguageType nTmpKey1 = eLang & 0x7ff; // the main language in many cases DE
OUString sTemp(sWord);
if (m_pLangTable->find(aLanguageTag) != m_pLangTable->end() || CreateLanguageFile(aLanguageTag, false))
@@ -1794,8 +1795,11 @@ bool SvxAutoCorrect::FindInWrdSttExceptList( LanguageType eLang,
return true;
}
- if (nTmpKey2 != eLang && (m_pLangTable->find(aLanguageTag.reset(nTmpKey2)) != m_pLangTable->end() ||
- CreateLanguageFile(aLanguageTag, false)))
+ // otherwise for example EN
+ LanguageType nTmpKey2 = aLanguageTag.getLanguageType(false);
+ if (nTmpKey2 != eLang && nTmpKey2 != LANGUAGE_UNDETERMINED &&
+ (m_pLangTable->find(aLanguageTag) != m_pLangTable->end() ||
+ CreateLanguageFile(aLanguageTag, false)))
{
//the language is available - so bring it on
auto const& pList = m_pLangTable->find(aLanguageTag)->second;
@@ -1857,8 +1861,7 @@ bool SvxAutoCorrect::FindInCplSttExceptList(LanguageType eLang,
// First search for eLang, then US-English -> English
// and last in LANGUAGE_UNDETERMINED
- LanguageType nTmpKey1 = eLang & 0x7ff, // the main language in many cases DE
- nTmpKey2 = eLang & 0x3ff; // otherwise for example EN
+ LanguageType nTmpKey1 = eLang & 0x7ff; // the main language in many cases DE
OUString sTemp( sWord );
if (m_pLangTable->find(aLanguageTag) != m_pLangTable->end() || CreateLanguageFile(aLanguageTag, false))
@@ -1878,8 +1881,11 @@ bool SvxAutoCorrect::FindInCplSttExceptList(LanguageType eLang,
return true;
}
- if(nTmpKey2 != eLang && (m_pLangTable->find(aLanguageTag.reset(nTmpKey2)) != m_pLangTable->end() ||
- CreateLanguageFile(aLanguageTag, false)))
+ // otherwise for example EN
+ LanguageType nTmpKey2 = aLanguageTag.getLanguageType(false);
+ if (nTmpKey2 != eLang && nTmpKey2 != LANGUAGE_UNDETERMINED &&
+ (m_pLangTable->find(aLanguageTag) != m_pLangTable->end() ||
+ CreateLanguageFile(aLanguageTag, false)))
{
//the language is available - so bring it on
const SvStringsISortDtor* pList = m_pLangTable->find(aLanguageTag)->second->GetCplSttExceptList();
commit b7ec9d722fc24b8a01e34df259594567c3fc7d43
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 22 17:10:00 2015 +0100
afl-eventtesting: crash seen on occasion
Change-Id: Ib8e33c3dbaf793f9ae57a2d54af34d7e823226ec
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 9191579..ec449b1 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -1257,10 +1257,10 @@ void SdrMarkView::CheckMarked()
{
for (size_t nm=GetMarkedObjectCount(); nm>0;) {
--nm;
- SdrMark* pM=GetSdrMarkByIndex(nm);
- SdrObject* pObj=pM->GetMarkedSdrObj();
- SdrPageView* pPV=pM->GetPageView();
- bool bRaus=!pPV->IsObjSelectable(pObj);
+ SdrMark* pM = GetSdrMarkByIndex(nm);
+ SdrObject* pObj = pM->GetMarkedSdrObj();
+ SdrPageView* pPV = pM->GetPageView();
+ bool bRaus = !pObj || !pPV->IsObjSelectable(pObj);
if (bRaus)
{
GetMarkedObjectListWriteAccess().DeleteMark(nm);
More information about the Libreoffice-commits
mailing list