[Libreoffice-commits] core.git: 4 commits - basctl/source include/sfx2 sc/inc sc/qa sc/source sd/source sfx2/source starmath/inc starmath/qa starmath/source sw/inc sw/qa sw/source

Noel Grandin noel at peralex.com
Fri Apr 10 00:48:37 PDT 2015


 basctl/source/basicide/basdoc.cxx                         |    4 -
 include/sfx2/dispatch.hxx                                 |   10 +-
 include/sfx2/objsh.hxx                                    |   48 ++++++++------
 include/sfx2/sfxmodelfactory.hxx                          |   20 ++++-
 sc/inc/appluno.hxx                                        |    3 
 sc/qa/unit/rangelst_test.cxx                              |    6 -
 sc/qa/unit/subsequent_export-test.cxx                     |   12 +--
 sc/qa/unit/ucalc.cxx                                      |    6 -
 sc/source/core/tool/progress.cxx                          |    2 
 sc/source/filter/xml/xmlwrap.cxx                          |   10 +-
 sc/source/ui/app/transobj.cxx                             |    2 
 sc/source/ui/docshell/arealink.cxx                        |    2 
 sc/source/ui/docshell/docsh.cxx                           |   16 ++--
 sc/source/ui/docshell/docsh4.cxx                          |    4 -
 sc/source/ui/docshell/docsh6.cxx                          |    4 -
 sc/source/ui/docshell/externalrefmgr.cxx                  |    2 
 sc/source/ui/docshell/tablink.cxx                         |    4 -
 sc/source/ui/inc/docsh.hxx                                |    2 
 sc/source/ui/unoobj/confuno.cxx                           |    2 
 sc/source/ui/unoobj/docuno.cxx                            |    6 -
 sc/source/ui/unoobj/unodoc.cxx                            |    2 
 sc/source/ui/view/tabvwsh4.cxx                            |    8 +-
 sc/source/ui/view/viewfun5.cxx                            |    2 
 sd/source/core/drawdoc.cxx                                |    6 -
 sd/source/core/drawdoc3.cxx                               |    4 -
 sd/source/filter/xml/sdxmlwrp.cxx                         |    6 -
 sd/source/ui/app/sdmod1.cxx                               |    4 -
 sd/source/ui/app/sdxfer.cxx                               |    2 
 sd/source/ui/dlg/dlgass.cxx                               |    2 
 sd/source/ui/dlg/navigatr.cxx                             |    2 
 sd/source/ui/dlg/sdtreelb.cxx                             |    2 
 sd/source/ui/docshell/docshel4.cxx                        |    6 -
 sd/source/ui/docshell/docshell.cxx                        |   14 ++--
 sd/source/ui/docshell/grdocsh.cxx                         |    4 -
 sd/source/ui/inc/DrawDocShell.hxx                         |    6 -
 sd/source/ui/inc/GraphicDocShell.hxx                      |    4 -
 sd/source/ui/inc/facreg.hxx                               |    5 -
 sd/source/ui/slideshow/slideshowimpl.cxx                  |    2 
 sd/source/ui/unoidl/UnoDocumentSettings.cxx               |    2 
 sd/source/ui/unoidl/unodoc.cxx                            |    4 -
 sd/source/ui/unoidl/unomodel.cxx                          |    2 
 sd/source/ui/view/drviews3.cxx                            |    2 
 sd/source/ui/view/drviews5.cxx                            |    4 -
 sd/source/ui/view/drviews7.cxx                            |    2 
 sd/source/ui/view/drviewsa.cxx                            |    6 -
 sd/source/ui/view/frmview.cxx                             |   10 +-
 sd/source/ui/view/presvish.cxx                            |    4 -
 sd/source/ui/view/sdview3.cxx                             |    4 -
 sd/source/ui/view/viewshe2.cxx                            |    2 
 sfx2/source/appl/sfxpicklist.cxx                          |    2 
 sfx2/source/control/dispatch.cxx                          |   20 ++---
 sfx2/source/doc/objcont.cxx                               |    2 
 sfx2/source/doc/objembed.cxx                              |    2 
 sfx2/source/doc/objmisc.cxx                               |    8 +-
 sfx2/source/doc/objserv.cxx                               |    4 -
 sfx2/source/doc/objstor.cxx                               |   16 ++--
 sfx2/source/doc/objxtor.cxx                               |   28 ++++----
 sfx2/source/doc/sfxbasemodel.cxx                          |   14 ++--
 sfx2/source/doc/sfxmodelfactory.cxx                       |   12 +--
 sfx2/source/view/sfxbasecontroller.cxx                    |    2 
 sfx2/source/view/viewfrm.cxx                              |   10 +-
 sfx2/source/view/viewfrm2.cxx                             |    4 -
 starmath/inc/document.hxx                                 |    2 
 starmath/qa/cppunit/test_nodetotextvisitors.cxx           |    3 
 starmath/qa/cppunit/test_starmath.cxx                     |    6 -
 starmath/qa/extras/mmlimport-test.cxx                     |    6 -
 starmath/source/ElementsDockingWindow.cxx                 |    3 
 starmath/source/cursor.cxx                                |    4 -
 starmath/source/document.cxx                              |   22 +++---
 starmath/source/mathmlexport.cxx                          |    2 
 starmath/source/mathmlimport.cxx                          |    2 
 starmath/source/register.hxx                              |    3 
 starmath/source/unodoc.cxx                                |    2 
 starmath/source/unomodel.cxx                              |    2 
 sw/inc/docsh.hxx                                          |    6 -
 sw/inc/globdoc.hxx                                        |    2 
 sw/inc/wdocsh.hxx                                         |    2 
 sw/qa/core/macros-test.cxx                                |    2 
 sw/qa/core/uwriter.cxx                                    |    2 
 sw/source/core/doc/DocumentLinksAdministrationManager.cxx |    6 -
 sw/source/core/doc/docglbl.cxx                            |    2 
 sw/source/core/doc/docnew.cxx                             |    2 
 sw/source/core/inc/unofreg.hxx                            |    3 
 sw/source/core/layout/paintfrm.cxx                        |    2 
 sw/source/core/ole/ndole.cxx                              |    6 -
 sw/source/core/swg/SwXMLTextBlocks.cxx                    |    4 -
 sw/source/core/unocore/unocoll.cxx                        |    2 
 sw/source/filter/basflt/shellio.cxx                       |    2 
 sw/source/filter/html/swhtml.cxx                          |    2 
 sw/source/filter/ww8/ww8glsy.cxx                          |    2 
 sw/source/filter/xml/swxml.cxx                            |    2 
 sw/source/filter/xml/wrtxml.cxx                           |    4 -
 sw/source/ui/dbui/mmoutputpage.cxx                        |    4 -
 sw/source/uibase/app/appenv.cxx                           |    2 
 sw/source/uibase/app/apphdl.cxx                           |    4 -
 sw/source/uibase/app/applab.cxx                           |    2 
 sw/source/uibase/app/docsh.cxx                            |   22 +++---
 sw/source/uibase/app/docsh2.cxx                           |    4 -
 sw/source/uibase/app/docshini.cxx                         |   24 +++----
 sw/source/uibase/dbui/dbmgr.cxx                           |    4 -
 sw/source/uibase/dochdl/swdtflvr.cxx                      |    6 -
 sw/source/uibase/globdoc/globdoc.cxx                      |    2 
 sw/source/uibase/misc/glshell.cxx                         |    4 -
 sw/source/uibase/shells/textsh.cxx                        |    8 +-
 sw/source/uibase/uiview/view.cxx                          |    8 +-
 sw/source/uibase/uiview/view2.cxx                         |   12 +--
 sw/source/uibase/uiview/viewport.cxx                      |    6 -
 sw/source/uibase/uno/SwXDocumentSettings.cxx              |    2 
 sw/source/uibase/uno/unodoc.cxx                           |    6 -
 sw/source/uibase/uno/unomailmerge.cxx                     |    2 
 sw/source/uibase/uno/unotxvw.cxx                          |    2 
 sw/source/uibase/web/wdocsh.cxx                           |    2 
 112 files changed, 335 insertions(+), 313 deletions(-)

New commits:
commit 2391931e2137493e51ba7e828798d86b217dfe03
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Apr 10 09:47:28 2015 +0200

    convert SFXOBJECTSHELL_ constants to scoped enum
    
    Change-Id: I5a159be0c342b778730cedb0fe35843c2c368c97

diff --git a/basctl/source/basicide/basdoc.cxx b/basctl/source/basicide/basdoc.cxx
index 0a3e172..7f03889 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 0bf721e..b92656e 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 bbed5ae..2ecbb0c 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 db475df..b848bec 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 ac88535..0da31b4 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 3b598e7..7d75118 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 03b4e3a..1a10c39 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 2cc18f1..67504bc 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 8c2ba6e..bdc0dee 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 b6d37ac..c111245 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 a6883f8..a6d1739 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 2268461..7e9a6c7 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 b4e7a36..e5ba996 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)
commit afc728fe76fbf1afea725afd6ff5e9af92e10b08
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Apr 9 16:35:22 2015 +0200

    convert SFXMODEL_ to scoped enum
    
    and fix up some confusion in SC and STARMATH about which constants to
    use
    
    Change-Id: Ib75bc78a24bd2fad6ec6d7c94c4c1ad7dc222c1a

diff --git a/basctl/source/basicide/basdoc.cxx b/basctl/source/basicide/basdoc.cxx
index bb58c09..0a3e172 100644
--- a/basctl/source/basicide/basdoc.cxx
+++ b/basctl/source/basicide/basdoc.cxx
@@ -44,7 +44,7 @@ void basctl_DocShell::InitInterface_Impl()
 }
 
 DocShell::DocShell()
