summaryrefslogtreecommitdiff
path: root/sfx2/source/control
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-09-14 19:33:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-09-14 20:05:29 +0000
commit0f33526ec27a3abcfa1ca9348a46238b1432e5e4 (patch)
tree07b13b44a6c106275593fa7351f12dda62be9b68 /sfx2/source/control
parentbee4ff508a456a1552aacdf6fc838b8b7cffb9ec (diff)
put all SfxShell feature flags in one typed_flags class
make values unique across modules. check if flag used in correct module. Change-Id: I656ffd3d527dd895777e14e1cc933c8b9b3f6e46 Reviewed-on: https://gerrit.libreoffice.org/28906 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/control')
-rw-r--r--sfx2/source/control/dispatch.cxx8
-rw-r--r--sfx2/source/control/objface.cxx20
-rw-r--r--sfx2/source/control/shell.cxx2
3 files changed, 15 insertions, 15 deletions
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index a83c6cb8361a..7357d79780c2 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1397,8 +1397,8 @@ void SfxDispatcher::Update_Impl_( bool bUIActive, bool bIsMDIApp, bool bIsIPOwne
continue;
// check whether toolbar needs activation of a special feature
- sal_uInt32 nFeature = pIFace->GetObjectBarFeature(nNo);
- if ( nFeature && !pShell->HasUIFeature( nFeature ) )
+ SfxShellFeature nFeature = pIFace->GetObjectBarFeature(nNo);
+ if ((nFeature != SfxShellFeature::NONE) && !pShell->HasUIFeature(nFeature))
continue;
// check for toolboxes that are exclusively for a viewer
@@ -1443,8 +1443,8 @@ void SfxDispatcher::Update_Impl_( bool bUIActive, bool bIsMDIApp, bool bIsIPOwne
continue;
}
- sal_uInt32 nFeature = pIFace->GetChildWindowFeature(nNo);
- if ( nFeature && !pShell->HasUIFeature( nFeature ) )
+ SfxShellFeature nFeature = pIFace->GetChildWindowFeature(nNo);
+ if ((nFeature != SfxShellFeature::NONE) && !pShell->HasUIFeature(nFeature))
continue;
// slot decides whether a ChildWindow is shown when document is OLE server or OLE client
diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx
index 49983e40d2f0..495374b16065 100644
--- a/sfx2/source/control/objface.cxx
+++ b/sfx2/source/control/objface.cxx
@@ -56,9 +56,9 @@ struct SfxObjectUI_Impl
sal_uInt16 nPos;
sal_uInt32 nResId;
bool bContext;
- sal_uInt32 nFeature;
+ SfxShellFeature nFeature;
- SfxObjectUI_Impl(sal_uInt16 n, sal_uInt32 nId, sal_uInt32 nFeat) :
+ SfxObjectUI_Impl(sal_uInt16 n, sal_uInt32 nId, SfxShellFeature nFeat) :
nPos(n),
nResId(nId),
bContext(false),
@@ -95,7 +95,7 @@ struct SfxInterface_Impl
}
};
-static SfxObjectUI_Impl* CreateObjectBarUI_Impl(sal_uInt16 nPos, sal_uInt32 nResId, sal_uInt32 nFeature);
+static SfxObjectUI_Impl* CreateObjectBarUI_Impl(sal_uInt16 nPos, sal_uInt32 nResId, SfxShellFeature nFeature);
// constuctor, registeres a new unit
SfxInterface::SfxInterface( const char *pClassName,
@@ -362,17 +362,17 @@ void SfxInterface::RegisterPopupMenu( const OUString& rResourceName )
void SfxInterface::RegisterObjectBar(sal_uInt16 nPos, sal_uInt32 nResId)
{
- RegisterObjectBar(nPos, nResId, 0UL);
+ RegisterObjectBar(nPos, nResId, SfxShellFeature::NONE);
}
-void SfxInterface::RegisterObjectBar(sal_uInt16 nPos, sal_uInt32 nResId, sal_uInt32 nFeature)
+void SfxInterface::RegisterObjectBar(sal_uInt16 nPos, sal_uInt32 nResId, SfxShellFeature nFeature)
{
SfxObjectUI_Impl* pUI = CreateObjectBarUI_Impl(nPos, nResId, nFeature);
if ( pUI )
pImplData->aObjectBars.push_back(pUI);
}
-SfxObjectUI_Impl* CreateObjectBarUI_Impl(sal_uInt16 nPos, sal_uInt32 nResId, sal_uInt32 nFeature)
+SfxObjectUI_Impl* CreateObjectBarUI_Impl(sal_uInt16 nPos, sal_uInt32 nResId, SfxShellFeature nFeature)
{
if ((nPos & SFX_VISIBILITY_MASK) == 0)
nPos |= SFX_VISIBILITY_STANDARD;
@@ -428,10 +428,10 @@ sal_uInt16 SfxInterface::GetObjectBarCount() const
void SfxInterface::RegisterChildWindow(sal_uInt16 nId, bool bContext)
{
- RegisterChildWindow(nId, bContext, 0UL);
+ RegisterChildWindow(nId, bContext, SfxShellFeature::NONE);
}
-void SfxInterface::RegisterChildWindow(sal_uInt16 nId, bool bContext, sal_uInt32 nFeature)
+void SfxInterface::RegisterChildWindow(sal_uInt16 nId, bool bContext, SfxShellFeature nFeature)
{
SfxObjectUI_Impl* pUI = new SfxObjectUI_Impl(0, nId, nFeature);
pUI->bContext = bContext;
@@ -464,7 +464,7 @@ sal_uInt32 SfxInterface::GetChildWindowId (sal_uInt16 nNo) const
return nRet;
}
-sal_uInt32 SfxInterface::GetChildWindowFeature (sal_uInt16 nNo) const
+SfxShellFeature SfxInterface::GetChildWindowFeature (sal_uInt16 nNo) const
{
if ( pGenoType )
{
@@ -504,7 +504,7 @@ sal_uInt32 SfxInterface::GetStatusBarId() const
return pImplData->nStatBarResId;
}
-sal_uInt32 SfxInterface::GetObjectBarFeature ( sal_uInt16 nNo ) const
+SfxShellFeature SfxInterface::GetObjectBarFeature ( sal_uInt16 nNo ) const
{
bool bGenoType = (pGenoType != nullptr && pGenoType->UseAsSuperClass());
if ( bGenoType )
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index c2b903f09dff..4703f7921972 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -657,7 +657,7 @@ SfxObjectShell* SfxShell::GetObjectShell()
return nullptr;
}
-bool SfxShell::HasUIFeature( sal_uInt32 )
+bool SfxShell::HasUIFeature(SfxShellFeature) const
{
return false;
}