summaryrefslogtreecommitdiff
path: root/svl/source
diff options
context:
space:
mode:
authorAugust Sodora <augsod@gmail.com>2011-11-26 13:55:52 -0500
committerAugust Sodora <augsod@gmail.com>2011-11-26 13:55:52 -0500
commit091ba739bad456938d462d808f5a76927d884ed9 (patch)
tree20ae59b7a508685c76e62d5768474f78c9fce50a /svl/source
parente81f36f6b62c6686f0156aef151ad8bf6d1b7917 (diff)
Added test for linguistic::RemoveHyphen and some simplification
Diffstat (limited to 'svl/source')
-rw-r--r--svl/source/misc/lngmisc.cxx12
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 )