diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-22 23:40:24 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-23 10:10:09 +0000 |
commit | b7ea36101497c275cb08b0e37facbde656197d9b (patch) | |
tree | a05e25d4f01c94c69712d17a1ab4cdbc925ef355 /sfx2 | |
parent | 62d880f3228c7f5c3f8a1d30f5a5c9ed390a1eb5 (diff) |
add stripStart, can replace EraseTrailingChars
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/newhelp.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/bastyp/frmhtmlw.cxx | 13 |
2 files changed, 10 insertions, 8 deletions
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 595d23318493..e532d98185bf 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -48,8 +48,9 @@ #include <boost/unordered_map.hpp> #include <rtl/ustrbuf.hxx> -#include <comphelper/processfactory.hxx> #include <comphelper/configurationhelper.hxx> +#include <comphelper/processfactory.hxx> +#include <comphelper/string.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <com/sun/star/util/XModifiable.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> @@ -1040,7 +1041,7 @@ SearchTabPage_Impl::~SearchTabPage_Impl() aUserData += ';'; } - aUserData.EraseTrailingChars(';'); + aUserData = comphelper::string::stripEnd(aUserData, ';'); Any aUserItem = makeAny( ::rtl::OUString( aUserData ) ); aViewOpt.SetUserItem( USERITEM_NAME, aUserItem ); } diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx index 2451d107408c..504baa79fc02 100644 --- a/sfx2/source/bastyp/frmhtmlw.cxx +++ b/sfx2/source/bastyp/frmhtmlw.cxx @@ -49,8 +49,8 @@ #include <sfx2/sfx.hrc> #include "bastyp.hrc" -#include <comphelper/string.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/string.hxx> #include <com/sun/star/script/XTypeConverter.hpp> #include <com/sun/star/document/XDocumentProperties.hpp> @@ -238,16 +238,17 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const String& rBaseURL, xUserDefinedProps->getPropertySetInfo(); DBG_ASSERT(xPropInfo.is(), "UserDefinedProperties Info is null"); uno::Sequence<beans::Property> props = xPropInfo->getProperties(); - for (sal_Int32 i = 0; i < props.getLength(); ++i) { - try { + for (sal_Int32 i = 0; i < props.getLength(); ++i) + { + try + { ::rtl::OUString name = props[i].Name; - ::rtl::OUString str; uno::Any aStr = xConverter->convertToSimpleType( xUserDefinedProps->getPropertyValue(name), uno::TypeClass_STRING); + ::rtl::OUString str; aStr >>= str; - String valstr(str); - valstr.EraseTrailingChars(); + String valstr(comphelper::string::stripEnd(str, ' ')); OutMeta( rStrm, pIndent, name, valstr, sal_False, eDestEnc, pNonConvertableChars ); } |