diff options
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 5 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 24 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 6 |
3 files changed, 7 insertions, 28 deletions
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index d5f465de5f6d..6a686723a184 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -601,7 +601,6 @@ private: std::vector<std::unique_ptr<DeletedNodeInfo>> maDeletedNodes; tools::Rectangle maInvalidRect; tools::Long mnCurTextHeight; - tools::Long mnCurTextHeightNTP; // without trailing empty paragraphs sal_uInt16 mnOnePixelInRef; IdleFormattter maIdleFormatter; @@ -893,7 +892,7 @@ private: const ParaPortionList& GetParaPortions() const { return maParaPortionList; } ParaPortionList& GetParaPortions() { return maParaPortionList; } - tools::Long Calc1ColumnTextHeight(tools::Long* pHeightNTP); + tools::Long Calc1ColumnTextHeight(); void IdleFormatAndLayout(EditView* pCurView) { maIdleFormatter.DoIdleFormat(pCurView); } @@ -1048,7 +1047,7 @@ public: EditSelection MoveParagraphs( Range aParagraphs, sal_Int32 nNewPos, EditView* pCurView ); - tools::Long CalcTextHeight( tools::Long* pHeightNTP ); + tools::Long CalcTextHeight(); sal_uInt32 GetTextHeight() const; sal_uInt32 CalcTextWidth( bool bIgnoreExtraSpace); sal_uInt32 CalcParaWidth( sal_Int32 nParagraph, bool bIgnoreExtraSpace ); diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 61c37b00d96f..fbf28b41c4dd 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -110,7 +110,6 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : mnBigTextObjectStart(20), meDefLanguage(LANGUAGE_DONTKNOW), mnCurTextHeight(0), - mnCurTextHeightNTP(0), maOnlineSpellTimer("editeng::ImpEditEngine aOnlineSpellTimer"), maStatusTimer("editeng::ImpEditEngine aStatusTimer"), mbKernAsianPunctuation(false), @@ -681,7 +680,6 @@ void ImpEditEngine::Clear() EditSelection aSel( aPaM ); mnCurTextHeight = 0; - mnCurTextHeightNTP = 0; ResetUndoManager(); @@ -740,10 +738,7 @@ void ImpEditEngine::SetText(const OUString& rText) } } if (rText.isEmpty()) // otherwise it must be invalidated later, !bFormatted is enough. - { mnCurTextHeight = 0; - mnCurTextHeightNTP = 0; - } EnableUndo( bUndoCurrentlyEnabled ); OSL_ENSURE( !HasUndoManager() || !GetUndoManager().GetUndoActionCount(), "Undo after SetText?" ); } @@ -3538,11 +3533,9 @@ sal_uInt32 ImpEditEngine::CalcLineWidth(ParaPortion const& rPortion, EditLine co return nWidth; } -tools::Long ImpEditEngine::Calc1ColumnTextHeight(tools::Long* pHeightNTP) +tools::Long ImpEditEngine::Calc1ColumnTextHeight() { tools::Long nHeight = 0; - if (pHeightNTP) - *pHeightNTP = 0; // Pretend that we have ~infinite height to get total height comphelper::ValueRestorationGuard aGuard(mnCurTextHeight, std::numeric_limits<tools::Long>::max()); @@ -3551,8 +3544,6 @@ tools::Long ImpEditEngine::Calc1ColumnTextHeight(tools::Long* pHeightNTP) { // bottom coordinate does not belong to area, so no need to do +1 nHeight = getBottomDocOffset(rInfo.aArea); - if (pHeightNTP && !rInfo.rPortion.IsEmpty()) - *pHeightNTP = nHeight; } return CallbackResult::Continue; }; @@ -3560,12 +3551,12 @@ tools::Long ImpEditEngine::Calc1ColumnTextHeight(tools::Long* pHeightNTP) return nHeight; } -tools::Long ImpEditEngine::CalcTextHeight(tools::Long* pHeightNTP) +tools::Long ImpEditEngine::CalcTextHeight() { assert( IsUpdateLayout() && "Should not be used when Update=FALSE: CalcTextHeight" ); if (mnColumns <= 1) - return Calc1ColumnTextHeight(pHeightNTP); // All text fits into a single column - done! + return Calc1ColumnTextHeight(); // All text fits into a single column - done! // The final column height can be smaller than total height divided by number of columns (taking // into account first line offset and interline spacing, that aren't considered in positioning @@ -3621,8 +3612,6 @@ tools::Long ImpEditEngine::CalcTextHeight(tools::Long* pHeightNTP) nTentativeColHeight += nWantedIncrease; nWantedIncrease = std::numeric_limits<tools::Long>::max(); nCurrentTextHeight = 0; - if (pHeightNTP) - *pHeightNTP = 0; auto GetHeightAndWantedIncrease = [&, minHeight = tools::Long(0), lastCol = sal_Int16(0)]( const LineAreaInfo& rInfo) mutable { if (rInfo.pLine) @@ -3636,13 +3625,6 @@ tools::Long ImpEditEngine::CalcTextHeight(tools::Long* pHeightNTP) } // bottom coordinate does not belong to area, so no need to do +1 nCurrentTextHeight = std::max(getBottomDocOffset(rInfo.aArea), minHeight); - if (pHeightNTP) - { - if (rInfo.rPortion.IsEmpty()) - *pHeightNTP = std::max(*pHeightNTP, minHeight); - else - *pHeightNTP = nCurrentTextHeight; - } } return CallbackResult::Continue; }; diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 6ae2804b4690..df5a13a83e71 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -525,8 +525,7 @@ void ImpEditEngine::FormatDoc() // One can also get into the formatting through UpdateMode ON=>OFF=>ON... // enable optimization first after Vobis delivery... { - tools::Long nNewHeightNTP; - tools::Long nNewHeight = CalcTextHeight(&nNewHeightNTP); + tools::Long nNewHeight = CalcTextHeight(); tools::Long nDiff = nNewHeight - mnCurTextHeight; if ( nDiff ) { @@ -536,7 +535,6 @@ void ImpEditEngine::FormatDoc() } mnCurTextHeight = nNewHeight; - mnCurTextHeightNTP = nNewHeightNTP; if ( maStatus.AutoPageSize() ) CheckAutoPageSize(); @@ -634,7 +632,7 @@ void ImpEditEngine::CheckPageOverflow() tools::Long nBoxHeight = GetMaxAutoPaperSize().Height(); SAL_INFO("editeng.chaining", "[OVERFLOW-CHECK] Current MaxAutoPaperHeight is " << nBoxHeight); - tools::Long nTxtHeight = CalcTextHeight(nullptr); + tools::Long nTxtHeight = CalcTextHeight(); SAL_INFO("editeng.chaining", "[OVERFLOW-CHECK] Current Text Height is " << nTxtHeight); sal_uInt32 nParaCount = maParaPortionList.Count(); |