-    :SfxObjectShell( SFXMODEL_DISABLE_EMBEDDED_SCRIPTS | SFXMODEL_DISABLE_DOCUMENT_RECOVERY )
+    :SfxObjectShell( SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS | SfxModelFlags::DISABLE_DOCUMENT_RECOVERY )
 {
     SetPool( &SfxGetpApp()->GetPool() );
     SetBaseModel( new SIDEModel(this) );
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 32aabff..0bf721e 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -74,6 +74,7 @@ class IndexBitSet;
 class JobSetup;
 class Size;
 class Point;
+enum class SfxModelFlags;
 
 // These values presumably must match exactly the corresponding
 // css::embed::Aspects ones (in offapi/com/sun/star/embed/Aspects.idl)
@@ -189,7 +190,7 @@ private:
 
 protected:
                                 SfxObjectShell(SfxObjectCreateMode);
-                                SfxObjectShell( const sal_uInt64 i_nCreationFlags );    // see sfxmodelfactory.hxx
+                                SfxObjectShell(SfxModelFlags);    // see sfxmodelfactory.hxx
     virtual                     ~SfxObjectShell();
 
     void                        ModifyChanged();
diff --git a/include/sfx2/sfxmodelfactory.hxx b/include/sfx2/sfxmodelfactory.hxx
index 2067fbf..43e0c6d 100644
--- a/include/sfx2/sfxmodelfactory.hxx
+++ b/include/sfx2/sfxmodelfactory.hxx
@@ -24,18 +24,26 @@
 
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <o3tl/typed_flags_set.hxx>
 
-#define SFXMODEL_STANDARD                   (sal_uInt64)(0x0000)
-#define SFXMODEL_EMBEDDED_OBJECT            (sal_uInt64)(0x0001)
-#define SFXMODEL_EXTERNAL_LINK              (sal_uInt64)(0x0002)
-#define SFXMODEL_DISABLE_EMBEDDED_SCRIPTS   (sal_uInt64)(0x0004)
-#define SFXMODEL_DISABLE_DOCUMENT_RECOVERY  (sal_uInt64)(0x0008)
+enum class SfxModelFlags
+{
+    NONE                       = 0x00,
+    EMBEDDED_OBJECT            = 0x01,
+    EXTERNAL_LINK              = 0x02,
+    DISABLE_EMBEDDED_SCRIPTS   = 0x04,
+    DISABLE_DOCUMENT_RECOVERY  = 0x08,
+};
+namespace o3tl
+{
+    template<> struct typed_flags<SfxModelFlags> : is_typed_flags<SfxModelFlags, 0x0f> {};
+}
 
 namespace sfx2
 {
     typedef ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ( SAL_CALL * SfxModelFactoryFunc ) (
         const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory,
-        const sal_uInt64 _nCreationFlags
+        SfxModelFlags _nCreationFlags
     );
 
 
diff --git a/sc/inc/appluno.hxx b/sc/inc/appluno.hxx
index 75df17d..662b028 100644
--- a/sc/inc/appluno.hxx
+++ b/sc/inc/appluno.hxx
@@ -33,6 +33,7 @@
 #include <cppuhelper/implbase3.hxx>
 #include <cppuhelper/implbase4.hxx>
 #include <rtl/ustring.hxx>
+#include <sfx2/sfxmodelfactory.hxx>
 
 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL
     ScSpreadsheetSettings_CreateInstance(
@@ -51,7 +52,7 @@ com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL
 css::uno::Sequence< OUString > SAL_CALL ScDocument_getSupportedServiceNames() throw();
 OUString SAL_CALL ScDocument_getImplementationName() throw();
 css::uno::Reference< css::uno::XInterface > SAL_CALL ScDocument_createInstance(
-            const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr, const sal_uInt64 _nCreationFlags ) throw( css::uno::Exception, std::exception );
+            const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr, SfxModelFlags _nCreationFlags ) throw( css::uno::Exception, std::exception );
 
 // Calc XML import
 css::uno::Sequence< OUString > SAL_CALL ScXMLImport_getSupportedServiceNames() throw();
diff --git a/sc/qa/unit/rangelst_test.cxx b/sc/qa/unit/rangelst_test.cxx
index 943ac20..6430fef 100644
--- a/sc/qa/unit/rangelst_test.cxx
+++ b/sc/qa/unit/rangelst_test.cxx
@@ -89,9 +89,9 @@ void Test::setUp()
 
     ScDLL::Init();
     m_xDocShRef = new ScDocShell(
-        SFXMODEL_STANDARD |
-        SFXMODEL_DISABLE_EMBEDDED_SCRIPTS |
-        SFXMODEL_DISABLE_DOCUMENT_RECOVERY);
+        SfxModelFlags::EMBEDDED_OBJECT |
+        SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS |
+        SfxModelFlags::DISABLE_DOCUMENT_RECOVERY);
 
     m_pDoc = &m_xDocShRef->GetDocument();
 }
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index b9be541..f8b5344 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -259,9 +259,9 @@ ScDocShellRef ScExportTest::saveAndReloadPassword(ScDocShell* pShell, const OUSt
 void ScExportTest::test()
 {
     ScDocShell* pShell = new ScDocShell(
-        SFXMODEL_STANDARD |
-        SFXMODEL_DISABLE_EMBEDDED_SCRIPTS |
-        SFXMODEL_DISABLE_DOCUMENT_RECOVERY);
+        SfxModelFlags::EMBEDDED_OBJECT |
+        SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS |
+        SfxModelFlags::DISABLE_DOCUMENT_RECOVERY);
     pShell->DoInitNew();
 
     ScDocument& rDoc = pShell->GetDocument();
@@ -281,9 +281,9 @@ void ScExportTest::test()
 void ScExportTest::testPasswordExport()
 {
     ScDocShell* pShell = new ScDocShell(
-        SFXMODEL_STANDARD |
-        SFXMODEL_DISABLE_EMBEDDED_SCRIPTS |
-        SFXMODEL_DISABLE_DOCUMENT_RECOVERY);
+        SfxModelFlags::EMBEDDED_OBJECT |
+        SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS |
+        SfxModelFlags::DISABLE_DOCUMENT_RECOVERY);
     pShell->DoInitNew();
 
     ScDocument& rDoc = pShell->GetDocument();
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index a80eaca..3525179 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -158,9 +158,9 @@ void Test::setUp()
 
     ScDLL::Init();
     m_pImpl->m_xDocShell = new ScDocShell(
-        SFXMODEL_STANDARD |
-        SFXMODEL_DISABLE_EMBEDDED_SCRIPTS |
-        SFXMODEL_DISABLE_DOCUMENT_RECOVERY);
+        SfxModelFlags::EMBEDDED_OBJECT |
+        SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS |
+        SfxModelFlags::DISABLE_DOCUMENT_RECOVERY);
 
     m_pImpl->m_xDocShell->DoInitUnitTest();
     m_pDoc = &m_pImpl->m_xDocShell->GetDocument();
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index c8d3de3..759b737 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -736,7 +736,7 @@ SfxObjectShell* ScTransferObj::SetDrawClipDoc( bool bAnyOle )
     if (bAnyOle)
     {
         ScGlobal::pDrawClipDocShellRef =
-                        new ScDocShellRef(new ScDocShell(SFXMODEL_EMBEDDED_OBJECT | SFXMODEL_DISABLE_EMBEDDED_SCRIPTS));      // there must be a ref
+                        new ScDocShellRef(new ScDocShell(SfxModelFlags::EMBEDDED_OBJECT | SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS));      // there must be a ref
         (*ScGlobal::pDrawClipDocShellRef)->DoInitNew(NULL);
         return *ScGlobal::pDrawClipDocShellRef;
     }
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index c981460..ee36eeb 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -254,7 +254,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
     SfxMedium* pMed = ScDocumentLoader::CreateMedium( aNewUrl, pFilter, aOptions);
 
     // aRef->DoClose() will be closed explicitly, but it is still more safe to use SfxObjectShellLock here
-    ScDocShell* pSrcShell = new ScDocShell(SFXMODEL_EMBEDDED_OBJECT | SFXMODEL_DISABLE_EMBEDDED_SCRIPTS);
+    ScDocShell* pSrcShell = new ScDocShell(SfxModelFlags::EMBEDDED_OBJECT | SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS);
     SfxObjectShellLock aRef = pSrcShell;
     pSrcShell->DoLoad(pMed);
 
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index ce2e040..bbed5ae 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2671,7 +2671,7 @@ ScDocShell::ScDocShell( const ScDocShell& rShell ) :
     // InitItems and CalcOutputFactor are called now in Load/ConvertFrom/InitNew
 }
 
-ScDocShell::ScDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
+ScDocShell::ScDocShell( const SfxModelFlags i_nSfxCreationFlags ) :
     SfxObjectShell( i_nSfxCreationFlags ),
     aDocument       ( SCDOCMODE_DOCUMENT, this ),
     aDdeTextFmt(OUString("TEXT")),
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index ff22d8d..5aa46e5 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2366,7 +2366,7 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt
     // To load encrypted documents with password, user interaction needs to be enabled.
     pMedium->UseInteractionHandler(mbUserInteractionEnabled);
 
-    ScDocShell* pNewShell = new ScDocShell(SFXMODEL_EXTERNAL_LINK);
+    ScDocShell* pNewShell = new ScDocShell(SfxModelFlags::EXTERNAL_LINK);
     SfxObjectShellRef aRef = pNewShell;
 
     // increment the recursive link count of the source document.
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index b744295..3a7cc59 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -200,7 +200,7 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter,
         pMed->UseInteractionHandler(true);    // enable the filter options dialog
 
     // aRef->DoClose() will be called explicitly, but it is still more safe to use SfxObjectShellLock here
-    ScDocShell* pSrcShell = new ScDocShell(SFXMODEL_EMBEDDED_OBJECT | SFXMODEL_DISABLE_EMBEDDED_SCRIPTS);
+    ScDocShell* pSrcShell = new ScDocShell(SfxModelFlags::EMBEDDED_OBJECT | SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS);
     SfxObjectShellLock aRef = pSrcShell;
     pSrcShell->DoLoad(pMed);
 
@@ -532,7 +532,7 @@ ScDocumentLoader::ScDocumentLoader( const OUString& rFileName,
     if ( bWithInteraction )
         pMedium->UseInteractionHandler( true ); // to enable the filter options dialog
 
-    pDocShell = new ScDocShell( SFXMODEL_EMBEDDED_OBJECT | SFXMODEL_DISABLE_EMBEDDED_SCRIPTS );
+    pDocShell = new ScDocShell( SfxModelFlags::EMBEDDED_OBJECT | SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS );
     aRef = pDocShell;
 
     ScDocument& rDoc = pDocShell->GetDocument();
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 990ecce..e0576a5 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -173,7 +173,7 @@ private:
 
 public:
                     ScDocShell( const ScDocShell& rDocShell );
-                    ScDocShell( const sal_uInt64 i_nSfxCreationFlags = SFXMODEL_EMBEDDED_OBJECT );
+                    ScDocShell( const SfxModelFlags i_nSfxCreationFlags = SfxModelFlags::EMBEDDED_OBJECT );
                     virtual ~ScDocShell();
 
 #if ENABLE_TELEPATHY
diff --git a/sc/source/ui/unoobj/unodoc.cxx b/sc/source/ui/unoobj/unodoc.cxx
index d200661..a5f99b2 100644
--- a/sc/source/ui/unoobj/unodoc.cxx
+++ b/sc/source/ui/unoobj/unodoc.cxx
@@ -44,7 +44,7 @@ uno::Sequence< OUString > SAL_CALL ScDocument_getSupportedServiceNames() throw()
 }
 
 uno::Reference< uno::XInterface > SAL_CALL ScDocument_createInstance(
-                const uno::Reference< lang::XMultiServiceFactory > & /* rSMgr */, const sal_uInt64 _nCreationFlags ) throw( uno::Exception, std::exception )
+                const uno::Reference< lang::XMultiServiceFactory > & /* rSMgr */, SfxModelFlags _nCreationFlags ) throw( uno::Exception, std::exception )
 {
     SolarMutexGuard aGuard;
     ScDLL::Init();
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index 626c4ff..5a94790 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -129,7 +129,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
                 SfxMedium* pMedium = new SfxMedium( xStore, OUString() );
 
                 //  TODO/LATER: is it a problem that we don't support binary formats here?
-                ScDocShellRef xDocShRef = new ScDocShell(SFXMODEL_STANDARD);
+                ScDocShellRef xDocShRef = new ScDocShell(SfxModelFlags::EMBEDDED_OBJECT);
                 if (xDocShRef->DoLoad(pMedium))
                 {
                     ScDocument& rSrcDoc = xDocShRef->GetDocument();
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx
index 8ad53d5..db475df 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -132,7 +132,7 @@ DrawDocShell::DrawDocShell(SfxObjectCreateMode eMode,
     Construct( eMode == SfxObjectCreateMode::INTERNAL );
 }
 
-DrawDocShell::DrawDocShell( const sal_uInt64 nModelCreationFlags, bool bDataObject, DocumentType eDocumentType ) :
+DrawDocShell::DrawDocShell( SfxModelFlags nModelCreationFlags, bool bDataObject, DocumentType eDocumentType ) :
     SfxObjectShell( nModelCreationFlags ),
     mpDoc(NULL),
     mpUndoManager(NULL),
diff --git a/sd/source/ui/docshell/grdocsh.cxx b/sd/source/ui/docshell/grdocsh.cxx
index a2fb7cf..ac88535 100644
--- a/sd/source/ui/docshell/grdocsh.cxx
+++ b/sd/source/ui/docshell/grdocsh.cxx
@@ -60,7 +60,7 @@ GraphicDocShell::GraphicDocShell(SfxObjectCreateMode eMode,
     SetStyleFamily( SD_STYLE_FAMILY_GRAPHICS );
 }
 
-GraphicDocShell::GraphicDocShell(const sal_uInt64 nModelCreationFlags,
+GraphicDocShell::GraphicDocShell(SfxModelFlags nModelCreationFlags,
                                      bool bDataObject,
                                      DocumentType eDocType) :
     DrawDocShell(nModelCreationFlags, bDataObject, eDocType)
diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx
index 791c608..bd7fec4 100644
--- a/sd/source/ui/inc/DrawDocShell.hxx
+++ b/sd/source/ui/inc/DrawDocShell.hxx
@@ -64,7 +64,7 @@ public:
         DocumentType=DOCUMENT_TYPE_IMPRESS);
 
     DrawDocShell (
-        const sal_uInt64 nModelCreationFlags,
+        SfxModelFlags nModelCreationFlags,
         bool bSdDataObj=false,
         DocumentType=DOCUMENT_TYPE_IMPRESS);
 
diff --git a/sd/source/ui/inc/GraphicDocShell.hxx b/sd/source/ui/inc/GraphicDocShell.hxx
index 987e1e9..7734f90 100644
--- a/sd/source/ui/inc/GraphicDocShell.hxx
+++ b/sd/source/ui/inc/GraphicDocShell.hxx
@@ -52,7 +52,7 @@ public:
         DocumentType=DOCUMENT_TYPE_DRAW);
 
     GraphicDocShell (
-        const sal_uInt64 nModelCreationFlags,
+        SfxModelFlags nModelCreationFlags,
         bool bSdDataObj=false,
         DocumentType=DOCUMENT_TYPE_DRAW);
 
diff --git a/sd/source/ui/inc/facreg.hxx b/sd/source/ui/inc/facreg.hxx
index e69f15b..23ab042 100644
--- a/sd/source/ui/inc/facreg.hxx
+++ b/sd/source/ui/inc/facreg.hxx
@@ -21,17 +21,18 @@
 #define INCLUDED_SD_SOURCE_UI_INC_FACREG_HXX
 
 #include <sal/config.h>
+#include <sfx2/sfxmodelfactory.hxx>
 
 namespace com { namespace sun { namespace star {
     namespace lang { class XMultiServiceFactory; }
     namespace uno { class XComponentContext; }
 } } }
 
-css::uno::Reference< css::uno::XInterface > SAL_CALL SdDrawingDocument_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory > & _rxFactory, const sal_uInt64 _nCreationFlags );
+css::uno::Reference< css::uno::XInterface > SAL_CALL SdDrawingDocument_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory > & _rxFactory, SfxModelFlags _nCreationFlags );
 OUString SdDrawingDocument_getImplementationName() throw( css::uno::RuntimeException );
 css::uno::Sequence< OUString > SAL_CALL SdDrawingDocument_getSupportedServiceNames() throw( css::uno::RuntimeException );
 
-css::uno::Reference< css::uno::XInterface > SAL_CALL SdPresentationDocument_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory > & _rxFactory, const sal_uInt64 _nCreationFlags );
+css::uno::Reference< css::uno::XInterface > SAL_CALL SdPresentationDocument_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory > & _rxFactory, SfxModelFlags _nCreationFlags );
 OUString SdPresentationDocument_getImplementationName() throw( css::uno::RuntimeException );
 css::uno::Sequence< OUString > SAL_CALL SdPresentationDocument_getSupportedServiceNames() throw( css::uno::RuntimeException );
 
diff --git a/sd/source/ui/unoidl/unodoc.cxx b/sd/source/ui/unoidl/unodoc.cxx
index 1869fcd..87375a3 100644
--- a/sd/source/ui/unoidl/unodoc.cxx
+++ b/sd/source/ui/unoidl/unodoc.cxx
@@ -48,7 +48,7 @@ uno::Sequence< OUString > SAL_CALL SdDrawingDocument_getSupportedServiceNames()
 }
 
 uno::Reference< uno::XInterface > SAL_CALL SdDrawingDocument_createInstance(
-                const uno::Reference< lang::XMultiServiceFactory > &, const sal_uInt64 _nCreationFlags )
+                const uno::Reference< lang::XMultiServiceFactory > &, SfxModelFlags _nCreationFlags )
 {
     SolarMutexGuard aGuard;
 
@@ -77,7 +77,7 @@ uno::Sequence< OUString > SAL_CALL SdPresentationDocument_getSupportedServiceNam
 }
 
 uno::Reference< uno::XInterface > SAL_CALL SdPresentationDocument_createInstance(
-                const uno::Reference< lang::XMultiServiceFactory > &, const sal_uInt64 _nCreationFlags )
+                const uno::Reference< lang::XMultiServiceFactory > &, SfxModelFlags _nCreationFlags )
 {
     SolarMutexGuard aGuard;
 
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 67405ac..2cc18f1 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -280,7 +280,7 @@ SfxObjectShell_Impl::~SfxObjectShell_Impl()
 
 
 
-SfxObjectShell::SfxObjectShell( const sal_uInt64 i_nCreationFlags )
+SfxObjectShell::SfxObjectShell( const SfxModelFlags i_nCreationFlags )
     :   pImp( new SfxObjectShell_Impl( *this ) )
     ,   pMedium(0)
     ,   pStyleSheetPool(0)
@@ -288,16 +288,16 @@ SfxObjectShell::SfxObjectShell( const sal_uInt64 i_nCreationFlags )
     ,   bHasName( false )
     ,   bIsInGenerateThumbnail ( false )
 {
-    if (i_nCreationFlags & SFXMODEL_EMBEDDED_OBJECT)
+    if (i_nCreationFlags & SfxModelFlags::EMBEDDED_OBJECT)
         eCreateMode = SfxObjectCreateMode::EMBEDDED;
-    else if (i_nCreationFlags & SFXMODEL_EXTERNAL_LINK)
+    else if (i_nCreationFlags & SfxModelFlags::EXTERNAL_LINK)
         eCreateMode = SfxObjectCreateMode::INTERNAL;
 
-    const bool bScriptSupport = ( i_nCreationFlags & SFXMODEL_DISABLE_EMBEDDED_SCRIPTS ) == 0;
+    const bool bScriptSupport = ( i_nCreationFlags & SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS ) == SfxModelFlags::NONE;
     if ( !bScriptSupport )
         SetHasNoBasic();
 
-    const bool bDocRecovery = ( i_nCreationFlags & SFXMODEL_DISABLE_DOCUMENT_RECOVERY ) == 0;
+    const bool bDocRecovery = ( i_nCreationFlags & SfxModelFlags::DISABLE_DOCUMENT_RECOVERY ) == SfxModelFlags::NONE;
     if ( !bDocRecovery )
         pImp->m_bDocRecoverySupport = false;
 }
diff --git a/sfx2/source/doc/sfxmodelfactory.cxx b/sfx2/source/doc/sfxmodelfactory.cxx
index 0fb5ed8..c184456 100644
--- a/sfx2/source/doc/sfxmodelfactory.cxx
+++ b/sfx2/source/doc/sfxmodelfactory.cxx
@@ -90,7 +90,7 @@ namespace sfx2
         virtual ~SfxModelFactory();
 
     private:
-        Reference< XInterface > impl_createInstance( const sal_uInt64 _nCreationFlags ) const;
+        Reference< XInterface > impl_createInstance( const SfxModelFlags _nCreationFlags ) const;
 
     private:
         const Reference< XMultiServiceFactory >     m_xServiceFactory;
@@ -119,7 +119,7 @@ namespace sfx2
     }
 
 
-    Reference< XInterface > SfxModelFactory::impl_createInstance( const sal_uInt64 _nCreationFlags ) const
+    Reference< XInterface > SfxModelFactory::impl_createInstance( const SfxModelFlags _nCreationFlags ) const
     {
         return (*m_pComponentFactoryFunc)( m_xServiceFactory, _nCreationFlags );
     }
@@ -161,10 +161,10 @@ namespace sfx2
         const bool bScriptSupport = aArgs.getOrDefault( "EmbeddedScriptSupport", sal_True );
         const bool bDocRecoverySupport = aArgs.getOrDefault( "DocumentRecoverySupport", sal_True );
 
-        sal_uInt64 nCreationFlags =
-                ( bEmbeddedObject ? SFXMODEL_EMBEDDED_OBJECT : 0 )
-            |   ( bScriptSupport ? 0 : SFXMODEL_DISABLE_EMBEDDED_SCRIPTS )
-            |   ( bDocRecoverySupport ? 0 : SFXMODEL_DISABLE_DOCUMENT_RECOVERY );
+        SfxModelFlags nCreationFlags =
+                ( bEmbeddedObject ? SfxModelFlags::EMBEDDED_OBJECT : SfxModelFlags::NONE )
+            |   ( bScriptSupport ? SfxModelFlags::NONE : SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS )
+            |   ( bDocRecoverySupport ? SfxModelFlags::NONE : SfxModelFlags::DISABLE_DOCUMENT_RECOVERY );
 
         Reference< XInterface > xInstance( impl_createInstance( nCreationFlags ) );
 
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx
index e437dd1..f439b13 100644
--- a/starmath/inc/document.hxx
+++ b/starmath/inc/document.hxx
@@ -162,7 +162,7 @@ private:
     static void InitInterface_Impl();
 
 public:
-                SmDocShell( const sal_uInt64 i_nSfxCreationFlags );
+                SmDocShell( SfxModelFlags i_nSfxCreationFlags );
     virtual     ~SmDocShell();
 
     void        LoadSymbols();
diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
index 4e4de16..7736d2f 100644
--- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx
+++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
@@ -11,6 +11,7 @@
 #include <test/bootstrapfixture.hxx>
 
 #include <vcl/svapp.hxx>
+#include <sfx2/sfxmodelfactory.hxx>
 #include <smdll.hxx>
 
 #include <document.hxx>
@@ -87,7 +88,7 @@ void Test::setUp()
 
     SmGlobals::ensure();
 
-    xDocShRef = new SmDocShell(SFXOBJECTSHELL_STD_NORMAL);
+    xDocShRef = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT);
 }
 
 void Test::tearDown()
diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx
index 054af67..5184b38 100644
--- a/starmath/qa/cppunit/test_starmath.cxx
+++ b/starmath/qa/cppunit/test_starmath.cxx
@@ -73,9 +73,9 @@ void Test::setUp()
     SmGlobals::ensure();
 
     m_xDocShRef = new SmDocShell(
-        SFXMODEL_STANDARD |
-        SFXMODEL_DISABLE_EMBEDDED_SCRIPTS |
-        SFXMODEL_DISABLE_DOCUMENT_RECOVERY);
+        SfxModelFlags::EMBEDDED_OBJECT |
+        SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS |
+        SfxModelFlags::DISABLE_DOCUMENT_RECOVERY);
     m_xDocShRef->DoInitNew(0);
 
     SfxViewFrame *pViewFrame = SfxViewFrame::LoadHiddenDocument(*m_xDocShRef, 0);
diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx
index e52ebf3..3effb31 100644
--- a/starmath/qa/extras/mmlimport-test.cxx
+++ b/starmath/qa/extras/mmlimport-test.cxx
@@ -55,9 +55,9 @@ private:
                                            "private:factory/smath*");
         pFilter->SetVersion(SOFFICE_FILEFORMAT_60);
 
-        mxDocShell = new SmDocShell(SFXMODEL_STANDARD |
-                                    SFXMODEL_DISABLE_EMBEDDED_SCRIPTS |
-                                    SFXMODEL_DISABLE_DOCUMENT_RECOVERY);
+        mxDocShell = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT |
+                                    SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS |
+                                    SfxModelFlags::DISABLE_DOCUMENT_RECOVERY);
 
         SfxMedium* pSrcMed = new SfxMedium(rURL, STREAM_STD_READ);
         pSrcMed->SetFilter(pFilter);
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index 907d148..12eb670 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -27,6 +27,7 @@
 
 #include <svl/stritem.hxx>
 #include <sfx2/dispatch.hxx>
+#include <sfx2/sfxmodelfactory.hxx>
 #include <vcl/settings.hxx>
 
 typedef tools::SvRef<SmDocShell> SmDocShellRef;
@@ -219,7 +220,7 @@ const sal_uInt16 SmElementsControl::aOthers[][2] =
 
 SmElementsControl::SmElementsControl(vcl::Window *pParent)
     : Control(pParent, WB_TABSTOP)
-    , mpDocShell(new SmDocShell(SFXOBJECTSHELL_STD_NORMAL))
+    , mpDocShell(new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT))
     , maCurrentSetId(0)
     , mpCurrentElement(NULL)
     , mbVerticalMode(true)
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 2f1c91b..b6d37ac 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -653,7 +653,7 @@ void SmDocShell::Repaint()
 }
 
 
-SmDocShell::SmDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
+SmDocShell::SmDocShell( SfxModelFlags i_nSfxCreationFlags ) :
     SfxObjectShell( i_nSfxCreationFlags ),
     pTree               ( 0 ),
     pEditEngineItemPool ( 0 ),
diff --git a/starmath/source/register.hxx b/starmath/source/register.hxx
index 5aac343..97b4692 100644
--- a/starmath/source/register.hxx
+++ b/starmath/source/register.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_STARMATH_SOURCE_REGISTER_HXX
 
 #include <sal/config.h>
+#include <sfx2/sfxmodelfactory.hxx>
 
 //Math document
 css::uno::Sequence< OUString > SAL_CALL
@@ -28,7 +29,7 @@ css::uno::Sequence< OUString > SAL_CALL
 OUString SAL_CALL
         SmDocument_getImplementationName() throw();
 css::uno::Reference< css::uno::XInterface >SAL_CALL
-        SmDocument_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr, const sal_uInt64 _nCreationFlags) throw( css::uno::Exception );
+        SmDocument_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr, SfxModelFlags _nCreationFlags) throw( css::uno::Exception );
 
 //MathML import
 css::uno::Sequence< OUString > SAL_CALL
diff --git a/starmath/source/unodoc.cxx b/starmath/source/unodoc.cxx
index 1d89f4a..df5a597 100644
--- a/starmath/source/unodoc.cxx
+++ b/starmath/source/unodoc.cxx
@@ -40,7 +40,7 @@ uno::Sequence< OUString > SAL_CALL SmDocument_getSupportedServiceNames() throw()
 }
 
 uno::Reference< uno::XInterface > SAL_CALL SmDocument_createInstance(
-                const uno::Reference< lang::XMultiServiceFactory > & /*rSMgr*/, const sal_uInt64 _nCreationFlags ) throw( uno::Exception )
+                const uno::Reference< lang::XMultiServiceFactory > & /*rSMgr*/, SfxModelFlags _nCreationFlags ) throw( uno::Exception )
 {
     SolarMutexGuard aGuard;
     SmGlobals::ensure();
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index deea28e..9fbb874 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -168,7 +168,7 @@ public:
 
     /// Doc is required for SO data exchange!
     SwDocShell( SfxObjectCreateMode eMode = SfxObjectCreateMode::EMBEDDED );
-    SwDocShell( const sal_uInt64 i_nSfxCreationFlags );
+    SwDocShell( SfxModelFlags i_nSfxCreationFlags );
     SwDocShell( SwDoc *pDoc, SfxObjectCreateMode eMode = SfxObjectCreateMode::STANDARD );
     virtual ~SwDocShell();
 
diff --git a/sw/source/core/inc/unofreg.hxx b/sw/source/core/inc/unofreg.hxx
index 962baac..b7c2aeb 100644
--- a/sw/source/core/inc/unofreg.hxx
+++ b/sw/source/core/inc/unofreg.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SW_SOURCE_CORE_INC_UNOFREG_HXX
 
 #include <sal/config.h>
+#include <sfx2/sfxmodelfactory.hxx>
 
 #include <com/sun/star/uno/Exception.hpp>
 #include <com/sun/star/uno/Sequence.hxx>
@@ -37,7 +38,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL SwUnoModule_createInstance(
 // writer documents
 css::uno::Sequence< OUString > SAL_CALL SwTextDocument_getSupportedServiceNames() throw();
 OUString SAL_CALL SwTextDocument_getImplementationName() throw();
-css::uno::Reference< css::uno::XInterface > SAL_CALL SwTextDocument_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory > &rSMgr, const sal_uInt64 _nCreationFlags ) throw( css::uno::Exception );
+css::uno::Reference< css::uno::XInterface > SAL_CALL SwTextDocument_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory > &rSMgr, SfxModelFlags _nCreationFlags ) throw( css::uno::Exception );
 
 #endif
 
diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx
index a02f787..8a752ca 100644
--- a/sw/source/uibase/app/docshini.cxx
+++ b/sw/source/uibase/app/docshini.cxx
@@ -337,7 +337,7 @@ SwDocShell::SwDocShell( SfxObjectCreateMode const eMode )
 }
 
 // Ctor / Dtor
-SwDocShell::SwDocShell( const sal_uInt64 i_nSfxCreationFlags )
+SwDocShell::SwDocShell( const SfxModelFlags i_nSfxCreationFlags )
     : SfxObjectShell ( i_nSfxCreationFlags )
     , m_pDoc(nullptr)
     , m_pFontList(nullptr)
diff --git a/sw/source/uibase/uno/unodoc.cxx b/sw/source/uibase/uno/unodoc.cxx
index c2782f6..bfa5ce5 100644
--- a/sw/source/uibase/uno/unodoc.cxx
+++ b/sw/source/uibase/uno/unodoc.cxx
@@ -48,7 +48,7 @@ OUString SAL_CALL SwTextDocument_getImplementationName() throw()
 }
 
 uno::Reference< uno::XInterface > SAL_CALL SwTextDocument_createInstance(
-        const uno::Reference< lang::XMultiServiceFactory >&, const sal_uInt64 _nCreationFlags )
+        const uno::Reference< lang::XMultiServiceFactory >&, SfxModelFlags _nCreationFlags )
     throw( uno::Exception )
 {
     SolarMutexGuard aGuard;
commit 89dd3f80685c66883b6ed4efbf369f5aa2dc292e
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Apr 9 15:24:21 2015 +0200

    convert SfxObjectCreateMode to scoped enum
    
    and fix some dodgy usage in /sc in the process
    
    Change-Id: Ia2bee267df31aba431fc8cb81195bb83e5b64deb

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 423e0fb..32aabff 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -143,14 +143,14 @@ enum HiddenWarningFact
     WhenCreatingPDF
 };
 
