[Libreoffice-commits] core.git: 3 commits - basctl/source configure.ac connectivity/source cui/source desktop/source extensions/source include/sfx2 scripting/source sc/source sd/source sfx2/source starmath/source svx/source sw/qa sw/source uui/source vbahelper/source

Norbert Thiebaud nthiebaud at gmail.com
Fri Jun 27 08:08:41 PDT 2014


 basctl/source/basicide/basdoc.cxx                       |    2 
 basctl/source/basicide/basidesh.cxx                     |    2 
 basctl/source/basicide/basobj3.cxx                      |    4 -
 basctl/source/basicide/macrodlg.cxx                     |   14 ++---
 basctl/source/basicide/moduldl2.cxx                     |    4 -
 basctl/source/basicide/moduldlg.cxx                     |    4 -
 basctl/source/basicide/scriptdocument.cxx               |    8 +--
 configure.ac                                            |    2 
 connectivity/source/drivers/odbc/OPreparedStatement.cxx |   27 ++++++----
 connectivity/source/drivers/odbc/OTools.cxx             |   24 +++++----
 cui/source/dialogs/SpellDialog.cxx                      |    2 
 cui/source/dialogs/cuicharmap.cxx                       |    2 
 cui/source/dialogs/cuifmsearch.cxx                      |    2 
 cui/source/dialogs/cuihyperdlg.cxx                      |    6 +-
 cui/source/dialogs/hltpbase.cxx                         |    2 
 cui/source/factory/dlgfact.cxx                          |    2 
 cui/source/options/optpath.cxx                          |    2 
 cui/source/options/treeopt.cxx                          |   26 +++++-----
 desktop/source/app/app.cxx                              |    4 -
 desktop/source/app/dispatchwatcher.cxx                  |    2 
 extensions/source/propctrlr/formcomponenthandler.cxx    |    2 
 include/sfx2/app.hxx                                    |    4 -
 sc/source/core/data/validat.cxx                         |    2 
 sc/source/core/tool/compiler.cxx                        |    2 
 sc/source/core/tool/interpr4.cxx                        |    2 
 sc/source/core/tool/progress.cxx                        |    2 
 sc/source/ui/app/inputhdl.cxx                           |   10 +--
 sc/source/ui/app/inputwin.cxx                           |    4 -
 sc/source/ui/app/scmod.cxx                              |   12 ++--
 sc/source/ui/dbgui/validate.cxx                         |    2 
 sc/source/ui/docshell/dbdocfun.cxx                      |    6 +-
 sc/source/ui/docshell/docfunc.cxx                       |   28 +++++-----
 sc/source/ui/docshell/docsh.cxx                         |    6 +-
 sc/source/ui/docshell/docsh3.cxx                        |    2 
 sc/source/ui/docshell/docsh4.cxx                        |    2 
 sc/source/ui/docshell/docsh5.cxx                        |    8 +--
 sc/source/ui/docshell/externalrefmgr.cxx                |    2 
 sc/source/ui/docshell/servobj.cxx                       |    8 +--
 sc/source/ui/docshell/tablink.cxx                       |    4 -
 sc/source/ui/drawfunc/drawsh.cxx                        |    4 -
 sc/source/ui/miscdlgs/anyrefdg.cxx                      |    2 
 sc/source/ui/namedlg/namedefdlg.cxx                     |    2 
 sc/source/ui/navipi/navipi.cxx                          |    4 -
 sc/source/ui/undo/undoblk.cxx                           |   16 +++---
 sc/source/ui/undo/undoblk3.cxx                          |    8 +--
 sc/source/ui/undo/undocell.cxx                          |    2 
 sc/source/ui/undo/undodat.cxx                           |    8 +--
 sc/source/ui/undo/undorangename.cxx                     |    6 +-
 sc/source/ui/undo/undotab.cxx                           |   20 +++----
 sc/source/ui/unoobj/appluno.cxx                         |    2 
 sc/source/ui/unoobj/funcuno.cxx                         |    2 
 sc/source/ui/unoobj/servuno.cxx                         |    2 
 sc/source/ui/unoobj/viewuno.cxx                         |    2 
 sc/source/ui/vba/vbaapplication.cxx                     |    8 +--
 sc/source/ui/vba/vbahelper.cxx                          |    4 -
 sc/source/ui/vba/vbarange.cxx                           |    2 
 sc/source/ui/view/dbfunc.cxx                            |    2 
 sc/source/ui/view/dbfunc3.cxx                           |    2 
 sc/source/ui/view/prevwsh.cxx                           |    4 -
 sc/source/ui/view/tabvwsh4.cxx                          |    6 +-
 sc/source/ui/view/tabvwshb.cxx                          |    2 
 sc/source/ui/view/viewfun2.cxx                          |   16 +++---
 sc/source/ui/view/viewfunc.cxx                          |    4 -
 scripting/source/basprov/basprov.cxx                    |    4 -
 scripting/source/dlgprov/dlgevtatt.cxx                  |    2 
 scripting/source/dlgprov/dlgprov.cxx                    |    2 
 sd/source/core/drawdoc3.cxx                             |    2 
 sd/source/ui/app/sdmod.cxx                              |    2 
 sd/source/ui/app/sdmod1.cxx                             |   16 +++---
 sd/source/ui/dlg/dlgass.cxx                             |    6 +-
 sd/source/ui/func/fuinsfil.cxx                          |    6 +-
 sd/source/ui/sidebar/MasterPageContainerProviders.cxx   |    2 
 sd/source/ui/table/TableDesignPane.cxx                  |    4 -
 sd/source/ui/view/drviewsg.cxx                          |    2 
 sd/source/ui/view/sdview4.cxx                           |    2 
 sfx2/source/appl/appbaslib.cxx                          |    8 +--
 sfx2/source/appl/appcfg.cxx                             |    2 
 sfx2/source/appl/appdde.cxx                             |    8 +--
 sfx2/source/appl/appdispatchprovider.cxx                |    6 +-
 sfx2/source/appl/appinit.cxx                            |    4 -
 sfx2/source/appl/appopen.cxx                            |    6 +-
 sfx2/source/appl/childwin.cxx                           |    8 +--
 sfx2/source/appl/linkmgr2.cxx                           |    2 
 sfx2/source/appl/macroloader.cxx                        |    2 
 sfx2/source/appl/module.cxx                             |    4 -
 sfx2/source/appl/sfxpicklist.cxx                        |    6 +-
 sfx2/source/appl/shutdownicon.cxx                       |    2 
 sfx2/source/appl/workwin.cxx                            |    4 -
 sfx2/source/bastyp/progress.cxx                         |   16 +++---
 sfx2/source/control/bindings.cxx                        |   16 +++---
 sfx2/source/control/dispatch.cxx                        |   22 ++++----
 sfx2/source/control/msgpool.cxx                         |    2 
 sfx2/source/control/objface.cxx                         |    4 -
 sfx2/source/control/statcach.cxx                        |    2 
 sfx2/source/control/unoctitm.cxx                        |    8 +--
 sfx2/source/dialog/filedlghelper.cxx                    |    8 +--
 sfx2/source/dialog/mgetempl.cxx                         |    2 
 sfx2/source/dialog/tabdlg.cxx                           |    8 +--
 sfx2/source/dialog/templdlg.cxx                         |    6 +-
 sfx2/source/doc/docfile.cxx                             |   10 +--
 sfx2/source/doc/docinsert.cxx                           |   10 +--
 sfx2/source/doc/frmdescr.cxx                            |    4 -
 sfx2/source/doc/guisaveas.cxx                           |    2 
 sfx2/source/doc/new.cxx                                 |    2 
 sfx2/source/doc/objcont.cxx                             |    2 
 sfx2/source/doc/objembed.cxx                            |    2 
 sfx2/source/doc/objmisc.cxx                             |   14 ++---
 sfx2/source/doc/objserv.cxx                             |    2 
 sfx2/source/doc/objstor.cxx                             |   10 +--
 sfx2/source/doc/objxtor.cxx                             |   41 ++++++++--------
 sfx2/source/doc/sfxbasemodel.cxx                        |   26 +++++-----
 sfx2/source/doc/templatedlg.cxx                         |    2 
 sfx2/source/menu/mnuitem.cxx                            |    4 -
 sfx2/source/menu/virtmenu.cxx                           |    2 
 sfx2/source/notify/eventsupplier.cxx                    |    6 +-
 sfx2/source/notify/globalevents.cxx                     |    2 
 sfx2/source/sidebar/Theme.cxx                           |    2 
 sfx2/source/statbar/stbitem.cxx                         |    4 -
 sfx2/source/toolbox/tbxitem.cxx                         |    8 +--
 sfx2/source/view/frame.cxx                              |    8 +--
 sfx2/source/view/frmload.cxx                            |   10 +--
 sfx2/source/view/sfxbasecontroller.cxx                  |    6 +-
 sfx2/source/view/viewfrm.cxx                            |   38 +++++++-------
 sfx2/source/view/viewfrm2.cxx                           |    2 
 sfx2/source/view/viewprn.cxx                            |    2 
 sfx2/source/view/viewsh.cxx                             |   20 +++----
 starmath/source/document.cxx                            |    6 +-
 svx/source/dialog/databaseregistrationui.cxx            |    2 
 svx/source/dialog/hyperdlg.cxx                          |    2 
 svx/source/dialog/srchdlg.cxx                           |    6 +-
 svx/source/form/fmscriptingenv.cxx                      |    2 
 svx/source/form/fmshell.cxx                             |    2 
 svx/source/form/fmtextcontrolshell.cxx                  |    8 +--
 svx/source/gallery2/galbrws1.cxx                        |    2 
 svx/source/unodraw/unoshap2.cxx                         |    2 
 sw/qa/core/filters-test.cxx                             |    2 
 sw/source/filter/html/htmlbas.cxx                       |    2 
 sw/source/ui/dbui/mmoutputpage.cxx                      |    4 -
 sw/source/ui/index/cnttab.cxx                           |    2 
 sw/source/uibase/app/appopt.cxx                         |    4 -
 sw/source/uibase/app/docsh2.cxx                         |    4 -
 sw/source/uibase/app/docst.cxx                          |    2 
 sw/source/uibase/app/swmodule.cxx                       |    4 -
 sw/source/uibase/dbui/dbmgr.cxx                         |   12 ++--
 sw/source/uibase/shells/textsh1.cxx                     |    2 
 sw/source/uibase/uiview/view2.cxx                       |    4 -
 sw/source/uibase/uno/unomailmerge.cxx                   |    4 -
 sw/source/uibase/utlui/navipi.cxx                       |    4 -
 uui/source/iahndl.cxx                                   |    2 
 vbahelper/source/vbahelper/vbahelper.cxx                |    4 -
 150 files changed, 462 insertions(+), 452 deletions(-)

New commits:
commit 0181a13904daef160bee543e9806b23a835f79c8
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Fri Jun 27 17:07:23 2014 +0200

    odbc properly support platform with sizeof(SQLWCHAR) = 4
    
    Change-Id: I06d5a6c93817d2623fac3962b82c1319caf13276

diff --git a/configure.ac b/configure.ac
index 2f58380..4da7afc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8797,7 +8797,7 @@ dnl ===================================================================
 dnl Check for system odbc
 dnl ===================================================================
 AC_MSG_CHECKING([which odbc headers to use])
-if test "$with_system_odbc" = "yes"; then
+if test "$with_system_odbc" = "yes" -o "$_os" = Darwin ; then
     AC_MSG_RESULT([external])
     SYSTEM_ODBC_HEADERS=TRUE
 
diff --git a/connectivity/source/drivers/odbc/OPreparedStatement.cxx b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
index 74eb5c3..1a39897 100644
--- a/connectivity/source/drivers/odbc/OPreparedStatement.cxx
+++ b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
@@ -317,6 +317,7 @@ void OPreparedStatement::setParameter(const sal_Int32 parameterIndex, const sal_
     sal_Int32 nCharLen;
     sal_Int32 nByteLen;
     void *pData;
+    OString sOData;
     if (useWChar)
     {
         /*
@@ -332,23 +333,27 @@ void OPreparedStatement::setParameter(const sal_Int32 parameterIndex, const sal_
          * and the established API that most drivers implement.
          * As wchar is often 32 bits, this differs from C-style strings of wchar!
          *
+         * On MacOS X, the "W" variants use wchar_t, which is UCS4
+         *
          * Our internal OUString storage is always UTF-16, so no conversion to do here.
          */
-        BOOST_STATIC_ASSERT( sizeof(sal_Unicode) == 2 );
-        BOOST_STATIC_ASSERT( sizeof(SQLWCHAR)    == 2 );
-        nCharLen = _sData.getLength();
-        nByteLen = nCharLen * sizeof(sal_Unicode);
-        pData = allocBindBuf(parameterIndex, nByteLen);
-        memcpy(pData, _sData.getStr(), nByteLen);
+        rtl_TextEncoding nSQLWCHAREncoding = RTL_TEXTENCODING_UCS2;
+        if( sizeof(SQLWCHAR) == 4 )
+        {
+            nSQLWCHAREncoding = RTL_TEXTENCODING_UCS4;
+        }
+
+        sOData = OUStringToOString(_sData, nSQLWCHAREncoding);
+        nByteLen = sOData.getLength();
+        nCharLen = nByteLen / sizeof(SQLWCHAR);
     }
     else
     {
-        OString sOData( OUStringToOString(_sData, getOwnConnection()->getTextEncoding()) );
-        nCharLen = sOData.getLength();
-        nByteLen = nCharLen;
-        pData = allocBindBuf(parameterIndex, nByteLen);
-        memcpy(pData, sOData.getStr(), nByteLen);
+        sOData = OUStringToOString(_sData, getOwnConnection()->getTextEncoding());
+        nCharLen = nByteLen = sOData.getLength();
     }
+    pData = allocBindBuf(parameterIndex, nByteLen);
+    memcpy(pData, sOData.getStr(), nByteLen);
 
     setParameter( parameterIndex, _nType, nCharLen, _nScale, pData, nByteLen, nByteLen );
 }
diff --git a/connectivity/source/drivers/odbc/OTools.cxx b/connectivity/source/drivers/odbc/OTools.cxx
index 70452dd..bbfc1ea 100644
--- a/connectivity/source/drivers/odbc/OTools.cxx
+++ b/connectivity/source/drivers/odbc/OTools.cxx
@@ -405,7 +405,7 @@ OUString OTools::getStringValue(OConnection* _pConnection,
                                        SQLSMALLINT _fSqlType,
                                        bool &_bWasNull,
                                        const Reference< XInterface >& _xInterface,
-                                       rtl_TextEncoding _nTextEncoding) throw(SQLException, RuntimeException)
+                                       const rtl_TextEncoding _nTextEncoding) throw(SQLException, RuntimeException)
 {
     OUStringBuffer aData;
     switch(_fSqlType)
@@ -414,15 +414,18 @@ OUString OTools::getStringValue(OConnection* _pConnection,
     case SQL_WCHAR:
     case SQL_WLONGVARCHAR:
     {
-        sal_Unicode waCharArray[2048];
-        // we assume everyone (LibO & ODBC) uses UTF-16; see OPreparedStatement::setParameter
-        BOOST_STATIC_ASSERT(sizeof(sal_Unicode) == 2);
-        BOOST_STATIC_ASSERT(sizeof(SQLWCHAR)    == 2);
-        BOOST_STATIC_ASSERT(sizeof(waCharArray) % 2 == 0);
+        SQLWCHAR waCharArray[2048];
+        rtl_TextEncoding nSQLWCHAREncoding = RTL_TEXTENCODING_UCS2;
+        BOOST_STATIC_ASSERT(sizeof(SQLWCHAR) == 2 || sizeof(SQLWCHAR) == 4);
+        if(sizeof(SQLWCHAR) == 4)
+        {
+            // we assume LibO uses UTF-16 and & ODBC uses UCS4 (UTF-32); see OPreparedStatement::setParameter
+            nSQLWCHAREncoding = RTL_TEXTENCODING_UCS4;
+        }
         // Size == number of bytes, Len == number of UTF-16 code units
         const SQLLEN nMaxSize = sizeof(waCharArray);
-        const SQLLEN nMaxLen  = sizeof(waCharArray) / sizeof(sal_Unicode);
-        BOOST_STATIC_ASSERT(nMaxLen * sizeof(sal_Unicode) == nMaxSize);
+        const SQLLEN nMaxLen  = sizeof(waCharArray) / sizeof(SQLWCHAR);
+        BOOST_STATIC_ASSERT(nMaxLen * sizeof(SQLWCHAR) == nMaxSize);
 
         // read the unicode data
         SQLLEN pcbValue = SQL_NO_TOTAL;
@@ -456,11 +459,10 @@ OUString OTools::getStringValue(OConnection* _pConnection,
             }
             else
             {
-                nReadChars = pcbValue/sizeof(sal_Unicode);
+                nReadChars = pcbValue/sizeof(SQLWCHAR);
             }
 
-            aData.append(waCharArray, nReadChars);
-
+            aData.append(OUString((sal_Char*)waCharArray, nReadChars, nSQLWCHAREncoding));
         }
         break;
     }
commit 01a882039ec4d0edf4da7d3e10ffea569a3e4aee
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Fri Jun 27 10:29:46 2014 +0200

    fdo#69036 do not try to create a sfxApplication when we are tearing-down
    
    This was triggered by connectivity calc driver, which on shutdown
    was trying to 'dispose()' it's connection
    which in turn would, if the shutdown of calc was already done
    try to re-create an sfxApplication instance, just to delete
    illusory inexistant documents...
    
    Change-Id: Ic166367ca399d613743f379ebbfbffb5813701c0

diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index 1c67756..0928635 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -149,6 +149,7 @@ public:
                                 SfxApplication();
                                 virtual ~SfxApplication();
     static SfxApplication*      GetOrCreate();
+    static SfxApplication*      Get() { return pApp;}
 
     // Resource Manager
     ResMgr*                     GetSfxResManager();
@@ -202,7 +203,6 @@ public:
     bool                        IsDowning() const;
     void                        ResetLastDir();
 
-    SAL_DLLPRIVATE static SfxApplication* Get() { return pApp;}
     SAL_DLLPRIVATE SfxDispatcher* GetAppDispatcher_Impl();
     SAL_DLLPRIVATE SfxDispatcher* GetDispatcher_Impl();
 
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 9ce512b..a374578 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -462,12 +462,17 @@ bool SfxObjectShell::Close()
         if ( pImp->bClosing )
         {
             // remove from Document list
-            SfxApplication *pSfxApp = SfxGetpApp();
-            SfxObjectShellArr_Impl &rDocs = pSfxApp->GetObjectShells_Impl();
-            SfxObjectShellArr_Impl::iterator it = std::find( rDocs.begin(), rDocs.end(), this );
-            if ( it != rDocs.end() )
-                rDocs.erase( it );
-            pImp->bInList = false;
+            // If there is no App, there is no document to remove
+            // no need to call GetOrCreate here
+            SfxApplication *pSfxApp = SfxApplication::Get();
+            if(pSfxApp)
+            {
+                SfxObjectShellArr_Impl &rDocs = pSfxApp->GetObjectShells_Impl();
+                SfxObjectShellArr_Impl::iterator it = std::find( rDocs.begin(), rDocs.end(), this );
+                if ( it != rDocs.end() )
+                    rDocs.erase( it );
+                pImp->bInList = false;
+            }
         }
     }
 
@@ -501,7 +506,7 @@ SfxObjectShell* SfxObjectShell::GetFirst
     bool          bOnlyVisible
 )
 {
-    SfxObjectShellArr_Impl &rDocs = SFX_APP()->GetObjectShells_Impl();
+    SfxObjectShellArr_Impl &rDocs = SfxGetpApp()->GetObjectShells_Impl();
 
     // seach for a SfxDocument of the specified type
     for ( sal_uInt16 nPos = 0; nPos < rDocs.size(); ++nPos )
@@ -528,7 +533,7 @@ SfxObjectShell* SfxObjectShell::GetNext
     bool                    bOnlyVisible
 )
 {
-    SfxObjectShellArr_Impl &rDocs = SFX_APP()->GetObjectShells_Impl();
+    SfxObjectShellArr_Impl &rDocs = SfxGetpApp()->GetObjectShells_Impl();
 
     // refind the specified predecessor
     sal_uInt16 nPos;
@@ -607,7 +612,7 @@ bool SfxObjectShell::PrepareClose
         }
     }
 
-    SfxApplication *pSfxApp = SFX_APP();
+    SfxApplication *pSfxApp = SfxGetpApp();
     pSfxApp->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEDOC, GlobalEventConfig::GetEventName(STR_EVENT_PREPARECLOSEDOC), this) );
 
     if( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
@@ -712,7 +717,7 @@ BasicManager* SfxObjectShell::GetBasicManager() const
     {
         pBasMgr = lcl_getBasicManagerForDocument( *this );
         if ( !pBasMgr )
-            pBasMgr = SFX_APP()->GetBasicManager();
+            pBasMgr = SfxGetpApp()->GetBasicManager();
     }
     catch (const css::ucb::ContentCreationException& e)
     {
@@ -793,7 +798,7 @@ Reference< XLibraryContainer > SfxObjectShell::GetDialogContainer()
 
     SAL_WARN("sfx.doc", "SfxObjectShell::GetDialogContainer: falling back to the application - is this really expected here?");
 #endif
-    return SFX_APP()->GetDialogContainer();
+    return SfxGetpApp()->GetDialogContainer();
 }
 
 Reference< XLibraryContainer > SfxObjectShell::GetBasicContainer()
@@ -814,7 +819,7 @@ Reference< XLibraryContainer > SfxObjectShell::GetBasicContainer()
     }
     SAL_WARN("sfx.doc", "SfxObjectShell::GetBasicContainer: falling back to the application - is this really expected here?");
 #endif
-    return SFX_APP()->GetBasicContainer();
+    return SfxGetpApp()->GetBasicContainer();
 }
 
 StarBASIC* SfxObjectShell::GetBasic() const
@@ -961,7 +966,7 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp
     // but we should have filtered quite some unnecessary calls already.
 
 #ifndef DISABLE_SCRIPTING
-    BasicManager* pAppMgr = SFX_APP()->GetBasicManager();
+    BasicManager* pAppMgr = SfxGetpApp()->GetBasicManager();
     rTheCurrentComponent = _rxComponent;
     if ( pAppMgr )
     {
@@ -1156,11 +1161,11 @@ void SfxObjectShell::SetInitialized_Impl( const bool i_fromInitNew )
     if ( i_fromInitNew )
     {
         SetActivateEvent_Impl( SFX_EVENT_CREATEDOC );
-        SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_DOCCREATED, GlobalEventConfig::GetEventName(STR_EVENT_DOCCREATED), this ) );
+        SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_DOCCREATED, GlobalEventConfig::GetEventName(STR_EVENT_DOCCREATED), this ) );
     }
     else
     {
-        SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, GlobalEventConfig::GetEventName(STR_EVENT_LOADFINISHED), this ) );
+        SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, GlobalEventConfig::GetEventName(STR_EVENT_LOADFINISHED), this ) );
     }
 }
 
commit d92aa2f445662aa9ca7d81fef1e667bcae031fc6
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Fri Jun 27 10:26:55 2014 +0200

    remove SFX_APP() macro that was a mer wrapper for SfxGetApp()
    
    Change-Id: I480a789c767dd671775c9d70d96bf71908f21f5b

diff --git a/basctl/source/basicide/basdoc.cxx b/basctl/source/basicide/basdoc.cxx
index c1dddba..aa78bea 100644
--- a/basctl/source/basicide/basdoc.cxx
+++ b/basctl/source/basicide/basdoc.cxx
@@ -49,7 +49,7 @@ void basctl_DocShell::InitInterface_Impl()
 DocShell::DocShell()
     :SfxObjectShell( SFXMODEL_DISABLE_EMBEDDED_SCRIPTS | SFXMODEL_DISABLE_DOCUMENT_RECOVERY )
 {
-    SetPool( &SFX_APP()->GetPool() );
+    SetPool( &SfxGetpApp()->GetPool() );
     SetBaseModel( new SIDEModel(this) );
 }
 
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index f66f8ca..18be999 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -370,7 +370,7 @@ void Shell::StoreAllWindowData( bool bPersistent )
 
     if ( bPersistent  )
     {
-        SFX_APP()->SaveBasicAndDialogContainer();
+        SfxGetpApp()->SaveBasicAndDialogContainer();
         SetAppBasicModified(false);
 
         if (SfxBindings* pBindings = GetBindingsPtr())
diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index ccc1e23..6a3f599 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -422,9 +422,9 @@ long HandleBasicError( StarBASIC* pBasic )
                 pShell = GetShell();
                 if ( !pShell )
                 {
-                    SfxAllItemSet aArgs( SFX_APP()->GetPool() );
+                    SfxAllItemSet aArgs( SfxGetpApp()->GetPool() );
                     SfxRequest aRequest( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON, aArgs );
-                    SFX_APP()->ExecuteSlot( aRequest );
+                    SfxGetpApp()->ExecuteSlot( aRequest );
                     pShell = GetShell();
                 }
             }
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx
index d5969d1..55f4f80 100644
--- a/basctl/source/basicide/macrodlg.cxx
+++ b/basctl/source/basicide/macrodlg.cxx
@@ -125,7 +125,7 @@ MacroChooser::MacroChooser( Window* pParnt, bool bCreateEntries )
 MacroChooser::~MacroChooser()
 {
     if ( bForceStoreBasic )
-        SFX_APP()->SaveBasicAndDialogContainer();
+        SfxGetpApp()->SaveBasicAndDialogContainer();
 }
 
 void MacroChooser::StoreMacroDescription()
@@ -674,9 +674,9 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton )
             if ( pEntry )
                 aInfoItem.SetMethod( m_pMacroBox->GetEntryText( pEntry ) );
             StoreMacroDescription();
-            SfxAllItemSet aArgs( SFX_APP()->GetPool() );
+            SfxAllItemSet aArgs( SfxGetpApp()->GetPool() );
             SfxRequest aRequest( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON, aArgs );
-            SFX_APP()->ExecuteSlot( aRequest );
+            SfxGetpApp()->ExecuteSlot( aRequest );
 
             if (SfxDispatcher* pDispatcher = GetDispatcher())
                 pDispatcher->Execute( SID_BASICIDE_EDITMACRO, SFX_CALLMODE_ASYNCHRON, &aInfoItem, 0L );
@@ -710,9 +710,9 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton )
                     aInfoItem.SetMethod( pMethod->GetName() );
                     aInfoItem.SetModule( pMethod->GetModule()->GetName() );
                     aInfoItem.SetLib( pMethod->GetModule()->GetParent()->GetName() );
-                    SfxAllItemSet aArgs( SFX_APP()->GetPool() );
+                    SfxAllItemSet aArgs( SfxGetpApp()->GetPool() );
                     SfxRequest aRequest( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON, aArgs );
-                    SFX_APP()->ExecuteSlot( aRequest );
+                    SfxGetpApp()->ExecuteSlot( aRequest );
 
                     if (SfxDispatcher* pDispatcher = GetDispatcher())
                         pDispatcher->Execute( SID_BASICIDE_EDITMACRO, SFX_CALLMODE_ASYNCHRON, &aInfoItem, 0L );
@@ -739,10 +739,10 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton )
         DBG_ASSERT( pMethod, "Method?" );
         OUString aComment( GetInfo( pMethod ) );
         SfxMacroInfoItem aItem( SID_MACROINFO, pBasMgr, aLib, aMod, aSub, aComment );
-        SfxAllItemSet Args( SFX_APP()->GetPool() );
+        SfxAllItemSet Args( SfxGetpApp()->GetPool() );
         SfxRequest aRequest( SID_CONFIG, SFX_CALLMODE_SYNCHRON, Args );
         aRequest.AppendItem( aItem );
-        SFX_APP()->ExecuteSlot( aRequest );
+        SfxGetpApp()->ExecuteSlot( aRequest );
     }
     else if (pButton == m_pNewLibButton)
     {
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 3a22d57..199c5d4 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -576,9 +576,9 @@ IMPL_LINK( LibPage, ButtonHdl, Button *, pButton )
 {
     if (pButton == m_pEditButton)
     {
-        SfxAllItemSet aArgs( SFX_APP()->GetPool() );
+        SfxAllItemSet aArgs( SfxGetpApp()->GetPool() );
         SfxRequest aRequest( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON, aArgs );
-        SFX_APP()->ExecuteSlot( aRequest );
+        SfxGetpApp()->ExecuteSlot( aRequest );
 
         SfxUsrAnyItem aDocItem( SID_BASICIDE_ARG_DOCUMENT_MODEL, makeAny( m_aCurDocument.getDocumentOrNull() ) );
         SvTreeListEntry* pCurEntry = m_pLibBox->GetCurEntry();
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index 35f6316..dbae150 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -679,9 +679,9 @@ IMPL_LINK( ObjectPage, ButtonHdl, Button *, pButton )
 {
     if (pButton == m_pEditButton)
     {
-        SfxAllItemSet aArgs( SFX_APP()->GetPool() );
+        SfxAllItemSet aArgs( SfxGetpApp()->GetPool() );
         SfxRequest aRequest( SID_BASICIDE_APPEAR, SFX_CALLMODE_SYNCHRON, aArgs );
-        SFX_APP()->ExecuteSlot( aRequest );
+        SfxGetpApp()->ExecuteSlot( aRequest );
 
         SfxDispatcher* pDispatcher = GetDispatcher();
         SvTreeListEntry* pCurEntry = m_pBasicBox->GetCurEntry();
diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx
index 4847ad0..c4f54e3 100644
--- a/basctl/source/basicide/scriptdocument.cxx
+++ b/basctl/source/basicide/scriptdocument.cxx
@@ -372,7 +372,7 @@ namespace basctl
         try
         {
             if ( isApplication() )
-                xContainer.set( _eType == E_SCRIPTS ? SFX_APP()->GetBasicContainer() : SFX_APP()->GetDialogContainer(), UNO_QUERY_THROW );
+                xContainer.set( _eType == E_SCRIPTS ? SfxGetpApp()->GetBasicContainer() : SfxGetpApp()->GetDialogContainer(), UNO_QUERY_THROW );
             else
             {
                 xContainer.set(
@@ -430,7 +430,7 @@ namespace basctl
                 return NULL;
 
             if ( isApplication() )
-                return SFX_APP()->GetBasicManager();
+                return SfxGetpApp()->GetBasicManager();
 
             return ::basic::BasicManagerRepository::getDocumentBasicManager( m_xDocument );
         }
@@ -1088,7 +1088,7 @@ namespace basctl
 
     ScriptDocument ScriptDocument::getDocumentForBasicManager( const BasicManager* _pManager )
     {
-        if ( _pManager == SFX_APP()->GetBasicManager() )
+        if ( _pManager == SfxGetpApp()->GetBasicManager() )
             return getApplicationScriptDocument();
 
         docs::Documents aDocuments;
@@ -1100,7 +1100,7 @@ namespace basctl
             )
         {
             const BasicManager* pDocBasicManager = ::basic::BasicManagerRepository::getDocumentBasicManager( doc->xModel );
-            if  (   ( pDocBasicManager != SFX_APP()->GetBasicManager() )
+            if  (   ( pDocBasicManager != SfxGetpApp()->GetBasicManager() )
                 &&  ( pDocBasicManager == _pManager )
                 )
             {
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 38bb116..ffb147e 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -495,7 +495,7 @@ void SpellDialog::StartSpellOptDlg_Impl()
         SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK,
         0
     };
-    SfxItemSet aSet( SFX_APP()->GetPool(), aSpellInfos);
+    SfxItemSet aSet( SfxGetpApp()->GetPool(), aSpellInfos);
     aSet.Put(SfxSpellCheckItem( xSpell, SID_ATTR_SPELL ));
     SfxSingleTabDialog* pDlg =
         new SfxSingleTabDialog(this, aSet, "SpellOptionsDialog", "cui/ui/spelloptionsdialog.ui");
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index f23c8e1..5ea074d 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -101,7 +101,7 @@ SvxCharacterMap::SvxCharacterMap( Window* pParent, bool bOne_, const SfxItemSet*
         SetCharFont( aTmpFont );
     }
 
-    CreateOutputItemSet( pSet ? *pSet->GetPool() : SFX_APP()->GetPool() );
+    CreateOutputItemSet( pSet ? *pSet->GetPool() : SfxGetpApp()->GetPool() );
 }
 
 
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx
index ecbf3ff..a63fba0 100644
--- a/cui/source/dialogs/cuifmsearch.cxx
+++ b/cui/source/dialogs/cuifmsearch.cxx
@@ -345,7 +345,7 @@ IMPL_LINK(FmSearchDialog, OnClickedSpecialSettings, Button*, pButton )
     }
     else if (m_pSoundsLikeCJKSettings == pButton)
     {
-        SfxItemSet aSet( SFX_APP()->GetPool() );
+        SfxItemSet aSet( SfxGetpApp()->GetPool() );
         SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
         if(pFact)
         {
diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx
index 33081c1..5bf73b9 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -117,7 +117,7 @@ SvxHpLinkDlg::SvxHpLinkDlg (Window* pParent, SfxBindings* pBindings)
     GetCancelButton().SetText ( CUI_RESSTR(RID_SVXSTR_HYPDLG_CLOSEBUT) );
 
     // create itemset for tabpages
-    mpItemSet = new SfxItemSet( SFX_APP()->GetPool(), SID_HYPERLINK_GETLINK,
+    mpItemSet = new SfxItemSet( SfxGetpApp()->GetPool(), SID_HYPERLINK_GETLINK,
                                SID_HYPERLINK_SETLINK );
 
     SvxHyperlinkItem aItem;
@@ -197,7 +197,7 @@ void SvxHpLinkDlg::Move()
         Size aDlgSize ( GetSizePixel () );
 
         // Size of Office-Main-Window
-        Size aWindowSize( SFX_APP()->GetTopWindow()->GetSizePixel() );
+        Size aWindowSize( SfxGetpApp()->GetTopWindow()->GetSizePixel() );
 
         // Size of Extrawindow
         Size aExtraWndSize( pCurrentPage->GetSizeExtraWnd() );
@@ -239,7 +239,7 @@ void SvxHpLinkDlg::Move()
 
 IMPL_LINK_NOARG(SvxHpLinkDlg, ClickApplyHdl_Impl)
 {
-    SfxItemSet aItemSet( SFX_APP()->GetPool(), SID_HYPERLINK_GETLINK,
+    SfxItemSet aItemSet( SfxGetpApp()->GetPool(), SID_HYPERLINK_GETLINK,
                          SID_HYPERLINK_SETLINK );
 
     SvxHyperlinkTabPageBase* pCurrentPage = (SvxHyperlinkTabPageBase*)
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index b019beb..3b3cd20 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -307,7 +307,7 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl)
             aItem.SetMacroTable( *pMacroTbl );
 
         // create empty itemset for macro-dlg
-        SfxItemSet* pItemSet = new SfxItemSet(SFX_APP()->GetPool(),
+        SfxItemSet* pItemSet = new SfxItemSet(SfxGetpApp()->GetPool(),
                                               SID_ATTR_MACROITEM,
                                               SID_ATTR_MACROITEM );
         pItemSet->Put ( aItem, SID_ATTR_MACROITEM );
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 01490ba..55d20b3c 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1596,7 +1596,7 @@ class SvxMacroAssignDialog : public VclAbstractDialog
 public:
     SvxMacroAssignDialog( Window* _pParent, const Reference< XFrame >& _rxDocumentFrame, const bool _bUnoDialogMode,
             const Reference< XNameReplace >& _rxEvents, const sal_uInt16 _nInitiallySelectedEvent )
-        :m_aItems( SFX_APP()->GetPool(), SID_ATTR_MACROITEM, SID_ATTR_MACROITEM )
+        :m_aItems( SfxGetpApp()->GetPool(), SID_ATTR_MACROITEM, SID_ATTR_MACROITEM )
     {
         m_aItems.Put( SfxBoolItem( SID_ATTR_MACROITEM, _bUnoDialogMode ) );
         m_pDialog.reset( new SvxMacroAssignDlg( _pParent, _rxDocumentFrame, m_aItems, _rxEvents, _nInitiallySelectedEvent ) );
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index b392869..fad0d74 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -513,7 +513,7 @@ void SvxPathTabPage::ChangeCurrentEntry( const OUString& _rFolder )
             SvtViewOptions aDlgOpt( E_DIALOG, IODLG_CONFIGNAME );
             aDlgOpt.Delete();
             // Reset also last used dir in the sfx application instance
-            SfxApplication *pSfxApp = SFX_APP();
+            SfxApplication *pSfxApp = SfxGetpApp();
             pSfxApp->ResetLastDir();
 
             // Set configuration flag to notify file picker that it's necessary
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 1420c3a..ed363cc 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1230,7 +1230,7 @@ SfxItemSet* OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId )
         case SID_GENERAL_OPTIONS:
         {
             pRet = new SfxItemSet(
-                SFX_APP()->GetPool(),
+                SfxGetpApp()->GetPool(),
                 SID_ATTR_METRIC, SID_ATTR_SPELL,
                 SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK,
                 SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER,
@@ -1238,8 +1238,8 @@ SfxItemSet* OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId )
                 SID_HTML_MODE, SID_HTML_MODE,
                 0 );
 
-            SfxItemSet aOptSet( SFX_APP()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER );
-            SFX_APP()->GetOptions(aOptSet);
+            SfxItemSet aOptSet( SfxGetpApp()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER );
+            SfxGetpApp()->GetOptions(aOptSet);
             pRet->Put(aOptSet);
 
             utl::MiscCfg    aMisc;
@@ -1270,7 +1270,7 @@ SfxItemSet* OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId )
         break;
         case SID_LANGUAGE_OPTIONS :
         {
-            pRet = new SfxItemSet(SFX_APP()->GetPool(),
+            pRet = new SfxItemSet(SfxGetpApp()->GetPool(),
                     SID_ATTR_LANGUAGE, SID_AUTOSPELL_CHECK,
                     SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE,
                     SID_OPT_LOCALE_CHANGED, SID_OPT_LOCALE_CHANGED,
@@ -1328,7 +1328,7 @@ SfxItemSet* OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId )
         }
         break;
         case SID_INET_DLG :
-                pRet = new SfxItemSet( SFX_APP()->GetPool(),
+                pRet = new SfxItemSet( SfxGetpApp()->GetPool(),
                                 SID_BASIC_ENABLED, SID_BASIC_ENABLED,
                 //SID_OPTIONS_START - ..END
                                 SID_INET_PROXY_TYPE, SID_INET_PROXY_PORT,
@@ -1338,20 +1338,20 @@ SfxItemSet* OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId )
                                 SID_INET_DNS_AUTO, SID_INET_DNS_SERVER,
                                 SID_SECURE_URL, SID_SECURE_URL,
                                 0L );
-                SFX_APP()->GetOptions(*pRet);
+                SfxGetpApp()->GetOptions(*pRet);
         break;
         case SID_FILTER_DLG:
-            pRet = new SfxItemSet( SFX_APP()->GetPool(),
+            pRet = new SfxItemSet( SfxGetpApp()->GetPool(),
             SID_ATTR_DOCINFO, SID_ATTR_AUTOSAVEMINUTE,
             SID_SAVEREL_INET, SID_SAVEREL_FSYS,
             SID_ATTR_PRETTYPRINTING, SID_ATTR_PRETTYPRINTING,
             SID_ATTR_WARNALIENFORMAT, SID_ATTR_WARNALIENFORMAT,
             0 );
-            SFX_APP()->GetOptions(*pRet);
+            SfxGetpApp()->GetOptions(*pRet);
             break;
 
         case SID_SB_STARBASEOPTIONS:
-            pRet = new SfxItemSet( SFX_APP()->GetPool(),
+            pRet = new SfxItemSet( SfxGetpApp()->GetPool(),
             SID_SB_POOLING_ENABLED, SID_SB_DB_REGISTER,
             0 );
             ::offapp::ConnectionPoolConfig::GetOptions(*pRet);
@@ -1361,7 +1361,7 @@ SfxItemSet* OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId )
         case SID_SCH_EDITOPTIONS:
         {
             SvxChartOptions aChartOpt;
-            pRet = new SfxItemSet( SFX_APP()->GetPool(), SID_SCH_EDITOPTIONS, SID_SCH_EDITOPTIONS );
+            pRet = new SfxItemSet( SfxGetpApp()->GetPool(), SID_SCH_EDITOPTIONS, SID_SCH_EDITOPTIONS );
             pRet->Put( SvxChartColorTableItem( SID_SCH_EDITOPTIONS, aChartOpt.GetDefaultColors() ) );
             break;
         }
@@ -1377,10 +1377,10 @@ void OfaTreeOptionsDialog::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet
         {
             utl::MiscCfg    aMisc;
             const SfxPoolItem* pItem;
-            SfxItemSet aOptSet(SFX_APP()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER );
+            SfxItemSet aOptSet(SfxGetpApp()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER );
             aOptSet.Put(rSet);
             if(aOptSet.Count())
-                SFX_APP()->SetOptions( aOptSet );
+                SfxGetpApp()->SetOptions( aOptSet );
             // get dispatcher anew, because SetOptions() might have destroyed the dispatcher
             SfxViewFrame *pViewFrame = SfxViewFrame::Current();
 
@@ -1427,7 +1427,7 @@ void OfaTreeOptionsDialog::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet
         break;
         case SID_INET_DLG :
         case SID_FILTER_DLG:
-            SFX_APP()->SetOptions( rSet );
+            SfxGetpApp()->SetOptions( rSet );
         break;
 
         case SID_SB_STARBASEOPTIONS:
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index fb11a18..3704bbd 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -326,8 +326,8 @@ bool shouldLaunchQuickstart()
     if (!bQuickstart)
     {
         const SfxPoolItem* pItem=0;
-        SfxItemSet aQLSet(SFX_APP()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER);
-        SFX_APP()->GetOptions(aQLSet);
+        SfxItemSet aQLSet(SfxGetpApp()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER);
+        SfxGetpApp()->GetOptions(aQLSet);
         SfxItemState eState = aQLSet.GetItemState(SID_ATTR_QUICKLAUNCHER, false, &pItem);
         if (SFX_ITEM_SET == eState)
             bQuickstart = ((SfxBoolItem*)pItem)->GetValue();
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index 41f7fdd..294d543 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -92,7 +92,7 @@ static OUString impl_GetFilterFromExt( const OUString& aUrl, SfxFilterFlags nFla
     }
     else
     {
-        SFX_APP()->GetFilterMatcher().GuessFilter( *pMedium, &pSfxFilter, nFlags, 0 );
+        SfxGetpApp()->GetFilterMatcher().GuessFilter( *pMedium, &pSfxFilter, nFlags, 0 );
     }
 
     if( pSfxFilter )
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index b35fa38..256317f 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2694,7 +2694,7 @@ namespace pcr
         try
         {
             // create the itemset for the dialog
-            SfxItemSet aCoreSet(SFX_APP()->GetPool(),
+            SfxItemSet aCoreSet(SfxGetpApp()->GetPool(),
                 SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_VALUE,
                 SID_ATTR_NUMBERFORMAT_INFO, SID_ATTR_NUMBERFORMAT_INFO,
                 0);     // ripped this somewhere ... don't understand it :(
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index 3f81077..1c67756 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -264,8 +264,6 @@ public:
     sfx2::sidebar::Theme & GetSidebarTheme();
 };
 
-#define SFX_APP() SfxGetpApp()
-
 inline SfxApplication* SfxGetpApp()
 {
     return SfxApplication::GetOrCreate();
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index bcd66e0..f1bd6bd 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -305,7 +305,7 @@ bool ScValidationData::DoMacro( const ScAddress& rPos, const OUString& rInput,
         if ( pObject->GetParent() )
             aBasicStr = pObject->GetParent()->GetName();    // Dokumentenbasic
         else
-            aBasicStr = SFX_APP()->GetName();               // Applikationsbasic
+            aBasicStr = SfxGetpApp()->GetName();               // Applikationsbasic
 
         //  Parameter fuer Makro
         SbxArrayRef refPar = new SbxArray;
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 2af5383..cec91da 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2771,7 +2771,7 @@ bool ScCompiler::IsMacro( const OUString& rName )
     StarBASIC* pObj = 0;
     SfxObjectShell* pDocSh = pDoc->GetDocumentShell();
 
-    SfxApplication* pSfxApp = SFX_APP();
+    SfxApplication* pSfxApp = SfxGetpApp();
 
     try
     {
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 3238d06..3406027 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3156,7 +3156,7 @@ void ScInterpreter::ScMacro()
     }
     else
     {
-        aBasicStr = SFX_APP()->GetName();               // Applikationsbasic
+        aBasicStr = SfxGetpApp()->GetName();               // Applikationsbasic
     }
     //  Parameter-Array zusammenbauen
 
diff --git a/sc/source/core/tool/progress.cxx b/sc/source/core/tool/progress.cxx
index c1d2991..2877a13 100644
--- a/sc/source/core/tool/progress.cxx
+++ b/sc/source/core/tool/progress.cxx
@@ -87,7 +87,7 @@ ScProgress::ScProgress( SfxObjectShell* pObjSh, const OUString& rText,
             pProgress = NULL;
         }
     }
-    else if ( SFX_APP()->IsDowning() )
+    else if ( SfxGetpApp()->IsDowning() )
     {
         //  This happens. E.g. when saving the clipboard-content as OLE when closing the app.
         //  In this case a SfxProgress would produce dirt in memory.
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index a28ddc7..2b70202 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1627,7 +1627,7 @@ void ScInputHandler::ViewShellGone(ScTabViewShell* pViewSh) // Executed synchron
         EnterHandler();
         bFormulaMode = false;
         pRefViewSh = NULL;
-        SFX_APP()->Broadcast( SfxSimpleHint( FID_REFMODECHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( FID_REFMODECHANGED ) );
         SC_MOD()->SetRefInputHdl(NULL);
         if (pInputWin)
             pInputWin->SetFormulaMode(false);
@@ -2118,7 +2118,7 @@ void ScInputHandler::DataChanged( bool bFromTopNotify, bool bSetModified )
 
 void ScInputHandler::UpdateFormulaMode()
 {
-    SfxApplication* pSfxApp = SFX_APP();
+    SfxApplication* pSfxApp = SfxGetpApp();
 
     bool bIsFormula = !bProtected && pEngine->GetParagraphCount() == 1;
     if (bIsFormula)
@@ -2362,7 +2362,7 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
 
     bool bMatrix = ( nBlockMode == SC_ENTER_MATRIX );
 
-    SfxApplication* pSfxApp     = SFX_APP();
+    SfxApplication* pSfxApp     = SfxGetpApp();
     EditTextObject* pObject     = NULL;
     ScPatternAttr*  pCellAttrs  = NULL;
     bool            bForget     = false; // Remove due to validity?
@@ -2712,7 +2712,7 @@ void ScInputHandler::CancelHandler()
             pExecuteSh->ActiveGrabFocus();
         }
         bFormulaMode = false;
-        SFX_APP()->Broadcast( SfxSimpleHint( FID_REFMODECHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( FID_REFMODECHANGED ) );
         SC_MOD()->SetRefInputHdl(NULL);
         if (pInputWin)
             pInputWin->SetFormulaMode(false);
@@ -3436,7 +3436,7 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState,
                     }
 
                     if (bStopEditing)
-                        SFX_APP()->Broadcast( SfxSimpleHint( FID_KILLEDITVIEW ) );
+                        SfxGetpApp()->Broadcast( SfxSimpleHint( FID_KILLEDITVIEW ) );
 
                     //  As long as the content is not edited, turn off online spelling.
                     //  Online spelling is turned back on in StartTable, after setting
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 57e5bec..a2e557e 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -2063,12 +2063,12 @@ ScPosWnd::ScPosWnd( Window* pParent ) :
 
     FillRangeNames();
 
-    StartListening( *SFX_APP() ); // For Navigator rangename updates
+    StartListening( *SfxGetpApp() ); // For Navigator rangename updates
 }
 
 ScPosWnd::~ScPosWnd()
 {
-    EndListening( *SFX_APP() );
+    EndListening( *SfxGetpApp() );
 
     HideTip();
 
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 5cd5851..d534592 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -185,7 +185,7 @@ ScModule::ScModule( SfxObjectFactory* pFact ) :
     SetPool( pMessagePool );
     ScGlobal::InitTextHeight( pMessagePool );
 
-    StartListening( *SFX_APP() );       // for SFX_HINT_DEINITIALIZING
+    StartListening( *SfxGetpApp() );       // for SFX_HINT_DEINITIALIZING
 }
 
 ScModule::~ScModule()
@@ -972,7 +972,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
     bool bSaveInputOptions = false;
     bool bCompileErrorCells = false;
 
-    //  SFX_APP()->SetOptions( rOptSet );
+    //  SfxGetpApp()->SetOptions( rOptSet );
 
     // No more linguistics
     if (rOptSet.HasItem(SID_ATTR_METRIC, &pItem))
@@ -1253,7 +1253,7 @@ void ScModule::ModifyOptions( const SfxItemSet& rOptSet )
         SetPrintOptions( rNewOpt );
 
         // broadcast causes all previews to recalc page numbers
-        SFX_APP()->Broadcast( SfxSimpleHint( SID_SCPRINTOPTIONS ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SID_SCPRINTOPTIONS ) );
     }
 
     if ( bSaveAppOptions )
@@ -1408,7 +1408,7 @@ bool ScModule::InputKeyEvent( const KeyEvent& rKEvt, bool bStartEdit )
 
 void ScModule::InputEnterHandler( sal_uInt8 nBlockMode )
 {
-    if ( !SFX_APP()->IsDowning() ) // Not when quitting the program
+    if ( !SfxGetpApp()->IsDowning() ) // Not when quitting the program
     {
         ScInputHandler* pHdl = GetInputHdl();
         if (pHdl)
@@ -1555,7 +1555,7 @@ void ScModule::SetRefDialog( sal_uInt16 nId, bool bVis, SfxViewFrame* pViewFrm )
             pViewFrm->SetChildWindow( nId, bVis );
         }
 
-        SfxApplication* pSfxApp = SFX_APP();
+        SfxApplication* pSfxApp = SfxGetpApp();
         pSfxApp->Broadcast( SfxSimpleHint( FID_REFMODECHANGED ) );
     }
 }
@@ -2003,7 +2003,7 @@ SfxItemSet*  ScModule::CreateItemSet( sal_uInt16 nId )
         ScUserListItem  aULItem( SCITEM_USERLIST );
         ScUserList*     pUL = ScGlobal::GetUserList();
 
-        //  SFX_APP()->GetOptions( aSet );
+        //  SfxGetpApp()->GetOptions( aSet );
 
         pRet->Put( SfxUInt16Item( SID_ATTR_METRIC,
                         sal::static_int_cast<sal_uInt16>(rAppOpt.GetAppMetric()) ) );
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 92e8f68..6cfaafa 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -80,7 +80,7 @@ static const sal_uInt16 pValueRanges[] =
 
 ScValidationDlg::ScValidationDlg(Window* pParent, const SfxItemSet* pArgSet,
     ScTabViewShell *pTabViewSh, SfxBindings *pB /*= NULL*/)
-    : ScValidationDlgBase(pParent ? pParent : SFX_APP()->GetTopWindow(),
+    : ScValidationDlgBase(pParent ? pParent : SfxGetpApp()->GetTopWindow(),
         "ValidationDialog", "modules/scalc/ui/validationdialog.ui", pArgSet, pB)
     , m_pTabVwSh(pTabViewSh)
     , m_nValuePageId(0)
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index 0c8e5d1..1c7ad53 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -104,7 +104,7 @@ bool ScDBDocFunc::AddDBRange( const OUString& rName, const ScRange& rRange, bool
     }
 
     aModificator.SetDocumentModified();
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
     return true;
 }
 
@@ -137,7 +137,7 @@ bool ScDBDocFunc::DeleteDBRange(const OUString& rName)
         }
 
         aModificator.SetDocumentModified();
-        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
         bDone = true;
     }
 
@@ -184,7 +184,7 @@ bool ScDBDocFunc::RenameDBRange( const OUString& rOld, const OUString& rNew )
                 delete pUndoColl;
 
             aModificator.SetDocumentModified();
-            SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
+            SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
             bDone = true;
         }
     }
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index f45db67..fd1d5ce 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -2016,7 +2016,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
 
     aModificator.SetDocumentModified();
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
     return bSuccess;
 }
 
@@ -2493,7 +2493,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
 
     aModificator.SetDocumentModified();
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
 
     return true;
 }
@@ -2840,7 +2840,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
 
     aModificator.SetDocumentModified();
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
 
     delete pClipDoc;
     return true;
@@ -2988,7 +2988,7 @@ bool ScDocFunc::InsertTable( SCTAB nTab, const OUString& rName, bool bRecord, bo
 
         rDocShell.PostPaintExtras();
         aModificator.SetDocumentModified();
-        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
         bSuccess = true;
     }
     else if (!bApi)
@@ -3083,7 +3083,7 @@ bool ScDocFunc::DeleteTable( SCTAB nTab, bool bRecord, bool /* bApi */ )
         rDocShell.PostPaintExtras();
         aModificator.SetDocumentModified();
 
-        SfxApplication* pSfxApp = SFX_APP();                                // Navigator
+        SfxApplication* pSfxApp = SfxGetpApp();                                // Navigator
         pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
         pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
         pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
@@ -3144,7 +3144,7 @@ bool ScDocFunc::SetTableVisible( SCTAB nTab, bool bVisible, bool bApi )
     if (!bVisible)
         rDocShell.Broadcast( ScTablesHint( SC_TAB_HIDDEN, nTab ) );
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
     rDocShell.PostPaint(0,0,0,MAXCOL,MAXROW,MAXTAB, PAINT_EXTRAS);
     aModificator.SetDocumentModified();
 
@@ -3208,7 +3208,7 @@ bool ScDocFunc::RenameTable( SCTAB nTab, const OUString& rName, bool bRecord, bo
         }
         rDocShell.PostPaintExtras();
         aModificator.SetDocumentModified();
-        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
 
         bSuccess = true;
     }
@@ -3245,7 +3245,7 @@ bool ScDocFunc::SetTabBgColor( SCTAB nTab, const Color& rColor, bool bRecord, bo
         rDocShell.PostPaintExtras();
         ScDocShellModificator aModificator( rDocShell );
         aModificator.SetDocumentModified();
-        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
 
         bSuccess = true;
     }
@@ -4843,7 +4843,7 @@ bool ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc, SCTA
     if (bModifyDoc)
     {
         aModificator.SetDocumentModified();
-        SFX_APP()->Broadcast( SfxSimpleHint(SC_HINT_AREAS_CHANGED) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint(SC_HINT_AREAS_CHANGED) );
     }
 
     return true;
@@ -4867,7 +4867,7 @@ void ScDocFunc::ModifyAllRangeNames( const boost::ptr_map<OUString, ScRangeName>
     rDoc.PostprocessRangeNameUpdate();
 
     aModificator.SetDocumentModified();
-    SFX_APP()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED));
+    SfxGetpApp()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED));
 }
 
 void ScDocFunc::CreateOneName( ScRangeName& rList,
@@ -5018,7 +5018,7 @@ bool ScDocFunc::CreateNames( const ScRange& rRange, sal_uInt16 nFlags, bool bApi
         bDone = ModifyRangeNames( aNewRanges, aTab );
 
         aModificator.SetDocumentModified();
-        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
     }
 
     return bDone;
@@ -5261,7 +5261,7 @@ bool ScDocFunc::InsertAreaLink( const OUString& rFile, const OUString& rFilter,
     if (pBindings)
         pBindings->Invalidate( SID_LINKS );
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );     // Navigator
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );     // Navigator
 
     return true;
 }
@@ -5354,7 +5354,7 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor
         rDocShell.PostPaint(*pRepaintRange, PAINT_GRID);
 
     aModificator.SetDocumentModified();
-    SFX_APP()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED));
+    SfxGetpApp()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED));
 }
 
 void ScDocFunc::SetConditionalFormatList( ScConditionalFormatList* pList, SCTAB nTab )
@@ -5384,7 +5384,7 @@ void ScDocFunc::SetConditionalFormatList( ScConditionalFormatList* pList, SCTAB
 
     rDoc.SetStreamValid(nTab, false);
     aModificator.SetDocumentModified();
-    SFX_APP()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED));
+    SfxGetpApp()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED));
 }
 
 void ScDocFunc::EnterListAction( sal_uInt16 nNameResId )
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 1e5e448..92cc36c 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -623,7 +623,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
             case SFX_HINT_TITLECHANGED:
                 aDocument.SetName( SfxShell::GetName() );
                 //  RegisterNewTargetNames gibts nicht mehr
-                SFX_APP()->Broadcast(SfxSimpleHint( SC_HINT_DOCNAME_CHANGED )); // Navigator
+                SfxGetpApp()->Broadcast(SfxSimpleHint( SC_HINT_DOCNAME_CHANGED )); // Navigator
                 break;
         }
     }
@@ -2725,7 +2725,7 @@ ScDocShell::~ScDocShell()
 
     delete pAutoStyleList;
 
-    SfxApplication *pSfxApp = SFX_APP();
+    SfxApplication *pSfxApp = SfxGetpApp();
     if ( pSfxApp->GetDdeService() ) // Delete DDE for Document
         pSfxApp->RemoveDdeTopic( this );
 
@@ -2855,7 +2855,7 @@ void ScDocShell::SetDrawModified( bool bIsModified /* = true */ )
         if ( aDocument.IsChartListenerCollectionNeedsUpdate() )
         {
             aDocument.UpdateChartListenerCollection();
-            SFX_APP()->Broadcast(SfxSimpleHint( SC_HINT_DRAW_CHANGED ));    // Navigator
+            SfxGetpApp()->Broadcast(SfxSimpleHint( SC_HINT_DRAW_CHANGED ));    // Navigator
         }
         SC_MOD()->AnythingChanged();
     }
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index e3eb97b..8544435 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -82,7 +82,7 @@ void ScDocShell::PostEditView( ScEditEngineDefaulter* pEditEngine, const ScAddre
 void ScDocShell::PostDataChanged()
 {
     Broadcast( SfxSimpleHint( FID_DATACHANGED ) );
-    SFX_APP()->Broadcast(SfxSimpleHint( FID_ANYDATACHANGED ));      // Navigator
+    SfxGetpApp()->Broadcast(SfxSimpleHint( FID_ANYDATACHANGED ));      // Navigator
     aDocument.ClearFormulaContext();
     //! Navigator direkt benachrichtigen!
 }
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 0f5a9cf..2aa636a 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -660,7 +660,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
                     rReq.Ignore();
                     break;
                 }
-                SfxApplication* pApp = SFX_APP();
+                SfxApplication* pApp = SfxGetpApp();
                 const SfxPoolItem* pItem;
                 SfxMedium* pMed = NULL;
                 if ( pReqArgs &&
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index d9ba6d3..7d06981 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -299,7 +299,7 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe
 
             //  "Import1" etc am Navigator bekanntmachen
             if (eMode==SC_DB_IMPORT)
-                SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
+                SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
         }
         pData = pNoNameData;
     }
@@ -741,7 +741,7 @@ void ScDocShell::ModifyScenario( SCTAB nTab, const OUString& rName, const OUStri
     aModificator.SetDocumentModified();
 
     if (!aOldName.equals(rName))
-        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
 
     SfxBindings* pBindings = GetViewBindings();
     if (pBindings)
@@ -807,7 +807,7 @@ SCTAB ScDocShell::MakeScenario( SCTAB nTab, const OUString& rName, const OUStrin
             PostPaintExtras();                                          // Tabellenreiter
             aModificator.SetDocumentModified();
 
-            SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+            SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
 
             return nNewTab;
         }
@@ -978,7 +978,7 @@ bool ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, bool bCopy, bool bRec
     PostPaintGridAll();
     PostPaintExtras();
     aModificator.SetDocumentModified();
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
 
     return true;
 }
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index f251164..6757d36 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2352,7 +2352,7 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt
         setRelativeFileName(nFileId, aStr);
     }
 
-    SfxItemSet* pSet = new SfxAllItemSet(SFX_APP()->GetPool());
+    SfxItemSet* pSet = new SfxAllItemSet(SfxGetpApp()->GetPool());
     if (!aOptions.isEmpty())
         pSet->Put(SfxStringItem(SID_FILE_FILTEROPTIONS, aOptions));
 
diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx
index b23f9c7..39d3ee1 100644
--- a/sc/source/ui/docshell/servobj.cxx
+++ b/sc/source/ui/docshell/servobj.cxx
@@ -103,7 +103,7 @@ ScServerObject::ScServerObject( ScDocShell* pShell, const OUString& rItem ) :
     pDocSh->GetDocument().StartListeningArea( aRange, &aForwarder );
 
     StartListening(*pDocSh);        // um mitzubekommen, wenn die DocShell geloescht wird
-    StartListening(*SFX_APP());     // for SC_HINT_AREAS_CHANGED
+    StartListening(*SfxGetpApp());     // for SC_HINT_AREAS_CHANGED
 }
 
 ScServerObject::~ScServerObject()
@@ -121,7 +121,7 @@ void ScServerObject::Clear()
         pTemp->GetDocument().EndListeningArea( aRange, &aForwarder );
         pTemp->GetDocument().GetLinkManager()->RemoveServer( this );
         EndListening(*pTemp);
-        EndListening(*SFX_APP());
+        EndListening(*SfxGetpApp());
     }
 }
 
@@ -156,7 +156,7 @@ bool ScServerObject::GetData(
         EndListeningAll();
         pDocSh->GetDocument().StartListeningArea( aRange, &aForwarder );
         StartListening(*pDocSh);
-        StartListening(*SFX_APP());
+        StartListening(*SfxGetpApp());
         bRefreshListener = false;
     }
 
@@ -206,7 +206,7 @@ void ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
         if ( rHint.ISA(SfxSimpleHint) && ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
         {
             pDocSh = NULL;
-            EndListening(*SFX_APP());
+            EndListening(*SfxGetpApp());
             //  don't access DocShell anymore for EndListening etc.
         }
     }
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index 9059a27..8ece986 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -190,7 +190,7 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter,
         aOptions = *pNewOptions;
 
     //  ItemSet immer anlegen, damit die DocShell die Optionen setzen kann
-    SfxItemSet* pSet = new SfxAllItemSet( SFX_APP()->GetPool() );
+    SfxItemSet* pSet = new SfxAllItemSet( SfxGetpApp()->GetPool() );
     if (!aOptions.isEmpty())
         pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, aOptions ) );
 
@@ -507,7 +507,7 @@ SfxMedium* ScDocumentLoader::CreateMedium( const OUString& rFileName, const SfxF
         const OUString& rOptions )
 {
     // Always create SfxItemSet so ScDocShell can set options.
-    SfxItemSet* pSet = new SfxAllItemSet( SFX_APP()->GetPool() );
+    SfxItemSet* pSet = new SfxAllItemSet( SfxGetpApp()->GetPool() );
     if ( !rOptions.isEmpty() )
         pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, rOptions ) );
 
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index aec10e8..ec6d47f 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -316,7 +316,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
 
 void ScDrawShell::ExecuteMacroAssign( SdrObject* pObj, Window* pWin )
 {
-    SvxMacroItem aItem ( SFX_APP()->GetPool().GetWhich( SID_ATTR_MACROITEM ) );
+    SvxMacroItem aItem ( SfxGetpApp()->GetPool().GetWhich( SID_ATTR_MACROITEM ) );
     ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, true );
     if ( !pInfo->GetMacro().isEmpty() )
     {
@@ -327,7 +327,7 @@ void ScDrawShell::ExecuteMacroAssign( SdrObject* pObj, Window* pWin )
     }
 
     // create empty itemset for macro-dlg
-    boost::scoped_ptr<SfxItemSet> pItemSet(new SfxItemSet(SFX_APP()->GetPool(), SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG, 0 ));
+    boost::scoped_ptr<SfxItemSet> pItemSet(new SfxItemSet(SfxGetpApp()->GetPool(), SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG, 0 ));
     pItemSet->Put ( aItem, SID_ATTR_MACROITEM );
 
     SfxEventNamesItem aNamesItem(SID_EVENTCONFIG);
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 4d28415..37db74e 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -611,7 +611,7 @@ void ScFormulaReferenceHelper::ToggleCollapsed( formula::RefEdit* pEdit, formula
 
 bool ScFormulaReferenceHelper::DoClose( sal_uInt16 nId )
 {
-    SfxApplication* pSfxApp = SFX_APP();
+    SfxApplication* pSfxApp = SfxGetpApp();
 
     SetDispatcherLock( false );         //! here and in dtor ?
 
diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx
index b05d69b..36a36d0 100644
--- a/sc/source/ui/namedlg/namedefdlg.cxx
+++ b/sc/source/ui/namedlg/namedefdlg.cxx
@@ -244,7 +244,7 @@ void ScNameDefDlg::AddPushed()
                     // call invalidates the stream
                     if (nTab != -1)
                         mpDoc->SetStreamValid(nTab, false);
-                    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
+                    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
                     mpDocShell->SetDocumentModified();
                     Close();
                 }
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 9da736c..70624af 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -628,7 +628,7 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, Win
 
     rBindings.LEAVEREGISTRATIONS();
 
-    StartListening( *(SFX_APP()) );
+    StartListening( *(SfxGetpApp()) );
     StartListening( rBindings );
 
     aLbDocuments.Hide();        // bei NAV_LMODE_NONE gibts die nicht
@@ -690,7 +690,7 @@ ScNavigatorDlg::~ScNavigatorDlg()
     delete [] ppBoundItems;
     delete pMarkArea;
 
-    EndListening( *(SFX_APP()) );
+    EndListening( *(SfxGetpApp()) );
     EndListening( rBindings );
 }
 
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 7128146..982925d 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -513,7 +513,7 @@ void ScUndoDeleteCells::Undo()
     BeginUndo();
     DoChange( true );
     EndUndo();
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
 
     // Selection not until EndUndo
     ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
@@ -536,7 +536,7 @@ void ScUndoDeleteCells::Redo()
     BeginRedo();
     DoChange( false);
     EndRedo();
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
 
     ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
     if (pViewShell)
@@ -695,7 +695,7 @@ void ScUndoDeleteMulti::Undo()
     //! since no data for selection exist
 
     EndUndo();
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
 }
 
 void ScUndoDeleteMulti::Redo()
@@ -722,7 +722,7 @@ void ScUndoDeleteMulti::Redo()
     DoChange();
 
     EndRedo();
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
 }
 
 void ScUndoDeleteMulti::Repeat(SfxRepeatTarget& rTarget)
@@ -1073,7 +1073,7 @@ void ScUndoPaste::Undo()
     if (!maBlockRanges.empty())
         ShowTable(*maBlockRanges.front());
     EndUndo();
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
 }
 
 void ScUndoPaste::Redo()
@@ -1084,7 +1084,7 @@ void ScUndoPaste::Redo()
     DoChange( false );
     EnableDrawAdjust( &rDoc, true );                 //! include in ScBlockUndo?
     EndRedo();
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
 }
 
 void ScUndoPaste::Repeat(SfxRepeatTarget& rTarget)
@@ -1291,7 +1291,7 @@ void ScUndoDragDrop::Undo()
     }
 
     EndUndo();
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
 }
 
 void ScUndoDragDrop::Redo()
@@ -1375,7 +1375,7 @@ void ScUndoDragDrop::Redo()
     EnableDrawAdjust( &rDoc, true );             //! include in ScBlockUndo?
 
     EndRedo();
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
 }
 
 void ScUndoDragDrop::Repeat(SfxRepeatTarget& /* rTarget */)
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index e80c526..661f3e9 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -1526,7 +1526,7 @@ void ScUndoInsertAreaLink::Undo()
     if (pLink)
         pLinkManager->Remove( pLink );
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );     // Navigator
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );     // Navigator
 }
 
 void ScUndoInsertAreaLink::Redo()
@@ -1542,7 +1542,7 @@ void ScUndoInsertAreaLink::Redo()
     pLink->Update();
     pLink->SetInCreate( false );
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );     // Navigator
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );     // Navigator
 }
 
 void ScUndoInsertAreaLink::Repeat(SfxRepeatTarget& /* rTarget */)
@@ -1591,7 +1591,7 @@ void ScUndoRemoveAreaLink::Undo()
     pLink->Update();
     pLink->SetInCreate( false );
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );     // Navigator
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );     // Navigator
 }
 
 void ScUndoRemoveAreaLink::Redo()
@@ -1604,7 +1604,7 @@ void ScUndoRemoveAreaLink::Redo()
     if (pLink)
         pLinkManager->Remove( pLink );
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );     // Navigator
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );     // Navigator
 }
 
 void ScUndoRemoveAreaLink::Repeat(SfxRepeatTarget& /* rTarget */)
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index 8e6c7cf..5ece768 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -1010,7 +1010,7 @@ void ScUndoRangeNames::DoChange( bool bUndo )
 
     rDoc.PostprocessRangeNameUpdate();
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
 }
 
 void ScUndoRangeNames::Undo()
diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
index 4d6111b..b6bc5d6 100644
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@ -1135,7 +1135,7 @@ void ScUndoDBData::Undo()
     rDoc.CompileDBFormula( false );    // CompileFormulaString
     rDoc.SetAutoCalc( bOldAutoCalc );
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
 
     EndUndo();
 }
@@ -1153,7 +1153,7 @@ void ScUndoDBData::Redo()
     rDoc.CompileDBFormula( false );    // CompileFormulaString
     rDoc.SetAutoCalc( bOldAutoCalc );
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
 
     EndRedo();
 }
@@ -1974,7 +1974,7 @@ void ScUndoDataForm::Undo()
         DoChange( true );
         ShowTable( aBlockRange );
         EndUndo();
-        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
 }
 
 void ScUndoDataForm::Redo()
@@ -1985,7 +1985,7 @@ void ScUndoDataForm::Redo()
         DoChange( false );
         EnableDrawAdjust( &rDoc, true );                                 //! include in ScBlockUndo?
         EndRedo();
-        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
 }
 
 void ScUndoDataForm::Repeat(SfxRepeatTarget& /*rTarget*/)
diff --git a/sc/source/ui/undo/undorangename.cxx b/sc/source/ui/undo/undorangename.cxx
index 4c06b29..8eafa6b 100644
--- a/sc/source/ui/undo/undorangename.cxx
+++ b/sc/source/ui/undo/undorangename.cxx
@@ -80,7 +80,7 @@ void ScUndoAllRangeNames::DoChange(const boost::ptr_map<OUString, ScRangeName>&
     rDoc.SetAllRangeNames(rNames);
     rDoc.PostprocessRangeNameUpdate();
 
-    SFX_APP()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED));
+    SfxGetpApp()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED));
 }
 
 ScUndoAddRangeData::ScUndoAddRangeData(ScDocShell* pDocSh, ScRangeData* pRangeData, SCTAB nTab) :
@@ -109,7 +109,7 @@ void ScUndoAddRangeData::Undo()
         pRangeName = rDoc.GetRangeName( mnTab );
     }
     pRangeName->erase(*mpRangeData);
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
 
 }
 
@@ -126,7 +126,7 @@ void ScUndoAddRangeData::Redo()
         pRangeName = rDoc.GetRangeName( mnTab );
     }
     pRangeName->insert(new ScRangeData(*mpRangeData));
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
 }
 
 void ScUndoAddRangeData::Repeat(SfxRepeatTarget& /*rTarget*/)
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index 67772dc..b5091d59 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -377,7 +377,7 @@ void ScUndoDeleteTab::Undo()
     {
         pDocShell->Broadcast( ScTablesHint( SC_TAB_INSERTED, theTabs[i]) );
     }
-    SfxApplication* pSfxApp = SFX_APP();                                // Navigator
+    SfxApplication* pSfxApp = SfxGetpApp();                                // Navigator
     pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
     pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
     pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
@@ -448,7 +448,7 @@ void ScUndoRenameTab::DoChange( SCTAB nTabP, const OUString& rName ) const
     ScDocument& rDoc = pDocShell->GetDocument();
     rDoc.RenameTab( nTabP, rName );
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );    // Navigator
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );    // Navigator
 
     pDocShell->PostPaintGridAll();
     pDocShell->PostPaintExtras();
@@ -556,7 +556,7 @@ void ScUndoMoveTab::DoChange( bool bUndo ) const
         }
     }
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );    // Navigator
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );    // Navigator
 
     pDocShell->PostPaintGridAll();
     pDocShell->PostPaintExtras();
@@ -617,7 +617,7 @@ void ScUndoCopyTab::DoChange() const
     if (pViewShell)
         pViewShell->SetTabNo((*mpOldTabs)[0],true);
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );    // Navigator
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );    // Navigator
 
     pDocShell->PostPaintGridAll();
     pDocShell->PostPaintExtras();
@@ -836,7 +836,7 @@ void ScUndoMakeScenario::Undo()
     if (pViewShell)
         pViewShell->SetTabNo( nSrcTab, true );
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
 
     //  SetTabNo(...,sal_True) for all views to sync with drawing layer pages
     pDocShell->Broadcast( SfxSimpleHint( SC_HINT_FORCESETTAB ) );
@@ -860,7 +860,7 @@ void ScUndoMakeScenario::Redo()
     if (pViewShell)
         pViewShell->SetTabNo( nDestTab, true );
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
 }
 
 void ScUndoMakeScenario::Repeat(SfxRepeatTarget& rTarget)
@@ -915,7 +915,7 @@ void ScUndoImportTab::DoChange() const
         }
     }
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );    // Navigator
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );    // Navigator
     pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB,
                                 PAINT_GRID | PAINT_TOP | PAINT_LEFT | PAINT_EXTRAS );
 }
@@ -1140,7 +1140,7 @@ void ScUndoShowHideTab::DoChange( bool bShowP ) const
             pViewShell->SetTabNo(nTab,true);
     }
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
     pDocShell->SetDocumentModified();
 }
 
@@ -1425,7 +1425,7 @@ void ScUndoScenarioFlags::Undo()
         pViewShell->UpdateInputHandler();
 
     if ( aOldName != aNewName )
-        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
 }
 
 void ScUndoScenarioFlags::Redo()
@@ -1442,7 +1442,7 @@ void ScUndoScenarioFlags::Redo()
         pViewShell->UpdateInputHandler();
 
     if ( aOldName != aNewName )
-        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
 }
 
 void ScUndoScenarioFlags::Repeat(SfxRepeatTarget& /* rTarget */)
diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx
index 4d165df..e10ec30 100644
--- a/sc/source/ui/unoobj/appluno.cxx
+++ b/sc/source/ui/unoobj/appluno.cxx
@@ -496,7 +496,7 @@ void SAL_CALL ScSpreadsheetSettings::setPropertyValue(
         ScPrintOptions aPrintOpt(pScMod->GetPrintOptions());
         aPrintOpt.SetSkipEmpty( !ScUnoHelpFunctions::GetBoolFromAny( aValue ) );    // reversed
         pScMod->SetPrintOptions( aPrintOpt );
-        SFX_APP()->Broadcast( SfxSimpleHint( SID_SCPRINTOPTIONS ) );    // update previews
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SID_SCPRINTOPTIONS ) );    // update previews
     }
 
     if ( bSaveApp )
diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx
index b171bf6..4d4a9b7 100644
--- a/sc/source/ui/unoobj/funcuno.cxx
+++ b/sc/source/ui/unoobj/funcuno.cxx
@@ -179,7 +179,7 @@ ScFunctionAccess::ScFunctionAccess() :
     mbArray( true ),    // default according to behaviour of older Office versions
     mbValid( true )
 {
-    StartListening( *SFX_APP() );       // for SFX_HINT_DEINITIALIZING
+    StartListening( *SfxGetpApp() );       // for SFX_HINT_DEINITIALIZING
 }
 
 ScFunctionAccess::~ScFunctionAccess()
diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx
index d483685..859117a 100644
--- a/sc/source/ui/unoobj/servuno.cxx
+++ b/sc/source/ui/unoobj/servuno.cxx
@@ -614,7 +614,7 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance(
                     aArgs[ 0 ] <<= pDocShell->GetModel();
                     xRet = ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( OUString( "ooo.vba.excel.Globals" ), aArgs );
                     pDocShell->GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", uno::Any( xRet ) );
-                    BasicManager* pAppMgr = SFX_APP()->GetBasicManager();
+                    BasicManager* pAppMgr = SfxGetpApp()->GetBasicManager();
                     if ( pAppMgr )
                         pAppMgr->SetGlobalUNOConstant( "ThisExcelDoc", aArgs[ 0 ] );
 
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index b2c8257..604a714 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -1741,7 +1741,7 @@ void ScTabViewObj::SelectionChanged()
     // will cause the style dialog to be raised so we go
     // direct here
     ScFormatShell aShell( &GetViewShell()->GetViewData() );
-    SfxAllItemSet reqList( SFX_APP()->GetPool() );
+    SfxAllItemSet reqList( SfxGetpApp()->GetPool() );
     SfxRequest aReq( SID_STYLE_END_PREVIEW, 0, reqList );
     aShell.ExecuteStyle( aReq );
     lang::EventObject aEvent;
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index 81aafa2..6426232 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -463,7 +463,7 @@ ScVbaApplication::Windows( const uno::Any& aIndex  ) throw (uno::RuntimeExceptio
 void SAL_CALL
 ScVbaApplication::wait( double time ) throw (uno::RuntimeException, std::exception)
 {
-    StarBASIC* pBasic = SFX_APP()->GetBasic();
+    StarBASIC* pBasic = SfxGetpApp()->GetBasic();
     SbxArrayRef aArgs = new SbxArray;
     SbxVariableRef aRef = new SbxVariable;
     aRef->PutDouble( time );
@@ -1238,7 +1238,7 @@ ScVbaApplication::getDisplayFormulaBar()
     if ( pViewShell )
     {
         SfxBoolItem sfxFormBar( FID_TOGGLEINPUTLINE);
-        SfxAllItemSet reqList(  SFX_APP()->GetPool() );
+        SfxAllItemSet reqList(  SfxGetpApp()->GetPool() );
         reqList.Put( sfxFormBar );
 
         pViewShell->GetState( reqList );
@@ -1257,7 +1257,7 @@ ScVbaApplication::setDisplayFormulaBar( sal_Bool _displayformulabar )
     if ( pViewShell && ( _displayformulabar !=  getDisplayFormulaBar() ) )
     {
         SfxBoolItem sfxFormBar( FID_TOGGLEINPUTLINE, _displayformulabar);
-        SfxAllItemSet reqList(  SFX_APP()->GetPool() );
+        SfxAllItemSet reqList(  SfxGetpApp()->GetPool() );
         SfxRequest aReq( FID_TOGGLEINPUTLINE, 0, reqList );
         pViewShell->Execute( aReq );
     }
@@ -1266,7 +1266,7 @@ ScVbaApplication::setDisplayFormulaBar( sal_Bool _displayformulabar )
 uno::Any SAL_CALL
 ScVbaApplication::Caller( const uno::Any& /*aIndex*/ ) throw ( uno::RuntimeException, std::exception )
 {
-    StarBASIC* pBasic = SFX_APP()->GetBasic();
+    StarBASIC* pBasic = SfxGetpApp()->GetBasic();
     SbMethod* pMeth = (SbMethod*)pBasic->GetRtl()->Find( OUString("FuncCaller"), SbxCLASS_METHOD );
     uno::Any aRet;
     if ( pMeth )
diff --git a/sc/source/ui/vba/vbahelper.cxx b/sc/source/ui/vba/vbahelper.cxx
index 662ffec..a29ae35 100644
--- a/sc/source/ui/vba/vbahelper.cxx
+++ b/sc/source/ui/vba/vbahelper.cxx
@@ -232,7 +232,7 @@ void implnPasteSpecial(sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpt
 getCurrentDocument() throw (uno::RuntimeException)
 {
     uno::Reference< frame::XModel > xModel;
-    SbxObject* pBasic = dynamic_cast< SbxObject* > ( SFX_APP()->GetBasic() );
+    SbxObject* pBasic = dynamic_cast< SbxObject* > ( SfxGetpApp()->GetBasic() );
     SbxObject* basicChosen =  pBasic ;
     if ( basicChosen == NULL)
     {
@@ -405,7 +405,7 @@ void PrintOutHelper( const uno::Any& From, const uno::Any& To, const uno::Any& C
         pViewFrame = pViewShell->GetViewFrame();
     if ( pViewFrame )
     {
-        SfxAllItemSet aArgs( SFX_APP()->GetPool() );
+        SfxAllItemSet aArgs( SfxGetpApp()->GetPool() );
 
         SfxBoolItem sfxCollate( SID_PRINT_COLLATE, bCollate );
         aArgs.Put( sfxCollate, sfxCollate.Which() );
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 521f224e..a14bb31 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -3574,7 +3574,7 @@ ScVbaRange::End( ::sal_Int32 Direction )  throw (uno::RuntimeException, std::exc
     SfxViewFrame* pViewFrame = excel::getViewFrame( xModel );
     if ( pViewFrame )
     {
-        SfxAllItemSet aArgs( SFX_APP()->GetPool() );
+        SfxAllItemSet aArgs( SfxGetpApp()->GetPool() );
         // Hoping this will make sure this slot is called
         // synchronously
         SfxBoolItem sfxAsync( SID_ASYNCHRON, false );
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index 3472140..a1a5fc2 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -226,7 +226,7 @@ void ScDBFunc::NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const std::
     pOldColl = NULL;
     pDocShell->PostPaint(ScRange(0, 0, 0, MAXCOL, MAXROW, MAXTAB), PAINT_GRID);
     aModificator.SetDocumentModified();
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
 
     if (bRecord)
     {
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 09293c0..ba0d50d 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -626,7 +626,7 @@ bool ScDBFunc::MakePivotTable(
     if ( bNewTable )
     {
         pDocSh->PostPaintExtras();
-        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
     }
 
     return bSuccess;
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 691d2b0..121a9cc 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -135,7 +135,7 @@ void ScPreviewShell::Construct( Window* pParent )
     SetPool( &SC_MOD()->GetPool() );
     SetWindow( pPreview );
     StartListening(*pDocShell,true);
-    StartListening(*SFX_APP(),true);        // #i62045# #i62046# application is needed for Calc's own hints
+    StartListening(*SfxGetpApp(),true);        // #i62045# #i62046# application is needed for Calc's own hints
     SfxBroadcaster* pDrawBC = pDocShell->GetDocument().GetDrawBroadcaster();
     if (pDrawBC)
         StartListening(*pDrawBC);
@@ -192,7 +192,7 @@ ScPreviewShell::~ScPreviewShell()
     SfxBroadcaster* pDrawBC = pDocShell->GetDocument().GetDrawBroadcaster();
     if (pDrawBC)
         EndListening(*pDrawBC);
-    EndListening(*SFX_APP());
+    EndListening(*SfxGetpApp());
     EndListening(*pDocShell);
 
     SetWindow(0);
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index ed254f0..f46b5bf 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -165,7 +165,7 @@ void ScTabViewShell::Activate(bool bMDI)
 
         if ( bFirstActivate )
         {
-            SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_NAVIGATOR_UPDATEALL ) );
+            SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_NAVIGATOR_UPDATEALL ) );
             bFirstActivate = false;
 
             // ReadExtOptions (view settings from Excel import) must also be done
@@ -1566,7 +1566,7 @@ bool ScTabViewShell::KeyInput( const KeyEvent &rKeyEvent )
 
 void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
 {
-    SfxApplication* pSfxApp  = SFX_APP();
+    SfxApplication* pSfxApp  = SfxGetpApp();
     ScDocShell* pDocSh = GetViewData().GetDocShell();
     ScDocument& rDoc = pDocSh->GetDocument();
     bReadOnly = pDocSh->IsReadOnly();
@@ -1819,7 +1819,7 @@ ScTabViewShell::~ScTabViewShell()
     ScDocShell* pDocSh = GetViewData().GetDocShell();
     EndListening(*pDocSh);
     EndListening(*GetViewFrame());
-    EndListening(*SFX_APP());           // #i62045# #i62046# needed now - SfxViewShell no longer does it
+    EndListening(*SfxGetpApp());           // #i62045# #i62046# needed now - SfxViewShell no longer does it
 
     SC_MOD()->ViewShellGone(this);
 
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index b3fb6a3..858bfa7 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -367,7 +367,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
                 {
                     pDlg->Execute();
                     rBindings.Invalidate( nSlot );
-                    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );     // Navigator
+                    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );     // Navigator
                     rReq.Done();
                 }
             }
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 5cdb610..8404452 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1892,7 +1892,7 @@ bool ScViewFunc::InsertTables(std::vector<OUString>& aNames, SCTAB nTab,
         SetTabNo( nTab, true );
         pDocSh->PostPaintExtras();
         pDocSh->SetDocumentModified();
-        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
         return true;
     }
     else
@@ -1923,7 +1923,7 @@ bool ScViewFunc::AppendTable( const OUString& rName, bool bRecord )
         SetTabNo( nTab, true );
         pDocSh->PostPaintExtras();
         pDocSh->SetDocumentModified();
-        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
         return true;
     }
     else
@@ -1982,7 +1982,7 @@ bool ScViewFunc::DeleteTables( const SCTAB nTab, SCTAB nSheets )
         pDocSh->PostPaintExtras();
         pDocSh->SetDocumentModified();
 
-        SfxApplication* pSfxApp = SFX_APP();                                // Navigator
+        SfxApplication* pSfxApp = SfxGetpApp();                                // Navigator
         pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
         pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
         pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
@@ -2106,7 +2106,7 @@ bool ScViewFunc::DeleteTables(const vector<SCTAB> &TheTabs, bool bRecord )
         pDocSh->PostPaintExtras();
         pDocSh->SetDocumentModified();
 
-        SfxApplication* pSfxApp = SFX_APP();                                // Navigator
+        SfxApplication* pSfxApp = SfxGetpApp();                                // Navigator
         pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
         pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) );
         pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
@@ -2305,7 +2305,7 @@ void ScViewFunc::ImportTables( ScDocShell* pSrcShell,
     pDocSh->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB,
                                 PAINT_GRID | PAINT_TOP | PAINT_LEFT | PAINT_EXTRAS );
 
-    SfxApplication* pSfxApp = SFX_APP();
+    SfxApplication* pSfxApp = SfxGetpApp();
     pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
     pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
 
@@ -2535,7 +2535,7 @@ void ScViewFunc::MoveTable(
         TheTabs.clear();
 
         pDestShell->SetDocumentModified();
-        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
     }
     else
     {
@@ -2692,7 +2692,7 @@ void ScViewFunc::ShowTable( const std::vector<OUString>& rNames )
         {
             rDoc.SetVisible( nPos, true );
             SetTabNo( nPos, true );
-            SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+            SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
             if (!bFound)
                 bFound = true;
             if (bUndo)
@@ -2752,7 +2752,7 @@ void ScViewFunc::HideTable( const ScMarkData& rMark )
         }
 
         //  Update views
-        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) );
         pDocSh->PostPaint(0,0,0,MAXCOL,MAXROW,MAXTAB, PAINT_EXTRAS);
         pDocSh->SetDocumentModified();
     }
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index ed0d0f5..b139987 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1727,7 +1727,7 @@ void ScViewFunc::DeleteMulti( bool bRows, bool bRecord )
         nCurX = static_cast<SCCOL>(aSpans[0].mnStart);
     SetCursor( nCurX, nCurY );
 
-    SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
+    SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
 }
 
 //  delete contents
@@ -2784,7 +2784,7 @@ bool ScViewFunc::InsertName( const OUString& rName, const OUString& rSymbol,
         rDoc.PostprocessRangeNameUpdate();
 
         aModificator.SetDocumentModified();
-        SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
+        SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) );
     }
 
     delete pNewEntry;       // if it wasn't inserted
diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx
index 6e8d5b3..0f27e92 100644
--- a/scripting/source/basprov/basprov.cxx
+++ b/scripting/source/basprov/basprov.cxx
@@ -271,10 +271,10 @@ namespace basprov
 
         // TODO
         if ( !m_pAppBasicManager )
-            m_pAppBasicManager = SFX_APP()->GetBasicManager();
+            m_pAppBasicManager = SfxGetpApp()->GetBasicManager();
 
         if ( !m_xLibContainerApp.is() )
-            m_xLibContainerApp = Reference< script::XLibraryContainer >( SFX_APP()->GetBasicContainer(), UNO_QUERY );
+            m_xLibContainerApp = Reference< script::XLibraryContainer >( SfxGetpApp()->GetBasicContainer(), UNO_QUERY );
     }
 
 
diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx
index bf66765..d77ec5c 100644
--- a/scripting/source/dlgprov/dlgevtatt.cxx
+++ b/scripting/source/dlgprov/dlgevtatt.cxx
@@ -630,7 +630,7 @@ namespace dlgprov
         }
         else
         {
-            ResMgr* pResMgr = SFX_APP()->GetSfxResManager();
+            ResMgr* pResMgr = SfxGetpApp()->GetSfxResManager();
             if( pResMgr )
             {
                 OUString aRes( ResId(STR_ERRUNOEVENTBINDUNG, *pResMgr) );
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index 6367e2c..bebd3ae 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -354,7 +354,7 @@ static OUString aResourceResolverPropName("ResourceResolver");
 
             if ( sLocation == "application" )
             {
-                xLibContainer = Reference< XLibraryContainer >( SFX_APP()->GetDialogContainer(), UNO_QUERY );
+                xLibContainer = Reference< XLibraryContainer >( SfxGetpApp()->GetDialogContainer(), UNO_QUERY );
             }
             else if ( sLocation == "document" )
             {
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 65b6ff7..72fab2c 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -201,7 +201,7 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium& rMedium)
     if ( !pFilter )
     {
         rMedium.UseInteractionHandler( true );
-        SFX_APP()->GetFilterMatcher().GuessFilter( rMedium, &pFilter );
+        SfxGetpApp()->GetFilterMatcher().GuessFilter( rMedium, &pFilter );
     }
 
     if ( !pFilter )
diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx
index 871bbc0..9bd820d 100644
--- a/sd/source/ui/app/sdmod.cxx
+++ b/sd/source/ui/app/sdmod.cxx
@@ -83,7 +83,7 @@ SdModule::SdModule(SfxObjectFactory* pFact1, SfxObjectFactory* pFact2 )
     SetName( OUString( "StarDraw" ) );  // Do not translate!
     pSearchItem = new SvxSearchItem(SID_SEARCH_ITEM);
     pSearchItem->SetAppFlag(SVX_SEARCHAPP_DRAW);
-    StartListening( *SFX_APP() );
+    StartListening( *SfxGetpApp() );
     SvxErrorHandler::ensure();
     mpErrorHdl = new SfxErrorHandler( RID_SD_ERRHDL,
                                          ERRCODE_AREA_SD,
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index a10cbf3..b4d7256 100644
--- a/sd/source/ui/app/sdmod1.cxx
+++ b/sd/source/ui/app/sdmod1.cxx
@@ -99,7 +99,7 @@ void SdModule::Execute(SfxRequest& rReq)
     {
         case SID_NEWDOC:
         {
-            SFX_APP()->ExecuteSlot(rReq, SFX_APP()->GetInterface());
+            SfxGetpApp()->ExecuteSlot(rReq, SfxGetpApp()->GetInterface());
         }
         break;
 
@@ -230,7 +230,7 @@ void SdModule::Execute(SfxRequest& rReq)
 
             if (!bIntercept)
             {
-                SFX_APP()->ExecuteSlot(rReq, SFX_APP()->GetInterface());
+                SfxGetpApp()->ExecuteSlot(rReq, SfxGetpApp()->GetInterface());
             }
             else
             {
@@ -358,7 +358,7 @@ void SdModule::GetState(SfxItemSet& rItemSet)
     // state of SID_OPENDOC is determined by the base class
     if (rItemSet.GetItemState(SID_OPENDOC) != SFX_ITEM_UNKNOWN)
     {
-        const SfxPoolItem* pItem = SFX_APP()->GetSlotState(SID_OPENDOC, SFX_APP()->GetInterface());
+        const SfxPoolItem* pItem = SfxGetpApp()->GetSlotState(SID_OPENDOC, SfxGetpApp()->GetInterface());
         if (pItem)
             rItemSet.Put(*pItem);
     }
@@ -366,7 +366,7 @@ void SdModule::GetState(SfxItemSet& rItemSet)
     // state of SID_OPENHYPERLINK is determined by the base class
     if (rItemSet.GetItemState(SID_OPENHYPERLINK) != SFX_ITEM_UNKNOWN)
     {
-        const SfxPoolItem* pItem = SFX_APP()->GetSlotState(SID_OPENHYPERLINK, SFX_APP()->GetInterface());
+        const SfxPoolItem* pItem = SfxGetpApp()->GetSlotState(SID_OPENHYPERLINK, SfxGetpApp()->GetInterface());
         if (pItem)
             rItemSet.Put(*pItem);
     }
@@ -498,10 +498,10 @@ SfxFrame* SdModule::CreateFromTemplate( const OUString& rTemplatePath, const Ref
 
     SfxObjectShellLock xDocShell;
 
-    SfxItemSet* pSet = new SfxAllItemSet( SFX_APP()->GetPool() );
+    SfxItemSet* pSet = new SfxAllItemSet( SfxGetpApp()->GetPool() );
     pSet->Put( SfxBoolItem( SID_TEMPLATE, true ) );
 
-    sal_uLong lErr = SFX_APP()->LoadTemplate( xDocShell, rTemplatePath, true, pSet );
+    sal_uLong lErr = SfxGetpApp()->LoadTemplate( xDocShell, rTemplatePath, true, pSet );
 
     SfxObjectShell* pDocShell = xDocShell;
 
@@ -601,7 +601,7 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq )
                         }
                         else
                         {
-                            SfxRequest aRequest (SID_OPENDOC, SFX_CALLMODE_SYNCHRON, SFX_APP()->GetPool());
+                            SfxRequest aRequest (SID_OPENDOC, SFX_CALLMODE_SYNCHRON, SfxGetpApp()->GetPool());
                             aRequest.AppendItem (aFile);
                             aRequest.AppendItem (aReferer);
                             // Put the password into the request
@@ -613,7 +613,7 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq )
                                 OUString("_default")));
                             try
                             {
-                                const SfxPoolItem* pRet = SFX_APP()->ExecuteSlot (aRequest);
+                                const SfxPoolItem* pRet = SfxGetpApp()->ExecuteSlot (aRequest);
                                 const SfxViewFrameItem* pFrameItem = PTR_CAST( SfxViewFrameItem, pRet );
                                 if ( pFrameItem )
                                     pFrame = &pFrameItem->GetFrame()->GetFrame();
diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx
index b434666..0e7f4d3 100644
--- a/sd/source/ui/dlg/dlgass.cxx
+++ b/sd/source/ui/dlg/dlgass.cxx
@@ -1406,7 +1406,7 @@ void AssistentDlgImpl::UpdatePreview( bool bDocPreview )
     OUString aDocFile = GetDocFileName();
     OUString aLayoutFile = GetLayoutFileName();
 
-    SfxApplication *pSfxApp = SFX_APP();
+    SfxApplication *pSfxApp = SfxGetpApp();
     sal_uLong lErr;
     bool bChangeMaster = !aLayoutFile.isEmpty();
 
@@ -1468,14 +1468,14 @@ void AssistentDlgImpl::UpdatePreview( bool bDocPreview )
         }
         else
         {
-            SfxRequest aReq( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, SFX_APP()->GetPool() );
+            SfxRequest aReq( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, SfxGetpApp()->GetPool() );
             aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aDocFile ));
             aReq.AppendItem( SfxStringItem( SID_REFERER, OUString() ) );
             aReq.AppendItem( SfxStringItem( SID_TARGETNAME, OUString("_default") ) );
             aReq.AppendItem( SfxBoolItem( SID_HIDDEN, true ) );
             aReq.AppendItem( SfxBoolItem( SID_PREVIEW, bDocPreview ) );
 
-            const SfxViewFrameItem* pRet = PTR_CAST( SfxViewFrameItem, SFX_APP()->ExecuteSlot( aReq ) );
+            const SfxViewFrameItem* pRet = PTR_CAST( SfxViewFrameItem, SfxGetpApp()->ExecuteSlot( aReq ) );
 
             if ( pRet && pRet->GetFrame() && pRet->GetFrame()->GetObjectShell() )
                 xDocShell = pRet->GetFrame()->GetObjectShell();
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index 99a2407..4d172e0 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -92,7 +92,7 @@ rtl::Reference<FuPoor> FuInsertFile::Create( ViewShell* pViewSh, ::sd::Window* p
 
 void FuInsertFile::DoExecute( SfxRequest& rReq )
 {
-    SfxFilterMatcher&       rMatcher = SFX_APP()->GetFilterMatcher();
+    SfxFilterMatcher&       rMatcher = SfxGetpApp()->GetFilterMatcher();
     ::std::vector< OUString > aFilterVector;
     const SfxItemSet*       pArgs = rReq.GetArgs ();
 
@@ -251,7 +251,7 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
     SfxMedium*          pMedium = new SfxMedium( aFile, STREAM_READ | STREAM_NOCREATE );
     const SfxFilter*    pFilter = NULL;
 
-    SFX_APP()->GetFilterMatcher().GuessFilter( *pMedium, &pFilter, SFX_FILTER_IMPORT, SFX_FILTER_NOTINSTALLED | SFX_FILTER_EXECUTABLE );
+    SfxGetpApp()->GetFilterMatcher().GuessFilter( *pMedium, &pFilter, SFX_FILTER_IMPORT, SFX_FILTER_NOTINSTALLED | SFX_FILTER_EXECUTABLE );
 
     bool                bDrawMode = mpViewShell && mpViewShell->ISA(DrawViewShell);
     bool                bInserted = false;
@@ -718,7 +718,7 @@ bool FuInsertFile::InsSDDinOlMode(SfxMedium* pMedium)
 
 void FuInsertFile::GetSupportedFilterVector( ::std::vector< OUString >& rFilterVector )
 {
-    SfxFilterMatcher&   rMatcher = SFX_APP()->GetFilterMatcher();
+    SfxFilterMatcher&   rMatcher = SfxGetpApp()->GetFilterMatcher();
     const SfxFilter*    pSearchFilter = NULL;
 
     rFilterVector.clear();
diff --git a/sd/source/ui/sidebar/MasterPageContainerProviders.cxx b/sd/source/ui/sidebar/MasterPageContainerProviders.cxx
index c81f74a..c197615 100644
--- a/sd/source/ui/sidebar/MasterPageContainerProviders.cxx
+++ b/sd/source/ui/sidebar/MasterPageContainerProviders.cxx
@@ -151,7 +151,7 @@ SdPage* TemplatePageObjectProvider::operator() (SdDrawDocument* pContainerDocume
 
 ::sd::DrawDocShell* TemplatePageObjectProvider::LoadDocument (const OUString& sFileName)
 {
-    SfxApplication* pSfxApp = SFX_APP();
+    SfxApplication* pSfxApp = SfxGetpApp();
     SfxItemSet* pSet = new SfxAllItemSet (pSfxApp->GetPool());
     pSet->Put (SfxBoolItem (SID_TEMPLATE, true));
     pSet->Put (SfxBoolItem (SID_PREVIEW, true));
diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx
index 01219e5..ef06796 100644
--- a/sd/source/ui/table/TableDesignPane.cxx
+++ b/sd/source/ui/table/TableDesignPane.cxx
@@ -189,7 +189,7 @@ void TableDesignWidget::ApplyStyle()
         {
             if( pView )
             {
-                SfxRequest aReq( SID_TABLE_STYLE, SFX_CALLMODE_SYNCHRON, SFX_APP()->GetPool() );
+                SfxRequest aReq( SID_TABLE_STYLE, SFX_CALLMODE_SYNCHRON, SfxGetpApp()->GetPool() );
                 aReq.AppendItem( SfxStringItem( SID_TABLE_STYLE, sStyleName ) );
 
                 rtl::Reference< sdr::SelectionController > xController( pView->getSelectionController() );
@@ -238,7 +238,7 @@ void TableDesignWidget::ApplyOptions()
 
     if( mxSelectedTable.is() )
     {
-        SfxRequest aReq( SID_TABLE_STYLE_SETTINGS, SFX_CALLMODE_SYNCHRON, SFX_APP()->GetPool() );
+        SfxRequest aReq( SID_TABLE_STYLE_SETTINGS, SFX_CALLMODE_SYNCHRON, SfxGetpApp()->GetPool() );
 
         for( sal_uInt16 i = CB_HEADER_ROW; i <= CB_BANDED_COLUMNS; ++i )
         {
diff --git a/sd/source/ui/view/drviewsg.cxx b/sd/source/ui/view/drviewsg.cxx
index cbb919c..2ada0a9 100644
--- a/sd/source/ui/view/drviewsg.cxx
+++ b/sd/source/ui/view/drviewsg.cxx
@@ -199,7 +199,7 @@ void DrawViewShell::ExecOptionsBar( SfxRequest& rReq )
         pOptions->StoreConfig();
 
         // Saves the configuration IMMEDIATELY
-        // SFX_APP()->SaveConfiguration();
+        // SfxGetpApp()->SaveConfiguration();
         WriteFrameViewData();
 
         mpFrameView->Update( pOptions );
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 70adc9d9..a437669 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -447,7 +447,7 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl)
             {
                 const SfxFilter*        pFoundFilter = NULL;
                 SfxMedium               aSfxMedium( aCurrentDropFile, STREAM_READ | STREAM_SHARE_DENYNONE );
-                ErrCode                 nErr = SFX_APP()->GetFilterMatcher().GuessFilter(  aSfxMedium, &pFoundFilter, SFX_FILTER_IMPORT, SFX_FILTER_NOTINSTALLED | SFX_FILTER_EXECUTABLE );
+                ErrCode                 nErr = SfxGetpApp()->GetFilterMatcher().GuessFilter(  aSfxMedium, &pFoundFilter, SFX_FILTER_IMPORT, SFX_FILTER_NOTINSTALLED | SFX_FILTER_EXECUTABLE );
 
                 if( pFoundFilter && !nErr )
                 {
diff --git a/sfx2/source/appl/appbaslib.cxx b/sfx2/source/appl/appbaslib.cxx
index d22dc48..3eee7e5 100644
--- a/sfx2/source/appl/appbaslib.cxx
+++ b/sfx2/source/appl/appbaslib.cxx
@@ -160,8 +160,8 @@ com_sun_star_comp_sfx2_ApplicationDialogLibraryContainer_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    SFX_APP()->GetBasicManager();
-    return SFX_APP()->GetDialogContainer();
+    SfxGetpApp()->GetBasicManager();
+    return SfxGetpApp()->GetDialogContainer();
 }
 
 
@@ -172,8 +172,8 @@ com_sun_star_comp_sfx2_ApplicationScriptLibraryContainer_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    SFX_APP()->GetBasicManager();
-    return SFX_APP()->GetBasicContainer();
+    SfxGetpApp()->GetBasicManager();
+    return SfxGetpApp()->GetBasicContainer();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 225fc4c..23d4642 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -140,7 +140,7 @@ IMPL_LINK(SfxEventAsyncer_Impl, TimerHdl, Timer*, pAsyncTimer)
         OSL_TRACE( "%s", aTmp.getStr() );
     }
 #endif
-    SFX_APP()->Broadcast( aHint );
+    SfxGetpApp()->Broadcast( aHint );
     if ( xRef.Is() )
         xRef->Broadcast( aHint );
     delete this;
diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx
index c034467..9d3d634 100644
--- a/sfx2/source/appl/appdde.cxx
+++ b/sfx2/source/appl/appdde.cxx
@@ -129,7 +129,7 @@ bool ImplDdeService::MakeTopic( const OUString& rNm )
         OUString sTmp( pShell->GetTitle(SFX_TITLE_FULLNAME) );
         if( sNm == sTmp.toAsciiLowerCase() )
         {
-            SFX_APP()->AddDdeTopic( pShell );
+            SfxGetpApp()->AddDdeTopic( pShell );
             bRet = true;
             break;
         }
@@ -148,7 +148,7 @@ bool ImplDdeService::MakeTopic( const OUString& rNm )
             SfxBoolItem aNewView(SID_OPEN_NEW_VIEW, sal_True);
 
             SfxBoolItem aSilent(SID_SILENT, sal_True);
-            SfxDispatcher* pDispatcher = SFX_APP()->GetDispatcher_Impl();
+            SfxDispatcher* pDispatcher = SfxGetpApp()->GetDispatcher_Impl();
             const SfxPoolItem* pRet = pDispatcher->Execute( SID_OPENDOC,
                     SFX_CALLMODE_SYNCHRON,
                     &aName, &aNewView,
@@ -159,7 +159,7 @@ bool ImplDdeService::MakeTopic( const OUString& rNm )
                 0 != ( pShell = ((SfxViewFrameItem*)pRet)
                     ->GetFrame()->GetObjectShell() ) )
             {
-                SFX_APP()->AddDdeTopic( pShell );
+                SfxGetpApp()->AddDdeTopic( pShell );
                 bRet = true;
             }
         }
@@ -192,7 +192,7 @@ OUString ImplDdeService::Topics()
 

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list