[Libreoffice-commits] core.git: 8 commits - avmedia/source basctl/source cui/source include/sfx2 include/svx reportdesign/source sc/source sd/source sfx2/source starmath/inc starmath/qa starmath/source svx/source sw/inc sw/source

Noel Grandin noel at peralex.com
Tue Mar 24 00:37:42 PDT 2015


 avmedia/source/framework/mediaplayer.cxx              |    2 
 basctl/source/basicide/basides2.cxx                   |    3 
 basctl/source/basicide/tbxctl.cxx                     |    4 
 basctl/source/inc/basidesh.hxx                        |    2 
 cui/source/dialogs/linkdlg.cxx                        |   14 -
 cui/source/dialogs/zoom.cxx                           |   28 +-
 cui/source/inc/linkdlg.hxx                            |    4 
 cui/source/options/treeopt.cxx                        |   10 
 include/sfx2/bindings.hxx                             |    7 
 include/sfx2/chalign.hxx                              |   38 +-
 include/sfx2/linkmgr.hxx                              |    2 
 include/sfx2/lnkbase.hxx                              |   23 -
 include/sfx2/tbxctrl.hxx                              |   14 -
 include/sfx2/templateabstractview.hxx                 |   12 
 include/sfx2/viewsh.hxx                               |   23 +
 include/sfx2/zoomitem.hxx                             |   57 ++--
 include/svx/zoomctrl.hxx                              |    5 
 reportdesign/source/ui/inc/ReportController.hxx       |    2 
 reportdesign/source/ui/report/ReportController.cxx    |   10 
 reportdesign/source/ui/report/ReportWindow.cxx        |    8 
 sc/source/core/data/documen8.cxx                      |   16 -
 sc/source/core/tool/appoptio.cxx                      |    2 
 sc/source/core/tool/ddelink.cxx                       |    6 
 sc/source/ui/app/inputwin.cxx                         |    2 
 sc/source/ui/cctrl/tbinsert.cxx                       |    2 
 sc/source/ui/docshell/arealink.cxx                    |    2 
 sc/source/ui/docshell/docsh3.cxx                      |   14 -
 sc/source/ui/docshell/externalrefmgr.cxx              |    2 
 sc/source/ui/docshell/tablink.cxx                     |    4 
 sc/source/ui/formdlg/dwfunctr.cxx                     |   34 +-
 sc/source/ui/inc/docsh.hxx                            |    2 
 sc/source/ui/inc/prevwsh.hxx                          |    2 
 sc/source/ui/inc/tabvwsh.hxx                          |    2 
 sc/source/ui/unoobj/appluno.cxx                       |   18 -
 sc/source/ui/unoobj/confuno.cxx                       |    2 
 sc/source/ui/unoobj/viewuno.cxx                       |   30 +-
 sc/source/ui/view/prevwsh.cxx                         |   30 +-
 sc/source/ui/view/tabview.cxx                         |    4 
 sc/source/ui/view/tabview2.cxx                        |   10 
 sc/source/ui/view/tabvwsh3.cxx                        |   26 +-
 sc/source/ui/view/tabvwsh4.cxx                        |    4 
 sc/source/ui/view/tabvwsha.cxx                        |    2 
 sc/source/ui/view/viewdata.cxx                        |    4 
 sd/source/core/pglink.cxx                             |    2 
 sd/source/ui/app/sdmod2.cxx                           |    9 
 sd/source/ui/app/tbxww.cxx                            |    2 
 sd/source/ui/dlg/AnimationChildWindow.cxx             |    2 
 sd/source/ui/dlg/PaneChildWindows.cxx                 |    4 
 sd/source/ui/docshell/docshel4.cxx                    |    9 
 sd/source/ui/func/fuscale.cxx                         |   22 -
 sd/source/ui/inc/ViewShellBase.hxx                    |    2 
 sd/source/ui/unoidl/SdUnoDrawView.cxx                 |    8 
 sd/source/ui/view/ViewShellBase.cxx                   |    6 
 sd/source/ui/view/drviews2.cxx                        |   12 
 sd/source/ui/view/drviewsa.cxx                        |    8 
 sd/source/ui/view/outlnvs2.cxx                        |    2 
 sd/source/ui/view/outlnvsh.cxx                        |   10 
 sfx2/source/appl/appserv.cxx                          |    8 
 sfx2/source/appl/childwin.cxx                         |    2 
 sfx2/source/appl/impldde.cxx                          |    8 
 sfx2/source/appl/linkmgr2.cxx                         |    8 
 sfx2/source/appl/lnkbase2.cxx                         |   14 -
 sfx2/source/appl/workwin.cxx                          |  172 ++++++-------
 sfx2/source/control/bindings.cxx                      |   32 +-
 sfx2/source/control/dispatch.cxx                      |    2 
 sfx2/source/control/templateabstractview.cxx          |   16 -
 sfx2/source/dialog/backingwindow.cxx                  |   12 
 sfx2/source/dialog/dockwin.cxx                        |  232 +++++++++---------
 sfx2/source/dialog/infobar.cxx                        |    2 
 sfx2/source/dialog/navigat.cxx                        |    2 
 sfx2/source/dialog/partwnd.cxx                        |    2 
 sfx2/source/dialog/recfloat.cxx                       |    2 
 sfx2/source/dialog/splitwin.cxx                       |    8 
 sfx2/source/dialog/taskpane.cxx                       |    8 
 sfx2/source/doc/printhelper.cxx                       |   17 -
 sfx2/source/doc/printhelper.hxx                       |    6 
 sfx2/source/doc/templatedlg.cxx                       |   37 +-
 sfx2/source/doc/zoomitem.cxx                          |   18 -
 sfx2/source/sidebar/SidebarChildWindow.cxx            |    2 
 sfx2/source/sidebar/SidebarDockingWindow.cxx          |   24 -
 sfx2/source/toolbox/tbxitem.cxx                       |    2 
 sfx2/source/view/viewprn.cxx                          |   30 +-
 starmath/inc/view.hxx                                 |    2 
 starmath/qa/cppunit/test_starmath.cxx                 |   14 -
 starmath/source/ElementsDockingWindow.cxx             |    6 
 starmath/source/toolbox.cxx                           |    2 
 starmath/source/view.cxx                              |   30 +-
 svx/source/customshapes/tbxcustomshapes.cxx           |    2 
 svx/source/dialog/SpellDialogChildWindow.cxx          |    2 
 svx/source/dialog/_bmpmask.cxx                        |    2 
 svx/source/dialog/_contdlg.cxx                        |    2 
 svx/source/dialog/fontwork.cxx                        |   26 +-
 svx/source/dialog/hyperdlg.cxx                        |    2 
 svx/source/dialog/imapdlg.cxx                         |    2 
 svx/source/dialog/rubydialog.cxx                      |    2 
 svx/source/dialog/srchdlg.cxx                         |    2 
 svx/source/engine3d/float3d.cxx                       |    2 
 svx/source/form/datanavi.cxx                          |   10 
 svx/source/form/filtnav.cxx                           |   10 
 svx/source/form/fmPropBrw.cxx                         |    2 
 svx/source/form/fmexpl.cxx                            |    6 
 svx/source/form/tabwin.cxx                            |    2 
 svx/source/form/tbxform.cxx                           |    2 
 svx/source/mnuctrls/clipboardctl.cxx                  |    2 
 svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx |    2 
 svx/source/stbctrls/zoomctrl.cxx                      |   50 +--
 svx/source/svdraw/svdograf.cxx                        |    2 
 svx/source/svdraw/svdoole2.cxx                        |    2 
 svx/source/svdraw/svdotxln.cxx                        |    2 
 svx/source/tbxctrls/SvxColorChildWindow.cxx           |    2 
 svx/source/tbxctrls/fontworkgallery.cxx               |    2 
 svx/source/tbxctrls/grafctrl.cxx                      |    2 
 svx/source/tbxctrls/layctrl.cxx                       |    4 
 svx/source/tbxctrls/lboxctrl.cxx                      |    2 
 svx/source/tbxctrls/linectrl.cxx                      |    2 
 svx/source/tbxctrls/subtoolboxcontrol.cxx             |    2 
 svx/source/tbxctrls/tbcontrl.cxx                      |    6 
 svx/source/tbxctrls/tbxalign.cxx                      |    2 
 svx/source/tbxctrls/tbxdrctl.cxx                      |    2 
 sw/inc/ddefld.hxx                                     |    6 
 sw/inc/section.hxx                                    |    4 
 sw/inc/swbaslnk.hxx                                   |    2 
 sw/source/core/docnode/section.cxx                    |    4 
 sw/source/core/fields/ddefld.cxx                      |   12 
 sw/source/core/graphic/ndgrf.cxx                      |    2 
 sw/source/core/ole/ndole.cxx                          |    2 
 sw/source/core/unocore/unofield.cxx                   |    3 
 sw/source/core/unocore/unosect.cxx                    |   11 
 sw/source/core/view/pagepreviewlayout.cxx             |    2 
 sw/source/filter/ww8/rtfexport.cxx                    |    2 
 sw/source/filter/ww8/wrtww8.cxx                       |    6 
 sw/source/filter/ww8/ww8par.cxx                       |    8 
 sw/source/filter/xml/xmltble.cxx                      |    2 
 sw/source/filter/xml/xmltbli.cxx                      |    7 
 sw/source/ui/fldui/fldvar.cxx                         |    6 
 sw/source/uibase/app/docsh2.cxx                       |    4 
 sw/source/uibase/config/viewopt.cxx                   |    2 
 sw/source/uibase/dialog/wordcountwrapper.cxx          |    2 
 sw/source/uibase/dochdl/swdtflvr.cxx                  |    4 
 sw/source/uibase/fldui/fldmgr.cxx                     |    6 
 sw/source/uibase/fldui/fldwrap.cxx                    |    4 
 sw/source/uibase/inc/pview.hxx                        |    2 
 sw/source/uibase/inc/srcview.hxx                      |    2 
 sw/source/uibase/inc/view.hxx                         |    2 
 sw/source/uibase/index/idxmrk.cxx                     |    4 
 sw/source/uibase/ribbar/inputwin.cxx                  |    2 
 sw/source/uibase/ribbar/tblctrl.cxx                   |    2 
 sw/source/uibase/ribbar/workctrl.cxx                  |    6 
 sw/source/uibase/uiview/pview.cxx                     |   44 +--
 sw/source/uibase/uiview/srcview.cxx                   |   12 
 sw/source/uibase/uiview/view.cxx                      |   12 
 sw/source/uibase/uiview/view0.cxx                     |    2 
 sw/source/uibase/uiview/view2.cxx                     |   22 -
 sw/source/uibase/uiview/viewmdi.cxx                   |   12 
 sw/source/uibase/uiview/viewport.cxx                  |   14 -
 sw/source/uibase/uiview/viewprt.cxx                   |   16 -
 sw/source/uibase/uno/unomod.cxx                       |   20 -
 157 files changed, 881 insertions(+), 862 deletions(-)

New commits:
commit 799a7878fd5b3a5a01b59d0a4139a2b0908ccc43
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Mar 24 09:36:29 2015 +0200

    convert SFX_PRINTER constants to enum class
    
    Change-Id: I5dca39f7668be2c03c904c33b6181ba769b70990

diff --git a/basctl/source/basicide/basides2.cxx b/basctl/source/basicide/basides2.cxx
index a05794c..e69c223 100644
--- a/basctl/source/basicide/basides2.cxx
+++ b/basctl/source/basicide/basides2.cxx
@@ -86,9 +86,8 @@ SfxPrinter* Shell::GetPrinter( bool bCreate )
     return 0;
 }
 
-sal_uInt16 Shell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags, bool )
+sal_uInt16 Shell::SetPrinter( SfxPrinter *pNewPrinter, SfxPrinterChangeFlags , bool )
 {
-    (void)nDiffFlags;
     DocShell* pDocShell = static_cast<DocShell*>(GetViewFrame()->GetObjectShell());
     DBG_ASSERT( pDocShell, "DocShell ?!" );
     pDocShell->SetPrinter( pNewPrinter );
diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx
index 8ded0fc..1ed8f9f 100644
--- a/basctl/source/inc/basidesh.hxx
+++ b/basctl/source/inc/basidesh.hxx
@@ -178,7 +178,7 @@ public:
 
     // virtual sal_uInt16           Print( SfxProgress &rProgress, sal_Bool bIsAPI, PrintDialog *pPrintDialog = 0 );
     virtual SfxPrinter*     GetPrinter( bool bCreate ) SAL_OVERRIDE;
-    virtual sal_uInt16      SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ) SAL_OVERRIDE;
+    virtual sal_uInt16      SetPrinter( SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ) SAL_OVERRIDE;
     virtual OUString        GetSelectionText( bool bCompleteWords ) SAL_OVERRIDE;
     virtual bool            HasSelection( bool bText ) const SAL_OVERRIDE;
 
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 31c4ee5..a8b005d 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1201,9 +1201,9 @@ SfxItemSet* OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId )
             // miscellaneous - Tabulator
             pRet->Put(SfxBoolItem(SID_PRINTER_NOTFOUND_WARN, aMisc.IsNotFoundWarning()));
 
-            sal_uInt16 nFlag = aMisc.IsPaperSizeWarning() ? SFX_PRINTER_CHG_SIZE : 0;
-            nFlag  |= aMisc.IsPaperOrientationWarning()  ? SFX_PRINTER_CHG_ORIENTATION : 0;
-            pRet->Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC, nFlag ));
+            SfxPrinterChangeFlags nFlag = aMisc.IsPaperSizeWarning() ? SfxPrinterChangeFlags::CHG_SIZE : SfxPrinterChangeFlags::NONE;
+            nFlag  |= aMisc.IsPaperOrientationWarning()  ? SfxPrinterChangeFlags::CHG_ORIENTATION : SfxPrinterChangeFlags::NONE;
+            pRet->Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC, static_cast<int>(nFlag) ));
 
         }
         break;
@@ -1346,8 +1346,8 @@ void OfaTreeOptionsDialog::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet
             if(SfxItemState::SET == rSet.GetItemState(SID_PRINTER_CHANGESTODOC, false, &pItem))
             {
                 const SfxFlagItem* pFlag = static_cast<const SfxFlagItem*>(pItem);
-                aMisc.SetPaperSizeWarning(0 != (pFlag->GetValue() &  SFX_PRINTER_CHG_SIZE ));
-                aMisc.SetPaperOrientationWarning(0 !=  (pFlag->GetValue() & SFX_PRINTER_CHG_ORIENTATION ));
+                aMisc.SetPaperSizeWarning(bool(static_cast<SfxPrinterChangeFlags>(pFlag->GetValue()) &  SfxPrinterChangeFlags::CHG_SIZE ));
+                aMisc.SetPaperOrientationWarning(bool(static_cast<SfxPrinterChangeFlags>(pFlag->GetValue()) & SfxPrinterChangeFlags::CHG_ORIENTATION ));
             }
 
 //          evaluate help options
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 7f5980e..08d3682 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -36,6 +36,7 @@
 #include <tools/gen.hxx>
 #include <tools/errcode.hxx>
 #include <vcl/jobset.hxx>
+#include <o3tl/typed_flags_set.hxx>
 
 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<SfxPrinterChangeFlags> : is_typed_flags<SfxPrinterChangeFlags, 31> {};
+}
+#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;
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 0a0e03d..74756f5 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -130,12 +130,12 @@ SfxPrinter* ScDocument::GetPrinter(bool bCreateIfNotExist)
                             NULL );
 
         ::utl::MiscCfg aMisc;
-        sal_uInt16 nFlags = 0;
+        SfxPrinterChangeFlags nFlags = SfxPrinterChangeFlags::NONE;
         if ( aMisc.IsPaperOrientationWarning() )
-            nFlags |= SFX_PRINTER_CHG_ORIENTATION;
+            nFlags |= SfxPrinterChangeFlags::CHG_ORIENTATION;
         if ( aMisc.IsPaperSizeWarning() )
-            nFlags |= SFX_PRINTER_CHG_SIZE;
-        pSet->Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC, nFlags ) );
+            nFlags |= SfxPrinterChangeFlags::CHG_SIZE;
+        pSet->Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC, static_cast<int>(nFlags) ) );
         pSet->Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aMisc.IsNotFoundWarning() ) );
 
         pPrinter = new SfxPrinter( pSet );
@@ -177,12 +177,12 @@ void ScDocument::SetPrintOptions()
         ::utl::MiscCfg aMisc;
         SfxItemSet aOptSet( pPrinter->GetOptions() );
 
-        sal_uInt16 nFlags = 0;
+        SfxPrinterChangeFlags nFlags = SfxPrinterChangeFlags::NONE;
         if ( aMisc.IsPaperOrientationWarning() )
-            nFlags |= SFX_PRINTER_CHG_ORIENTATION;
+            nFlags |= SfxPrinterChangeFlags::CHG_ORIENTATION;
         if ( aMisc.IsPaperSizeWarning() )
-            nFlags |= SFX_PRINTER_CHG_SIZE;
-        aOptSet.Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC, nFlags ) );
+            nFlags |= SfxPrinterChangeFlags::CHG_SIZE;
+        aOptSet.Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC, static_cast<int>(nFlags) ) );
         aOptSet.Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aMisc.IsNotFoundWarning() ) );
 
         pPrinter->SetOptions( aOptSet );
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 950664a..568556a 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -450,13 +450,13 @@ OutputDevice* ScDocShell::GetRefDevice()
     return aDocument.GetRefDevice();
 }
 
-sal_uInt16 ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags )
+sal_uInt16 ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, SfxPrinterChangeFlags nDiffFlags )
 {
     SfxPrinter *pOld = aDocument.GetPrinter( false );
     if ( pOld && pOld->IsPrinting() )
         return SFX_PRINTERROR_BUSY;
 
-    if (nDiffFlags & SFX_PRINTER_PRINTER)
+    if (nDiffFlags & SfxPrinterChangeFlags::PRINTER)
     {
         if ( aDocument.GetPrinter() != pNewPrinter )
         {
@@ -491,7 +491,7 @@ sal_uInt16 ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlag
             }
         }
     }
-    else if (nDiffFlags & SFX_PRINTER_JOBSETUP)
+    else if (nDiffFlags & SfxPrinterChangeFlags::JOBSETUP)
     {
         SfxPrinter* pOldPrinter = aDocument.GetPrinter();
         if (pOldPrinter)
@@ -506,12 +506,12 @@ sal_uInt16 ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlag
         }
     }
 
-    if (nDiffFlags & SFX_PRINTER_OPTIONS)
+    if (nDiffFlags & SfxPrinterChangeFlags::OPTIONS)
     {
         aDocument.SetPrintOptions();        //! aus neuem Printer ???
     }
 
-    if (nDiffFlags & (SFX_PRINTER_CHG_ORIENTATION | SFX_PRINTER_CHG_SIZE))
+    if (nDiffFlags & (SfxPrinterChangeFlags::CHG_ORIENTATION | SfxPrinterChangeFlags::CHG_SIZE))
     {
         OUString aStyle = aDocument.GetPageStyle( GetCurTab() );
         ScStyleSheetPool* pStPl = aDocument.GetStyleSheetPool();
@@ -520,7 +520,7 @@ sal_uInt16 ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlag
         {
             SfxItemSet& rSet = pStyleSheet->GetItemSet();
 
-            if (nDiffFlags & SFX_PRINTER_CHG_ORIENTATION)
+            if (nDiffFlags & SfxPrinterChangeFlags::CHG_ORIENTATION)
             {
                 const SvxPageItem& rOldItem = static_cast<const SvxPageItem&>(rSet.Get(ATTR_PAGE));
                 bool bWasLand = rOldItem.IsLandscape();
@@ -538,7 +538,7 @@ sal_uInt16 ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlag
                     rSet.Put( aNewSItem );
                 }
             }
-            if (nDiffFlags & SFX_PRINTER_CHG_SIZE)
+            if (nDiffFlags & SfxPrinterChangeFlags::CHG_SIZE)
             {
                 SvxSizeItem aPaperSizeItem( ATTR_PAGE_SIZE, SvxPaperInfo::GetPaperSize(pNewPrinter) );
                 rSet.Put( aPaperSizeItem );
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 423e13e..990ecce 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -234,7 +234,7 @@ public:
     void            SetDocFunc( ScDocFunc *pDF ) { pDocFunc = pDF; }
 
     SfxPrinter*     GetPrinter( bool bCreateIfNotExist = true );
-    sal_uInt16          SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL );
+    sal_uInt16      SetPrinter( SfxPrinter* pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL );
 
     void            UpdateFontList();
 
diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx
index 7c57876..d8bec53 100644
--- a/sc/source/ui/inc/prevwsh.hxx
+++ b/sc/source/ui/inc/prevwsh.hxx
@@ -107,7 +107,7 @@ public:
     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
 
     virtual SfxPrinter*     GetPrinter( bool bCreate = false ) SAL_OVERRIDE;
-    virtual sal_uInt16      SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ) SAL_OVERRIDE;
+    virtual sal_uInt16      SetPrinter( SfxPrinter* pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ) SAL_OVERRIDE;
     virtual bool            HasPrintOptionsPage() const SAL_OVERRIDE;
     virtual SfxTabPage*     CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions ) SAL_OVERRIDE;
 
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 7f1fd84..81e8004 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -345,7 +345,7 @@ public:
     // Drucken:
     virtual SfxPrinter*     GetPrinter( bool bCreate = false ) SAL_OVERRIDE;
     virtual sal_uInt16      SetPrinter( SfxPrinter* pNewPrinter,
-                                          sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false ) SAL_OVERRIDE;
+                                          SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false ) SAL_OVERRIDE;
 
     virtual bool            HasPrintOptionsPage() const SAL_OVERRIDE;
     virtual SfxTabPage*     CreatePrintOptionsPage( vcl::Window *pParent, const SfxItemSet &rOptions ) SAL_OVERRIDE;
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index 6cd3204..68ca1df 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -193,7 +193,7 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
                         {
                             SfxPrinter* pNewPrinter = new SfxPrinter( pPrinter->GetOptions().Clone(), sPrinterName );
                             if (pNewPrinter->IsKnown())
-                                pDocShell->SetPrinter( pNewPrinter, SFX_PRINTER_PRINTER );
+                                pDocShell->SetPrinter( pNewPrinter, SfxPrinterChangeFlags::PRINTER );
                             else
                                 delete pNewPrinter;
                         }
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index e79dd92..29398d4 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -521,7 +521,7 @@ SfxPrinter* ScPreviewShell::GetPrinter( bool bCreate )
     return pDocShell->GetPrinter(bCreate);
 }
 
-sal_uInt16 ScPreviewShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags, bool )
+sal_uInt16 ScPreviewShell::SetPrinter( SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags, bool )
 {
     return pDocShell->SetPrinter( pNewPrinter, nDiffFlags );
 }
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index a943245..7076f81 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1053,7 +1053,7 @@ SfxPrinter* ScTabViewShell::GetPrinter( bool bCreate )
     return GetViewData().GetDocShell()->GetPrinter(bCreate);
 }
 
-sal_uInt16 ScTabViewShell::SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags, bool )
+sal_uInt16 ScTabViewShell::SetPrinter( SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags, bool )
 {
     return GetViewData().GetDocShell()->SetPrinter( pNewPrinter, nDiffFlags );
 }
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index 9ca9b60..b6f924d 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -635,11 +635,10 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
         // set PrintOptionsSet
         SdOptionsPrintItem aPrintItem( ATTR_OPTIONS_PRINT, pOptions );
         SfxFlagItem aFlagItem( SID_PRINTER_CHANGESTODOC );
-        sal_uInt16      nFlags = 0;
-
-        nFlags =  (aPrintItem.GetOptionsPrint().IsWarningSize() ? SFX_PRINTER_CHG_SIZE : 0) |
-                (aPrintItem.GetOptionsPrint().IsWarningOrientation() ? SFX_PRINTER_CHG_ORIENTATION : 0);
-        aFlagItem.SetValue( nFlags );
+        SfxPrinterChangeFlags nFlags =
+                (aPrintItem.GetOptionsPrint().IsWarningSize() ? SfxPrinterChangeFlags::CHG_SIZE : SfxPrinterChangeFlags::NONE) |
+                (aPrintItem.GetOptionsPrint().IsWarningOrientation() ? SfxPrinterChangeFlags::CHG_ORIENTATION : SfxPrinterChangeFlags::NONE);
+        aFlagItem.SetValue( static_cast<int>(nFlags) );
 
         aPrintSet.Put( aPrintItem );
         aPrintSet.Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aPrintItem.GetOptionsPrint().IsWarningPrinter() ) );
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 4ad0774..b6663db 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -100,11 +100,10 @@ SfxPrinter* DrawDocShell::GetPrinter(bool bCreate)
         SdOptionsPrintItem aPrintItem( ATTR_OPTIONS_PRINT,
                             SD_MOD()->GetSdOptions(mpDoc->GetDocumentType()));
         SfxFlagItem aFlagItem( SID_PRINTER_CHANGESTODOC );
-        sal_uInt16      nFlags = 0;
-
-        nFlags =  (aPrintItem.GetOptionsPrint().IsWarningSize() ? SFX_PRINTER_CHG_SIZE : 0) |
-                (aPrintItem.GetOptionsPrint().IsWarningOrientation() ? SFX_PRINTER_CHG_ORIENTATION : 0);
-        aFlagItem.SetValue( nFlags );
+        SfxPrinterChangeFlags nFlags =
+                (aPrintItem.GetOptionsPrint().IsWarningSize() ? SfxPrinterChangeFlags::CHG_SIZE : SfxPrinterChangeFlags::NONE) |
+                (aPrintItem.GetOptionsPrint().IsWarningOrientation() ? SfxPrinterChangeFlags::CHG_ORIENTATION : SfxPrinterChangeFlags::NONE);
+        aFlagItem.SetValue( static_cast<int>(nFlags) );
 
         pSet->Put( aPrintItem );
         pSet->Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aPrintItem.GetOptionsPrint().IsWarningPrinter() ) );
diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx
index 12bef3f..e1a1807 100644
--- a/sd/source/ui/inc/ViewShellBase.hxx
+++ b/sd/source/ui/inc/ViewShellBase.hxx
@@ -139,7 +139,7 @@ public:
     /// Forwarded to the print manager.
     virtual sal_uInt16 SetPrinter (
         SfxPrinter* pNewPrinter,
-        sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false) SAL_OVERRIDE;
+        SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false) SAL_OVERRIDE;
 
     /// Forward methods to main sub shell.
     virtual void WriteUserDataSequence (
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index 92832d2..1f17591 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -513,15 +513,15 @@ SfxPrinter* ViewShellBase::GetPrinter (bool bCreate)
 
 sal_uInt16 ViewShellBase::SetPrinter (
     SfxPrinter* pNewPrinter,
-    sal_uInt16 nDiffFlags,
+    SfxPrinterChangeFlags nDiffFlags,
     bool bIsAPI)
 {
     OSL_ASSERT(mpImpl.get()!=NULL);
 
     GetDocShell()->SetPrinter(pNewPrinter);
 
-    if ( (nDiffFlags & SFX_PRINTER_CHG_ORIENTATION ||
-          nDiffFlags & SFX_PRINTER_CHG_SIZE) && pNewPrinter  )
+    if ( (nDiffFlags & SfxPrinterChangeFlags::CHG_ORIENTATION ||
+          nDiffFlags & SfxPrinterChangeFlags::CHG_SIZE) && pNewPrinter  )
     {
         MapMode aMap = pNewPrinter->GetMapMode();
         aMap.SetMapUnit(MAP_100TH_MM);
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index 27f2e62..c7db58f 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -312,7 +312,10 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxPrintHelper::getPrinter() thro
 //  XPrintable
 
 
-void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >& rPrinter,SfxPrinter*& pPrinter,sal_uInt16& nChangeFlags,SfxViewShell*& pViewSh)
+void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >& rPrinter,
+                                     SfxPrinter*& pPrinter,
+                                     SfxPrinterChangeFlags& nChangeFlags,
+                                     SfxViewShell*& pViewSh)
 
 {
     // Get old Printer
@@ -327,7 +330,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >
         return;
 
     // new Printer-Name available?
-    nChangeFlags = 0;
+    nChangeFlags = SfxPrinterChangeFlags::NONE;
     sal_Int32 lDummy = 0;
     for ( int n = 0; n < rPrinter.getLength(); ++n )
     {
@@ -344,7 +347,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >
             if ( aPrinterName != pPrinter->GetName() )
             {
                 pPrinter = new SfxPrinter( pPrinter->GetOptions().Clone(), aPrinterName );
-                nChangeFlags = SFX_PRINTER_PRINTER;
+                nChangeFlags = SfxPrinterChangeFlags::PRINTER;
             }
             break;
         }
@@ -373,7 +376,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >
             if ( (Orientation) eOrient != pPrinter->GetOrientation() )
             {
                 pPrinter->SetOrientation( (Orientation) eOrient );
-                nChangeFlags |= SFX_PRINTER_CHG_ORIENTATION;
+                nChangeFlags |= SfxPrinterChangeFlags::CHG_ORIENTATION;
             }
         }
 
@@ -390,7 +393,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >
             if ( convertToPaper(nPaperFormat) != pPrinter->GetPaper() )
             {
                 pPrinter->SetPaper( convertToPaper(nPaperFormat) );
-                nChangeFlags |= SFX_PRINTER_CHG_SIZE;
+                nChangeFlags |= SfxPrinterChangeFlags::CHG_SIZE;
             }
         }
 
@@ -437,7 +440,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >
         if( aSetPaperSize != pPrinter->GetPaperSizePixel() )
         {
             pPrinter->SetPaperSizeUser( pPrinter->PixelToLogic( aSetPaperSize ) );
-            nChangeFlags |= SFX_PRINTER_CHG_SIZE;
+            nChangeFlags |= SfxPrinterChangeFlags::CHG_SIZE;
         }
     }
 
@@ -455,7 +458,7 @@ void SAL_CALL SfxPrintHelper::setPrinter(const uno::Sequence< beans::PropertyVal
 
     SfxViewShell* pViewSh = NULL;
     SfxPrinter* pPrinter = NULL;
-    sal_uInt16 nChangeFlags = 0;
+    SfxPrinterChangeFlags nChangeFlags = SfxPrinterChangeFlags::NONE;
     impl_setPrinter(rPrinter,pPrinter,nChangeFlags,pViewSh);
     // set new printer
     if ( pViewSh && pPrinter )
diff --git a/sfx2/source/doc/printhelper.hxx b/sfx2/source/doc/printhelper.hxx
index 09f15f8..ef4e31d 100644
--- a/sfx2/source/doc/printhelper.hxx
+++ b/sfx2/source/doc/printhelper.hxx
@@ -22,6 +22,7 @@
 
 #include <sal/config.h>
 #include <sfx2/dllapi.h>
+#include <sfx2/viewsh.hxx>
 #include <sal/types.h>
 
 #include <com/sun/star/view/XPrintable.hpp>
@@ -60,7 +61,10 @@ private:
 
     osl::Mutex m_aMutex;
     IMPL_PrintListener_DataContainer* m_pData ;
-    void impl_setPrinter(const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rPrinter,SfxPrinter*& pPrinter,sal_uInt16& nChangeFlags,SfxViewShell*& pViewSh);
+    void impl_setPrinter(const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rPrinter,
+                         SfxPrinter*& pPrinter,
+                         SfxPrinterChangeFlags& nChangeFlags,
+                         SfxViewShell*& pViewSh);
 } ;
 
 #endif
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 2104532..34716d6 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -386,7 +386,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
                 {
                     SfxPrinter* pNewPrt = new SfxPrinter( pDocPrt->GetOptions().Clone(), getPrinter()->GetName() );
                     pNewPrt->SetJobSetup( getPrinter()->GetJobSetup() );
-                    mpViewShell->SetPrinter( pNewPrt, SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP );
+                    mpViewShell->SetPrinter( pNewPrt, SfxPrinterChangeFlags::PRINTER | SfxPrinterChangeFlags::JOBSETUP );
                 }
             }
         }
@@ -478,8 +478,8 @@ SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter )
     sal_uInt16 nWhich = GetPool().GetWhich(SID_PRINTER_CHANGESTODOC);
     const SfxFlagItem *pFlagItem = 0;
     pDocPrinter->GetOptions().GetItemState( nWhich, false, reinterpret_cast<const SfxPoolItem**>(&pFlagItem) );
-    bool bOriToDoc = pFlagItem && (pFlagItem->GetValue() & SFX_PRINTER_CHG_ORIENTATION);
-    bool bSizeToDoc = pFlagItem && (pFlagItem->GetValue() & SFX_PRINTER_CHG_SIZE);
+    bool bOriToDoc = pFlagItem && (static_cast<SfxPrinterChangeFlags>(pFlagItem->GetValue()) & SfxPrinterChangeFlags::CHG_ORIENTATION);
+    bool bSizeToDoc = pFlagItem && (static_cast<SfxPrinterChangeFlags>(pFlagItem->GetValue()) & SfxPrinterChangeFlags::CHG_SIZE);
 
     // Determine the previous format and size
     Orientation eOldOri = pDocPrinter->GetOrientation();
@@ -499,25 +499,25 @@ SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter )
 
     // Message and Flags for page format, summaries changes
     OUString aMsg;
-    sal_uInt16 nNewOpt=0;
+    SfxPrinterChangeFlags nNewOpt = SfxPrinterChangeFlags::NONE;
     if( bOriChg && bPgSzChg )
     {
         aMsg = SfxResId(STR_PRINT_NEWORISIZE).toString();
-        nNewOpt = SFX_PRINTER_CHG_ORIENTATION | SFX_PRINTER_CHG_SIZE;
+        nNewOpt = SfxPrinterChangeFlags::CHG_ORIENTATION | SfxPrinterChangeFlags::CHG_SIZE;
     }
     else if (bOriChg )
     {
         aMsg = SfxResId(STR_PRINT_NEWORI).toString();
-        nNewOpt = SFX_PRINTER_CHG_ORIENTATION;
+        nNewOpt = SfxPrinterChangeFlags::CHG_ORIENTATION;
     }
     else if (bPgSzChg)
     {
         aMsg = SfxResId(STR_PRINT_NEWSIZE).toString();
-        nNewOpt = SFX_PRINTER_CHG_SIZE;
+        nNewOpt = SfxPrinterChangeFlags::CHG_SIZE;
     }
 
     // Summaries in this variable what has been changed.
-    sal_uInt16 nChangedFlags = 0;
+    SfxPrinterChangeFlags nChangedFlags = SfxPrinterChangeFlags::NONE;
 
     // Ask if possible, if page format should be taken over from printer.
     if ( ( bOriChg  || bPgSzChg ) &&
@@ -535,7 +535,7 @@ SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter )
     // or the other way around?
     if ( (aTempPrtName != aDocPrtName) || (pDocPrinter->IsDefPrinter() != pNewPrinter->IsDefPrinter()) )
     {
-        nChangedFlags |= SFX_PRINTER_PRINTER|SFX_PRINTER_JOBSETUP;
+        nChangedFlags |= SfxPrinterChangeFlags::PRINTER|SfxPrinterChangeFlags::JOBSETUP;
         pDocPrinter = pNewPrinter;
     }
     else
@@ -545,7 +545,7 @@ SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter )
         {
             // Option have changed
             pDocPrinter->SetOptions( pNewPrinter->GetOptions() );
-            nChangedFlags |= SFX_PRINTER_OPTIONS;
+            nChangedFlags |= SfxPrinterChangeFlags::OPTIONS;
         }
 
         // Compare JobSetups
@@ -553,7 +553,7 @@ SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter )
         JobSetup aOldJobSetup = pDocPrinter->GetJobSetup();
         if ( aNewJobSetup != aOldJobSetup )
         {
-            nChangedFlags |= SFX_PRINTER_JOBSETUP;
+            nChangedFlags |= SfxPrinterChangeFlags::JOBSETUP;
         }
 
         // Keep old changed Printer.
@@ -561,7 +561,7 @@ SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter )
         delete pNewPrinter;
     }
 
-    if ( 0 != nChangedFlags )
+    if ( SfxPrinterChangeFlags::NONE != nChangedFlags )
         // SetPrinter will delete the old printer if it changes
         SetPrinter( pDocPrinter, nChangedFlags );
     return pDocPrinter;
@@ -781,7 +781,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
             {
                 // just set a recorded printer name
                 if ( pPrinter )
-                    SetPrinter( pPrinter, SFX_PRINTER_PRINTER  );
+                    SetPrinter( pPrinter, SfxPrinterChangeFlags::PRINTER  );
                 return;
             }
 
@@ -843,7 +843,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
                     else
                     {
                         pPrinter->SetOptions( *pExecutor->GetOptions() );
-                        SetPrinter( pPrinter, SFX_PRINTER_OPTIONS );
+                        SetPrinter( pPrinter, SfxPrinterChangeFlags::OPTIONS );
                     }
                 }
 
@@ -887,7 +887,7 @@ SfxPrinter* SfxViewShell::GetPrinter( bool /*bCreate*/ )
     return 0;
 }
 
-sal_uInt16 SfxViewShell::SetPrinter( SfxPrinter* /*pNewPrinter*/, sal_uInt16 /*nDiffFlags*/, bool )
+sal_uInt16 SfxViewShell::SetPrinter( SfxPrinter* /*pNewPrinter*/, SfxPrinterChangeFlags /*nDiffFlags*/, bool )
 {
     return 0;
 }
diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index 9a59199..85bfbdb 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -262,7 +262,7 @@ protected:
 
     virtual SfxPrinter *GetPrinter(bool bCreate = false) SAL_OVERRIDE;
     virtual sal_uInt16 SetPrinter(SfxPrinter *pNewPrinter,
-                              sal_uInt16     nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false) SAL_OVERRIDE;
+                              SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false) SAL_OVERRIDE;
 
     void Insert( SfxMedium& rMedium );
     void InsertFrom(SfxMedium &rMedium);
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 31bc611..5635f3c 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1327,16 +1327,16 @@ SfxPrinter* SmViewShell::GetPrinter(bool bCreate)
     return 0;
 }
 
-sal_uInt16 SmViewShell::SetPrinter(SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags, bool )
+sal_uInt16 SmViewShell::SetPrinter(SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags, bool )
 {
     SfxPrinter *pOld = GetDoc()->GetPrinter();
     if ( pOld && pOld->IsPrinting() )
         return SFX_PRINTERROR_BUSY;
 
-    if ((nDiffFlags & SFX_PRINTER_PRINTER) == SFX_PRINTER_PRINTER)
+    if ((nDiffFlags & SfxPrinterChangeFlags::PRINTER) == SfxPrinterChangeFlags::PRINTER)
         GetDoc()->SetPrinter( pNewPrinter );
 
-    if ((nDiffFlags & SFX_PRINTER_OPTIONS) == SFX_PRINTER_OPTIONS)
+    if ((nDiffFlags & SfxPrinterChangeFlags::OPTIONS) == SfxPrinterChangeFlags::OPTIONS)
     {
         SmModule *pp = SM_MOD();
         pp->GetConfig()->ItemSetToConfig(pNewPrinter->GetOptions());
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index df8550d..47ede5c 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -165,7 +165,7 @@ void SwDocShell::ToggleBrowserMode(bool bSet, SwView* _pView )
     {
         pTempView->GetViewFrame()->GetBindings().Invalidate(FN_SHADOWCURSOR);
         if( !GetDoc()->getIDocumentDeviceAccess().getPrinter( false ) )
-            pTempView->SetPrinter( GetDoc()->getIDocumentDeviceAccess().getPrinter( false ), SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP );
+            pTempView->SetPrinter( GetDoc()->getIDocumentDeviceAccess().getPrinter( false ), SfxPrinterChangeFlags::PRINTER | SfxPrinterChangeFlags::JOBSETUP );
         GetDoc()->CheckDefaultPageFmt();
         SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, false);
         while (pTmpFrm)
diff --git a/sw/source/uibase/inc/pview.hxx b/sw/source/uibase/inc/pview.hxx
index d486f17..b33a451 100644
--- a/sw/source/uibase/inc/pview.hxx
+++ b/sw/source/uibase/inc/pview.hxx
@@ -190,7 +190,7 @@ class SW_DLLPUBLIC SwPagePreview: public SfxViewShell
     SAL_DLLPRIVATE bool            ChgPage( int eMvMode, bool bUpdateScrollbar = true );
 
     SAL_DLLPRIVATE virtual SfxPrinter*     GetPrinter( bool bCreate = false ) SAL_OVERRIDE;
-    SAL_DLLPRIVATE virtual sal_uInt16      SetPrinter( SfxPrinter *pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ) SAL_OVERRIDE;
+    SAL_DLLPRIVATE virtual sal_uInt16      SetPrinter( SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ) SAL_OVERRIDE;
     SAL_DLLPRIVATE virtual bool            HasPrintOptionsPage() const SAL_OVERRIDE;
     SAL_DLLPRIVATE virtual SfxTabPage*     CreatePrintOptionsPage( vcl::Window *pParent,
                                                 const SfxItemSet &rOptions ) SAL_OVERRIDE;
diff --git a/sw/source/uibase/inc/srcview.hxx b/sw/source/uibase/inc/srcview.hxx
index 8ec289d..ab37058 100644
--- a/sw/source/uibase/inc/srcview.hxx
+++ b/sw/source/uibase/inc/srcview.hxx
@@ -78,7 +78,7 @@ public:
 
     void            Load(SwDocShell* pDocShell);
 
-    virtual sal_uInt16  SetPrinter( SfxPrinter* pNew, sal_uInt16 nDiff = SFX_PRINTER_ALL, bool bIsAPI=false ) SAL_OVERRIDE;
+    virtual sal_uInt16  SetPrinter( SfxPrinter* pNew, SfxPrinterChangeFlags nDiff = SFX_PRINTER_ALL, bool bIsAPI=false ) SAL_OVERRIDE;
     virtual SfxPrinter* GetPrinter( bool bCreate = false ) SAL_OVERRIDE;
 
     sal_Int32       PrintSource( OutputDevice *pOutDev, sal_Int32 nPage, bool bCalcNumPagesOnly );
diff --git a/sw/source/uibase/inc/view.hxx b/sw/source/uibase/inc/view.hxx
index b921216..8cd1d5cf 100644
--- a/sw/source/uibase/inc/view.hxx
+++ b/sw/source/uibase/inc/view.hxx
@@ -404,7 +404,7 @@ public:
     virtual ErrCode         DoVerb( long nVerb ) SAL_OVERRIDE;
 
     virtual sal_uInt16          SetPrinter( SfxPrinter* pNew,
-                                        sal_uInt16 nDiff = SFX_PRINTER_ALL, bool bIsAPI=false) SAL_OVERRIDE;
+                                        SfxPrinterChangeFlags nDiff = SFX_PRINTER_ALL, bool bIsAPI=false) SAL_OVERRIDE;
     ShellModes              GetShellMode();
 
     com::sun::star::view::XSelectionSupplier*       GetUNOObject();
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index b713b2a..83cc23f 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -1635,7 +1635,7 @@ SfxPrinter*  SwPagePreview::GetPrinter( bool bCreate )
     return pViewWin->GetViewShell()->getIDocumentDeviceAccess()->getPrinter( bCreate );
 }
 
-sal_uInt16  SwPagePreview::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags, bool )
+sal_uInt16  SwPagePreview::SetPrinter( SfxPrinter *pNew, SfxPrinterChangeFlags nDiffFlags, bool )
 {
     SwViewShell &rSh = *GetViewShell();
     SfxPrinter* pOld = rSh.getIDocumentDeviceAccess()->getPrinter( false );
@@ -1643,17 +1643,17 @@ sal_uInt16  SwPagePreview::SetPrinter( SfxPrinter *pNew, sal_uInt16 nDiffFlags,
         return SFX_PRINTERROR_BUSY;
 
     SwEditShell &rESh = static_cast<SwEditShell&>(rSh);  //Buh...
-    if( ( SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP ) & nDiffFlags )
+    if( ( SfxPrinterChangeFlags::PRINTER | SfxPrinterChangeFlags::JOBSETUP ) & nDiffFlags )
     {
         rSh.getIDocumentDeviceAccess()->setPrinter( pNew, true, true );
-        if( nDiffFlags & SFX_PRINTER_PRINTER )
+        if( nDiffFlags & SfxPrinterChangeFlags::PRINTER )
             rESh.SetModified();
     }
-    if ( ( nDiffFlags & SFX_PRINTER_OPTIONS ) == SFX_PRINTER_OPTIONS )
+    if ( ( nDiffFlags & SfxPrinterChangeFlags::OPTIONS ) == SfxPrinterChangeFlags::OPTIONS )
         ::SetPrinter( rSh.getIDocumentDeviceAccess(), pNew, false );
 
-    const bool bChgOri = nDiffFlags & SFX_PRINTER_CHG_ORIENTATION;
-    const bool bChgSize= nDiffFlags & SFX_PRINTER_CHG_SIZE;
+    const bool bChgOri  = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_ORIENTATION);
+    const bool bChgSize = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_SIZE);
     if ( bChgOri || bChgSize )
     {
         rESh.StartAllAction();
diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx
index fc0a8de..5582107 100644
--- a/sw/source/uibase/uiview/srcview.cxx
+++ b/sw/source/uibase/uiview/srcview.cxx
@@ -661,20 +661,20 @@ sal_uInt16 SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
     return nFound;
 }
 
