[Libreoffice-commits] core.git: cui/source include/vcl sfx2/source svtools/source sw/source vcl/source vcl/unx

Noel Grandin noel at peralex.com
Tue May 31 06:27:50 UTC 2016


 cui/source/tabpages/page.cxx          |    2 +-
 include/vcl/print.hxx                 |   10 +++++-----
 sfx2/source/doc/printhelper.cxx       |    6 +++---
 svtools/source/dialogs/prnsetup.cxx   |    4 ++--
 sw/source/ui/dbui/mmresultdialogs.cxx |    2 +-
 vcl/source/gdi/print.cxx              |   20 ++++++++++----------
 vcl/source/window/printdlg.cxx        |    2 +-
 vcl/unx/generic/print/genprnpsp.cxx   |    2 +-
 8 files changed, 24 insertions(+), 24 deletions(-)

New commits:
commit fafb2cf4de2eb2de46afab0738b7fd95663c0164
Author: Noel Grandin <noel at peralex.com>
Date:   Mon May 30 10:55:13 2016 +0200

    Convert PrinterSupport to scoped enum
    
    Change-Id: I2bde7261b8e8f31e6dd5a02cd4130156a04b8a7f
    Reviewed-on: https://gerrit.libreoffice.org/25657
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 0fa0782..1b72b7e 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -527,7 +527,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
         aPaperSize = static_cast<const SvxSizeItem*>(pItem)->GetSize();
 
     bool bOrientationSupport =
-        mpDefPrinter->HasSupport( SUPPORT_SET_ORIENTATION );
+        mpDefPrinter->HasSupport( PrinterSupport::SetOrientation );
 
     if ( !bOrientationSupport &&
          aPaperSize.Width() > aPaperSize.Height() )
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index e38372d..fcb11bc 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -50,12 +50,12 @@ namespace vcl {
 }
 
 
-enum PrinterSupport
+enum class PrinterSupport
 {
-    SUPPORT_SET_ORIENTATION, SUPPORT_SET_PAPERBIN,
-    SUPPORT_SET_PAPERSIZE, SUPPORT_SET_PAPER,
-    SUPPORT_COPY, SUPPORT_COLLATECOPY,
-    SUPPORT_SETUPDIALOG, SUPPORT_FAX, SUPPORT_PDF
+    SetOrientation, SetPaperBin,
+    SetPaperSize, SetPaper,
+    Copy, CollateCopy,
+    SetupDialog, Fax, Pdf
 };
 
 
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index fa13268..5c3b4b8 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -278,13 +278,13 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxPrintHelper::getPrinter() thro
     uno::Sequence< beans::PropertyValue > aPrinter(8);
 
     aPrinter.getArray()[7].Name = "CanSetPaperSize";
-    aPrinter.getArray()[7].Value <<= ( pPrinter->HasSupport( SUPPORT_SET_PAPERSIZE ) );
+    aPrinter.getArray()[7].Value <<= ( pPrinter->HasSupport( PrinterSupport::SetPaperSize ) );
 
     aPrinter.getArray()[6].Name = "CanSetPaperFormat";
-    aPrinter.getArray()[6].Value <<= ( pPrinter->HasSupport( SUPPORT_SET_PAPER ) );
+    aPrinter.getArray()[6].Value <<= ( pPrinter->HasSupport( PrinterSupport::SetPaper ) );
 
     aPrinter.getArray()[5].Name = "CanSetPaperOrientation";
-    aPrinter.getArray()[5].Value <<= ( pPrinter->HasSupport( SUPPORT_SET_ORIENTATION ) );
+    aPrinter.getArray()[5].Value <<= ( pPrinter->HasSupport( PrinterSupport::SetOrientation ) );
 
     aPrinter.getArray()[4].Name = "IsBusy";
     aPrinter.getArray()[4].Value <<= ( pPrinter->IsPrinting() );
diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx
index 8663722..2608486 100644
--- a/svtools/source/dialogs/prnsetup.cxx
+++ b/svtools/source/dialogs/prnsetup.cxx
@@ -38,7 +38,7 @@ void ImplFillPrnDlgListBox( const Printer* pPrinter,
     }
 
     pBox->Enable( nCount != 0 );
-    pPropBtn->Show( pPrinter->HasSupport( SUPPORT_SETUPDIALOG ) );
+    pPropBtn->Show( pPrinter->HasSupport( PrinterSupport::SetupDialog ) );
 }
 
 
@@ -76,7 +76,7 @@ Printer* ImplPrnDlgListBoxSelect( ListBox* pBox, PushButton* pPropBtn,
                 }
             }
 
