Kaydet (Commit) 9905f055 authored tarafından Noel Grandin's avatar Noel Grandin

convert SFX_TOOLBOX_ constants to scoped enum

and move them to a more logical header

Change-Id: I56956969d3067d66ccdadd53cd5630409de16cd8
üst 321d924f
...@@ -21,14 +21,28 @@ ...@@ -21,14 +21,28 @@
#define INCLUDED_SFX2_IMGMGR_HXX #define INCLUDED_SFX2_IMGMGR_HXX
#include <sal/config.h> #include <sal/config.h>
#include <sfx2/dllapi.h>
#include <sal/types.h> #include <sal/types.h>
#include <o3tl/typed_flags_set.hxx>
#include <sfx2/dllapi.h>
#include <vcl/image.hxx> #include <vcl/image.hxx>
class ToolBox; class ToolBox;
class SfxModule; class SfxModule;
class SfxImageManager_Impl; class SfxImageManager_Impl;
enum class SfxToolboxFlags
{
CHANGESYMBOLSET = 0x01,
CHANGEOUTSTYLE = 0x02,
ALL = CHANGESYMBOLSET | CHANGEOUTSTYLE,
};
namespace o3tl
{
template<> struct typed_flags<SfxToolboxFlags> : is_typed_flags<SfxToolboxFlags, 0x03> {};
}
class SFX2_DLLPUBLIC SfxImageManager class SFX2_DLLPUBLIC SfxImageManager
{ {
SfxImageManager_Impl* pImp; SfxImageManager_Impl* pImp;
...@@ -39,7 +53,7 @@ public: ...@@ -39,7 +53,7 @@ public:
SfxImageManager(SfxModule& rModule); SfxImageManager(SfxModule& rModule);
~SfxImageManager(); ~SfxImageManager();
void RegisterToolBox( ToolBox *pBox, sal_uInt16 nFlags=0xFFFF); void RegisterToolBox( ToolBox *pBox, SfxToolboxFlags nFlags=SfxToolboxFlags::ALL);
void ReleaseToolBox( ToolBox *pBox ); void ReleaseToolBox( ToolBox *pBox );
Image GetImage( sal_uInt16 nId, bool bLarge ) const; Image GetImage( sal_uInt16 nId, bool bLarge ) const;
......
...@@ -27,9 +27,6 @@ enum SfxSymbolsSize ...@@ -27,9 +27,6 @@ enum SfxSymbolsSize
SFX_SYMBOLS_SIZE_AUTO SFX_SYMBOLS_SIZE_AUTO
}; };
#define SFX_TOOLBOX_CHANGESYMBOLSET 0x0001
#define SFX_TOOLBOX_CHANGEOUTSTYLE 0x0002
#endif // INCLUDED_SVTOOLS_IMGDEF_HXX #endif // INCLUDED_SVTOOLS_IMGDEF_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -45,8 +45,8 @@ const sal_uInt32 IMAGELIST_COUNT = 4; // small, small-hi, large, large-hi ...@@ -45,8 +45,8 @@ const sal_uInt32 IMAGELIST_COUNT = 4; // small, small-hi, large, large-hi
struct ToolBoxInf_Impl struct ToolBoxInf_Impl
{ {
ToolBox* pToolBox; ToolBox* pToolBox;
sal_uInt16 nFlags; SfxToolboxFlags nFlags;
}; };
class SfxImageManager_Impl class SfxImageManager_Impl
...@@ -167,7 +167,7 @@ void SfxImageManager_Impl::SetSymbolsSize_Impl( sal_Int16 nNewSymbolsSize ) ...@@ -167,7 +167,7 @@ void SfxImageManager_Impl::SetSymbolsSize_Impl( sal_Int16 nNewSymbolsSize )
for ( sal_uInt32 n=0; n < m_aToolBoxes.size(); n++ ) for ( sal_uInt32 n=0; n < m_aToolBoxes.size(); n++ )
{ {
ToolBoxInf_Impl *pInf = m_aToolBoxes[n]; ToolBoxInf_Impl *pInf = m_aToolBoxes[n];
if ( pInf->nFlags & SFX_TOOLBOX_CHANGESYMBOLSET ) if ( pInf->nFlags & SfxToolboxFlags::CHANGESYMBOLSET )
{ {
ToolBox *pBox = pInf->pToolBox; ToolBox *pBox = pInf->pToolBox;
sal_uInt16 nCount = pBox->GetItemCount(); sal_uInt16 nCount = pBox->GetItemCount();
...@@ -300,7 +300,7 @@ Image SfxImageManager::SeekImage( sal_uInt16 nId ) const ...@@ -300,7 +300,7 @@ Image SfxImageManager::SeekImage( sal_uInt16 nId ) const
return SeekImage( nId, bLarge ); return SeekImage( nId, bLarge );
} }
void SfxImageManager::RegisterToolBox( ToolBox *pBox, sal_uInt16 nFlags ) void SfxImageManager::RegisterToolBox( ToolBox *pBox, SfxToolboxFlags nFlags )
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
......
...@@ -803,8 +803,8 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings, ...@@ -803,8 +803,8 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
if ( pCreateView ) if ( pCreateView )
StartListening(*pCreateView); StartListening(*pCreateView);
SfxImageManager* pImgMan = SfxImageManager::GetImageManager(*SW_MOD()); SfxImageManager* pImgMan = SfxImageManager::GetImageManager(*SW_MOD());
pImgMan->RegisterToolBox(&aContentToolBox, SFX_TOOLBOX_CHANGEOUTSTYLE); pImgMan->RegisterToolBox(&aContentToolBox, SfxToolboxFlags::CHANGEOUTSTYLE);
pImgMan->RegisterToolBox(&aGlobalToolBox, SFX_TOOLBOX_CHANGEOUTSTYLE); pImgMan->RegisterToolBox(&aGlobalToolBox, SfxToolboxFlags::CHANGEOUTSTYLE);
aContentToolBox.SetItemBits( FN_CREATE_NAVIGATION, aContentToolBox.GetItemBits( FN_CREATE_NAVIGATION ) | ToolBoxItemBits::DROPDOWNONLY ); aContentToolBox.SetItemBits( FN_CREATE_NAVIGATION, aContentToolBox.GetItemBits( FN_CREATE_NAVIGATION ) | ToolBoxItemBits::DROPDOWNONLY );
aContentToolBox.SetItemBits( FN_DROP_REGION, aContentToolBox.GetItemBits( FN_DROP_REGION ) | ToolBoxItemBits::DROPDOWNONLY ); aContentToolBox.SetItemBits( FN_DROP_REGION, aContentToolBox.GetItemBits( FN_DROP_REGION ) | ToolBoxItemBits::DROPDOWNONLY );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment