diff options
Diffstat (limited to 'desktop/source/deployment')
-rw-r--r-- | desktop/source/deployment/registry/configuration/dp_configuration.cxx | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 1f4ba053ec55..622814248670 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -37,6 +37,7 @@ #include <unotools/ucbhelper.hxx> #include <xmlscript/xml_helper.hxx> #include <comphelper/lok.hxx> +#include <comphelper/xmlencode.hxx> #include <svl/inettype.hxx> #include <o3tl/string_view.hxx> #include <com/sun/star/configuration/Update.hpp> @@ -566,39 +567,6 @@ BackendImpl::PackageImpl::isRegistered_( } -OUString encodeForXml( std::u16string_view text ) -{ - // encode conforming xml: - size_t len = text.size(); - OUStringBuffer buf; - for ( size_t pos = 0; pos < len; ++pos ) - { - sal_Unicode c = text[ pos ]; - switch (c) { - case '<': - buf.append( "<" ); - break; - case '>': - buf.append( ">" ); - break; - case '&': - buf.append( "&" ); - break; - case '\'': - buf.append( "'" ); - break; - case '\"': - buf.append( """ ); - break; - default: - buf.append( c ); - break; - } - } - return buf.makeStringAndClear(); -} - - OUString replaceOrigin( OUString const & url, std::u16string_view destFolder, Reference< XCommandEnvironment > const & xCmdEnv, Reference< XComponentContext > const & xContext, bool & out_replaced) { @@ -651,7 +619,7 @@ OUString replaceOrigin( if (origin.isEmpty()) { // encode only once origin = OUStringToOString( - encodeForXml( url.subView( 0, url.lastIndexOf( '/' ) ) ), + comphelper::string::encodeForXml( url.subView( 0, url.lastIndexOf( '/' ) ) ), // xxx todo: encode always for UTF-8? => lookup doc-header? RTL_TEXTENCODING_UTF8 ); } |