-sal_uInt16 SwSrcView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool )
+sal_uInt16 SwSrcView::SetPrinter(SfxPrinter* pNew, SfxPrinterChangeFlags nDiffFlags, bool )
 {
     SwDocShell* pDocSh = GetDocShell();
-    if ( (SFX_PRINTER_JOBSETUP | SFX_PRINTER_PRINTER) & nDiffFlags )
+    if ( (SfxPrinterChangeFlags::JOBSETUP | SfxPrinterChangeFlags::PRINTER) & nDiffFlags )
     {
         pDocSh->GetDoc()->getIDocumentDeviceAccess().setPrinter( pNew, true, true );
-        if ( nDiffFlags & SFX_PRINTER_PRINTER )
+        if ( nDiffFlags & SfxPrinterChangeFlags::PRINTER )
             pDocSh->SetModified();
     }
-    if ( nDiffFlags & SFX_PRINTER_OPTIONS )
+    if ( nDiffFlags & SfxPrinterChangeFlags::OPTIONS )
         ::SetPrinter( pDocSh->getIDocumentDeviceAccess(), pNew, true );
 
-    const bool bChgOri = nDiffFlags & SFX_PRINTER_CHG_ORIENTATION;
-    const bool bChgSize= nDiffFlags & SFX_PRINTER_CHG_SIZE;
+    const bool bChgOri  = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_ORIENTATION);
+    const bool bChgSize = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_SIZE);
     if ( bChgOri || bChgSize )
     {
         pDocSh->SetModified();
diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx
index f2112af..a9e63c3 100644
--- a/sw/source/uibase/uiview/viewprt.cxx
+++ b/sw/source/uibase/uiview/viewprt.cxx
@@ -104,25 +104,25 @@ void SetPrinter( IDocumentDeviceAccess* pIDDA, SfxPrinter* pNew, bool bWeb )
     }
 }
 
-sal_uInt16 SwView::SetPrinter(SfxPrinter* pNew, sal_uInt16 nDiffFlags, bool  )
+sal_uInt16 SwView::SetPrinter(SfxPrinter* pNew, SfxPrinterChangeFlags nDiffFlags, bool  )
 {
     SwWrtShell &rSh = GetWrtShell();
     SfxPrinter* pOld = rSh.getIDocumentDeviceAccess()->getPrinter( false );
     if ( pOld && pOld->IsPrinting() )
         return SFX_PRINTERROR_BUSY;
 
-    if ( (SFX_PRINTER_JOBSETUP | SFX_PRINTER_PRINTER) & nDiffFlags )
+    if ( (SfxPrinterChangeFlags::JOBSETUP | SfxPrinterChangeFlags::PRINTER) & nDiffFlags )
     {
         rSh.getIDocumentDeviceAccess()->setPrinter( pNew, true, true );
-        if ( nDiffFlags & SFX_PRINTER_PRINTER )
+        if ( nDiffFlags & SfxPrinterChangeFlags::PRINTER )
             rSh.SetModified();
     }
     bool bWeb = this->ISA(SwWebView);
-    if ( nDiffFlags & SFX_PRINTER_OPTIONS )
+    if ( nDiffFlags & SfxPrinterChangeFlags::OPTIONS )
         ::SetPrinter( rSh.getIDocumentDeviceAccess(), pNew, bWeb );
 
-    const bool bChgOri = nDiffFlags & SFX_PRINTER_CHG_ORIENTATION;
-    const bool bChgSize= nDiffFlags & SFX_PRINTER_CHG_SIZE;
+    const bool bChgOri  = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_ORIENTATION);
+    const bool bChgSize = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_SIZE);
     if ( bChgOri || bChgSize )
     {
         rSh.StartAllAction();
@@ -295,8 +295,8 @@ void SetAppPrintOptions( SwViewShell* pSh, bool bWeb )
                         aMisc.IsNotFoundWarning() ));
         aSet.Put(aAddPrinterItem);
         aSet.Put( SfxFlagItem( SID_PRINTER_CHANGESTODOC,
-            (aMisc.IsPaperSizeWarning() ? SFX_PRINTER_CHG_SIZE : 0)   |
-            (aMisc.IsPaperOrientationWarning()  ? SFX_PRINTER_CHG_ORIENTATION : 0 )));
+            static_cast<int>(aMisc.IsPaperSizeWarning() ? SfxPrinterChangeFlags::CHG_SIZE : SfxPrinterChangeFlags::NONE)   |
+            static_cast<int>(aMisc.IsPaperOrientationWarning()  ? SfxPrinterChangeFlags::CHG_ORIENTATION : SfxPrinterChangeFlags::NONE )));
 
         pIDDA->getPrinter( true )->SetOptions( aSet );
     }
commit fba2d764d88582951f00af8184d481a6647a8564
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Mar 23 15:44:53 2015 +0200

    convert SfxPopupWindowType to enum class
    
    Change-Id: I03813103d648c5745beab740403c7912cdff2756

diff --git a/basctl/source/basicide/tbxctl.cxx b/basctl/source/basicide/tbxctl.cxx
index f2950b9..fac2961 100644
--- a/basctl/source/basicide/tbxctl.cxx
+++ b/basctl/source/basicide/tbxctl.cxx
@@ -63,8 +63,8 @@ TbxControls::TbxControls( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) :
 SfxPopupWindowType TbxControls::GetPopupWindowType() const
 {
     if( nLastSlot == USHRT_MAX )
-        return SFX_POPUPWINDOW_ONCLICK;
-    return SFX_POPUPWINDOW_ONTIMEOUT;
+        return SfxPopupWindowType::ONCLICK;
+    return SfxPopupWindowType::ONTIMEOUT;
 }
 
 void TbxControls::StateChanged( sal_uInt16 nSID, SfxItemState eState,
diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx
index f0fbfdb..e6d5388 100644
--- a/include/sfx2/tbxctrl.hxx
+++ b/include/sfx2/tbxctrl.hxx
@@ -65,14 +65,14 @@ struct SfxTbxCtrlFactory
 
 
 
-enum SfxPopupWindowType
+enum class SfxPopupWindowType
 {
-    SFX_POPUPWINDOW_NONE,
-    SFX_POPUPWINDOW_ONCLICK,
-    SFX_POPUPWINDOW_ONTIMEOUT,
-    SFX_POPUPWINDOW_ONCLICKANDMOVE,
-    SFX_POPUPWINDOW_ONTIMEOUTANDMOVE,
-    SFX_POPUPWINDOW_CONTEXTMENU
+    NONE,
+    ONCLICK,
+    ONTIMEOUT,
+    ONCLICKANDMOVE,
+    ONTIMEOUTANDMOVE,
+    CONTEXTMENU
 };
 
 
diff --git a/sc/source/ui/cctrl/tbinsert.cxx b/sc/source/ui/cctrl/tbinsert.cxx
index 4030b74..32b06bbb 100644
--- a/sc/source/ui/cctrl/tbinsert.cxx
+++ b/sc/source/ui/cctrl/tbinsert.cxx
@@ -95,7 +95,7 @@ SfxPopupWindow* ScTbxInsertCtrl::CreatePopupWindow()
 
 SfxPopupWindowType ScTbxInsertCtrl::GetPopupWindowType() const
 {
-    return nLastSlotId ? SFX_POPUPWINDOW_ONTIMEOUT : SFX_POPUPWINDOW_ONCLICK;
+    return nLastSlotId ? SfxPopupWindowType::ONTIMEOUT : SfxPopupWindowType::ONCLICK;
 }
 
 void ScTbxInsertCtrl::Select( bool /* bMod1 */ )
diff --git a/sd/source/ui/app/tbxww.cxx b/sd/source/ui/app/tbxww.cxx
index e2e3d7b..cbf4015 100644
--- a/sd/source/ui/app/tbxww.cxx
+++ b/sd/source/ui/app/tbxww.cxx
@@ -53,7 +53,7 @@ SdTbxControl::SdTbxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx )
 
 SfxPopupWindowType SdTbxControl::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONTIMEOUT;
+    return SfxPopupWindowType::ONTIMEOUT;
 }
 
 /**
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index 4c49cb9..027d440 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -976,7 +976,7 @@ void SfxToolBoxControl::Click()
 
 SfxPopupWindowType SfxToolBoxControl::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_NONE;
+    return SfxPopupWindowType::NONE;
 }
 
 
diff --git a/svx/source/customshapes/tbxcustomshapes.cxx b/svx/source/customshapes/tbxcustomshapes.cxx
index a1bad6d..b287aac 100644
--- a/svx/source/customshapes/tbxcustomshapes.cxx
+++ b/svx/source/customshapes/tbxcustomshapes.cxx
@@ -97,7 +97,7 @@ void SvxTbxCtlCustomShapes::StateChanged( sal_uInt16 nSID, SfxItemState eState,
 // when one wants to create a popup window
 SfxPopupWindowType SvxTbxCtlCustomShapes::GetPopupWindowType() const
 {
-    return( m_aCommand.isEmpty() ? SFX_POPUPWINDOW_ONCLICK : SFX_POPUPWINDOW_ONTIMEOUT);
+    return( m_aCommand.isEmpty() ? SfxPopupWindowType::ONCLICK : SfxPopupWindowType::ONTIMEOUT);
 }
 
 // Here is the window created
diff --git a/svx/source/form/tbxform.cxx b/svx/source/form/tbxform.cxx
index f72ad7c..3c3e8f7 100644
--- a/svx/source/form/tbxform.cxx
+++ b/svx/source/form/tbxform.cxx
@@ -198,7 +198,7 @@ void SvxFmTbxCtlConfig::StateChanged(sal_uInt16 nSID, SfxItemState eState, const
 
 SfxPopupWindowType SvxFmTbxCtlConfig::GetPopupWindowType() const
 {
-    return( nLastSlot == 0 ? SFX_POPUPWINDOW_ONCLICK : SFX_POPUPWINDOW_ONTIMEOUT );
+    return( nLastSlot == 0 ? SfxPopupWindowType::ONCLICK : SfxPopupWindowType::ONTIMEOUT );
 }
 
 
diff --git a/svx/source/mnuctrls/clipboardctl.cxx b/svx/source/mnuctrls/clipboardctl.cxx
index 352dcb0..e0ec272 100644
--- a/svx/source/mnuctrls/clipboardctl.cxx
+++ b/svx/source/mnuctrls/clipboardctl.cxx
@@ -110,7 +110,7 @@ SfxPopupWindow* SvxClipBoardControl::CreatePopupWindow()
 
 SfxPopupWindowType SvxClipBoardControl::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONTIMEOUT;
+    return SfxPopupWindowType::ONTIMEOUT;
 }
 
 
diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx
index 345aed3..5b13291 100644
--- a/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx
+++ b/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx
@@ -39,7 +39,7 @@ ParaLineSpacingPopup::~ParaLineSpacingPopup()
 
 SfxPopupWindowType ParaLineSpacingPopup::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONTIMEOUT;
+    return SfxPopupWindowType::ONTIMEOUT;
 }
 
 SfxPopupWindow* ParaLineSpacingPopup::CreatePopupWindow()
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index a2b6085..c4df8a5 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -273,7 +273,7 @@ FontWorkShapeTypeControl::~FontWorkShapeTypeControl()
 
 SfxPopupWindowType FontWorkShapeTypeControl::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONCLICK; //( aLastAction.getLength() == 0 ? SFX_POPUPWINDOW_ONCLICK : SFX_POPUPWINDOW_ONTIMEOUT );
+    return SfxPopupWindowType::ONCLICK; //( aLastAction.getLength() == 0 ? SfxPopupWindowType::ONCLICK : SfxPopupWindowType::ONTIMEOUT );
 }
 
 
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index a670e09..e42c3ce 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -446,7 +446,7 @@ void SvxGrafFilterToolBoxControl::StateChanged( sal_uInt16, SfxItemState eState,
 
 SfxPopupWindowType SvxGrafFilterToolBoxControl::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONCLICK;
+    return SfxPopupWindowType::ONCLICK;
 }
 
 SfxPopupWindow* SvxGrafFilterToolBoxControl::CreatePopupWindow()
diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx
index 7fd2388..53ed61e 100644
--- a/svx/source/tbxctrls/layctrl.cxx
+++ b/svx/source/tbxctrls/layctrl.cxx
@@ -717,7 +717,7 @@ SvxTableToolBoxControl::~SvxTableToolBoxControl()
 
 SfxPopupWindowType SvxTableToolBoxControl::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONTIMEOUTANDMOVE;
+    return SfxPopupWindowType::ONTIMEOUTANDMOVE;
 }
 
 
@@ -782,7 +782,7 @@ SvxColumnsToolBoxControl::~SvxColumnsToolBoxControl()
 
 SfxPopupWindowType SvxColumnsToolBoxControl::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONTIMEOUTANDMOVE;
+    return SfxPopupWindowType::ONTIMEOUTANDMOVE;
 }
 
 
diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx
index 66512d5..f65d68f 100644
--- a/svx/source/tbxctrls/lboxctrl.cxx
+++ b/svx/source/tbxctrls/lboxctrl.cxx
@@ -153,7 +153,7 @@ SfxPopupWindow* SvxListBoxControl::CreatePopupWindow()
 
 SfxPopupWindowType SvxListBoxControl::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONTIMEOUT;
+    return SfxPopupWindowType::ONTIMEOUT;
 }
 
 
diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx
index 56fd6a6..bee2f93 100644
--- a/svx/source/tbxctrls/linectrl.cxx
+++ b/svx/source/tbxctrls/linectrl.cxx
@@ -619,7 +619,7 @@ SvxLineEndToolBoxControl::~SvxLineEndToolBoxControl()
 
 SfxPopupWindowType SvxLineEndToolBoxControl::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONCLICK;
+    return SfxPopupWindowType::ONCLICK;
 }
 
 
diff --git a/svx/source/tbxctrls/subtoolboxcontrol.cxx b/svx/source/tbxctrls/subtoolboxcontrol.cxx
index d186f55..c04c79b 100644
--- a/svx/source/tbxctrls/subtoolboxcontrol.cxx
+++ b/svx/source/tbxctrls/subtoolboxcontrol.cxx
@@ -54,7 +54,7 @@ SfxPopupWindow* SvxSubToolBoxControl::CreatePopupWindow()
 
 SfxPopupWindowType  SvxSubToolBoxControl::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONCLICK;
+    return SfxPopupWindowType::ONCLICK;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index ff96a35..e66a10c 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2492,7 +2492,7 @@ SvxColorToolBoxControl::~SvxColorToolBoxControl()
 
 SfxPopupWindowType SvxColorToolBoxControl::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONTIMEOUT;
+    return SfxPopupWindowType::ONTIMEOUT;
 }
 
 SfxPopupWindow* SvxColorToolBoxControl::CreatePopupWindow()
@@ -2670,7 +2670,7 @@ SvxFrameToolBoxControl::SvxFrameToolBoxControl(
 
 SfxPopupWindowType SvxFrameToolBoxControl::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONCLICK;
+    return SfxPopupWindowType::ONCLICK;
 }
 
 SfxPopupWindow* SvxFrameToolBoxControl::CreatePopupWindow()
@@ -2712,7 +2712,7 @@ SvxFrameLineStyleToolBoxControl::SvxFrameLineStyleToolBoxControl(
 
 SfxPopupWindowType SvxFrameLineStyleToolBoxControl::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONCLICK;
+    return SfxPopupWindowType::ONCLICK;
 }
 
 SfxPopupWindow* SvxFrameLineStyleToolBoxControl::CreatePopupWindow()
diff --git a/svx/source/tbxctrls/tbxalign.cxx b/svx/source/tbxctrls/tbxalign.cxx
index 2e4e0f2..41571ee 100644
--- a/svx/source/tbxctrls/tbxalign.cxx
+++ b/svx/source/tbxctrls/tbxalign.cxx
@@ -52,7 +52,7 @@ SvxTbxCtlAlign::SvxTbxCtlAlign( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTb
 
 SfxPopupWindowType SvxTbxCtlAlign::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONCLICK;
+    return SfxPopupWindowType::ONCLICK;
 }
 
 /*
diff --git a/svx/source/tbxctrls/tbxdrctl.cxx b/svx/source/tbxctrls/tbxdrctl.cxx
index 541b2e0..6280e1f 100644
--- a/svx/source/tbxctrls/tbxdrctl.cxx
+++ b/svx/source/tbxctrls/tbxdrctl.cxx
@@ -70,7 +70,7 @@ void SvxTbxCtlDraw::StateChanged( sal_uInt16 nSID, SfxItemState eState,
 
 SfxPopupWindowType SvxTbxCtlDraw::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONCLICK;
+    return SfxPopupWindowType::ONCLICK;
 }
 
 
diff --git a/sw/source/uibase/ribbar/tblctrl.cxx b/sw/source/uibase/ribbar/tblctrl.cxx
index c194062..b56e892 100644
--- a/sw/source/uibase/ribbar/tblctrl.cxx
+++ b/sw/source/uibase/ribbar/tblctrl.cxx
@@ -49,7 +49,7 @@ SfxPopupWindow* SwTableOptimizeCtrl::CreatePopupWindow()
 
 SfxPopupWindowType  SwTableOptimizeCtrl::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONCLICK;
+    return SfxPopupWindowType::ONCLICK;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx
index 09ee4a3..7cbb8b9 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -135,7 +135,7 @@ SfxPopupWindow* SwTbxInsertCtrl::CreatePopupWindow()
 
 SfxPopupWindowType  SwTbxInsertCtrl::GetPopupWindowType() const
 {
-    return nLastSlotId ? SFX_POPUPWINDOW_ONTIMEOUT : SFX_POPUPWINDOW_ONCLICK;
+    return nLastSlotId ? SfxPopupWindowType::ONTIMEOUT : SfxPopupWindowType::ONCLICK;
 }
 
 void SwTbxInsertCtrl::Select( sal_uInt16 /*nSelectModifier*/ )
@@ -224,7 +224,7 @@ SfxPopupWindow* SwTbxAutoTextCtrl::CreatePopupWindow()
 
 SfxPopupWindowType SwTbxAutoTextCtrl::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONTIMEOUT;
+    return SfxPopupWindowType::ONTIMEOUT;
 }
 
 void SwTbxAutoTextCtrl::StateChanged( sal_uInt16,
@@ -321,7 +321,7 @@ SfxPopupWindow* SwTbxFieldCtrl::CreatePopupWindow()
 
 SfxPopupWindowType SwTbxFieldCtrl::GetPopupWindowType() const
 {
-    return SFX_POPUPWINDOW_ONTIMEOUT;
+    return SfxPopupWindowType::ONTIMEOUT;
 }
 
 void SwTbxFieldCtrl::StateChanged( sal_uInt16,
commit b2125ae811c2fc2233026e5218a03bc24210a5c1
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Mar 23 15:30:00 2015 +0200

    convert FILTER_APPLICATION to enum class
    
    Change-Id: I9ad1d1c9a2d9d538a4cc95f0b65f45f631116916

diff --git a/include/sfx2/templateabstractview.hxx b/include/sfx2/templateabstractview.hxx
index 5e316e1..5509374 100644
--- a/include/sfx2/templateabstractview.hxx
+++ b/include/sfx2/templateabstractview.hxx
@@ -31,13 +31,13 @@
 
 class SfxDocumentTemplates;
 
-enum FILTER_APPLICATION
+enum class FILTER_APPLICATION
 {
-    FILTER_APP_NONE,
-    FILTER_APP_WRITER,
-    FILTER_APP_CALC,
-    FILTER_APP_IMPRESS,
-    FILTER_APP_DRAW
+    NONE,
+    WRITER,
+    CALC,
+    IMPRESS,
+    DRAW
 };
 
 // Display template items depending on the generator application
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
index d7858a4..51b213d 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -38,19 +38,19 @@ bool ViewFilter_Application::isFilteredExtension(FILTER_APPLICATION filter, cons
 {
     bool bRet = true;
 
-    if (filter == FILTER_APP_WRITER)
+    if (filter == FILTER_APPLICATION::WRITER)
     {
         bRet = rExt == "ott" || rExt == "stw" || rExt == "oth" || rExt == "dot" || rExt == "dotx" || rExt == "otm";
     }
-    else if (filter == FILTER_APP_CALC)
+    else if (filter == FILTER_APPLICATION::CALC)
     {
         bRet = rExt == "ots" || rExt == "stc" || rExt == "xlt" || rExt == "xltm" || rExt == "xltx";
     }
-    else if (filter == FILTER_APP_IMPRESS)
+    else if (filter == FILTER_APPLICATION::IMPRESS)
     {
         bRet = rExt == "otp" || rExt == "sti" || rExt == "pot" || rExt == "potm" || rExt == "potx";
     }
-    else if (filter == FILTER_APP_DRAW)
+    else if (filter == FILTER_APPLICATION::DRAW)
     {
         bRet = rExt == "otg" || rExt == "std";
     }
@@ -249,13 +249,13 @@ BitmapEx TemplateAbstractView::getDefaultThumbnail( const OUString& rPath )
     INetURLObject aUrl(rPath);
     OUString aExt = aUrl.getExtension();
 
-    if ( ViewFilter_Application::isFilteredExtension( FILTER_APP_WRITER, aExt) )
+    if ( ViewFilter_Application::isFilteredExtension( FILTER_APPLICATION::WRITER, aExt) )
         aImg = BitmapEx ( SfxResId( SFX_THUMBNAIL_TEXT ) );
-    else if ( ViewFilter_Application::isFilteredExtension( FILTER_APP_CALC, aExt) )
+    else if ( ViewFilter_Application::isFilteredExtension( FILTER_APPLICATION::CALC, aExt) )
         aImg = BitmapEx ( SfxResId( SFX_THUMBNAIL_SHEET ) );
-    else if ( ViewFilter_Application::isFilteredExtension( FILTER_APP_IMPRESS, aExt) )
+    else if ( ViewFilter_Application::isFilteredExtension( FILTER_APPLICATION::IMPRESS, aExt) )
         aImg = BitmapEx ( SfxResId( SFX_THUMBNAIL_PRESENTATION ) );
-    else if ( ViewFilter_Application::isFilteredExtension( FILTER_APP_DRAW, aExt) )
+    else if ( ViewFilter_Application::isFilteredExtension( FILTER_APPLICATION::DRAW, aExt) )
         aImg = BitmapEx ( SfxResId( SFX_THUMBNAIL_DRAWING ) );
 
     return aImg;
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index e0074b5..e716242 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -322,7 +322,7 @@ void BackingWindow::initializeLocalView()
         mbLocalViewInitialized = true;
         mpLocalView->Populate();
         mpLocalView->showRootRegion();
-        mpLocalView->filterItems(ViewFilter_Application(FILTER_APP_NONE));
+        mpLocalView->filterItems(ViewFilter_Application(FILTER_APPLICATION::NONE));
     }
 }
 
@@ -564,7 +564,7 @@ IMPL_LINK( BackingWindow, ClickHdl, Button*, pButton )
     {
         mpAllRecentThumbnails->Hide();
         initializeLocalView();
-        mpLocalView->filterItems(ViewFilter_Application(FILTER_APP_NONE));
+        mpLocalView->filterItems(ViewFilter_Application(FILTER_APPLICATION::NONE));
         mpLocalView->Show();
         mpLocalView->reload();
         mpLocalView->GrabFocus();
@@ -580,19 +580,19 @@ IMPL_LINK( BackingWindow, MenuSelectHdl, MenuButton*, pButton )
 
     if( sId == "filter_writer" )
     {
-        mpLocalView->filterItems(ViewFilter_Application(FILTER_APP_WRITER));
+        mpLocalView->filterItems(ViewFilter_Application(FILTER_APPLICATION::WRITER));
     }
     else if( sId == "filter_calc" )
     {
-        mpLocalView->filterItems(ViewFilter_Application(FILTER_APP_CALC));
+        mpLocalView->filterItems(ViewFilter_Application(FILTER_APPLICATION::CALC));
     }
     else if( sId == "filter_impress" )
     {
-        mpLocalView->filterItems(ViewFilter_Application(FILTER_APP_IMPRESS));
+        mpLocalView->filterItems(ViewFilter_Application(FILTER_APPLICATION::IMPRESS));
     }
     else if( sId == "filter_draw" )
     {
-        mpLocalView->filterItems(ViewFilter_Application(FILTER_APP_DRAW));
+        mpLocalView->filterItems(ViewFilter_Application(FILTER_APPLICATION::DRAW));
     }
     else if( sId == "edit" )
     {
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index a584a7d..6b32d1a 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -136,19 +136,19 @@ public:
         INetURLObject aUrl(rItem.aPath);
         OUString aExt = aUrl.getExtension();
 
-        if (meApp == FILTER_APP_WRITER)
+        if (meApp == FILTER_APPLICATION::WRITER)
         {
             bRet = aExt == "ott" || aExt == "stw" || aExt == "oth" || aExt == "dot" || aExt == "dotx";
         }
-        else if (meApp == FILTER_APP_CALC)
+        else if (meApp == FILTER_APPLICATION::CALC)
         {
             bRet = aExt == "ots" || aExt == "stc" || aExt == "xlt" || aExt == "xltm" || aExt == "xltx";
         }
-        else if (meApp == FILTER_APP_IMPRESS)
+        else if (meApp == FILTER_APPLICATION::IMPRESS)
         {
             bRet = aExt == "otp" || aExt == "sti" || aExt == "pot" || aExt == "potm" || aExt == "potx";
         }
-        else if (meApp == FILTER_APP_DRAW)
+        else if (meApp == FILTER_APPLICATION::DRAW)
         {
             bRet = aExt == "otg" || aExt == "std";
         }
@@ -289,7 +289,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(vcl::Window *parent)
     createDefaultTemplateMenu();
 
     mpLocalView->Populate();
-    mpCurView->filterItems(ViewFilter_Application(FILTER_APP_WRITER));
+    mpCurView->filterItems(ViewFilter_Application(FILTER_APPLICATION::WRITER));
 
     readSettings();
 
@@ -330,7 +330,7 @@ void SfxTemplateManagerDlg::setSaveMode()
     while (mpTabControl->GetPageCount() > 1)
         mpTabControl->RemovePage(mpTabControl->GetPageId(1));
 
-    mpCurView->filterItems(ViewFilter_Application(FILTER_APP_NONE));
+    mpCurView->filterItems(ViewFilter_Application(FILTER_APPLICATION::NONE));
 
     mpViewBar->ShowItem(VIEWBAR_SAVE);
     mpViewBar->HideItem(VIEWBAR_IMPORT);
@@ -356,15 +356,15 @@ FILTER_APPLICATION SfxTemplateManagerDlg::getCurrentFilter()
     const sal_uInt16 nCurPageId = mpTabControl->GetCurPageId();
 
     if (nCurPageId == mpTabControl->GetPageId(FILTER_DOCS))
-        return FILTER_APP_WRITER;
+        return FILTER_APPLICATION::WRITER;
     else if (nCurPageId == mpTabControl->GetPageId(FILTER_PRESENTATIONS))
-        return FILTER_APP_IMPRESS;
+        return FILTER_APPLICATION::IMPRESS;
     else if (nCurPageId == mpTabControl->GetPageId(FILTER_SHEETS))
-        return FILTER_APP_CALC;
+        return FILTER_APPLICATION::CALC;
     else if (nCurPageId == mpTabControl->GetPageId(FILTER_DRAWINGS))
-        return FILTER_APP_DRAW;
+        return FILTER_APPLICATION::DRAW;
 
-    return FILTER_APP_NONE;
+    return FILTER_APPLICATION::NONE;
 }
 
 IMPL_LINK_NOARG(SfxTemplateManagerDlg,ActivatePageHdl)
@@ -386,24 +386,25 @@ void SfxTemplateManagerDlg::readSettings ()
 
     if ( aViewSettings.Exists() )
     {
-        sal_uInt16 nFilter = 0;
+        sal_uInt16 nTmp = 0;
         aViewSettings.GetUserItem(TM_SETTING_LASTFOLDER) >>= aLastFolder;
-        aViewSettings.GetUserItem(TM_SETTING_FILTER) >>= nFilter;
-
+        aViewSettings.GetUserItem(TM_SETTING_FILTER) >>= nTmp;
+        FILTER_APPLICATION nFilter = static_cast<FILTER_APPLICATION>(nTmp);
         switch (nFilter)
         {
-            case FILTER_APP_WRITER:
+            case FILTER_APPLICATION::WRITER:
                 nPageId = mpTabControl->GetPageId(FILTER_DOCS);
                 break;
-            case FILTER_APP_IMPRESS:
+            case FILTER_APPLICATION::IMPRESS:
                 nPageId = mpTabControl->GetPageId(FILTER_PRESENTATIONS);
                 break;
-            case FILTER_APP_CALC:
+            case FILTER_APPLICATION::CALC:
                 nPageId = mpTabControl->GetPageId(FILTER_SHEETS);
                 break;
-            case FILTER_APP_DRAW:
+            case FILTER_APPLICATION::DRAW:
                 nPageId = mpTabControl->GetPageId(FILTER_DRAWINGS);
                 break;
+            default: break;
         }
     }
 
commit ecec9afe852d3bca019b6b44a40d8be39e0f58f4
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Mar 23 15:20:12 2015 +0200

    convert SVX_ZOOM_ENABLE constants to enum class
    
    Change-Id: Iead354b95b832edd72eb8e881855f228fd85be70

diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx
index 446e47a..32dea8c 100644
--- a/cui/source/dialogs/zoom.cxx
+++ b/cui/source/dialogs/zoom.cxx
@@ -207,7 +207,7 @@ SvxZoomDialog::SvxZoomDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet )
         const SvxZoomItem& rZoomItem = static_cast<const SvxZoomItem&>(rItem);
         const sal_uInt16 nZoom = rZoomItem.GetValue();
         const SvxZoomType eType = rZoomItem.GetType();
-        const sal_uInt16 nValSet = rZoomItem.GetValueSet();
+        const SvxZoomEnableFlags nValSet = rZoomItem.GetValueSet();
         sal_uInt16 nButtonId = 0;
 
         switch (eType)
@@ -227,13 +227,13 @@ SvxZoomDialog::SvxZoomDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet )
                 break;
         }
 
