diff options
Diffstat (limited to 'filter/source/xsltfilter/OleHandler.cxx')
-rw-r--r-- | filter/source/xsltfilter/OleHandler.cxx | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/filter/source/xsltfilter/OleHandler.cxx b/filter/source/xsltfilter/OleHandler.cxx index bb2089935b32..0318aaa5d2f0 100644 --- a/filter/source/xsltfilter/OleHandler.cxx +++ b/filter/source/xsltfilter/OleHandler.cxx @@ -49,10 +49,9 @@ namespace XSLT m_rootStream = createTempFile(); Sequence<Any> args{ Any(m_rootStream->getInputStream()) }; - Reference<XNameContainer> cont( + m_storage.set( Reference<XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW) - ->createInstanceWithArguments("com.sun.star.embed.OLESimpleStorage", args), UNO_QUERY); - m_storage = cont; + ->createInstanceWithArguments(u"com.sun.star.embed.OLESimpleStorage"_ustr, args), UNO_QUERY); } } @@ -71,10 +70,9 @@ namespace XSLT //create a com.sun.star.embed.OLESimpleStorage from the temp stream Sequence<Any> args{ Any(xSeek) }; - Reference<XNameContainer> cont( + m_storage.set( Reference<XMultiServiceFactory>(m_xContext->getServiceManager(), UNO_QUERY_THROW) - ->createInstanceWithArguments("com.sun.star.embed.OLESimpleStorage", args), UNO_QUERY); - m_storage = cont; + ->createInstanceWithArguments(u"com.sun.star.embed.OLESimpleStorage"_ustr, args), UNO_QUERY); } OString @@ -82,13 +80,13 @@ namespace XSLT { if (!m_storage || !m_storage->hasByName(streamName)) { - return "Not Found:";// + streamName; + return "Not Found:"_ostr;// + streamName; } Reference<XInputStream> subStream(m_storage->getByName(streamName), UNO_QUERY); if (!subStream.is()) { - return "Not Found:";// + streamName; + return "Not Found:"_ostr;// + streamName; } //The first four byte are the length of the uncompressed data Sequence<sal_Int8> aLength(4); @@ -98,7 +96,7 @@ namespace XSLT int readbytes = subStream->readBytes(aLength, 4); if (4 != readbytes) { - return "Can not read the length."; + return "Can not read the length."_ostr; } sal_Int32 const oleLength = (static_cast<sal_uInt8>(aLength[0]) << 0U) | (static_cast<sal_uInt8>(aLength[1]) << 8U) @@ -106,14 +104,14 @@ namespace XSLT | (static_cast<sal_uInt8>(aLength[3]) << 24U); if (oleLength < 0) { - return "invalid oleLength"; + return "invalid oleLength"_ostr; } Sequence<sal_Int8> content(oleLength); //Read all bytes. The compressed length should be less than the uncompressed length readbytes = subStream->readBytes(content, oleLength); if (oleLength < readbytes) { - return "oleLength";// +oleLength + readBytes; + return "oleLength"_ostr;// +oleLength + readBytes; } // Decompress the bytes @@ -126,7 +124,7 @@ namespace XSLT //return the base64 string of the uncompressed data OUStringBuffer buf(oleLength); ::comphelper::Base64::encode(buf, result); - return OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); + return OUStringToOString(buf, RTL_TEXTENCODING_ASCII_US); } void @@ -159,7 +157,7 @@ namespace XSLT //return the base64 encoded string OUStringBuffer buf(oleLength); ::comphelper::Base64::encode(buf, oledata); - return OUStringToOString(buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US); + return OUStringToOString(buf, RTL_TEXTENCODING_ASCII_US); } return encodeSubStorage(streamName); } |