summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/tiledrendering/tiledrendering.cxx3
-rw-r--r--sc/source/ui/unoobj/docuno.cxx7
-rw-r--r--sc/source/ui/view/tabview.cxx10
-rw-r--r--sc/source/ui/view/tabview3.cxx13
4 files changed, 26 insertions, 7 deletions
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 14b80dde4ca7..85f9c235f450 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -3603,6 +3603,9 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testLongFirstColumnMouseClick)
// very long (longer than ~800px default size of GridWindow) triggers a code-path where the cell
// selected is the neighbouring cell even when we clicked on the area of the first cell.
+ comphelper::LibreOfficeKit::setCompatFlag(
+ comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs);
+
ScModelObj* pModelObj = createDoc("DocumentWithLongFirstColumn.ods");
CPPUNIT_ASSERT(pModelObj);
pModelObj->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>());
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 96c4d18f69d7..f92864e76ece 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1171,13 +1171,6 @@ void ScModelObj::setClientVisibleArea(const tools::Rectangle& rRectangle)
if (pTabView)
pTabView->extendTiledAreaIfNeeded();
}
-
- // Set the GridWindow size to the client area size, so that the logic in GridWindow works correctly
- // for the current view and doesn't cause any unexpected behaviour related to window size and checks if we are
- // outside of the window.
-
- ScGridWindow* pGridWindow = pViewData->GetActiveWin();
- pGridWindow->SetOutputSizePixel(Size(rRectangle.GetWidth() * pViewData->GetPPTX(), rRectangle.GetHeight() * pViewData->GetPPTY()));
}
void ScModelObj::setOutlineState(bool bColumn, int nLevel, int nIndex, bool bHidden)
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index a865acb71505..5d0699f26e6b 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2734,6 +2734,16 @@ void lcl_ExtendTiledDimension(bool bColumn, const SCCOLROW nEnd, const SCCOLROW
if (!pDocSh)
return;
+ if (pModelObj)
+ {
+ ScGridWindow* pGridWindow = rViewData.GetActiveWin();
+ if (pGridWindow)
+ {
+ Size aNewSizePx(aNewSize.Width() * rViewData.GetPPTX(), aNewSize.Height() * rViewData.GetPPTY());
+ pGridWindow->SetOutputSizePixel(aNewSizePx);
+ }
+ }
+
// New area extended to the right/bottom of the sheet after last col/row
tools::Rectangle aNewArea(Point(0, 0), aNewSize);
// excluding overlapping area with aNewArea
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 7de940ce24a9..fb91cc886ef3 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -423,9 +423,22 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew )
if (pModelObj)
aNewSize = pModelObj->getDocumentSize();
+ if (aOldSize == aNewSize)
+ return;
+
if (!pDocSh)
return;
+ if (pModelObj)
+ {
+ ScGridWindow* pGridWindow = aViewData.GetActiveWin();
+ if (pGridWindow)
+ {
+ Size aNewSizePx(aNewSize.Width() * aViewData.GetPPTX(), aNewSize.Height() * aViewData.GetPPTY());
+ pGridWindow->SetOutputSizePixel(aNewSizePx);
+ }
+ }
+
// New area extended to the right of the sheet after last column
// including overlapping area with aNewRowArea
tools::Rectangle aNewColArea(aOldSize.getWidth(), 0, aNewSize.getWidth(), aNewSize.getHeight());