-        if (!(SVX_ZOOM_ENABLE_100 & nValSet))
+        if (!(SvxZoomEnableFlags::N100 & nValSet))
             m_p100Btn->Disable();
-        if (!(SVX_ZOOM_ENABLE_OPTIMAL & nValSet))
+        if (!(SvxZoomEnableFlags::OPTIMAL & nValSet))
             m_pOptimalBtn->Disable();
-        if (!(SVX_ZOOM_ENABLE_PAGEWIDTH & nValSet))
+        if (!(SvxZoomEnableFlags::PAGEWIDTH & nValSet))
             m_pPageWidthBtn->Disable();
-        if (!(SVX_ZOOM_ENABLE_WHOLEPAGE & nValSet))
+        if (!(SvxZoomEnableFlags::WHOLEPAGE & nValSet))
             m_pWholePageBtn->Disable();
 
         SetFactor(nZoom, nButtonId);
diff --git a/include/sfx2/zoomitem.hxx b/include/sfx2/zoomitem.hxx
index 2354223..efc6a96 100644
--- a/include/sfx2/zoomitem.hxx
+++ b/include/sfx2/zoomitem.hxx
@@ -22,7 +22,7 @@
 #include <svl/intitem.hxx>
 #include <sfx2/sfxsids.hrc>
 #include <sfx2/dllapi.h>
-
+#include <o3tl/typed_flags_set.hxx>
 
 
 enum class SvxZoomType
@@ -34,11 +34,27 @@ enum class SvxZoomType
     PAGEWIDTH_NOBORDER  // GetValue() pagewidth without border
 };
 
-
+enum class SvxZoomEnableFlags
+{
+    NONE         = 0x0000,
+    N50          = 0x0001,
+    N75          = 0x0002,
+    N100         = 0x0004,
+    N150         = 0x0008,
+    N200         = 0x0010,
+    OPTIMAL      = 0x1000,
+    WHOLEPAGE    = 0x2000,
+    PAGEWIDTH    = 0x4000,
+    ALL          = 0x701F
+};
+namespace o3tl
+{
+    template<> struct typed_flags<SvxZoomEnableFlags> : is_typed_flags<SvxZoomEnableFlags, 0x701f> {};
+}
 
 class SFX2_DLLPUBLIC SvxZoomItem: public SfxUInt16Item
 {
-    sal_uInt16              nValueSet;  // allowed values (see #defines below)
+    SvxZoomEnableFlags      nValueSet;  // allowed values (see #defines below)
     SvxZoomType             eType;
 
 public:
@@ -49,14 +65,13 @@ public:
     SvxZoomItem( const SvxZoomItem& );
     virtual ~SvxZoomItem();
 
-    void                    SetValueSet( sal_uInt16 nValues ) { nValueSet = nValues; }
-    sal_uInt16              GetValueSet() const { return nValueSet; }
-    bool                    IsValueAllowed( sal_uInt16 nValue ) const
-                            { return nValue == ( nValue & nValueSet ); }
+    void                    SetValueSet( SvxZoomEnableFlags nValues ) { nValueSet = nValues; }
+    SvxZoomEnableFlags      GetValueSet() const { return nValueSet; }
+    bool                    IsValueAllowed( SvxZoomEnableFlags nValue ) const
+                            { return bool( nValue & nValueSet ); }
 
     SvxZoomType             GetType() const { return eType; }
-    void                    SetType( SvxZoomType eNewType )
-                            { eType = eNewType; }
+    void                    SetType( SvxZoomType eNewType ) { eType = eNewType; }
 
     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = 0 ) const SAL_OVERRIDE;
     virtual SfxPoolItem*    Create( SvStream& rStrm, sal_uInt16 nVersion ) const SAL_OVERRIDE;
@@ -68,16 +83,6 @@ public:
 
 
 
-#define SVX_ZOOM_ENABLE_50          0x0001
-#define SVX_ZOOM_ENABLE_75          0x0002
-#define SVX_ZOOM_ENABLE_100         0x0004
-#define SVX_ZOOM_ENABLE_150         0x0008
-#define SVX_ZOOM_ENABLE_200         0x0010
-#define SVX_ZOOM_ENABLE_OPTIMAL     0x1000
-#define SVX_ZOOM_ENABLE_WHOLEPAGE   0x2000
-#define SVX_ZOOM_ENABLE_PAGEWIDTH   0x4000
-#define SVX_ZOOM_ENABLE_ALL         0x701F
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/zoomctrl.hxx b/include/svx/zoomctrl.hxx
index c6937ee..c829181 100644
--- a/include/svx/zoomctrl.hxx
+++ b/include/svx/zoomctrl.hxx
@@ -21,13 +21,14 @@
 
 #include <sfx2/stbitem.hxx>
 #include <svx/svxdllapi.h>
+#include <sfx2/zoomitem.hxx>
 #include <vcl/image.hxx>
 
 class SVX_DLLPUBLIC SvxZoomStatusBarControl : public SfxStatusBarControl
 {
 private:
-    sal_uInt16  nZoom;
-    sal_uInt16  nValueSet;
+    sal_uInt16         nZoom;
+    SvxZoomEnableFlags nValueSet;
 
 public:
     virtual void    StateChanged( sal_uInt16 nSID, SfxItemState eState,
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index ca05e17..38ae927 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -942,7 +942,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
             aReturn.bEnabled = true;
             {
                 SvxZoomItem aZoom(m_eZoomType,m_nZoomValue);
-                aZoom.SetValueSet(SVX_ZOOM_ENABLE_50|SVX_ZOOM_ENABLE_75|SVX_ZOOM_ENABLE_100|SVX_ZOOM_ENABLE_200);
+                aZoom.SetValueSet(SvxZoomEnableFlags::N50|SvxZoomEnableFlags::N75|SvxZoomEnableFlags::N100|SvxZoomEnableFlags::N200);
                 aZoom.QueryValue(aReturn.aValue);
             }
             break;
@@ -4275,7 +4275,7 @@ void OReportController::openZoomDialog()
             ::std::unique_ptr<SfxItemSet> pDescriptor(new SfxItemSet(*pPool, pRanges));
             // fill it
             SvxZoomItem aZoomItem( m_eZoomType, m_nZoomValue, SID_ATTR_ZOOM );
-            aZoomItem.SetValueSet(SVX_ZOOM_ENABLE_100|SVX_ZOOM_ENABLE_WHOLEPAGE|SVX_ZOOM_ENABLE_PAGEWIDTH);
+            aZoomItem.SetValueSet(SvxZoomEnableFlags::N100|SvxZoomEnableFlags::WHOLEPAGE|SvxZoomEnableFlags::PAGEWIDTH);
             pDescriptor->Put(aZoomItem);
 
             ::std::unique_ptr<AbstractSvxZoomDialog> pDlg( pFact->CreateSvxZoomDialog(NULL, *pDescriptor.get()) );
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 3bc36f7..e79dd92 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -829,7 +829,7 @@ void ScPreviewShell::GetState( SfxItemSet& rSet )
             case SID_ATTR_ZOOM:
                 {
                     SvxZoomItem aZoom( eZoom, nZoom, nWhich );
-                    aZoom.SetValueSet( SVX_ZOOM_ENABLE_ALL & ~SVX_ZOOM_ENABLE_OPTIMAL );
+                    aZoom.SetValueSet( SvxZoomEnableFlags::ALL & ~SvxZoomEnableFlags::OPTIMAL );
                     rSet.Put( aZoom );
                 }
                 break;
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index e7da396..bee2927 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -640,16 +640,16 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
                     SvxZoomItem     aZoomItem( eOldZoomType, nOldZoom, SID_ATTR_ZOOM );
                     boost::scoped_ptr<AbstractSvxZoomDialog> pDlg;
                     ScMarkData&     rMark = GetViewData().GetMarkData();
-                    sal_uInt16          nBtnFlags =   SVX_ZOOM_ENABLE_50
-                                                | SVX_ZOOM_ENABLE_75
-                                                | SVX_ZOOM_ENABLE_100
-                                                | SVX_ZOOM_ENABLE_150
-                                                | SVX_ZOOM_ENABLE_200
-                                                | SVX_ZOOM_ENABLE_WHOLEPAGE
-                                                | SVX_ZOOM_ENABLE_PAGEWIDTH;
+                    SvxZoomEnableFlags nBtnFlags = SvxZoomEnableFlags::N50
+                                                | SvxZoomEnableFlags::N75
+                                                | SvxZoomEnableFlags::N100
+                                                | SvxZoomEnableFlags::N150
+                                                | SvxZoomEnableFlags::N200
+                                                | SvxZoomEnableFlags::WHOLEPAGE
+                                                | SvxZoomEnableFlags::PAGEWIDTH;
 
                     if ( rMark.IsMarked() || rMark.IsMultiMarked() )
-                        nBtnFlags = nBtnFlags | SVX_ZOOM_ENABLE_OPTIMAL;
+                        nBtnFlags = nBtnFlags | SvxZoomEnableFlags::OPTIMAL;
 
                     aZoomItem.SetValueSet( nBtnFlags );
                     aSet.Put( aZoomItem );
diff --git a/sd/source/ui/func/fuscale.cxx b/sd/source/ui/func/fuscale.cxx
index bee4127..9729951 100644
--- a/sd/source/ui/func/fuscale.cxx
+++ b/sd/source/ui/func/fuscale.cxx
@@ -72,7 +72,7 @@ void FuScale::DoExecute( SfxRequest& rReq )
     {
         SfxItemSet aNewAttr( mpDoc->GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM );
         boost::scoped_ptr<SvxZoomItem> pZoomItem;
-        sal_uInt16 nZoomValues = SVX_ZOOM_ENABLE_ALL;
+        SvxZoomEnableFlags nZoomValues = SvxZoomEnableFlags::ALL;
 
         nValue = (sal_Int16) mpWindow->GetZoom();
 
@@ -96,14 +96,14 @@ void FuScale::DoExecute( SfxRequest& rReq )
                 if( ( pPageView && pPageView->GetObjList()->GetObjCount() == 0 ) )
                     // || ( mpView->GetMarkedObjectList().GetMarkCount() == 0 ) )
                 {
-                    nZoomValues &= ~SVX_ZOOM_ENABLE_OPTIMAL;
+                    nZoomValues &= ~SvxZoomEnableFlags::OPTIMAL;
                 }
             }
             else if( mpViewShell->ISA( OutlineViewShell ) )
             {
-                nZoomValues &= ~SVX_ZOOM_ENABLE_OPTIMAL;
-                nZoomValues &= ~SVX_ZOOM_ENABLE_WHOLEPAGE;
-                nZoomValues &= ~SVX_ZOOM_ENABLE_PAGEWIDTH;
+                nZoomValues &= ~SvxZoomEnableFlags::OPTIMAL;
+                nZoomValues &= ~SvxZoomEnableFlags::WHOLEPAGE;
+                nZoomValues &= ~SvxZoomEnableFlags::PAGEWIDTH;
             }
         }
 
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index f319505..d3421cb 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -590,13 +590,13 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet)
                 pZoomItem.reset(new SvxZoomItem( SvxZoomType::PERCENT, nZoom ));
 
             // constrain area
-            sal_uInt16 nZoomValues = SVX_ZOOM_ENABLE_ALL;
+            SvxZoomEnableFlags nZoomValues = SvxZoomEnableFlags::ALL;
             SdrPageView* pPageView = mpDrawView->GetSdrPageView();
 
             if( ( pPageView && pPageView->GetObjList()->GetObjCount() == 0 ) )
                 // || ( mpDrawView->GetMarkedObjectList().GetMarkCount() == 0 ) )
             {
-                nZoomValues &= ~SVX_ZOOM_ENABLE_OPTIMAL;
+                nZoomValues &= ~SvxZoomEnableFlags::OPTIMAL;
             }
 
             pZoomItem->SetValueSet( nZoomValues );
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index 494119a..bc7ec61 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -1279,10 +1279,10 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet)
         boost::scoped_ptr<SvxZoomItem> pZoomItem(new SvxZoomItem( SvxZoomType::PERCENT, nZoom ));
 
         // limit area
-        sal_uInt16 nZoomValues = SVX_ZOOM_ENABLE_ALL;
-        nZoomValues &= ~SVX_ZOOM_ENABLE_OPTIMAL;
-        nZoomValues &= ~SVX_ZOOM_ENABLE_WHOLEPAGE;
-        nZoomValues &= ~SVX_ZOOM_ENABLE_PAGEWIDTH;
+        SvxZoomEnableFlags nZoomValues = SvxZoomEnableFlags::ALL;
+        nZoomValues &= ~SvxZoomEnableFlags::OPTIMAL;
+        nZoomValues &= ~SvxZoomEnableFlags::WHOLEPAGE;
+        nZoomValues &= ~SvxZoomEnableFlags::PAGEWIDTH;
 
         pZoomItem->SetValueSet( nZoomValues );
         rSet.Put( *pZoomItem );
diff --git a/sfx2/source/doc/zoomitem.cxx b/sfx2/source/doc/zoomitem.cxx
index a89e590..69a24f3 100644
--- a/sfx2/source/doc/zoomitem.cxx
+++ b/sfx2/source/doc/zoomitem.cxx
@@ -43,7 +43,7 @@ SvxZoomItem::SvxZoomItem
     sal_uInt16      _nWhich
 )
 :   SfxUInt16Item( _nWhich, nVal ),
-    nValueSet( SVX_ZOOM_ENABLE_ALL ),
+    nValueSet( SvxZoomEnableFlags::ALL ),
     eType( eZoomType )
 {
 }
@@ -79,7 +79,7 @@ SfxPoolItem* SvxZoomItem::Create( SvStream& rStrm, sal_uInt16 /*nVersion*/ ) con
     sal_Int8 nType;
     rStrm.ReadUInt16( nValue ).ReadUInt16( nValSet ).ReadSChar( nType );
     SvxZoomItem* pNew = new SvxZoomItem( (SvxZoomType)nType, nValue, Which() );
-    pNew->SetValueSet( nValSet );
+    pNew->SetValueSet( static_cast<SvxZoomEnableFlags>(nValSet) );
     return pNew;
 }
 
@@ -88,7 +88,7 @@ SfxPoolItem* SvxZoomItem::Create( SvStream& rStrm, sal_uInt16 /*nVersion*/ ) con
 SvStream& SvxZoomItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) const
 {
     rStrm.WriteUInt16( GetValue() )
-         .WriteUInt16( nValueSet )
+         .WriteUInt16( static_cast<sal_uInt16>(nValueSet) )
          .WriteSChar( static_cast<int>(eType) );
     return rStrm;
 }
@@ -172,8 +172,8 @@ bool SvxZoomItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMem
                 if ( bAllConverted && nConvertedCount == ZOOM_PARAMS )
                 {
                     SetValue( (sal_uInt16)nValueTmp );
-                    nValueSet = nValueSetTmp;
-                    eType = SvxZoomType( nTypeTmp );
+                    nValueSet = static_cast<SvxZoomEnableFlags>(nValueSetTmp);
+                    eType = static_cast<SvxZoomType>(nTypeTmp);
                     return true;
                 }
             }
@@ -194,13 +194,13 @@ bool SvxZoomItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMem
         case MID_VALUESET:
         case MID_TYPE:
         {
-            sal_Int16 nVal = sal_Int16();
+            sal_Int16 nVal;
             if ( rVal >>= nVal )
             {
                 if ( nMemberId == MID_VALUESET )
-                    nValueSet = (sal_Int16) nVal;
+                    nValueSet = static_cast<SvxZoomEnableFlags>(nVal);
                 else if ( nMemberId == MID_TYPE )
-                    eType = SvxZoomType( (sal_Int16) nVal );
+                    eType = static_cast<SvxZoomType>(nVal);
                 return true;
             }
             else
diff --git a/svx/source/stbctrls/zoomctrl.cxx b/svx/source/stbctrls/zoomctrl.cxx
index b50efb2..d5b9ad3 100644
--- a/svx/source/stbctrls/zoomctrl.cxx
+++ b/svx/source/stbctrls/zoomctrl.cxx
@@ -39,7 +39,7 @@ SFX_IMPL_STATUSBAR_CONTROL(SvxZoomStatusBarControl,SvxZoomItem);
 class ZoomPopup_Impl : public PopupMenu
 {
 public:
-    ZoomPopup_Impl( sal_uInt16 nZ, sal_uInt16 nValueSet );
+    ZoomPopup_Impl( sal_uInt16 nZ, SvxZoomEnableFlags nValueSet );
 
     sal_uInt16          GetZoom() const { return nZoom; }
     sal_uInt16          GetCurId() const { return nCurId; }
@@ -53,25 +53,25 @@ private:
 
 
 
-ZoomPopup_Impl::ZoomPopup_Impl( sal_uInt16 nZ, sal_uInt16 nValueSet )
+ZoomPopup_Impl::ZoomPopup_Impl( sal_uInt16 nZ, SvxZoomEnableFlags nValueSet )
     : PopupMenu(ResId(RID_SVXMNU_ZOOM, DIALOG_MGR()))
     , nZoom(nZ)
     , nCurId(0)
 {
-    static const sal_uInt16 aTable[] =
-    {
-        SVX_ZOOM_ENABLE_50,         ZOOM_50,
-        SVX_ZOOM_ENABLE_100,        ZOOM_100,
-        SVX_ZOOM_ENABLE_150,        ZOOM_150,
-        SVX_ZOOM_ENABLE_200,        ZOOM_200,
-        SVX_ZOOM_ENABLE_OPTIMAL,    ZOOM_OPTIMAL,
-        SVX_ZOOM_ENABLE_WHOLEPAGE,  ZOOM_WHOLE_PAGE,
-        SVX_ZOOM_ENABLE_PAGEWIDTH,  ZOOM_PAGE_WIDTH
-    };
-
-    for ( sal_uInt16 nPos = 0; nPos < SAL_N_ELEMENTS(aTable); nPos += 2 )
-        if ( ( aTable[nPos] != ( aTable[nPos] & nValueSet ) ) )
-            EnableItem( aTable[nPos+1], false );
+    if ( !(SvxZoomEnableFlags::N50 & nValueSet) )
+            EnableItem( ZOOM_50, false );
+    if ( !(SvxZoomEnableFlags::N100 & nValueSet) )
+            EnableItem( ZOOM_100, false );
+    if ( !(SvxZoomEnableFlags::N150 & nValueSet) )
+            EnableItem( ZOOM_150, false );
+    if ( !(SvxZoomEnableFlags::N200 & nValueSet) )
+            EnableItem( ZOOM_200, false );
+    if ( !(SvxZoomEnableFlags::OPTIMAL & nValueSet) )
+            EnableItem( ZOOM_OPTIMAL, false );
+    if ( !(SvxZoomEnableFlags::WHOLEPAGE & nValueSet) )
+            EnableItem( ZOOM_WHOLE_PAGE, false );
+    if ( !(SvxZoomEnableFlags::PAGEWIDTH & nValueSet) )
+            EnableItem( ZOOM_PAGE_WIDTH, false );
 }
 
 
@@ -101,7 +101,7 @@ SvxZoomStatusBarControl::SvxZoomStatusBarControl( sal_uInt16 _nSlotId,
 
     SfxStatusBarControl( _nSlotId, _nId, rStb ),
     nZoom( 100 ),
-    nValueSet( SVX_ZOOM_ENABLE_ALL )
+    nValueSet( SvxZoomEnableFlags::ALL )
 {
     GetStatusBar().SetQuickHelpText(GetId(), SVX_RESSTR(RID_SVXSTR_ZOOMTOOL_HINT));
 }
@@ -112,7 +112,7 @@ void SvxZoomStatusBarControl::StateChanged( sal_uInt16, SfxItemState eState,
     if( SfxItemState::DEFAULT != eState )
     {
         GetStatusBar().SetItemText( GetId(), "" );
-        nValueSet = 0;
+        nValueSet = SvxZoomEnableFlags::NONE;
     }
     else if ( pState->ISA( SfxUInt16Item) )
     {
@@ -129,7 +129,7 @@ void SvxZoomStatusBarControl::StateChanged( sal_uInt16, SfxItemState eState,
         else
         {
             DBG_WARNING( "use SfxZoomItem for SID_ATTR_ZOOM" );
-            nValueSet = SVX_ZOOM_ENABLE_ALL;
+            nValueSet = SvxZoomEnableFlags::ALL;
         }
     }
 }
@@ -142,7 +142,7 @@ void SvxZoomStatusBarControl::Paint( const UserDrawEvent& )
 
 void SvxZoomStatusBarControl::Command( const CommandEvent& rCEvt )
 {
-    if ( COMMAND_CONTEXTMENU & rCEvt.GetCommand() && 0 != nValueSet )
+    if ( COMMAND_CONTEXTMENU & rCEvt.GetCommand() && bool(nValueSet) )
     {
         ZoomPopup_Impl aPop( nZoom, nValueSet );
         StatusBar& rStatusbar = GetStatusBar();
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index d72438c..b713b2a 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -750,12 +750,12 @@ void  SwPagePreview::Execute( SfxRequest &rReq )
                 SvxZoomItem aZoom( (SvxZoomType)pVOpt->GetZoomType(),
                                             pVOpt->GetZoom() );
                 aZoom.SetValueSet(
-                        SVX_ZOOM_ENABLE_50|
-                        SVX_ZOOM_ENABLE_75|
-                        SVX_ZOOM_ENABLE_100|
-                        SVX_ZOOM_ENABLE_150|
-                        SVX_ZOOM_ENABLE_200|
-                        SVX_ZOOM_ENABLE_WHOLEPAGE);
+                        SvxZoomEnableFlags::N50|
+                        SvxZoomEnableFlags::N75|
+                        SvxZoomEnableFlags::N100|
+                        SvxZoomEnableFlags::N150|
+                        SvxZoomEnableFlags::N200|
+                        SvxZoomEnableFlags::WHOLEPAGE);
                 aCoreSet.Put( aZoom );
 
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
@@ -992,11 +992,11 @@ void  SwPagePreview::GetState( SfxItemSet& rSet )
                     SvxZoomItem aZoom((SvxZoomType)pVOpt->GetZoomType(),
                                         pVOpt->GetZoom());
                     aZoom.SetValueSet(
-                            SVX_ZOOM_ENABLE_50|
-                            SVX_ZOOM_ENABLE_75|
-                            SVX_ZOOM_ENABLE_100|
-                            SVX_ZOOM_ENABLE_150|
-                            SVX_ZOOM_ENABLE_200);
+                            SvxZoomEnableFlags::N50|
+                            SvxZoomEnableFlags::N75|
+                            SvxZoomEnableFlags::N100|
+                            SvxZoomEnableFlags::N150|
+                            SvxZoomEnableFlags::N200);
                     rSet.Put( aZoom );
             }
         break;
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 2bb5d44..f79372b 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1403,11 +1403,11 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
                     if( pVOpt->getBrowseMode() )
                     {
                         aZoom.SetValueSet(
-                                SVX_ZOOM_ENABLE_50|
-                                SVX_ZOOM_ENABLE_75|
-                                SVX_ZOOM_ENABLE_100|
-                                SVX_ZOOM_ENABLE_150|
-                                SVX_ZOOM_ENABLE_200);
+                                SvxZoomEnableFlags::N50|
+                                SvxZoomEnableFlags::N75|
+                                SvxZoomEnableFlags::N100|
+                                SvxZoomEnableFlags::N150|
+                                SvxZoomEnableFlags::N200);
                     }
                     rSet.Put( aZoom );
                 }
@@ -1690,11 +1690,11 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq)
                     if( bBrowseMode )
                     {
                         aZoom.SetValueSet(
-                                SVX_ZOOM_ENABLE_50|
-                                SVX_ZOOM_ENABLE_75|
-                                SVX_ZOOM_ENABLE_100|
-                                SVX_ZOOM_ENABLE_150|
-                                SVX_ZOOM_ENABLE_200);
+                                SvxZoomEnableFlags::N50|
+                                SvxZoomEnableFlags::N75|
+                                SvxZoomEnableFlags::N100|
+                                SvxZoomEnableFlags::N150|
+                                SvxZoomEnableFlags::N200);
                     }
                     aCoreSet.Put( aZoom );
 
commit 5d37fa2a710e3bd76d3f1e18d1d66b8a4ab15030
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Mar 23 14:40:02 2015 +0200

    convert SvxZoomType to enum class
    
    Change-Id: I7308e848d3f9ac391dc656a145139dabbc792df3

diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx
index fa8b53e..446e47a 100644
--- a/cui/source/dialogs/zoom.cxx
+++ b/cui/source/dialogs/zoom.cxx
@@ -212,18 +212,18 @@ SvxZoomDialog::SvxZoomDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet )
 
         switch (eType)
         {
-            case SVX_ZOOM_OPTIMAL:
+            case SvxZoomType::OPTIMAL:
                 nButtonId = ZOOMBTN_OPTIMAL;
                 break;
-            case SVX_ZOOM_PAGEWIDTH:
+            case SvxZoomType::PAGEWIDTH:
                 nButtonId = ZOOMBTN_PAGEWIDTH;
                 break;
-            case SVX_ZOOM_WHOLEPAGE:
+            case SvxZoomType::WHOLEPAGE:
                 nButtonId = ZOOMBTN_WHOLEPAGE;
                 break;
-            case SVX_ZOOM_PERCENT:
+            case SvxZoomType::PERCENT:
                 break;
-            case SVX_ZOOM_PAGEWIDTH_NOBORDER:
+            case SvxZoomType::PAGEWIDTH_NOBORDER:
                 break;
         }
 
