diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-11-28 11:13:44 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2019-12-07 19:58:33 +0100 |
commit | ad86ebb1f86f6347ccb9bbe40b0ca080562cbae8 (patch) | |
tree | b598bad7d2ae57861cc57cd81271bd96b9aa9929 /lingucomponent | |
parent | e000187243b9b90f9c8c9110fcd9a82c01ba0fe7 (diff) |
tdf#121658 Add option to not hyphenate words in CAPS
* Add checkbox to pagraph dialog
* Store property in paragraph model
* Move docx import/export from grabbag to paragraph model
* Add ODF import/export
* Add ODF unit test
* Add layout test
Change-Id: Id4e7c5a0ad145c042f862995d227c31ae2aa0abd
Reviewed-on: https://gerrit.libreoffice.org/83979
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
(cherry picked from commit 72bd0df107ee47c4d54fa88b4960d32ea03e9f69)
Reviewed-on: https://gerrit.libreoffice.org/84620
Diffstat (limited to 'lingucomponent')
-rw-r--r-- | lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx index 3434482486ed..a16420844228 100644 --- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx @@ -42,6 +42,7 @@ #include <linguistic/lngprops.hxx> #include <linguistic/misc.hxx> #include <svtools/strings.hrc> +#include <unotools/charclass.hxx> #include <unotools/pathoptions.hxx> #include <unotools/useroptions.hxx> #include <unotools/lingucfg.hxx> @@ -254,6 +255,7 @@ Reference< XHyphenatedWord > SAL_CALL Hyphenator::hyphenate( const OUString& aWo sal_Int16 minTrail = rHelper.GetMinTrailing(); sal_Int16 minLead = rHelper.GetMinLeading(); sal_Int16 minLen = rHelper.GetMinWordLength(); + bool bNoHyphenateCaps = rHelper.IsNoHyphenateCaps(); HyphenDict *dict = nullptr; rtl_TextEncoding eEnc = RTL_TEXTENCODING_DONTKNOW; @@ -286,6 +288,12 @@ Reference< XHyphenatedWord > SAL_CALL Hyphenator::hyphenate( const OUString& aWo eEnc = mvDicts[k].eEnc; CharClass * pCC = mvDicts[k].apCC.get(); + // Don't hyphenate uppercase words if requested + if (bNoHyphenateCaps && aWord == makeUpperCase(aWord, pCC)) + { + return nullptr; + } + // we don't want to work with a default text encoding since following incorrect // results may occur only for specific text and thus may be hard to notice. // Thus better always make a clean exit here if the text encoding is in question. |