editeng/source/outliner/outliner.cxx | 18 ++++++++++++------ include/editeng/outliner.hxx | 2 ++ svx/source/svdraw/svdotextdecomposition.cxx | 12 ++++++++---- 3 files changed, 22 insertions(+), 10 deletions(-)
New commits: commit 0d64bfe7c447be8b508e04990e0b1a81ae352be8 Author: matteocam <matteo.campane...@gmail.com> Date: Thu Jun 11 12:45:36 2015 -0400 Added Outliner::GetEmptyParaObject Change-Id: I233ad3e908fd69791f8b044d2ab4af2cd65d2484 diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index a4c285b..060e628 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2121,12 +2121,8 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const // Only overflowing text, i.e. 1st line of 1st paragraph overflowing if ( nCount == 0 && nOverflowLine == 0) { - EditTextObject *pEmptyText = pEditEngine->GetEmptyTextObject(); - OutlinerParaObject* pPObj = new OutlinerParaObject( *pEmptyText ); - pPObj->SetOutlinerMode(GetMode()); - - delete pEmptyText; - return new NonOverflowingText(pPObj, ""); + OutlinerParaObject* pEmptyPObj = GetEmptyParaObject(); + return new NonOverflowingText(pEmptyPObj, ""); } else if (nCount < 0) { // No overflowing Text: all para-s included nCount = GetParagraphCount(); @@ -2158,6 +2154,16 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const return new NonOverflowingText(pHeadParas, aPreOverflowingTxt); } +OutlinerParaObject *Outliner::GetEmptyParaObject() const +{ + EditTextObject *pEmptyText = pEditEngine->GetEmptyTextObject(); + OutlinerParaObject* pPObj = new OutlinerParaObject( *pEmptyText ); + pPObj->SetOutlinerMode(GetMode()); + + delete pEmptyText; + return pPObj; +} + OverflowingText *Outliner::GetOverflowingText() const { if ( pEditEngine->GetOverflowingParaNum() < 0) diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index 76f0157..0cef0cc 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -765,6 +765,8 @@ public: void ClearOverflowingParaNum(); bool IsPageOverflow(); + OutlinerParaObject *GetEmptyParaObject() const; + virtual void DepthChangedHdl(); void SetDepthChangedHdl(const Link& rLink){aDepthChangedHdl=rLink;} Link GetDepthChangedHdl() const { return aDepthChangedHdl; } diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 5bcfbe3..d88dc56 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -738,7 +738,7 @@ OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOut pNonOverflowingTxt = pOutliner->GetNonOverflowingText(); - pOutliner->Clear(); + //pOutliner->Clear(); //pOutliner->SetStyleSheet( 0, pEdtOutl->GetStyleSheet(0)); if (pNonOverflowingTxt->mPreOverflowingTxt == "" && @@ -756,6 +756,10 @@ OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOut if (pNonOverflowingTxt->mpHeadParas != NULL) pOutliner->SetText(*pNonOverflowingTxt->mpHeadParas); + else { // set empty paraObj + + pOutliner->SetText(*emptyParaObj); + } pOutliner->AddText(*pPObj); } @@ -780,7 +784,7 @@ OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutlin return NULL; // XXX: Not sure if necessary - pOutliner->Clear(); + //pOutliner->Clear(); OutlinerParaObject *pCurTxt = pNextTextObj->GetOutlinerParaObject(); pOutliner->SetText(*pCurTxt); @@ -802,7 +806,7 @@ OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutlin OutlinerParaObject *pJoiningPara = NULL; if (pOldPara0) { - pOutliner->Clear(); + //pOutliner->Clear(); pTmpPara0 = pOutliner->GetParagraph(0); pOutliner->SetText(mpOverflowingText->mTailTxt + aOldPara0Txt, pTmpPara0); @@ -810,7 +814,7 @@ OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutlin } // start actual composition - pOutliner->Clear(); + //pOutliner->Clear(); // Set headText at the beginning of box Paragraph *pNewPara0 = pOutliner->GetParagraph(0); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits