summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-01-08 14:11:58 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-01-08 14:11:58 +0100
commit31911b3cdcd405973b689e10ee86add6f1c40bd1 (patch)
tree3f2de8a7ddacd3e769d391fbd572a8a8a740301e /sw
parentd7a360eb99a403df65574d1e237db04da6e1c4c2 (diff)
Consolidate XServiceInfo for classes derived from SvXMLExport
Change-Id: Ia3e2b5e682a64844bb6c713912c50c7681393d52
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/swg/SwXMLBlockExport.cxx4
-rw-r--r--sw/source/filter/xml/xmlexp.cxx49
-rw-r--r--sw/source/filter/xml/xmlexp.hxx6
3 files changed, 15 insertions, 44 deletions
diff --git a/sw/source/core/swg/SwXMLBlockExport.cxx b/sw/source/core/swg/SwXMLBlockExport.cxx
index 39aa87a1f7bb..93131a4db2f2 100644
--- a/sw/source/core/swg/SwXMLBlockExport.cxx
+++ b/sw/source/core/swg/SwXMLBlockExport.cxx
@@ -32,7 +32,7 @@ SwXMLBlockListExport::SwXMLBlockListExport(
SwXMLTextBlocks & rBlocks,
const OUString &rFileName,
uno::Reference< xml::sax::XDocumentHandler> &rHandler)
-: SvXMLExport( xContext, rFileName, util::MeasureUnit::CM, rHandler ),
+: SvXMLExport( xContext, "", rFileName, util::MeasureUnit::CM, rHandler ),
rBlockList(rBlocks)
{
_GetNamespaceMap().Add( GetXMLToken ( XML_NP_BLOCK_LIST ),
@@ -83,7 +83,7 @@ SwXMLTextBlockExport::SwXMLTextBlockExport(
SwXMLTextBlocks & rBlocks,
const OUString &rFileName,
uno::Reference< xml::sax::XDocumentHandler> &rHandler)
-: SvXMLExport( xContext, rFileName, util::MeasureUnit::CM, rHandler ),
+: SvXMLExport( xContext, "", rFileName, util::MeasureUnit::CM, rHandler ),
rBlockList(rBlocks)
{
_GetNamespaceMap().Add( GetXMLToken ( XML_NP_BLOCK_LIST ),
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index a971029b61a8..df90df5b57ad 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -80,8 +80,8 @@ using namespace ::xmloff::token;
SwXMLExport::SwXMLExport(
const uno::Reference< uno::XComponentContext > xContext,
- sal_uInt16 nExportFlags)
-: SvXMLExport( util::MeasureUnit::INCH, xContext, XML_TEXT,
+ OUString const & implementationName, sal_uInt16 nExportFlags)
+: SvXMLExport( util::MeasureUnit::INCH, xContext, implementationName, XML_TEXT,
nExportFlags ),
pTableItemMapper( 0 ),
pTableLines( 0 ),
@@ -534,7 +534,7 @@ Reference< XInterface > SAL_CALL SwXMLExportOOO_createInstance(
const Reference< XMultiServiceFactory > & rSMgr)
throw( Exception )
{
- return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), EXPORT_ALL);
+ return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportOOO_getImplementationName(), EXPORT_ALL);
}
OUString SAL_CALL SwXMLExportStylesOOO_getImplementationName() throw()
@@ -555,7 +555,7 @@ Reference< XInterface > SAL_CALL SwXMLExportStylesOOO_createInstance(
const Reference< XMultiServiceFactory > & rSMgr)
throw( Exception )
{
- return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr),
+ return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportStylesOOO_getImplementationName(),
EXPORT_STYLES | EXPORT_MASTERSTYLES | EXPORT_AUTOSTYLES |
EXPORT_FONTDECLS );
}
@@ -578,7 +578,7 @@ Reference< XInterface > SAL_CALL SwXMLExportContentOOO_createInstance(
const Reference< XMultiServiceFactory > & rSMgr)
throw( Exception )
{
- return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr),
+ return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportContentOOO_getImplementationName(),
EXPORT_AUTOSTYLES | EXPORT_CONTENT | EXPORT_SCRIPTS |
EXPORT_FONTDECLS );
}
@@ -601,7 +601,7 @@ Reference< XInterface > SAL_CALL SwXMLExportMetaOOO_createInstance(
const Reference< XMultiServiceFactory > & rSMgr)
throw( Exception )
{
- return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), EXPORT_META);
+ return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportMetaOOO_getImplementationName(), EXPORT_META);
}
OUString SAL_CALL SwXMLExportSettingsOOO_getImplementationName() throw()
@@ -622,7 +622,7 @@ Reference< XInterface > SAL_CALL SwXMLExportSettingsOOO_createInstance(
const Reference< XMultiServiceFactory > & rSMgr)
throw( Exception )
{
- return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), EXPORT_SETTINGS);
+ return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportSettingsOOO_getImplementationName(), EXPORT_SETTINGS);
}
// OASIS
@@ -644,7 +644,7 @@ Reference< XInterface > SAL_CALL SwXMLExport_createInstance(
const Reference< XMultiServiceFactory > & rSMgr)
throw( Exception )
{
- return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), EXPORT_ALL|EXPORT_OASIS);
+ return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExport_getImplementationName(), EXPORT_ALL|EXPORT_OASIS);
}
OUString SAL_CALL SwXMLExportStyles_getImplementationName() throw()
@@ -665,7 +665,7 @@ Reference< XInterface > SAL_CALL SwXMLExportStyles_createInstance(
const Reference< XMultiServiceFactory > & rSMgr)
throw( Exception )
{
- return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr),
+ return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportStyles_getImplementationName(),
EXPORT_STYLES | EXPORT_MASTERSTYLES | EXPORT_AUTOSTYLES |
EXPORT_FONTDECLS|EXPORT_OASIS );
}
@@ -689,7 +689,7 @@ Reference< XInterface > SAL_CALL SwXMLExportContent_createInstance(
throw( Exception )
{
return (cppu::OWeakObject*)new SwXMLExport(
- comphelper::getComponentContext(rSMgr),
+ comphelper::getComponentContext(rSMgr), SwXMLExportContent_getImplementationName(),
EXPORT_AUTOSTYLES | EXPORT_CONTENT | EXPORT_SCRIPTS |
EXPORT_FONTDECLS|EXPORT_OASIS );
}
@@ -712,7 +712,7 @@ Reference< XInterface > SAL_CALL SwXMLExportMeta_createInstance(
const Reference< XMultiServiceFactory > & rSMgr)
throw( Exception )
{
- return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), EXPORT_META|EXPORT_OASIS);
+ return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportMeta_getImplementationName(), EXPORT_META|EXPORT_OASIS);
}
OUString SAL_CALL SwXMLExportSettings_getImplementationName() throw()
@@ -733,7 +733,7 @@ Reference< XInterface > SAL_CALL SwXMLExportSettings_createInstance(
const Reference< XMultiServiceFactory > & rSMgr)
throw( Exception )
{
- return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), EXPORT_SETTINGS|EXPORT_OASIS);
+ return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportSettings_getImplementationName(), EXPORT_SETTINGS|EXPORT_OASIS);
}
namespace
@@ -758,31 +758,6 @@ sal_Int64 SAL_CALL SwXMLExport::getSomething( const Sequence< sal_Int8 >& rId )
return SvXMLExport::getSomething( rId );
}
-
-// XServiceInfo
-// override empty method from parent class
-OUString SAL_CALL SwXMLExport::getImplementationName()
- throw(RuntimeException)
-{
- switch( getExportFlags() )
- {
- case EXPORT_ALL:
- return SwXMLExport_getImplementationName();
- case (EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_FONTDECLS):
- return SwXMLExportStyles_getImplementationName();
- case (EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS):
- return SwXMLExportContent_getImplementationName();
- case EXPORT_META:
- return SwXMLExportMeta_getImplementationName();
- case EXPORT_SETTINGS:
- return SwXMLExportSettings_getImplementationName();
- default:
- // generic name for 'unknown' cases
- return OUString(
- "com.sun.star.comp.Writer.SwXMLExport" );
- }
-}
-
SwDoc* SwXMLExport::getDoc()
{
if( doc != NULL )
diff --git a/sw/source/filter/xml/xmlexp.hxx b/sw/source/filter/xml/xmlexp.hxx
index 0fa8c6bdbafb..335643bb2e58 100644
--- a/sw/source/filter/xml/xmlexp.hxx
+++ b/sw/source/filter/xml/xmlexp.hxx
@@ -119,7 +119,7 @@ protected:
public:
SwXMLExport(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext,
- sal_uInt16 nExportFlags = EXPORT_ALL);
+ OUString const & implementationName, sal_uInt16 nExportFlags);
virtual ~SwXMLExport();
@@ -144,10 +144,6 @@ public:
static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
- // XServiceInfo (override parent method)
- OUString SAL_CALL getImplementationName()
- throw( ::com::sun::star::uno::RuntimeException );
-
const SwDoc* getDoc() const;
SwDoc* getDoc();
};