diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-07 20:33:43 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-05-30 09:40:36 +0200 |
commit | f5a6844e683f8d97c60f5cf19aab00d41209cfc3 (patch) | |
tree | e4ebfe86d810ded6f2f5a9f81866eba3bc3d48a0 | |
parent | 3ad60c39a266b54a0dd94ac8bd15a88d64c9dd5f (diff) |
make SfxGetpApp just get and move GetOrCreate to the periphery
Reviewed-on: https://gerrit.libreoffice.org/34957
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry-picked from commit 3d213b3dc5130bdbacbd64be00867eecad6373e8)
Conflicts:
svx/source/gengal/gengal.cxx
Change-Id: If3b22635e46dbccf0fad101f51bb653cbbcd3a32
Reviewed-on: https://gerrit.libreoffice.org/38166
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | cppcanvas/qa/extras/emfplus/emfplus.cxx | 2 | ||||
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 1 | ||||
-rw-r--r-- | include/sfx2/app.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/module.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/notify/globalevents.cxx | 2 | ||||
-rw-r--r-- | svx/CppunitTest_svx_unit.mk | 1 | ||||
-rw-r--r-- | svx/Executable_gengal.mk | 1 | ||||
-rw-r--r-- | svx/qa/unit/xoutdev.cxx | 7 | ||||
-rw-r--r-- | svx/source/gengal/gengal.cxx | 4 | ||||
-rw-r--r-- | sw/CppunitTest_sw_docbookexport.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_globalfilter.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_odfexport.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_odfimport.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_ooxmlexport8.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_ooxmlimport.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_rtfexport.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_rtfimport.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_ww8export2.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_ww8import.mk | 1 | ||||
-rw-r--r-- | sw/ooxmlexport_setup.mk | 1 | ||||
-rw-r--r-- | sw/qa/extras/inc/swmodeltestbase.hxx | 3 |
21 files changed, 32 insertions, 4 deletions
diff --git a/cppcanvas/qa/extras/emfplus/emfplus.cxx b/cppcanvas/qa/extras/emfplus/emfplus.cxx index c83c2e992538..4c8a7774f0d1 100644 --- a/cppcanvas/qa/extras/emfplus/emfplus.cxx +++ b/cppcanvas/qa/extras/emfplus/emfplus.cxx @@ -13,6 +13,7 @@ #include <com/sun/star/graphic/XGraphic.hpp> #include <comphelper/processfactory.hxx> +#include <sfx2/app.hxx> #include <sfx2/objsh.hxx> #include <sfx2/sfxbasemodel.hxx> #include <test/unoapi_test.hxx> @@ -37,6 +38,7 @@ public: { UnoApiTest::setUp(); mxDesktop.set(frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory()))); + SfxApplication::GetOrCreate(); }; virtual void tearDown() override diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index dae50d66314c..50cf4d633bd3 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -62,6 +62,7 @@ public: { UnoApiTest::setUp(); mxDesktop.set(frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory()))); + SfxApplication::GetOrCreate(); }; virtual void tearDown() override diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx index 74d29003aa9e..6b5a1af72aac 100644 --- a/include/sfx2/app.hxx +++ b/include/sfx2/app.hxx @@ -248,7 +248,7 @@ public: inline SfxApplication* SfxGetpApp() { - return SfxApplication::GetOrCreate(); + return SfxApplication::Get(); } #endif diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index 72d447b6ec26..830f7eb7696a 100644 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -115,7 +115,7 @@ SfxModule::SfxModule( ResMgr* pMgrP, std::initializer_list<SfxObjectFactory*> pF void SfxModule::Construct_Impl() { - SfxApplication *pApp = SfxGetpApp(); + SfxApplication *pApp = SfxApplication::GetOrCreate(); pImpl = new SfxModule_Impl; pImpl->pSlotPool = new SfxSlotPool(&pApp->GetAppSlotPool_Impl()); diff --git a/sfx2/source/notify/globalevents.cxx b/sfx2/source/notify/globalevents.cxx index 9cecd83e5740..69e23ceea6f3 100644 --- a/sfx2/source/notify/globalevents.cxx +++ b/sfx2/source/notify/globalevents.cxx @@ -164,7 +164,7 @@ SfxGlobalEvents_Impl::SfxGlobalEvents_Impl( const uno::Reference < uno::XCompone , pImp (nullptr ) { m_refCount++; - SfxGetpApp(); + SfxApplication::GetOrCreate(); pImp = new GlobalEventConfig(); m_xEvents = pImp; m_refCount--; diff --git a/svx/CppunitTest_svx_unit.mk b/svx/CppunitTest_svx_unit.mk index 6563d60e4eaf..0bac905a9dc9 100644 --- a/svx/CppunitTest_svx_unit.mk +++ b/svx/CppunitTest_svx_unit.mk @@ -20,6 +20,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,svx_unit, \ $(eval $(call gb_CppunitTest_use_libraries,svx_unit, \ sal \ + sfx \ svxcore \ tl \ unotest \ diff --git a/svx/Executable_gengal.mk b/svx/Executable_gengal.mk index 49b3b34df987..0cecfa02357c 100644 --- a/svx/Executable_gengal.mk +++ b/svx/Executable_gengal.mk @@ -33,6 +33,7 @@ $(eval $(call gb_Executable_use_libraries,gengal,\ basegfx \ sal \ tl \ + sfx \ svl \ svt \ comphelper \ diff --git a/svx/qa/unit/xoutdev.cxx b/svx/qa/unit/xoutdev.cxx index 7be8c4749992..22c92d5ff291 100644 --- a/svx/qa/unit/xoutdev.cxx +++ b/svx/qa/unit/xoutdev.cxx @@ -13,6 +13,7 @@ #include <cppunit/plugin/TestPlugIn.h> #include <sal/types.h> +#include <sfx2/app.hxx> #include <tools/stream.hxx> #include <unotest/directories.hxx> #include <unotools/tempfile.hxx> @@ -25,6 +26,12 @@ class XOutdevTest : public CppUnit::TestFixture public: void testPdfGraphicExport(); + virtual void setUp() override + { + CppUnit::TestFixture::setUp(); + SfxApplication::GetOrCreate(); + } + CPPUNIT_TEST_SUITE(XOutdevTest); CPPUNIT_TEST(testPdfGraphicExport); CPPUNIT_TEST_SUITE_END(); diff --git a/svx/source/gengal/gengal.cxx b/svx/source/gengal/gengal.cxx index f8b5385203a8..7c7fc24dff64 100644 --- a/svx/source/gengal/gengal.cxx +++ b/svx/source/gengal/gengal.cxx @@ -36,6 +36,8 @@ #include <osl/file.hxx> #include <osl/process.h> #include <rtl/bootstrap.hxx> +#include <sfx2/app.hxx> +#include <sal/types.h> #include <vcl/svapp.hxx> #include <svx/galtheme.hxx> @@ -276,6 +278,8 @@ int GalApp::Main() { try { + SfxApplication::GetOrCreate(); + OUString aPath, aDestDir; OUString aName( "Default name" ); std::vector<INetURLObject> aFiles; diff --git a/sw/CppunitTest_sw_docbookexport.mk b/sw/CppunitTest_sw_docbookexport.mk index d0c94720b3ee..9e5a45c41d1c 100644 --- a/sw/CppunitTest_sw_docbookexport.mk +++ b/sw/CppunitTest_sw_docbookexport.mk @@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_docbookexport, \ cppuhelper \ i18nlangtag \ sal \ + sfx \ sw \ test \ tl \ diff --git a/sw/CppunitTest_sw_globalfilter.mk b/sw/CppunitTest_sw_globalfilter.mk index cb12badd22e4..347959f376dc 100644 --- a/sw/CppunitTest_sw_globalfilter.mk +++ b/sw/CppunitTest_sw_globalfilter.mk @@ -20,6 +20,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_globalfilter, \ cppu \ cppuhelper \ sal \ + sfx \ svt \ sw \ test \ diff --git a/sw/CppunitTest_sw_odfexport.mk b/sw/CppunitTest_sw_odfexport.mk index b9260b328b1a..18d06733cbec 100644 --- a/sw/CppunitTest_sw_odfexport.mk +++ b/sw/CppunitTest_sw_odfexport.mk @@ -20,6 +20,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_odfexport, \ cppu \ cppuhelper \ sal \ + sfx \ sw \ test \ tl \ diff --git a/sw/CppunitTest_sw_odfimport.mk b/sw/CppunitTest_sw_odfimport.mk index 4c249d5d6168..d79de18dd006 100644 --- a/sw/CppunitTest_sw_odfimport.mk +++ b/sw/CppunitTest_sw_odfimport.mk @@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_odfimport, \ cppuhelper \ sal \ svt \ + sfx \ sw \ test \ unotest \ diff --git a/sw/CppunitTest_sw_ooxmlexport8.mk b/sw/CppunitTest_sw_ooxmlexport8.mk index 8bf3f5dab8d7..81f758b83b12 100644 --- a/sw/CppunitTest_sw_ooxmlexport8.mk +++ b/sw/CppunitTest_sw_ooxmlexport8.mk @@ -24,6 +24,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_ooxmlexport8, \ test \ unotest \ utl \ + sfx \ sw \ tl \ vcl \ diff --git a/sw/CppunitTest_sw_ooxmlimport.mk b/sw/CppunitTest_sw_ooxmlimport.mk index ae84e315339a..76f78f21b8ae 100644 --- a/sw/CppunitTest_sw_ooxmlimport.mk +++ b/sw/CppunitTest_sw_ooxmlimport.mk @@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_ooxmlimport, \ cppu \ cppuhelper \ sal \ + sfx \ test \ unotest \ utl \ diff --git a/sw/CppunitTest_sw_rtfexport.mk b/sw/CppunitTest_sw_rtfexport.mk index 9e05e6fa3bfa..54f8014ab2e6 100644 --- a/sw/CppunitTest_sw_rtfexport.mk +++ b/sw/CppunitTest_sw_rtfexport.mk @@ -20,6 +20,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_rtfexport, \ cppu \ cppuhelper \ sal \ + sfx \ sw \ test \ unotest \ diff --git a/sw/CppunitTest_sw_rtfimport.mk b/sw/CppunitTest_sw_rtfimport.mk index 3be64d04b8aa..c2dbf8fc2785 100644 --- a/sw/CppunitTest_sw_rtfimport.mk +++ b/sw/CppunitTest_sw_rtfimport.mk @@ -20,6 +20,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_rtfimport, \ cppu \ cppuhelper \ sal \ + sfx \ i18nlangtag \ sw \ test \ diff --git a/sw/CppunitTest_sw_ww8export2.mk b/sw/CppunitTest_sw_ww8export2.mk index 214b5007b759..c09e528b0aa9 100644 --- a/sw/CppunitTest_sw_ww8export2.mk +++ b/sw/CppunitTest_sw_ww8export2.mk @@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_ww8export2, \ cppuhelper \ $(if $(filter WNT-TRUE,$(OS)-$(DISABLE_ATL)),,emboleobj) \ sal \ + sfx \ test \ unotest \ utl \ diff --git a/sw/CppunitTest_sw_ww8import.mk b/sw/CppunitTest_sw_ww8import.mk index db8599553b3f..ec80cbc4f75b 100644 --- a/sw/CppunitTest_sw_ww8import.mk +++ b/sw/CppunitTest_sw_ww8import.mk @@ -22,6 +22,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_ww8import, \ sal \ test \ unotest \ + sfx \ sw \ utl \ $(gb_UWINAPI) \ diff --git a/sw/ooxmlexport_setup.mk b/sw/ooxmlexport_setup.mk index ae1b27f9cd84..d793575f13af 100644 --- a/sw/ooxmlexport_setup.mk +++ b/sw/ooxmlexport_setup.mk @@ -14,6 +14,7 @@ define sw_ooxmlexport_libraries cppu \ cppuhelper \ sal \ + sfx \ sw \ test \ tl \ diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx index 07b04ea2ba4d..5a4ad3ede655 100644 --- a/sw/qa/extras/inc/swmodeltestbase.hxx +++ b/sw/qa/extras/inc/swmodeltestbase.hxx @@ -38,6 +38,7 @@ #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> #include <rtl/byteseq.hxx> +#include <sfx2/app.hxx> #include <comphelper/processfactory.hxx> #include <unotools/tempfile.hxx> #include <unotools/localfilehelper.hxx> @@ -197,8 +198,8 @@ public: virtual void setUp() override { test::BootstrapFixture::setUp(); - mxDesktop.set(css::frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory()))); + SfxApplication::GetOrCreate(); } virtual void tearDown() override |