summaryrefslogtreecommitdiff
path: root/sw/qa/extras
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-27 10:19:29 +0200
commit69e7adc64ae3834213896f73c286848b1108d32a (patch)
tree70538d2272c6c690325468a0328d9b482c085680 /sw/qa/extras
parentc102627a72d1650a19affd20b76ae74bb1b13de4 (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. Reviewed-on: https://gerrit.libreoffice.org/29300 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit c8968b12f9ae88f592d8a8d17cdecfae8aa8722e) Conflicts: sw/qa/extras/uiwriter/uiwriter.cxx Change-Id: I35decb0b69aeebd3984f4da4386c696a63fe3e04
Diffstat (limited to 'sw/qa/extras')
-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 cb55d49ca919..208efa49b429 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -88,7 +88,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>
static const char* DATA_DIRECTORY = "/sw/qa/extras/uiwriter/data/";
@@ -3408,7 +3409,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);