summaryrefslogtreecommitdiff
path: root/sw/source/filter/xml
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-02-04 13:20:48 +0200
committerNoel Grandin <noel@peralex.com>2013-02-12 10:14:43 +0200
commita6a8a8707b6ae111f94bac094d3c2909f523ca6f (patch)
tree402b668480b3106df0d3055cff037c8a768a419c /sw/source/filter/xml
parentf1204419af34b1d2f0ecaa69ceeb1f8c8a7d87df (diff)
fdo#46808, convert xmloff module code to use XComponentContext
with lots of repurcussions in other modules Change-Id: I6982671eecc701b06cf85d93533e1fe618044fea
Diffstat (limited to 'sw/source/filter/xml')
-rw-r--r--sw/source/filter/xml/swxml.cxx4
-rw-r--r--sw/source/filter/xml/xmlimp.cxx15
-rw-r--r--sw/source/filter/xml/xmlimp.hxx2
-rw-r--r--sw/source/filter/xml/xmlitemi.cxx2
4 files changed, 11 insertions, 12 deletions
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 175372d85df5..2d2f108c591e 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -1051,8 +1051,6 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con
size_t XMLReader::GetSectionList( SfxMedium& rMedium,
std::vector<String*>& rStrings ) const
{
- uno::Reference< lang::XMultiServiceFactory > xServiceFactory =
- comphelper::getProcessServiceFactory();
uno::Reference< uno::XComponentContext > xContext =
comphelper::getProcessComponentContext();
uno::Reference < embed::XStorage > xStg2;
@@ -1069,7 +1067,7 @@ size_t XMLReader::GetSectionList( SfxMedium& rMedium,
aParserInput.aInputStream = xStm->getInputStream();
// get filter
- uno::Reference< xml::sax::XDocumentHandler > xFilter = new SwXMLSectionList( xServiceFactory, rStrings );
+ uno::Reference< xml::sax::XDocumentHandler > xFilter = new SwXMLSectionList( xContext, rStrings );
// connect parser and filter
uno::Reference< xml::sax::XParser > xParser = xml::sax::Parser::create(xContext);
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 67fa1efdcb6f..e45dc1cc82d2 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -65,6 +65,7 @@
#include <xmloff/xmlmetai.hxx>
#include <xmloff/xformsimport.hxx>
#include <comphelper/servicehelper.hxx>
+#include <comphelper/processfactory.hxx>
using ::rtl::OUString;
@@ -408,9 +409,9 @@ SvXMLImportContext *SwXMLImport::CreateContext(
}
SwXMLImport::SwXMLImport(
- const uno::Reference< lang::XMultiServiceFactory > xServiceFactory,
+ const uno::Reference< uno::XComponentContext > xContext,
sal_uInt16 nImportFlags)
-: SvXMLImport( xServiceFactory, nImportFlags ),
+: SvXMLImport( xContext, nImportFlags ),
pSttNdIdx( 0 ),
pTableItemMapper( 0 ),
pDocElemTokenMap( 0 ),
@@ -1560,7 +1561,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwXMLImport_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
throw( uno::Exception )
{
- return (cppu::OWeakObject*)new SwXMLImport( rSMgr, IMPORT_ALL );
+ return (cppu::OWeakObject*)new SwXMLImport( comphelper::getComponentContext(rSMgr), IMPORT_ALL );
}
OUString SAL_CALL SwXMLImportStyles_getImplementationName() throw()
@@ -1582,7 +1583,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwXMLImportStyles_createInstance(
throw( uno::Exception )
{
return (cppu::OWeakObject*)new SwXMLImport(
- rSMgr,
+ comphelper::getComponentContext(rSMgr),
IMPORT_STYLES | IMPORT_MASTERSTYLES | IMPORT_AUTOSTYLES |
IMPORT_FONTDECLS );
}
@@ -1606,7 +1607,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwXMLImportContent_createInstance(
throw( uno::Exception )
{
return (cppu::OWeakObject*)new SwXMLImport(
- rSMgr,
+ comphelper::getComponentContext(rSMgr),
IMPORT_AUTOSTYLES | IMPORT_CONTENT | IMPORT_SCRIPTS |
IMPORT_FONTDECLS );
}
@@ -1629,7 +1630,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwXMLImportMeta_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
throw( uno::Exception )
{
- return (cppu::OWeakObject*)new SwXMLImport( rSMgr, IMPORT_META );
+ return (cppu::OWeakObject*)new SwXMLImport( comphelper::getComponentContext(rSMgr), IMPORT_META );
}
OUString SAL_CALL SwXMLImportSettings_getImplementationName() throw()
@@ -1650,7 +1651,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwXMLImportSettings_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
throw( uno::Exception )
{
- return (cppu::OWeakObject*)new SwXMLImport( rSMgr, IMPORT_SETTINGS );
+ return (cppu::OWeakObject*)new SwXMLImport( comphelper::getComponentContext(rSMgr), IMPORT_SETTINGS );
}
diff --git a/sw/source/filter/xml/xmlimp.hxx b/sw/source/filter/xml/xmlimp.hxx
index 992236015971..5e2e4959c918 100644
--- a/sw/source/filter/xml/xmlimp.hxx
+++ b/sw/source/filter/xml/xmlimp.hxx
@@ -109,7 +109,7 @@ protected:
public:
SwXMLImport(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext,
sal_uInt16 nImportFlags = IMPORT_ALL);
~SwXMLImport() throw();
diff --git a/sw/source/filter/xml/xmlitemi.cxx b/sw/source/filter/xml/xmlitemi.cxx
index 8359cafa58d6..3fc237af18e0 100644
--- a/sw/source/filter/xml/xmlitemi.cxx
+++ b/sw/source/filter/xml/xmlitemi.cxx
@@ -336,7 +336,7 @@ SvXMLImportContext *SwXMLItemSetContext_Impl::CreateChildContext(
void SwXMLImport::_InitItemImport()
{
- pTwipUnitConv = new SvXMLUnitConverter( comphelper::getComponentContext(getServiceFactory()),
+ pTwipUnitConv = new SvXMLUnitConverter( GetComponentContext(),
util::MeasureUnit::TWIP, util::MeasureUnit::TWIP );
xTableItemMap = new SvXMLItemMapEntries( aXMLTableItemMap );