summaryrefslogtreecommitdiffstats
path: root/sfx2
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-03-30 05:14:50 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-06-18 17:01:50 +0200
commit77dd7f82911b2e8cd076dd71f3b3901b84fb98d6 (patch)
tree11f63b0daf5b7d74a9b71ad8dc58fba60dbdf4d3 /sfx2
parentremove excessive whitespace (diff)
downloadcore-77dd7f82911b2e8cd076dd71f3b3901b84fb98d6.tar.gz
core-77dd7f82911b2e8cd076dd71f3b3901b84fb98d6.zip
uitest: a slightly better approach for the factory problem in the ui testing
Change-Id: I15dbf2446791c4be9be4e18e63c0d03104d8d405
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/Library_sfx.mk1
-rw-r--r--sfx2/inc/uitest/uitest_factory.hxx21
-rw-r--r--sfx2/source/dialog/tabdlg.cxx14
-rw-r--r--sfx2/source/uitest/factory.cxx26
-rw-r--r--sfx2/source/uitest/sfx_uiobject.cxx9
5 files changed, 8 insertions, 63 deletions
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index ac848db0356c..696402b6eb0b 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -286,7 +286,6 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/styles/StyleManager \
sfx2/source/toolbox/imgmgr \
sfx2/source/toolbox/tbxitem \
- sfx2/source/uitest/factory \
sfx2/source/uitest/sfx_uiobject \
sfx2/source/view/classificationcontroller \
sfx2/source/view/classificationhelper \
diff --git a/sfx2/inc/uitest/uitest_factory.hxx b/sfx2/inc/uitest/uitest_factory.hxx
deleted file mode 100644
index b2d298f5a6eb..000000000000
--- a/sfx2/inc/uitest/uitest_factory.hxx
+++ /dev/null
@@ -1,21 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include <vcl/uitest/factory.hxx>
-
-class SfxUITestFactory
-{
-public:
-
- static void registerSfxTabDialog();
-
- static void registerSfxTabPage();
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index c61c1e285f13..4b33e3171006 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -37,7 +37,7 @@
#include <sfx2/sfxdlg.hxx>
#include <sfx2/itemconnect.hxx>
-#include "uitest/uitest_factory.hxx"
+#include "uitest/sfx_uiobject.hxx"
#include "dialog.hrc"
#include "helpid.hrc"
@@ -329,13 +329,6 @@ SfxTabDialog::SfxTabDialog
, m_pExampleSet(nullptr)
{
Init_Impl(bEditFmt);
-
- static bool bRegisterUITest = false;
- if (!bRegisterUITest)
- {
- SfxUITestFactory::registerSfxTabDialog();
- bRegisterUITest = true;
- }
}
@@ -1334,4 +1327,9 @@ void SfxTabDialog::SetInputSet( const SfxItemSet* pInSet )
}
}
+FactoryFunction SfxTabDialog::GetUITestFactory() const
+{
+ return SfxTabDialogUIObject::create;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/uitest/factory.cxx b/sfx2/source/uitest/factory.cxx
deleted file mode 100644
index 447943706ed1..000000000000
--- a/sfx2/source/uitest/factory.cxx
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include <uitest/uitest_factory.hxx>
-#include <uitest/sfx_uiobject.hxx>
-
-#include <vcl/uitest/factory.hxx>
-
-
-void SfxUITestFactory::registerSfxTabDialog()
-{
- registerUITestFactory(WINDOW_TABDIALOG, FactoryFunction(SfxTabDialogUIObject::create));
-}
-
-void SfxUITestFactory::registerSfxTabPage()
-{
-
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/uitest/sfx_uiobject.cxx b/sfx2/source/uitest/sfx_uiobject.cxx
index 590ffd3a95ac..d42798781e1a 100644
--- a/sfx2/source/uitest/sfx_uiobject.cxx
+++ b/sfx2/source/uitest/sfx_uiobject.cxx
@@ -37,13 +37,8 @@ UIObjectType SfxTabDialogUIObject::get_type() const
std::unique_ptr<UIObject> SfxTabDialogUIObject::create(vcl::Window* pWindow)
{
SfxTabDialog* pDialog = dynamic_cast<SfxTabDialog*>(pWindow);
-
- if (pDialog)
- {
- return std::unique_ptr<UIObject>(new SfxTabDialogUIObject(pDialog));
- }
-
- return nullptr;
+ assert(pDialog);
+ return std::unique_ptr<UIObject>(new SfxTabDialogUIObject(pDialog));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */