summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-12-28 14:22:51 +0200
committerNoel Grandin <noel@peralex.com>2015-01-06 10:59:42 +0200
commitc29657e0d6bb707345584ac7a7f5ae5016f37297 (patch)
tree89cd11551729836a979570744da3c81090e330dd /sw/source
parentec5bf66d366cd42774a87465e1187271f48a4ab1 (diff)
fdo#84938: convert EXPORT_ #defines to 'enum class'
Change-Id: I2ed239fa073b5fa8fb56c1af9d4b0bac89acfacf
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/xml/xmlexp.cxx40
-rw-r--r--sw/source/filter/xml/xmlexp.hxx2
-rw-r--r--sw/source/filter/xml/xmlexpit.cxx2
-rw-r--r--sw/source/filter/xml/xmlfmte.cxx14
-rw-r--r--sw/source/filter/xml/xmlfonte.cxx2
-rw-r--r--sw/source/filter/xml/xmltble.cxx4
-rw-r--r--sw/source/filter/xml/xmltexte.cxx12
7 files changed, 38 insertions, 38 deletions
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index f43b8cb46289..1af695cc928f 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -84,7 +84,7 @@ using namespace ::xmloff::token;
SwXMLExport::SwXMLExport(
const uno::Reference< uno::XComponentContext > xContext,
- OUString const & implementationName, sal_uInt16 nExportFlags)
+ OUString const & implementationName, SvXMLExportFlags nExportFlags)
: SvXMLExport( util::MeasureUnit::INCH, xContext, implementationName, XML_TEXT,
nExportFlags ),
pTableItemMapper( 0 ),
@@ -135,8 +135,8 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
SwDoc *pDoc = getDoc();
bool bExtended = false;
- if( (getExportFlags() & (EXPORT_FONTDECLS|EXPORT_STYLES|
- EXPORT_MASTERSTYLES|EXPORT_CONTENT)) != 0 )
+ if( getExportFlags() & (SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::STYLES|
+ SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT))
{
if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 )
{
@@ -195,7 +195,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
SetExtended( bExtended );
- if( (getExportFlags() & EXPORT_META) != 0 )
+ if( getExportFlags() & SvXMLExportFlags::META)
{
// Update doc stat, so that correct values are exported and
// the progress works correctly.
@@ -231,7 +231,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
}
}
- if( (getExportFlags() & (EXPORT_MASTERSTYLES|EXPORT_CONTENT)) != 0 )
+ if( getExportFlags() & (SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT))
{
//Auf die Korrektheit der OrdNums sind wir schon angewiesen.
SwDrawModel* pModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
@@ -276,7 +276,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
// set redline mode if we export STYLES or CONTENT, unless redline
// mode is taken care of outside (through info XPropertySet)
bool bSaveRedline =
- ( (getExportFlags() & (EXPORT_CONTENT|EXPORT_STYLES)) != 0 );
+ bool( getExportFlags() & (SvXMLExportFlags::CONTENT|SvXMLExportFlags::STYLES) );
if( bSaveRedline )
{
// if the info property set has a ShowChanges property,
@@ -522,7 +522,7 @@ Reference< XInterface > SAL_CALL SwXMLExportOOO_createInstance(
const Reference< XMultiServiceFactory > & rSMgr)
throw( Exception )
{
- return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportOOO_getImplementationName(), EXPORT_ALL);
+ return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportOOO_getImplementationName(), SvXMLExportFlags::ALL);
}
OUString SAL_CALL SwXMLExportStylesOOO_getImplementationName() throw()
@@ -544,8 +544,8 @@ Reference< XInterface > SAL_CALL SwXMLExportStylesOOO_createInstance(
throw( Exception )
{
return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportStylesOOO_getImplementationName(),
- EXPORT_STYLES | EXPORT_MASTERSTYLES | EXPORT_AUTOSTYLES |
- EXPORT_FONTDECLS );
+ SvXMLExportFlags::STYLES | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::AUTOSTYLES |
+ SvXMLExportFlags::FONTDECLS );
}
OUString SAL_CALL SwXMLExportContentOOO_getImplementationName() throw()
@@ -567,8 +567,8 @@ Reference< XInterface > SAL_CALL SwXMLExportContentOOO_createInstance(
throw( Exception )
{
return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportContentOOO_getImplementationName(),
- EXPORT_AUTOSTYLES | EXPORT_CONTENT | EXPORT_SCRIPTS |
- EXPORT_FONTDECLS );
+ SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::CONTENT | SvXMLExportFlags::SCRIPTS |
+ SvXMLExportFlags::FONTDECLS );
}
OUString SAL_CALL SwXMLExportMetaOOO_getImplementationName() throw()
@@ -589,7 +589,7 @@ Reference< XInterface > SAL_CALL SwXMLExportMetaOOO_createInstance(
const Reference< XMultiServiceFactory > & rSMgr)
throw( Exception )
{
- return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportMetaOOO_getImplementationName(), EXPORT_META);
+ return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportMetaOOO_getImplementationName(), SvXMLExportFlags::META);
}
OUString SAL_CALL SwXMLExportSettingsOOO_getImplementationName() throw()
@@ -610,7 +610,7 @@ Reference< XInterface > SAL_CALL SwXMLExportSettingsOOO_createInstance(
const Reference< XMultiServiceFactory > & rSMgr)
throw( Exception )
{
- return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportSettingsOOO_getImplementationName(), EXPORT_SETTINGS);
+ return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportSettingsOOO_getImplementationName(), SvXMLExportFlags::SETTINGS);
}
// OASIS
@@ -632,7 +632,7 @@ Reference< XInterface > SAL_CALL SwXMLExport_createInstance(
const Reference< XMultiServiceFactory > & rSMgr)
throw( Exception )
{
- return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExport_getImplementationName(), EXPORT_ALL|EXPORT_OASIS);
+ return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExport_getImplementationName(), SvXMLExportFlags::ALL|SvXMLExportFlags::OASIS);
}
OUString SAL_CALL SwXMLExportStyles_getImplementationName() throw()
@@ -654,8 +654,8 @@ Reference< XInterface > SAL_CALL SwXMLExportStyles_createInstance(
throw( Exception )
{
return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportStyles_getImplementationName(),
- EXPORT_STYLES | EXPORT_MASTERSTYLES | EXPORT_AUTOSTYLES |
- EXPORT_FONTDECLS|EXPORT_OASIS );
+ SvXMLExportFlags::STYLES | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::AUTOSTYLES |
+ SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::OASIS );
}
OUString SAL_CALL SwXMLExportContent_getImplementationName() throw()
@@ -678,8 +678,8 @@ Reference< XInterface > SAL_CALL SwXMLExportContent_createInstance(
{
return (cppu::OWeakObject*)new SwXMLExport(
comphelper::getComponentContext(rSMgr), SwXMLExportContent_getImplementationName(),
- EXPORT_AUTOSTYLES | EXPORT_CONTENT | EXPORT_SCRIPTS |
- EXPORT_FONTDECLS|EXPORT_OASIS );
+ SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::CONTENT | SvXMLExportFlags::SCRIPTS |
+ SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::OASIS );
}
OUString SAL_CALL SwXMLExportMeta_getImplementationName() throw()
@@ -700,7 +700,7 @@ Reference< XInterface > SAL_CALL SwXMLExportMeta_createInstance(
const Reference< XMultiServiceFactory > & rSMgr)
throw( Exception )
{
- return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportMeta_getImplementationName(), EXPORT_META|EXPORT_OASIS);
+ return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportMeta_getImplementationName(), SvXMLExportFlags::META|SvXMLExportFlags::OASIS);
}
OUString SAL_CALL SwXMLExportSettings_getImplementationName() throw()
@@ -721,7 +721,7 @@ Reference< XInterface > SAL_CALL SwXMLExportSettings_createInstance(
const Reference< XMultiServiceFactory > & rSMgr)
throw( Exception )
{
- return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportSettings_getImplementationName(), EXPORT_SETTINGS|EXPORT_OASIS);
+ return (cppu::OWeakObject*)new SwXMLExport( comphelper::getComponentContext(rSMgr), SwXMLExportSettings_getImplementationName(), SvXMLExportFlags::SETTINGS|SvXMLExportFlags::OASIS);
}
namespace
diff --git a/sw/source/filter/xml/xmlexp.hxx b/sw/source/filter/xml/xmlexp.hxx
index 99cf7a5b54d1..08f86a4e3172 100644
--- a/sw/source/filter/xml/xmlexp.hxx
+++ b/sw/source/filter/xml/xmlexp.hxx
@@ -117,7 +117,7 @@ protected:
public:
SwXMLExport(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext,
- OUString const & implementationName, sal_uInt16 nExportFlags);
+ OUString const & implementationName, SvXMLExportFlags nExportFlags);
virtual ~SwXMLExport();
diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx
index d8415d4ccf26..ba5aeef44a21 100644
--- a/sw/source/filter/xml/xmlexpit.cxx
+++ b/sw/source/filter/xml/xmlexpit.cxx
@@ -123,7 +123,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport,
bool bAddAttribute = true;
if( rEntry.nNameSpace == XML_NAMESPACE_STYLE )
{
- if( (rExport.getExportFlags() & EXPORT_SAVEBACKWARDCOMPATIBLE ) == 0 ||
+ if( !(rExport.getExportFlags() & SvXMLExportFlags::SAVEBACKWARDCOMPATIBLE ) ||
!QueryXMLValue(rItem, aValue,
static_cast< sal_uInt16 >( rEntry.nMemberId & MID_SW_FLAG_MASK ),
rUnitConverter ) )
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx
index df323eb743e3..634da16cf838 100644
--- a/sw/source/filter/xml/xmlfmte.cxx
+++ b/sw/source/filter/xml/xmlfmte.cxx
@@ -180,9 +180,9 @@ void SwXMLExport::_ExportAutoStyles()
// the order in which they are exported. Otherwise, caching will
// fail.
- if( (getExportFlags() & (EXPORT_MASTERSTYLES|EXPORT_CONTENT)) != 0 )
+ if( getExportFlags() & (SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) )
{
- if( (getExportFlags() & EXPORT_CONTENT) == 0 )
+ if( !(getExportFlags() & SvXMLExportFlags::CONTENT) )
{
// only master pages are exported => styles for frames bound
// to frames (but none for frames bound to pages) need to be
@@ -192,17 +192,17 @@ void SwXMLExport::_ExportAutoStyles()
}
// exported in _ExportMasterStyles
- if( (getExportFlags() & EXPORT_MASTERSTYLES) != 0 )
+ if( getExportFlags() & SvXMLExportFlags::MASTERSTYLES )
GetPageExport()->collectAutoStyles( false );
// if we don't export styles (i.e. in content stream only, but not
// in single-stream case), then we can save ourselves a bit of
// work and memory by not collecting field masters
- if( (getExportFlags() & EXPORT_STYLES ) == 0 )
+ if( !(getExportFlags() & SvXMLExportFlags::STYLES) )
GetTextParagraphExport()->exportUsedDeclarations( false );
// exported in _ExportContent
- if( (getExportFlags() & EXPORT_CONTENT) != 0 )
+ if( getExportFlags() & SvXMLExportFlags::CONTENT )
{
GetTextParagraphExport()->exportTrackedChanges( true );
Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
@@ -224,14 +224,14 @@ void SwXMLExport::_ExportAutoStyles()
GetTextParagraphExport()->exportTextAutoStyles();
GetShapeExport()->exportAutoStyles();
- if( (getExportFlags() & EXPORT_MASTERSTYLES) != 0 )
+ if( getExportFlags() & SvXMLExportFlags::MASTERSTYLES )
GetPageExport()->exportAutoStyles();
// we rely on data styles being written after cell styles in the
// ExportFmt() method; so be careful when changing order.
exportAutoDataStyles();
- sal_uInt16 nContentAutostyles = EXPORT_CONTENT | EXPORT_AUTOSTYLES;
+ SvXMLExportFlags nContentAutostyles = SvXMLExportFlags::CONTENT | SvXMLExportFlags::AUTOSTYLES;
if ( ( getExportFlags() & nContentAutostyles ) == nContentAutostyles )
GetFormExport()->exportAutoStyles();
}
diff --git a/sw/source/filter/xml/xmlfonte.cxx b/sw/source/filter/xml/xmlfonte.cxx
index 8574cd7ddcd7..fbe6263d6b10 100644
--- a/sw/source/filter/xml/xmlfonte.cxx
+++ b/sw/source/filter/xml/xmlfonte.cxx
@@ -77,7 +77,7 @@ XMLFontAutoStylePool* SwXMLExport::CreateFontAutoStylePool()
// written by different SwXMLExport instance, and would therefore write each
// font file twice without complicated checking for duplicates, so handle
// the embedding only in one of them.
- if(( getExportFlags() & EXPORT_CONTENT ) == 0 )
+ if( !( getExportFlags() & SvXMLExportFlags::CONTENT) )
blockFontEmbedding = true;
if( !getDoc()->getIDocumentSettingAccess().get( IDocumentSettingAccess::EMBED_FONTS ))
blockFontEmbedding = true;
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index c92a55ef728c..de682f256edb 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -666,7 +666,7 @@ void SwXMLExport::ExportTableLinesAutoStyles( const SwTableLines& rLines,
rTblInfo.SetBaseSection( xTextSection );
}
- const bool bExportContent = (getExportFlags() & EXPORT_CONTENT ) != 0;
+ const bool bExportContent = bool(getExportFlags() & SvXMLExportFlags::CONTENT );
if ( !bExportContent )
{
// AUTOSTYLES - not needed anymore if we are currently exporting content.xml
@@ -1153,7 +1153,7 @@ void SwXMLTextParagraphExport::exportTable(
// the table is located in header/footer:
// During the flat XML export (used e.g. by .sdw-export)
// ALL flags are set at the same time.
- const bool bExportStyles = ( GetExport().getExportFlags() & EXPORT_STYLES ) != 0;
+ const bool bExportStyles = bool( GetExport().getExportFlags() & SvXMLExportFlags::STYLES );
if ( bExportStyles || !pFmt->GetDoc()->IsInHeaderFooter( aIdx ) )
static_cast<SwXMLExport&>(GetExport()).ExportTableAutoStyles( *pTblNd );
}
diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
index e5eb86c057af..4b7d506a5af2 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -436,7 +436,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded(
{
case SV_EMBEDDED_OUTPLACE:
case SV_EMBEDDED_OWN:
- if( (rXMLExport.getExportFlags() & EXPORT_EMBEDDED) == 0 )
+ if( !(rXMLExport.getExportFlags() & SvXMLExportFlags::EMBEDDED) )
{
OUString sURL;
@@ -600,7 +600,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded(
switch( nType )
{
case SV_EMBEDDED_OWN:
- if( (rXMLExport.getExportFlags() & EXPORT_EMBEDDED) != 0 )
+ if( rXMLExport.getExportFlags() & SvXMLExportFlags::EMBEDDED )
{
Reference < XEmbeddedObjectSupplier > xEOS( rPropSet, UNO_QUERY );
OSL_ENSURE( xEOS.is(), "no embedded object supplier for own object" );
@@ -609,11 +609,11 @@ void SwXMLTextParagraphExport::_exportTextEmbedded(
}
break;
case SV_EMBEDDED_OUTPLACE:
- if( (rXMLExport.getExportFlags() & EXPORT_EMBEDDED) != 0 )
+ if( rXMLExport.getExportFlags() & SvXMLExportFlags::EMBEDDED )
{
OUString sURL( sEmbeddedObjectProtocol + rOLEObj.GetCurrentPersistName() );
- if ( ( rXMLExport.getExportFlags() & EXPORT_OASIS ) == 0 )
+ if ( !( rXMLExport.getExportFlags() & SvXMLExportFlags::OASIS ) )
sURL += "?oasis=false";
rXMLExport.AddEmbeddedObjectAsBase64( sURL );
@@ -678,7 +678,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded(
if( SV_EMBEDDED_OUTPLACE==nType || SV_EMBEDDED_OWN==nType )
{
OUString sURL( sGraphicObjectProtocol + rOLEObj.GetCurrentPersistName() );
- if( (rXMLExport.getExportFlags() & EXPORT_EMBEDDED) == 0 )
+ if( !(rXMLExport.getExportFlags() & SvXMLExportFlags::EMBEDDED) )
{
sURL = GetExport().AddEmbeddedObject( sURL );
lcl_addURL( rXMLExport, sURL, false );
@@ -687,7 +687,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded(
SvXMLElementExport aElementExport( GetExport(), XML_NAMESPACE_DRAW,
XML_IMAGE, false, true );
- if( (rXMLExport.getExportFlags() & EXPORT_EMBEDDED) != 0 )
+ if( rXMLExport.getExportFlags() & SvXMLExportFlags::EMBEDDED )
GetExport().AddEmbeddedObjectAsBase64( sURL );
}