summaryrefslogtreecommitdiff
path: root/sc/qa/unit/ucalc.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-02-21 15:32:35 +0100
committerHenry Castro <hcastro@collabora.com>2017-05-03 13:36:46 -0400
commit091c3c85075eb8a714cb3016470845ed1c0c9444 (patch)
treebae2e75f5cc60141bb2c76f67d0be3bb1696a45e /sc/qa/unit/ucalc.cxx
parente6c0fbc9e98dbef3fca9f8d37e097b1f4de7ed6d (diff)
move ScDocShell de-/init related to getNewDocShell() and closeDocShell()
In preparation for being able to handle two documents. Conflicts: sc/qa/unit/ucalc.cxx Change-Id: Ie7ea65136bcd6719031af6b1034d002058bfd81a
Diffstat (limited to 'sc/qa/unit/ucalc.cxx')
-rw-r--r--sc/qa/unit/ucalc.cxx27
1 files changed, 19 insertions, 8 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 8cf5a59fadd9..76a4065dc359 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -125,25 +125,36 @@ ScDocShell& Test::getDocShell()
return *m_pImpl->m_xDocShell;
}
+void Test::getNewDocShell( ScDocShellRef& rDocShellRef )
+{
+ rDocShellRef = new ScDocShell(
+ SfxModelFlags::EMBEDDED_OBJECT |
+ SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS |
+ SfxModelFlags::DISABLE_DOCUMENT_RECOVERY);
+
+ rDocShellRef->SetIsInUcalc();
+ rDocShellRef->DoInitUnitTest();
+}
+
+void Test::closeDocShell( ScDocShellRef& rDocShellRef )
+{
+ rDocShellRef->DoClose();
+ rDocShellRef.Clear();
+}
+
void Test::setUp()
{
BootstrapFixture::setUp();
ScDLL::Init();
- m_pImpl->m_xDocShell = new ScDocShell(
- SfxModelFlags::EMBEDDED_OBJECT |
- SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS |
- SfxModelFlags::DISABLE_DOCUMENT_RECOVERY);
- m_pImpl->m_xDocShell->SetIsInUcalc();
- m_pImpl->m_xDocShell->DoInitUnitTest();
+ getNewDocShell(m_pImpl->m_xDocShell);
m_pDoc = &m_pImpl->m_xDocShell->GetDocument();
}
void Test::tearDown()
{
- m_pImpl->m_xDocShell->DoClose();
- m_pImpl->m_xDocShell.Clear();
+ closeDocShell(m_pImpl->m_xDocShell);
BootstrapFixture::tearDown();
}