summaryrefslogtreecommitdiff
path: root/oox/source/helper
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-01-30 14:46:50 +0200
committerNoel Grandin <noel@peralex.com>2013-02-11 08:02:15 +0200
commitff85e8319a263e428ce53f7758092475b953afba (patch)
tree61d407de6a6bd00b352da51c013e3351237b95ee /oox/source/helper
parenta7ecab870eb5567bceb3ef61d87d8db805bc6796 (diff)
fdo#46808, convert io::TextInputStream service to new style
Change-Id: Ida4abdd6587399aa8ade88af672bcb23ab7ea0f1
Diffstat (limited to 'oox/source/helper')
-rw-r--r--oox/source/helper/textinputstream.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/oox/source/helper/textinputstream.cxx b/oox/source/helper/textinputstream.cxx
index 926beb963455..7bc5b5ac9aad 100644
--- a/oox/source/helper/textinputstream.cxx
+++ b/oox/source/helper/textinputstream.cxx
@@ -20,7 +20,7 @@
#include "oox/helper/textinputstream.hxx"
#include <com/sun/star/io/XActiveDataSink.hpp>
-#include <com/sun/star/io/XTextInputStream.hpp>
+#include <com/sun/star/io/TextInputStream.hpp>
#include <cppuhelper/implbase1.hxx>
#include <rtl/tencinfo.h>
#include "oox/helper/binaryinputstream.hxx"
@@ -184,18 +184,16 @@ OUString TextInputStream::readToChar( sal_Unicode cChar, bool bIncludeChar )
return OUString();
}
-/*static*/ Reference< XTextInputStream > TextInputStream::createXTextInputStream(
+/*static*/ Reference< XTextInputStream2 > TextInputStream::createXTextInputStream(
const Reference< XComponentContext >& rxContext, const Reference< XInputStream >& rxInStrm, rtl_TextEncoding eTextEnc )
{
- Reference< XTextInputStream > xTextStrm;
+ Reference< XTextInputStream2 > xTextStrm;
const char* pcCharset = rtl_getBestMimeCharsetFromTextEncoding( eTextEnc );
OSL_ENSURE( pcCharset, "TextInputStream::createXTextInputStream - unsupported text encoding" );
if( rxContext.is() && rxInStrm.is() && pcCharset ) try
{
- Reference< XMultiServiceFactory > xFactory( rxContext->getServiceManager(), UNO_QUERY_THROW );
- Reference< XActiveDataSink > xDataSink( xFactory->createInstance( "com.sun.star.io.TextInputStream" ), UNO_QUERY_THROW );
- xDataSink->setInputStream( rxInStrm );
- xTextStrm.set( xDataSink, UNO_QUERY_THROW );
+ xTextStrm = com::sun::star::io::TextInputStream::create( rxContext );
+ xTextStrm->setInputStream( rxInStrm );
xTextStrm->setEncoding( OUString::createFromAscii( pcCharset ) );
}
catch (const Exception&)