From 799a7878fd5b3a5a01b59d0a4139a2b0908ccc43 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 24 Mar 2015 09:36:29 +0200 Subject: convert SFX_PRINTER constants to enum class Change-Id: I5dca39f7668be2c03c904c33b6181ba769b70990 --- include/sfx2/viewsh.hxx | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index 7f5980e568cf..08d3682e8986 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -36,6 +36,7 @@ #include #include #include +#include class SfxBaseController; class Size; @@ -62,13 +63,21 @@ class NotifyEvent; class SfxInPlaceClient; namespace vcl { class PrinterController; } -#define SFX_PRINTER_PRINTER 1 // without JOB SETUP => Temporary -#define SFX_PRINTER_JOBSETUP 2 -#define SFX_PRINTER_OPTIONS 4 -#define SFX_PRINTER_CHG_ORIENTATION 8 -#define SFX_PRINTER_CHG_SIZE 16 -#define SFX_PRINTER_ALL 31 +enum class SfxPrinterChangeFlags +{ + NONE = 0, + PRINTER = 1, // without JOB SETUP => Temporary + JOBSETUP = 2, + OPTIONS = 4, + CHG_ORIENTATION = 8, + CHG_SIZE = 16 +}; +namespace o3tl +{ + template<> struct typed_flags : is_typed_flags {}; +} +#define SFX_PRINTER_ALL (SfxPrinterChangeFlags::PRINTER | SfxPrinterChangeFlags::JOBSETUP | SfxPrinterChangeFlags::OPTIONS | SfxPrinterChangeFlags::CHG_ORIENTATION | SfxPrinterChangeFlags::CHG_SIZE) #define SFX_PRINTERROR_BUSY 1 @@ -217,7 +226,7 @@ public: // Printing Interface virtual SfxPrinter* GetPrinter( bool bCreate = false ); - virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ); + virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ); virtual bool HasPrintOptionsPage() const; virtual SfxTabPage* CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions ); JobSetup GetJobSetup() const; -- cgit