editeng/source/outliner/outliner.cxx | 10 ++++++++-- editeng/source/outliner/overflowingtxt.cxx | 10 ++++++++-- include/editeng/overflowingtxt.hxx | 4 +++- 3 files changed, 19 insertions(+), 5 deletions(-)
New commits: commit 1f71d4b088f43611094ae95d53c6bea44bf7a9ad Author: matteocam <matteo.campane...@gmail.com> Date: Mon Jul 13 11:29:58 2015 -0400 Add bLastParaInterrupted to NonOverflowingText Change-Id: Ie6864bfbce088fabd3fba65c3e1313bc2fafcbac diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 2b03d26..a8e5be0 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2131,7 +2131,8 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const { ESelection aEmptySel(0,0,0,0); EditTextObject *pTObj = pEditEngine->CreateTextObject(aEmptySel); - return new NonOverflowingText(pTObj); + bool bLastParaInterrupted = true; // Last Para was interrupted since everything overflew + return new NonOverflowingText(pTObj, bLastParaInterrupted); } else { // Get the lines that of the overflowing para fit in the box sal_Int32 nOverflowingPara = nCount; @@ -2159,7 +2160,12 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const ESelection(nStartPara, nStartPos, nOverflowingPara, nLen); } EditTextObject *pTObj = pEditEngine->CreateTextObject(aNonOverflowingTextSelection); - return new NonOverflowingText(pTObj); + + sal_Int32 nLastLine = GetLineCount(nOverflowingPara)-1; + bool bLastParaInterrupted = + pEditEngine->GetOverflowingLineNum() < nLastLine; + + return new NonOverflowingText(pTObj, bLastParaInterrupted); } } diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 339a335..9b6da0a 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -55,12 +55,18 @@ ESelection OverflowingText::GetInsertionPointSel() const // class NonOverflowingText -NonOverflowingText::NonOverflowingText(const EditTextObject *pTObj) - : mpContentTextObj(pTObj->Clone()) +NonOverflowingText::NonOverflowingText(const EditTextObject *pTObj, bool bLastParaInterrupted) + : mpContentTextObj(pTObj->Clone()), + mbLastParaInterrupted(bLastParaInterrupted) { // XXX: may have to delete pTObj } +bool NonOverflowingText::IsLastParaInterrupted() const +{ + return mbLastParaInterrupted; +} + OutlinerParaObject *NonOverflowingText::ToParaObject(Outliner *pOutliner) const { diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 72d2355..449ca5a 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -60,13 +60,15 @@ class NonOverflowingText { public: OutlinerParaObject *ToParaObject(Outliner *) const; ESelection GetOverflowPointSel() const; + bool IsLastParaInterrupted() const; private: // Constructor - NonOverflowingText(const EditTextObject *pTObj); + NonOverflowingText(const EditTextObject *pTObj, bool bLastParaInterrupted); friend class Outliner; const EditTextObject *mpContentTextObj; + const bool mbLastParaInterrupted; }; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits