diff options
-rw-r--r-- | sc/source/core/data/column2.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/output2.cxx | 14 |
2 files changed, 13 insertions, 5 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index d037685c66e4..a2f8ca5ea25a 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1328,6 +1328,10 @@ bool ScColumn::HasVisibleDataAt(SCROW nRow) const bool ScColumn::IsEmptyData(SCROW nStartRow, SCROW nEndRow) const { + // simple case + if (maCells.block_size() == 1 && maCells.begin()->type == sc::element_type_empty) + return true; + std::pair<sc::CellStoreType::const_iterator,size_t> aPos = maCells.position(nStartRow); sc::CellStoreType::const_iterator it = aPos.first; if (it == maCells.end()) diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index c80c6483bc5e..1b67ab4f4b24 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -1513,8 +1513,11 @@ void ScOutputData::LayoutStrings(bool bPixelToLogic) SCCOL nLastContentCol = mpDoc->MaxCol(); if ( nX2 < mpDoc->MaxCol() ) - nLastContentCol = sal::static_int_cast<SCCOL>( - nLastContentCol - mpDoc->GetEmptyLinesInBlock( nX2+1, nY1, nTab, mpDoc->MaxCol(), nY2, nTab, DIR_RIGHT ) ); + { + SCROW nEndRow; + mpDoc->GetCellArea(nTab, nLastContentCol, nEndRow); + } + SCCOL nLoopStartX = nX1; if ( nX1 > 0 ) --nLoopStartX; // start before nX1 for rest of long text to the left @@ -4394,11 +4397,12 @@ void ScOutputData::DrawEdit(bool bPixelToLogic) } tools::Long nLayoutSign = bLayoutRTL ? -1 : 1; - //! store nLastContentCol as member! SCCOL nLastContentCol = mpDoc->MaxCol(); if ( nX2 < mpDoc->MaxCol() ) - nLastContentCol = sal::static_int_cast<SCCOL>( - nLastContentCol - mpDoc->GetEmptyLinesInBlock( nX2+1, nY1, nTab, mpDoc->MaxCol(), nY2, nTab, DIR_RIGHT ) ); + { + SCROW nEndRow; + mpDoc->GetCellArea(nTab, nLastContentCol, nEndRow); + } tools::Long nRowPosY = nScrY; for (SCSIZE nArrY=0; nArrY+1<nArrCount; nArrY++) // 0 of the rest of the merged |