summaryrefslogtreecommitdiff
path: root/starmath/qa
diff options
context:
space:
mode:
Diffstat (limited to 'starmath/qa')
-rw-r--r--starmath/qa/cppunit/test_nodetotextvisitors.cxx4
-rw-r--r--starmath/qa/cppunit/test_starmath.cxx28
-rw-r--r--starmath/qa/extras/mmlimport-test.cxx6
3 files changed, 20 insertions, 18 deletions
diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
index 29d554a7e477..2b105cbca164 100644
--- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx
+++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
@@ -11,6 +11,7 @@
#include <test/bootstrapfixture.hxx>
#include <vcl/svapp.hxx>
+#include <sfx2/sfxmodelfactory.hxx>
#include <smdll.hxx>
#include <document.hxx>
@@ -74,7 +75,6 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- uno::Reference< uno::XComponentContext > m_context;
SmDocShellRef xDocShRef;
void parseandparseagain(const char *input, const char *test_name);
void ParseAndCheck(const char *input, const char *expected, const char *test_name);
@@ -87,7 +87,7 @@ void Test::setUp()
SmGlobals::ensure();
- xDocShRef = new SmDocShell(SFXOBJECTSHELL_STD_NORMAL);
+ xDocShRef = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT);
}
void Test::tearDown()
diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx
index 0e3c1dead415..5de607ce30b3 100644
--- a/starmath/qa/cppunit/test_starmath.cxx
+++ b/starmath/qa/cppunit/test_starmath.cxx
@@ -10,7 +10,6 @@
#include <sal/config.h>
#include <test/bootstrapfixture.hxx>
-#include <vcl/svapp.hxx>
#include <smdll.hxx>
#include <document.hxx>
#include <view.hxx>
@@ -20,12 +19,11 @@
#include <sfx2/request.hxx>
#include <sfx2/dispatch.hxx>
-#include <svl/stritem.hxx>
-
#include <editeng/editeng.hxx>
#include <editeng/editview.hxx>
#include <sfx2/zoomitem.hxx>
+#include <memory>
typedef tools::SvRef<SmDocShell> SmDocShellRef;
@@ -36,6 +34,8 @@ namespace {
class Test : public test::BootstrapFixture
{
public:
+ Test();
+
// init
virtual void setUp() SAL_OVERRIDE;
virtual void tearDown() SAL_OVERRIDE;
@@ -55,17 +55,19 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- uno::Reference<uno::XComponentContext> m_xContext;
- uno::Reference<lang::XMultiComponentFactory> m_xFactory;
-
SfxBindings m_aBindings;
- SfxDispatcher *m_pDispatcher;
+ std::unique_ptr<SfxDispatcher> m_pDispatcher;
VclPtr<SmCmdBoxWindow> m_pSmCmdBoxWindow;
VclPtr<SmEditWindow> m_pEditWindow;
SmDocShellRef m_xDocShRef;
SmViewShell *m_pViewShell;
};
+Test::Test()
+ : m_pViewShell(nullptr)
+{
+}
+
void Test::setUp()
{
BootstrapFixture::setUp();
@@ -73,17 +75,17 @@ void Test::setUp()
SmGlobals::ensure();
m_xDocShRef = new SmDocShell(
- SFXMODEL_STANDARD |
- SFXMODEL_DISABLE_EMBEDDED_SCRIPTS |
- SFXMODEL_DISABLE_DOCUMENT_RECOVERY);
+ SfxModelFlags::EMBEDDED_OBJECT |
+ SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS |
+ SfxModelFlags::DISABLE_DOCUMENT_RECOVERY);
m_xDocShRef->DoInitNew(0);
SfxViewFrame *pViewFrame = SfxViewFrame::LoadHiddenDocument(*m_xDocShRef, 0);
CPPUNIT_ASSERT_MESSAGE("Should have a SfxViewFrame", pViewFrame);
- m_pDispatcher = new SfxDispatcher(pViewFrame);
- m_aBindings.SetDispatcher(m_pDispatcher);
+ m_pDispatcher.reset(new SfxDispatcher(pViewFrame));
+ m_aBindings.SetDispatcher(m_pDispatcher.get());
m_aBindings.EnterRegistrations();
m_pSmCmdBoxWindow.reset(VclPtr<SmCmdBoxWindow>::Create(&m_aBindings, nullptr, nullptr));
m_aBindings.LeaveRegistrations();
@@ -96,7 +98,7 @@ void Test::tearDown()
{
m_pEditWindow.disposeAndClear();
m_pSmCmdBoxWindow.disposeAndClear();
- delete m_pDispatcher;
+ m_pDispatcher.reset();
m_xDocShRef->DoClose();
m_xDocShRef.Clear();
diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx
index e52ebf308daa..3effb31a2823 100644
--- a/starmath/qa/extras/mmlimport-test.cxx
+++ b/starmath/qa/extras/mmlimport-test.cxx
@@ -55,9 +55,9 @@ private:
"private:factory/smath*");
pFilter->SetVersion(SOFFICE_FILEFORMAT_60);
- mxDocShell = new SmDocShell(SFXMODEL_STANDARD |
- SFXMODEL_DISABLE_EMBEDDED_SCRIPTS |
- SFXMODEL_DISABLE_DOCUMENT_RECOVERY);
+ mxDocShell = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT |
+ SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS |
+ SfxModelFlags::DISABLE_DOCUMENT_RECOVERY);
SfxMedium* pSrcMed = new SfxMedium(rURL, STREAM_STD_READ);
pSrcMed->SetFilter(pFilter);