summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-09-14 13:22:45 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2019-09-25 12:31:49 +0200
commitcd7ff1797d754018db1d47888781c9d7ecb24dcf (patch)
treefd58ae3cd52d376cfb1cd930ea2297e8882c752a /sc
parent630d5915819c664aaee5f17066c61939f7ceaefe (diff)
lok: send an invalidation by document size change
It was sent by the kit code earlier. Now we move it to the LO core code, so we can optimize it later. Change-Id: Id0a8991016dbe8d13891071e2d5b4c9250720da9 co-author: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/79491 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/tiledrendering/tiledrendering.cxx8
-rw-r--r--sc/source/core/data/document.cxx13
-rw-r--r--sc/source/ui/docshell/docsh3.cxx4
-rw-r--r--sc/source/ui/view/tabview.cxx7
-rw-r--r--sc/source/ui/view/tabview3.cxx3
-rw-r--r--sc/source/ui/view/tabview5.cxx3
6 files changed, 24 insertions, 14 deletions
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 29437d8e91b9..000050262011 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -527,7 +527,7 @@ public:
else
{
uno::Sequence<OUString> aSeq = comphelper::string::convertCommaSeparated(OUString::createFromAscii(pPayload));
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), aSeq.getLength());
+ CPPUNIT_ASSERT(aSeq.getLength() == 4 || aSeq.getLength() == 5);
tools::Rectangle aInvalidationRect;
aInvalidationRect.setX(aSeq[0].toInt32());
aInvalidationRect.setY(aSeq[1].toInt32());
@@ -1014,7 +1014,7 @@ void ScTiledRenderingTest::testInvalidateOnInserRowCol()
comphelper::dispatchCommand(".uno:InsertRows", aArgs);
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT(aView.m_bInvalidateTiles);
- CPPUNIT_ASSERT_EQUAL(size_t(1), aView.m_aInvalidations.size());
+ CPPUNIT_ASSERT_EQUAL(size_t(2), aView.m_aInvalidations.size());
CPPUNIT_ASSERT_EQUAL(tools::Rectangle(-75, 50985, 32212230, 63990), aView.m_aInvalidations[0]);
// move on the right
@@ -1031,7 +1031,7 @@ void ScTiledRenderingTest::testInvalidateOnInserRowCol()
comphelper::dispatchCommand(".uno:InsertColumns", aArgs);
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT(aView.m_bInvalidateTiles);
- CPPUNIT_ASSERT_EQUAL(size_t(1), aView.m_aInvalidations.size());
+ CPPUNIT_ASSERT_EQUAL(size_t(2), aView.m_aInvalidations.size());
CPPUNIT_ASSERT_EQUAL(tools::Rectangle(253650, -15, 32212230, 63990), aView.m_aInvalidations[0]);
}
@@ -1692,7 +1692,7 @@ void ScTiledRenderingTest::testSheetChangeInvalidation()
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::PAGEDOWN | KEY_MOD1);
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT(aView1.m_bInvalidateTiles);
- CPPUNIT_ASSERT_EQUAL(size_t(1), aView1.m_aInvalidations.size());
+ CPPUNIT_ASSERT_EQUAL(size_t(3), aView1.m_aInvalidations.size());
CPPUNIT_ASSERT_EQUAL(tools::Rectangle(0, 0, 1310720, 268435456), aView1.m_aInvalidations[0]);
}
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 9e9a3f0a25c7..81cdc056daf1 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -98,6 +98,7 @@
#include <vcl/uitest/eventdescription.hxx>
#include <mtvelements.hxx>
+#include <sfx2/lokhelper.hxx>
using ::editeng::SvxBorderLine;
using namespace ::com::sun::star;
@@ -586,7 +587,8 @@ bool ScDocument::InsertTab(
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
{
- pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(pViewShell->GetCurrentDocument());
+ SfxLokHelper::notifyDocumentSizeChanged(pViewShell, "", pModel);
pViewShell = SfxViewShell::GetNext(*pViewShell);
}
}
@@ -756,7 +758,8 @@ bool ScDocument::DeleteTab( SCTAB nTab )
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
{
- pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(pViewShell->GetCurrentDocument());
+ SfxLokHelper::notifyDocumentSizeChanged(pViewShell, "", pModel);
pViewShell = SfxViewShell::GetNext(*pViewShell);
}
}
@@ -852,7 +855,8 @@ bool ScDocument::DeleteTabs( SCTAB nTab, SCTAB nSheets )
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
{
- pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(pViewShell->GetCurrentDocument());
+ SfxLokHelper::notifyDocumentSizeChanged(pViewShell, "", pModel);
pViewShell = SfxViewShell::GetNext(*pViewShell);
}
}
@@ -903,7 +907,8 @@ bool ScDocument::RenameTab( SCTAB nTab, const OUString& rName, bool bExternalDoc
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
{
- pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(pViewShell->GetCurrentDocument());
+ SfxLokHelper::notifyDocumentSizeChanged(pViewShell, "", pModel);
pViewShell = SfxViewShell::GetNext(*pViewShell);
}
}
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index bd648ada28cb..c9267f436ebe 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -69,6 +69,7 @@
#include <comphelper/lok.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <sfx2/lokhelper.hxx>
// Redraw - Notifications
@@ -174,7 +175,8 @@ void ScDocShell::PostPaint( const ScRangeList& rRanges, PaintPartFlags nPart, sa
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
{
- pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, "");
+ ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(pViewShell->GetCurrentDocument());
+ SfxLokHelper::notifyDocumentSizeChanged(pViewShell, "", pModel);
pViewShell = SfxViewShell::GetNext(*pViewShell);
}
}
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 0005a3b2da07..5116fd17e6fc 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2560,7 +2560,8 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle)
std::stringstream ss;
ss << aNewSize.Width() << ", " << aNewSize.Height();
OString sSize = ss.str().c_str();
- aViewData.GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, sSize.getStr());
+ ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(aViewData.GetViewShell()->GetCurrentDocument());
+ SfxLokHelper::notifyDocumentSizeChanged(aViewData.GetViewShell(), sSize, pModel);
// New area extended to the bottom of the sheet after last row
// excluding overlapping area with aNewColArea
@@ -2703,8 +2704,8 @@ OUString ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle)
std::stringstream ss;
ss << aNewSize.Width() << ", " << aNewSize.Height();
OString sSize = ss.str().c_str();
- aViewData.GetViewShell()->libreOfficeKitViewCallback(
- LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, sSize.getStr());
+ ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(aViewData.GetViewShell()->GetCurrentDocument());
+ SfxLokHelper::notifyDocumentSizeChanged(aViewData.GetViewShell(), sSize, pModel);
}
// New area extended to the right of the sheet after last column
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 2eb0b5d57089..db33673cfddb 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -404,7 +404,8 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
std::stringstream ss;
ss << aNewSize.Width() << ", " << aNewSize.Height();
OString sSize = ss.str().c_str();
- aViewData.GetViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, sSize.getStr());
+ ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(aViewData.GetViewShell()->GetCurrentDocument());
+ SfxLokHelper::notifyDocumentSizeChanged(aViewData.GetViewShell(), sSize, pModel);
// New area extended to the right of the sheet after last column
// including overlapping area with aNewRowArea
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index 84afe610ff35..3ece4d760efb 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -327,7 +327,8 @@ void ScTabView::TabChanged( bool bSameTabButMoved )
ss << aDocSize.Width() << ", " << aDocSize.Height();
OString sRect = ss.str().c_str();
ScTabViewShell* pViewShell = aViewData.GetViewShell();
- pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, sRect.getStr());
+ ScModelObj* pModel = comphelper::getUnoTunnelImplementation<ScModelObj>(pViewShell->GetCurrentDocument());
+ SfxLokHelper::notifyDocumentSizeChanged(pViewShell, sRect, pModel);
}
}
}