summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-12-25 15:17:55 +0200
committerNoel Grandin <noel@peralex.com>2015-01-06 10:59:41 +0200
commitdc28e90d200a839d4017d548217ee5ce8a23f848 (patch)
treea6ae872fb19a046292d96d280da286a20a397def /xmloff
parent465356ecc81e23016b4289ab16e99084f2a7b84e (diff)
fdo#84938: convert IMPORT_ constants to 'enum class'
Change-Id: Idaa8f07c62b3ba93c27ca5fe286720254baac10d
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/SchXMLImport.hxx2
-rw-r--r--xmloff/source/chart/SchXMLImport.cxx12
-rw-r--r--xmloff/source/chart/contexts.cxx8
-rw-r--r--xmloff/source/core/xmlimp.cxx8
-rw-r--r--xmloff/source/draw/animationimport.cxx2
-rw-r--r--xmloff/source/draw/sdxmlimp.cxx36
-rw-r--r--xmloff/source/draw/sdxmlimp_impl.hxx2
-rw-r--r--xmloff/source/draw/ximpshap.cxx2
-rw-r--r--xmloff/source/forms/layerimport.cxx2
9 files changed, 37 insertions, 37 deletions
diff --git a/xmloff/inc/SchXMLImport.hxx b/xmloff/inc/SchXMLImport.hxx
index 8b6286dfedef..6535faacfe80 100644
--- a/xmloff/inc/SchXMLImport.hxx
+++ b/xmloff/inc/SchXMLImport.hxx
@@ -172,7 +172,7 @@ public:
// #110680#
SchXMLImport(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
- OUString const & implementationName, sal_uInt16 nImportFlags );
+ OUString const & implementationName, SvXMLImportFlags nImportFlags );
virtual ~SchXMLImport() throw ();
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index 52a09d550e3e..ce11bea12497 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -515,7 +515,7 @@ Reference< chart2::XDataSeries > SchXMLImportHelper::GetNewDataSeries(
// #110680#
SchXMLImport::SchXMLImport(
const Reference< uno::XComponentContext >& xContext,
- OUString const & implementationName, sal_uInt16 nImportFlags ) :
+ OUString const & implementationName, SvXMLImportFlags nImportFlags ) :
SvXMLImport( xContext, implementationName, nImportFlags )
{
GetNamespaceMap().Add( GetXMLToken(XML_NP_XLINK), GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK );
@@ -554,7 +554,7 @@ SvXMLImportContext *SchXMLImport::CreateContext( sal_uInt16 nPrefix, const OUStr
} else if ( (XML_NAMESPACE_OFFICE == nPrefix) &&
( IsXMLToken(rLocalName, XML_DOCUMENT) ||
(IsXMLToken(rLocalName, XML_DOCUMENT_META)
- && (getImportFlags() & IMPORT_META) )) )
+ && (getImportFlags() & SvXMLImportFlags::META) )) )
{
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
GetModel(), uno::UNO_QUERY);
@@ -680,7 +680,7 @@ OUString SAL_CALL SchXMLImport_getImplementationName() throw()
Reference< uno::XInterface > SAL_CALL SchXMLImport_createInstance(const Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
{
// #110680#
- return (cppu::OWeakObject*)new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_getImplementationName(), IMPORT_ALL);
+ return (cppu::OWeakObject*)new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_getImplementationName(), SvXMLImportFlags::ALL);
}
// multiple storage version: one for content / styles / meta
@@ -700,7 +700,7 @@ OUString SAL_CALL SchXMLImport_Styles_getImplementationName() throw()
Reference< uno::XInterface > SAL_CALL SchXMLImport_Styles_createInstance(const Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
{
// #110680#
- return (cppu::OWeakObject*)new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_Styles_getImplementationName(), IMPORT_STYLES );
+ return (cppu::OWeakObject*)new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_Styles_getImplementationName(), SvXMLImportFlags::STYLES );
}
Sequence< OUString > SAL_CALL SchXMLImport_Content_getSupportedServiceNames() throw()
@@ -718,7 +718,7 @@ OUString SAL_CALL SchXMLImport_Content_getImplementationName() throw()
Reference< uno::XInterface > SAL_CALL SchXMLImport_Content_createInstance(const Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
{
// #110680#
- return (cppu::OWeakObject*)new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_Content_getImplementationName(), IMPORT_CONTENT | IMPORT_AUTOSTYLES | IMPORT_FONTDECLS );
+ return (cppu::OWeakObject*)new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_Content_getImplementationName(), SvXMLImportFlags::CONTENT | SvXMLImportFlags::AUTOSTYLES | SvXMLImportFlags::FONTDECLS );
}
Sequence< OUString > SAL_CALL SchXMLImport_Meta_getSupportedServiceNames() throw()
@@ -736,7 +736,7 @@ OUString SAL_CALL SchXMLImport_Meta_getImplementationName() throw()
Reference< uno::XInterface > SAL_CALL SchXMLImport_Meta_createInstance(const Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
{
// #110680#
- return (cppu::OWeakObject*)new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_Meta_getImplementationName(), IMPORT_META );
+ return (cppu::OWeakObject*)new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_Meta_getImplementationName(), SvXMLImportFlags::META );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/chart/contexts.cxx b/xmloff/source/chart/contexts.cxx
index e6fff5f1788f..7c212e56aab8 100644
--- a/xmloff/source/chart/contexts.cxx
+++ b/xmloff/source/chart/contexts.cxx
@@ -95,12 +95,12 @@ SvXMLImportContext* SchXMLDocContext::CreateChildContext(
{
SvXMLImportContext* pContext = 0;
const SvXMLTokenMap& rTokenMap = mrImportHelper.GetDocElemTokenMap();
- sal_uInt16 nFlags = GetImport().getImportFlags();
+ SvXMLImportFlags nFlags = GetImport().getImportFlags();
switch( rTokenMap.Get( nPrefix, rLocalName ))
{
case XML_TOK_DOC_AUTOSTYLES:
- if( nFlags & IMPORT_AUTOSTYLES )
+ if( nFlags & SvXMLImportFlags::AUTOSTYLES )
// not nice, but this is safe, as the SchXMLDocContext class can only by
// instantiated by the chart import class SchXMLImport (header is not exported)
pContext =
@@ -108,7 +108,7 @@ SvXMLImportContext* SchXMLDocContext::CreateChildContext(
break;
case XML_TOK_DOC_STYLES:
// for draw styles containing gradients/hatches/markers and dashes
- if( nFlags & IMPORT_STYLES )
+ if( nFlags & SvXMLImportFlags::STYLES )
pContext = new SvXMLStylesContext( GetImport(), nPrefix, rLocalName, xAttrList );
break;
case XML_TOK_DOC_META:
@@ -118,7 +118,7 @@ SvXMLImportContext* SchXMLDocContext::CreateChildContext(
pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList );
break;
case XML_TOK_DOC_BODY:
- if( nFlags & IMPORT_CONTENT )
+ if( nFlags & SvXMLImportFlags::CONTENT )
pContext = new SchXMLBodyContext_Impl( mrImportHelper, GetImport(), nPrefix, rLocalName );
break;
}
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index d688e8fe837b..56cf1f6e1784 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -354,7 +354,7 @@ SvXMLImportContext *SvXMLImport::CreateFastContext( sal_Int32 /*Element*/,
void SvXMLImport::_InitCtor()
{
- if( mnImportFlags != 0 )
+ if( mnImportFlags != SvXMLImportFlags::NONE )
{
// implicit "xml" namespace prefix
mpNamespaceMap->Add( GetXMLToken(XML_XML), GetXMLToken(XML_N_XML), XML_NAMESPACE_XML );
@@ -413,7 +413,7 @@ void SvXMLImport::_InitCtor()
SvXMLImport::SvXMLImport(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
- OUString const & implementationName, sal_uInt16 nImportFlags ) throw ()
+ OUString const & implementationName, SvXMLImportFlags nImportFlags ) throw ()
: mpImpl( new SvXMLImport_Impl(xContext, implementationName) ),
mpNamespaceMap( new SvXMLNamespaceMap ),
@@ -1253,7 +1253,7 @@ bool SvXMLImport::IsPackageURL( const OUString& rURL ) const
{
// if, and only if, only parts are imported, then we're in a package
- const sal_uInt32 nTest = IMPORT_META|IMPORT_STYLES|IMPORT_CONTENT|IMPORT_SETTINGS;
+ const SvXMLImportFlags nTest = SvXMLImportFlags::META|SvXMLImportFlags::STYLES|SvXMLImportFlags::CONTENT|SvXMLImportFlags::SETTINGS;
if( (mnImportFlags & nTest) == nTest )
return false;
@@ -1575,7 +1575,7 @@ void SvXMLImport::SetStyles( SvXMLStylesContext *pStyles )
void SvXMLImport::SetAutoStyles( SvXMLStylesContext *pAutoStyles )
{
- if (pAutoStyles && mxNumberStyles.is() && (mnImportFlags & IMPORT_CONTENT) )
+ if (pAutoStyles && mxNumberStyles.is() && (mnImportFlags & SvXMLImportFlags::CONTENT) )
{
uno::Reference<xml::sax::XAttributeList> xAttrList;
uno::Sequence< OUString > aNames = mxNumberStyles->getElementNames();
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx
index 0cbbd29432f6..a72dcedc6fb0 100644
--- a/xmloff/source/draw/animationimport.cxx
+++ b/xmloff/source/draw/animationimport.cxx
@@ -1275,7 +1275,7 @@ private:
};
AnimationsImport::AnimationsImport( const Reference< XComponentContext > & rxContext )
-: SvXMLImport( rxContext, AnimationsImport_getImplementationName(), IMPORT_META )
+: SvXMLImport( rxContext, AnimationsImport_getImplementationName(), SvXMLImportFlags::META )
//FIXME: the above "IMPORT_META" used to be a nonsensical "true", question
// remainst whether this should be IMPORT_META (same numerical value as
// true) or default IMPORT_ALL
diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx
index 06df8eca4403..aa2172656889 100644
--- a/xmloff/source/draw/sdxmlimp.cxx
+++ b/xmloff/source/draw/sdxmlimp.cxx
@@ -140,7 +140,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext(
}
case XML_TOK_DOC_SETTINGS:
{
- if( GetImport().getImportFlags() & IMPORT_SETTINGS )
+ if( GetImport().getImportFlags() & SvXMLImportFlags::SETTINGS )
{
pContext = new XMLDocumentSettingsContext(GetImport(), nPrefix, rLocalName, xAttrList );
}
@@ -148,7 +148,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext(
}
case XML_TOK_DOC_STYLES:
{
- if( GetImport().getImportFlags() & IMPORT_STYLES )
+ if( GetImport().getImportFlags() & SvXMLImportFlags::STYLES )
{
// office:styles inside office:document
pContext = GetSdImport().CreateStylesContext(rLocalName, xAttrList);
@@ -157,7 +157,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext(
}
case XML_TOK_DOC_AUTOSTYLES:
{
- if( GetImport().getImportFlags() & IMPORT_AUTOSTYLES )
+ if( GetImport().getImportFlags() & SvXMLImportFlags::AUTOSTYLES )
{
// office:automatic-styles inside office:document
pContext = GetSdImport().CreateAutoStylesContext(rLocalName, xAttrList);
@@ -166,7 +166,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext(
}
case XML_TOK_DOC_MASTERSTYLES:
{
- if( GetImport().getImportFlags() & IMPORT_MASTERSTYLES )
+ if( GetImport().getImportFlags() & SvXMLImportFlags::MASTERSTYLES )
{
// office:master-styles inside office:document
pContext = GetSdImport().CreateMasterStylesContext(rLocalName, xAttrList);
@@ -180,7 +180,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext(
}
case XML_TOK_DOC_SCRIPT:
{
- if( GetImport().getImportFlags() & IMPORT_SCRIPTS )
+ if( GetImport().getImportFlags() & SvXMLImportFlags::SCRIPTS )
{
// office:script inside office:document
pContext = GetSdImport().CreateScriptContext( rLocalName );
@@ -189,7 +189,7 @@ SvXMLImportContext *SdXMLDocContext_Impl::CreateChildContext(
}
case XML_TOK_DOC_BODY:
{
- if( GetImport().getImportFlags() & IMPORT_CONTENT )
+ if( GetImport().getImportFlags() & SvXMLImportFlags::CONTENT )
{
// office:body inside office:document
pContext = new SdXMLBodyContext_Impl(GetSdImport(),nPrefix,
@@ -267,26 +267,26 @@ uno::Reference< uno::XInterface > SAL_CALL classname##_createInstance(const uno:
return (cppu::OWeakObject*)new SdXMLImport( comphelper::getComponentContext(rSMgr), implementationname, draw, flags ); \
}
-SERVICE( XMLImpressImportOasis, "com.sun.star.comp.Impress.XMLOasisImporter", "XMLImpressImportOasis", false, IMPORT_ALL )
-SERVICE( XMLDrawImportOasis, "com.sun.star.comp.Draw.XMLOasisImporter", "XMLDrawImportOasis", true, IMPORT_ALL )
+SERVICE( XMLImpressImportOasis, "com.sun.star.comp.Impress.XMLOasisImporter", "XMLImpressImportOasis", false, SvXMLImportFlags::ALL )
+SERVICE( XMLDrawImportOasis, "com.sun.star.comp.Draw.XMLOasisImporter", "XMLDrawImportOasis", true, SvXMLImportFlags::ALL )
-SERVICE( XMLImpressStylesImportOasis, "com.sun.star.comp.Impress.XMLOasisStylesImporter", "XMLImpressStylesImportOasis", false, IMPORT_STYLES|IMPORT_AUTOSTYLES|IMPORT_MASTERSTYLES )
-SERVICE( XMLDrawStylesImportOasis, "com.sun.star.comp.Draw.XMLOasisStylesImporter", "XMLImpressStylesImportOasis", true, IMPORT_STYLES|IMPORT_AUTOSTYLES|IMPORT_MASTERSTYLES )
+SERVICE( XMLImpressStylesImportOasis, "com.sun.star.comp.Impress.XMLOasisStylesImporter", "XMLImpressStylesImportOasis", false, SvXMLImportFlags::STYLES|SvXMLImportFlags::AUTOSTYLES|SvXMLImportFlags::MASTERSTYLES )
+SERVICE( XMLDrawStylesImportOasis, "com.sun.star.comp.Draw.XMLOasisStylesImporter", "XMLImpressStylesImportOasis", true, SvXMLImportFlags::STYLES|SvXMLImportFlags::AUTOSTYLES|SvXMLImportFlags::MASTERSTYLES )
-SERVICE( XMLImpressContentImportOasis, "com.sun.star.comp.Impress.XMLOasisContentImporter", "XMLImpressContentImportOasis", false, IMPORT_AUTOSTYLES|IMPORT_CONTENT|IMPORT_SCRIPTS|IMPORT_FONTDECLS )
-SERVICE( XMLDrawContentImportOasis, "com.sun.star.comp.Draw.XMLOasisContentImporter", "XMLImpressContentImportOasis", true, IMPORT_AUTOSTYLES|IMPORT_CONTENT|IMPORT_SCRIPTS|IMPORT_FONTDECLS )
+SERVICE( XMLImpressContentImportOasis, "com.sun.star.comp.Impress.XMLOasisContentImporter", "XMLImpressContentImportOasis", false, SvXMLImportFlags::AUTOSTYLES|SvXMLImportFlags::CONTENT|SvXMLImportFlags::SCRIPTS|SvXMLImportFlags::FONTDECLS )
+SERVICE( XMLDrawContentImportOasis, "com.sun.star.comp.Draw.XMLOasisContentImporter", "XMLImpressContentImportOasis", true, SvXMLImportFlags::AUTOSTYLES|SvXMLImportFlags::CONTENT|SvXMLImportFlags::SCRIPTS|SvXMLImportFlags::FONTDECLS )
-SERVICE( XMLImpressMetaImportOasis, "com.sun.star.comp.Impress.XMLOasisMetaImporter", "XMLImpressMetaImportOasis", false, IMPORT_META )
-SERVICE( XMLDrawMetaImportOasis, "com.sun.star.comp.Draw.XMLOasisMetaImporter", "XMLImpressMetaImportOasis", true, IMPORT_META )
+SERVICE( XMLImpressMetaImportOasis, "com.sun.star.comp.Impress.XMLOasisMetaImporter", "XMLImpressMetaImportOasis", false, SvXMLImportFlags::META )
+SERVICE( XMLDrawMetaImportOasis, "com.sun.star.comp.Draw.XMLOasisMetaImporter", "XMLImpressMetaImportOasis", true, SvXMLImportFlags::META )
-SERVICE( XMLImpressSettingsImportOasis, "com.sun.star.comp.Impress.XMLOasisSettingsImporter", "XMLImpressSettingsImportOasis", false, IMPORT_SETTINGS )
-SERVICE( XMLDrawSettingsImportOasis, "com.sun.star.comp.Draw.XMLOasisSettingsImporter", "XMLImpressSettingsImportOasis", true, IMPORT_SETTINGS )
+SERVICE( XMLImpressSettingsImportOasis, "com.sun.star.comp.Impress.XMLOasisSettingsImporter", "XMLImpressSettingsImportOasis", false, SvXMLImportFlags::SETTINGS )
+SERVICE( XMLDrawSettingsImportOasis, "com.sun.star.comp.Draw.XMLOasisSettingsImporter", "XMLImpressSettingsImportOasis", true, SvXMLImportFlags::SETTINGS )
// #110680#
SdXMLImport::SdXMLImport(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
OUString const & implementationName,
- bool bIsDraw, sal_uInt16 nImportFlags )
+ bool bIsDraw, SvXMLImportFlags nImportFlags )
: SvXMLImport( xContext, implementationName, nImportFlags ),
mpMasterStylesContext(0L),
mpDocElemTokenMap(0L),
@@ -681,7 +681,7 @@ SvXMLImportContext *SdXMLImport::CreateMetaContext(const OUString& rLocalName,
{
SvXMLImportContext* pContext = 0L;
- if (getImportFlags() & IMPORT_META)
+ if (getImportFlags() & SvXMLImportFlags::META)
{
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
GetModel(), uno::UNO_QUERY_THROW);
diff --git a/xmloff/source/draw/sdxmlimp_impl.hxx b/xmloff/source/draw/sdxmlimp_impl.hxx
index 2f15ee467953..23e192903495 100644
--- a/xmloff/source/draw/sdxmlimp_impl.hxx
+++ b/xmloff/source/draw/sdxmlimp_impl.hxx
@@ -221,7 +221,7 @@ public:
SdXMLImport(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
OUString const & implementationName,
- bool bIsDraw, sal_uInt16 nImportFlags );
+ bool bIsDraw, SvXMLImportFlags nImportFlags );
virtual ~SdXMLImport() throw ();
// XImporter
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index eb3bab44f9be..316b37912a00 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -2692,7 +2692,7 @@ void SdXMLObjectShapeContext::StartElement( const ::com::sun::star::uno::Referen
// #i13140# Check for more than empty string in maHref, there are
// other possibilities that maHref results in empty container
// storage names
- if( !(GetImport().getImportFlags() & IMPORT_EMBEDDED) && !mbIsPlaceholder && ImpIsEmptyURL(maHref) )
+ if( !(GetImport().getImportFlags() & SvXMLImportFlags::EMBEDDED) && !mbIsPlaceholder && ImpIsEmptyURL(maHref) )
return;
OUString service("com.sun.star.drawing.OLE2Shape");
diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx
index 47f62fc00300..aa5f578d69c7 100644
--- a/xmloff/source/forms/layerimport.cxx
+++ b/xmloff/source/forms/layerimport.cxx
@@ -509,7 +509,7 @@ SvXMLImportContext* OFormLayerXMLImport_Impl::createContext(const sal_uInt16 _nP
void OFormLayerXMLImport_Impl::documentDone( )
{
SvXMLImport& rImport = getGlobalContext();
- if ( ( rImport.getImportFlags() & IMPORT_CONTENT ) == 0 )
+ if ( !( rImport.getImportFlags() & SvXMLImportFlags::CONTENT ) )
return;
// create (and bind) the spreadsheet cell bindings