diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-02 16:10:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-05 05:55:06 +0000 |
commit | d92d9df55c002323219012cd4896034e2be935fd (patch) | |
tree | 8e701ce7d6be18af4eb368d0f0e2d39a27b1d1b6 | |
parent | fe3e1067bfa8d62d2a43c7ea227d87327ee020d2 (diff) |
convert E_GRAPH_PROV constants to typed_flags
and drop the never checked
E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES
constant
Change-Id: Idd2598c209b34bfa4a58a84ce5ee14a7340d59d4
Reviewed-on: https://gerrit.libreoffice.org/31553
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | filter/source/msfilter/escherex.cxx | 6 | ||||
-rw-r--r-- | include/filter/msfilter/escherex.hxx | 18 | ||||
-rw-r--r-- | oox/source/export/vmlexport.cxx | 2 | ||||
-rw-r--r-- | sd/source/filter/eppt/epptso.cxx | 2 |
4 files changed, 17 insertions, 11 deletions
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index b6d56403d36c..d6c8ce30403c 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -4065,7 +4065,7 @@ bool EscherBlibEntry::operator==( const EscherBlibEntry& rEscherBlibEntry ) cons return true; } -EscherGraphicProvider::EscherGraphicProvider( sal_uInt32 nFlags ) : +EscherGraphicProvider::EscherGraphicProvider( EscherGraphicProviderFlags nFlags ) : mnFlags ( nFlags ), mpBlibEntrys ( nullptr ), mnBlibBufSize ( 0 ), @@ -4326,7 +4326,7 @@ sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const OStrin sal_uInt32 nExtra, nAtomSize = 0; sal_uInt32 nInstance, nUncompressedSize = p_EscherBlibEntry->mnSize; - if ( mnFlags & E_GRAPH_PROV_USE_INSTANCES ) + if ( mnFlags & EscherGraphicProviderFlags::UseInstances ) { rPicOutStrm.WriteUInt32( 0x7f90000 | (sal_uInt16)( mnBlibEntrys << 4 ) ) .WriteUInt32( 0 ); @@ -4798,7 +4798,7 @@ void EscherSolverContainer::WriteSolver( SvStream& rStrm ) } } -EscherExGlobal::EscherExGlobal( sal_uInt32 nGraphicProvFlags ) : +EscherExGlobal::EscherExGlobal( EscherGraphicProviderFlags nGraphicProvFlags ) : EscherGraphicProvider( nGraphicProvFlags ), mpPicStrm( nullptr ), mbHasDggCont( false ), diff --git a/include/filter/msfilter/escherex.hxx b/include/filter/msfilter/escherex.hxx index 00286c91f814..0e7a1993f61b 100644 --- a/include/filter/msfilter/escherex.hxx +++ b/include/filter/msfilter/escherex.hxx @@ -39,6 +39,7 @@ #include <tools/solar.h> #include <tools/stream.hxx> #include <vcl/mapmod.hxx> +#include <o3tl/typed_flags_set.hxx> namespace com { namespace sun { namespace star { namespace awt { struct Rectangle; } @@ -545,13 +546,18 @@ public: }; -#define E_GRAPH_PROV_USE_INSTANCES 1 -#define E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES 2 +enum class EscherGraphicProviderFlags { + NONE = 0, + UseInstances = 1, +}; +namespace o3tl { + template<> struct typed_flags<EscherGraphicProviderFlags> : is_typed_flags<EscherGraphicProviderFlags, 0x01> {}; +} class MSFILTER_DLLPUBLIC EscherGraphicProvider { - sal_uInt32 mnFlags; - + EscherGraphicProviderFlags + mnFlags; EscherBlibEntry** mpBlibEntrys; sal_uInt32 mnBlibBufSize; sal_uInt32 mnBlibEntrys; @@ -585,7 +591,7 @@ public: void SetBaseURI( const OUString& rBaseURI ) { maBaseURI = rBaseURI; }; const OUString& GetBaseURI() { return maBaseURI; }; - EscherGraphicProvider( sal_uInt32 nFlags = E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES ); + EscherGraphicProvider( EscherGraphicProviderFlags nFlags = EscherGraphicProviderFlags::NONE ); virtual ~EscherGraphicProvider(); }; @@ -939,7 +945,7 @@ public: class MSFILTER_DLLPUBLIC EscherExGlobal : public EscherGraphicProvider { public: - explicit EscherExGlobal( sal_uInt32 nGraphicProvFlags = E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES ); + explicit EscherExGlobal( EscherGraphicProviderFlags nGraphicProvFlags = EscherGraphicProviderFlags::NONE ); virtual ~EscherExGlobal() override; /** Returns a new drawing ID for a new drawing container (DGCONTAINER). */ diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index 28de3dce50c2..11035f28b80a 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -52,7 +52,7 @@ static const sal_Int32 Tag_Container = 44444; static const sal_Int32 Tag_Commit = 44445; VMLExport::VMLExport( ::sax_fastparser::FSHelperPtr const & pSerializer, VMLTextExport* pTextExport ) - : EscherEx( std::make_shared<EscherExGlobal>(0), nullptr, /*bOOXML=*/true ) + : EscherEx( std::make_shared<EscherExGlobal>(), nullptr, /*bOOXML=*/true ) , m_pSerializer( pSerializer ) , m_pTextExport( pTextExport ) , m_eHOri( 0 ) diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 3a320e1285b5..3112e651e5de 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -98,7 +98,7 @@ using namespace ::com::sun::star; PPTExBulletProvider::PPTExBulletProvider() { - pGraphicProv = new EscherGraphicProvider( E_GRAPH_PROV_USE_INSTANCES | E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES ); + pGraphicProv = new EscherGraphicProvider( EscherGraphicProviderFlags::UseInstances ); } PPTExBulletProvider::~PPTExBulletProvider() |