editeng/source/outliner/outliner.cxx | 28 +++++++++++++++++++++++++++- editeng/source/outliner/outlvw.cxx | 1 + editeng/source/outliner/overflowingtxt.cxx | 16 +++++++++++++--- include/editeng/overflowingtxt.hxx | 2 ++ svx/source/svdraw/textchainflow.cxx | 2 +- 5 files changed, 44 insertions(+), 5 deletions(-)
New commits: commit 30db056d97d95d5d68f938e390e0874f12f40e87 Author: matteocam <matteo.campane...@gmail.com> Date: Fri Aug 7 17:43:39 2015 +0200 Using QuickDelete instead of SetText for changes in Overflow Change-Id: Ia952113a6cdd0beace331e1f63d08b124d2629b0 diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 1404868..68a17c2 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2107,6 +2107,31 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const return NULL; } + // Same code as GetOverflowingText (we just have to get that selection after all) + + sal_Int32 nHeadPara = pEditEngine->GetOverflowingParaNum(); + sal_uInt32 nParaCount = GetParagraphCount(); + + sal_uInt32 nLen = 0; + for ( sal_Int32 nLine = 0; + nLine < pEditEngine->GetOverflowingLineNum(); + nLine++) { + nLen += GetLineLen(nHeadPara, nLine); + } + + sal_uInt32 nOverflowingPara = pEditEngine->GetOverflowingParaNum(); + ESelection aOverflowingTextSel; + sal_Int32 nLastPara = nParaCount-1; + sal_Int32 nLastParaLen = GetText(GetParagraph(nLastPara)).getLength(); + aOverflowingTextSel = ESelection(nOverflowingPara, nLen, + nLastPara, nLastParaLen); + bool bLastParaInterrupted = + pEditEngine->GetOverflowingLineNum() > 0; + + return new NonOverflowingText(aOverflowingTextSel, bLastParaInterrupted); + + /* Old code + // Only overflowing text, i.e. 1st line of 1st paragraph overflowing bool bItAllOverflew = nCount == 0 && nOverflowLine == 0; if ( bItAllOverflew ) @@ -2147,8 +2172,9 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const bool bLastParaInterrupted = pEditEngine->GetOverflowingLineNum() > 0; - return new NonOverflowingText(pTObj, bLastParaInterrupted); + return new NonOverflowingText(pTObj, bLastParaInterrupted); } + * */ } OutlinerParaObject *Outliner::GetEmptyParaObject() const diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index 8f7be36..39f6321 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -697,9 +697,6 @@ void OutlinerView::PasteSpecial() pOwner->UndoActionStart( OLUNDO_INSERT ); pOwner->pEditEngine->SetUpdateMode( false ); - // XXX:Experiment with QuickDelete - pOwner->QuickDelete(ESelection(0,0,0,1)); - pOwner->bPasting = true; pEditView->PasteSpecial(); diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index b015c28..34f1bb4 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -135,6 +135,12 @@ NonOverflowingText::NonOverflowingText(const EditTextObject *pTObj, bool bLastP // XXX: may have to delete pTObj } +NonOverflowingText::NonOverflowingText(const ESelection &aSel, bool bLastParaInterrupted) + : maContentSel(aSel), + mbLastParaInterrupted(bLastParaInterrupted) +{ +} + bool NonOverflowingText::IsLastParaInterrupted() const { return mbLastParaInterrupted; @@ -143,9 +149,13 @@ bool NonOverflowingText::IsLastParaInterrupted() const OutlinerParaObject *NonOverflowingText::ToParaObject(Outliner *pOutliner) const { - OutlinerParaObject *pPObj = new OutlinerParaObject(*mpContentTextObj); - pPObj->SetOutlinerMode(pOutliner->GetOutlinerMode()); - return pPObj; + // XXX: Old code + //OutlinerParaObject *pPObj = new OutlinerParaObject(*mpContentTextObj); + //pPObj->SetOutlinerMode(pOutliner->GetOutlinerMode()); + //return pPObj; + + pOutliner->QuickDelete(maContentSel); + return pOutliner->CreateParaObject(); } ESelection NonOverflowingText::GetOverflowPointSel() const diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index ae9b39e..76a9623 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -68,10 +68,12 @@ public: private: // Constructor NonOverflowingText(const EditTextObject *pTObj, bool bLastParaInterrupted); + NonOverflowingText(const ESelection &aSel, bool bLastParaInterrupted); friend class Outliner; const EditTextObject *mpContentTextObj; const bool mbLastParaInterrupted; + const ESelection maContentSel; }; diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index 1da308a..71fd30f 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -296,7 +296,7 @@ void EditingTextChainFlow::CheckForFlowEvents(SdrOutliner *pFlowOutl) void EditingTextChainFlow::impLeaveOnlyNonOverflowingText(SdrOutliner *pNonOverflOutl) { OutlinerParaObject *pNewText = impGetNonOverflowingParaObject(pNonOverflOutl); - impSetTextForEditingOutliner(pNewText); + //impSetTextForEditingOutliner(pNewText); //XXX: Don't call it since we do everything with NonOverflowingText::ToParaObject GetLinkTarget()->NbcSetOutlinerParaObject(pNewText); } commit d424de8e12f53a6bc51f491876dcccf6c4b0e6b7 Author: matteocam <matteo.campane...@gmail.com> Date: Fri Aug 7 17:11:38 2015 +0200 Experiment with Outliner::QuickDelete Change-Id: Ic23709c4dd1ffc0ad18f980e86a802c979b7f142 diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index 2f691bd..8f7be36 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -693,9 +693,13 @@ void OutlinerView::PasteSpecial() { if ( !ImpCalcSelectedPages( false ) || pOwner->ImpCanDeleteSelectedPages( this ) ) { + pOwner->UndoActionStart( OLUNDO_INSERT ); pOwner->pEditEngine->SetUpdateMode( false ); + // XXX:Experiment with QuickDelete + pOwner->QuickDelete(ESelection(0,0,0,1)); + pOwner->bPasting = true; pEditView->PasteSpecial(); commit 18f398438a61930913331d1e92dd94a10c7b02ec Author: matteocam <matteo.campane...@gmail.com> Date: Fri Aug 7 15:08:17 2015 +0200 Noop commit for feature/gsoc14-draw-chained-text-boxes Change-Id: I175f520af7568455da95ccbae2301acb08f48587 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits