diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 05:03:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 05:09:28 +0000 |
commit | 97ac77f067910fa5e8206d75160fa63546a9358d (patch) | |
tree | e6fa64b43e8150ef65578afa4f1f40f3e19f7fa3 /sc/source/core | |
parent | Releasing progress-linux version 4:24.2.2-3~progress7.99u1. (diff) | |
download | libreoffice-97ac77f067910fa5e8206d75160fa63546a9358d.tar.xz libreoffice-97ac77f067910fa5e8206d75160fa63546a9358d.zip |
Merging upstream version 4:24.2.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sc/source/core')
-rw-r--r-- | sc/source/core/data/documen9.cxx | 9 | ||||
-rw-r--r-- | sc/source/core/data/drwlayer.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/formulacell.cxx | 11 | ||||
-rw-r--r-- | sc/source/core/data/table1.cxx | 16 |
4 files changed, 24 insertions, 16 deletions
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index a9f04943c0..ee72637fa9 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -440,13 +440,8 @@ bool ScDocument::IsPrintEmpty( SCCOL nStartCol, SCROW nStartRow, // keep vertical part of aMMRect, only update horizontal position aMMRect = *pLastMM; - tools::Long nLeft = 0; - SCCOL i; - for (i=0; i<nStartCol; i++) - nLeft += GetColWidth(i,nTab); - tools::Long nRight = nLeft; - for (i=nStartCol; i<=nEndCol; i++) - nRight += GetColWidth(i,nTab); + tools::Long nLeft = GetColWidth(0, nStartCol-1, nTab); + tools::Long nRight = nLeft + GetColWidth(nStartCol,nEndCol, nTab); aMMRect.SetLeft(o3tl::convert(nLeft, o3tl::Length::twip, o3tl::Length::mm100)); aMMRect.SetRight(o3tl::convert(nRight, o3tl::Length::twip, o3tl::Length::mm100)); diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index d5f2cc09b9..d03f3572dc 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -1055,6 +1055,10 @@ void ScDrawLayer::InitializeCellAnchoredObj(SdrObject* pObj, ScDrawObjData& rDat UpdateCellAnchorFromPositionEnd(*pObj, rNoRotatedAnchor, *pDoc, nTab1, true /*bUseLogicRect*/); } + else if (pObj->GetObjIdentifier() == SdrObjKind::Group) + { + // nothing to do. + } else { // In case there are hidden rows or cols, versions 7.0 and earlier have written width and diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index f278492b09..93d712d106 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -4607,10 +4607,17 @@ struct ScDependantsCalculator continue; } + SCROW nFirstRefStartRow = bIsRef1RowRel ? aAbs.aStart.Row() + mnStartOffset : aAbs.aStart.Row(); + SCROW nLastRefEndRow = bIsRef2RowRel ? aAbs.aEnd.Row() + mnEndOffset : aAbs.aEnd.Row(); + + SCROW nFirstRefEndRow = bIsRef1RowRel ? aAbs.aStart.Row() + mnEndOffset : aAbs.aStart.Row(); + SCROW nLastRefStartRow = bIsRef2RowRel ? aAbs.aEnd.Row() + mnStartOffset : aAbs.aEnd.Row(); + // The first row that will be referenced through the doubleref. - SCROW nFirstRefRow = bIsRef1RowRel ? aAbs.aStart.Row() + mnStartOffset : aAbs.aStart.Row(); + SCROW nFirstRefRow = std::min(nFirstRefStartRow, nLastRefStartRow); // The last row that will be referenced through the doubleref. - SCROW nLastRefRow = bIsRef2RowRel ? aAbs.aEnd.Row() + mnEndOffset : aAbs.aEnd.Row(); + SCROW nLastRefRow = std::max(nLastRefEndRow, nFirstRefEndRow); + // Number of rows to be evaluated from nFirstRefRow. SCROW nArrayLength = nLastRefRow - nFirstRefRow + 1; assert(nArrayLength > 0); diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 93d023f962..4df5d92ec5 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -2091,17 +2091,19 @@ void ScTable::ExtendPrintArea( OutputDevice* pDev, else { // These columns are visible. Check for empty columns. - for (SCCOL j = i; j <= nLastCol; ++j) + SCCOL nEmptyCount = 0; + SCCOL j = i; + for (; j <= nLastCol; ++j) { if ( j >= aCol.size() ) - { - aSkipCols.setTrue( j, rDocument.MaxCol() ); break; - } - if (aCol[j].GetCellCount() == 0) - // empty - aSkipCols.setTrue(j,j); + if (aCol[j].GetCellCount() == 0) // empty + nEmptyCount++; } + if (nEmptyCount) + aSkipCols.setTrue(i,i+nEmptyCount); + if ( j >= aCol.size() ) + aSkipCols.setTrue( j, rDocument.MaxCol() ); } i = nLastCol; } |