[Libreoffice-commits] core.git: cppcanvas/qa desktop/qa include/sfx2 sfx2/source svx/CppunitTest_svx_unit.mk svx/Executable_gengal.mk svx/qa svx/source sw/CppunitTest_sw_docbookexport.mk sw/CppunitTest_sw_globalfilter.mk sw/CppunitTest_sw_odfexport.mk sw/CppunitTest_sw_odfimport.mk sw/CppunitTest_sw_ooxmlexport8.mk sw/CppunitTest_sw_ooxmlimport.mk sw/CppunitTest_sw_rtfexport.mk sw/CppunitTest_sw_rtfimport.mk sw/CppunitTest_sw_ww8export2.mk sw/CppunitTest_sw_ww8import.mk sw/ooxmlexport_setup.mk sw/qa

Caolán McNamara caolanm at redhat.com
Wed Mar 8 09:56:40 UTC 2017


 cppcanvas/qa/extras/emfplus/emfplus.cxx     |    2 ++
 desktop/qa/desktop_lib/test_desktop_lib.cxx |    1 +
 include/sfx2/app.hxx                        |    2 +-
 sfx2/source/appl/module.cxx                 |    2 +-
 sfx2/source/notify/globalevents.cxx         |    2 +-
 svx/CppunitTest_svx_unit.mk                 |    1 +
 svx/Executable_gengal.mk                    |    1 +
 svx/qa/unit/xoutdev.cxx                     |    7 +++++++
 svx/source/gengal/gengal.cxx                |    3 +++
 sw/CppunitTest_sw_docbookexport.mk          |    1 +
 sw/CppunitTest_sw_globalfilter.mk           |    1 +
 sw/CppunitTest_sw_odfexport.mk              |    1 +
 sw/CppunitTest_sw_odfimport.mk              |    1 +
 sw/CppunitTest_sw_ooxmlexport8.mk           |    1 +
 sw/CppunitTest_sw_ooxmlimport.mk            |    1 +
 sw/CppunitTest_sw_rtfexport.mk              |    1 +
 sw/CppunitTest_sw_rtfimport.mk              |    1 +
 sw/CppunitTest_sw_ww8export2.mk             |    1 +
 sw/CppunitTest_sw_ww8import.mk              |    1 +
 sw/ooxmlexport_setup.mk                     |    1 +
 sw/qa/extras/inc/swmodeltestbase.hxx        |    3 ++-
 21 files changed, 31 insertions(+), 4 deletions(-)

New commits:
commit 3d213b3dc5130bdbacbd64be00867eecad6373e8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Mar 7 20:33:43 2017 +0000

    make SfxGetpApp just get and move GetOrCreate to the periphery
    
    Change-Id: If3b22635e46dbccf0fad101f51bb653cbbcd3a32
    Reviewed-on: https://gerrit.libreoffice.org/34957
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cppcanvas/qa/extras/emfplus/emfplus.cxx b/cppcanvas/qa/extras/emfplus/emfplus.cxx
index 5ccbea1..a3c6a67 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>
@@ -33,6 +34,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 1a9cd26..310fe23 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -58,6 +58,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 5735044..315e3ae 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -246,7 +246,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 4705ba4..f26660a 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -89,7 +89,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 8b8ae93..011d775 100644
--- a/sfx2/source/notify/globalevents.cxx
+++ b/sfx2/source/notify/globalevents.cxx
@@ -146,7 +146,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 6563d60..0bac905a 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 49b3b34..0cecfa0 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 7b472b9..f2bbb3c 100644
--- a/svx/qa/unit/xoutdev.cxx
+++ b/svx/qa/unit/xoutdev.cxx
@@ -15,6 +15,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>
@@ -27,6 +28,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 ca84867..e3fe915 100644
--- a/svx/source/gengal/gengal.cxx
+++ b/svx/source/gengal/gengal.cxx
@@ -32,6 +32,7 @@
 #include <osl/file.hxx>
 #include <osl/process.h>
 #include <rtl/bootstrap.hxx>
+#include <sfx2/app.hxx>
 #include <sal/types.h>
 #include <vcl/svapp.hxx>
 
@@ -274,6 +275,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 d0c9472..9e5a45c 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 cb12bad..347959f 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 b9260b3..18d0673 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 36a16db..651aef0 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 8bf3f5d..81f758b 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 ae84e31..76f78f2 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 9e05e6f..54f8014 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 3be64d0..c2dbf8f 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 214b500..c09e528 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 d3ae08a..4b38dfd 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 ae1b27f..d793575 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 aad89d8..8bb35fc 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


More information about the Libreoffice-commits mailing list