summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-04-24 12:24:36 +0200
committerNoel Grandin <noel@peralex.com>2015-04-29 10:41:39 +0200
commit1902ad6cad6d8c18f8d81e92517a88568f734b44 (patch)
treeb82ce8781571faf52d70dcd8362708666987ad22
parentd66f266cf24d09c2ceb9320f1355ba27114187c2 (diff)
convert SDR_SWAPGRAPHICS constants to scoped enum
and drop unused DOC constant Change-Id: Id35d18241642742500cc007c575a8a54b5b8dd97
-rw-r--r--include/svx/svdmodel.hxx34
-rw-r--r--sc/source/ui/app/drwtrans.cxx4
-rw-r--r--sd/source/filter/sdpptwrp.cxx2
-rw-r--r--sd/source/ui/app/sdxfer.cxx10
-rw-r--r--sd/source/ui/docshell/docshel3.cxx4
-rw-r--r--sd/source/ui/docshell/docshel4.cxx4
-rw-r--r--svx/source/svdraw/svdmodel.cxx2
-rw-r--r--svx/source/svdraw/svdograf.cxx6
8 files changed, 35 insertions, 31 deletions
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index ea9e4c222919..5cd184e4640d 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -32,6 +32,7 @@
#include <tools/datetime.hxx>
#include <tools/fract.hxx>
#include <svl/hint.hxx>
+#include <o3tl/typed_flags_set.hxx>
#include <svl/style.hxx>
#include <svx/xtable.hxx>
@@ -88,11 +89,16 @@ namespace sfx2
}
-#define SDR_SWAPGRAPHICSMODE_TEMP 0x00000001
-#define SDR_SWAPGRAPHICSMODE_DOC 0x00000002
-#define SDR_SWAPGRAPHICSMODE_PURGE 0x00000100
-#define SDR_SWAPGRAPHICSMODE_DEFAULT (SDR_SWAPGRAPHICSMODE_TEMP|SDR_SWAPGRAPHICSMODE_DOC|SDR_SWAPGRAPHICSMODE_PURGE)
-
+enum class SdrSwapGraphicsMode
+{
+ TEMP = 0x0001,
+ PURGE = 0x0100,
+ DEFAULT = TEMP | PURGE,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<SdrSwapGraphicsMode> : is_typed_flags<SdrSwapGraphicsMode, 0x0101> {};
+}
enum SdrHintKind
@@ -232,20 +238,20 @@ public:
sal_uInt16 nStarDrawPreviewMasterPageNum;
SvxForbiddenCharactersTable* mpForbiddenCharactersTable;
- sal_uIntPtr nSwapGraphicsMode;
+ SdrSwapGraphicsMode nSwapGraphicsMode;
- SdrOutlinerCache* mpOutlinerCache;
+ SdrOutlinerCache* mpOutlinerCache;
//get a vector of all the SdrOutliner belonging to the model
std::vector<SdrOutliner*> GetActiveOutliners() const;
- SdrModelImpl* mpImpl;
+ SdrModelImpl* mpImpl;
sal_uInt16 mnCharCompressType;
sal_uInt16 mnHandoutPageCount;
sal_uInt16 nReserveUInt6;
sal_uInt16 nReserveUInt7;
- bool mbModelLocked;
- bool mbKernAsianPunctuation;
- bool mbAddExtLeading;
- bool mbInDestruction;
+ bool mbModelLocked;
+ bool mbKernAsianPunctuation;
+ bool mbAddExtLeading;
+ bool mbInDestruction;
// Color, Dash, Line-End, Hatch, Gradient, Bitmap property lists ...
XPropertyListRef maProperties[XPROPERTY_LIST_COUNT];
@@ -481,8 +487,8 @@ public:
// Default=FALSE. Flag is not persistent.
bool IsSwapGraphics() const { return bSwapGraphics; }
void SetSwapGraphics(bool bJa = true);
- void SetSwapGraphicsMode(sal_uIntPtr nMode) { nSwapGraphicsMode = nMode; }
- sal_uIntPtr GetSwapGraphicsMode() const { return nSwapGraphicsMode; }
+ void SetSwapGraphicsMode(SdrSwapGraphicsMode nMode) { nSwapGraphicsMode = nMode; }
+ SdrSwapGraphicsMode GetSwapGraphicsMode() const { return nSwapGraphicsMode; }
bool IsSaveOLEPreview() const { return bSaveOLEPreview; }
void SetSaveOLEPreview( bool bSet) { bSaveOLEPreview = bSet; }
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index 0e4f4d2e6dd5..bf0e200dff47 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -365,12 +365,12 @@ bool ScDrawTransferObj::GetData( const css::datatransfer::DataFlavor& rFlavor, c
if( aOleData.GetTransferable().is() && aOleData.HasFormat( rFlavor ) )
{
- sal_uLong nOldSwapMode = 0;
+ SdrSwapGraphicsMode nOldSwapMode;
if( pModel )
{
nOldSwapMode = pModel->GetSwapGraphicsMode();
- pModel->SetSwapGraphicsMode( SDR_SWAPGRAPHICSMODE_PURGE );
+ pModel->SetSwapGraphicsMode( SdrSwapGraphicsMode::PURGE );
}
bOK = SetAny( aOleData.GetAny(rFlavor, rDestDoc), rFlavor );
diff --git a/sd/source/filter/sdpptwrp.cxx b/sd/source/filter/sdpptwrp.cxx
index ab540914a2b6..379098391e45 100644
--- a/sd/source/filter/sdpptwrp.cxx
+++ b/sd/source/filter/sdpptwrp.cxx
@@ -159,7 +159,7 @@ bool SdPPTFilter::Export()
if ( rFilterOptions.IsEnablePPTPreview() )
nCnvrtFlags |= 0x8000;
- mrDocument.SetSwapGraphicsMode( SDR_SWAPGRAPHICSMODE_TEMP );
+ mrDocument.SetSwapGraphicsMode( SdrSwapGraphicsMode::TEMP );
if( mbShowProgress )
CreateStatusIndicator();
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index ed424d464275..6bb1dacdbd58 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -466,12 +466,12 @@ bool SdTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo
}
else if( mpOLEDataHelper && mpOLEDataHelper->HasFormat( rFlavor ) )
{
- sal_uLong nOldSwapMode = 0;
+ SdrSwapGraphicsMode nOldSwapMode;
if( mpSdDrawDocumentIntern )
{
nOldSwapMode = mpSdDrawDocumentIntern->GetSwapGraphicsMode();
- mpSdDrawDocumentIntern->SetSwapGraphicsMode( SDR_SWAPGRAPHICSMODE_PURGE );
+ mpSdDrawDocumentIntern->SetSwapGraphicsMode( SdrSwapGraphicsMode::PURGE );
}
// TODO/LATER: support all the graphical formats, the embedded object scenario should not have separated handling
@@ -544,12 +544,10 @@ bool SdTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo
}
else if( nFormat == SotClipboardFormatId::EMBED_SOURCE )
{
- sal_uLong nOldSwapMode = 0;
-
if( mpSdDrawDocumentIntern )
{
- nOldSwapMode = mpSdDrawDocumentIntern->GetSwapGraphicsMode();
- mpSdDrawDocumentIntern->SetSwapGraphicsMode( SDR_SWAPGRAPHICSMODE_PURGE );
+ SdrSwapGraphicsMode nOldSwapMode = mpSdDrawDocumentIntern->GetSwapGraphicsMode();
+ mpSdDrawDocumentIntern->SetSwapGraphicsMode( SdrSwapGraphicsMode::PURGE );
if( !maDocShellRef.Is() )
{
diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx
index 0b5c2c66a156..81d7118716bc 100644
--- a/sd/source/ui/docshell/docshel3.cxx
+++ b/sd/source/ui/docshell/docshel3.cxx
@@ -243,9 +243,9 @@ void DrawDocShell::Execute( SfxRequest& rReq )
case SID_VERSION:
{
- const sal_uLong nOldSwapMode = mpDoc->GetSwapGraphicsMode();
+ const SdrSwapGraphicsMode nOldSwapMode = mpDoc->GetSwapGraphicsMode();
- mpDoc->SetSwapGraphicsMode( SDR_SWAPGRAPHICSMODE_TEMP );
+ mpDoc->SetSwapGraphicsMode( SdrSwapGraphicsMode::TEMP );
ExecuteSlot( rReq, SfxObjectShell::GetStaticInterface() );
mpDoc->SetSwapGraphicsMode( nOldSwapMode );
}
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 05edd42ed21f..a0dd8586fa0b 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -606,9 +606,9 @@ bool DrawDocShell::ConvertTo( SfxMedium& rMedium )
if( pFilter )
{
- const sal_uLong nOldSwapMode = mpDoc->GetSwapGraphicsMode();
+ const SdrSwapGraphicsMode nOldSwapMode = mpDoc->GetSwapGraphicsMode();
- mpDoc->SetSwapGraphicsMode( SDR_SWAPGRAPHICSMODE_TEMP );
+ mpDoc->SetSwapGraphicsMode( SdrSwapGraphicsMode::TEMP );
bRet = pFilter->Export();
if( !bRet )
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index eb0f00ee6582..3d485bcc4bd7 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -152,7 +152,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe
bSaveCompressed=false;
bSaveNative=false;
bSwapGraphics=false;
- nSwapGraphicsMode=SDR_SWAPGRAPHICSMODE_DEFAULT;
+ nSwapGraphicsMode=SdrSwapGraphicsMode::DEFAULT;
bSaveOLEPreview=false;
bPasteResize=false;
bNoBitmapCaching=false;
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 9e1f49112780..b4cf3899dd2e 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -1280,14 +1280,14 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
// ## test only if there are VOCs other than the preview renderer
if(!GetViewContact().HasViewObjectContacts(true))
{
- const sal_uIntPtr nSwapMode = pModel->GetSwapGraphicsMode();
+ const SdrSwapGraphicsMode nSwapMode = pModel->GetSwapGraphicsMode();
if( ( pGraphicLink ) &&
- ( nSwapMode & SDR_SWAPGRAPHICSMODE_PURGE ) )
+ ( nSwapMode & SdrSwapGraphicsMode::PURGE ) )
{
pRet = GRFMGR_AUTOSWAPSTREAM_LINK;
}
- else if( nSwapMode & SDR_SWAPGRAPHICSMODE_TEMP )
+ else if( nSwapMode & SdrSwapGraphicsMode::TEMP )
{
pRet = GRFMGR_AUTOSWAPSTREAM_TEMP;
pGraphic->SetUserData();