summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-09-26 17:51:17 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-09-26 18:30:31 +0000
commitc8968b12f9ae88f592d8a8d17cdecfae8aa8722e (patch)
treea68040771551755726b7406180f92c26150cc9c0 /sw
parent0f6a4ab13ec3dd4f9df0cb10e2de2c648cc4b0ac (diff)
CppunitTest_sw_uiwriter: avoid SfxLokHelper
It assumes that the process has only a single document opened (createView() creates a new window on the frame returned by SfxViewFrame::First()), while it's possible that in this test an other testcase forgot to dispose its component. This way testCursorWindows() depends less on other testcases, and ideally all testcases should be entirely independent of each other. Change-Id: I35decb0b69aeebd3984f4da4386c696a63fe3e04 Reviewed-on: https://gerrit.libreoffice.org/29300 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index d6208c7525a6..d6deb9d231b9 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -91,7 +91,8 @@
#include <comphelper/propertysequence.hxx>
#include <sfx2/classificationhelper.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
-#include <sfx2/lokhelper.hxx>
+#include <sfx2/viewfrm.hxx>
+#include <sfx2/dispatch.hxx>
#include <config_features.h>
static const char* DATA_DIRECTORY = "/sw/qa/extras/uiwriter/data/";
@@ -3989,7 +3990,7 @@ void SwUiWriterTest::testCursorWindows()
SwWrtShell* pWrtShell1 = pDocShell->GetWrtShell();
// Create a second view and type something.
- SfxLokHelper::createView();
+ pDocShell->GetViewShell()->GetViewFrame()->GetDispatcher()->Execute(SID_NEWWINDOW, SfxCallMode::SYNCHRON | SfxCallMode::RECORD);
SwWrtShell* pWrtShell2 = pDocShell->GetWrtShell();
OUString aText("foo");
pWrtShell2->Insert(aText);