diff options
author | Sascha Ballach <sab@openoffice.org> | 2001-10-29 14:59:46 +0000 |
---|---|---|
committer | Sascha Ballach <sab@openoffice.org> | 2001-10-29 14:59:46 +0000 |
commit | 2b53d7f1ee2b19764c21f6cd3063c6af0250a1d4 (patch) | |
tree | 2035df2ae054918f2c41065c06af86d37077e845 /xmloff | |
parent | 58eeb2c37d363be2f7a45e72c8b4289202b42c50 (diff) |
#93910#; method to delete undefined chars from a string
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmluconv.cxx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx index 34f45a149e15..7ee0791c77a5 100644 --- a/xmloff/source/core/xmluconv.cxx +++ b/xmloff/source/core/xmluconv.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmluconv.cxx,v $ * - * $Revision: 1.22 $ + * $Revision: 1.23 $ * - * last change: $Author: dvo $ $Date: 2001-06-29 21:07:12 $ + * last change: $Author: sab $ $Date: 2001-10-29 15:59:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1912,3 +1912,19 @@ void SvXMLUnitConverter::convertPropertySet(uno::Reference<beans::XPropertySet>& } } +void SvXMLUnitConverter::clearUndefinedChars(rtl::OUString& rTarget, const rtl::OUString& rSource) +{ + sal_uInt32 nLength(rSource.getLength()); + rtl::OUStringBuffer sBuffer(nLength); + for (sal_uInt32 i = 0; i < nLength; i++) + { + sal_Unicode cChar = rSource[i]; + if (!(cChar < 0x0020) || + (cChar == 0x0009) || // TAB + (cChar == 0x000A) || // LF + (cChar == 0x000D)) // legal character + sBuffer.append(cChar); + } + rTarget = sBuffer.makeStringAndClear(); +} + |