summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-06-16 16:45:21 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-06-16 16:19:10 +0000
commit5bf3ae663a2189e37959235cda8c6a4051e10a1a (patch)
tree8f5c8348355a009425c7c82780a6b63605775ef9 /sw/qa
parente841ed93d6c6d817be1f7fdc18ff971325c861cc (diff)
comphelper: enable LibreOfficeKit::isViewCallback() by default
This requires porting the sw/sd/sc_tiledrendering test code to the new internal API, as only the public LOK API is unchanged. Change-Id: Ic6a2f96421da4a16bdee7d0cbb3f6e35bc6ddff9 Reviewed-on: https://gerrit.libreoffice.org/26379 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx22
1 files changed, 14 insertions, 8 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index d0203afde5b9..5eed6d174683 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -25,6 +25,7 @@
#include <drawdoc.hxx>
#include <ndtxt.hxx>
#include <wrtsh.hxx>
+#include <sfx2/viewsh.hxx>
static const char* DATA_DIRECTORY = "/sw/qa/extras/tiledrendering/data/";
@@ -169,8 +170,8 @@ void SwTiledRenderingTest::testRegisterCallback()
{
comphelper::LibreOfficeKit::setActive();
SwXTextDocument* pXTextDocument = createDoc("dummy.fodt");
- pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
+ pWrtShell->GetSfxViewShell()->registerLibreOfficeKitViewCallback(&SwTiledRenderingTest::callback, this);
// Insert a character at the beginning of the document.
pWrtShell->Insert("x");
@@ -339,8 +340,8 @@ void SwTiledRenderingTest::testSearch()
comphelper::LibreOfficeKit::setActive();
SwXTextDocument* pXTextDocument = createDoc("search.odt");
- pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
+ pWrtShell->GetSfxViewShell()->registerLibreOfficeKitViewCallback(&SwTiledRenderingTest::callback, this);
std::size_t nNode = pWrtShell->getShellCursor(false)->Start()->nNode.GetNode().GetIndex();
// First hit, in the second paragraph, before the shape.
@@ -408,7 +409,8 @@ void SwTiledRenderingTest::testSearchTextFrame()
comphelper::LibreOfficeKit::setActive();
SwXTextDocument* pXTextDocument = createDoc("search.odt");
- pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
+ SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
+ pWrtShell->GetSfxViewShell()->registerLibreOfficeKitViewCallback(&SwTiledRenderingTest::callback, this);
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
{
{"SearchItem.SearchString", uno::makeAny(OUString("TextFrame"))},
@@ -424,7 +426,8 @@ void SwTiledRenderingTest::testSearchTextFrame()
void SwTiledRenderingTest::testSearchTextFrameWrapAround()
{
SwXTextDocument* pXTextDocument = createDoc("search.odt");
- pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
+ SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
+ pWrtShell->GetSfxViewShell()->registerLibreOfficeKitViewCallback(&SwTiledRenderingTest::callback, this);
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
{
{"SearchItem.SearchString", uno::makeAny(OUString("TextFrame"))},
@@ -442,8 +445,8 @@ void SwTiledRenderingTest::testDocumentSizeChanged()
comphelper::LibreOfficeKit::setActive();
// Get the current document size.
SwXTextDocument* pXTextDocument = createDoc("2-pages.odt");
- pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
+ pWrtShell->GetSfxViewShell()->registerLibreOfficeKitViewCallback(&SwTiledRenderingTest::callback, this);
Size aSize = pXTextDocument->getDocumentSize();
// Delete the second page and see how the size changes.
@@ -461,7 +464,8 @@ void SwTiledRenderingTest::testSearchAll()
comphelper::LibreOfficeKit::setActive();
SwXTextDocument* pXTextDocument = createDoc("search.odt");
- pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
+ SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
+ pWrtShell->GetSfxViewShell()->registerLibreOfficeKitViewCallback(&SwTiledRenderingTest::callback, this);
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
{
{"SearchItem.SearchString", uno::makeAny(OUString("shape"))},
@@ -481,7 +485,8 @@ void SwTiledRenderingTest::testSearchAllNotifications()
{
comphelper::LibreOfficeKit::setActive();
SwXTextDocument* pXTextDocument = createDoc("search.odt");
- pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
+ SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
+ pWrtShell->GetSfxViewShell()->registerLibreOfficeKitViewCallback(&SwTiledRenderingTest::callback, this);
uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
{
{"SearchItem.SearchString", uno::makeAny(OUString("shape"))},
@@ -509,7 +514,8 @@ void SwTiledRenderingTest::testPageDownInvalidation()
{".uno:HideWhitespace", uno::makeAny(true)},
}));
pXTextDocument->initializeForTiledRendering(aPropertyValues);
- pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
+ SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
+ pWrtShell->GetSfxViewShell()->registerLibreOfficeKitViewCallback(&SwTiledRenderingTest::callback, this);
comphelper::dispatchCommand(".uno:PageDown", uno::Sequence<beans::PropertyValue>());
// This was 2.