summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basctl/source/basicide/basdoc.cxx2
-rw-r--r--include/sfx2/objsh.hxx27
-rw-r--r--sc/source/ui/docshell/docsh.cxx2
-rw-r--r--sd/source/ui/docshell/docshell.cxx2
-rw-r--r--sd/source/ui/docshell/grdocsh.cxx2
-rw-r--r--sfx2/source/doc/objmisc.cxx4
-rw-r--r--sfx2/source/doc/objserv.cxx4
-rw-r--r--sfx2/source/doc/objxtor.cxx2
-rw-r--r--sfx2/source/view/viewfrm2.cxx2
-rw-r--r--starmath/source/document.cxx2
-rw-r--r--sw/source/uibase/app/docsh.cxx2
-rw-r--r--sw/source/uibase/globdoc/globdoc.cxx2
-rw-r--r--sw/source/uibase/web/wdocsh.cxx2
13 files changed, 31 insertions, 24 deletions
diff --git a/basctl/source/basicide/basdoc.cxx b/basctl/source/basicide/basdoc.cxx
index 0a3e172e5f46..7f0388960c11 100644
--- a/basctl/source/basicide/basdoc.cxx
+++ b/basctl/source/basicide/basdoc.cxx
@@ -34,7 +34,7 @@ namespace basctl
TYPEINIT1(DocShell, SfxObjectShell);
-SFX_IMPL_OBJECTFACTORY( DocShell, SvGlobalName(), SFXOBJECTSHELL_STD_NORMAL, "sbasic" )
+SFX_IMPL_OBJECTFACTORY( DocShell, SvGlobalName(), SfxObjectShellFlags::STD_NORMAL, "sbasic" )
SFX_IMPL_SUPERCLASS_INTERFACE(basctl_DocShell, SfxObjectShell)
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 0bf721e88e30..b92656e7101c 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -47,6 +47,7 @@
#include <com/sun/star/frame/XModel.hpp>
#include <memory>
#include <set>
+#include <o3tl/typed_flags_set.hxx>
class SbxValue;
class SvxMacro;
@@ -108,15 +109,21 @@ namespace com { namespace sun { namespace star {
}
} } }
-typedef sal_uInt32 SfxObjectShellFlags;
-#define SFXOBJECTSHELL_HASOPENDOC 0x01L
-#define SFXOBJECTSHELL_HASMENU 0x04L
-#define SFXOBJECTSHELL_DONTLOADFILTERS 0x08L
-#define SFXOBJECTSHELL_DONTCLOSE 0x10L
-#define SFXOBJECTSHELL_NODOCINFO 0x20L
-#define SFXOBJECTSHELL_STD_NORMAL ( SFXOBJECTSHELL_HASOPENDOC )
-#define SFXOBJECTSHELL_STD_SPECIAL ( SFXOBJECTSHELL_DONTLOADFILTERS )
-#define SFXOBJECTSHELL_UNDEFINED 0xf000000
+enum class SfxObjectShellFlags
+{
+ HASOPENDOC = 0x01L,
+ HASMENU = 0x04L,
+ DONTLOADFILTERS = 0x08L,
+ DONTCLOSE = 0x10L,
+ NODOCINFO = 0x20L,
+ STD_NORMAL = HASOPENDOC,
+ STD_SPECIAL = DONTLOADFILTERS,
+ UNDEFINED = 0xf000000
+};
+namespace o3tl
+{
+ template<> struct typed_flags<SfxObjectShellFlags> : is_typed_flags<SfxObjectShellFlags, 0xf00003d> {};
+}
#define SFX_TITLE_TITLE 0
#define SFX_TITLE_FILENAME 1
@@ -236,7 +243,7 @@ public:
virtual void Invalidate(sal_uInt16 nId = 0) SAL_OVERRIDE;
- SfxObjectShellFlags GetFlags( ) const ;
+ SfxObjectShellFlags GetFlags( ) const;
SfxModule* GetModule() const;
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index bbed5ae8e479..2ecbb0c90351 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -173,7 +173,7 @@ void ScDocShell::InitInterface_Impl()
}
// GlobalName of the current version:
-SFX_IMPL_OBJECTFACTORY( ScDocShell, SvGlobalName(SO3_SC_CLASSID), SFXOBJECTSHELL_STD_NORMAL, "scalc" )
+SFX_IMPL_OBJECTFACTORY( ScDocShell, SvGlobalName(SO3_SC_CLASSID), SfxObjectShellFlags::STD_NORMAL, "scalc" )
TYPEINIT1( ScDocShell, SfxObjectShell ); // SfxInPlaceObject: No TypeInfo?
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx
index db475df23123..b848becc4ffb 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -89,7 +89,7 @@ TYPEINIT1( DrawDocShell, SfxObjectShell );
SFX_IMPL_OBJECTFACTORY(
DrawDocShell,
SvGlobalName(SO3_SIMPRESS_CLASSID),
- SFXOBJECTSHELL_STD_NORMAL,
+ SfxObjectShellFlags::STD_NORMAL,
"simpress" )
void DrawDocShell::Construct( bool bClipboard )
diff --git a/sd/source/ui/docshell/grdocsh.cxx b/sd/source/ui/docshell/grdocsh.cxx
index ac885351d93c..0da31b4f6d9b 100644
--- a/sd/source/ui/docshell/grdocsh.cxx
+++ b/sd/source/ui/docshell/grdocsh.cxx
@@ -50,7 +50,7 @@ void GraphicDocShell::InitInterface_Impl()
GetStaticInterface()->RegisterChildWindow(SID_SEARCH_DLG);
}
-SFX_IMPL_OBJECTFACTORY( GraphicDocShell, SvGlobalName(SO3_SDRAW_CLASSID_60), SFXOBJECTSHELL_STD_NORMAL, "sdraw" )
+SFX_IMPL_OBJECTFACTORY( GraphicDocShell, SvGlobalName(SO3_SDRAW_CLASSID_60), SfxObjectShellFlags::STD_NORMAL, "sdraw" )
GraphicDocShell::GraphicDocShell(SfxObjectCreateMode eMode,
bool bDataObject,
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 3b598e737a3a..7d751182b365 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1041,7 +1041,7 @@ void SfxObjectShell::PostActivateEvent_Impl( SfxViewFrame* pFrame )
void SfxObjectShell::SetActivateEvent_Impl(sal_uInt16 nId )
{
- if ( GetFactory().GetFlags() & SFXOBJECTSHELL_HASOPENDOC )
+ if ( GetFactory().GetFlags() & SfxObjectShellFlags::HASOPENDOC )
pImp->nEventId = nId;
}
@@ -1596,7 +1596,7 @@ ErrCode SfxObjectShell::CallXScript( const OUString& rScriptURL,
SfxObjectShellFlags SfxObjectShell::GetFlags() const
{
- if( pImp->eFlags == SFXOBJECTSHELL_UNDEFINED )
+ if( pImp->eFlags == SfxObjectShellFlags::UNDEFINED )
pImp->eFlags = GetFactory().GetFlags();
return pImp->eFlags;
}
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 03b4e3a10bc7..1a10c396a38a 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1024,7 +1024,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
break;
case SID_DOCINFO:
- if ( 0 != ( pImp->eFlags & SFXOBJECTSHELL_NODOCINFO ) )
+ if ( pImp->eFlags & SfxObjectShellFlags::NODOCINFO )
rSet.DisableItem( nWhich );
break;
@@ -1041,7 +1041,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
pDoc = pFrame->GetTopViewFrame()->GetObjectShell();
}
- if ( pDoc->GetFlags() & SFXOBJECTSHELL_DONTCLOSE )
+ if ( pDoc->GetFlags() & SfxObjectShellFlags::DONTCLOSE )
rSet.DisableItem(nWhich);
else
rSet.Put(SfxStringItem(nWhich, SfxResId(STR_CLOSEDOC).toString()));
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 2cc18f17f0cc..67504bcef382 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -253,7 +253,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,bReloadAvailable( false )
,nAutoLoadLocks( 0 )
,pModule( 0 )
- ,eFlags( SFXOBJECTSHELL_UNDEFINED )
+ ,eFlags( SfxObjectShellFlags::UNDEFINED )
,bReadOnlyUI( false )
,nStyleFilter( 0 )
,bDisposing( false )
diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx
index 8c2ba6e7f9ff..bdc0dee0bb50 100644
--- a/sfx2/source/view/viewfrm2.cxx
+++ b/sfx2/source/view/viewfrm2.cxx
@@ -379,7 +379,7 @@ void SfxViewFrame::INetState_Impl( SfxItemSet &rItemSet )
// Add/SaveToBookmark at BASIC-IDE, QUERY-EDITOR etc. disable
SfxObjectShell *pDocSh = GetObjectShell();
- bool bPseudo = pDocSh && !( pDocSh->GetFactory().GetFlags() & SFXOBJECTSHELL_HASOPENDOC );
+ bool bPseudo = pDocSh && !( pDocSh->GetFactory().GetFlags() & SfxObjectShellFlags::HASOPENDOC );
bool bEmbedded = pDocSh && pDocSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED;
if ( !pDocSh || bPseudo || bEmbedded || !pDocSh->HasName() )
rItemSet.DisableItem( SID_CREATELINK );
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index b6d37ac4d197..c1112450fe17 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -115,7 +115,7 @@ void SmDocShell::InitInterface_Impl()
GetStaticInterface()->RegisterPopupMenu(SmResId(RID_COMMANDMENU));
}
-SFX_IMPL_OBJECTFACTORY(SmDocShell, SvGlobalName(SO3_SM_CLASSID), SFXOBJECTSHELL_STD_NORMAL, "smath" )
+SFX_IMPL_OBJECTFACTORY(SmDocShell, SvGlobalName(SO3_SM_CLASSID), SfxObjectShellFlags::STD_NORMAL, "smath" )
void SmDocShell::SFX_NOTIFY(SfxBroadcaster&, const TypeId&,
const SfxHint& rHint, const TypeId&)
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index a6883f8bb3e0..a6d173954fa1 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -134,7 +134,7 @@ void SwDocShell::InitInterface_Impl()
TYPEINIT2(SwDocShell, SfxObjectShell, SfxListener);
-SFX_IMPL_OBJECTFACTORY(SwDocShell, SvGlobalName(SO3_SW_CLASSID), SFXOBJECTSHELL_STD_NORMAL|SFXOBJECTSHELL_HASMENU, "swriter" )
+SFX_IMPL_OBJECTFACTORY(SwDocShell, SvGlobalName(SO3_SW_CLASSID), SfxObjectShellFlags::STD_NORMAL|SfxObjectShellFlags::HASMENU, "swriter" )
bool SwDocShell::InsertGeneratedStream(SfxMedium & rMedium,
uno::Reference<text::XTextRange> const& xInsertPosition)
diff --git a/sw/source/uibase/globdoc/globdoc.cxx b/sw/source/uibase/globdoc/globdoc.cxx
index 22684610461c..7e9a6c78236d 100644
--- a/sw/source/uibase/globdoc/globdoc.cxx
+++ b/sw/source/uibase/globdoc/globdoc.cxx
@@ -32,7 +32,7 @@
TYPEINIT1(SwGlobalDocShell, SwDocShell);
-SFX_IMPL_OBJECTFACTORY( SwGlobalDocShell, SvGlobalName(SO3_SWGLOB_CLASSID), SFXOBJECTSHELL_STD_NORMAL|SFXOBJECTSHELL_HASMENU, "swriter/GlobalDocument" )
+SFX_IMPL_OBJECTFACTORY( SwGlobalDocShell, SvGlobalName(SO3_SWGLOB_CLASSID), SfxObjectShellFlags::STD_NORMAL|SfxObjectShellFlags::HASMENU, "swriter/GlobalDocument" )
SwGlobalDocShell::SwGlobalDocShell(SfxObjectCreateMode eMode ) :
SwDocShell(eMode)
diff --git a/sw/source/uibase/web/wdocsh.cxx b/sw/source/uibase/web/wdocsh.cxx
index b4e7a36466b9..e5ba996d5383 100644
--- a/sw/source/uibase/web/wdocsh.cxx
+++ b/sw/source/uibase/web/wdocsh.cxx
@@ -49,7 +49,7 @@ void SwWebDocShell::InitInterface_Impl()
TYPEINIT1(SwWebDocShell, SwDocShell);
-SFX_IMPL_OBJECTFACTORY(SwWebDocShell, SvGlobalName(SO3_SWWEB_CLASSID), SFXOBJECTSHELL_STD_NORMAL|SFXOBJECTSHELL_HASMENU, "swriter/web" )
+SFX_IMPL_OBJECTFACTORY(SwWebDocShell, SvGlobalName(SO3_SWWEB_CLASSID), SfxObjectShellFlags::STD_NORMAL|SfxObjectShellFlags::HASMENU, "swriter/web" )
SwWebDocShell::SwWebDocShell(SfxObjectCreateMode const eMode)
: SwDocShell(eMode)