accessibility/source/standard/vclxaccessiblescrollbar.cxx | 10 cppcanvas/source/mtfrenderer/implrenderer.cxx | 20 - cui/source/options/optgdlg.cxx | 32 +- cui/source/options/optmemory.cxx | 2 cui/source/tabpages/grfpage.cxx | 4 cui/source/tabpages/page.cxx | 6 dbaccess/source/ui/misc/WNameMatch.cxx | 4 desktop/source/deployment/gui/license_dialog.cxx | 2 drawinglayer/source/primitive2d/metafileprimitive2d.cxx | 32 +- drawinglayer/source/processor2d/vclhelperbufferdevice.cxx | 6 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 36 +-- drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 8 editeng/source/editeng/impedit.cxx | 2 editeng/source/items/paperinf.cxx | 2 extensions/source/propctrlr/browserlistbox.cxx | 2 extensions/source/propctrlr/standardcontrol.cxx | 2 extensions/source/propctrlr/taborder.cxx | 4 extensions/source/scanner/sanedlg.cxx | 2 extensions/source/update/ui/updatecheckui.cxx | 2 filter/source/flash/swfwriter1.cxx | 2 filter/source/flash/swfwriter2.cxx | 26 +- filter/source/graphicfilter/eps/eps.cxx | 2 filter/source/graphicfilter/idxf/dxf2mtf.cxx | 10 filter/source/graphicfilter/idxf/dxfvec.hxx | 2 filter/source/graphicfilter/ios2met/ios2met.cxx | 58 ++-- filter/source/graphicfilter/ipict/ipict.cxx | 34 +- filter/source/msfilter/escherex.cxx | 2 filter/source/svg/svgwriter.cxx | 20 - framework/source/uielement/addonstoolbarmanager.cxx | 2 framework/source/uielement/popuptoolbarcontroller.cxx | 2 framework/source/uielement/subtoolbarcontroller.cxx | 2 framework/source/uielement/toolbarmanager.cxx | 4 include/sfx2/sidebar/SidebarToolBox.hxx | 2 include/svtools/miscopt.hxx | 9 include/svtools/optionsdrawinglayer.hxx | 2 include/vcl/field.hxx | 4 include/vcl/lineinfo.hxx | 2 include/vcl/prntypes.hxx | 2 include/vcl/scrbar.hxx | 9 include/vcl/toolbox.hxx | 4 include/vcl/vclenum.hxx | 78 +++--- oox/source/export/drawingml.cxx | 12 - reportdesign/source/ui/report/EndMarker.cxx | 4 reportdesign/source/ui/report/StartMarker.cxx | 4 reportdesign/source/ui/report/ViewsWindow.cxx | 2 reportdesign/source/ui/report/dlgedfunc.cxx | 10 sc/source/ui/cctrl/tbzoomsliderctrl.cxx | 2 sc/source/ui/dbgui/csvcontrol.cxx | 2 sc/source/ui/docshell/docsh3.cxx | 2 sc/source/ui/view/output.cxx | 4 sc/source/ui/view/printfun.cxx | 2 sc/source/ui/view/tabview.cxx | 14 - sd/source/core/sdpage.cxx | 8 sd/source/ui/annotations/annotationwindow.cxx | 6 sd/source/ui/controller/displaymodecontroller.cxx | 2 sd/source/ui/func/fupage.cxx | 4 sd/source/ui/unoidl/unopage.cxx | 4 sd/source/ui/view/DocumentRenderer.cxx | 20 - sd/source/ui/view/drviews7.cxx | 2 sfx2/source/dialog/dinfdlg.cxx | 6 sfx2/source/notebookbar/BigToolBox.cxx | 2 sfx2/source/notebookbar/NotebookbarToolBox.cxx | 12 - sfx2/source/sidebar/SidebarToolBox.cxx | 16 - sfx2/source/sidebar/Theme.cxx | 4 sfx2/source/toolbox/tbxitem.cxx | 2 slideshow/source/engine/shapes/gdimtftools.cxx | 2 svtools/source/config/miscopt.cxx | 57 ++-- svtools/source/config/optionsdrawinglayer.cxx | 2 svtools/source/contnr/imivctl1.cxx | 2 svtools/source/contnr/svimpbox.cxx | 2 svtools/source/control/headbar.cxx | 4 svtools/source/graphic/grfcache.cxx | 2 svtools/source/graphic/grfmgr2.cxx | 2 svx/source/sdr/overlay/overlayselection.cxx | 2 svx/source/sidebar/area/AreaPropertyPanelBase.cxx | 2 svx/source/svdraw/svdfmtf.cxx | 22 - svx/source/svdraw/svdobj.cxx | 2 svx/source/svdraw/svdpage.cxx | 6 svx/source/xoutdev/_xoutbmp.cxx | 2 sw/source/core/txtnode/fntcache.cxx | 2 sw/source/core/view/vprint.cxx | 2 sw/source/uibase/docvw/AnnotationMenuButton.cxx | 4 sw/source/uibase/docvw/SidebarTxtControl.cxx | 4 sw/source/uibase/uiview/pview.cxx | 6 sw/source/uibase/uiview/viewport.cxx | 6 sw/source/uibase/utlui/shdwcrsr.cxx | 2 test/source/mtfxmldump.cxx | 20 - toolkit/source/awt/vclxgraphics.cxx | 4 toolkit/source/awt/vclxwindows.cxx | 6 vcl/backendtest/VisualBackendTest.cxx | 2 vcl/backendtest/outputdevice/gradient.cxx | 4 vcl/backendtest/outputdevice/outputdevice.cxx | 6 vcl/headless/svpgdi.cxx | 4 vcl/headless/svpprn.cxx | 2 vcl/inc/unx/fc_fontoptions.hxx | 6 vcl/opengl/gdiimpl.cxx | 12 - vcl/osx/salprn.cxx | 16 - vcl/quartz/salgdicommon.cxx | 4 vcl/source/control/field2.cxx | 152 ++++++------- vcl/source/control/scrbar.cxx | 58 ++-- vcl/source/control/slider.cxx | 66 ++--- vcl/source/edit/vclmedit.cxx | 12 - vcl/source/filter/wmf/emfwr.cxx | 10 vcl/source/filter/wmf/enhwmf.cxx | 24 +- vcl/source/filter/wmf/winmtf.cxx | 32 +- vcl/source/filter/wmf/winwmf.cxx | 12 - vcl/source/filter/wmf/wmfwr.cxx | 22 - vcl/source/gdi/gradient.cxx | 12 - vcl/source/gdi/hatch.cxx | 4 vcl/source/gdi/jobset.cxx | 2 vcl/source/gdi/lineinfo.cxx | 8 vcl/source/gdi/metaact.cxx | 4 vcl/source/gdi/pdfwriter_impl.cxx | 36 +-- vcl/source/gdi/pdfwriter_impl2.cxx | 4 vcl/source/gdi/print.cxx | 12 - vcl/source/gdi/svmconverter.cxx | 40 +-- vcl/source/gdi/virdev.cxx | 2 vcl/source/gdi/wall.cxx | 2 vcl/source/outdev/bitmap.cxx | 6 vcl/source/outdev/gradient.cxx | 24 +- vcl/source/outdev/hatch.cxx | 4 vcl/source/outdev/line.cxx | 14 - vcl/source/outdev/map.cxx | 4 vcl/source/outdev/mask.cxx | 2 vcl/source/outdev/outdev.cxx | 8 vcl/source/outdev/outdevstate.cxx | 16 - vcl/source/outdev/polygon.cxx | 12 - vcl/source/outdev/polyline.cxx | 14 - vcl/source/outdev/transparent.cxx | 6 vcl/source/outdev/wallpaper.cxx | 6 vcl/source/window/dockmgr.cxx | 2 vcl/source/window/menu.cxx | 2 vcl/source/window/paint.cxx | 6 vcl/source/window/printdlg.cxx | 2 vcl/source/window/split.cxx | 2 vcl/source/window/toolbox.cxx | 4 vcl/source/window/toolbox2.cxx | 6 vcl/source/window/window.cxx | 4 vcl/unx/generic/fontmanager/fontconfig.cxx | 4 vcl/unx/generic/gdi/salgdi2.cxx | 4 vcl/unx/generic/glyphs/freetype_glyphcache.cxx | 6 vcl/unx/generic/print/genprnpsp.cxx | 4 vcl/unx/generic/print/genpspgraphics.cxx | 2 vcl/unx/generic/print/printerjob.cxx | 2 vcl/win/gdi/salgdi2.cxx | 4 vcl/win/gdi/salprn.cxx | 6 vcl/workben/outdevgrind.cxx | 18 - vcl/workben/svptest.cxx | 4 vcl/workben/vcldemo.cxx | 22 - 149 files changed, 783 insertions(+), 774 deletions(-)
New commits: commit 87ee6c044d79978d2121087f5e1a10f417adf9c7 Author: Noel Grandin <[email protected]> Date: Sun Sep 4 12:02:54 2016 +0200 convert Orientation to scoped enum Change-Id: Ifbfcf3557ca2a16d21e7a1d613ee54c1c6625f07 diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index ca206e6..7b54e08 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -467,7 +467,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) // general page data SvxNumType eNumType = SVX_ARABIC; - bLandscape = ( mpDefPrinter->GetOrientation() == ORIENTATION_LANDSCAPE ); + bLandscape = ( mpDefPrinter->GetOrientation() == Orientation::Landscape ); sal_uInt16 nUse = (sal_uInt16)SVX_PAGE_ALL; pItem = GetItem( *rSet, SID_ATTR_PAGE ); @@ -1059,10 +1059,10 @@ IMPL_LINK_TYPED( SvxPageDescPage, SwapOrientation_Impl, Button *, pBtn, void ) void SvxPageDescPage::SwapFirstValues_Impl( bool bSet ) { MapMode aOldMode = mpDefPrinter->GetMapMode(); - Orientation eOri = ORIENTATION_PORTRAIT; + Orientation eOri = Orientation::Portrait; if ( bLandscape ) - eOri = ORIENTATION_LANDSCAPE; + eOri = Orientation::Landscape; Orientation eOldOri = mpDefPrinter->GetOrientation(); mpDefPrinter->SetOrientation( eOri ); mpDefPrinter->SetMapMode( MAP_TWIP ); diff --git a/editeng/source/items/paperinf.cxx b/editeng/source/items/paperinf.cxx index 118d532d3..42d49e7 100644 --- a/editeng/source/items/paperinf.cxx +++ b/editeng/source/items/paperinf.cxx @@ -77,7 +77,7 @@ Size SvxPaperInfo::GetPaperSize( const Printer* pPrinter ) const Orientation eOrient = pPrinter->GetOrientation(); Size aSize( GetPaperSize( ePaper ) ); // for Landscape exchange the pages, has already been done by SV - if ( eOrient == ORIENTATION_LANDSCAPE ) + if ( eOrient == Orientation::Landscape ) Swap( aSize ); return aSize; } diff --git a/include/vcl/prntypes.hxx b/include/vcl/prntypes.hxx index 06cf3f8..169271e 100644 --- a/include/vcl/prntypes.hxx +++ b/include/vcl/prntypes.hxx @@ -28,7 +28,7 @@ enum DuplexMode { DUPLEX_UNKNOWN, DUPLEX_OFF, DUPLEX_LONGEDGE, DUPLEX_SHORTEDGE }; -enum Orientation { ORIENTATION_PORTRAIT, ORIENTATION_LANDSCAPE }; +enum class Orientation { Portrait, Landscape }; enum class PrintQueueFlags diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 3d9408c..baf3908 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -538,7 +538,7 @@ sal_uInt16 ScDocShell::SetPrinter( SfxPrinter* pNewPrinter, SfxPrinterChangeFlag { const SvxPageItem& rOldItem = static_cast<const SvxPageItem&>(rSet.Get(ATTR_PAGE)); bool bWasLand = rOldItem.IsLandscape(); - bool bNewLand = ( pNewPrinter->GetOrientation() == ORIENTATION_LANDSCAPE ); + bool bNewLand = ( pNewPrinter->GetOrientation() == Orientation::Landscape ); if (bNewLand != bWasLand) { SvxPageItem aNewItem( rOldItem ); diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 0890697..b23ffcd 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -2587,7 +2587,7 @@ void ScPrintFunc::ApplyPrintSettings() Size aEnumSize = aPageSize; - pPrinter->SetOrientation( bLandscape ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT ); + pPrinter->SetOrientation( bLandscape ? Orientation::Landscape : Orientation::Portrait ); if ( bLandscape ) { // landscape is always interpreted as a rotation by 90 degrees ! diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index d794cff..f7e073f 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -126,11 +126,11 @@ SdPage::SdPage(SdDrawDocument& rNewDoc, bool bMasterPage) if (aPageSize.Width() > aPageSize.Height()) { - meOrientation = ORIENTATION_LANDSCAPE; + meOrientation = Orientation::Landscape; } else { - meOrientation = ORIENTATION_PORTRAIT; + meOrientation = Orientation::Portrait; } } @@ -1732,11 +1732,11 @@ void SdPage::SetSize(const Size& aSize) // we initialize the orientation. if (aSize.Width() > aSize.Height()) { - meOrientation = ORIENTATION_LANDSCAPE; + meOrientation = Orientation::Landscape; } else { - meOrientation = ORIENTATION_PORTRAIT; + meOrientation = Orientation::Portrait; } } } diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index 02df0da..b4c6095 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -239,7 +239,7 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent ) SvxPageItem aPageItem( SID_ATTR_PAGE ); aPageItem.SetDescName( mpPage->GetName() ); aPageItem.SetPageUsage( (SvxPageUsage) SVX_PAGE_ALL ); - aPageItem.SetLandscape( mpPage->GetOrientation() == ORIENTATION_LANDSCAPE ); + aPageItem.SetLandscape( mpPage->GetOrientation() == Orientation::Landscape ); aPageItem.SetNumType( mpDoc->GetPageNumType() ); aNewAttr.Put( aPageItem ); @@ -524,7 +524,7 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs ) mpDoc->SetPageNumType(static_cast<const SvxPageItem*>(pPoolItem)->GetNumType()); eOrientation = static_cast<const SvxPageItem*>(pPoolItem)->IsLandscape() ? - ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT; + Orientation::Landscape : Orientation::Portrait; if( mpPage->GetOrientation() != eOrientation ) bSetPageSizeAndBorder = true; diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 11269c1..206cc01 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -694,7 +694,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName if(!::cppu::enum2int( nEnum, aValue )) throw lang::IllegalArgumentException(); - Orientation eOri = (((view::PaperOrientation)nEnum) == view::PaperOrientation_PORTRAIT)?ORIENTATION_PORTRAIT:ORIENTATION_LANDSCAPE; + Orientation eOri = (((view::PaperOrientation)nEnum) == view::PaperOrientation_PORTRAIT)?Orientation::Portrait:Orientation::Landscape; if( eOri != GetPage()->GetOrientation() ) { @@ -1054,7 +1054,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) break; case WID_PAGE_ORIENT: aAny <<= view::PaperOrientation( - GetPage()->GetOrientation() == ORIENTATION_PORTRAIT + GetPage()->GetOrientation() == Orientation::Portrait ? view::PaperOrientation_PORTRAIT : view::PaperOrientation_LANDSCAPE); break; diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 3eee817..886f21f 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -266,7 +266,7 @@ namespace { msPageString(), maPrintSize(0,0), maPageSize(0,0), - meOrientation(ORIENTATION_PORTRAIT), + meOrientation(Orientation::Portrait), maMap(), mbPrintMarkedOnly(bPrintMarkedOnly) {} @@ -1374,14 +1374,14 @@ private: PrintInfo& rInfo) { SdDrawDocument* pDocument = mrBase.GetMainViewShell()->GetDoc(); - rInfo.meOrientation = ORIENTATION_PORTRAIT; + rInfo.meOrientation = Orientation::Portrait; if( ! mpOptions->IsBooklet()) { rInfo.meOrientation = pDocument->GetSdPage(0, ePageKind)->GetOrientation(); } else if (rInfo.maPageSize.Width() < rInfo.maPageSize.Height()) - rInfo.meOrientation = ORIENTATION_LANDSCAPE; + rInfo.meOrientation = Orientation::Landscape; // Draw and Notes should usually abide by their specified paper size Size aPaperSize; @@ -1400,10 +1400,10 @@ private: if (mpOptions->IsPrinterPreferred(pDocument->GetDocumentType())) { - if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE && + if( (rInfo.meOrientation == Orientation::Landscape && (aPaperSize.Width() < aPaperSize.Height())) || - (rInfo.meOrientation == ORIENTATION_PORTRAIT && + (rInfo.meOrientation == Orientation::Portrait && (aPaperSize.Width() > aPaperSize.Height())) ) { @@ -1788,10 +1788,10 @@ private: rInfo.meOrientation = rMaster.GetOrientation(); const Size aPaperSize (rInfo.mpPrinter->GetPaperSize()); - if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE && + if( (rInfo.meOrientation == Orientation::Landscape && (aPaperSize.Width() < aPaperSize.Height())) || - (rInfo.meOrientation == ORIENTATION_PORTRAIT && + (rInfo.meOrientation == Orientation::Portrait && (aPaperSize.Width() > aPaperSize.Height())) ) { @@ -2003,7 +2003,7 @@ private: Size aPrintSize_2 (rInfo.maPrintSize); Size aPageSize_2 (rInfo.maPageSize); - if (rInfo.meOrientation == ORIENTATION_LANDSCAPE) + if (rInfo.meOrientation == Orientation::Landscape) aPrintSize_2.Width() >>= 1; else aPrintSize_2.Height() >>= 1; @@ -2032,7 +2032,7 @@ private: aStdMap, aMap)); - if (rInfo.meOrientation == ORIENTATION_LANDSCAPE) + if (rInfo.meOrientation == Orientation::Landscape) { aOffset.X() = ( ( aAdjustedPrintSize.Width() >> 1 ) - rInfo.maPageSize.Width() ) >> 1; aOffset.Y() = ( aAdjustedPrintSize.Height() - rInfo.maPageSize.Height() ) >> 1; @@ -2093,7 +2093,7 @@ private: { const std::pair<sal_uInt16, sal_uInt16> aPair (aPairVector[nIndex]); Point aSecondOffset (aOffset); - if (rInfo.meOrientation == ORIENTATION_LANDSCAPE) + if (rInfo.meOrientation == Orientation::Landscape) aSecondOffset.X() += aAdjustedPrintSize.Width() / 2; else aSecondOffset.Y() += aAdjustedPrintSize.Height() / 2; diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 83e3b28..c821eef 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1650,7 +1650,7 @@ void DrawViewShell::GetPageProperties( SfxItemSet &rSet ) if (pPage != nullptr && GetDoc() != nullptr) { SvxPageItem aPageItem(SID_ATTR_PAGE); - aPageItem.SetLandscape( pPage->GetOrientation() == ORIENTATION_LANDSCAPE ); + aPageItem.SetLandscape( pPage->GetOrientation() == Orientation::Landscape ); rSet.Put(SvxSizeItem( SID_ATTR_PAGE_SIZE, pPage->GetSize() )); rSet.Put(aPageItem); diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 59def84..cbac68b 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -1353,7 +1353,7 @@ void SdrPage::SetOrientation(Orientation eOri) // square: handle like portrait format Size aSiz(GetSize()); if (aSiz.Width()!=aSiz.Height()) { - if ((eOri==ORIENTATION_PORTRAIT) == (aSiz.Width()>aSiz.Height())) { + if ((eOri==Orientation::Portrait) == (aSiz.Width()>aSiz.Height())) { SetSize(Size(aSiz.Height(),aSiz.Width())); } } @@ -1362,9 +1362,9 @@ void SdrPage::SetOrientation(Orientation eOri) Orientation SdrPage::GetOrientation() const { // square: handle like portrait format - Orientation eRet=ORIENTATION_PORTRAIT; + Orientation eRet=Orientation::Portrait; Size aSiz(GetSize()); - if (aSiz.Width()>aSiz.Height()) eRet=ORIENTATION_LANDSCAPE; + if (aSiz.Width()>aSiz.Height()) eRet=Orientation::Landscape; return eRet; } diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index 7fe0801..354328a 100644 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -223,7 +223,7 @@ void SwViewShell::ChgAllPageOrientation( Orientation eOri ) SET_CURR_SHELL( this ); const size_t nAll = GetDoc()->GetPageDescCnt(); - bool bNewOri = eOri != ORIENTATION_PORTRAIT; + bool bNewOri = eOri != Orientation::Portrait; for( size_t i = 0; i < nAll; ++ i ) { diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index fb86905..a341cfc 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -925,9 +925,9 @@ MOVEPAGE: if(pPPVPD) { SfxPrinter* pPrinter = GetPrinter( true ); - if((pPrinter->GetOrientation() == ORIENTATION_LANDSCAPE) + if((pPrinter->GetOrientation() == Orientation::Landscape) != pPPVPD->GetLandscape()) - pPrinter->SetOrientation(pPPVPD->GetLandscape() ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT); + pPrinter->SetOrientation(pPPVPD->GetLandscape() ? Orientation::Landscape : Orientation::Portrait); } ::SetAppPrintOptions( m_pViewWin->GetViewShell(), false ); m_bNormalPrint = false; diff --git a/vcl/headless/svpprn.cxx b/vcl/headless/svpprn.cxx index c5c8ea5..35946f2 100644 --- a/vcl/headless/svpprn.cxx +++ b/vcl/headless/svpprn.cxx @@ -60,7 +60,7 @@ inline int PtTo10Mu( int nPoints ) { return (int)((((double)nPoints)*35.27777778 static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData ) { - pJobSetup->SetOrientation( (Orientation)(rData.m_eOrientation == orientation::Landscape ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT) ); + pJobSetup->SetOrientation( (Orientation)(rData.m_eOrientation == orientation::Landscape ? Orientation::Landscape : Orientation::Portrait) ); // copy page size OUString aPaper; diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx index d151f6c..fa2f88b 100644 --- a/vcl/osx/salprn.cxx +++ b/vcl/osx/salprn.cxx @@ -49,7 +49,7 @@ AquaSalInfoPrinter::AquaSalInfoPrinter( const SalPrinterQueueInfo& i_rQueue ) : mbJob( false ), mpPrinter( nil ), mpPrintInfo( nil ), - mePageOrientation( ORIENTATION_PORTRAIT ), + mePageOrientation( Orientation::Portrait ), mnStartPageOffsetX( 0 ), mnStartPageOffsetY( 0 ), mnCurPageRangeStart( 0 ), @@ -65,10 +65,10 @@ AquaSalInfoPrinter::AquaSalInfoPrinter( const SalPrinterQueueInfo& i_rQueue ) : mpPrintInfo = [pShared copy]; [mpPrintInfo setPrinter: mpPrinter]; #if MACOSX_SDK_VERSION >= 1090 - mePageOrientation = ([mpPrintInfo orientation] == NSPaperOrientationPortrait) ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT; + mePageOrientation = ([mpPrintInfo orientation] == NSPaperOrientationPortrait) ? Orientation::Landscape : Orientation::Portrait; [mpPrintInfo setOrientation: NSPaperOrientationPortrait]; #else - mePageOrientation = ([mpPrintInfo orientation] == NSLandscapeOrientation) ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT; + mePageOrientation = ([mpPrintInfo orientation] == NSLandscapeOrientation) ? Orientation::Landscape : Orientation::Portrait; [mpPrintInfo setOrientation: NSPortraitOrientation]; #endif } @@ -109,7 +109,7 @@ void AquaSalInfoPrinter::SetupPrinterGraphics( CGContextRef i_rContext ) const NSSize aPaperSize = [mpPrintInfo paperSize]; NSRect aImageRect = [mpPrintInfo imageablePageBounds]; - if( mePageOrientation == ORIENTATION_PORTRAIT ) + if( mePageOrientation == Orientation::Portrait ) { // move mirrored CTM back into paper double dX = 0, dY = aPaperSize.height; @@ -205,7 +205,7 @@ bool AquaSalInfoPrinter::SetPrinterData( ImplJobSetup* io_pSetupData ) void AquaSalInfoPrinter::setPaperSize( long i_nWidth, long i_nHeight, Orientation i_eSetOrientation ) { - Orientation ePaperOrientation = ORIENTATION_PORTRAIT; + Orientation ePaperOrientation = Orientation::Portrait; const PaperInfo* pPaper = matchPaper( i_nWidth, i_nHeight, ePaperOrientation ); if( pPaper ) @@ -323,7 +323,7 @@ void AquaSalInfoPrinter::GetPageInfo( const ImplJobSetup*, o_rOutWidth = static_cast<long>( aImageRect.size.width * fXScaling ); o_rOutHeight = static_cast<long>( aImageRect.size.height * fYScaling ); - if( mePageOrientation == ORIENTATION_LANDSCAPE ) + if( mePageOrientation == Orientation::Landscape ) { std::swap( o_rOutWidth, o_rOutHeight ); std::swap( o_rPageWidth, o_rPageHeight ); @@ -669,7 +669,7 @@ const PaperInfo* AquaSalInfoPrinter::matchPaper( long i_nWidth, long i_nHeight, const_cast<AquaSalInfoPrinter*>(this)->InitPaperFormats( nullptr ); const PaperInfo* pMatch = nullptr; - o_rOrientation = ORIENTATION_PORTRAIT; + o_rOrientation = Orientation::Portrait; for( int n = 0; n < 2 ; n++ ) { for( size_t i = 0; i < m_aPaperFormats.size(); i++ ) @@ -681,7 +681,7 @@ const PaperInfo* AquaSalInfoPrinter::matchPaper( long i_nWidth, long i_nHeight, return pMatch; } } - o_rOrientation = ORIENTATION_LANDSCAPE; + o_rOrientation = Orientation::Landscape; std::swap( i_nWidth, i_nHeight ); } return pMatch; diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx index 6424eaa..0fc9a7c 100644 --- a/vcl/source/gdi/jobset.cxx +++ b/vcl/source/gdi/jobset.cxx @@ -52,7 +52,7 @@ struct Impl364JobSetupData ImplJobSetup::ImplJobSetup() { mnSystem = 0; - meOrientation = ORIENTATION_PORTRAIT; + meOrientation = Orientation::Portrait; meDuplexMode = DUPLEX_UNKNOWN; mnPaperBin = 0; mePaperFormat = PAPER_USER; diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index d2c0f87..8b0aa60 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -1322,7 +1322,7 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe rData.SetPaperFormat( ImplGetPaperFormat( rPaperInfo.getWidth(), rPaperInfo.getHeight() )); - rData.SetOrientation( ORIENTATION_PORTRAIT ); + rData.SetOrientation( Orientation::Portrait ); bFound = true; break; } @@ -1348,7 +1348,7 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe rData.SetPaperFormat( ImplGetPaperFormat( rPaperInfo.getWidth(), rPaperInfo.getHeight() )); - rData.SetOrientation( ORIENTATION_LANDSCAPE ); + rData.SetOrientation( Orientation::Landscape ); bFound = true; break; } @@ -1359,7 +1359,7 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe { sal_Int64 nBestMatch = SAL_MAX_INT64; int nBestIndex = 0; - Orientation eBestOrientation = ORIENTATION_PORTRAIT; + Orientation eBestOrientation = Orientation::Portrait; for( int i = 0; i < nPaperCount; i++ ) { const PaperInfo& rPaperInfo = GetPaperInfo( i ); @@ -1372,7 +1372,7 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe { nBestMatch = nMatch; nBestIndex = i; - eBestOrientation = ORIENTATION_PORTRAIT; + eBestOrientation = Orientation::Portrait; } // check landscape match @@ -1383,7 +1383,7 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool bMatchNe { nBestMatch = nMatch; nBestIndex = i; - eBestOrientation = ORIENTATION_LANDSCAPE; + eBestOrientation = Orientation::Landscape; } } const PaperInfo& rBestInfo = GetPaperInfo( nBestIndex ); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 258df17..0ddf2f6 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -654,7 +654,7 @@ PrintDialog::PrintDialog( vcl::Window* i_pParent, const std::shared_ptr<PrinterC // setup sizes for N-Up Size aNupSize( maPController->getPrinter()->PixelToLogic( maPController->getPrinter()->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) ); - if( maPController->getPrinter()->GetOrientation() == ORIENTATION_LANDSCAPE ) + if( maPController->getPrinter()->GetOrientation() == Orientation::Landscape ) { maNupLandscapeSize = aNupSize; maNupPortraitSize = Size( aNupSize.Height(), aNupSize.Width() ); diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx index e9b9d87..573518e 100644 --- a/vcl/unx/generic/print/genprnpsp.cxx +++ b/vcl/unx/generic/print/genprnpsp.cxx @@ -156,7 +156,7 @@ inline int TenMuToPt( int nUnits ) { return (int)((((double)nUnits)/35.27777778) static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData ) { pJobSetup->SetOrientation( (Orientation)(rData.m_eOrientation == orientation::Landscape ? - ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT)); + Orientation::Landscape : Orientation::Portrait)); // copy page size OUString aPaper; @@ -668,7 +668,7 @@ bool PspSalInfoPrinter::SetData( // merge orientation if necessary if( nSetDataFlags & JobSetFlags::ORIENTATION ) - aData.m_eOrientation = pJobSetup->GetOrientation() == ORIENTATION_LANDSCAPE ? orientation::Landscape : orientation::Portrait; + aData.m_eOrientation = pJobSetup->GetOrientation() == Orientation::Landscape ? orientation::Landscape : orientation::Portrait; // merge duplex if necessary if( nSetDataFlags & JobSetFlags::DUPLEXMODE ) diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx index 140ecf3..3ec4097 100644 --- a/vcl/win/gdi/salprn.cxx +++ b/vcl/win/gdi/salprn.cxx @@ -466,9 +466,9 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS if ( nFlags & JobSetFlags::ORIENTATION ) { if ( CHOOSE_DEVMODE(dmOrientation) == DMORIENT_PORTRAIT ) - pSetupData->SetOrientation( ORIENTATION_PORTRAIT ); + pSetupData->SetOrientation( Orientation::Portrait ); else if ( CHOOSE_DEVMODE(dmOrientation) == DMORIENT_LANDSCAPE ) - pSetupData->SetOrientation( ORIENTATION_LANDSCAPE ); + pSetupData->SetOrientation( Orientation::Landscape ); } // PaperBin @@ -732,7 +732,7 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, const ImplJobSet if ( nFlags & JobSetFlags::ORIENTATION ) { CHOOSE_DEVMODE(dmFields) |= DM_ORIENTATION; - if ( pSetupData->GetOrientation() == ORIENTATION_PORTRAIT ) + if ( pSetupData->GetOrientation() == Orientation::Portrait ) CHOOSE_DEVMODE(dmOrientation) = DMORIENT_PORTRAIT; else CHOOSE_DEVMODE(dmOrientation) = DMORIENT_LANDSCAPE; commit 04a8ba2084950f998d791edad29739c124c8c4b8 Author: Noel Grandin <[email protected]> Date: Fri Sep 2 14:57:18 2016 +0200 convert ScrollType to scoped enum Change-Id: I6dd02d4f7df028dada6cfd5d767a6ec1b1c1efe1 diff --git a/accessibility/source/standard/vclxaccessiblescrollbar.cxx b/accessibility/source/standard/vclxaccessiblescrollbar.cxx index 516d41d..6fdf416 100644 --- a/accessibility/source/standard/vclxaccessiblescrollbar.cxx +++ b/accessibility/source/standard/vclxaccessiblescrollbar.cxx @@ -138,11 +138,11 @@ sal_Bool VCLXAccessibleScrollBar::doAccessibleAction ( sal_Int32 nIndex ) throw ScrollType eScrollType; switch ( nIndex ) { - case 0: eScrollType = SCROLL_LINEUP; break; - case 1: eScrollType = SCROLL_LINEDOWN; break; - case 2: eScrollType = SCROLL_PAGEUP; break; - case 3: eScrollType = SCROLL_PAGEDOWN; break; - default: eScrollType = SCROLL_DONTKNOW; break; + case 0: eScrollType = ScrollType::LineUp; break; + case 1: eScrollType = ScrollType::LineDown; break; + case 2: eScrollType = ScrollType::PageUp; break; + case 3: eScrollType = ScrollType::PageDown; break; + default: eScrollType = ScrollType::DontKnow; break; } if ( pScrollBar->DoScrollAction( eScrollType ) ) bReturn = true; diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 75d9a78..42917c6 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -220,7 +220,7 @@ IMPL_LINK_TYPED( OWizNameMatching, ButtonClickHdl, Button *, pButton, void ) if(pButton == m_pColumn_down && (nThumbPos+nVisibleSize+1) < nPos) { - m_pCTRL_LEFT->GetVScroll()->DoScrollAction(SCROLL_LINEDOWN); + m_pCTRL_LEFT->GetVScroll()->DoScrollAction(ScrollType::LineDown); } TableListClickHdl(m_pCTRL_LEFT); @@ -245,7 +245,7 @@ IMPL_LINK_TYPED( OWizNameMatching, RightButtonClickHdl, Button *, pButton, void long nVisibleSize = m_pCTRL_RIGHT->GetVScroll()->GetVisibleSize(); if(pButton == m_pColumn_down_right && (nThumbPos+nVisibleSize+1) < nPos) - m_pCTRL_RIGHT->GetVScroll()->DoScrollAction(SCROLL_LINEDOWN); + m_pCTRL_RIGHT->GetVScroll()->DoScrollAction(ScrollType::LineDown); TableListRightSelectHdl(m_pCTRL_RIGHT); } } diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx index a5bf802..212accc 100644 --- a/desktop/source/deployment/gui/license_dialog.cxx +++ b/desktop/source/deployment/gui/license_dialog.cxx @@ -276,7 +276,7 @@ IMPL_LINK_NOARG_TYPED(LicenseDialogImpl, ScrolledHdl, LicenseView&, void) IMPL_LINK_NOARG_TYPED(LicenseDialogImpl, PageDownHdl, Button*, void) { - m_pLicense->ScrollDown( SCROLL_PAGEDOWN ); + m_pLicense->ScrollDown( ScrollType::PageDown ); } IMPL_LINK_NOARG_TYPED(LicenseDialogImpl, EndReachedHdl, LicenseView&, void) diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx index 5012c49..81d9050 100644 --- a/extensions/source/propctrlr/browserlistbox.cxx +++ b/extensions/source/propctrlr/browserlistbox.cxx @@ -865,7 +865,7 @@ namespace pcr { PositionLine((sal_uInt16)nThumbPos); } - else if (nDelta!=0 || m_aVScroll->GetType() == SCROLL_DONTKNOW) + else if (nDelta!=0 || m_aVScroll->GetType() == ScrollType::DontKnow) { UpdatePlayGround(); } diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx index 4d7ce61..0880464 100644 --- a/extensions/source/propctrlr/taborder.cxx +++ b/extensions/source/propctrlr/taborder.cxx @@ -389,9 +389,9 @@ namespace pcr long nFirstVisible = GetModel()->GetAbsPos( FirstVisible()); if ( ( nThumbPos + nVisibleSize + 1 ) < (long)( nLastSelPos + 3 ) ) - GetVScroll()->DoScrollAction(SCROLL_LINEDOWN); + GetVScroll()->DoScrollAction(ScrollType::LineDown); else if((nThumbPos+nVisibleSize+1) >= (nFirstVisible)) - GetVScroll()->DoScrollAction(SCROLL_LINEUP); + GetVScroll()->DoScrollAction(ScrollType::LineUp); } } } diff --git a/include/vcl/scrbar.hxx b/include/vcl/scrbar.hxx index 951fb87..1267015 100644 --- a/include/vcl/scrbar.hxx +++ b/include/vcl/scrbar.hxx @@ -27,8 +27,13 @@ class AutoTimer; -enum ScrollType { SCROLL_DONTKNOW, SCROLL_LINEUP, SCROLL_LINEDOWN, - SCROLL_PAGEUP, SCROLL_PAGEDOWN, SCROLL_DRAG, SCROLL_SET }; +enum class ScrollType +{ + DontKnow, + LineUp, LineDown, + PageUp, PageDown, + Drag, Set +}; struct ImplScrollBarData; diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index c4be7f7..16c94af 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -1472,7 +1472,7 @@ void OViewsWindow::handleKey(const vcl::KeyCode& _rCode) OScrollWindowHelper* pScrollWindow = getView()->getScrollWindow(); ScrollBar& rScrollBar = ( nCode == KEY_LEFT || nCode == KEY_RIGHT ) ? pScrollWindow->GetHScroll() : pScrollWindow->GetVScroll(); if ( rScrollBar.IsVisible() ) - rScrollBar.DoScrollAction(( nCode == KEY_RIGHT || nCode == KEY_UP ) ? SCROLL_LINEUP : SCROLL_LINEDOWN ); + rScrollBar.DoScrollAction(( nCode == KEY_RIGHT || nCode == KEY_UP ) ? ScrollType::LineUp : ScrollType::LineDown ); return; } TSectionsMap::const_iterator aIter = m_aSections.begin(); diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index d6603e2..45cd2e7 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -92,16 +92,16 @@ void DlgEdFunc::ForceScroll( const Point& rPos ) { ScrollBar& rHScroll = pScrollWindow->GetHScroll(); ScrollBar& rVScroll = pScrollWindow->GetVScroll(); - ScrollType eH = SCROLL_LINEDOWN,eV = SCROLL_LINEDOWN; + ScrollType eH = ScrollType::LineDown,eV = ScrollType::LineDown; if( rPos.X() < aOutRect.Left() ) - eH = SCROLL_LINEUP; + eH = ScrollType::LineUp; else if( rPos.X() <= aOutRect.Right() ) - eH = SCROLL_DONTKNOW; + eH = ScrollType::DontKnow; if( rPos.Y() < aOutRect.Top() ) - eV = SCROLL_LINEUP; + eV = ScrollType::LineUp; else if( rPos.Y() <= aOutRect.Bottom() ) - eV = SCROLL_DONTKNOW; + eV = ScrollType::DontKnow; rHScroll.DoScrollAction(eH); rVScroll.DoScrollAction(eV); diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index aa81b31..5ac34bd 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -1037,7 +1037,7 @@ IMPL_LINK_TYPED( ScTabView, ScrollHdl, ScrollBar*, pScroll, void ) bool bLayoutRTL = aViewData.GetDocument()->IsLayoutRTL( aViewData.GetTabNo() ); ScrollType eType = pScroll->GetType(); - if ( eType == SCROLL_DRAG ) + if ( eType == ScrollType::Drag ) { if (!bDragging) { @@ -1106,27 +1106,27 @@ IMPL_LINK_TYPED( ScTabView, ScrollHdl, ScrollBar*, pScroll, void ) long nDelta = pScroll->GetDelta(); switch ( eType ) { - case SCROLL_LINEUP: + case ScrollType::LineUp: nDelta = -1; break; - case SCROLL_LINEDOWN: + case ScrollType::LineDown: nDelta = 1; break; - case SCROLL_PAGEUP: + case ScrollType::PageUp: if ( pScroll == aHScrollLeft.get() ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_LEFT ); if ( pScroll == aHScrollRight.get() ) nDelta = -(long) aViewData.PrevCellsX( SC_SPLIT_RIGHT ); if ( pScroll == aVScrollTop.get() ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_TOP ); if ( pScroll == aVScrollBottom.get() ) nDelta = -(long) aViewData.PrevCellsY( SC_SPLIT_BOTTOM ); if (nDelta==0) nDelta=-1; break; - case SCROLL_PAGEDOWN: + case ScrollType::PageDown: if ( pScroll == aHScrollLeft.get() ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_LEFT ); if ( pScroll == aHScrollRight.get() ) nDelta = aViewData.VisibleCellsX( SC_SPLIT_RIGHT ); if ( pScroll == aVScrollTop.get() ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_TOP ); if ( pScroll == aVScrollBottom.get() ) nDelta = aViewData.VisibleCellsY( SC_SPLIT_BOTTOM ); if (nDelta==0) nDelta=1; break; - case SCROLL_DRAG: + case ScrollType::Drag: { // only scroll in the correct direction, do not jitter around hidden ranges long nScrollMin = 0; // simulate RangeMin @@ -1158,7 +1158,7 @@ IMPL_LINK_TYPED( ScTabView, ScrollHdl, ScrollBar*, pScroll, void ) if (nDelta) { - bool bUpdate = ( eType != SCROLL_DRAG ); // don't alter the ranges while dragging + bool bUpdate = ( eType != ScrollType::Drag ); // don't alter the ranges while dragging if ( bHoriz ) ScrollX( nDelta, (pScroll == aHScrollLeft.get()) ? SC_SPLIT_LEFT : SC_SPLIT_RIGHT, bUpdate ); else diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 828e957..017ef84 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -2161,7 +2161,7 @@ IMPL_LINK_NOARG_TYPED(CustomPropertiesControl, RemovedHdl, void*, void) long nLineCount = m_pPropertiesWin->GetVisibleLineCount(); m_pVertScroll->SetRangeMax(nLineCount + 1); if ( m_pPropertiesWin->GetOutputSizePixel().Height() < nLineCount * m_pPropertiesWin->GetLineHeight() ) - m_pVertScroll->DoScrollAction ( SCROLL_LINEUP ); + m_pVertScroll->DoScrollAction ( ScrollType::LineUp ); } void CustomPropertiesControl::AddLine( const OUString& sName, Any& rAny, bool bInteractive ) diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 24423f5..fb86905 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -1426,7 +1426,7 @@ IMPL_LINK_TYPED( SwPagePreview, ScrollHdl, ScrollBar *, p, void ) if(!GetViewShell()) return; if( !pScrollbar->IsHoriScroll() && - pScrollbar->GetType() == SCROLL_DRAG && + pScrollbar->GetType() == ScrollType::Drag && Help::IsQuickHelpEnabled() && GetViewShell()->PagePreviewLayout()->DoesPreviewLayoutRowsFitIntoWindow()) { diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx index 7be971d..89b3e14 100644 --- a/sw/source/uibase/uiview/viewport.cxx +++ b/sw/source/uibase/uiview/viewport.cxx @@ -686,11 +686,11 @@ IMPL_LINK_TYPED( SwView, ScrollHdl, ScrollBar *, p, void ) if ( GetWrtShell().ActionPend() ) return; - if ( pScrollbar->GetType() == SCROLL_DRAG ) + if ( pScrollbar->GetType() == ScrollType::Drag ) m_pWrtShell->EnableSmooth( false ); if(!m_pWrtShell->GetViewOptions()->getBrowseMode() && - pScrollbar->GetType() == SCROLL_DRAG) + pScrollbar->GetType() == ScrollType::Drag) { // Here comment out again if it is not desired to scroll together: // The end scrollhandler invalidate the FN_STAT_PAGE, @@ -746,7 +746,7 @@ IMPL_LINK_TYPED( SwView, ScrollHdl, ScrollBar *, p, void ) else EndScrollHdl(pScrollbar); - if ( pScrollbar->GetType() == SCROLL_DRAG ) + if ( pScrollbar->GetType() == ScrollType::Drag ) m_pWrtShell->EnableSmooth( true ); } diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index 83c2c56..d3b6556 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -3699,15 +3699,15 @@ void VCLXScrollBar::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) // set adjustment type ScrollType aType = pScrollBar->GetType(); - if ( aType == SCROLL_LINEUP || aType == SCROLL_LINEDOWN ) + if ( aType == ScrollType::LineUp || aType == ScrollType::LineDown ) { aEvent.Type = css::awt::AdjustmentType_ADJUST_LINE; } - else if ( aType == SCROLL_PAGEUP || aType == SCROLL_PAGEDOWN ) + else if ( aType == ScrollType::PageUp || aType == ScrollType::PageDown ) { aEvent.Type = css::awt::AdjustmentType_ADJUST_PAGE; } - else if ( aType == SCROLL_DRAG ) + else if ( aType == ScrollType::Drag ) { aEvent.Type = css::awt::AdjustmentType_ADJUST_ABS; } diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index b4abe08..5ac987e 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -89,7 +89,7 @@ void ScrollBar::ImplInit( vcl::Window* pParent, WinBits nStyle ) mnDelta = 0; mnDragDraw = 0; mnStateFlags = 0; - meScrollType = SCROLL_DONTKNOW; + meScrollType = ScrollType::DontKnow; mbCalcSize = true; mbFullDrag = false; @@ -724,19 +724,19 @@ long ScrollBar::ImplDoAction( bool bCallEndScroll ) switch ( meScrollType ) { - case SCROLL_LINEUP: + case ScrollType::LineUp: nDelta = ImplScroll( mnThumbPos-mnLineSize, bCallEndScroll ); break; - case SCROLL_LINEDOWN: + case ScrollType::LineDown: nDelta = ImplScroll( mnThumbPos+mnLineSize, bCallEndScroll ); break; - case SCROLL_PAGEUP: + case ScrollType::PageUp: nDelta = ImplScroll( mnThumbPos-mnPageSize, bCallEndScroll ); break; - case SCROLL_PAGEDOWN: + case ScrollType::PageDown: nDelta = ImplScroll( mnThumbPos+mnPageSize, bCallEndScroll ); break; default: @@ -758,7 +758,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) switch ( meScrollType ) { - case SCROLL_LINEUP: + case ScrollType::LineUp: if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? ControlPart::ButtonRight: ControlPart::ButtonLeft): ControlPart::ButtonUp, aControlRegion, rMousePos, bIsInside )? bIsInside: @@ -771,7 +771,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) mnStateFlags &= ~SCRBAR_STATE_BTN1_DOWN; break; - case SCROLL_LINEDOWN: + case ScrollType::LineDown: if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? (IsRTLEnabled()? ControlPart::ButtonLeft: ControlPart::ButtonRight): ControlPart::ButtonDown, aControlRegion, rMousePos, bIsInside )? bIsInside: @@ -784,7 +784,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) mnStateFlags &= ~SCRBAR_STATE_BTN2_DOWN; break; - case SCROLL_PAGEUP: + case ScrollType::PageUp: // HitTestNativeControl, see remark at top of file if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? ControlPart::TrackHorzLeft: ControlPart::TrackVertUpper, maPage1Rect, rMousePos, bIsInside )? @@ -798,7 +798,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) mnStateFlags &= ~SCRBAR_STATE_PAGE1_DOWN; break; - case SCROLL_PAGEDOWN: + case ScrollType::PageDown: // HitTestNativeControl, see remark at top of file if ( HitTestNativeControl( ControlType::Scrollbar, bHorizontal? ControlPart::TrackHorzRight: ControlPart::TrackVertLower, maPage2Rect, rMousePos, bIsInside )? @@ -892,7 +892,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) if (rMEvt.IsLeft() && !(mnStateFlags & SCRBAR_STATE_BTN1_DISABLE) ) { nTrackFlags = StartTrackingFlags::ButtonRepeat; - meScrollType = SCROLL_LINEUP; + meScrollType = ScrollType::LineUp; mnDragDraw = SCRBAR_DRAW_BTN1; } } @@ -904,7 +904,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) if (rMEvt.IsLeft() && !(mnStateFlags & SCRBAR_STATE_BTN2_DISABLE) ) { nTrackFlags = StartTrackingFlags::ButtonRepeat; - meScrollType = SCROLL_LINEDOWN; + meScrollType = ScrollType::LineDown; mnDragDraw = SCRBAR_DRAW_BTN2; } } @@ -932,7 +932,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) if ( mnVisibleSize < mnMaxRange-mnMinRange ) { nTrackFlags = StartTrackingFlags::NONE; - meScrollType = SCROLL_DRAG; + meScrollType = ScrollType::Drag; mnDragDraw = SCRBAR_DRAW_THUMB; // calculate mouse offset @@ -968,19 +968,19 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) bIsInside: maPage1Rect.IsInside( rMousePos ) ) { - meScrollType = SCROLL_PAGEUP; + meScrollType = ScrollType::PageUp; mnDragDraw = SCRBAR_DRAW_PAGE1; } else { - meScrollType = SCROLL_PAGEDOWN; + meScrollType = ScrollType::PageDown; mnDragDraw = SCRBAR_DRAW_PAGE2; } } } // Should we start Tracking? - if ( meScrollType != SCROLL_DONTKNOW ) + if ( meScrollType != ScrollType::DontKnow ) { // store original position for cancel and EndScroll delta mnStartPos = mnThumbPos; @@ -1018,7 +1018,7 @@ void ScrollBar::Tracking( const TrackingEvent& rTEvt ) Scroll(); } - if ( meScrollType == SCROLL_DRAG ) + if ( meScrollType == ScrollType::Drag ) { // On a SCROLLDRAG we recalculate the Thumb, so that it's back to a // rounded ThumbPosition @@ -1035,7 +1035,7 @@ void ScrollBar::Tracking( const TrackingEvent& rTEvt ) mnDelta = mnThumbPos-mnStartPos; EndScroll(); mnDelta = 0; - meScrollType = SCROLL_DONTKNOW; + meScrollType = ScrollType::DontKnow; if( mpData ) mpData->mbHide = false; // re-enable focus blinking @@ -1057,7 +1057,7 @@ void ScrollBar::Tracking( const TrackingEvent& rTEvt ) const Point rMousePos = (GetMapMode().GetMapUnit() != MAP_TWIP ? rTEvt.GetMouseEvent().GetPosPixel() : aPosPixel); // Dragging is treated in a special way - if ( meScrollType == SCROLL_DRAG ) + if ( meScrollType == ScrollType::Drag ) ImplDragThumb( rMousePos ); else ImplDoMouseAction( rMousePos, rTEvt.IsTrackingRepeat() ); @@ -1085,20 +1085,20 @@ void ScrollBar::KeyInput( const KeyEvent& rKEvt ) case KEY_LEFT: case KEY_UP: - DoScrollAction( SCROLL_LINEUP ); + DoScrollAction( ScrollType::LineUp ); break; case KEY_RIGHT: case KEY_DOWN: - DoScrollAction( SCROLL_LINEDOWN ); + DoScrollAction( ScrollType::LineDown ); break; case KEY_PAGEUP: - DoScrollAction( SCROLL_PAGEUP ); + DoScrollAction( ScrollType::PageUp ); break; case KEY_PAGEDOWN: - DoScrollAction( SCROLL_PAGEDOWN ); + DoScrollAction( ScrollType::PageDown ); break; default: @@ -1323,26 +1323,26 @@ void ScrollBar::EndScroll() long ScrollBar::DoScroll( long nNewPos ) { - if ( meScrollType != SCROLL_DONTKNOW ) + if ( meScrollType != ScrollType::DontKnow ) return 0; SAL_INFO("vcl.scrollbar", "DoScroll(" << nNewPos << ")"); - meScrollType = SCROLL_DRAG; + meScrollType = ScrollType::Drag; long nDelta = ImplScroll( nNewPos, true ); - meScrollType = SCROLL_DONTKNOW; + meScrollType = ScrollType::DontKnow; return nDelta; } long ScrollBar::DoScrollAction( ScrollType eScrollType ) { - if ( (meScrollType != SCROLL_DONTKNOW) || - (eScrollType == SCROLL_DONTKNOW) || - (eScrollType == SCROLL_DRAG) ) + if ( (meScrollType != ScrollType::DontKnow) || + (eScrollType == ScrollType::DontKnow) || + (eScrollType == ScrollType::Drag) ) return 0; meScrollType = eScrollType; long nDelta = ImplDoAction( true ); - meScrollType = SCROLL_DONTKNOW; + meScrollType = ScrollType::DontKnow; return nDelta; } diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index a59eb77..1c38fbe 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -56,7 +56,7 @@ void Slider::ImplInit( vcl::Window* pParent, WinBits nStyle ) mnPageSize = 1; mnDelta = 0; mnStateFlags = 0; - meScrollType = SCROLL_DONTKNOW; + meScrollType = ScrollType::DontKnow; mbCalcSize = true; mbFullDrag = true; @@ -505,23 +505,23 @@ long Slider::ImplDoAction( bool bCallEndSlide ) switch ( meScrollType ) { - case SCROLL_LINEUP: + case ScrollType::LineUp: nDelta = ImplSlide( mnThumbPos-mnLineSize, bCallEndSlide ); break; - case SCROLL_LINEDOWN: + case ScrollType::LineDown: nDelta = ImplSlide( mnThumbPos+mnLineSize, bCallEndSlide ); break; - case SCROLL_PAGEUP: + case ScrollType::PageUp: nDelta = ImplSlide( mnThumbPos-mnPageSize, bCallEndSlide ); break; - case SCROLL_PAGEDOWN: + case ScrollType::PageDown: nDelta = ImplSlide( mnThumbPos+mnPageSize, bCallEndSlide ); break; - case SCROLL_SET: + case ScrollType::Set: nDelta = ImplSlide( ImplCalcThumbPos( GetPointerPosPixel().X() ), bCallEndSlide ); break; default: @@ -538,7 +538,7 @@ void Slider::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) switch ( meScrollType ) { - case SCROLL_SET: + case ScrollType::Set: { const bool bUp = ImplIsPageUp( rMousePos ), bDown = ImplIsPageDown( rMousePos ); @@ -552,7 +552,7 @@ void Slider::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) break; } - case SCROLL_PAGEUP: + case ScrollType::PageUp: if ( ImplIsPageUp( rMousePos ) ) { bAction = bCallAction; @@ -562,7 +562,7 @@ void Slider::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) mnStateFlags &= ~SLIDER_STATE_CHANNEL1_DOWN; break; - case SCROLL_PAGEDOWN: + case ScrollType::PageDown: if ( ImplIsPageDown( rMousePos ) ) { bAction = bCallAction; @@ -591,24 +591,24 @@ void Slider::ImplDoMouseAction( const Point& rMousePos, bool bCallAction ) void Slider::ImplDoSlide( long nNewPos ) { - if ( meScrollType != SCROLL_DONTKNOW ) + if ( meScrollType != ScrollType::DontKnow ) return; - meScrollType = SCROLL_DRAG; + meScrollType = ScrollType::Drag; ImplSlide( nNewPos, true ); - meScrollType = SCROLL_DONTKNOW; + meScrollType = ScrollType::DontKnow; } void Slider::ImplDoSlideAction( ScrollType eScrollType ) { - if ( (meScrollType != SCROLL_DONTKNOW) || - (eScrollType == SCROLL_DONTKNOW) || - (eScrollType == SCROLL_DRAG) ) + if ( (meScrollType != ScrollType::DontKnow) || + (eScrollType == ScrollType::DontKnow) || + (eScrollType == ScrollType::Drag) ) return; meScrollType = eScrollType; ImplDoAction( true ); - meScrollType = SCROLL_DONTKNOW; + meScrollType = ScrollType::DontKnow; } void Slider::MouseButtonDown( const MouseEvent& rMEvt ) @@ -620,7 +620,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt ) if ( maThumbRect.IsInside( rMousePos ) ) { - meScrollType = SCROLL_DRAG; + meScrollType = ScrollType::Drag; // calculate additional values Point aCenterPos = maThumbRect.Center(); @@ -632,33 +632,33 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt ) else if ( ImplIsPageUp( rMousePos ) ) { if( GetStyle() & WB_SLIDERSET ) - meScrollType = SCROLL_SET; + meScrollType = ScrollType::Set; else { nTrackFlags = StartTrackingFlags::ButtonRepeat; - meScrollType = SCROLL_PAGEUP; + meScrollType = ScrollType::PageUp; } } else if ( ImplIsPageDown( rMousePos ) ) { if( GetStyle() & WB_SLIDERSET ) - meScrollType = SCROLL_SET; + meScrollType = ScrollType::Set; else { nTrackFlags = StartTrackingFlags::ButtonRepeat; - meScrollType = SCROLL_PAGEDOWN; + meScrollType = ScrollType::PageDown; } } // Shall we start Tracking? - if( meScrollType != SCROLL_DONTKNOW ) + if( meScrollType != ScrollType::DontKnow ) { // store Start position for cancel and EndScroll delta mnStartPos = mnThumbPos; - ImplDoMouseAction( rMousePos, meScrollType != SCROLL_SET ); + ImplDoMouseAction( rMousePos, meScrollType != ScrollType::Set ); Update(); - if( meScrollType != SCROLL_SET ) + if( meScrollType != ScrollType::Set ) StartTracking( nTrackFlags ); } } @@ -666,7 +666,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt ) void Slider::MouseButtonUp( const MouseEvent& ) { - if( SCROLL_SET == meScrollType ) + if( ScrollType::Set == meScrollType ) { // reset Button and PageRect state const sal_uInt16 nOldStateFlags = mnStateFlags; @@ -678,7 +678,7 @@ void Slider::MouseButtonUp( const MouseEvent& ) Invalidate(InvalidateFlags::NoChildren | InvalidateFlags::NoErase); } ImplDoAction( true ); - meScrollType = SCROLL_DONTKNOW; + meScrollType = ScrollType::DontKnow; } } @@ -704,7 +704,7 @@ void Slider::Tracking( const TrackingEvent& rTEvt ) Slide(); } - if ( meScrollType == SCROLL_DRAG ) + if ( meScrollType == ScrollType::Drag ) { // after dragging, recalculate to a rounded Thumb position ImplCalc(); @@ -721,14 +721,14 @@ void Slider::Tracking( const TrackingEvent& rTEvt ) mnDelta = mnThumbPos-mnStartPos; EndSlide(); mnDelta = 0; - meScrollType = SCROLL_DONTKNOW; + meScrollType = ScrollType::DontKnow; } else { const Point rMousePos = rTEvt.GetMouseEvent().GetPosPixel(); // special handling for dragging - if ( meScrollType == SCROLL_DRAG ) + if ( meScrollType == ScrollType::Drag ) { long nMovePix; Point aCenterPos = maThumbRect.Center(); @@ -784,20 +784,20 @@ void Slider::KeyInput( const KeyEvent& rKEvt ) case KEY_LEFT: case KEY_UP: - ImplDoSlideAction( SCROLL_LINEUP ); + ImplDoSlideAction( ScrollType::LineUp ); break; case KEY_RIGHT: case KEY_DOWN: - ImplDoSlideAction( SCROLL_LINEDOWN ); + ImplDoSlideAction( ScrollType::LineDown ); break; case KEY_PAGEUP: - ImplDoSlideAction( SCROLL_PAGEUP ); + ImplDoSlideAction( ScrollType::PageUp ); break; case KEY_PAGEDOWN: - ImplDoSlideAction( SCROLL_PAGEDOWN ); + ImplDoSlideAction( ScrollType::PageDown ); break; default: diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx index 3079dbd..97ab755 100644 --- a/vcl/source/edit/vclmedit.cxx +++ b/vcl/source/edit/vclmedit.cxx @@ -1467,37 +1467,37 @@ bool VclMultiLineEdit::PreNotify( NotifyEvent& rNEvt ) case KEY_UP: { if ( pImpVclMEdit->GetVScrollBar() ) - pImpVclMEdit->GetVScrollBar()->DoScrollAction( SCROLL_LINEUP ); + pImpVclMEdit->GetVScrollBar()->DoScrollAction( ScrollType::LineUp ); } break; case KEY_DOWN: { if ( pImpVclMEdit->GetVScrollBar() ) - pImpVclMEdit->GetVScrollBar()->DoScrollAction( SCROLL_LINEDOWN ); + pImpVclMEdit->GetVScrollBar()->DoScrollAction( ScrollType::LineDown ); } break; case KEY_PAGEUP : { if ( pImpVclMEdit->GetVScrollBar() ) - pImpVclMEdit->GetVScrollBar()->DoScrollAction( SCROLL_PAGEUP ); + pImpVclMEdit->GetVScrollBar()->DoScrollAction( ScrollType::PageUp ); } break; case KEY_PAGEDOWN: { if ( pImpVclMEdit->GetVScrollBar() ) - pImpVclMEdit->GetVScrollBar()->DoScrollAction( SCROLL_PAGEDOWN ); + pImpVclMEdit->GetVScrollBar()->DoScrollAction( ScrollType::PageDown ); } break; case KEY_LEFT: { if ( pImpVclMEdit->GetHScrollBar() ) - pImpVclMEdit->GetHScrollBar()->DoScrollAction( SCROLL_LINEUP ); + pImpVclMEdit->GetHScrollBar()->DoScrollAction( ScrollType::LineUp ); } break; case KEY_RIGHT: { if ( pImpVclMEdit->GetHScrollBar() ) - pImpVclMEdit->GetHScrollBar()->DoScrollAction( SCROLL_LINEDOWN ); + pImpVclMEdit->GetHScrollBar()->DoScrollAction( ScrollType::LineDown ); } break; case KEY_HOME: commit a1cd62bcd589a7c1050e327f4cb0ad95f9ea19d1 Author: Noel Grandin <[email protected]> Date: Fri Sep 2 13:54:34 2016 +0200 convert ToolBoxButtonSize to scoped enum Change-Id: I365b0e34361eb339b04e5f4792f54eff5bf582a5 diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 298c45f..0058b32 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -767,12 +767,12 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* ) if( nSidebarSizeLB_InitialSelection != nSidebarSizeLB_NewSelection ) { // from now on it's modified, even if via auto setting the same size was set as now selected in the LB - sal_Int16 eSet = TOOLBOX_BUTTONSIZE_DONTCARE; + ToolBoxButtonSize eSet = ToolBoxButtonSize::DontCare; switch( nSidebarSizeLB_NewSelection ) { - case 0: eSet = TOOLBOX_BUTTONSIZE_DONTCARE; break; - case 1: eSet = TOOLBOX_BUTTONSIZE_SMALL; break; - case 2: eSet = TOOLBOX_BUTTONSIZE_LARGE; break; + case 0: eSet = ToolBoxButtonSize::DontCare; break; + case 1: eSet = ToolBoxButtonSize::Small; break; + case 2: eSet = ToolBoxButtonSize::Large; break; default: OSL_FAIL( "OfaViewTabPage::FillItemSet(): This state of m_pSidebarIconSizeLB should not be possible!" ); } @@ -783,12 +783,12 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* ) if( nNotebookbarSizeLB_InitialSelection != nNotebookbarSizeLB_NewSelection ) { // from now on it's modified, even if via auto setting the same size was set as now selected in the LB - sal_Int16 eSet = TOOLBOX_BUTTONSIZE_DONTCARE; + ToolBoxButtonSize eSet = ToolBoxButtonSize::DontCare; switch( nNotebookbarSizeLB_NewSelection ) { - case 0: eSet = TOOLBOX_BUTTONSIZE_DONTCARE; break; - case 1: eSet = TOOLBOX_BUTTONSIZE_SMALL; break; - case 2: eSet = TOOLBOX_BUTTONSIZE_LARGE; break; + case 0: eSet = ToolBoxButtonSize::DontCare; break; + case 1: eSet = ToolBoxButtonSize::Small; break; + case 2: eSet = ToolBoxButtonSize::Large; break; default: OSL_FAIL( "OfaViewTabPage::FillItemSet(): This state of m_pNotebookbarIconSizeLB should not be possible!" ); } @@ -943,12 +943,20 @@ void OfaViewTabPage::Reset( const SfxItemSet* ) nSizeLB_InitialSelection = ( aMiscOptions.AreCurrentSymbolsLarge() )? 2 : 1; m_pIconSizeLB->SelectEntryPos( nSizeLB_InitialSelection ); m_pIconSizeLB->SaveValue(); - if( aMiscOptions.GetSidebarIconSize() != TOOLBOX_BUTTONSIZE_DONTCARE ) - nSidebarSizeLB_InitialSelection = aMiscOptions.GetSidebarIconSize(); + if( aMiscOptions.GetSidebarIconSize() == ToolBoxButtonSize::DontCare ) + ; // do nothing + else if( aMiscOptions.GetSidebarIconSize() == ToolBoxButtonSize::Small ) + nSidebarSizeLB_InitialSelection = 1; + else if( aMiscOptions.GetSidebarIconSize() == ToolBoxButtonSize::Large ) + nSidebarSizeLB_InitialSelection = 2; m_pSidebarIconSizeLB->SelectEntryPos( nSidebarSizeLB_InitialSelection ); m_pSidebarIconSizeLB->SaveValue(); - if( aMiscOptions.GetNotebookbarIconSize() != TOOLBOX_BUTTONSIZE_DONTCARE ) - nNotebookbarSizeLB_InitialSelection = aMiscOptions.GetNotebookbarIconSize(); + if( aMiscOptions.GetNotebookbarIconSize() == ToolBoxButtonSize::DontCare ) + ; // do nothing + else if( aMiscOptions.GetNotebookbarIconSize() == ToolBoxButtonSize::Small ) + nNotebookbarSizeLB_InitialSelection = 1; + else if( aMiscOptions.GetNotebookbarIconSize() == ToolBoxButtonSize::Large ) + nNotebookbarSizeLB_InitialSelection = 2; m_pNotebookbarIconSizeLB->SelectEntryPos( nNotebookbarSizeLB_InitialSelection ); m_pNotebookbarIconSizeLB->SaveValue(); diff --git a/framework/source/uielement/addonstoolbarmanager.cxx b/framework/source/uielement/addonstoolbarmanager.cxx index fe3aadc..0a27244 100644 --- a/framework/source/uielement/addonstoolbarmanager.cxx +++ b/framework/source/uielement/addonstoolbarmanager.cxx @@ -188,7 +188,7 @@ void AddonsToolBarManager::RefreshImages() ); } } - m_pToolBar->SetToolboxButtonSize( bBigImages ? TOOLBOX_BUTTONSIZE_LARGE : TOOLBOX_BUTTONSIZE_SMALL ); + m_pToolBar->SetToolboxButtonSize( bBigImages ? ToolBoxButtonSize::Large : ToolBoxButtonSize::Small ); ::Size aSize = m_pToolBar->CalcWindowSizePixel(); m_pToolBar->SetOutputSizePixel( aSize ); } diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx index fa088a2..52d6746 100644 --- a/framework/source/uielement/popuptoolbarcontroller.cxx +++ b/framework/source/uielement/popuptoolbarcontroller.cxx @@ -424,7 +424,7 @@ void SaveToolbarController::updateImage() if ( !getToolboxId( nId, &pToolBox ) ) return; - bool bLargeIcons = pToolBox->GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE; + bool bLargeIcons = pToolBox->GetToolboxButtonSize() == ToolBoxButtonSize::Large; Image aImage; if ( m_bReadOnly ) diff --git a/framework/source/uielement/subtoolbarcontroller.cxx b/framework/source/uielement/subtoolbarcontroller.cxx index 3681678..40f7630 100644 --- a/framework/source/uielement/subtoolbarcontroller.cxx +++ b/framework/source/uielement/subtoolbarcontroller.cxx @@ -291,7 +291,7 @@ void SubToolBarController::updateImage() sal_uInt16 nId = 0; if ( getToolboxId( nId, &pToolBox ) ) { - Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( m_aLastCommand, pToolBox->GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE, getFrameInterface() ); + Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( m_aLastCommand, pToolBox->GetToolboxButtonSize() == ToolBoxButtonSize::Large, getFrameInterface() ); if ( !!aImage ) pToolBox->SetItemImage( nId, aImage ); } diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 68a3e00..eb85a82 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -163,7 +163,7 @@ ToolBarManager::ToolBarManager( const Reference< XComponentContext >& rxContext, m_pToolBar->SetDoubleClickHdl( LINK( this, ToolBarManager, DoubleClick ) ); m_pToolBar->SetStateChangedHdl( LINK( this, ToolBarManager, StateChanged ) ); m_pToolBar->SetDataChangedHdl( LINK( this, ToolBarManager, DataChanged ) ); - m_pToolBar->SetToolboxButtonSize( m_bSmallSymbols ? TOOLBOX_BUTTONSIZE_SMALL : TOOLBOX_BUTTONSIZE_LARGE ); + m_pToolBar->SetToolboxButtonSize( m_bSmallSymbols ? ToolBoxButtonSize::Small : ToolBoxButtonSize::Large ); // enables a menu for clipped items and customization SvtCommandOptions aCmdOptions; @@ -276,7 +276,7 @@ void ToolBarManager::RefreshImages() SolarMutexGuard g; bool bBigImages( SvtMiscOptions().AreCurrentSymbolsLarge() ); - m_pToolBar->SetToolboxButtonSize( bBigImages ? TOOLBOX_BUTTONSIZE_LARGE : TOOLBOX_BUTTONSIZE_SMALL ); + m_pToolBar->SetToolboxButtonSize( bBigImages ? ToolBoxButtonSize::Large : ToolBoxButtonSize::Small ); for ( auto const& it : m_aControllerMap ) { diff --git a/include/sfx2/sidebar/SidebarToolBox.hxx b/include/sfx2/sidebar/SidebarToolBox.hxx index d61f15f1..3eb7eb4 100644 --- a/include/sfx2/sidebar/SidebarToolBox.hxx +++ b/include/sfx2/sidebar/SidebarToolBox.hxx @@ -43,7 +43,7 @@ public: virtual ~SidebarToolBox(); virtual void dispose() override; - virtual sal_uInt16 GetIconSize() const; + virtual ToolBoxButtonSize GetIconSize() const; using ToolBox::InsertItem; virtual void InsertItem(const OUString& rCommand, diff --git a/include/svtools/miscopt.hxx b/include/svtools/miscopt.hxx index 5d6a91a..aa92690 100644 --- a/include/svtools/miscopt.hxx +++ b/include/svtools/miscopt.hxx @@ -35,6 +35,7 @@ *//*-*************************************************************************************************************/ class SvtMiscOptions_Impl; +enum class ToolBoxButtonSize; /*-************************************************************************************************************ @short collect information about misc group @@ -62,10 +63,10 @@ class SVT_DLLPUBLIC SvtMiscOptions: public utl::detail::Options sal_Int16 GetSymbolsSize() const; void SetSymbolsSize( sal_Int16 eSet ); - sal_Int16 GetSidebarIconSize() const; - void SetSidebarIconSize( sal_Int16 eSet ); - sal_Int16 GetNotebookbarIconSize() const; - void SetNotebookbarIconSize( sal_Int16 eSet ); + ToolBoxButtonSize GetSidebarIconSize() const; + void SetSidebarIconSize( ToolBoxButtonSize eSet ); + ToolBoxButtonSize GetNotebookbarIconSize() const; + void SetNotebookbarIconSize( ToolBoxButtonSize eSet ); sal_Int16 GetCurrentSymbolsSize() const; bool AreCurrentSymbolsLarge() const; diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx index 6020b01..28a7045 100644 --- a/include/vcl/toolbox.hxx +++ b/include/vcl/toolbox.hxx @@ -60,7 +60,7 @@ namespace o3tl // small or large force an exact toolbox size for proper alignemnt // dontcare will let the toolbox decide about its size -enum ToolBoxButtonSize { TOOLBOX_BUTTONSIZE_DONTCARE, TOOLBOX_BUTTONSIZE_SMALL, TOOLBOX_BUTTONSIZE_LARGE }; +enum class ToolBoxButtonSize { DontCare, Small, Large }; // ToolBoxLayoutMode::Normal - traditional layout, items are centered in the toolbar // ToolBoxLayoutMode::LockVert - special mode (currently used for calc input/formula diff --git a/sd/source/ui/controller/displaymodecontroller.cxx b/sd/source/ui/controller/displaymodecontroller.cxx index 8e8b6b9f..628f3ac 100644 --- a/sd/source/ui/controller/displaymodecontroller.cxx +++ b/sd/source/ui/controller/displaymodecontroller.cxx @@ -252,7 +252,7 @@ void DisplayModeController::setToolboxItemImage( sal_uInt16 nImage ) if (getToolboxId( nId, &pToolBox )) { SdResId resId( nImage ); BitmapEx aBmp( resId ); - int targetSize = (pToolBox->GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE) ? 32 : 16; + int targetSize = (pToolBox->GetToolboxButtonSize() == ToolBoxButtonSize::Large) ? 32 : 16; double scale = 1.0f; Size size = aBmp.GetSizePixel(); if (size.Width() > targetSize) diff --git a/sfx2/source/notebookbar/BigToolBox.cxx b/sfx2/source/notebookbar/BigToolBox.cxx index 8848cba..a271f04 100644 --- a/sfx2/source/notebookbar/BigToolBox.cxx +++ b/sfx2/source/notebookbar/BigToolBox.cxx @@ -41,7 +41,7 @@ BigToolBox::BigToolBox(vcl::Window* pParent) SvtMiscOptions aMiscOptions; aMiscOptions.RemoveListenerLink(LINK(this, SidebarToolBox, ChangedIconSizeHandler)); - SetToolboxButtonSize(TOOLBOX_BUTTONSIZE_LARGE); + SetToolboxButtonSize(ToolBoxButtonSize::Large); SetButtonType(ButtonType::SYMBOLTEXT); SetToolBoxTextPosition(ToolBoxTextPosition::Bottom); } diff --git a/sfx2/source/notebookbar/NotebookbarToolBox.cxx b/sfx2/source/notebookbar/NotebookbarToolBox.cxx index 37662a8..0822343 100644 --- a/sfx2/source/notebookbar/NotebookbarToolBox.cxx +++ b/sfx2/source/notebookbar/NotebookbarToolBox.cxx @@ -30,18 +30,12 @@ public: NotebookbarToolBox(vcl::Window* pParentWindow) : sfx2::sidebar::SidebarToolBox(pParentWindow) { - ToolBoxButtonSize eSize = TOOLBOX_BUTTONSIZE_SMALL; - - SvtMiscOptions aMiscOptions; - - sal_uInt16 nSize = GetIconSize(); - if (nSize <= TOOLBOX_BUTTONSIZE_LARGE) - eSize = static_cast<ToolBoxButtonSize>(nSize); - + ToolBoxButtonSize eSize = ToolBoxButtonSize::Small; + eSize = GetIconSize(); SetToolboxButtonSize(eSize); } - virtual sal_uInt16 GetIconSize() const override + virtual ToolBoxButtonSize GetIconSize() const override { SvtMiscOptions aMiscOptions; return aMiscOptions.GetNotebookbarIconSize(); diff --git a/sfx2/source/sidebar/SidebarToolBox.cxx b/sfx2/source/sidebar/SidebarToolBox.cxx index 29c82ff..02d9165 100644 --- a/sfx2/source/sidebar/SidebarToolBox.cxx +++ b/sfx2/source/sidebar/SidebarToolBox.cxx @@ -64,14 +64,12 @@ SidebarToolBox::SidebarToolBox (vcl::Window* pParentWindow) SetBackground(Wallpaper()); SetPaintTransparent(true); - ToolBoxButtonSize eSize = TOOLBOX_BUTTONSIZE_SMALL; + ToolBoxButtonSize eSize = ToolBoxButtonSize::Small; SvtMiscOptions aMiscOptions; aMiscOptions.AddListenerLink(LINK(this, SidebarToolBox, ChangedIconSizeHandler)); - sal_uInt16 nSize = GetIconSize(); - if (nSize <= TOOLBOX_BUTTONSIZE_LARGE) - eSize = static_cast<ToolBoxButtonSize>(nSize); + eSize = GetIconSize(); SetToolboxButtonSize(eSize); @@ -117,7 +115,7 @@ void SidebarToolBox::dispose() ToolBox::dispose(); } -sal_uInt16 SidebarToolBox::GetIconSize() const +ToolBoxButtonSize SidebarToolBox::GetIconSize() const { SvtMiscOptions aMiscOptions; return aMiscOptions.GetSidebarIconSize(); @@ -268,13 +266,9 @@ IMPL_LINK_NOARG_TYPED(SidebarToolBox, ChangedIconSizeHandler, LinkParamNone*, vo { SolarMutexGuard g; - ToolBoxButtonSize eSize = TOOLBOX_BUTTONSIZE_SMALL; + ToolBoxButtonSize eSize = GetIconSize(); - sal_uInt16 nSize = GetIconSize(); - if(nSize <= TOOLBOX_BUTTONSIZE_LARGE) - eSize = static_cast<ToolBoxButtonSize>(nSize); - - bool bBigImages(eSize == TOOLBOX_BUTTONSIZE_LARGE); + bool bBigImages(eSize == ToolBoxButtonSize::Large); SetToolboxButtonSize(eSize); for (auto const& it : maControllers) diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index e17f67e..f117458 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -597,7 +597,7 @@ Reference< css::awt::XWindow > SAL_CALL SfxToolBoxControl::createItemWindow( con bool SfxToolBoxControl::hasBigImages() const { - return (GetToolBox().GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE); + return (GetToolBox().GetToolboxButtonSize() == ToolBoxButtonSize::Large); } void SfxToolBoxControl::SetPopupWindow( SfxPopupWindow* pWindow ) diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx index dd42ca0..8b7eb7d 100644 --- a/svtools/source/config/miscopt.cxx +++ b/svtools/source/config/miscopt.cxx @@ -31,6 +31,7 @@ #include <svtools/imgdef.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> +#include <vcl/toolbox.hxx> #include <list> @@ -79,9 +80,9 @@ private: bool m_bIsPluginsEnabledRO; sal_Int16 m_nSymbolsSize; bool m_bIsSymbolsSizeRO; - sal_Int16 m_nSidebarIconSize; + ToolBoxButtonSize m_nSidebarIconSize; bool m_bIsSidebarIconSizeRO; - sal_Int16 m_nNotebookbarIconSize; + ToolBoxButtonSize m_nNotebookbarIconSize; bool m_bIsNotebookbarIconSizeRO; bool m_bIsSymbolsStyleRO; sal_Int16 m_nToolboxStyle; @@ -154,17 +155,17 @@ public: inline sal_Int16 GetSymbolsSize() { return m_nSymbolsSize; } - inline sal_Int16 GetSidebarIconSize() + inline ToolBoxButtonSize GetSidebarIconSize() { return m_nSidebarIconSize; } - inline sal_Int16 GetNotebookbarIconSize() + inline ToolBoxButtonSize GetNotebookbarIconSize() { return m_nNotebookbarIconSize; } void SetSymbolsSize( sal_Int16 nSet ); - void SetSidebarIconSize( sal_Int16 nSet ); + void SetSidebarIconSize( ToolBoxButtonSize nSet ); - void SetNotebookbarIconSize( sal_Int16 nSet ); + void SetNotebookbarIconSize( ToolBoxButtonSize nSet ); static OUString GetIconTheme(); @@ -243,9 +244,9 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl() , m_bIsPluginsEnabledRO( false ) , m_nSymbolsSize( 0 ) , m_bIsSymbolsSizeRO( false ) - , m_nSidebarIconSize( 0 ) + , m_nSidebarIconSize( ToolBoxButtonSize::DontCare ) , m_bIsSidebarIconSizeRO( false ) - , m_nNotebookbarIconSize( 0 ) + , m_nNotebookbarIconSize( ToolBoxButtonSize::DontCare ) , m_bIsNotebookbarIconSizeRO( false ) , m_bIsSymbolsStyleRO( false ) , m_nToolboxStyle( 1 ) @@ -299,20 +300,24 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl() case PROPERTYHANDLE_SIDEBARICONSIZE : { - if( !(seqValues[nProperty] >>= m_nSidebarIconSize) ) + sal_uInt16 nTmp; + if( !(seqValues[nProperty] >>= nTmp) ) { OSL_FAIL("Wrong type of \"Misc\\SidebarIconSize\"!" ); - } + } else + m_nSidebarIconSize = (ToolBoxButtonSize)nTmp; m_bIsSidebarIconSizeRO = seqRO[nProperty]; break; } case PROPERTYHANDLE_NOTEBOOKBARICONSIZE : { - if( !(seqValues[nProperty] >>= m_nNotebookbarIconSize) ) + sal_uInt16 nTmp; + if( !(seqValues[nProperty] >>= nTmp) ) { OSL_FAIL("Wrong type of \"Misc\\NotebookbarIconSize\"!" ); - } + } else + m_nNotebookbarIconSize = (ToolBoxButtonSize)nTmp; m_bIsNotebookbarIconSizeRO = seqRO[nProperty]; break; } @@ -447,17 +452,21 @@ void SvtMiscOptions_Impl::Load( const Sequence< OUString >& rPropertyNames ) } break; case PROPERTYHANDLE_SIDEBARICONSIZE : { - if( !(seqValues[nProperty] >>= m_nSidebarIconSize) ) + sal_uInt16 nTmp; + if( !(seqValues[nProperty] >>= nTmp) ) { OSL_FAIL("Wrong type of \"Misc\\SidebarIconSize\"!" ); - } + } else + m_nSidebarIconSize = (ToolBoxButtonSize)nTmp; } break; case PROPERTYHANDLE_NOTEBOOKBARICONSIZE : { - if( !(seqValues[nProperty] >>= m_nNotebookbarIconSize) ) + sal_uInt16 nTmp; + if( !(seqValues[nProperty] >>= nTmp ) ) { OSL_FAIL("Wrong type of \"Misc\\NotebookbarIconSize\"!" ); - } + } else + m_nNotebookbarIconSize = (ToolBoxButtonSize)nTmp; } break; case PROPERTYHANDLE_TOOLBOXSTYLE : { @@ -542,14 +551,14 @@ void SvtMiscOptions_Impl::SetSymbolsSize( sal_Int16 nSet ) CallListeners(); } -void SvtMiscOptions_Impl::SetSidebarIconSize( sal_Int16 nSet ) +void SvtMiscOptions_Impl::SetSidebarIconSize( ToolBoxButtonSize nSet ) { m_nSidebarIconSize = nSet; SetModified(); CallListeners(); } -void SvtMiscOptions_Impl::SetNotebookbarIconSize( sal_Int16 nSet ) +void SvtMiscOptions_Impl::SetNotebookbarIconSize( ToolBoxButtonSize nSet ) { m_nNotebookbarIconSize = nSet; SetModified(); @@ -626,14 +635,14 @@ void SvtMiscOptions_Impl::ImplCommit() case PROPERTYHANDLE_SIDEBARICONSIZE : { if ( !m_bIsSidebarIconSizeRO ) - seqValues[nProperty] <<= m_nSidebarIconSize; + seqValues[nProperty] <<= (sal_uInt16)m_nSidebarIconSize; break; } case PROPERTYHANDLE_NOTEBOOKBARICONSIZE : { if ( !m_bIsNotebookbarIconSizeRO ) - seqValues[nProperty] <<= m_nNotebookbarIconSize; + seqValues[nProperty] <<= (sal_uInt16)m_nNotebookbarIconSize; break; } @@ -787,22 +796,22 @@ void SvtMiscOptions::SetSymbolsSize( sal_Int16 nSet ) m_pImpl->SetSymbolsSize( nSet ); } -sal_Int16 SvtMiscOptions::GetSidebarIconSize() const +ToolBoxButtonSize SvtMiscOptions::GetSidebarIconSize() const { return m_pImpl->GetSidebarIconSize(); } -sal_Int16 SvtMiscOptions::GetNotebookbarIconSize() const +ToolBoxButtonSize SvtMiscOptions::GetNotebookbarIconSize() const { return m_pImpl->GetNotebookbarIconSize(); } -void SvtMiscOptions::SetSidebarIconSize( sal_Int16 nSet ) +void SvtMiscOptions::SetSidebarIconSize( ToolBoxButtonSize nSet ) { m_pImpl->SetSidebarIconSize( nSet ); } -void SvtMiscOptions::SetNotebookbarIconSize( sal_Int16 nSet ) +void SvtMiscOptions::SetNotebookbarIconSize( ToolBoxButtonSize nSet ) { m_pImpl->SetNotebookbarIconSize( nSet ); } diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 4bdca1b..5ca7454 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -1982,7 +1982,7 @@ bool ToolBox::ImplCalcItem() ImplAddButtonBorder( nMaxWidth, nMaxHeight, mpData->mbNativeButtons ); } - if( !ImplIsFloatingMode() && GetToolboxButtonSize() != TOOLBOX_BUTTONSIZE_DONTCARE + if( !ImplIsFloatingMode() && GetToolboxButtonSize() != ToolBoxButtonSize::DontCare && ( meTextPosition == ToolBoxTextPosition::Right ) ) { // make sure all vertical toolbars have the same width and horizontal have the same height diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index a584a55..fedc41c 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -48,7 +48,7 @@ using namespace vcl; ImplToolBoxPrivateData::ImplToolBoxPrivateData() : m_pLayoutData( nullptr ) { - meButtonSize = TOOLBOX_BUTTONSIZE_DONTCARE; + meButtonSize = ToolBoxButtonSize::DontCare; mpMenu = VclPtr<PopupMenu>::Create(); mnEventId = nullptr; @@ -519,7 +519,7 @@ void ToolBox::InsertItem(const OUString& rCommand, const css::uno::Reference<css OUString aLabel(vcl::CommandInfoProvider::Instance().GetLabelForCommand(rCommand, rFrame)); OUString aTooltip(vcl::CommandInfoProvider::Instance().GetTooltipForCommand(rCommand, rFrame)); Image aImage(vcl::CommandInfoProvider::Instance().GetImageForCommand( - rCommand, (GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE), rFrame)); + rCommand, (GetToolboxButtonSize() == ToolBoxButtonSize::Large), rFrame)); sal_uInt16 nItemId = GetItemCount() + 1; InsertItem(nItemId, aImage, aLabel, nBits, nPos); @@ -722,7 +722,7 @@ ToolBoxButtonSize ToolBox::GetToolboxButtonSize() const Size ToolBox::GetDefaultImageSize() const { - return GetDefaultImageSize( GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE ); + return GetDefaultImageSize( GetToolboxButtonSize() == ToolBoxButtonSize::Large ); } void ToolBox::SetAlign( WindowAlign eNewAlign ) commit 256654c26fa0d474891809d30d0004c3d87a5841 Author: Noel Grandin <[email protected]> Date: Fri Sep 2 13:09:26 2016 +0200 convert ToolBoxTextPosition to scoped enum Change-Id: I467b3245d5366af461dfd45eb9fd6fa87a6bef17 diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx index a0f74c9..6020b01 100644 --- a/include/vcl/toolbox.hxx +++ b/include/vcl/toolbox.hxx @@ -69,7 +69,7 @@ enum ToolBoxButtonSize { TOOLBOX_BUTTONSIZE_DONTCARE, TOOLBOX_BUTTONSIZE_SMALL, enum class ToolBoxLayoutMode { Normal, LockVert }; // Position of the text when icon and text are painted -enum ToolBoxTextPosition { Right, Bottom }; +enum class ToolBoxTextPosition { Right, Bottom }; struct ImplToolSize { commit 5fab198d0d6c2a6619cf7e5deac2f1fc969810ca Author: Noel Grandin <[email protected]> Date: Fri Sep 2 12:59:27 2016 +0200 fix usage of std::unique in commit 26c149617c54e29902a "std::list<sal_Int32> to deque" Change-Id: Ifd6ad15d8f95512e31bac4c39d2092a53a7c0ee1 diff --git a/vcl/unx/generic/print/printerjob.cxx b/vcl/unx/generic/print/printerjob.cxx index c4f7aa3..0adb334 100644 --- a/vcl/unx/generic/print/printerjob.cxx +++ b/vcl/unx/generic/print/printerjob.cxx @@ -848,7 +848,7 @@ void PrinterJob::writeJobPatch( osl::File* pFile, const JobData& rJobData ) } std::sort(patch_order.begin(), patch_order.end()); - std::unique(patch_order.begin(), patch_order.end()); + patch_order.erase(std::unique(patch_order.begin(), patch_order.end()), patch_order.end()); while( !patch_order.empty() ) { commit 2df04c81cf08301f8b4479471dd59352bf90b6e3 Author: Noel Grandin <[email protected]> Date: Fri Sep 2 12:58:07 2016 +0200 convert ExtTimeFieldFormat to scoped enum Change-Id: I6cb4e057f7a5b83edb51048f24372d19fbf48177 diff --git a/cui/source/options/optmemory.cxx b/cui/source/options/optmemory.cxx index 2f8e2fc..31cc66d 100644 --- a/cui/source/options/optmemory.cxx +++ b/cui/source/options/optmemory.cxx @@ -134,7 +134,7 @@ OfaMemoryOptionsPage::OfaMemoryOptionsPage(vcl::Window* pParent, const SfxItemSe m_pQuickStarterFrame->Hide(); #endif - m_pTfGraphicObjectTime->SetExtFormat( EXTTIMEF_24H_SHORT ); + m_pTfGraphicObjectTime->SetExtFormat( ExtTimeFieldFormat::Short24H ); SetExchangeSupport(); diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx index 3441ba6..3324b3d 100644 --- a/include/vcl/vclenum.hxx +++ b/include/vcl/vclenum.hxx @@ -24,9 +24,12 @@ #include <sal/types.h> #include <tools/fontenum.hxx> -enum ExtTimeFieldFormat { EXTTIMEF_24H_SHORT, EXTTIMEF_24H_LONG, - EXTTIMEF_12H_SHORT, EXTTIMEF_12H_LONG, - EXTTIMEF_DURATION_SHORT, EXTTIMEF_DURATION_LONG }; +enum class ExtTimeFieldFormat +{ + Short24H, Long24H, + Short12H, Long12H, + ShortDuration, LongDuration +}; enum class ExtDateFieldFormat { diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index ab8c00c..828e957 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1415,7 +1415,7 @@ CustomPropertyLine::CustomPropertyLine( vcl::Window* pParent ) : m_bTypeLostFocus( false ) { - m_aTimeField->SetExtFormat( EXTTIMEF_24H_LONG ); + m_aTimeField->SetExtFormat( ExtTimeFieldFormat::Long24H ); m_aDateField->SetExtDateFormat( ExtDateFieldFormat::SystemShortYYYY ); m_aRemoveButton->SetModeImage(Image(SfxResId(SFX_IMG_PROPERTY_REMOVE))); diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 2a00d3f..80861d6 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -2606,41 +2606,41 @@ void TimeField::SetExtFormat( ExtTimeFieldFormat eFormat ) { switch ( eFormat ) { - case EXTTIMEF_24H_SHORT: + case ExtTimeFieldFormat::Short24H: { SetTimeFormat( TimeFormat::Hour24 ); SetDuration( false ); SetFormat( TimeFieldFormat::F_NONE ); } break; - case EXTTIMEF_24H_LONG: + case ExtTimeFieldFormat::Long24H: { SetTimeFormat( TimeFormat::Hour24 ); SetDuration( false ); SetFormat( TimeFieldFormat::F_SEC ); } break; - case EXTTIMEF_12H_SHORT: + case ExtTimeFieldFormat::Short12H: { SetTimeFormat( TimeFormat::Hour12 ); SetDuration( false ); SetFormat( TimeFieldFormat::F_NONE ); } break; - case EXTTIMEF_12H_LONG: + case ExtTimeFieldFormat::Long12H: { SetTimeFormat( TimeFormat::Hour12 ); SetDuration( false ); SetFormat( TimeFieldFormat::F_SEC ); } break; - case EXTTIMEF_DURATION_SHORT: + case ExtTimeFieldFormat::ShortDuration: { SetDuration( true ); SetFormat( TimeFieldFormat::F_NONE ); } break; - case EXTTIMEF_DURATION_LONG: + case ExtTimeFieldFormat::LongDuration: { SetDuration( true ); SetFormat( TimeFieldFormat::F_SEC ); commit 0112840eb074dd0feeedb4aa132e7e04c2b855b1 Author: Noel Grandin <[email protected]> Date: Fri Sep 2 11:55:30 2016 +0200 convert ExtDateFieldFormat to scoped enum Change-Id: I717e5e727ee0e2b6d732ecc6a432c70926654902 diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index 5aa8a4f..78b5ea6 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -122,7 +122,7 @@ namespace pcr pControlWindow->SetLast( ::Date( 1, 1, 9999 ) ); pControlWindow->SetMax( ::Date( 1, 1, 9999 ) ); - pControlWindow->SetExtDateFormat( XTDATEF_SYSTEM_SHORT_YYYY ); + pControlWindow->SetExtDateFormat( ExtDateFieldFormat::SystemShortYYYY ); pControlWindow->EnableEmptyFieldValue( true ); } diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx index d277a0a..7bf3c07 100644 --- a/include/vcl/field.hxx +++ b/include/vcl/field.hxx @@ -281,8 +281,8 @@ private: Date maMax; bool mbLongFormat; bool mbShowDateCentury; - sal_uInt16 mnDateFormat; - sal_uLong mnExtDateFormat; + sal_uInt16 mnDateFormat; + ExtDateFieldFormat mnExtDateFormat; bool mbEnforceValidValue; SAL_DLLPRIVATE void ImplInit(); diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx index 6581365..3441ba6 100644 --- a/include/vcl/vclenum.hxx +++ b/include/vcl/vclenum.hxx @@ -28,12 +28,17 @@ enum ExtTimeFieldFormat { EXTTIMEF_24H_SHORT, EXTTIMEF_24H_LONG, EXTTIMEF_12H_SHORT, EXTTIMEF_12H_LONG, EXTTIMEF_DURATION_SHORT, EXTTIMEF_DURATION_LONG }; -enum ExtDateFieldFormat { XTDATEF_SYSTEM_SHORT, XTDATEF_SYSTEM_SHORT_YY, XTDATEF_SYSTEM_SHORT_YYYY, - XTDATEF_SYSTEM_LONG, - XTDATEF_SHORT_DDMMYY, XTDATEF_SHORT_MMDDYY, XTDATEF_SHORT_YYMMDD, - XTDATEF_SHORT_DDMMYYYY, XTDATEF_SHORT_MMDDYYYY, XTDATEF_SHORT_YYYYMMDD, - XTDATEF_SHORT_YYMMDD_DIN5008, XTDATEF_SHORT_YYYYMMDD_DIN5008, ExtDateFieldFormat_FORCE_EQUAL_SIZE=SAL_MAX_ENUM }; +enum class ExtDateFieldFormat +{ + SystemShort, SystemShortYY, SystemShortYYYY, + SystemLong, + ShortDDMMYY, ShortMMDDYY, ShortYYMMDD, + ShortDDMMYYYY, ShortMMDDYYYY, ShortYYYYMMDD, + ShortYYMMDD_DIN5008, ShortYYYYMMDD_DIN5008, + FORCE_EQUAL_SIZE=SAL_MAX_ENUM +}; +// this appears to be a direct copy of css::awt::GradientStyle enum class GradientStyle { Linear = 0, diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index a2e8fc7..ab8c00c 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1416,7 +1416,7 @@ CustomPropertyLine::CustomPropertyLine( vcl::Window* pParent ) : { m_aTimeField->SetExtFormat( EXTTIMEF_24H_LONG ); - m_aDateField->SetExtDateFormat( XTDATEF_SYSTEM_SHORT_YYYY ); + m_aDateField->SetExtDateFormat( ExtDateFieldFormat::SystemShortYYYY ); m_aRemoveButton->SetModeImage(Image(SfxResId(SFX_IMG_PROPERTY_REMOVE))); m_aRemoveButton->SetQuickHelpText(SfxResId(STR_SFX_REMOVE_PROPERTY).toString()); diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index eb32e17..2a00d3f 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -943,9 +943,9 @@ static ExtDateFieldFormat ImplGetExtFormat( DateFormat eOld ) { switch( eOld ) { - case DMY: return XTDATEF_SHORT_DDMMYY; - case MDY: return XTDATEF_SHORT_MMDDYY; - default: return XTDATEF_SHORT_YYMMDD; + case DMY: return ExtDateFieldFormat::ShortDDMMYY; + case MDY: return ExtDateFieldFormat::ShortMMDDYY; + default: return ExtDateFieldFormat::ShortYYMMDD; } } @@ -992,7 +992,7 @@ static sal_uInt16 ImplCutMonthFromString( OUString& rStr, const CalendarWrapper& static OUString ImplGetDateSep( const LocaleDataWrapper& rLocaleDataWrapper, ExtDateFieldFormat eFormat ) { - if ( ( eFormat == XTDATEF_SHORT_YYMMDD_DIN5008 ) || ( eFormat == XTDATEF_SHORT_YYYYMMDD_DIN5008 ) ) + if ( ( eFormat == ExtDateFieldFormat::ShortYYMMDD_DIN5008 ) || ( eFormat == ExtDateFieldFormat::ShortYYYYMMDD_DIN5008 ) ) return OUString("-"); else return rLocaleDataWrapper.getDateSep(); @@ -1022,7 +1022,7 @@ static bool ImplDateGetValue( const OUString& rStr, Date& rDate, ExtDateFieldFor bool bError = false; OUString aStr( rStr ); - if ( eDateFormat == XTDATEF_SYSTEM_LONG ) + if ( eDateFormat == ExtDateFieldFormat::SystemLong ) { DateFormat eFormat = rLocaleDataWrapper.getLongDateFormat(); switch( eFormat ) @@ -1066,8 +1066,8 @@ static bool ImplDateGetValue( const OUString& rStr, Date& rDate, ExtDateFieldFor switch ( eDateFormat ) { - case XTDATEF_SHORT_DDMMYY: - case XTDATEF_SHORT_DDMMYYYY: + case ExtDateFieldFormat::ShortDDMMYY: + case ExtDateFieldFormat::ShortDDMMYYYY: { nDay = ImplGetNum( pBuf, bError ); ImplSkipDelimiters( pBuf ); @@ -1077,8 +1077,8 @@ static bool ImplDateGetValue( const OUString& rStr, Date& rDate, ExtDateFieldFor nYear = ImplGetNum( pBuf, bError ); } break; - case XTDATEF_SHORT_MMDDYY: - case XTDATEF_SHORT_MMDDYYYY: + case ExtDateFieldFormat::ShortMMDDYY: + case ExtDateFieldFormat::ShortMMDDYYYY: { nMonth = ImplGetNum( pBuf, bError ); ImplSkipDelimiters( pBuf ); @@ -1088,10 +1088,10 @@ static bool ImplDateGetValue( const OUString& rStr, Date& rDate, ExtDateFieldFor nYear = ImplGetNum( pBuf, bError ); } break; - case XTDATEF_SHORT_YYMMDD: - case XTDATEF_SHORT_YYYYMMDD: - case XTDATEF_SHORT_YYMMDD_DIN5008: - case XTDATEF_SHORT_YYYYMMDD_DIN5008: + case ExtDateFieldFormat::ShortYYMMDD: + case ExtDateFieldFormat::ShortYYYYMMDD: + case ExtDateFieldFormat::ShortYYMMDD_DIN5008: + case ExtDateFieldFormat::ShortYYYYMMDD_DIN5008: { if ( bYear ) nYear = ImplGetNum( pBuf, bError ); @@ -1145,12 +1145,12 @@ OUString DateFormatter::ImplGetDateAsText( const Date& rDate, bool bShowCentury = false; switch ( GetExtDateFormat() ) { - case XTDATEF_SYSTEM_SHORT_YYYY: - case XTDATEF_SYSTEM_LONG: - case XTDATEF_SHORT_DDMMYYYY: - case XTDATEF_SHORT_MMDDYYYY: - case XTDATEF_SHORT_YYYYMMDD: - case XTDATEF_SHORT_YYYYMMDD_DIN5008: + case ExtDateFieldFormat::SystemShortYYYY: + case ExtDateFieldFormat::SystemLong: + case ExtDateFieldFormat::ShortDDMMYYYY: + case ExtDateFieldFormat::ShortMMDDYYYY: + case ExtDateFieldFormat::ShortYYYYMMDD: + case ExtDateFieldFormat::ShortYYYYMMDD_DIN5008: { bShowCentury = true; } @@ -1186,12 +1186,12 @@ OUString DateFormatter::ImplGetDateAsText( const Date& rDate, switch ( GetExtDateFormat( true ) ) { - case XTDATEF_SYSTEM_LONG: + case ExtDateFieldFormat::SystemLong: { return ImplGetLocaleDataWrapper().getLongDate( rDate, GetCalendarWrapper(), !bShowCentury ); } - case XTDATEF_SHORT_DDMMYY: - case XTDATEF_SHORT_DDMMYYYY: + case ExtDateFieldFormat::ShortDDMMYY: + case ExtDateFieldFormat::ShortDDMMYYYY: { pBuf = ImplAddNum( pBuf, nDay, 2 ); pBuf = ImplAddString( pBuf, aDateSep ); @@ -1200,8 +1200,8 @@ OUString DateFormatter::ImplGetDateAsText( const Date& rDate, pBuf = ImplAddSNum( pBuf, nYear, nYearLen ); } break; - case XTDATEF_SHORT_MMDDYY: - case XTDATEF_SHORT_MMDDYYYY: + case ExtDateFieldFormat::ShortMMDDYY: + case ExtDateFieldFormat::ShortMMDDYYYY: { pBuf = ImplAddNum( pBuf, nMonth, 2 ); pBuf = ImplAddString( pBuf, aDateSep ); @@ -1210,10 +1210,10 @@ OUString DateFormatter::ImplGetDateAsText( const Date& rDate, pBuf = ImplAddSNum( pBuf, nYear, nYearLen ); } break; - case XTDATEF_SHORT_YYMMDD: - case XTDATEF_SHORT_YYYYMMDD: - case XTDATEF_SHORT_YYMMDD_DIN5008: - case XTDATEF_SHORT_YYYYMMDD_DIN5008: + case ExtDateFieldFormat::ShortYYMMDD: + case ExtDateFieldFormat::ShortYYYYMMDD: + case ExtDateFieldFormat::ShortYYMMDD_DIN5008: + case ExtDateFieldFormat::ShortYYYYMMDD_DIN5008: { pBuf = ImplAddSNum( pBuf, nYear, nYearLen ); pBuf = ImplAddString( pBuf, aDateSep ); @@ -1338,7 +1338,7 @@ void DateField::ImplDateSpinArea( bool bUp ) sal_Int8 nDateArea = 0; ExtDateFieldFormat eFormat = GetExtDateFormat( true ); - if ( eFormat == XTDATEF_SYSTEM_LONG ) + if ( eFormat == ExtDateFieldFormat::SystemLong ) { eFormat = ImplGetExtFormat( ImplGetLocaleDataWrapper().getLongDateFormat() ); nDateArea = 1; @@ -1363,8 +1363,8 @@ void DateField::ImplDateSpinArea( bool bUp ) switch( eFormat ) { - case XTDATEF_SHORT_MMDDYY: - case XTDATEF_SHORT_MMDDYYYY: + case ExtDateFieldFormat::ShortMMDDYY: + case ExtDateFieldFormat::ShortMMDDYYYY: switch( nDateArea ) { case 1: ImplDateIncrementMonth( aDate, bUp ); @@ -1375,8 +1375,8 @@ void DateField::ImplDateSpinArea( bool bUp ) break; } break; - case XTDATEF_SHORT_DDMMYY: - case XTDATEF_SHORT_DDMMYYYY: + case ExtDateFieldFormat::ShortDDMMYY: + case ExtDateFieldFormat::ShortDDMMYYYY: switch( nDateArea ) { case 1: ImplDateIncrementDay( aDate, bUp ); @@ -1387,10 +1387,10 @@ void DateField::ImplDateSpinArea( bool bUp ) break; } break; - case XTDATEF_SHORT_YYMMDD: - case XTDATEF_SHORT_YYYYMMDD: - case XTDATEF_SHORT_YYMMDD_DIN5008: - case XTDATEF_SHORT_YYYYMMDD_DIN5008: + case ExtDateFieldFormat::ShortYYMMDD: + case ExtDateFieldFormat::ShortYYYYMMDD: + case ExtDateFieldFormat::ShortYYMMDD_DIN5008: + case ExtDateFieldFormat::ShortYYYYMMDD_DIN5008: switch( nDateArea ) { case 1: ImplDateIncrementYear( aDate, bUp ); @@ -1417,7 +1417,7 @@ void DateFormatter::ImplInit() mbShowDateCentury = true; mpCalendarWrapper = nullptr; mnDateFormat = 0xFFFF; - mnExtDateFormat = XTDATEF_SYSTEM_SHORT; + mnExtDateFormat = ExtDateFieldFormat::SystemShort; } DateFormatter::DateFormatter() : @@ -1464,16 +1464,16 @@ ExtDateFieldFormat DateFormatter::GetExtDateFormat( bool bResolveSystemFormat ) { ExtDateFieldFormat eDateFormat = (ExtDateFieldFormat)mnExtDateFormat; - if ( bResolveSystemFormat && ( eDateFormat <= XTDATEF_SYSTEM_SHORT_YYYY ) ) + if ( bResolveSystemFormat && ( eDateFormat <= ExtDateFieldFormat::SystemShortYYYY ) ) { - bool bShowCentury = (eDateFormat == XTDATEF_SYSTEM_SHORT_YYYY); + bool bShowCentury = (eDateFormat == ExtDateFieldFormat::SystemShortYYYY); switch ( ImplGetLocaleDataWrapper().getDateFormat() ) { - case DMY: eDateFormat = bShowCentury ? XTDATEF_SHORT_DDMMYYYY : XTDATEF_SHORT_DDMMYY; + case DMY: eDateFormat = bShowCentury ? ExtDateFieldFormat::ShortDDMMYYYY : ExtDateFieldFormat::ShortDDMMYY; break; - case MDY: eDateFormat = bShowCentury ? XTDATEF_SHORT_MMDDYYYY : XTDATEF_SHORT_MMDDYY; + case MDY: eDateFormat = bShowCentury ? ExtDateFieldFormat::ShortMMDDYYYY : ExtDateFieldFormat::ShortMMDDYY; break; - default: eDateFormat = bShowCentury ? XTDATEF_SHORT_YYYYMMDD : XTDATEF_SHORT_YYMMDD; + default: eDateFormat = bShowCentury ? ExtDateFieldFormat::ShortYYYYMMDD : ExtDateFieldFormat::ShortYYMMDD; } } @@ -1507,12 +1507,12 @@ void DateFormatter::SetLongFormat( bool bLong ) // #91913# Remove LongFormat and DateShowCentury - redundant if ( bLong ) { - SetExtDateFormat( XTDATEF_SYSTEM_LONG ); + SetExtDateFormat( ExtDateFieldFormat::SystemLong ); } else { - if( mnExtDateFormat == XTDATEF_SYSTEM_LONG ) - SetExtDateFormat( XTDATEF_SYSTEM_SHORT ); + if( mnExtDateFormat == ExtDateFieldFormat::SystemLong ) + SetExtDateFormat( ExtDateFieldFormat::SystemShort ); } ReformatAll(); @@ -1527,17 +1527,17 @@ void DateFormatter::SetShowDateCentury( bool bShowDateCentury ) { switch ( GetExtDateFormat() ) { - case XTDATEF_SYSTEM_SHORT: - case XTDATEF_SYSTEM_SHORT_YY: - SetExtDateFormat( XTDATEF_SYSTEM_SHORT_YYYY ); break; - case XTDATEF_SHORT_DDMMYY: - SetExtDateFormat( XTDATEF_SHORT_DDMMYYYY ); break; - case XTDATEF_SHORT_MMDDYY: - SetExtDateFormat( XTDATEF_SHORT_MMDDYYYY ); break; - case XTDATEF_SHORT_YYMMDD: - SetExtDateFormat( XTDATEF_SHORT_YYYYMMDD ); break; - case XTDATEF_SHORT_YYMMDD_DIN5008: - SetExtDateFormat( XTDATEF_SHORT_YYYYMMDD_DIN5008 ); break; + case ExtDateFieldFormat::SystemShort: + case ExtDateFieldFormat::SystemShortYY: + SetExtDateFormat( ExtDateFieldFormat::SystemShortYYYY ); break; + case ExtDateFieldFormat::ShortDDMMYY: + SetExtDateFormat( ExtDateFieldFormat::ShortDDMMYYYY ); break; + case ExtDateFieldFormat::ShortMMDDYY: + SetExtDateFormat( ExtDateFieldFormat::ShortMMDDYYYY ); break; + case ExtDateFieldFormat::ShortYYMMDD: + SetExtDateFormat( ExtDateFieldFormat::ShortYYYYMMDD ); break; + case ExtDateFieldFormat::ShortYYMMDD_DIN5008: + SetExtDateFormat( ExtDateFieldFormat::ShortYYYYMMDD_DIN5008 ); break; default: ; } @@ -1546,17 +1546,17 @@ void DateFormatter::SetShowDateCentury( bool bShowDateCentury ) { switch ( GetExtDateFormat() ) { - case XTDATEF_SYSTEM_SHORT: - case XTDATEF_SYSTEM_SHORT_YYYY: - SetExtDateFormat( XTDATEF_SYSTEM_SHORT_YY ); break; - case XTDATEF_SHORT_DDMMYYYY: - SetExtDateFormat( XTDATEF_SHORT_DDMMYY ); break; - case XTDATEF_SHORT_MMDDYYYY: - SetExtDateFormat( XTDATEF_SHORT_MMDDYY ); break; ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
