sc/source/ui/inc/viewfunc.hxx | 2 +- sc/source/ui/view/viewfun2.cxx | 4 ++-- sc/source/ui/view/viewfun3.cxx | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-)
New commits: commit ea37c7805a9a68f694d892205ee475d8b531be35 Author: Gülşah Köse <[email protected]> AuthorDate: Fri Jul 25 13:18:07 2025 +0300 Commit: Gülşah Köse <[email protected]> CommitDate: Mon Oct 27 06:59:50 2025 +0100 Invalidate column haaders when style brush is applied. Signed-off-by: Gülşah Köse <[email protected]> Change-Id: Iff56926a230b60f71c6103b5a86f5d7e7deda68b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188335 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Kohei Yoshida <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192964 Tested-by: Jenkins diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx index 0ed2d8ee58bd..20dbc01f4de1 100644 --- a/sc/source/ui/inc/viewfunc.hxx +++ b/sc/source/ui/inc/viewfunc.hxx @@ -230,7 +230,7 @@ public: void SetMarkedWidthOrHeight( bool bWidth, ScSizeMode eMode, sal_uInt16 nSizeTwips ); - bool AdjustBlockHeight( bool bPaint = true, ScMarkData* pMarkData = nullptr ); + bool AdjustBlockHeight( bool bPaint = true, ScMarkData* pMarkData = nullptr, bool bRangeWidthChanged = false ); bool AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, bool bApi ); void ModifyCellSize( ScDirection eDir, bool bOptimal ); diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index d54b3355d083..0b9d85aad7e7 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -111,7 +111,7 @@ void collectUIInformation(std::map<OUString, OUString>&& aParameters, const OUSt } } -bool ScViewFunc::AdjustBlockHeight( bool bPaint, ScMarkData* pMarkData ) +bool ScViewFunc::AdjustBlockHeight( bool bPaint, ScMarkData* pMarkData, bool bRangeWidthChanged ) { ScDocShell& rDocSh = GetViewData().GetDocShell(); if (!pMarkData) @@ -179,7 +179,7 @@ bool ScViewFunc::AdjustBlockHeight( bool bPaint, ScMarkData* pMarkData ) { ScTabViewShell::notifyAllViewsSheetGeomInvalidation( GetViewData().GetViewShell(), - false /* bColumns */, true /* bRows */, + bRangeWidthChanged /* bColumns */, true /* bRows */, true /* bSizes*/, false /* bHidden */, false /* bFiltered */, false /* bGroups */, GetViewData().GetTabNumber()); ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), ROW_HEADER, GetViewData().GetTabNumber()); diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 799071fbdb7d..3aa58ac19bad 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -1150,6 +1150,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, // target-range, as displayed: ScRange aUserRange( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab ); + tools::Long nRangeWidth = GetViewData().GetDocShell().GetDocument().GetColWidth(nStartCol,nEndCol,nStartTab); // should lines be inserted? // ( too large nEndCol/nEndRow are detected below) @@ -1365,7 +1366,8 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, } pMixDoc.reset(); - AdjustBlockHeight(); // update row heights before pasting objects + bool IsRangeWidthChanged = nRangeWidth != GetViewData().GetDocShell().GetDocument().GetColWidth(nStartCol,nEndCol,nStartTab); + AdjustBlockHeight(true, nullptr, IsRangeWidthChanged ); // update row heights before pasting objects ::std::vector< OUString > aExcludedChartNames; SdrPage* pPage = nullptr;
