Kaydet (Commit) c8968b12 authored tarafından Miklos Vajna's avatar Miklos Vajna

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/29300Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 0f6a4ab1
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment