Kaydet (Commit) 3d213b3d authored tarafından Caolán McNamara's avatar Caolán McNamara

make SfxGetpApp just get and move GetOrCreate to the periphery

Change-Id: If3b22635e46dbccf0fad101f51bb653cbbcd3a32
Reviewed-on: https://gerrit.libreoffice.org/34957Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst b5acaa42
......@@ -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
......
......@@ -58,6 +58,7 @@ public:
{
UnoApiTest::setUp();
mxDesktop.set(frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory())));
SfxApplication::GetOrCreate();
};
virtual void tearDown() override
......
......@@ -246,7 +246,7 @@ public:
inline SfxApplication* SfxGetpApp()
{
return SfxApplication::GetOrCreate();
return SfxApplication::Get();
}
#endif
......
......@@ -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());
......
......@@ -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--;
......
......@@ -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 \
......
......@@ -33,6 +33,7 @@ $(eval $(call gb_Executable_use_libraries,gengal,\
basegfx \
sal \
tl \
sfx \
svl \
svt \
comphelper \
......
......@@ -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();
......
......@@ -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;
......
......@@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_docbookexport, \
cppuhelper \
i18nlangtag \
sal \
sfx \
sw \
test \
tl \
......
......@@ -20,6 +20,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_globalfilter, \
cppu \
cppuhelper \
sal \
sfx \
svt \
sw \
test \
......
......@@ -20,6 +20,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_odfexport, \
cppu \
cppuhelper \
sal \
sfx \
sw \
test \
tl \
......
......@@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_odfimport, \
cppuhelper \
sal \
svt \
sfx \
sw \
test \
unotest \
......
......@@ -24,6 +24,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_ooxmlexport8, \
test \
unotest \
utl \
sfx \
sw \
tl \
vcl \
......
......@@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_ooxmlimport, \
cppu \
cppuhelper \
sal \
sfx \
test \
unotest \
utl \
......
......@@ -20,6 +20,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_rtfexport, \
cppu \
cppuhelper \
sal \
sfx \
sw \
test \
unotest \
......
......@@ -20,6 +20,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_rtfimport, \
cppu \
cppuhelper \
sal \
sfx \
i18nlangtag \
sw \
test \
......
......@@ -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 \
......
......@@ -22,6 +22,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_ww8import, \
sal \
test \
unotest \
sfx \
sw \
utl \
$(gb_UWINAPI) \
......
......@@ -14,6 +14,7 @@ define sw_ooxmlexport_libraries
cppu \
cppuhelper \
sal \
sfx \
sw \
test \
tl \
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment