diff options
author | László Németh <nemeth@numbertext.org> | 2014-01-30 14:56:30 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2014-01-30 14:56:30 +0100 |
commit | e63923b0334ae381e0fcc576a6b6e08a62e657cf (patch) | |
tree | fd281a8df85ef40df228fcf8ef75bdb4067400e3 /cui | |
parent | a1aa702861694fb114403b3f2746a33eb315ed87 (diff) |
fdo#44314 non-standard hyphenation at soft hyphens + with pers. dic.
Change-Id: I25e7c13036c6ce1948cc33d45901ef69a258fb03
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optdict.cxx | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx index ba626c4958ab..af009878db2c 100644 --- a/cui/source/options/optdict.cxx +++ b/cui/source/options/optdict.cxx @@ -54,6 +54,23 @@ static long nStaticTabs[]= static OUString getNormDicEntry_Impl(const OUString &rText) { OUString aTmp(comphelper::string::stripEnd(rText, '.')); + // non-standard hyphenation + if (aTmp.indexOf('[') > -1) + { + OUStringBuffer aTmp2 ( aTmp.getLength() ); + sal_Bool bSkip = sal_False; + for (sal_Int32 i = 0; i < aTmp.getLength(); i++) + { + sal_Unicode cTmp = aTmp[i]; + if (cTmp == '[') + bSkip = sal_True; + else if (!bSkip) + aTmp2.append( cTmp ); + else if (cTmp == ']') + bSkip = sal_False; + } + aTmp = aTmp2.makeStringAndClear(); + } return comphelper::string::remove(aTmp, '='); } @@ -68,7 +85,7 @@ static CDE_RESULT cmpDicEntry_Impl( const OUString &rText1, const OUString &rTex eRes = CDE_EQUAL; else { // similar = equal up to trailing '.' and hyphenation positions - // marked with '=' + // marked with '=' and '[' + alternative spelling pattern + ']' if (getNormDicEntry_Impl( rText1 ) == getNormDicEntry_Impl( rText2 )) eRes = CDE_SIMILAR; } |