summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-10-22 16:59:03 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-10-22 16:59:03 +0200
commitab3e0975e1bf8d662e7d154de9313a491dc02b31 (patch)
treec9c253243157b358b137acdf64f863554c712e8f
parente9e2d065b33d441ffa8838cc15f70a99155893de (diff)
fdo#46808: Adapt to core css.xml.sax.Writer changes
Change-Id: Ic1f0e96bbf8f3f9ea0d5ab9678f6efd0a929999f
-rw-r--r--bf_sfx2/source/appl/sfx2_namecont.cxx32
-rw-r--r--bf_sfx2/source/appl/sfx2_scriptcont.cxx17
2 files changed, 16 insertions, 33 deletions
diff --git a/bf_sfx2/source/appl/sfx2_namecont.cxx b/bf_sfx2/source/appl/sfx2_namecont.cxx
index ee5162cca..312bd8444 100644
--- a/bf_sfx2/source/appl/sfx2_namecont.cxx
+++ b/bf_sfx2/source/appl/sfx2_namecont.cxx
@@ -28,10 +28,12 @@
#include <bf_svtools/ehdl.hxx>
#include "bf_basic/basmgr.hxx"
+#include <com/sun/star/xml/sax/Writer.hpp>
#include <com/sun/star/xml/sax/XParser.hpp>
#include <com/sun/star/io/XActiveDataSource.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/uno/DeploymentException.hpp>
+#include <comphelper/processfactory.hxx>
#include <legacysmgr/legacy_binfilters_smgr.hxx>
@@ -840,14 +842,8 @@ void SfxLibraryContainer_Impl::implStoreLibraryIndexFile( SfxLibrary_Impl* pLib,
const ::xmlscript::LibDescriptor& rLib, SotStorageRef xStorage )
{
// Create sax writer
- Reference< XExtendedDocumentHandler > xHandler(
- mxMSF->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer") ) ), UNO_QUERY );
- if( !xHandler.is() )
- {
- OSL_FAIL( "### couldn't create sax-writer component\n" );
- return;
- }
+ Reference< XWriter > xWriter(
+ Writer::create( comphelper::getComponentContext( mxMSF ) ) );
sal_Bool bLink = pLib->mbLink;
sal_Bool bStorage = xStorage.Is() && !bLink;
@@ -905,10 +901,9 @@ void SfxLibraryContainer_Impl::implStoreLibraryIndexFile( SfxLibrary_Impl* pLib,
return;
}
- Reference< XActiveDataSource > xSource( xHandler, UNO_QUERY );
- xSource->setOutputStream( xOut );
+ xWriter->setOutputStream( xOut );
- xmlscript::exportLibrary( xHandler, rLib );
+ xmlscript::exportLibrary( xWriter, rLib );
if( xInfoStream.Is() )
xInfoStream->Commit();
@@ -1157,14 +1152,8 @@ void SfxLibraryContainer_Impl::implStoreLibraryIndexFile( SfxLibrary_Impl* pLib,
/*N*/
/*N*/ // Write library container info
/*N*/ // Create sax writer
-/*N*/ Reference< XExtendedDocumentHandler > xHandler(
-/*N*/ mxMSF->createInstance(
-/*N*/ OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer") ) ), UNO_QUERY );
-/*N*/ if( !xHandler.is() )
-/*N*/ {
-/*N*/ OSL_FAIL( "### couldn't create sax-writer component\n" );
-/*N*/ return;
-/*N*/ }
+ Reference< XWriter > xWriter(
+ Writer::create( comphelper::getComponentContext( mxMSF ) ) );
/*N*/
/*N*/ // Write info file
/*N*/ Reference< XOutputStream > xOut;
@@ -1222,10 +1211,9 @@ void SfxLibraryContainer_Impl::implStoreLibraryIndexFile( SfxLibrary_Impl* pLib,
/*N*/ return;
/*N*/ }
/*N*/
-/*N*/ Reference< XActiveDataSource > xSource( xHandler, UNO_QUERY );
-/*N*/ xSource->setOutputStream( xOut );
+/*N*/ xWriter->setOutputStream( xOut );
/*N*/
-/*N*/ xmlscript::exportLibraryContainer( xHandler, pLibArray );
+/*N*/ xmlscript::exportLibraryContainer( xWriter, pLibArray );
/*N*/ if( xInfoStream.Is() )
/*?*/ xInfoStream->Commit();
/*N*/ if( xLibrariesStor.Is() )
diff --git a/bf_sfx2/source/appl/sfx2_scriptcont.cxx b/bf_sfx2/source/appl/sfx2_scriptcont.cxx
index 6453a76e3..70a197bfa 100644
--- a/bf_sfx2/source/appl/sfx2_scriptcont.cxx
+++ b/bf_sfx2/source/appl/sfx2_scriptcont.cxx
@@ -17,9 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <com/sun/star/xml/sax/Writer.hpp>
#include <com/sun/star/xml/sax/XParser.hpp>
#include <com/sun/star/io/XActiveDataSource.hpp>
+#include <comphelper/processfactory.hxx>
#include <bf_sfx2/sfxuno.hxx>
@@ -172,23 +174,16 @@ void SfxScriptLibraryContainer::setLibraryPassword(
/*?*/ throw(Exception)
/*?*/ {
// Create sax writer
- Reference< XExtendedDocumentHandler > xHandler(
- mxMSF->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer") ) ), UNO_QUERY );
- if( !xHandler.is() )
- {
- OSL_FAIL( "### couldn't create sax-writer component\n" );
- return;
- }
+ Reference< XWriter > xWriter(
+ Writer::create( comphelper::getComponentContext( mxMSF ) ) );
- Reference< XActiveDataSource > xSource( xHandler, UNO_QUERY );
- xSource->setOutputStream( xOutput );
+ xWriter->setOutputStream( xOutput );
xmlscript::ModuleDescriptor aMod;
aMod.aName = aElementName;
aMod.aLanguage = maScriptLanguage;
aElement >>= aMod.aCode;
- xmlscript::exportScriptModule( xHandler, aMod );
+ xmlscript::exportScriptModule( xWriter, aMod );
/*?*/ }