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>
This commit is contained in:
Noel Grandin 2016-12-02 16:10:09 +02:00
parent fe3e1067bf
commit d92d9df55c
4 changed files with 17 additions and 11 deletions

View File

@ -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 ),

View File

@ -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). */

View File

@ -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 )

View File

@ -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()