-            pPropBtn->Enable( pTempPrinter->HasSupport( SUPPORT_SETUPDIALOG ) );
+            pPropBtn->Enable( pTempPrinter->HasSupport( PrinterSupport::SetupDialog ) );
         }
         else
             pPropBtn->Disable();
diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx
index 1c6218a..ded7030 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -786,7 +786,7 @@ IMPL_LINK_TYPED(SwMMResultPrintDialog, PrinterChangeHdl_Impl, ListBox&, rBox, vo
         else if( ! m_pTempPrinter )
             m_pTempPrinter = VclPtr<Printer>::Create();
 
-        m_pPrinterSettingsPB->Enable( m_pTempPrinter->HasSupport( SUPPORT_SETUPDIALOG ) );
+        m_pPrinterSettingsPB->Enable( m_pTempPrinter->HasSupport( PrinterSupport::SetupDialog ) );
     }
     else
         m_pPrinterSettingsPB->Disable();
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 8c267db..c0cfdf59 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1031,23 +1031,23 @@ bool Printer::HasSupport( PrinterSupport eFeature ) const
 {
     switch ( eFeature )
     {
-        case SUPPORT_SET_ORIENTATION:
+        case PrinterSupport::SetOrientation:
             return GetCapabilities( PrinterCapType::SetOrientation ) != 0;
-        case SUPPORT_SET_PAPERBIN:
+        case PrinterSupport::SetPaperBin:
             return GetCapabilities( PrinterCapType::SetPaperBin ) != 0;
-        case SUPPORT_SET_PAPERSIZE:
+        case PrinterSupport::SetPaperSize:
             return GetCapabilities( PrinterCapType::SetPaperSize ) != 0;
-        case SUPPORT_SET_PAPER:
+        case PrinterSupport::SetPaper:
             return GetCapabilities( PrinterCapType::SetPaper ) != 0;
-        case SUPPORT_COPY:
+        case PrinterSupport::Copy:
             return (GetCapabilities( PrinterCapType::Copies ) != 0);
-        case SUPPORT_COLLATECOPY:
+        case PrinterSupport::CollateCopy:
             return (GetCapabilities( PrinterCapType::CollateCopies ) != 0);
-        case SUPPORT_SETUPDIALOG:
+        case PrinterSupport::SetupDialog:
             return GetCapabilities( PrinterCapType::SupportDialog ) != 0;
-        case SUPPORT_FAX:
+        case PrinterSupport::Fax:
             return GetCapabilities( PrinterCapType::Fax ) != 0;
-        case SUPPORT_PDF:
+        case PrinterSupport::Pdf:
             return GetCapabilities( PrinterCapType::PDF ) != 0;
     }
 
@@ -1330,7 +1330,7 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe
     // all paper sizes with portrait orientation only!!
     if ( pSetupData->mePaperFormat == PAPER_USER &&
          nLandscapeAngle != 0 &&
-         HasSupport( SUPPORT_SET_ORIENTATION ))
+         HasSupport( PrinterSupport::SetOrientation ))
     {
         const long nRotatedWidth = pSetupData->mnPaperHeight;
         const long nRotatedHeight = pSetupData->mnPaperWidth;
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index c03d76f..0363ea6 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -1221,7 +1221,7 @@ void PrintDialog::checkControlDependencies()
     maJobPage.mpCollateImage->SetImage( aImg );
 
     // enable setup button only for printers that can be setup
-    bool bHaveSetup = maPController->getPrinter()->HasSupport( SUPPORT_SETUPDIALOG );
+    bool bHaveSetup = maPController->getPrinter()->HasSupport( PrinterSupport::SetupDialog );
     maJobPage.mpSetupButton->Enable(bHaveSetup);
 }
 
diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx
index 3e2a17f..63495e9 100644
--- a/vcl/unx/generic/print/genprnpsp.cxx
+++ b/vcl/unx/generic/print/genprnpsp.cxx
@@ -1163,7 +1163,7 @@ bool PspSalPrinter::StartJob( const OUString* i_pFileName, const OUString& i_rJo
     {
         if( bCollate )
         {
-            if (aPDFFiles.size() == 1 && xPrinter->HasSupport(SUPPORT_COLLATECOPY))
+            if (aPDFFiles.size() == 1 && xPrinter->HasSupport(PrinterSupport::CollateCopy))
             {
                 m_aJobData.setCollate( true );
                 m_aJobData.m_nCopies = nCopies;


More information about the Libreoffice-commits mailing list