diff options
author | August Sodora <augsod@gmail.com> | 2011-11-26 13:55:52 -0500 |
---|---|---|
committer | August Sodora <augsod@gmail.com> | 2011-11-26 13:55:52 -0500 |
commit | 091ba739bad456938d462d808f5a76927d884ed9 (patch) | |
tree | 20ae59b7a508685c76e62d5768474f78c9fce50a /svl/source/misc | |
parent | e81f36f6b62c6686f0156aef151ad8bf6d1b7917 (diff) |
Added test for linguistic::RemoveHyphen and some simplification
Diffstat (limited to 'svl/source/misc')
-rw-r--r-- | svl/source/misc/lngmisc.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/svl/source/misc/lngmisc.cxx b/svl/source/misc/lngmisc.cxx index ca1b68a6c0e5..f204f4bf8924 100644 --- a/svl/source/misc/lngmisc.cxx +++ b/svl/source/misc/lngmisc.cxx @@ -58,14 +58,10 @@ sal_Int32 GetNumControlChars( const OUString &rTxt ) sal_Bool RemoveHyphens( OUString &rTxt ) { - sal_Bool bModified = sal_False; - if (HasHyphens(rTxt)) - { - rTxt = comphelper::string::remove(rTxt, SVT_SOFT_HYPHEN); - rTxt = comphelper::string::remove(rTxt, SVT_HARD_HYPHEN); - bModified = sal_True; - } - return bModified; + sal_Int32 n = rTxt.getLength(); + rTxt = comphelper::string::remove(rTxt, SVT_SOFT_HYPHEN); + rTxt = comphelper::string::remove(rTxt, SVT_HARD_HYPHEN); + return n != rTxt.getLength(); } sal_Bool RemoveControlChars( OUString &rTxt ) |