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 242e7401eee6a7c4fbae1af85fd6a37362a16924 Author: Gülşah Köse <gulsah.k...@collabora.com> AuthorDate: Fri Jul 25 13:18:07 2025 +0300 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Mon Aug 11 06:24:03 2025 +0200 Invalidate column haaders when style brush is applied. Signed-off-by: Gülşah Köse <gulsah.k...@collabora.com> Change-Id: Iff56926a230b60f71c6103b5a86f5d7e7deda68b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188335 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Kohei Yoshida <ko...@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx index 2dc82d4e1645..fa2d1214f5b9 100644 --- a/sc/source/ui/inc/viewfunc.hxx +++ b/sc/source/ui/inc/viewfunc.hxx @@ -214,7 +214,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 243fd2c30275..b0311f36371b 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -113,7 +113,7 @@ void collectUIInformation(std::map<OUString, OUString>&& aParameters, const OUSt using ::std::vector; using ::std::unique_ptr; -bool ScViewFunc::AdjustBlockHeight( bool bPaint, ScMarkData* pMarkData ) +bool ScViewFunc::AdjustBlockHeight( bool bPaint, ScMarkData* pMarkData, bool bRangeWidthChanged ) { ScDocShell* pDocSh = GetViewData().GetDocShell(); if (!pMarkData) @@ -182,7 +182,7 @@ bool ScViewFunc::AdjustBlockHeight( bool bPaint, ScMarkData* pMarkData ) SCTAB nTab = GetViewData().GetTabNo(); ScTabViewShell::notifyAllViewsSheetGeomInvalidation( GetViewData().GetViewShell(), - false /* bColumns */, true /* bRows */, + bRangeWidthChanged /* bColumns */, true /* bRows */, true /* bSizes*/, false /* bHidden */, false /* bFiltered */, false /* bGroups */, nTab); ScTabViewShell::notifyAllViewsHeaderInvalidation(GetViewData().GetViewShell(), ROW_HEADER, nTab); diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index f485ea2d9439..a0bd3ff432fe 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -1144,6 +1144,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) @@ -1359,7 +1360,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;