diff options
author | Noel Grandin <noel@peralex.com> | 2013-01-30 14:46:50 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-02-11 08:02:15 +0200 |
commit | ff85e8319a263e428ce53f7758092475b953afba (patch) | |
tree | 61d407de6a6bd00b352da51c013e3351237b95ee /forms | |
parent | a7ecab870eb5567bceb3ef61d87d8db805bc6796 (diff) |
fdo#46808, convert io::TextInputStream service to new style
Change-Id: Ida4abdd6587399aa8ade88af672bcb23ab7ea0f1
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/xforms/model_ui.cxx | 13 | ||||
-rw-r--r-- | forms/source/xforms/unohelper.cxx | 11 | ||||
-rw-r--r-- | forms/source/xforms/unohelper.hxx | 4 |
3 files changed, 6 insertions, 22 deletions
diff --git a/forms/source/xforms/model_ui.cxx b/forms/source/xforms/model_ui.cxx index d0bfb79ec265..7032b8fa4653 100644 --- a/forms/source/xforms/model_ui.cxx +++ b/forms/source/xforms/model_ui.cxx @@ -31,6 +31,7 @@ #include <rtl/ustring.hxx> #include <rtl/ustrbuf.hxx> #include <tools/debug.hxx> +#include <comphelper/processfactory.hxx> // UNO classes #include <com/sun/star/xml/dom/XNode.hpp> @@ -42,7 +43,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XActiveDataSink.hpp> -#include <com/sun/star/io/XTextInputStream.hpp> +#include <com/sun/star/io/TextInputStream.hpp> #include <com/sun/star/container/XEnumeration.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/frame/XModel.hpp> @@ -57,7 +58,8 @@ using rtl::OUStringBuffer; using com::sun::star::beans::PropertyValue; using com::sun::star::io::XInputStream; using com::sun::star::io::XActiveDataSink; -using com::sun::star::io::XTextInputStream; +using com::sun::star::io::TextInputStream; +using com::sun::star::io::XTextInputStream2; using com::sun::star::container::XEnumeration; using com::sun::star::container::XNameContainer; using com::sun::star::xforms::XFormsSupplier; @@ -838,11 +840,8 @@ static OUString lcl_serializeForDisplay( const Reference<XNodeList>& xNodes ) aSerialization.serialize(); // copy stream into buffer - Reference<XTextInputStream> xTextInputStream( - createInstance( "com.sun.star.io.TextInputStream" ), - UNO_QUERY ); - Reference<XActiveDataSink>( xTextInputStream, UNO_QUERY_THROW ) - ->setInputStream( aSerialization.getInputStream() ); + Reference<XTextInputStream2> xTextInputStream = TextInputStream::create( comphelper::getProcessComponentContext() ); + xTextInputStream->setInputStream( aSerialization.getInputStream() ); /* WORK AROUND for problem in serialization: currently, multiple XML delarations (<?xml...?>) are being written out and we don't diff --git a/forms/source/xforms/unohelper.cxx b/forms/source/xforms/unohelper.cxx index 15e9dae1ca84..df62262a264b 100644 --- a/forms/source/xforms/unohelper.cxx +++ b/forms/source/xforms/unohelper.cxx @@ -46,17 +46,6 @@ using com::sun::star::beans::PropertyAttribute::READONLY; using rtl::OUString; -Reference<XInterface> xforms::createInstance( const OUString& sServiceName ) -{ - Reference<XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory(); - OSL_ENSURE( xFactory.is(), "can't get service factory" ); - - Reference<XInterface> xInstance = xFactory->createInstance( sServiceName ); - OSL_ENSURE( xInstance.is(), "failed to create instance" ); - - return xInstance; -} - void xforms::copy( const Reference<XPropertySet>& xFrom, Reference<XPropertySet>& xTo ) { diff --git a/forms/source/xforms/unohelper.hxx b/forms/source/xforms/unohelper.hxx index 41e78fde5b9c..84f07da13316 100644 --- a/forms/source/xforms/unohelper.hxx +++ b/forms/source/xforms/unohelper.hxx @@ -35,10 +35,6 @@ namespace com { namespace sun { namespace star { namespace xforms { -/** instantiate a UNO service using the process global service factory */ -com::sun::star::uno::Reference<com::sun::star::uno::XInterface> - createInstance( const rtl::OUString& sServiceName ); - /** copy the properties from one PropertySet into the next */ void copy( const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& , com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& ); |