-enum SfxObjectCreateMode
+enum class SfxObjectCreateMode
 {
-    SFX_CREATE_MODE_EMBEDDED,
-    SFX_CREATE_MODE_STANDARD,
-    SFX_CREATE_MODE_PREVIEW,
-    SFX_CREATE_MODE_ORGANIZER,
-    SFX_CREATE_MODE_PLUGIN,
-    SFX_CREATE_MODE_INTERNAL
+    EMBEDDED,
+    STANDARD,
+    PREVIEW,
+    ORGANIZER,
+    PLUGIN,
+    INTERNAL
 };
 
 /*
@@ -506,8 +506,8 @@ public:
     virtual ::com::sun::star::uno::Sequence< OUString > GetEventNames();
 
     vcl::Window*                GetDialogParent( SfxMedium* pMedium=0 );
-    static SfxObjectShell*      CreateObject( const OUString& rServiceName, SfxObjectCreateMode = SFX_CREATE_MODE_STANDARD );
-    static SfxObjectShell*      CreateObjectByFactoryName( const OUString& rURL, SfxObjectCreateMode = SFX_CREATE_MODE_STANDARD );
+    static SfxObjectShell*      CreateObject( const OUString& rServiceName, SfxObjectCreateMode = SfxObjectCreateMode::STANDARD );
+    static SfxObjectShell*      CreateObjectByFactoryName( const OUString& rURL, SfxObjectCreateMode = SfxObjectCreateMode::STANDARD );
     static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
                                 CreateAndLoadComponent( const SfxItemSet& rSet, SfxFrame* pFrame = NULL );
     static SfxObjectShell*      GetShellFromComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xComp );
diff --git a/sc/source/core/tool/progress.cxx b/sc/source/core/tool/progress.cxx
index c428447..ed5dcdc 100644
--- a/sc/source/core/tool/progress.cxx
+++ b/sc/source/core/tool/progress.cxx
@@ -95,7 +95,7 @@ ScProgress::ScProgress( SfxObjectShell* pObjSh, const OUString& rText,
 
         pProgress = NULL;
     }
-    else if ( pObjSh && ( pObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ||
+    else if ( pObjSh && ( pObjSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED ||
                           pObjSh->GetProgress() ||
                           lcl_HasControllersLocked(*pObjSh) ) )
     {
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index dee1722..b2ee358 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -385,7 +385,7 @@ bool ScXMLImportWrapper::Import( sal_uInt8 nMode, ErrCode& rError )
 
     // TODO/LATER: do not do it for embedded links
     OUString aName;
-    if (SFX_CREATE_MODE_EMBEDDED == mrDocShell.GetCreateMode())
+    if (SfxObjectCreateMode::EMBEDDED == mrDocShell.GetCreateMode())
     {
         if ( pMedium && pMedium->GetItemSet() )
         {
@@ -404,7 +404,7 @@ bool ScXMLImportWrapper::Import( sal_uInt8 nMode, ErrCode& rError )
         }
     }
 
-    if (mrDocShell.GetCreateMode() == SFX_CREATE_MODE_ORGANIZER)
+    if (mrDocShell.GetCreateMode() == SfxObjectCreateMode::ORGANIZER)
         xInfoSet->setPropertyValue("OrganizerMode", uno::makeAny(true));
 
     xInfoSet->setPropertyValue( "SourceStorage", uno::Any( xStorage ) );
@@ -520,7 +520,7 @@ bool ScXMLImportWrapper::Import( sal_uInt8 nMode, ErrCode& rError )
     sal_uInt32 nDocRetval(0);
     if ((nMode & CONTENT) == CONTENT)
     {
-        if (mrDocShell.GetCreateMode() == SFX_CREATE_MODE_INTERNAL)
+        if (mrDocShell.GetCreateMode() == SfxObjectCreateMode::INTERNAL)
             // We only need to import content for external link cache document.
             xInfoSet->setPropertyValue(SC_UNO_ODS_IMPORT_STYLES, uno::makeAny(false));
 
@@ -807,7 +807,7 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly)
         xInfoSet->setPropertyValue( sPropName, uno::makeAny( aBaseURL ) );
 
         // TODO/LATER: do not do it for embedded links
-        if( SFX_CREATE_MODE_EMBEDDED == pObjSh->GetCreateMode() )
+        if( SfxObjectCreateMode::EMBEDDED == pObjSh->GetCreateMode() )
         {
             OUString aName("dummyObjectName");
             if ( pMedium && pMedium->GetItemSet() )
@@ -825,7 +825,7 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly)
             }
         }
 
-        bool bMetaRet(pObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED);
+        bool bMetaRet(pObjSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED);
         bool bStylesRet (false);
         bool bDocRet(false);
         bool bSettingsRet(false);
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index df4435a..c8d3de3 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -736,7 +736,7 @@ SfxObjectShell* ScTransferObj::SetDrawClipDoc( bool bAnyOle )
     if (bAnyOle)
     {
         ScGlobal::pDrawClipDocShellRef =
-                        new ScDocShellRef(new ScDocShell(SFX_CREATE_MODE_INTERNAL));      // there must be a ref
+                        new ScDocShellRef(new ScDocShell(SFXMODEL_EMBEDDED_OBJECT | SFXMODEL_DISABLE_EMBEDDED_SCRIPTS));      // there must be a ref
         (*ScGlobal::pDrawClipDocShellRef)->DoInitNew(NULL);
         return *ScGlobal::pDrawClipDocShellRef;
     }
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index d1d5500..c981460 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -254,7 +254,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
     SfxMedium* pMed = ScDocumentLoader::CreateMedium( aNewUrl, pFilter, aOptions);
 
     // aRef->DoClose() will be closed explicitly, but it is still more safe to use SfxObjectShellLock here
-    ScDocShell* pSrcShell = new ScDocShell(SFX_CREATE_MODE_INTERNAL);
+    ScDocShell* pSrcShell = new ScDocShell(SFXMODEL_EMBEDDED_OBJECT | SFXMODEL_DISABLE_EMBEDDED_SCRIPTS);
     SfxObjectShellLock aRef = pSrcShell;
     pSrcShell->DoLoad(pMed);
 
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 959837b..ce2e040 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -274,7 +274,7 @@ void ScDocShell::BeforeXMLLoading()
 
 void ScDocShell::AfterXMLLoading(bool bRet)
 {
-    if (GetCreateMode() != SFX_CREATE_MODE_ORGANIZER)
+    if (GetCreateMode() != SfxObjectCreateMode::ORGANIZER)
     {
         UpdateLinks();
         // don't prevent establishing of listeners anymore
@@ -444,7 +444,7 @@ bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::uno::R
     bool bRet = false;
     ErrCode nError = ERRCODE_NONE;
     aDocument.EnableAdjustHeight(false);
-    if (GetCreateMode() == SFX_CREATE_MODE_ORGANIZER)
+    if (GetCreateMode() == SfxObjectCreateMode::ORGANIZER)
         bRet = aImport.Import(ScXMLImportWrapper::STYLES, nError);
     else
         bRet = aImport.Import(ScXMLImportWrapper::ALL, nError);
@@ -517,7 +517,7 @@ bool ScDocShell::SaveXML( SfxMedium* pSaveMedium, const ::com::sun::star::uno::R
 
     ScXMLImportWrapper aImport(*this, pSaveMedium, xStor);
     bool bRet(false);
-    if (GetCreateMode() != SFX_CREATE_MODE_ORGANIZER)
+    if (GetCreateMode() != SfxObjectCreateMode::ORGANIZER)
         bRet = aImport.Export(false);
     else
         bRet = aImport.Export(true);
@@ -1575,7 +1575,7 @@ ScDocShell::PrepareSaveGuard::PrepareSaveGuard( ScDocShell& rDocShell )
             mrDocShell.aDocument.MarkUsedExternalReferences();  // Mark tables of external references to be written.
         }
     }
-    if (mrDocShell.GetCreateMode()== SFX_CREATE_MODE_STANDARD)
+    if (mrDocShell.GetCreateMode()== SfxObjectCreateMode::STANDARD)
         mrDocShell.SfxObjectShell::SetVisArea( Rectangle() );   // "Normally" worked on => no VisArea.
 }
 
@@ -2192,7 +2192,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
 
     if (pAutoStyleList)
         pAutoStyleList->ExecuteAllNow(); // Execute template timeouts now
-    if (GetCreateMode()== SFX_CREATE_MODE_STANDARD)
+    if (GetCreateMode()== SfxObjectCreateMode::STANDARD)
         SfxObjectShell::SetVisArea( Rectangle() ); // Edited normally -> no VisArea
 
     OSL_ENSURE( rMed.GetFilter(), "Filter == 0" );
@@ -2698,7 +2698,7 @@ ScDocShell::ScDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
 {
     SetPool( &SC_MOD()->GetPool() );
 
-    bIsInplace = (GetCreateMode() == SFX_CREATE_MODE_EMBEDDED);
+    bIsInplace = (GetCreateMode() == SfxObjectCreateMode::EMBEDDED);
     //  Will be reset if not in place
 
     pDocFunc = CreateDocFunc();
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index c2077f7..d9b7355 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1888,7 +1888,7 @@ void ScDocShell::Draw( OutputDevice* pDev, const JobSetup & /* rSetup */, sal_uI
 Rectangle ScDocShell::GetVisArea( sal_uInt16 nAspect ) const
 {
     SfxObjectCreateMode eShellMode = GetCreateMode();
-    if ( eShellMode == SFX_CREATE_MODE_ORGANIZER )
+    if ( eShellMode == SfxObjectCreateMode::ORGANIZER )
     {
         //  ohne Inhalte wissen wir auch nicht, wie gross die Inhalte sind
         //  leeres Rechteck zurueckgeben, das wird dann nach dem Laden berechnet
@@ -1913,7 +1913,7 @@ Rectangle ScDocShell::GetVisArea( sal_uInt16 nAspect ) const
         SnapVisArea( aArea );
         return aArea;
     }
-    else if( nAspect == ASPECT_CONTENT && eShellMode != SFX_CREATE_MODE_EMBEDDED )
+    else if( nAspect == ASPECT_CONTENT && eShellMode != SfxObjectCreateMode::EMBEDDED )
     {
         //  Visarea holen wie nach Load
 
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 92b6e2a..3918dbc 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -171,7 +171,7 @@ void ScDocShell::SetVisAreaOrSize( const Rectangle& rVisArea, bool bModifyStart
 
 bool ScDocShell::IsOle()
 {
-    return (GetCreateMode() == SFX_CREATE_MODE_EMBEDDED);
+    return (GetCreateMode() == SfxObjectCreateMode::EMBEDDED);
 }
 
 void ScDocShell::UpdateOle( const ScViewData* pViewData, bool bSnapSize )
@@ -179,7 +179,7 @@ void ScDocShell::UpdateOle( const ScViewData* pViewData, bool bSnapSize )
     //  wenn's gar nicht Ole ist, kann man sich die Berechnungen sparen
     //  (VisArea wird dann beim Save wieder zurueckgesetzt)
 
-    if (GetCreateMode() == SFX_CREATE_MODE_STANDARD)
+    if (GetCreateMode() == SfxObjectCreateMode::STANDARD)
         return;
 
     OSL_ENSURE(pViewData,"pViewData==0 bei ScDocShell::UpdateOle");
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index c669e6b..b744295 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -200,7 +200,7 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter,
         pMed->UseInteractionHandler(true);    // enable the filter options dialog
 
     // aRef->DoClose() will be called explicitly, but it is still more safe to use SfxObjectShellLock here
-    ScDocShell* pSrcShell = new ScDocShell(SFX_CREATE_MODE_INTERNAL);
+    ScDocShell* pSrcShell = new ScDocShell(SFXMODEL_EMBEDDED_OBJECT | SFXMODEL_DISABLE_EMBEDDED_SCRIPTS);
     SfxObjectShellLock aRef = pSrcShell;
     pSrcShell->DoLoad(pMed);
 
@@ -532,7 +532,7 @@ ScDocumentLoader::ScDocumentLoader( const OUString& rFileName,
     if ( bWithInteraction )
         pMedium->UseInteractionHandler( true ); // to enable the filter options dialog
 
-    pDocShell = new ScDocShell( SFX_CREATE_MODE_INTERNAL );
+    pDocShell = new ScDocShell( SFXMODEL_EMBEDDED_OBJECT | SFXMODEL_DISABLE_EMBEDDED_SCRIPTS );
     aRef = pDocShell;
 
     ScDocument& rDoc = pDocShell->GetDocument();
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index 6d0ceb7..c7f19d4 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -184,7 +184,7 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
             if ( aValue >>= sPrinterName )
             {
                 // #i75610# if the name is empty, do nothing (don't create any printer)
-                if ( !sPrinterName.isEmpty() && pDocShell->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
+                if ( !sPrinterName.isEmpty() && pDocShell->GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
                 {
                     SfxPrinter* pPrinter = pDocShell->GetPrinter();
                     if (pPrinter)
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index f2d62cf..20ffa33 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1854,7 +1854,7 @@ uno::Reference< container::XIndexAccess > SAL_CALL ScModelObj::getViewData(  )
     if( !xRet.is() )
     {
         SolarMutexGuard aGuard;
-        if (pDocShell && pDocShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED)
+        if (pDocShell && pDocShell->GetCreateMode() == SfxObjectCreateMode::EMBEDDED)
         {
             uno::Reference < container::XIndexContainer > xCont = document::IndexedPropertyValues::create( ::comphelper::getProcessComponentContext() );
             xRet.set( xCont, uno::UNO_QUERY_THROW );
@@ -2209,7 +2209,7 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const OUString& aPropertyName )
         }
         else if ( aString == "InternalDocument" )
         {
-            ScUnoHelpFunctions::SetBoolInAny( aRet, (pDocShell->GetCreateMode() == SFX_CREATE_MODE_INTERNAL) );
+            ScUnoHelpFunctions::SetBoolInAny( aRet, (pDocShell->GetCreateMode() == SfxObjectCreateMode::INTERNAL) );
         }
         else if ( aString == SC_UNO_INTEROPGRABBAG )
         {
@@ -2251,7 +2251,7 @@ css::uno::Reference<css::uno::XInterface> ScModelObj::create(
         // there should be no data provider, so that own data is used
         bool bCreate =
             ! ( nType == SC_SERVICE_CHDATAPROV &&
-                ( pDocShell->GetCreateMode() == SFX_CREATE_MODE_INTERNAL ));
+                ( pDocShell->GetCreateMode() == SfxObjectCreateMode::INTERNAL ));
         // this should never happen, i.e. the temporary document should never be
         // loaded, because this unlinks the data
         OSL_ASSERT( bCreate );
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index a90605d..b62648e 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -323,7 +323,7 @@ bool ScTabViewShell::PrepareClose(bool bUI)
 void ScTabViewShell::UpdateOleZoom()
 {
     ScDocShell* pDocSh = GetViewData().GetDocShell();
-    if ( pDocSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+    if ( pDocSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
     {
         //TODO/LATER: is there a difference between the two GetVisArea methods?
         Size aObjSize = ((const SfxObjectShell*)pDocSh)->GetVisArea().GetSize();
@@ -1473,7 +1473,7 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
     bool bFirstView = !pFirst
           || (pFirst == GetViewFrame() && !SfxViewFrame::GetNext(*pFirst,pDocSh));
 
-    if ( pDocSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+    if ( pDocSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
     {
         //TODO/LATER: is there a difference between the two GetVisArea methods?
         Rectangle aVisArea = ((const SfxObjectShell*)pDocSh)->GetVisArea();
@@ -1552,7 +1552,7 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
             rDoc.SetLayoutRTL( 0, ScGlobal::IsSystemRTL() );
 
             // append additional sheets (not for OLE object)
-            if ( pDocSh->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
+            if ( pDocSh->GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
             {
                 // Get the customized initial tab count
                 const ScDefaultsOptions& rOpt = SC_MOD()->GetDefaultsOptions();
@@ -1568,7 +1568,7 @@ void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
         // ReadExtOptions is now in Activate
 
         //  Link-Update nicht verschachteln
-        if ( pDocSh->GetCreateMode() != SFX_CREATE_MODE_INTERNAL &&
+        if ( pDocSh->GetCreateMode() != SfxObjectCreateMode::INTERNAL &&
              pDocSh->IsUpdateEnabled() )  // #105575#; update only in the first creation of the ViewShell
         {
             // Check if there are any external data.
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index ef3b99c..626c4ff 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -129,7 +129,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
                 SfxMedium* pMedium = new SfxMedium( xStore, OUString() );
 
                 //  TODO/LATER: is it a problem that we don't support binary formats here?
-                ScDocShellRef xDocShRef = new ScDocShell(SFX_CREATE_MODE_EMBEDDED);
+                ScDocShellRef xDocShRef = new ScDocShell(SFXMODEL_STANDARD);
                 if (xDocShRef->DoLoad(pMedium))
                 {
                     ScDocument& rSrcDoc = xDocShRef->GetDocument();
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 877eeb8..f3034577 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -452,10 +452,10 @@ SdDrawDocument* SdDrawDocument::AllocSdDrawDocument() const
 
         if( meDocType == DOCUMENT_TYPE_IMPRESS )
             mpCreatingTransferable->SetDocShell( new ::sd::DrawDocShell(
-                SFX_CREATE_MODE_EMBEDDED, true, meDocType ) );
+                SfxObjectCreateMode::EMBEDDED, true, meDocType ) );
         else
             mpCreatingTransferable->SetDocShell( new ::sd::GraphicDocShell(
-                SFX_CREATE_MODE_EMBEDDED, true, meDocType ) );
+                SfxObjectCreateMode::EMBEDDED, true, meDocType ) );
 
         pNewDocSh = static_cast< ::sd::DrawDocShell*>( pObj = mpCreatingTransferable->GetDocShell() );
         pNewDocSh->DoInitNew( NULL );
@@ -487,7 +487,7 @@ SdDrawDocument* SdDrawDocument::AllocSdDrawDocument() const
         SdDrawDocument* pDoc = const_cast<SdDrawDocument*>(this);
         pDoc->SetAllocDocSh(false);
         pDoc->mxAllocedDocShRef = new ::sd::DrawDocShell(
-            SFX_CREATE_MODE_EMBEDDED, true, meDocType);
+            SfxObjectCreateMode::EMBEDDED, true, meDocType);
         pDoc->mxAllocedDocShRef->DoInitNew(NULL);
         pNewModel = pDoc->mxAllocedDocShRef->GetDoc();
     }
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index ee87396..ec5416c 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -224,10 +224,10 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium& rMedium)
             // If that wasn't the case, we could load the model directly.
             if ( bCreateGraphicShell )
                 // Draw
-                mxBookmarkDocShRef = new ::sd::GraphicDocShell(SFX_CREATE_MODE_STANDARD, true);
+                mxBookmarkDocShRef = new ::sd::GraphicDocShell(SfxObjectCreateMode::STANDARD, true);
             else
                 // Impress
-                mxBookmarkDocShRef = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD, true);
+                mxBookmarkDocShRef = new ::sd::DrawDocShell(SfxObjectCreateMode::STANDARD, true);
 
             bOK = mxBookmarkDocShRef->DoLoad(&rMedium);
             if( bOK )
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index b10a3be..bb7dd96 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -612,7 +612,7 @@ bool SdXMLFilter::Import( ErrCode& nError )
     // Set base URI
     xInfoSet->setPropertyValue( "BaseURI" , makeAny( mrMedium.GetBaseURL() ) );
 
-    if( 0 == nRet && SFX_CREATE_MODE_EMBEDDED == mrDocShell.GetCreateMode() )
+    if( 0 == nRet && SfxObjectCreateMode::EMBEDDED == mrDocShell.GetCreateMode() )
     {
         OUString aName;
         if ( mrMedium.GetItemSet() )
@@ -904,7 +904,7 @@ bool SdXMLFilter::Export()
         OUString sTargetStorage( "TargetStorage" );
         xInfoSet->setPropertyValue( sTargetStorage, Any( xStorage ) );
 
-        if( SFX_CREATE_MODE_EMBEDDED == mrDocShell.GetCreateMode() )
+        if( SfxObjectCreateMode::EMBEDDED == mrDocShell.GetCreateMode() )
         {
             OUString aName;
             if ( mrMedium.GetItemSet() )
@@ -979,7 +979,7 @@ bool SdXMLFilter::Export()
             aServices[i  ].mpService = pServiceNames->mpSettings;
             aServices[i++].mpStream  = sXML_settingsStreamName;
 
-            if( mrDocShell.GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
+            if( mrDocShell.GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
             {
                 aServices[i  ].mpService = pServiceNames->mpMeta;
                 aServices[i++].mpStream  = sXML_metaStreamName;
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index a0e2880..65108f1 100644
--- a/sd/source/ui/app/sdmod1.cxx
+++ b/sd/source/ui/app/sdmod1.cxx
@@ -265,7 +265,7 @@ bool SdModule::OutlineToImpress(SfxRequest& rRequest)
             SfxObjectShellLock xDocShell;
             ::sd::DrawDocShell* pDocSh;
             xDocShell = pDocSh = new ::sd::DrawDocShell(
-                SFX_CREATE_MODE_STANDARD, false);
+                SfxObjectCreateMode::STANDARD, false);
 
             pDocSh->DoInitNew(NULL);
             SdDrawDocument* pDoc = pDocSh->GetDoc();
@@ -721,7 +721,7 @@ SfxFrame* SdModule::CreateEmptyDocument( DocumentType eDocType, const Reference<
 
     SfxObjectShellLock xDocShell;
     ::sd::DrawDocShell* pNewDocSh;
-    xDocShell = pNewDocSh = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD,false,eDocType);
+    xDocShell = pNewDocSh = new ::sd::DrawDocShell(SfxObjectCreateMode::STANDARD,false,eDocType);
     pNewDocSh->DoInitNew(NULL);
     SdDrawDocument* pDoc = pNewDocSh->GetDoc();
     if (pDoc)
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index 32b0278..0bd42e9 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -555,7 +555,7 @@ bool SdTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo
                 {
                     maDocShellRef = new ::sd::DrawDocShell(
                         mpSdDrawDocumentIntern,
-                        SFX_CREATE_MODE_EMBEDDED,
+                        SfxObjectCreateMode::EMBEDDED,
                         true,
                         mpSdDrawDocumentIntern->GetDocumentType());
                     mbOwnDocument = false;
diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx
index 8ed9166..9a41a12 100644
--- a/sd/source/ui/dlg/dlgass.cxx
+++ b/sd/source/ui/dlg/dlgass.cxx
@@ -1418,7 +1418,7 @@ void AssistentDlgImpl::UpdatePreview( bool bDocPreview )
             CloseDocShell();
 
             DrawDocShell* pNewDocSh;
-            xDocShell = pNewDocSh = new DrawDocShell(SFX_CREATE_MODE_STANDARD, false);
+            xDocShell = pNewDocSh = new DrawDocShell(SfxObjectCreateMode::STANDARD, false);
             pNewDocSh->DoInitNew(NULL);
             SdDrawDocument* pDoc = pNewDocSh->GetDoc();
             pDoc->CreateFirstPages();
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index f7b4791..21fa0d9 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -691,7 +691,7 @@ void SdNavigatorWin::RefreshDocumentLB( const OUString* pDocName )
         while( pSfxDocShell )
         {
             ::sd::DrawDocShell* pDocShell = PTR_CAST(::sd::DrawDocShell, pSfxDocShell );
-            if( pDocShell  && !pDocShell->IsInDestruction() && ( pDocShell->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) )
+            if( pDocShell  && !pDocShell->IsInDestruction() && ( pDocShell->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) )
             {
                 NavDocInfo aInfo ;
                 aInfo.mpDocShell = pDocShell;
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 12c2bcb..a0358f4 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -990,7 +990,7 @@ SdDrawDocument* SdPageObjsTLB::GetBookmarkDoc(SfxMedium* pMed)
         if( pMed )
         {
             // in this mode the document is also owned and controlled by this instance
-            mxBookmarkDocShRef = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD, true);
+            mxBookmarkDocShRef = new ::sd::DrawDocShell(SfxObjectCreateMode::STANDARD, true);
             if (mxBookmarkDocShRef->DoLoad(pMed))
                 mpBookmarkDoc = mxBookmarkDocShRef->GetDoc();
             else
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 3eb5584..f653189 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -301,7 +301,7 @@ bool DrawDocShell::Load( SfxMedium& rMedium )
         // space. Had to remove the check for empty VisArea below,
         // since XML load always sets a VisArea before.
         //TODO/LATER: looks a little bit strange!
-        if( ( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) && SfxObjectShell::GetVisArea( ASPECT_CONTENT ).IsEmpty() )
+        if( ( GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) && SfxObjectShell::GetVisArea( ASPECT_CONTENT ).IsEmpty() )
         {
             SdPage* pPage = mpDoc->GetSdPage( 0, PK_STANDARD );
 
@@ -517,7 +517,7 @@ bool DrawDocShell::Save()
     mpDoc->StopWorkStartupDelay();
 
     //TODO/LATER: why this?!
-    if( GetCreateMode() == SFX_CREATE_MODE_STANDARD )
+    if( GetCreateMode() == SfxObjectCreateMode::STANDARD )
         SfxObjectShell::SetVisArea( Rectangle() );
 
     bool bRet = SfxObjectShell::Save();
@@ -550,7 +550,7 @@ bool DrawDocShell::SaveAs( SfxMedium& rMedium )
     mpDoc->StopWorkStartupDelay();
 
     //TODO/LATER: why this?!
-    if( GetCreateMode() == SFX_CREATE_MODE_STANDARD )
+    if( GetCreateMode() == SfxObjectCreateMode::STANDARD )
         SfxObjectShell::SetVisArea( Rectangle() );
 
     sal_uInt32  nVBWarning = ERRCODE_NONE;
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx
index 5cdda0f..8ad53d5 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -117,7 +117,7 @@ void DrawDocShell::Construct( bool bClipboard )
 DrawDocShell::DrawDocShell(SfxObjectCreateMode eMode,
                                bool bDataObject,
                                DocumentType eDocumentType) :
-    SfxObjectShell( eMode == SFX_CREATE_MODE_INTERNAL ?  SFX_CREATE_MODE_EMBEDDED : eMode),
+    SfxObjectShell( eMode == SfxObjectCreateMode::INTERNAL ?  SfxObjectCreateMode::EMBEDDED : eMode),
     mpDoc(NULL),
     mpUndoManager(NULL),
     mpPrinter(NULL),
@@ -129,7 +129,7 @@ DrawDocShell::DrawDocShell(SfxObjectCreateMode eMode,
     mbOwnPrinter(false),
     mbNewDocument( true )
 {
-    Construct( eMode == SFX_CREATE_MODE_INTERNAL );
+    Construct( eMode == SfxObjectCreateMode::INTERNAL );
 }
 
 DrawDocShell::DrawDocShell( const sal_uInt64 nModelCreationFlags, bool bDataObject, DocumentType eDocumentType ) :
@@ -151,7 +151,7 @@ DrawDocShell::DrawDocShell( const sal_uInt64 nModelCreationFlags, bool bDataObje
 DrawDocShell::DrawDocShell(SdDrawDocument* pDoc, SfxObjectCreateMode eMode,
                                bool bDataObject,
                                DocumentType eDocumentType) :
-    SfxObjectShell(eMode == SFX_CREATE_MODE_INTERNAL ?  SFX_CREATE_MODE_EMBEDDED : eMode),
+    SfxObjectShell(eMode == SfxObjectCreateMode::INTERNAL ?  SfxObjectCreateMode::EMBEDDED : eMode),
     mpDoc(pDoc),
     mpUndoManager(NULL),
     mpPrinter(NULL),
@@ -163,7 +163,7 @@ DrawDocShell::DrawDocShell(SdDrawDocument* pDoc, SfxObjectCreateMode eMode,
     mbOwnPrinter(false),
     mbNewDocument( true )
 {
-    Construct( eMode == SFX_CREATE_MODE_INTERNAL );
+    Construct( eMode == SfxObjectCreateMode::INTERNAL );
 }
 
 DrawDocShell::~DrawDocShell()
diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx
index dc2d510..791c608 100644
--- a/sd/source/ui/inc/DrawDocShell.hxx
+++ b/sd/source/ui/inc/DrawDocShell.hxx
@@ -59,7 +59,7 @@ private:
 
 public:
     DrawDocShell (
-        SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED,
+        SfxObjectCreateMode eMode = SfxObjectCreateMode::EMBEDDED,
         bool bSdDataObj=false,
         DocumentType=DOCUMENT_TYPE_IMPRESS);
 
@@ -70,7 +70,7 @@ public:
 
     DrawDocShell (
         SdDrawDocument* pDoc,
-        SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED,
+        SfxObjectCreateMode eMode = SfxObjectCreateMode::EMBEDDED,
         bool bSdDataObj=false,
         DocumentType=DOCUMENT_TYPE_IMPRESS);
     virtual ~DrawDocShell();
diff --git a/sd/source/ui/inc/GraphicDocShell.hxx b/sd/source/ui/inc/GraphicDocShell.hxx
index 3e418c5..987e1e9 100644
--- a/sd/source/ui/inc/GraphicDocShell.hxx
+++ b/sd/source/ui/inc/GraphicDocShell.hxx
@@ -47,7 +47,7 @@ public:
     SFX_DECL_OBJECTFACTORY();
 
     GraphicDocShell (
-        SfxObjectCreateMode eMode = SFX_CREATE_MODE_EMBEDDED,
+        SfxObjectCreateMode eMode = SfxObjectCreateMode::EMBEDDED,
         bool bSdDataObj=false,
         DocumentType=DOCUMENT_TYPE_DRAW);
 
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index 2be0f09..7498fca 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -725,7 +725,7 @@ throw (UnknownPropertyException, PropertyVetoException,
                     if( *pValues >>= aPrinterName )
                     {
                         bOk = true;
-                        if( !aPrinterName.isEmpty() && pDocSh->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
+                        if( !aPrinterName.isEmpty() && pDocSh->GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
                         {
                             SfxPrinter *pTempPrinter = pDocSh->GetPrinter( true );
                             if (pTempPrinter)
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index e2ab4f8..bdf49e9 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -651,7 +651,7 @@ void SAL_CALL SdXImpressDocument::setViewData( const uno::Reference < container:
         throw lang::DisposedException();
 
     SfxBaseModel::setViewData( xData );
-    if( mpDocShell && (mpDocShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED) && xData.is() )
+    if( mpDocShell && (mpDocShell->GetCreateMode() == SfxObjectCreateMode::EMBEDDED) && xData.is() )
     {
         const sal_Int32 nCount = xData->getCount();
 
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index 56b6cad..0b82950 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -183,7 +183,7 @@ void  DrawViewShell::ExecCtrl(SfxRequest& rReq)
                     break;
                 }
 
-                if( GetDocSh() && (GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED))
+                if( GetDocSh() && (GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED))
                     GetDocSh()->SetModified();
 
                 SwitchPage(nSelectedPage);
diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx
index 8d9b045..e3e184b 100644
--- a/sd/source/ui/view/drviews5.cxx
+++ b/sd/source/ui/view/drviews5.cxx
@@ -89,7 +89,7 @@ void DrawViewShell::Resize (void)
 {
     ViewShell::Resize();
 
-    if ( GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+    if ( GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
     {
         SetZoomRect( GetDocSh()->GetVisArea(ASPECT_CONTENT) );
     }
@@ -508,7 +508,7 @@ void DrawViewShell::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence
     {
         const Rectangle aVisArea( mpFrameView->GetVisArea() );
 
-        if ( GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+        if ( GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
         {
             GetDocSh()->SetVisArea(aVisArea);
         }
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 055dcd8..27a6176 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -1722,7 +1722,7 @@ void DrawViewShell::GetModeSwitchingMenuState (SfxItemSet &rSet)
         rSet.DisableItem( SID_DIAMODE );
     }
 
-    if (GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED)
+    if (GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED)
     {
         // Outplace-Edit: do not allow switch
         rSet.ClearItem( SID_OUTLINEMODE );
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index d3421cb..87464eb 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -277,7 +277,7 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
 
     Point aVisAreaPos;
 
-    if ( pDocSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+    if ( pDocSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
     {
         aVisAreaPos = pDocSh->GetVisArea(ASPECT_CONTENT).TopLeft();
     }
@@ -343,7 +343,7 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, PageKind eInitialPageKind)
     FuPermanent(aReq);
     mpDrawView->SetFrameDragSingles(true);
 
-    if (pDocSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED)
+    if (pDocSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED)
     {
         mbZoomOnPage = false;
     }
@@ -549,7 +549,7 @@ void DrawViewShell::SetupPage (Size &rSize,
 
     Point aVisAreaPos;
 
-    if ( GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+    if ( GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
     {
         aVisAreaPos = GetDocSh()->GetVisArea(ASPECT_CONTENT).TopLeft();
     }
diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx
index fd009b7..44338eb 100644
--- a/sd/source/ui/view/frmview.cxx
+++ b/sd/source/ui/view/frmview.cxx
@@ -610,7 +610,7 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
                 if( pValue->Value >>= nInt16 )
                 {
                     SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() );
-                    if( pDoc && pDoc->GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
+                    if( pDoc && pDoc->GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
                         SetPageKind( (PageKind)nInt16 );
 
                     SetPageKindOnLoad( (PageKind)nInt16 );
@@ -621,7 +621,7 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
                 if( pValue->Value >>= nInt16 )
                 {
                     SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() );
-                    if( pDoc && pDoc->GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
+                    if( pDoc && pDoc->GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
                         SetSelectedPage( (sal_uInt16)nInt16 );
 
                     SetSelectedPageOnLoad( (sal_uInt16)nInt16 );
@@ -660,7 +660,7 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
                 if( pValue->Value >>= nInt32 )
                 {
                     SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() );
-                    if( pDoc && pDoc->GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
+                    if( pDoc && pDoc->GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
                         SetViewShEditMode( (EditMode)nInt32, PK_STANDARD );
                 }
             }
@@ -669,7 +669,7 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
                 if( pValue->Value >>= nInt32 )
                 {
                     SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() );
-                    if( pDoc && pDoc->GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
+                    if( pDoc && pDoc->GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
                         SetViewShEditMode( (EditMode)nInt32, PK_NOTES );
                 }
             }
@@ -678,7 +678,7 @@ void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < :
                 if( pValue->Value >>= nInt32 )
                 {
                     SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() );
-                    if( pDoc && pDoc->GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
+                    if( pDoc && pDoc->GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
                         SetViewShEditMode( (EditMode)nInt32, PK_HANDOUT );
                 }
             }
diff --git a/sd/source/ui/view/presvish.cxx b/sd/source/ui/view/presvish.cxx
index 34b0c57..ba43053 100644
--- a/sd/source/ui/view/presvish.cxx
+++ b/sd/source/ui/view/presvish.cxx
@@ -79,14 +79,14 @@ TYPEINIT1( PresentationViewShell, DrawViewShell );
 PresentationViewShell::PresentationViewShell( SfxViewFrame* pFrame, ViewShellBase& rViewShellBase, vcl::Window* pParentWindow, FrameView* pFrameView)
 : DrawViewShell( pFrame, rViewShellBase, pParentWindow, PK_STANDARD, pFrameView)
 {
-    if( GetDocSh() && GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+    if( GetDocSh() && GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
         maOldVisArea = GetDocSh()->GetVisArea( ASPECT_CONTENT );
     meShellType = ST_PRESENTATION;
 }
 
 PresentationViewShell::~PresentationViewShell (void)
 {
-    if( GetDocSh() && GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED && !maOldVisArea.IsEmpty() )
+    if( GetDocSh() && GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED && !maOldVisArea.IsEmpty() )
         GetDocSh()->SetVisArea( maOldVisArea );
 }
 
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 90c9cc0..5619c15 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -663,7 +663,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
 
         if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::DRAWING, xStm ) )
         {
-            DrawDocShellRef xShell = new DrawDocShell(SFX_CREATE_MODE_INTERNAL);
+            DrawDocShellRef xShell = new DrawDocShell(SfxObjectCreateMode::INTERNAL);
             xShell->DoInitNew(0);
 
             SdDrawDocument* pModel = xShell->GetDoc();
@@ -857,7 +857,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
             if( mrDoc.GetDocSh() && ( mrDoc.GetDocSh()->GetClassName() == aObjDesc.maClassName ) )
             {
                 uno::Reference < embed::XStorage > xStore( ::comphelper::OStorageHelper::GetStorageFromInputStream( xStm ) );
-                ::sd::DrawDocShellRef xDocShRef( new ::sd::DrawDocShell( SFX_CREATE_MODE_EMBEDDED, true, mrDoc.GetDocumentType() ) );
+                ::sd::DrawDocShellRef xDocShRef( new ::sd::DrawDocShell( SfxObjectCreateMode::EMBEDDED, true, mrDoc.GetDocumentType() ) );
 
                 // mba: BaseURL doesn't make sense for clipboard functionality
                 SfxMedium *pMedium = new SfxMedium( xStore, OUString() );
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx
index f6d25df..ea5e50c 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -594,7 +594,7 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize,
 
     Point aVisAreaPos;
 
-    if ( GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+    if ( GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
     {
         aVisAreaPos = GetDocSh()->GetVisArea(ASPECT_CONTENT).TopLeft();
     }
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index 1e6550b..4ef2921 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -167,7 +167,7 @@ void SfxPickList::AddDocumentToPickList( SfxObjectShell* pDocSh )
 
     // Unnamed Documents and embedded-Documents not in Picklist
     if ( !pDocSh->HasName() ||
-            SFX_CREATE_MODE_STANDARD != pDocSh->GetCreateMode() )
+            SfxObjectCreateMode::STANDARD != pDocSh->GetCreateMode() )
         return;
 
     // Help not in History
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 3f54b39..f9a25a3 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -482,7 +482,7 @@ void SfxObjectShell::UpdateFromTemplate_Impl(  )
             {
                 // styles should be updated, create document in organizer mode to read in the styles
                 //TODO: testen!
-                SfxObjectShellLock xTemplDoc = CreateObjectByFactoryName( GetFactory().GetFactoryName(), SFX_CREATE_MODE_ORGANIZER );
+                SfxObjectShellLock xTemplDoc = CreateObjectByFactoryName( GetFactory().GetFactoryName(), SfxObjectCreateMode::ORGANIZER );
                 xTemplDoc->DoInitNew(0);
 
                 // TODO/MBA: do we need a BaseURL? Then LoadFrom must be extended!
diff --git a/sfx2/source/doc/objembed.cxx b/sfx2/source/doc/objembed.cxx
index 8acc580..a5f9070 100644
--- a/sfx2/source/doc/objembed.cxx
+++ b/sfx2/source/doc/objembed.cxx
@@ -119,7 +119,7 @@ void SfxObjectShell::SetVisArea( const Rectangle & rVisArea )
     if( pImp->m_aVisArea != rVisArea )
     {
         pImp->m_aVisArea = rVisArea;
-        if ( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+        if ( GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
         {
             if ( IsEnableSetModified() )
                 SetModified( true );
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 19e74f3..3b598e7 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1801,7 +1801,7 @@ void SfxObjectShell::SetCreateMode_Impl( SfxObjectCreateMode nMode )
 
 bool SfxObjectShell::IsInPlaceActive()
 {
-    if ( eCreateMode != SFX_CREATE_MODE_EMBEDDED )
+    if ( eCreateMode != SfxObjectCreateMode::EMBEDDED )
         return false;
 
     SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this );
@@ -1810,7 +1810,7 @@ bool SfxObjectShell::IsInPlaceActive()
 
 bool SfxObjectShell::IsUIActive()
 {
-    if ( eCreateMode != SFX_CREATE_MODE_EMBEDDED )
+    if ( eCreateMode != SfxObjectCreateMode::EMBEDDED )
         return false;
 
     SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this );
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 91c3855..32dcfef 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -519,7 +519,7 @@ bool SfxObjectShell::DoInitNew( SfxMedium* pMed )
     {
         // empty documents always get their macros from the user, so there is no reason to restrict access
         pImp->aMacroMode.allowMacroExecution();
-        if ( SFX_CREATE_MODE_EMBEDDED == eCreateMode )
+        if ( SfxObjectCreateMode::EMBEDDED == eCreateMode )
             SetTitle(SfxResId(STR_NONAME).toString());
 
         uno::Reference< frame::XModel >  xModel ( GetModel(), uno::UNO_QUERY );
@@ -842,7 +842,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
         }
         Broadcast( SfxSimpleHint(SFX_HINT_NAMECHANGED) );
 
-        if ( SFX_CREATE_MODE_EMBEDDED != eCreateMode )
+        if ( SfxObjectCreateMode::EMBEDDED != eCreateMode )
         {
             SFX_ITEMSET_ARG( pMedium->GetItemSet(), pAsTempItem, SfxBoolItem, SID_TEMPLATE, false);
             SFX_ITEMSET_ARG( pMedium->GetItemSet(), pPreviewItem, SfxBoolItem, SID_PREVIEW, false);
@@ -1196,7 +1196,7 @@ bool SfxObjectShell::SaveTo_Impl
     if( pMedSet )
     {
         SFX_ITEMSET_ARG( pMedSet, pSaveToItem, SfxBoolItem, SID_SAVETO, false );
-        bCopyTo =   GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ||
+        bCopyTo =   GetCreateMode() == SfxObjectCreateMode::EMBEDDED ||
                     (pSaveToItem && pSaveToItem->GetValue());
     }
 
@@ -1211,7 +1211,7 @@ bool SfxObjectShell::SaveTo_Impl
         if ( pMedium->DocNeedsFileDateCheck() )
             rMedium.CheckFileDate( pMedium->GetInitFileDate( false ) );
 
-        if ( bCopyTo && GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
+        if ( bCopyTo && GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
         {
             // export to the same location is forbidden
             SetError( ERRCODE_IO_CANTWRITE, OUString( OSL_LOG_PREFIX  ) );
@@ -1451,7 +1451,7 @@ bool SfxObjectShell::SaveTo_Impl
 
         //fdo#61320: only store thumbnail image if the corresponding option is enabled in the configuration
         if ( bOk && officecfg::Office::Common::Save::Document::GenerateThumbnail::get()
-                && GetCreateMode() != SFX_CREATE_MODE_EMBEDDED && !bPasswdProvided )
+                && GetCreateMode() != SfxObjectCreateMode::EMBEDDED && !bPasswdProvided )
         {
             // store the thumbnail representation image
             // the thumbnail is not stored in case of encrypted document
@@ -2082,7 +2082,7 @@ bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed )
             pNewMed->SetCachedSignatureState_Impl( SIGNATURESTATE_NOSIGNATURES ); // set the default value back
 
             // Set new title
-            if (!pNewMed->GetName().isEmpty() && SFX_CREATE_MODE_EMBEDDED != eCreateMode)
+            if (!pNewMed->GetName().isEmpty() && SfxObjectCreateMode::EMBEDDED != eCreateMode)
                 InvalidateName();
             SetModified(false); // reset only by set medium
             Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) );
@@ -2818,7 +2818,7 @@ bool SfxObjectShell::PreDoSaveAs_Impl
 
     // check if a "SaveTo" is wanted, no "SaveAs"
     SFX_ITEMSET_ARG( pParams, pSaveToItem, SfxBoolItem, SID_SAVETO, false );
-    bool bCopyTo = GetCreateMode() == SFX_CREATE_MODE_EMBEDDED || (pSaveToItem && pSaveToItem->GetValue());
+    bool bCopyTo = GetCreateMode() == SfxObjectCreateMode::EMBEDDED || (pSaveToItem && pSaveToItem->GetValue());
 
     // distinguish between "Save" and "SaveAs"
     pImp->bIsSaving = false;
@@ -3155,7 +3155,7 @@ bool SfxObjectShell::SaveAsChildren( SfxMedium& rMedium )
     if ( pImp->mpObjectContainer )
     {
         bool bOasis = ( SotStorage::GetVersion( xStorage ) > SOFFICE_FILEFORMAT_60 );
-        GetEmbeddedObjectContainer().StoreAsChildren(bOasis,SFX_CREATE_MODE_EMBEDDED == eCreateMode,xStorage);
+        GetEmbeddedObjectContainer().StoreAsChildren(bOasis,SfxObjectCreateMode::EMBEDDED == eCreateMode,xStorage);
     }
 
     if ( bResult )
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 4b7d6dd..67405ac 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -284,14 +284,14 @@ SfxObjectShell::SfxObjectShell( const sal_uInt64 i_nCreationFlags )
     :   pImp( new SfxObjectShell_Impl( *this ) )
     ,   pMedium(0)
     ,   pStyleSheetPool(0)
-    ,   eCreateMode(SFX_CREATE_MODE_STANDARD)
+    ,   eCreateMode(SfxObjectCreateMode::STANDARD)
     ,   bHasName( false )
     ,   bIsInGenerateThumbnail ( false )
 {
     if (i_nCreationFlags & SFXMODEL_EMBEDDED_OBJECT)
-        eCreateMode = SFX_CREATE_MODE_EMBEDDED;
+        eCreateMode = SfxObjectCreateMode::EMBEDDED;
     else if (i_nCreationFlags & SFXMODEL_EXTERNAL_LINK)
-        eCreateMode = SFX_CREATE_MODE_INTERNAL;
+        eCreateMode = SfxObjectCreateMode::INTERNAL;
 
     const bool bScriptSupport = ( i_nCreationFlags & SFXMODEL_DISABLE_EMBEDDED_SCRIPTS ) == 0;
     if ( !bScriptSupport )
@@ -311,18 +311,18 @@ SfxObjectShell::SfxObjectShell
     SfxObjectCreateMode eMode   /*  Purpose, io which the SfxObjectShell
                                     is created:
 
-                                    SFX_CREATE_MODE_EMBEDDED (default)
+                                    SfxObjectCreateMode::EMBEDDED (default)
                                         as SO-Server from within another
                                         Document
 
-                                    SFX_CREATE_MODE_STANDARD,
+                                    SfxObjectCreateMode::STANDARD,
                                         as a normal Document open stand-alone
 
-                                    SFX_CREATE_MODE_PREVIEW
+                                    SfxObjectCreateMode::PREVIEW
                                         to enable a Preview, if possible are
                                         only little information is needed
 
-                                    SFX_CREATE_MODE_ORGANIZER
+                                    SfxObjectCreateMode::ORGANIZER
                                         to be displayed in the Organizer, here
                                         notning of the contents is used  */
 )
@@ -609,7 +609,7 @@ bool SfxObjectShell::PrepareClose
     SfxApplication *pSfxApp = SfxGetpApp();
     pSfxApp->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEDOC, GlobalEventConfig::GetEventName(STR_EVENT_PREPARECLOSEDOC), this) );
 
-    if( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+    if( GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
     {
         pImp->bPreparedForClose = true;
         return true;
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index f16c5a6..d3c4eb5 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -887,7 +887,7 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const   OUString&
         {
             bool bEmb(false);
             if ( ( rArgs[0].Value >>= bEmb ) && bEmb )
-                m_pData->m_pObjectShell->SetCreateMode_Impl( SFX_CREATE_MODE_EMBEDDED );
+                m_pData->m_pObjectShell->SetCreateMode_Impl( SfxObjectCreateMode::EMBEDDED );
         }
 
         return sal_True;
@@ -1581,7 +1581,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const    Sequence< beans::PropertyValue >
         bool bRet = false;
 
         // TODO/LATER: let the embedded case of saving be handled more careful
-        if ( m_pData->m_pObjectShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+        if ( m_pData->m_pObjectShell->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
         {
             // If this is an embedded object that has no URL based location it should be stored to own storage.
             // An embedded object can have a location based on URL in case it is a link, then it should be
@@ -1914,7 +1914,7 @@ void SAL_CALL SfxBaseModel::load(   const Sequence< beans::PropertyValue >& seqA
     }
 
     // TODO/LATER: may be the mode should be retrieved from outside and the preused filter should not be set
-    if ( m_pData->m_pObjectShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+    if ( m_pData->m_pObjectShell->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
     {
         SFX_ITEMSET_ARG( pMedium->GetItemSet(), pFilterItem, SfxStringItem, SID_FILTER_NAME, false );
         if ( pFilterItem )
@@ -2761,7 +2761,7 @@ void SfxBaseModel::Notify(          SfxBroadcaster& rBC     ,
             case SFX_EVENT_STORAGECHANGED:
             {
                 if ( m_pData->m_xUIConfigurationManager.is()
-                  && m_pData->m_pObjectShell->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
+                  && m_pData->m_pObjectShell->GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
                 {
                     Reference< embed::XStorage > xConfigStorage;
                     OUString aUIConfigFolderName( "Configurations2" );
@@ -3051,7 +3051,7 @@ void SfxBaseModel::impl_store(  const   OUString&                   sURL
         // DocumentProperties must be saved on "SaveTo", so it can be restored
         // after saving
         bool bCopyTo =  bSaveTo ||
-            m_pData->m_pObjectShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED;
+            m_pData->m_pObjectShell->GetCreateMode() == SfxObjectCreateMode::EMBEDDED;
         Reference<document::XDocumentProperties> xOldDocProps;
         if ( bCopyTo )
         {
@@ -3566,7 +3566,7 @@ Reference< ui::XUIConfigurationManager2 > SfxBaseModel::getUIConfigurationManage
 
         // embedded objects did not support local configuration data until OOo 3.0, so there's nothing to
         // migrate
-        if ( m_pData->m_pObjectShell->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
+        if ( m_pData->m_pObjectShell->GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
         {
             // Import old UI configuration from OOo 1.x
             Reference< embed::XStorage > xOOo1ConfigStorage;
@@ -3642,7 +3642,7 @@ void SAL_CALL SfxBaseModel::setVisualAreaSize( sal_Int64 nAspect, const awt::Siz
         throw Exception(); // TODO: error handling
 
     SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst( m_pData->m_pObjectShell, false );
-    if ( pViewFrm && m_pData->m_pObjectShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED && !pViewFrm->GetFrame().IsInPlace() )
+    if ( pViewFrm && m_pData->m_pObjectShell->GetCreateMode() == SfxObjectCreateMode::EMBEDDED && !pViewFrm->GetFrame().IsInPlace() )
     {
         vcl::Window* pWindow = VCLUnoHelper::GetWindow( pViewFrm->GetFrame().GetFrameInterface()->getContainerWindow() );
         Size aWinSize = pWindow->GetSizePixel();
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 9f160d7..e9fc0af 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -1241,7 +1241,7 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect )
         if ( i_eConnect == E_CONNECT )
         {
             if  (   ( m_pData->m_pViewShell->GetObjectShell() != NULL )
-                &&  ( m_pData->m_pViewShell->GetObjectShell()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+                &&  ( m_pData->m_pViewShell->GetObjectShell()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
                 )
             {
                 SfxViewFrame* pViewFrm = m_pData->m_pViewShell->GetViewFrame();
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 434b387..c2d63d9 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -721,7 +721,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
                     pMedium->CloseAndRelease();
                 }
 
-                xNewObj = SfxObjectShell::CreateObject( pFilter->GetServiceName(), SFX_CREATE_MODE_STANDARD );
+                xNewObj = SfxObjectShell::CreateObject( pFilter->GetServiceName(), SfxObjectCreateMode::STANDARD );
 
                 if ( xOldObj->IsModifyPasswordEntered() )
                     xNewObj->SetModifyPasswordEntered();
@@ -863,7 +863,7 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet )
                 if ( !pSh ||
                      !pSh->HasName() ||
                      !( pSh->Get_Impl()->nLoadedFlags &  SFX_LOADED_MAINDOCUMENT ) ||
-                     ( pSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED &&
+                     ( pSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED &&
                        ( !(pVSh = pSh->GetViewShell())  ||
                          !(pFSh = pVSh->GetFormShell()) ||
                          !pFSh->IsDesignMode())))
@@ -883,7 +883,7 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet )
             {
                 SfxFrame* pFrame = &GetTopFrame();
 
-                if ( !pSh || !pSh->CanReload_Impl() || pSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+                if ( !pSh || !pSh->CanReload_Impl() || pSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
                     rSet.DisableItem(nWhich);
                 else
                 {
@@ -1092,7 +1092,7 @@ void SfxViewFrame::ReleaseObjectShell_Impl()
         Notify( *xObjSh, SfxSimpleHint(SFX_HINT_TITLECHANGED) );
         Notify( *xObjSh, SfxSimpleHint(SFX_HINT_DOCCHANGED) );
 
-        if ( 1 == xObjSh->GetOwnerLockCount() && pImp->bObjLocked && xObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+        if ( 1 == xObjSh->GetOwnerLockCount() && pImp->bObjLocked && xObjSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
             xObjSh->DoClose();
         SfxObjectShellRef xDyingObjSh = xObjSh;
         xObjSh.Clear();
@@ -1348,7 +1348,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
                 const SfxViewShell *pVSh;
                 const SfxShell *pFSh;
                 if ( !xObjSh->IsReadOnly() ||
-                     ( xObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED &&
+                     ( xObjSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED &&
                        (pVSh = xObjSh->GetViewShell()) &&
                        (pFSh = pVSh->GetFormShell()) &&
                        !pFSh->IsDesignMode()))
diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx
index ff8f3e9..8c2ba6e 100644
--- a/sfx2/source/view/viewfrm2.cxx
+++ b/sfx2/source/view/viewfrm2.cxx
@@ -380,7 +380,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 bEmbedded = pDocSh && pDocSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED;
+    bool bEmbedded = pDocSh && pDocSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED;
     if ( !pDocSh || bPseudo || bEmbedded || !pDocSh->HasName() )
         rItemSet.DisableItem( SID_CREATELINK );
 }
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index cd5bbc0..de483e5 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -1455,7 +1455,7 @@ void SmCursor::EndEdit(){
 
     //TODO: Consider copying the update accessability code from SmDocShell::SetText in here...
     //This somehow updates the size of SmGraphicView if it is running in embedded mode
-    if( pDocShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+    if( pDocShell->GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
         pDocShell->OnDocumentPrinterChanged(0);
 
     //Request a replaint...
@@ -1473,7 +1473,7 @@ void SmCursor::EndEdit(){
 void SmCursor::RequestRepaint(){
     SmViewShell *pViewSh = SmGetActiveView();
     if( pViewSh ) {
-        if ( SFX_CREATE_MODE_EMBEDDED == pDocShell->GetCreateMode() )
+        if ( SfxObjectCreateMode::EMBEDDED == pDocShell->GetCreateMode() )
             pDocShell->Repaint();
         else
             pViewSh->GetGraphicWindow().Invalidate();
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index f6a0bde..2f1c91b 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -166,7 +166,7 @@ void SmDocShell::SetText(const OUString& rBuffer)
         if( pViewSh )
         {
             pViewSh->GetViewFrame()->GetBindings().Invalidate(SID_TEXT);
-            if ( SFX_CREATE_MODE_EMBEDDED == GetCreateMode() )
+            if ( SfxObjectCreateMode::EMBEDDED == GetCreateMode() )
             {
                 // have SwOleClient::FormatChanged() to align the modified formula properly
                 // even if the vis area does not change (e.g. when formula text changes from
@@ -195,7 +195,7 @@ void SmDocShell::SetText(const OUString& rBuffer)
             }
         }
 
-        if ( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+        if ( GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
             OnDocumentPrinterChanged(0);
     }
 }
@@ -509,7 +509,7 @@ SmPrinterAccess::SmPrinterAccess( SmDocShell &rDocShell )
     if ( 0 != (pPrinter = rDocShell.GetPrt()) )
     {
         pPrinter->Push( PushFlags::MAPMODE );
-        if ( SFX_CREATE_MODE_EMBEDDED == rDocShell.GetCreateMode() )
+        if ( SfxObjectCreateMode::EMBEDDED == rDocShell.GetCreateMode() )
         {
             // if it is an embedded object (without it's own printer)

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list