diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-13 14:23:36 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-16 06:41:49 +0000 |
commit | 34178c86ce4439e39464084d1a17ac07f330a0e9 (patch) | |
tree | f8ce065ecb878607570d4b61bdea3646c4412573 /svx | |
parent | 58944b5c6e49023d93f08e9e18eaa47f445dc5f8 (diff) |
convert GALLERY_ITEM to scoped enum
Change-Id: I7b3b2b72baf58cd7713418ea36d6a2fe6e0e12e9
Reviewed-on: https://gerrit.libreoffice.org/24962
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/galbrws2.hxx | 15 | ||||
-rw-r--r-- | svx/source/gallery2/galbrws2.cxx | 14 | ||||
-rw-r--r-- | svx/source/gallery2/galctrl.cxx | 8 |
3 files changed, 21 insertions, 16 deletions
diff --git a/svx/inc/galbrws2.hxx b/svx/inc/galbrws2.hxx index c0556f8081f2..dd3d0b038502 100644 --- a/svx/inc/galbrws2.hxx +++ b/svx/inc/galbrws2.hxx @@ -53,10 +53,15 @@ enum GalleryBrowserTravel GALLERYBROWSERTRAVEL_NEXT = 4 }; - -#define GALLERY_ITEM_THEMENAME 0x00000001 -#define GALLERY_ITEM_TITLE 0x00000002 -#define GALLERY_ITEM_PATH 0x00000004 +enum class GalleryItemFlags { + ThemeName = 0x0001, + Title = 0x0002, + Path = 0x0004 +}; +namespace o3tl +{ + template<> struct typed_flags<GalleryItemFlags> : is_typed_flags<GalleryItemFlags, 0x0007> {}; +} class GalleryToolBox : public ToolBox @@ -132,7 +137,7 @@ private: public: - static OUString GetItemText( const GalleryTheme& rTheme, const SgaObject& rObj, sal_uIntPtr nItemTextFlags ); + static OUString GetItemText( const GalleryTheme& rTheme, const SgaObject& rObj, GalleryItemFlags nItemTextFlags ); public: diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index d9e7ca056dba..d942ba69e7bc 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -1173,7 +1173,7 @@ void GalleryBrowser2::Execute( sal_uInt16 nId ) if( pObj ) { - const OUString aOldTitle( GetItemText( *mpCurTheme, *pObj, GALLERY_ITEM_TITLE ) ); + const OUString aOldTitle( GetItemText( *mpCurTheme, *pObj, GalleryItemFlags::Title ) ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) @@ -1235,19 +1235,19 @@ void GalleryBrowser2::Execute( sal_uInt16 nId ) } } -OUString GalleryBrowser2::GetItemText( const GalleryTheme& rTheme, const SgaObject& rObj, sal_uIntPtr nItemTextFlags ) +OUString GalleryBrowser2::GetItemText( const GalleryTheme& rTheme, const SgaObject& rObj, GalleryItemFlags nItemTextFlags ) { OUString aRet; const INetURLObject& aURL(rObj.GetURL()); - if( nItemTextFlags & GALLERY_ITEM_THEMENAME ) + if( nItemTextFlags & GalleryItemFlags::ThemeName ) { aRet += rTheme.GetName(); aRet += " - "; } - if( nItemTextFlags & GALLERY_ITEM_TITLE ) + if( nItemTextFlags & GalleryItemFlags::Title ) { OUString aTitle( rObj.GetTitle() ); @@ -1263,16 +1263,16 @@ OUString GalleryBrowser2::GetItemText( const GalleryTheme& rTheme, const SgaObje aRet += aTitle; } - if( nItemTextFlags & GALLERY_ITEM_PATH ) + if( nItemTextFlags & GalleryItemFlags::Path ) { const OUString aPath( aURL.getFSysPath( INetURLObject::FSYS_DETECT ) ); - if( !aPath.isEmpty() && ( nItemTextFlags & GALLERY_ITEM_TITLE ) ) + if( !aPath.isEmpty() && ( nItemTextFlags & GalleryItemFlags::Title ) ) aRet += " ("; aRet += aURL.getFSysPath( INetURLObject::FSYS_DETECT ); - if( !aPath.isEmpty() && ( nItemTextFlags & GALLERY_ITEM_TITLE ) ) + if( !aPath.isEmpty() && ( nItemTextFlags & GalleryItemFlags::Title ) ) aRet += ")"; } diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index 22714c929aa1..e5436375fcc5 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -332,7 +332,7 @@ void GalleryIconView::UserDraw(const UserDrawEvent& rUDEvt) if(pObj) { aBitmapEx = pObj->createPreviewBitmapEx(aSize); - aItemTextTitle = GalleryBrowser2::GetItemText(*mpTheme, *pObj, GALLERY_ITEM_TITLE); + aItemTextTitle = GalleryBrowser2::GetItemText(*mpTheme, *pObj, GalleryItemFlags::Title); mpTheme->SetPreviewBitmapExAndStrings(nId - 1, aBitmapEx, aSize, aItemTextTitle, aItemTextPath); GalleryTheme::ReleaseObject(pObj); @@ -450,7 +450,7 @@ OUString GalleryListView::GetCellText(long _nRow, sal_uInt16 /*nColumnId*/) cons if( pObj ) { - sRet = GalleryBrowser2::GetItemText( *mpTheme, *pObj, GALLERY_ITEM_TITLE ); + sRet = GalleryBrowser2::GetItemText( *mpTheme, *pObj, GalleryItemFlags::Title ); GalleryTheme::ReleaseObject( pObj ); } } @@ -515,8 +515,8 @@ void GalleryListView::PaintField(vcl::RenderContext& rDev, const Rectangle& rRec if(pObj) { aBitmapEx = pObj->createPreviewBitmapEx(aSize); - aItemTextTitle = GalleryBrowser2::GetItemText(*mpTheme, *pObj, GALLERY_ITEM_TITLE); - aItemTextPath = GalleryBrowser2::GetItemText(*mpTheme, *pObj, GALLERY_ITEM_PATH); + aItemTextTitle = GalleryBrowser2::GetItemText(*mpTheme, *pObj, GalleryItemFlags::Title); + aItemTextPath = GalleryBrowser2::GetItemText(*mpTheme, *pObj, GalleryItemFlags::Path); mpTheme->SetPreviewBitmapExAndStrings(mnCurRow, aBitmapEx, aSize, aItemTextTitle, aItemTextPath); GalleryTheme::ReleaseObject(pObj); |