@@ -380,7 +380,7 @@ IMPL_LINK(SvxZoomDialog, OKHdl, Button*, pButton)
 {
     if (mbModified || m_pOKBtn != pButton)
     {
-        SvxZoomItem aZoomItem(SVX_ZOOM_PERCENT, 0, mrSet.GetPool()->GetWhich(SID_ATTR_ZOOM));
+        SvxZoomItem aZoomItem(SvxZoomType::PERCENT, 0, mrSet.GetPool()->GetWhich(SID_ATTR_ZOOM));
         SvxViewLayoutItem aViewLayoutItem(0, false, mrSet.GetPool()->GetWhich(SID_ATTR_VIEWLAYOUT));
 
         if (m_pOKBtn == pButton)
@@ -390,11 +390,11 @@ IMPL_LINK(SvxZoomDialog, OKHdl, Button*, pButton)
             if (SPECIAL_FACTOR == nFactor)
             {
                 if (m_pOptimalBtn->IsChecked())
-                    aZoomItem.SetType(SVX_ZOOM_OPTIMAL);
+                    aZoomItem.SetType(SvxZoomType::OPTIMAL);
                 else if (m_pPageWidthBtn->IsChecked())
-                    aZoomItem.SetType(SVX_ZOOM_PAGEWIDTH);
+                    aZoomItem.SetType(SvxZoomType::PAGEWIDTH);
                 else if (m_pWholePageBtn->IsChecked())
-                    aZoomItem.SetType(SVX_ZOOM_WHOLEPAGE);
+                    aZoomItem.SetType(SvxZoomType::WHOLEPAGE);
             }
             else
             {
diff --git a/include/sfx2/zoomitem.hxx b/include/sfx2/zoomitem.hxx
index e086653..2354223 100644
--- a/include/sfx2/zoomitem.hxx
+++ b/include/sfx2/zoomitem.hxx
@@ -25,32 +25,32 @@
 
 
 
-enum SvxZoomType
+enum class SvxZoomType
 {
-    SVX_ZOOM_PERCENT,       // GetValue() is no special percentage value
-    SVX_ZOOM_OPTIMAL,       // GetValue() corresponds to the optimal size
-    SVX_ZOOM_WHOLEPAGE,     // GetValue() corresponds to the whole page
-    SVX_ZOOM_PAGEWIDTH,      // GetValue() corresponds to the page width
-    SVX_ZOOM_PAGEWIDTH_NOBORDER  // GetValue() pagewidth without border
+    PERCENT,       // GetValue() is no special percentage value
+    OPTIMAL,       // GetValue() corresponds to the optimal size
+    WHOLEPAGE,     // GetValue() corresponds to the whole page
+    PAGEWIDTH,      // GetValue() corresponds to the page width
+    PAGEWIDTH_NOBORDER  // GetValue() pagewidth without border
 };
 
 
 
 class SFX2_DLLPUBLIC SvxZoomItem: public SfxUInt16Item
 {
-    sal_uInt16                  nValueSet;  // allowed values (see #defines below)
+    sal_uInt16              nValueSet;  // allowed values (see #defines below)
     SvxZoomType             eType;
 
 public:
     TYPEINFO_OVERRIDE();
 
-    SvxZoomItem( SvxZoomType eZoomType = SVX_ZOOM_PERCENT,
+    SvxZoomItem( SvxZoomType eZoomType = SvxZoomType::PERCENT,
                  sal_uInt16 nVal = 0, sal_uInt16 nWhich = SID_ATTR_ZOOM );
     SvxZoomItem( const SvxZoomItem& );
     virtual ~SvxZoomItem();
 
     void                    SetValueSet( sal_uInt16 nValues ) { nValueSet = nValues; }
-    sal_uInt16                  GetValueSet() const { return nValueSet; }
+    sal_uInt16              GetValueSet() const { return nValueSet; }
     bool                    IsValueAllowed( sal_uInt16 nValue ) const
                             { return nValue == ( nValue & nValueSet ); }
 
diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx
index acb4c00..ae4ef39 100644
--- a/reportdesign/source/ui/inc/ReportController.hxx
+++ b/reportdesign/source/ui/inc/ReportController.hxx
@@ -445,7 +445,7 @@ namespace rptui
 
         inline ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >  getContext() const { return m_xContext; }
         inline sal_Int16   getZoomValue() const     { return m_nZoomValue; }
-        inline void         resetZoomType()         { m_eZoomType = SVX_ZOOM_PERCENT; }
+        inline void         resetZoomType()         { m_eZoomType = SvxZoomType::PERCENT; }
 
         // com::sun::star::beans::XPropertySet
         virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index fb4cb41..ca05e17 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -298,7 +298,7 @@ OReportController::OReportController(Reference< XComponentContext > const & xCon
     ,m_nSelectionCount(0)
     ,m_nAspect(0)
     ,m_nZoomValue(100)
-    ,m_eZoomType(SVX_ZOOM_PERCENT)
+    ,m_eZoomType(SvxZoomType::PERCENT)
     ,m_bShowRuler(true)
     ,m_bGridVisible(true)
     ,m_bGridUse(true)
@@ -1645,7 +1645,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
                 SvxZoomSliderItem aZoomSlider;
                 aZoomSlider.PutValue(aArgs[0].Value);
                 m_nZoomValue = aZoomSlider.GetValue();
-                m_eZoomType = SVX_ZOOM_PERCENT;
+                m_eZoomType = SvxZoomType::PERCENT;
                 impl_zoom_nothrow();
             }
             break;
@@ -4287,7 +4287,7 @@ void OReportController::openZoomDialog()
                 const SvxZoomItem&  rZoomItem = static_cast<const SvxZoomItem&>(pDlg->GetOutputItemSet()->Get( SID_ATTR_ZOOM ));
                 m_eZoomType = rZoomItem.GetType();
                 m_nZoomValue = rZoomItem.GetValue();
-                if ( m_eZoomType != SVX_ZOOM_PERCENT )
+                if ( m_eZoomType != SvxZoomType::PERCENT )
                     m_nZoomValue = getDesignView()->getZoomFactor( m_eZoomType );
 
                 impl_zoom_nothrow();
diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx
index 1ec3c0a..3ace86e 100644
--- a/reportdesign/source/ui/report/ReportWindow.cxx
+++ b/reportdesign/source/ui/report/ReportWindow.cxx
@@ -407,12 +407,12 @@ sal_uInt16 OReportWindow::getZoomFactor(SvxZoomType _eType) const
     const Size aSize( GetSizePixel() );
     switch( _eType)
     {
-        case SVX_ZOOM_PERCENT:
+        case SvxZoomType::PERCENT:
             nZoom = m_pView->getController().getZoomValue();
             break;
-        case SVX_ZOOM_OPTIMAL:
+        case SvxZoomType::OPTIMAL:
             break;
-        case SVX_ZOOM_WHOLEPAGE:
+        case SvxZoomType::WHOLEPAGE:
             {
                 nZoom = (sal_uInt16)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth());
                 MapMode aMap( MAP_100TH_MM );
@@ -420,7 +420,7 @@ sal_uInt16 OReportWindow::getZoomFactor(SvxZoomType _eType) const
                 nZoom = ::std::min(nZoom,(sal_uInt16)(long)Fraction(aSize.Height()*100,aHeight.Height()));
             }
             break;
-        case SVX_ZOOM_PAGEWIDTH:
+        case SvxZoomType::PAGEWIDTH:
             nZoom = (sal_uInt16)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth());
             break;
         default:
diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx
index abe4658..59bcd40 100644
--- a/sc/source/core/tool/appoptio.cxx
+++ b/sc/source/core/tool/appoptio.cxx
@@ -60,7 +60,7 @@ void ScAppOptions::SetDefaults()
         eMetric     = FUNIT_INCH;           // default for others
 
     nZoom           = 100;
-    eZoomType       = SVX_ZOOM_PERCENT;
+    eZoomType       = SvxZoomType::PERCENT;
     bSynchronizeZoom = true;
     nStatusFunc     = SUBTOTAL_FUNC_SUM;
     bAutoComplete   = true;
diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx
index dff6fd0..002a571 100644
--- a/sc/source/ui/unoobj/appluno.cxx
+++ b/sc/source/ui/unoobj/appluno.cxx
@@ -455,19 +455,19 @@ void SAL_CALL ScSpreadsheetSettings::setPropertyValue(
         short nVal = ScUnoHelpFunctions::GetInt16FromAny( aValue );
         if ( nVal < 0 )
         {
-            SvxZoomType eType = SVX_ZOOM_PERCENT;
+            SvxZoomType eType = SvxZoomType::PERCENT;
             switch (nVal)
             {
-                case SC_ZOOMVAL_OPTIMAL:    eType = SVX_ZOOM_OPTIMAL;   break;
-                case SC_ZOOMVAL_WHOLEPAGE:  eType = SVX_ZOOM_WHOLEPAGE; break;
-                case SC_ZOOMVAL_PAGEWIDTH:  eType = SVX_ZOOM_PAGEWIDTH; break;
+                case SC_ZOOMVAL_OPTIMAL:    eType = SvxZoomType::OPTIMAL;   break;
+                case SC_ZOOMVAL_WHOLEPAGE:  eType = SvxZoomType::WHOLEPAGE; break;
+                case SC_ZOOMVAL_PAGEWIDTH:  eType = SvxZoomType::PAGEWIDTH; break;
             }
             aAppOpt.SetZoomType( eType );
         }
         else if ( nVal >= MINZOOM && nVal <= MAXZOOM )
         {
             aAppOpt.SetZoom( nVal );
-            aAppOpt.SetZoomType( SVX_ZOOM_PERCENT );
+            aAppOpt.SetZoomType( SvxZoomType::PERCENT );
         }
         bSaveApp = true;
     }
@@ -549,10 +549,10 @@ uno::Any SAL_CALL ScSpreadsheetSettings::getPropertyValue( const OUString& aProp
         sal_Int16 nZoomVal = 0;
         switch ( aAppOpt.GetZoomType() )
         {
-            case SVX_ZOOM_PERCENT:   nZoomVal = aAppOpt.GetZoom();    break;
-            case SVX_ZOOM_OPTIMAL:   nZoomVal = SC_ZOOMVAL_OPTIMAL;   break;
-            case SVX_ZOOM_WHOLEPAGE: nZoomVal = SC_ZOOMVAL_WHOLEPAGE; break;
-            case SVX_ZOOM_PAGEWIDTH: nZoomVal = SC_ZOOMVAL_PAGEWIDTH; break;
+            case SvxZoomType::PERCENT:   nZoomVal = aAppOpt.GetZoom();    break;
+            case SvxZoomType::OPTIMAL:   nZoomVal = SC_ZOOMVAL_OPTIMAL;   break;
+            case SvxZoomType::WHOLEPAGE: nZoomVal = SC_ZOOMVAL_WHOLEPAGE; break;
+            case SvxZoomType::PAGEWIDTH: nZoomVal = SC_ZOOMVAL_PAGEWIDTH; break;
             default:
             {
                 // added to avoid warnings
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 7f7ac0d..f60d22c 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -1472,19 +1472,19 @@ sal_Int16 ScTabViewObj::GetZoomType(void) const
         SvxZoomType eZoomType = pViewSh->GetViewData().GetView()->GetZoomType();
         switch (eZoomType)
         {
-        case SVX_ZOOM_PERCENT:
+        case SvxZoomType::PERCENT:
             aZoomType = view::DocumentZoomType::BY_VALUE;
             break;
-        case SVX_ZOOM_OPTIMAL:
+        case SvxZoomType::OPTIMAL:
             aZoomType = view::DocumentZoomType::OPTIMAL;
             break;
-        case SVX_ZOOM_WHOLEPAGE:
+        case SvxZoomType::WHOLEPAGE:
             aZoomType = view::DocumentZoomType::ENTIRE_PAGE;
             break;
-        case SVX_ZOOM_PAGEWIDTH:
+        case SvxZoomType::PAGEWIDTH:
             aZoomType = view::DocumentZoomType::PAGE_WIDTH;
             break;
-        case SVX_ZOOM_PAGEWIDTH_NOBORDER:
+        case SvxZoomType::PAGEWIDTH_NOBORDER:
             aZoomType = view::DocumentZoomType::PAGE_WIDTH_EXACT;
             break;
         }
@@ -1504,26 +1504,26 @@ void ScTabViewObj::SetZoomType(sal_Int16 aZoomType)
             switch (aZoomType)
             {
             case view::DocumentZoomType::BY_VALUE:
-                eZoomType = SVX_ZOOM_PERCENT;
+                eZoomType = SvxZoomType::PERCENT;
                 break;
             case view::DocumentZoomType::OPTIMAL:
-                eZoomType = SVX_ZOOM_OPTIMAL;
+                eZoomType = SvxZoomType::OPTIMAL;
                 break;
             case view::DocumentZoomType::ENTIRE_PAGE:
-                eZoomType = SVX_ZOOM_WHOLEPAGE;
+                eZoomType = SvxZoomType::WHOLEPAGE;
                 break;
             case view::DocumentZoomType::PAGE_WIDTH:
-                eZoomType = SVX_ZOOM_PAGEWIDTH;
+                eZoomType = SvxZoomType::PAGEWIDTH;
                 break;
             case view::DocumentZoomType::PAGE_WIDTH_EXACT:
-                eZoomType = SVX_ZOOM_PAGEWIDTH_NOBORDER;
+                eZoomType = SvxZoomType::PAGEWIDTH_NOBORDER;
                 break;
             default:
-                eZoomType = SVX_ZOOM_OPTIMAL;
+                eZoomType = SvxZoomType::OPTIMAL;
             }
             sal_Int16 nZoom(GetZoom());
             sal_Int16 nOldZoom(nZoom);
-            if ( eZoomType == SVX_ZOOM_PERCENT )
+            if ( eZoomType == SvxZoomType::PERCENT )
             {
                 if ( nZoom < MINZOOM )  nZoom = MINZOOM;
                 if ( nZoom > MAXZOOM )  nZoom = MAXZOOM;
@@ -1533,13 +1533,13 @@ void ScTabViewObj::SetZoomType(sal_Int16 aZoomType)
 
             switch ( eZoomType )
             {
-                case SVX_ZOOM_WHOLEPAGE:
-                case SVX_ZOOM_PAGEWIDTH:
+                case SvxZoomType::WHOLEPAGE:
+                case SvxZoomType::PAGEWIDTH:
                     pView->SetZoomType( eZoomType, true );
                     break;
 
                 default:
-                    pView->SetZoomType( SVX_ZOOM_PERCENT, true );
+                    pView->SetZoomType( SvxZoomType::PERCENT, true );
             }
             SetZoom( nZoom );
         }
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 6793f20..3bc36f7 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -117,7 +117,7 @@ void ScPreviewShell::Construct( vcl::Window* pParent )
     if (mpFrameWindow)
         mpFrameWindow->SetCloseHdl(LINK(this, ScPreviewShell, CloseHdl));
 
-    eZoom = SVX_ZOOM_WHOLEPAGE;
+    eZoom = SvxZoomType::WHOLEPAGE;
 
     pCorner = new ScrollBarBox( pParent, WB_SIZEABLE );
 
@@ -215,9 +215,9 @@ void ScPreviewShell::AdjustPosSizePixel( const Point &rPos, const Size &rSize )
     Size aOutSize( rSize );
     pPreview->SetPosSizePixel( rPos, aOutSize );
 
-    if ( SVX_ZOOM_WHOLEPAGE == eZoom )
+    if ( SvxZoomType::WHOLEPAGE == eZoom )
         pPreview->SetZoom( pPreview->GetOptimalZoom(false) );
-    else if ( SVX_ZOOM_PAGEWIDTH == eZoom )
+    else if ( SvxZoomType::PAGEWIDTH == eZoom )
         pPreview->SetZoom( pPreview->GetOptimalZoom(true) );
 
     UpdateNeededScrollBars();
@@ -502,7 +502,7 @@ bool ScPreviewShell::ScrollCommand( const CommandEvent& rCEvt )
 
         if ( nNew != nOld )
         {
-            eZoom = SVX_ZOOM_PERCENT;
+            eZoom = SvxZoomType::PERCENT;
             pPreview->SetZoom( (sal_uInt16)nNew );
         }
 
@@ -627,7 +627,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
                 sal_uInt16      nZoom       = 100;
                 bool        bCancel     = false;
 
-                eZoom = SVX_ZOOM_PERCENT;
+                eZoom = SvxZoomType::PERCENT;
 
                 if ( pReqArgs )
                 {
@@ -641,7 +641,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
                 else
                 {
                     SfxItemSet      aSet     ( GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM );
-                    SvxZoomItem     aZoomItem( SVX_ZOOM_PERCENT, pPreview->GetZoom(), SID_ATTR_ZOOM );
+                    SvxZoomItem     aZoomItem( SvxZoomType::PERCENT, pPreview->GetZoom(), SID_ATTR_ZOOM );
 
                     aSet.Put( aZoomItem );
                     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
@@ -669,11 +669,11 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
                 {
                     switch ( eZoom )
                     {
-                        case SVX_ZOOM_OPTIMAL:
-                        case SVX_ZOOM_WHOLEPAGE:
+                        case SvxZoomType::OPTIMAL:
+                        case SvxZoomType::WHOLEPAGE:
                             nZoom = pPreview->GetOptimalZoom(false);
                             break;
-                        case SVX_ZOOM_PAGEWIDTH:
+                        case SvxZoomType::PAGEWIDTH:
                             nZoom = pPreview->GetOptimalZoom(true);
                             break;
                         default:
@@ -692,7 +692,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
                 sal_uInt16 nNew = pPreview->GetZoom() + 20 ;
                 nNew -= nNew % 20;
                 pPreview->SetZoom( nNew );
-                eZoom = SVX_ZOOM_PERCENT;
+                eZoom = SvxZoomType::PERCENT;
                 rReq.Done();
             }
             break;
@@ -701,7 +701,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
                 sal_uInt16 nNew = pPreview->GetZoom() - 1;
                 nNew -= nNew % 20;
                 pPreview->SetZoom( nNew );
-                eZoom = SVX_ZOOM_PERCENT;
+                eZoom = SvxZoomType::PERCENT;
                 rReq.Done();
             }
             break;
@@ -716,7 +716,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
         case SID_ATTR_ZOOMSLIDER:
             {
                 const SfxPoolItem* pItem;
-                eZoom = SVX_ZOOM_PERCENT;
+                eZoom = SvxZoomType::PERCENT;
                 if( pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( SID_ATTR_ZOOMSLIDER, true, &pItem ) )
                 {
                     const sal_uInt16 nCurrentZoom = static_cast<const SvxZoomSliderItem*>(pItem)->GetValue();
@@ -933,7 +933,7 @@ void ScPreviewShell::ReadUserData(const OUString& rData, bool /* bBrowse */)
         sal_Int32 nIndex = 0;
         pPreview->SetZoom((sal_uInt16)rData.getToken(0, SC_USERDATA_SEP, nIndex).toInt32());
         pPreview->SetPageNo(rData.getToken(0, SC_USERDATA_SEP, nIndex).toInt32());

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list