summaryrefslogtreecommitdiff
path: root/oox
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
parenta7ecab870eb5567bceb3ef61d87d8db805bc6796 (diff)
fdo#46808, convert io::TextInputStream service to new style
Change-Id: Ida4abdd6587399aa8ade88af672bcb23ab7ea0f1
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/oox/helper/textinputstream.hxx6
-rw-r--r--oox/inc/oox/vml/vmlinputstream.hxx4
-rw-r--r--oox/source/helper/textinputstream.cxx12
-rw-r--r--oox/source/vml/vmlinputstream.cxx2
4 files changed, 11 insertions, 13 deletions
diff --git a/oox/inc/oox/helper/textinputstream.hxx b/oox/inc/oox/helper/textinputstream.hxx
index 2ac99ad66963..944f32950f4b 100644
--- a/oox/inc/oox/helper/textinputstream.hxx
+++ b/oox/inc/oox/helper/textinputstream.hxx
@@ -25,7 +25,7 @@
namespace com { namespace sun { namespace star {
namespace io { class XInputStream; }
- namespace io { class XTextInputStream; }
+ namespace io { class XTextInputStream2; }
namespace uno { class XComponentContext; }
} } }
@@ -91,7 +91,7 @@ public:
/** Creates a UNO text input stream object from the passed UNO input stream.
*/
- static ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextInputStream >
+ static ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextInputStream2 >
createXTextInputStream(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
@@ -108,7 +108,7 @@ private:
::rtl::OUString createFinalString( const ::rtl::OUString& rString );
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextInputStream >
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextInputStream2 >
mxTextStrm;
sal_Unicode mcPendingChar;
};
diff --git a/oox/inc/oox/vml/vmlinputstream.hxx b/oox/inc/oox/vml/vmlinputstream.hxx
index 1670654a25d7..5c23af76971f 100644
--- a/oox/inc/oox/vml/vmlinputstream.hxx
+++ b/oox/inc/oox/vml/vmlinputstream.hxx
@@ -25,7 +25,7 @@
#include <rtl/string.hxx>
namespace com { namespace sun { namespace star {
- namespace io { class XTextInputStream; }
+ namespace io { class XTextInputStream2; }
namespace uno { class XComponentContext; }
} } }
@@ -78,7 +78,7 @@ private:
::rtl::OString readToElementEnd() throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextInputStream >
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XTextInputStream2 >
mxTextStrm;
::com::sun::star::uno::Sequence< sal_Unicode > maOpeningBracket;
::com::sun::star::uno::Sequence< sal_Unicode > maClosingBracket;
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&)
diff --git a/oox/source/vml/vmlinputstream.cxx b/oox/source/vml/vmlinputstream.cxx
index 340d5b22effa..48d0a3c42987 100644
--- a/oox/source/vml/vmlinputstream.cxx
+++ b/oox/source/vml/vmlinputstream.cxx
@@ -19,7 +19,7 @@
#include "oox/vml/vmlinputstream.hxx"
-#include <com/sun/star/io/XTextInputStream.hpp>
+#include <com/sun/star/io/XTextInputStream2.hpp>
#include <map>
#include <string.h>
#include <rtl/strbuf.hxx>