sc/qa/unit/tiledrendering/data/DocumentWithLongFirstColumn.ods |binary sc/source/ui/view/tabview.cxx | 9 +++-- sc/source/ui/view/tabview3.cxx | 16 ++++++---- 3 files changed, 16 insertions(+), 9 deletions(-)
New commits: commit 8795bd709ce5a179782fea4aa2d69d72dfe481d7 Author: Caolán McNamara <[email protected]> AuthorDate: Mon Mar 25 14:31:11 2024 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Tue Mar 26 17:29:24 2024 +0100 lok: The GridWindow can get reset to a smaller than wanted size This is the same problem as described in: commit 22a185a977f90d706c3e9d182adeaac310b6f348 Date: Thu Jan 11 15:08:21 2024 +0900 sc lok: set the GridWindow size to the client area size + test except that the size of the GridWindow gets reset by UpdateFormulas via UpdateHeaderWidth to the width of the "frame" which is remains at the nominal 800x600 initial size throughout. That only happens if there are enough rows in the document to trigger a check against this, so add some extra content into the test document to trigger the problem, and then guard against this reset for the kit case. Change-Id: Ibf80849929a4c987fd0fe977518336e5115ebdce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165241 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sc/qa/unit/tiledrendering/data/DocumentWithLongFirstColumn.ods b/sc/qa/unit/tiledrendering/data/DocumentWithLongFirstColumn.ods index 27fc3f45c543..9c03b5ae2f43 100644 Binary files a/sc/qa/unit/tiledrendering/data/DocumentWithLongFirstColumn.ods and b/sc/qa/unit/tiledrendering/data/DocumentWithLongFirstColumn.ods differ diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 6417c4e3115e..6c6f174278bf 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2743,9 +2743,6 @@ void lcl_ExtendTiledDimension(bool bColumn, const SCCOLROW nEnd, const SCCOLROW if (pModelObj) aNewSize = pModelObj->getDocumentSize(); - if (aOldSize == aNewSize) - return; - if (!pDocSh) return; @@ -2755,10 +2752,14 @@ void lcl_ExtendTiledDimension(bool bColumn, const SCCOLROW nEnd, const SCCOLROW if (pGridWindow) { Size aNewSizePx(aNewSize.Width() * rViewData.GetPPTX(), aNewSize.Height() * rViewData.GetPPTY()); - pGridWindow->SetOutputSizePixel(aNewSizePx); + if (aNewSizePx != pGridWindow->GetOutputSizePixel()) + pGridWindow->SetOutputSizePixel(aNewSizePx); } } + if (aOldSize == aNewSize) + return; + // 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 9e36ec386eb0..8345ba9f42d0 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -425,9 +425,6 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew ) if (pModelObj) aNewSize = pModelObj->getDocumentSize(); - if (aOldSize == aNewSize) - return; - if (!pDocSh) return; @@ -437,10 +434,14 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew ) if (pGridWindow) { Size aNewSizePx(aNewSize.Width() * aViewData.GetPPTX(), aNewSize.Height() * aViewData.GetPPTY()); - pGridWindow->SetOutputSizePixel(aNewSizePx); + if (aNewSizePx != pGridWindow->GetOutputSizePixel()) + pGridWindow->SetOutputSizePixel(aNewSizePx); } } + if (aOldSize == aNewSize) + return; + // 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()); @@ -2379,7 +2380,12 @@ void ScTabView::UpdateFormulas(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, if ( aViewData.IsPagebreakMode() ) UpdatePageBreakData(); //! asynchronous - UpdateHeaderWidth(); + bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive(); + // UpdateHeaderWidth can fit the GridWindow widths to the frame, something + // we don't want in kit-mode where we try and match the GridWindow width + // to the tiled area separately + if (!bIsTiledRendering) + UpdateHeaderWidth(); // if in edit mode, adjust edit view area because widths/heights may have changed if ( aViewData.HasEditView( aViewData.GetActivePart() ) )
