[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/overflowingtxt.cxx | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) New commits: commit 08c726f26245e5fc0b35552812fc5bb53ef42c83 Author: matteocam Date: Thu Aug 20 18:33:40 2015 +0200 Don't add empty paras Change-Id: I9c507fc99f0c482b74ae398d1f44d3db3750f431 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 9b6ae81..bd0f59f 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -44,6 +44,11 @@ OutlinerParaObject *TextChainingUtils::JuxtaposeParaObject( pOutl->SetText(*pNextPObj); } +// Special case: if only empty text remove it at the end +bool bOnlyOneEmptyPara = !pNextPObj || + (pOutl->GetParagraphCount() == 1 && + pNextPObj->GetTextObject().GetText(0) == ""); + EditEngine &rEditEngine = const_cast(pOutl->GetEditEngine()); // XXX: this code should be moved in Outliner directly @@ -54,8 +59,12 @@ OutlinerParaObject *TextChainingUtils::JuxtaposeParaObject( aStartSel.Min(), true); -// Separate Paragraphs -rEditEngine.InsertParaBreak(aNewSel); +if (!bOnlyOneEmptyPara) { +// Separate Paragraphs +rEditEngine.InsertParaBreak(aNewSel); +} + + return pOutl->CreateParaObject(); } @@ -65,7 +74,7 @@ OutlinerParaObject *TextChainingUtils::DeeplyMergeParaObject( Outliner *pOutl, OutlinerParaObject *pNextPObj) { - if (!pNextPObj) { +if (!pNextPObj) { pOutl->SetToEmptyText(); } else { pOutl->SetText(*pNextPObj); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/outliner.cxx |4 ++-- editeng/source/outliner/overflowingtxt.cxx |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) New commits: commit 729dbfa57af9a237357dd54cd4b3f78c1ae32295 Author: matteocam Date: Thu Aug 20 18:22:31 2015 +0200 Set right selection when creating OverflowingText Change-Id: I795eca81c54e3196554915571e42978974fc0d73 diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 11e299b..9e76a00 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2159,8 +2159,8 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const //sal_Int32 nStartPos = 0; ESelection aOverflowingTextSelection; -const sal_Int32 nEndPara = 100; -const sal_Int32 nEndPos = 100; +const sal_Int32 nEndPara = GetParagraphCount()-1; +const sal_Int32 nEndPos = pEditEngine->GetTextLen(nEndPara); if (nLen == 0) { // XXX: What happens inside this case might be dependent on the joining paragraps or not-thingy diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index b46ad22..9b6ae81 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -89,7 +89,7 @@ OutlinerParaObject *TextChainingUtils::DeeplyMergeParaObject( TranferableText TextChainingUtils::CreateTransferableFromText(Outliner *pOutl) { const EditEngine &rEditEngine = pOutl->GetEditEngine(); -sal_Int32 nLastPara = rEditEngine.GetParagraphCount()-1; +sal_Int32 nLastPara = pOutl->GetParagraphCount()-1; ESelection aWholeTextSel(0, 0, nLastPara, rEditEngine.GetTextLen(nLastPara)); return rEditEngine.CreateTransferable(aWholeTextSel); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/overflowingtxt.cxx | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) New commits: commit 02739f1876f6d945823d5c4663e6b37f435f4a2f Author: matteocam Date: Tue Aug 18 12:54:16 2015 +0200 Assign return value of InsertText to EditSelection Change-Id: I6e00e408ed84c4310e276de8e0b37b230748cc13 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 3a97c89..3454aee 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -184,25 +184,30 @@ OutlinerParaObject *OverflowingText::JuxtaposeParaObject(Outliner *pOutl, Outlin // XXX: this code should be moved in Outliner directly // creating Outliner::InsertText(...transferable...) EditSelection aStartSel(pOutl->pEditEngine->CreateSelection(ESelection(0,0))); -EditPaM aPaM = pOutl->pEditEngine->InsertText(mxOverflowingContent, +EditSelection aNewSel = pOutl->pEditEngine->InsertText(mxOverflowingContent, OUString(), aStartSel.Min(), true); // Separate Paragraphs -pOutl->pEditEngine->InsertParaBreak(EditSelection(aPaM, aPaM)); +pOutl->pEditEngine->InsertParaBreak(aNewSel); return pOutl->CreateParaObject(); } -OutlinerParaObject *OverflowingText::impMakeOverflowingParaObject(Outliner *pOutliner) +// XXX: This method should probably be removed +OutlinerParaObject *OverflowingText::impMakeOverflowingParaObject(Outliner *) { +/* // Simply Juxtaposing; no within-para merging OutlinerParaObject *pOverflowingPObj = new OutlinerParaObject(*mpContentTextObj); // the OutlinerParaObject constr. at the prev line gives no valid outliner mode, so we set it pOverflowingPObj->SetOutlinerMode(pOutliner->GetOutlinerMode()); return pOverflowingPObj; +*/ +assert(0); // Should not be called +return NULL; } @@ -218,7 +223,9 @@ OutlinerParaObject *OverflowingText::DeeplyMergeParaObject(Outliner *pOutl, Outl // XXX: this code should be moved in Outliner directly // creating Outliner::InsertText(...transferable...) EditSelection aStartSel(pOutl->pEditEngine->CreateSelection(ESelection(0,0))); -EditPaM aPaM = pOutl->pEditEngine->InsertText(mxOverflowingContent, +// We don't need to mark the selection +// EditSelection aNewSel = +pOutl->pEditEngine->InsertText(mxOverflowingContent, OUString(), aStartSel.Min(), true); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng
editeng/source/outliner/overflowingtxt.cxx |9 - include/editeng/editeng.hxx|2 ++ include/editeng/outliner.hxx |2 +- 3 files changed, 7 insertions(+), 6 deletions(-) New commits: commit d5b80ee6210e9efac8f2a609ec8d9df5ce1153c9 Author: matteocam Date: Sat Aug 15 11:14:50 2015 +0200 [unbuildable] Included required headers Change-Id: I4f525b06982d34e0946e15cbcaa5fc8996d70f90 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index a443a82..3a97c89 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -26,6 +26,10 @@ #include #include +// XXX +#include +#include "../editeng/editdoc.hxx" + #include @@ -193,11 +197,6 @@ OutlinerParaObject *OverflowingText::JuxtaposeParaObject(Outliner *pOutl, Outlin OutlinerParaObject *OverflowingText::impMakeOverflowingParaObject(Outliner *pOutliner) { -if (mpContentTextObj == NULL) { -fprintf(stderr, "[Chaining] OverflowingText's mpContentTextObj is NULL!\n"); -return NULL; -} - // Simply Juxtaposing; no within-para merging OutlinerParaObject *pOverflowingPObj = new OutlinerParaObject(*mpContentTextObj); // the OutlinerParaObject constr. at the prev line gives no valid outliner mode, so we set it diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index 98f5d7c..e5604461 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -145,6 +145,8 @@ class EDITENG_DLLPUBLIC EditEngine friend class EditDbg; friend class Outliner; +friend class OverflowingText; + public: typedef std::vector ViewsType; diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index 07d9215..833a9ad 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -585,7 +585,7 @@ class EDITENG_DLLPUBLIC Outliner : public SfxBroadcaster friend class OutlinerUndoCheckPara; friend class OutlinerUndoChangeParaFlags; -friend class NonOverflowingText; +friend class OverflowingText; OutlinerEditEng*pEditEngine; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/outlvw.cxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit eddc701b22134997c53edc7c1d438a343bac017a Author: matteocam Date: Fri Aug 7 12:37:54 2015 +0200 Calling chaining during undo action for paste Change-Id: I68516eaa53703df9a96a8c5727272ee11f172788 diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index 16c416c..2f691bd 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -707,13 +707,13 @@ void OutlinerView::PasteSpecial() pOwner->ImplSetLevelDependendStyleSheet( nPara ); } +// XXX: Chaining call +if (aEndCutPasteLink.IsSet()) +aEndCutPasteLink.Call(NULL); + pEditView->SetEditEngineUpdateMode( true ); pOwner->UndoActionEnd( OLUNDO_INSERT ); pEditView->ShowCursor( true, true ); - -// XXX: Not sure if this should be called right before ShowCursor -if (aEndCutPasteLink.IsSet()) -aEndCutPasteLink.Call(NULL); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng include/svx svx/source
editeng/source/outliner/outlvw.cxx |8 include/editeng/outliner.hxx |4 ++-- include/svx/svdedxv.hxx|2 +- svx/source/svdraw/svdedxv.cxx |4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) New commits: commit 39a980fa88eb65a9feaeeb1b7db7f2f78070055b Author: matteocam Date: Thu Jul 30 13:48:52 2015 +0200 Change name to post-paste&cutting method Change-Id: Ie49890788ea0b7f3b58b3d4a854bbc0f09526bf9 diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index bff66ad..16c416c 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -679,8 +679,8 @@ void OutlinerView::Cut() pEditView->Cut(); // Chaining handling -if (aEndPasteLink.IsSet()) -aEndPasteLink.Call(NULL); +if (aEndCutPasteLink.IsSet()) +aEndCutPasteLink.Call(NULL); } } @@ -712,8 +712,8 @@ void OutlinerView::PasteSpecial() pEditView->ShowCursor( true, true ); // XXX: Not sure if this should be called right before ShowCursor -if (aEndPasteLink.IsSet()) -aEndPasteLink.Call(NULL); +if (aEndCutPasteLink.IsSet()) +aEndCutPasteLink.Call(NULL); } } diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index 74c9f72..96105e6 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -215,7 +215,7 @@ private: EDITENG_DLLPRIVATE void ImpPasted( sal_Int32 nStart, sal_Int32 nPrevParaCount, sal_Int32 nSize); EDITENG_DLLPRIVATE sal_Int32ImpCalcSelectedPages( bool bIncludeFirstSelected ); -Link<> aEndPasteLink; +Link<> aEndCutPasteLink; public: OutlinerView( Outliner* pOut, vcl::Window* pWindow ); @@ -376,7 +376,7 @@ public: OUStringGetSurroundingText() const; Selection GetSurroundingTextSelection() const; -voidSetEndPasteLinkHdl(const Link<> &rLink) { aEndPasteLink = rLink; } +voidSetEndCutPasteLinkHdl(const Link<> &rLink) { aEndCutPasteLink = rLink; } }; diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx index 6b6f27c..b5ee30b 100644 --- a/include/svx/svdedxv.hxx +++ b/include/svx/svdedxv.hxx @@ -128,7 +128,7 @@ protected: // handler for AutoGrowing text with active Outliner DECL_LINK(ImpOutlinerStatusEventHdl,EditStatus*); DECL_LINK(ImpChainingEventHdl,void*); -DECL_LINK(ImpAfterPasteChainingEventHdl,void*); +DECL_LINK(ImpAfterCutOrPasteChainingEventHdl,void*); DECL_LINK(ImpOutlinerCalcFieldValueHdl,EditFieldInfo*); // link for EndTextEditHdl diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 02f7df0..14f864a 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -525,7 +525,7 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl) return 0; } -IMPL_LINK_NOARG(SdrObjEditView,ImpAfterPasteChainingEventHdl) +IMPL_LINK_NOARG(SdrObjEditView,ImpAfterCutOrPasteChainingEventHdl) { SdrTextObj* pTextObj = dynamic_cast< SdrTextObj * >( GetTextEditObject()); if (!pTextObj) @@ -800,7 +800,7 @@ bool SdrObjEditView::SdrBeginTextEdit( pTextEditOutlinerView->ShowCursor(); pTextEditOutliner->SetStatusEventHdl(LINK(this,SdrObjEditView,ImpOutlinerStatusEventHdl)); if (pTextObj->IsChainable()) { - pTextEditOutlinerView->SetEndPasteLinkHdl(LINK(this,SdrObjEditView,ImpAfterPasteChainingEventHdl) ); + pTextEditOutlinerView->SetEndCutPasteLinkHdl(LINK(this,SdrObjEditView,ImpAfterCutOrPasteChainingEventHdl) ); /* We should call: * ImpChainingEventHdl(NULL); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/outlvw.cxx |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) New commits: commit 4493543f1fa9420a67ac18e904d436dc0404a8a3 Author: matteocam Date: Thu Jul 30 13:29:45 2015 +0200 Handle underflow after cutting text Change-Id: I33d83d7423a18f71ea7c1c4d1a03580354e48092 diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index 987bd0a..bff66ad 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -675,8 +675,13 @@ void OutlinerView::InsertText( const OutlinerParaObject& rParaObj ) void OutlinerView::Cut() { -if ( !ImpCalcSelectedPages( false ) || pOwner->ImpCanDeleteSelectedPages( this ) ) +if ( !ImpCalcSelectedPages( false ) || pOwner->ImpCanDeleteSelectedPages( this ) ) { pEditView->Cut(); + +// Chaining handling +if (aEndPasteLink.IsSet()) +aEndPasteLink.Call(NULL); +} } void OutlinerView::Paste() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source sd/source svx/source
editeng/source/outliner/outlvw.cxx |4 sd/source/ui/view/sdview.cxx |4 svx/source/svdraw/svdedxv.cxx | 11 +-- 3 files changed, 13 insertions(+), 6 deletions(-) New commits: commit 3b81b9fa231d4b8435b9869c59bd64e7d67cfd6f Author: matteocam Date: Fri Jul 24 18:04:27 2015 +0200 Move Chaining post-paste to OutlinerView Change-Id: If869ba6fc27d4c293a003a88c97cd52b71b9d895 diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index 88c6d10..987bd0a 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -705,6 +705,10 @@ void OutlinerView::PasteSpecial() pEditView->SetEditEngineUpdateMode( true ); pOwner->UndoActionEnd( OLUNDO_INSERT ); pEditView->ShowCursor( true, true ); + +// XXX: Not sure if this should be called right before ShowCursor +if (aEndPasteLink.IsSet()) +aEndPasteLink.Call(NULL); } } diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 9f2a83f..c1135de 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -1260,10 +1260,6 @@ void View::OnEndPasteOrDrop( PasteOrDropInfos* pInfos ) } } -/* Chaining handling */ -ImpChainingEventHdl(NULL); -TextChainCursorManager *pCursorManager = new TextChainCursorManager(this, pTextObj); -ImpMoveCursorAfterChainingEvent(pCursorManager); } bool View::ShouldToggleOn( diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index cfc5d33..fb71e2f 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -788,8 +788,15 @@ bool SdrObjEditView::SdrBeginTextEdit( pTextEditOutlinerView->ShowCursor(); pTextEditOutliner->SetStatusEventHdl(LINK(this,SdrObjEditView,ImpOutlinerStatusEventHdl)); -if (pTextObj->IsChainable()) - pTextEditOutliner->SetChainingEventHdl(LINK(this,SdrObjEditView,ImpChainingEventHdl) ); +if (pTextObj->IsChainable()) { + pTextEditOutlinerView->SetEndPasteLinkHdl(LINK(this,SdrObjEditView,ImpChainingEventHdl) ); +/* We should call: + * +ImpChainingEventHdl(NULL); +TextChainCursorManager *pCursorManager = new TextChainCursorManager(this, pTextObj); +ImpMoveCursorAfterChainingEvent(pCursorManager); +*/ +} #ifdef DBG_UTIL if (pItemBrowser!=nullptr) pItemBrowser->SetDirty(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng svx/source
editeng/source/outliner/outlvw.cxx |1 + include/editeng/outliner.hxx |1 + svx/source/svdraw/svdedxv.cxx |5 - 3 files changed, 6 insertions(+), 1 deletion(-) New commits: commit cd87130df7a95691e2e73af0076b02f6a6143cf4 Author: matteocam Date: Mon Jul 20 14:46:10 2015 -0400 Call chaining handling from end-of-paste handler Change-Id: I4b11d98558d2deb6fb4465eb98b383d5a5f5f0c9 diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index 1a9e10b..88c6d10 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -706,6 +706,7 @@ void OutlinerView::PasteSpecial() pOwner->UndoActionEnd( OLUNDO_INSERT ); pEditView->ShowCursor( true, true ); } + } void OutlinerView::CreateSelectionList (std::vector &aSelList) diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index dcdc3db..e1a4c91 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -215,6 +215,7 @@ private: EDITENG_DLLPRIVATE void ImpPasted( sal_Int32 nStart, sal_Int32 nPrevParaCount, sal_Int32 nSize); EDITENG_DLLPRIVATE sal_Int32ImpCalcSelectedPages( bool bIncludeFirstSelected ); + public: OutlinerView( Outliner* pOut, vcl::Window* pWindow ); virtual ~OutlinerView(); diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 3ac3c1e..774c974 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -1294,7 +1294,6 @@ bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin) ESelection aCurSel = pTextEditOutlinerView->GetSelection(); - SdrTextObj* pTextObj = NULL; if (mxTextEditObj.is()) pTextObj= dynamic_cast(mxTextEditObj.get()); @@ -1341,8 +1340,10 @@ bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin) } // FIXME(matteocam) +// Start chaining processing ImpChainingEventHdl(NULL); ImpMoveCursorAfterChainingEvent(); +// End chaining processing if (pWin!=NULL && pWin!=pTextEditWin) SetTextEditWin(pWin); #ifdef DBG_UTIL @@ -2036,6 +2037,8 @@ void SdrObjEditView::OnBeginPasteOrDrop( PasteOrDropInfos* ) void SdrObjEditView::OnEndPasteOrDrop( PasteOrDropInfos* ) { // applications can derive from these virtual methods to do something before a drop or paste operation +ImpChainingEventHdl(NULL); + } sal_uInt16 SdrObjEditView::GetSelectionLevel() const ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source
editeng/source/editeng/impedit3.cxx |2 +- svx/source/svdraw/svdedxv.cxx | 13 - 2 files changed, 9 insertions(+), 6 deletions(-) New commits: commit 89c288be6f20141ad6e29374dc3c4e7084dcc348 Author: matteocam Date: Tue Jul 14 20:03:31 2015 -0400 Handle UF/OF from KeyInput only Change-Id: Icf9a248450ac6e03d6aab6c3e7d202aab7b3a171 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 82fd6cd..f564a78 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -481,7 +481,7 @@ void ImpEditEngine::FormatDoc() //FIXME(matteocam) -CallChainingEventHdl(); // For chaining +//CallChainingEventHdl(); // For chaining LeaveBlockNotifications(); } diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 7314e41..4bbb28d 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -540,11 +540,12 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent() OutlinerView* pOLV = GetTextEditOutlinerView(); TextChain *pTextChain = pTextObj->GetTextChain(); +ESelection aNewSel = pTextChain->GetPostChainingSel(pTextObj); switch ( pTextChain->GetCursorEvent(pTextObj) ) { case CursorChainingEvent::UNCHANGED: -// Set same selection as before the chainging +// Set same selection as before the chaining // We need an explicit set because the Outliner is messed up //after text transfer and otherwise it brings us at arbitrary positions. pOLV->SetSelection(pTextChain->GetPreChainingSel(pTextObj)); @@ -554,8 +555,7 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent() SdrBeginTextEdit(pNextLink); // OutlinerView has changed, so we update the pointer pOLV = GetTextEditOutlinerView(); -pOLV->SetSelection(pTextChain->GetPostChainingSel(pTextObj)); // XXX - +pOLV->SetSelection(aNewSel); // XXX break; case CursorChainingEvent::TO_PREV_LINK: // XXX: To be handled @@ -1294,14 +1294,17 @@ bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin) pMod->SetChanged( true ); } +// FIXME(matteocam) +ImpChainingEventHdl(NULL); +ImpMoveCursorAfterChainingEvent(); + if (pWin!=NULL && pWin!=pTextEditWin) SetTextEditWin(pWin); #ifdef DBG_UTIL if (pItemBrowser!=nullptr) pItemBrowser->SetDirty(); #endif ImpMakeTextCursorAreaVisible(); -// FIXME(matteocam) -ImpMoveCursorAfterChainingEvent(); + return true; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/overflowingtxt.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 024ebf6859ceadd9a259b9607bdf1063516b0a29 Author: matteocam Date: Mon Jul 13 16:56:13 2015 -0400 Fix juxtaposing special case in deep merge Change-Id: Ica2e7935a4328ba05381ff44a1e5a0292b2860ea diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 7df78b0..31b3d64 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -79,7 +79,7 @@ OutlinerParaObject *impGetDeeplyMergedParaObject(Outliner *pOutl, pOutl->SetText(*pPObj1); return impGetJuxtaposedParaObject( pOutl, -pOutl->CreateParaObject(0, nParaCount - 1), +pOutl->CreateParaObject(0, nParaCount1 - 1), pPObj2); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/overflowingtxt.cxx |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) New commits: commit 9890550e354a311714550fa42d1e8a6aae8ea04b Author: matteocam Date: Mon Jul 13 16:13:46 2015 -0400 More debugging output Change-Id: I2a375ad899b8a284867251f5515b22d29834d1ee diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index ecb69d3..efaaa9b 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -219,10 +219,13 @@ OutlinerParaObject *OFlowChainedText::CreateOverflowingParaObject(Outliner *pOut if (mpOverflowingTxt == NULL || pTextToBeMerged == NULL) return NULL; -if (mbIsDeepMerge) +if (mbIsDeepMerge) { +fprintf(stderr, "[TEXTCHAINFLOW - OF] Deep merging paras\n" ); return mpOverflowingTxt->GetJuxtaposedParaObject(pOutliner, pTextToBeMerged ); -else +} else { +fprintf(stderr, "[TEXTCHAINFLOW - OF] Juxtaposing paras\n" ); return mpOverflowingTxt->GetDeeplyMergedParaObject(pOutliner, pTextToBeMerged ); +} } @@ -254,9 +257,11 @@ OutlinerParaObject *UFlowChainedText::CreateMergedUnderflowParaObject(Outliner * OutlinerParaObject *pCurText = mpUnderflowPObj; if (mbIsDeepMerge) { +fprintf(stderr, "[TEXTCHAINFLOW - UF] Deep merging paras\n" ); pNewText = impGetDeeplyMergedParaObject(pOutl, pCurText, pNextLinkWholeText); } else { // NewTextForCurBox = Txt(CurBox) ++ Txt(NextBox) +fprintf(stderr, "[TEXTCHAINFLOW - UF] Juxtaposing paras\n" ); pNewText = impGetJuxtaposedParaObject(pOutl, pCurText, pNextLinkWholeText); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/outliner.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 7aae39ef5679db0299c34095781187546cbedff2 Author: matteocam Date: Mon Jul 13 15:12:48 2015 -0400 Fix wrong definition of bLastParaIsInterrupted Change-Id: Ib0b65afa6c44e9b6b83c2acef5044d8cd3182a00 diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index a8e5be0..148efa7 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2161,9 +2161,9 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const } EditTextObject *pTObj = pEditEngine->CreateTextObject(aNonOverflowingTextSelection); -sal_Int32 nLastLine = GetLineCount(nOverflowingPara)-1; +//sal_Int32 nLastLine = GetLineCount(nOverflowingPara)-1; bool bLastParaInterrupted = -pEditEngine->GetOverflowingLineNum() < nLastLine; +pEditEngine->GetOverflowingLineNum() > 0; return new NonOverflowingText(pTObj, bLastParaInterrupted); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/overflowingtxt.cxx | 55 ++--- 1 file changed, 50 insertions(+), 5 deletions(-) New commits: commit 5694e32c7cbfb9079585502fae14ba7a583db999 Author: matteocam Date: Mon Jul 13 14:53:14 2015 -0400 Add rough algorithm for deep merging. Not all attrbs saved. Change-Id: I369f0e2c9e56e0257284a038bfe707dd37a88421 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 6a73775..ecb69d3 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -54,18 +54,63 @@ OutlinerParaObject *impGetJuxtaposedParaObject(Outliner *pOutl, return pPObj; } +// In a deep merge parts of text are not only juxtaposed but the last and first para become the same OutlinerParaObject *impGetDeeplyMergedParaObject(Outliner *pOutl, OutlinerParaObject *pPObj1, OutlinerParaObject *pPObj2) -{ // XXX: For now just the same - +{ assert(pOutl && pPObj1 && pPObj2); +const EditTextObject rTObj1 = pPObj1->GetTextObject(); +const EditTextObject rTObj2 = pPObj2->GetTextObject(); +sal_Int32 nParaCount1 = rTObj1.GetParagraphCount(); + +// If no paras in the first text, just use second text +if (nParaCount1 == 0) { +pOutl->SetText(*pPObj2); +return pOutl->CreateParaObject(); +} + + +sal_Int32 nLastPara1 = nParaCount1 - 1; + +// If last para of first text is empty, discard it and just juxtapose +if (rTObj1.GetText(nLastPara1) == "" && nParaCount1 >= 2) { +pOutl->SetText(*pPObj1); +return impGetJuxtaposedParaObject( +pOutl, +pOutl->CreateParaObject(0, nLastPara1 - 1), +pPObj2); +} + +/* --- Standard procedure: when pPObj1 is 'fine' --- */ + + +// Cut first para of second object +OUString aFirstParaTxt2 = rTObj2.GetText(0); + +// Prepare remainder for text 2 +OutlinerParaObject *pRemainderPObj2 = NULL; +if (rTObj2.GetParagraphCount() > 1) { +pOutl->SetText(*pPObj2); +pRemainderPObj2 = pOutl->CreateParaObject(1); // from second para on +} else { // No text to append +pRemainderPObj2 = NULL; +} + +// Set first object as text pOutl->SetText(*pPObj1); -pOutl->AddText(*pPObj2); -OutlinerParaObject *pPObj = pOutl->CreateParaObject(); -return pPObj; +// Merges LastPara(pPObj1) with FirstPara(pPObj2) +Paragraph *pLastPara1 = pOutl->GetParagraph(nLastPara1); +OUString aLastParaTxt1 = pOutl->GetText(pLastPara1); +pOutl->SetText(aLastParaTxt1 + aFirstParaTxt2, pLastPara1); // XXX: This way it screws up attributes! + +// add the remainder of the second text +if (pRemainderPObj2) +pOutl->AddText(*pRemainderPObj2); + +return pOutl->CreateParaObject(); } // class OverflowingText ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng
editeng/source/outliner/overflowingtxt.cxx | 78 +++-- include/editeng/overflowingtxt.hxx |3 + 2 files changed, 65 insertions(+), 16 deletions(-) New commits: commit d35ecc609fa55835f3942656dcd9330c24dc4521 Author: matteocam Date: Mon Jul 13 14:08:00 2015 -0400 Add impGetDeeplyMergedParaObject. But with juxtaposition semantics Change-Id: Idd8d8d39d7ddabc9bdfe416250c6611b21f74e11 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index eb6bfe5..6a73775 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -26,7 +26,7 @@ #include -// Helper function for *OverflowingText classes +/* Helper functions for *OverflowingText classes */ ESelection getLastPositionSel(const EditTextObject *pTObj) { @@ -40,6 +40,34 @@ ESelection getLastPositionSel(const EditTextObject *pTObj) return aEndPos; } +// Put a para next to each other in the same OutlinerParaObject +OutlinerParaObject *impGetJuxtaposedParaObject(Outliner *pOutl, + OutlinerParaObject *pPObj1, + OutlinerParaObject *pPObj2) +{ +assert(pOutl && pPObj1 && pPObj2); + +pOutl->SetText(*pPObj1); +pOutl->AddText(*pPObj2); +OutlinerParaObject *pPObj = pOutl->CreateParaObject(); + +return pPObj; +} + +OutlinerParaObject *impGetDeeplyMergedParaObject(Outliner *pOutl, + OutlinerParaObject *pPObj1, + OutlinerParaObject *pPObj2) +{ // XXX: For now just the same + +assert(pOutl && pPObj1 && pPObj2); + +pOutl->SetText(*pPObj1); +pOutl->AddText(*pPObj2); +OutlinerParaObject *pPObj = pOutl->CreateParaObject(); + +return pPObj; +} + // class OverflowingText OverflowingText::OverflowingText(EditTextObject *pTObj) @@ -89,24 +117,35 @@ OutlinerParaObject *OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou return NULL; } -// Simply Juxtaposing; no within-para merging OutlinerParaObject *pOverflowingPObj = new OutlinerParaObject(*mpContentTextObj); // the OutlinerParaObject constr. at the prev line gives no valid outliner mode, so we set it pOverflowingPObj->SetOutlinerMode(pOutl->GetOutlinerMode()); -/* Actual Text Setting */ -pOutl->SetText(*pOverflowingPObj); +// Simply Juxtaposing; no within-para merging +return impGetJuxtaposedParaObject(pOutl, pOverflowingPObj, pNextPObj); +} -// Set selection position between new and old text -//maInsertionPointSel = impGetEndSelection(pOutl); // XXX: Maybe setting in the constructor is just right +OutlinerParaObject *OverflowingText::impMakeOverflowingParaObject(Outliner *pOutliner) +{ +if (mpContentTextObj == NULL) { +fprintf(stderr, "[Chaining] OverflowingText's mpContentTextObj is NULL!\n"); +return NULL; +} + +// Simply Juxtaposing; no within-para merging +OutlinerParaObject *pOverflowingPObj = new OutlinerParaObject(*mpContentTextObj); +// the OutlinerParaObject constr. at the prev line gives no valid outliner mode, so we set it +pOverflowingPObj->SetOutlinerMode(pOutliner->GetOutlinerMode()); -pOutl->AddText(*pNextPObj); +return pOverflowingPObj; +} -// End Text Setting -OutlinerParaObject *pPObj = pOutl->CreateParaObject(); -//pPObj->SetOutlinerMode(pOutl->GetOutlinerMode()); -return pPObj; +OutlinerParaObject *OverflowingText::GetDeeplyMergedParaObject(Outliner *pOutliner, OutlinerParaObject *pNextPObj) +{ +OutlinerParaObject *pOverflowingPObj = impMakeOverflowingParaObject(pOutliner); + +return impGetDeeplyMergedParaObject(pOutliner, pOverflowingPObj, pNextPObj); } // class OFlowChainedText @@ -135,9 +174,13 @@ OutlinerParaObject *OFlowChainedText::CreateOverflowingParaObject(Outliner *pOut if (mpOverflowingTxt == NULL || pTextToBeMerged == NULL) return NULL; -return mpOverflowingTxt->GetJuxtaposedParaObject(pOutliner, pTextToBeMerged ); +if (mbIsDeepMerge) +return mpOverflowingTxt->GetJuxtaposedParaObject(pOutliner, pTextToBeMerged ); +else +return mpOverflowingTxt->GetDeeplyMergedParaObject(pOutliner, pTextToBeMerged ); } + OutlinerParaObject *OFlowChainedText::CreateNonOverflowingParaObject(Outliner *pOutliner) { if (mpNonOverflowingTxt == NULL) @@ -162,12 +205,15 @@ UFlowChainedText::UFlowChainedText(Outliner *pOutl, bool bIsDeepMerge) OutlinerParaObject *UFlowChainedText::CreateMergedUnderflowParaObject(Outliner *pOutl, OutlinerParaObject *pNextLinkWholeText) { +OutlinerParaObject *pNewText = NULL; OutlinerParaObject *pCurText = mpUnderflowPObj; -// NewTextForCurBox = Txt(CurBox) ++ Txt(NextBox) -pOutl->SetText(*pCurText); -pOutl->AddText(*pNextLinkWholeText); -OutlinerP
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng include/svx svx/source
editeng/source/outliner/overflowingtxt.cxx |9 +-- include/editeng/overflowingtxt.hxx |8 +- include/svx/textchainflow.hxx |2 - svx/source/svdraw/textchainflow.cxx| 34 + 4 files changed, 33 insertions(+), 20 deletions(-) New commits: commit 0c01a319097cc79e3860d1ac3d760de912bbe887 Author: matteocam Date: Mon Jul 13 12:32:43 2015 -0400 Move logic for para merging to editeng Change-Id: I10ed532d8a42dbcb2f4c5aaa52f1848dde6745e6 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 45e8f51..eb6bfe5 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -111,10 +111,12 @@ OutlinerParaObject *OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou // class OFlowChainedText -OFlowChainedText::OFlowChainedText(Outliner *pOutl) +OFlowChainedText::OFlowChainedText(Outliner *pOutl, bool bIsDeepMerge) { mpOverflowingTxt = pOutl->GetOverflowingText(); mpNonOverflowingTxt = pOutl->GetNonOverflowingText(); + +mbIsDeepMerge = bIsDeepMerge; } ESelection OFlowChainedText::GetInsertionPointSel() const @@ -129,7 +131,7 @@ ESelection OFlowChainedText::GetOverflowPointSel() const OutlinerParaObject *OFlowChainedText::CreateOverflowingParaObject(Outliner *pOutliner, OutlinerParaObject *pTextToBeMerged) { -// Just return the roughly merged paras fpr now +// Just return the roughly merged paras for now if (mpOverflowingTxt == NULL || pTextToBeMerged == NULL) return NULL; @@ -152,9 +154,10 @@ bool OFlowChainedText::IsLastParaInterrupted() const // classes UFlowChainedText -UFlowChainedText::UFlowChainedText(Outliner *pOutl) +UFlowChainedText::UFlowChainedText(Outliner *pOutl, bool bIsDeepMerge) { mpUnderflowPObj = pOutl->CreateParaObject(); +mbIsDeepMerge = bIsDeepMerge; } OutlinerParaObject *UFlowChainedText::CreateMergedUnderflowParaObject(Outliner *pOutl, OutlinerParaObject *pNextLinkWholeText) diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 2f63cea..345daa8 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -81,7 +81,7 @@ private: class EDITENG_DLLPUBLIC OFlowChainedText { public: -OFlowChainedText(Outliner *); +OFlowChainedText(Outliner *, bool ); OutlinerParaObject *CreateOverflowingParaObject(Outliner *, OutlinerParaObject *); OutlinerParaObject *CreateNonOverflowingParaObject(Outliner *); @@ -99,18 +99,22 @@ class EDITENG_DLLPUBLIC OFlowChainedText { NonOverflowingText *mpNonOverflowingTxt; OverflowingText *mpOverflowingTxt; +bool mbIsDeepMerge; + }; // UFlowChainedText is a simpler class than OFlowChainedText: it almost only joins para-objects class EDITENG_DLLPUBLIC UFlowChainedText { public: -UFlowChainedText(Outliner *); +UFlowChainedText(Outliner *, bool); OutlinerParaObject *CreateMergedUnderflowParaObject(Outliner *, OutlinerParaObject *); protected: private: OutlinerParaObject *mpUnderflowPObj; + +bool mbIsDeepMerge; }; #endif diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx index 8e8ad62..f96ce59 100644 --- a/include/svx/textchainflow.hxx +++ b/include/svx/textchainflow.hxx @@ -104,8 +104,6 @@ class TextChainFlow { OFlowChainedText *mpOverflChText; UFlowChainedText *mpUnderflChText; -bool mbMustMergeParaAmongLinks; - }; diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index 50bddb5..57147d3 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -41,7 +41,6 @@ TextChainFlow::TextChainFlow(SdrTextObj *pChainTarget) maCursorEvent = CursorChainingEvent::NULL_EVENT; mbPossiblyCursorOut = false; -mbMustMergeParaAmongLinks = false; } @@ -90,11 +89,26 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p pFlowOutl->SetUpdateMode(bOldUpdateMode); } +// Get old state on whether to merge para-s or not +// NOTE: We handle UF/OF using the _old_ state. The new one is simply saved +bool bMustMergeParaAmongLinks = GetTextChain()->GetIsPartOfLastParaInNextLink(mpTargetLink); + // Set (Non)OverflowingTxt here (if any) -mpOverflChText = bOverflow ? new OFlowChainedText(pFlowOutl) : NULL; +mpOverflChText = bOverflow ? new OFlowChainedText(pFlowOutl, bMustMergeParaAmongLinks) : NULL; // Set current underflowing text (if any) -mpUnderflChText = bUnderflow ? new UFlowChainedText(pFlowOutl) : NULL; +mpUnderflChText = bUnderflow ? new UFlowChainedText(pFlowOutl, bMustMergeParaAmongLinks) : NULL; + +// update new state on paragraph merging +if (bOverflow) { +GetTextChain()->SetIsPartOfL
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng include/svx svx/source
editeng/source/outliner/overflowingtxt.cxx |6 ++ include/editeng/overflowingtxt.hxx |2 ++ include/svx/textchainflow.hxx |2 ++ svx/source/svdraw/textchainflow.cxx| 10 ++ 4 files changed, 20 insertions(+) New commits: commit 92a56f1fb97e3a095fa2702ba6970b056fef7bf6 Author: matteocam Date: Mon Jul 13 12:01:16 2015 -0400 Add TextChainFlow info for merging paras Change-Id: Ieb1f951e083c11b9c18a9a15180e8aff7ef02db7 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 9b6da0a..45e8f51 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -144,6 +144,12 @@ OutlinerParaObject *OFlowChainedText::CreateNonOverflowingParaObject(Outliner *p return mpNonOverflowingTxt->ToParaObject(pOutliner); } +bool OFlowChainedText::IsLastParaInterrupted() const +{ +return mpNonOverflowingTxt->IsLastParaInterrupted(); +} + + // classes UFlowChainedText UFlowChainedText::UFlowChainedText(Outliner *pOutl) diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 449ca5a..2f63cea 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -89,6 +89,8 @@ class EDITENG_DLLPUBLIC OFlowChainedText { ESelection GetInsertionPointSel() const; ESelection GetOverflowPointSel() const; +bool IsLastParaInterrupted() const; + protected: void impSetOutlinerToEmptyTxt(Outliner *); diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx index f96ce59..8e8ad62 100644 --- a/include/svx/textchainflow.hxx +++ b/include/svx/textchainflow.hxx @@ -104,6 +104,8 @@ class TextChainFlow { OFlowChainedText *mpOverflChText; UFlowChainedText *mpUnderflChText; +bool mbMustMergeParaAmongLinks; + }; diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index 4c48266..50bddb5 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -40,6 +40,8 @@ TextChainFlow::TextChainFlow(SdrTextObj *pChainTarget) maCursorEvent = CursorChainingEvent::NULL_EVENT; mbPossiblyCursorOut = false; + +mbMustMergeParaAmongLinks = false; } @@ -100,6 +102,14 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p // To check whether an overflow is underflow induced or not (useful in cursor checking) mbOFisUFinduced = bUnderflow; +// Save old state and update new +mbMustMergeParaAmongLinks = GetTextChain()->GetIsPartOfLastParaInNextLink(mpTargetLink); + +if (bOverflow) +GetTextChain()->SetIsPartOfLastParaInNextLink(mpTargetLink, mpOverflChText->IsLastParaInterrupted()); +else // Overflows determine merging or not. If no OF, just merge everything next time. +GetTextChain()->SetIsPartOfLastParaInNextLink(mpTargetLink, true); + } void TextChainFlow::impUpdateCursorInfo() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng
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 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
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng
editeng/source/outliner/overflowingtxt.cxx | 22 +- include/editeng/overflowingtxt.hxx | 12 2 files changed, 29 insertions(+), 5 deletions(-) New commits: commit 6c36f1508baf0089f260e4ad7ddff57532bb125f Author: matteocam Date: Thu Jul 9 14:52:01 2015 -0400 Clone EditTextObjects before using them for *OverflowingText Change-Id: I0624b90967d5599534b3b159cb3e0838778ec3d9 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 868daa6..339a335 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -25,6 +25,9 @@ #include #include + +// Helper function for *OverflowingText classes + ESelection getLastPositionSel(const EditTextObject *pTObj) { sal_Int32 nLastPara = pTObj->GetParagraphCount()-1; @@ -37,8 +40,12 @@ ESelection getLastPositionSel(const EditTextObject *pTObj) return aEndPos; } -OverflowingText::OverflowingText(EditTextObject *pTObj) : mpContentTextObj(pTObj) +// class OverflowingText + +OverflowingText::OverflowingText(EditTextObject *pTObj) +: mpContentTextObj(pTObj->Clone()) { +// XXX: may have to delete pTObj } ESelection OverflowingText::GetInsertionPointSel() const @@ -46,6 +53,15 @@ ESelection OverflowingText::GetInsertionPointSel() const return getLastPositionSel(mpContentTextObj); } +// class NonOverflowingText + +NonOverflowingText::NonOverflowingText(const EditTextObject *pTObj) +: mpContentTextObj(pTObj->Clone()) +{ + // XXX: may have to delete pTObj +} + + OutlinerParaObject *NonOverflowingText::ToParaObject(Outliner *pOutliner) const { OutlinerParaObject *pPObj = new OutlinerParaObject(*mpContentTextObj); @@ -87,6 +103,8 @@ OutlinerParaObject *OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou return pPObj; } +// class OFlowChainedText + OFlowChainedText::OFlowChainedText(Outliner *pOutl) { mpOverflowingTxt = pOutl->GetOverflowingText(); @@ -120,6 +138,8 @@ OutlinerParaObject *OFlowChainedText::CreateNonOverflowingParaObject(Outliner *p return mpNonOverflowingTxt->ToParaObject(pOutliner); } +// classes UFlowChainedText + UFlowChainedText::UFlowChainedText(Outliner *pOutl) { mpUnderflowPObj = pOutl->CreateParaObject(); diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 4e97fcc..72d2355 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -31,6 +31,11 @@ class OutlinerParaObject; class EditTextObject; class Outliner; +/* + * The classes OverflowingText and NonOverflowingText handle the + * actual preparation of the OutlinerParaObjects to be used in destination + * and source box respectively. +*/ class OverflowingText { @@ -58,9 +63,7 @@ public: private: // Constructor -NonOverflowingText(const EditTextObject *pTObj) -: mpContentTextObj(pTObj) -{ } +NonOverflowingText(const EditTextObject *pTObj); friend class Outliner; const EditTextObject *mpContentTextObj; @@ -69,7 +72,8 @@ private: /* * classes OFlowChainedText and UFlowChainedText: - * contain and handle the state of a broken up text _after_ a flow event. + * contain and handle the state of a broken up text _after_ a flow event + * (respectively after Overflow and Underflow). * */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng include/svx svx/source
editeng/source/outliner/overflowingtxt.cxx | 10 + include/editeng/overflowingtxt.hxx |4 +- include/svx/textchainflow.hxx | 11 - svx/source/svdraw/svdedxv.cxx |2 - svx/source/svdraw/textchainflow.cxx| 57 - 5 files changed, 53 insertions(+), 31 deletions(-) New commits: commit b0273e17cdf5a0f0877c3bc64543b333727cfdc7 Author: matteocam Date: Wed Jul 8 23:06:07 2015 -0400 Test for actual cursor overflow Change-Id: Ia306b8ee15d986c773787a500a23a886caf20087 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 03ed385..304e04b 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -126,6 +126,16 @@ OFlowChainedText::OFlowChainedText(Outliner *pOutl) mpNonOverflowingTxt = pOutl->GetNonOverflowingText(); } +ESelection OFlowChainedText::GetInsertionPointSel() const +{ +return mpOverflowingTxt->GetInsertionPointSel(); +} + +ESelection OFlowChainedText::GetOverflowPointSel() const +{ +return mpNonOverflowingTxt->GetOverflowPointSel(); +} + OutlinerParaObject *OFlowChainedText::CreateOverflowingParaObject(Outliner *pOutliner, OutlinerParaObject *pTextToBeMerged) { // Just return the roughly merged paras fpr now diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 7faa9a9..4e97fcc 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -49,7 +49,6 @@ private: OverflowingText(EditTextObject *pTObj); const EditTextObject *mpContentTextObj; -ESelection maInsertionPointSel; }; class NonOverflowingText { @@ -81,7 +80,8 @@ class EDITENG_DLLPUBLIC OFlowChainedText { OutlinerParaObject *CreateOverflowingParaObject(Outliner *, OutlinerParaObject *); OutlinerParaObject *CreateNonOverflowingParaObject(Outliner *); -ESelection GetInsertionPointSel() const { return mpOverflowingTxt->GetInsertionPointSel(); } +ESelection GetInsertionPointSel() const; +ESelection GetOverflowPointSel() const; protected: void impSetOutlinerToEmptyTxt(Outliner *); diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx index b2373e8..00a04f3 100644 --- a/include/svx/textchainflow.hxx +++ b/include/svx/textchainflow.hxx @@ -62,7 +62,12 @@ class TextChainFlow { // -- Protected Members -- protected: + +// Cursor related +bool mbPossiblyCursorOut; CursorChainingEvent maCursorEvent; +ESelection maOverflowPosSel; + void impCheckForFlowEvents(SdrOutliner *, SdrOutliner *); @@ -80,8 +85,10 @@ class TextChainFlow { // -- Private Members -- private: +// XXX: It would be nice to get rid of this +bool mbOFisUFinduced; -void impUpdateCursorInfo(SdrOutliner *, bool); +void impUpdateCursorInfo(); SdrTextObj *mpTargetLink; SdrTextObj *mpNextLink; @@ -96,8 +103,6 @@ class TextChainFlow { OFlowChainedText *mpOverflChText; UFlowChainedText *mpUnderflChText; -// XXX: It would be nice to get rid of this -bool mbOFisUFinduced; }; diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index d893dab..16373c3 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -499,7 +499,7 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl) // We prevent to trigger further handling of overflow/underflow for pTextObj pTextChain->SetNilChainingEvent(pTextObj, true); -// Save previous selection pos +// Save previous selection pos // NOTE: It must be done to have the right CursorEvent in KeyInput pTextChain->SetPreChainingSel(pTextObj, pOLV->GetSelection()); //maPreChainingSel = new ESelection(pOLV->GetSelection()); diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index 161e615..1df7fe3 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -38,7 +38,8 @@ TextChainFlow::TextChainFlow(SdrTextObj *pChainTarget) mpOverflChText = NULL; mpUnderflChText = NULL; -maCursorEvent = CursorChainingEvent::UNCHANGED; +maCursorEvent = CursorChainingEvent::NULL_EVENT; +mbPossiblyCursorOut = false; } @@ -79,8 +80,6 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p bOverflow = bIsPageOverflow && mpNextLink; bUnderflow = !bIsPageOverflow && mpNextLink && mpNextLink->HasText(); -impUpdateCursorInfo(pFlowOutl, bOverflow); - if (pParamOutl != NULL) { pFlowOutl->SetUpdateMode(bOldUpdateMode); @@ -92,22 +91,22 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p // Set current underflowing text (if any) mpUnderflChText = bUnderflow ? new UFlowChainedTe
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng include/svx svx/source
editeng/source/outliner/outliner.cxx |5 editeng/source/outliner/overflowingtxt.cxx | 31 - include/editeng/overflowingtxt.hxx | 27 ++--- include/svx/textchainflow.hxx |2 - svx/source/svdraw/textchainflow.cxx|8 ++- 5 files changed, 45 insertions(+), 28 deletions(-) New commits: commit 7b5adb6f56dcd448cb2f92dd9dc679abb1479d50 Author: matteocam Date: Wed Jul 8 14:41:58 2015 -0400 Add Selection getters to (Non)OverflowingText Change-Id: Ia5f485c3f3adf6ae0cab3cf12ebb1119048eec83 diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 301ee0c..2b03d26 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2144,7 +2144,6 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const nLen += GetLineLen(nOverflowingPara, nLine); } -/* BEGIN Experiment with ESelection and EditTextobject */ sal_Int32 nStartPara = 0; sal_Int32 nStartPos = 0; ESelection aNonOverflowingTextSelection; @@ -2201,7 +2200,6 @@ OverflowingText *Outliner::GetOverflowingText() const nLen += GetLineLen(nHeadPara, nLine); } -/* BEGIN experiment ESEL */ sal_uInt32 nOverflowingPara = pEditEngine->GetOverflowingParaNum(); ESelection aOverflowingTextSel; sal_Int32 nLastPara = nParaCount-1; @@ -2211,9 +2209,6 @@ OverflowingText *Outliner::GetOverflowingText() const EditTextObject *pTObj = pEditEngine->CreateTextObject(aOverflowingTextSel); return new OverflowingText(pTObj); - -/* END experiment ESel */ - } void Outliner::ClearOverflowingParaNum() diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 77f4829..03ed385 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -23,6 +23,28 @@ #include #include #include +#include + +ESelection getLastPositionSel(const EditTextObject *pTObj) +{ +sal_Int32 nLastPara = pTObj->GetParagraphCount()-1; +// If text is empty +if (nLastPara < 0 ) +nLastPara = 0; +sal_Int32 nLen = pTObj->GetText(nLastPara).getLength(); +ESelection aEndPos(nLastPara, nLen, nLastPara, nLen); + +return aEndPos; +} + +OverflowingText::OverflowingText(EditTextObject *pTObj) : mpContentTextObj(pTObj) +{ +} + +ESelection OverflowingText::GetInsertionPointSel() const +{ +return getLastPositionSel(mpContentTextObj); +} OutlinerParaObject *NonOverflowingText::ToParaObject(Outliner *pOutliner) const { @@ -31,6 +53,11 @@ OutlinerParaObject *NonOverflowingText::ToParaObject(Outliner *pOutliner) const return pPObj; } +ESelection NonOverflowingText::GetOverflowPointSel() const +{ +return getLastPositionSel(mpContentTextObj); +} + // The equivalent of ToParaObject for OverflowingText. Here we are prepending the overflowing text to the old dest box's text // XXX: In a sense a better name for OverflowingText and NonOverflowingText are respectively DestLinkText and SourceLinkText OutlinerParaObject *OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, OutlinerParaObject *pNextPObj) @@ -49,7 +76,7 @@ OutlinerParaObject *OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou pOutl->SetText(*pOverflowingPObj); // Set selection position between new and old text -maInsertionPointSel = impGetEndSelection(pOutl); +//maInsertionPointSel = impGetEndSelection(pOutl); // XXX: Maybe setting in the constructor is just right pOutl->AddText(*pNextPObj); @@ -60,6 +87,7 @@ OutlinerParaObject *OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou return pPObj; } +/* ESelection OverflowingText::impGetEndSelection(Outliner *pOutl) const { const sal_Int32 nParaCount = pOutl->GetParagraphCount(); @@ -70,6 +98,7 @@ ESelection OverflowingText::impGetEndSelection(Outliner *pOutl) const ESelection aEndSel(nLastParaIndex,nLenLastPara,nLastParaIndex,nLenLastPara); return aEndSel; } +* */ /* OUString OverflowingText::GetEndingLines() const diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index be5530b..7faa9a9 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -36,14 +36,6 @@ class OverflowingText { public: -// Constructor - -OverflowingText(EditTextObject *pTObj) : mpContentTextObj(pTObj) -{ -ESelection aStartPos(0,0,0,0); -maInsertionPointSel = aStartPos; -} - OutlinerParaObject *GetJuxtaposedParaObject(Outliner *, OutlinerParaObject *); ESelection GetInsertionPointSel() const; @@ -52,25 +44,26 @@ public: //bool HasOtherParas() const { return !(mTailTxt == "" && mpMidParas == NULL); } private: +friend class Outliner; +// Construct
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng svx/source
editeng/source/outliner/overflowingtxt.cxx | 57 - include/editeng/overflowingtxt.hxx |7 +++ svx/source/svdraw/textchainflow.cxx|5 +- 3 files changed, 50 insertions(+), 19 deletions(-) New commits: commit abf19ac0252a7f21bb276ed98ee73312096eaf93 Author: matteocam Date: Wed Jul 8 09:31:28 2015 -0400 Save insertion point in dest box when making overflowing text Change-Id: If08717c89d424b3e248d628e289f00da2d340d94 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 49284f6..77f4829 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -31,23 +31,8 @@ OutlinerParaObject *NonOverflowingText::ToParaObject(Outliner *pOutliner) const return pPObj; } -/* -OUString OverflowingText::GetEndingLines() const -{ -// If the only overflowing part is some lines in a paragraph, -// the end of the overflowing text is its head. -if (!HasOtherParas()) -return mHeadTxt; - -return mTailTxt; -} - -OUString OverflowingText::GetHeadingLines() const -{ -return mHeadTxt; -} -* */ - +// The equivalent of ToParaObject for OverflowingText. Here we are prepending the overflowing text to the old dest box's text +// XXX: In a sense a better name for OverflowingText and NonOverflowingText are respectively DestLinkText and SourceLinkText OutlinerParaObject *OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, OutlinerParaObject *pNextPObj) { if (mpContentTextObj == NULL) { @@ -59,14 +44,52 @@ OutlinerParaObject *OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou OutlinerParaObject *pOverflowingPObj = new OutlinerParaObject(*mpContentTextObj); // the OutlinerParaObject constr. at the prev line gives no valid outliner mode, so we set it pOverflowingPObj->SetOutlinerMode(pOutl->GetOutlinerMode()); + +/* Actual Text Setting */ pOutl->SetText(*pOverflowingPObj); + +// Set selection position between new and old text +maInsertionPointSel = impGetEndSelection(pOutl); + pOutl->AddText(*pNextPObj); +// End Text Setting + OutlinerParaObject *pPObj = pOutl->CreateParaObject(); //pPObj->SetOutlinerMode(pOutl->GetOutlinerMode()); return pPObj; } +ESelection OverflowingText::impGetEndSelection(Outliner *pOutl) const +{ +const sal_Int32 nParaCount = pOutl->GetParagraphCount(); +const sal_Int32 nLastParaIndex = nParaCount > 1 ? nParaCount - 1 : 0; +Paragraph* pLastPara = pOutl->GetParagraph( nLastParaIndex); +const sal_Int32 nLenLastPara = pOutl->GetText(pLastPara).getLength(); +// Selection at end of editing area +ESelection aEndSel(nLastParaIndex,nLenLastPara,nLastParaIndex,nLenLastPara); +return aEndSel; +} + +/* +OUString OverflowingText::GetEndingLines() const +{ +// If the only overflowing part is some lines in a paragraph, +// the end of the overflowing text is its head. +if (!HasOtherParas()) +return mHeadTxt; + +return mTailTxt; +} + +OUString OverflowingText::GetHeadingLines() const +{ +return mHeadTxt; +} +* */ + + + OFlowChainedText::OFlowChainedText(Outliner *pOutl) { diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 797264b..be5530b 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -22,6 +22,7 @@ #include #include +#include class OUString; @@ -39,9 +40,12 @@ public: OverflowingText(EditTextObject *pTObj) : mpContentTextObj(pTObj) { +ESelection aStartPos(0,0,0,0); +maInsertionPointSel = aStartPos; } OutlinerParaObject *GetJuxtaposedParaObject(Outliner *, OutlinerParaObject *); +ESelection GetInsertionPointSel() const; //OUString GetHeadingLines() const; //OUString GetEndingLines() const; @@ -49,6 +53,9 @@ public: private: const EditTextObject *mpContentTextObj; +ESelection maInsertionPointSel; + +ESelection impGetEndSelection(Outliner *pOutl) const; }; class NonOverflowingText { diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index 2647afa..9e794bc 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -63,7 +63,8 @@ void TextChainFlow::impSetFlowOutlinerParams(SdrOutliner *, SdrOutliner *) void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *pParamOutl) { bool bOldUpdateMode = pFlowOutl->GetUpdateMode(); -// NOTE: Nah you probably don't need this + +// XXX: This could be reorganized moving most of this stuff inside EditingTextChainFlow (we need update=true anyway for TextChainFlow though) if (pParamOutl != NULL) { // We need this since it's required to check overflow @@ -83,7 +84,7 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutlin
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/overflowingtxt.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 720f3bb602d574cea191ffc659c596064be3be74 Author: matteocam Date: Wed Jul 1 15:24:04 2015 -0400 Moved setting outliner mode Change-Id: I442a08d76fe201a0f26eb4d64a59ae00c9df1fed diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 3e40b92..49284f6 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -57,11 +57,13 @@ OutlinerParaObject *OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou // Simply Juxtaposing; no within-para merging OutlinerParaObject *pOverflowingPObj = new OutlinerParaObject(*mpContentTextObj); +// the OutlinerParaObject constr. at the prev line gives no valid outliner mode, so we set it +pOverflowingPObj->SetOutlinerMode(pOutl->GetOutlinerMode()); pOutl->SetText(*pOverflowingPObj); pOutl->AddText(*pNextPObj); OutlinerParaObject *pPObj = pOutl->CreateParaObject(); -pPObj->SetOutlinerMode(pOutl->GetOutlinerMode()); +//pPObj->SetOutlinerMode(pOutl->GetOutlinerMode()); return pPObj; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng
editeng/source/outliner/outliner.cxx | 64 + editeng/source/outliner/overflowingtxt.cxx | 56 ++--- include/editeng/overflowingtxt.hxx | 31 +- 3 files changed, 22 insertions(+), 129 deletions(-) New commits: commit d82ca32c357d35b3e00379273e695281dafc22e1 Author: matteocam Date: Wed Jul 1 15:16:21 2015 -0400 All chaining code converted to EditTextObject approach Change-Id: I4a80b9424eafb7e14f9912e965caf03b42b42e65 diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 961f1bd..df1b54a 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2113,7 +2113,6 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const // last non-overflowing paragraph is before the first overflowing one sal_Int32 nCount = pEditEngine->GetOverflowingParaNum(); sal_Int32 nOverflowLine = pEditEngine->GetOverflowingLineNum(); -OUString aPreOverflowingTxt(""); // Defensive check: oveflowing para index beyond actual # of paragraphs? if ( nCount > GetParagraphCount()-1) { @@ -2124,20 +2123,23 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const return NULL; } + if (nCount < 0) + { +fprintf(stderr, +"[Overflowing] No Overflowing text but GetNonOverflowinText called?!\n"); +return NULL; + } + // Only overflowing text, i.e. 1st line of 1st paragraph overflowing -if ( nCount == 0 && nOverflowLine == 0) +bool bItAllOverflew = nCount == 0 && nOverflowLine == 0; +if ( bItAllOverflew ) { -OutlinerParaObject* pEmptyPObj = GetEmptyParaObject(); -return new NonOverflowingText(pEmptyPObj, ""); - -} else if (nCount < 0) { // No overflowing Text: all para-s included -nCount = GetParagraphCount(); -// aPreOverflowingText == "" +ESelection aEmptySel(0,0,0,0); +EditTextObject *pTObj = pEditEngine->CreateTextObject(aEmptySel); +return new NonOverflowingText(pTObj); } else { // Get the lines that of the overflowing para fit in the box -// XXX: Is there a proper method to join lines in a single string? sal_Int32 nOverflowingPara = nCount; -OUString aWholeTxtHeadPara = GetText(GetParagraph(nOverflowingPara)); sal_uInt32 nLen = 0; for ( sal_Int32 nLine = 0; @@ -2153,7 +2155,7 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const ESelection aNonOverflowingTextSelection; if (nLen == 0) { // XXX: What happens inside this case might be dependent on the joining paragraps or not-thingy -// Overflowing paragraph is empty: it's not "Non-Overflowing" text then +// Overflowing paragraph is empty or first line overflowing: it's not "Non-Overflowing" text then sal_Int32 nParaLen = GetText(GetParagraph(nOverflowingPara-1)).getLength(); aNonOverflowingTextSelection = ESelection(nStartPara, nStartPos, nOverflowingPara-1, nParaLen); @@ -2164,21 +2166,7 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const } EditTextObject *pTObj = pEditEngine->CreateTextObject(aNonOverflowingTextSelection); return new NonOverflowingText(pTObj); - - -/* END Experiment with ESelection and EditTextobject */ - -// XXX: Any separator to be included? -aPreOverflowingTxt = aWholeTxtHeadPara.copy(0, nLen); } - -OutlinerParaObject *pHeadParas; -if (nCount == 0) // No text to save expect for the one in the overflowing para (i.e. aPreOverflowingTxt) -pHeadParas = NULL; -else -pHeadParas = CreateParaObject(0, nCount); - -return new NonOverflowingText(pHeadParas, aPreOverflowingTxt); } OutlinerParaObject *Outliner::GetEmptyParaObject() const @@ -2206,19 +2194,10 @@ OverflowingText *Outliner::GetOverflowingText() const return NULL; } -OUString aHeadTxt, aTailTxt(""); -OutlinerParaObject *pMidParas = NULL; sal_Int32 nHeadPara = pEditEngine->GetOverflowingParaNum(); sal_uInt32 nParaCount = GetParagraphCount(); -sal_Int32 nTailPara = nParaCount-1; -sal_Int32 nMidParas = nTailPara-nHeadPara-1; - -// Set the head text -// XXX: Is there a proper method to join lines in a single string? -OUString aWholeTxtHeadPara = GetText(GetParagraph(nHeadPara)); - sal_uInt32 nLen = 0; for ( sal_Int32 nLine = 0; @@ -2240,23 +2219,6 @@ OverflowingText *Outliner::GetOverflowingText() const /* END experiment ESel */ -// XXX: Any separator to be included? -aHeadTxt = aWholeTxtHeadPara.copy(nLen); - - -// If there is at least one more paragraph overflowing -if (nTailPara > nHeadPara) { -// Get text of last paragraph -aTailTxt = GetText(GetParagraph(nTailPara)); -} - -if (nMidParas
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/outliner.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f04017fd48443d1fef48822585fb440945854801 Author: matteocam Date: Wed Jul 1 14:32:11 2015 -0400 Fixed other wrong para index Change-Id: Ia15a01fa61870753339d6edbf75faa31e85bb602 diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 63c40a1..961f1bd 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2231,7 +2231,7 @@ OverflowingText *Outliner::GetOverflowingText() const sal_uInt32 nOverflowingPara = pEditEngine->GetOverflowingParaNum(); ESelection aOverflowingTextSel; sal_Int32 nLastPara = nParaCount-1; -sal_Int32 nLastParaLen = GetText(GetParagraph(nLastPara-1)).getLength(); +sal_Int32 nLastParaLen = GetText(GetParagraph(nLastPara)).getLength(); aOverflowingTextSel = ESelection(nOverflowingPara, nLen, nLastPara, nLastParaLen); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/outliner.cxx |2 +- editeng/source/outliner/overflowingtxt.cxx | 11 +-- 2 files changed, 10 insertions(+), 3 deletions(-) New commits: commit 20f4c1f5c025afd2afb1abd612753f421186ee39 Author: matteocam Date: Wed Jul 1 14:15:40 2015 -0400 Fixed Outliner mode issue; Fixed wrong para index Change-Id: I88024bcc8280d017db10570f636f101a25d270b9 diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index bfd4189..63c40a1 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2231,7 +2231,7 @@ OverflowingText *Outliner::GetOverflowingText() const sal_uInt32 nOverflowingPara = pEditEngine->GetOverflowingParaNum(); ESelection aOverflowingTextSel; sal_Int32 nLastPara = nParaCount-1; -sal_Int32 nLastParaLen = GetText(GetParagraph(nOverflowingPara-1)).getLength(); +sal_Int32 nLastParaLen = GetText(GetParagraph(nLastPara-1)).getLength(); aOverflowingTextSel = ESelection(nOverflowingPara, nLen, nLastPara, nLastParaLen); diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 5a7b15c..666f53b 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -28,7 +28,11 @@ OutlinerParaObject *NonOverflowingText::ToParaObject(Outliner *pOutliner) const { if (mpContentTextObj) -return new OutlinerParaObject(*mpContentTextObj); +{ +OutlinerParaObject *pPObj = new OutlinerParaObject(*mpContentTextObj); +pPObj->SetOutlinerMode(pOutliner->GetOutlinerMode()); +return pPObj; +} // XXX: Possibility: let the NonUnderflowingParaObject just be a TextEditObject created by the Outliner (by means of a selection). @@ -99,7 +103,10 @@ OutlinerParaObject *OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou OutlinerParaObject *pOverflowingPObj = new OutlinerParaObject(*mpContentTextObj); pOutl->SetText(*pOverflowingPObj); pOutl->AddText(*pNextPObj); -return pOutl->CreateParaObject(); + +OutlinerParaObject *pPObj = pOutl->CreateParaObject(); +pPObj->SetOutlinerMode(pOutl->GetOutlinerMode()); +return pPObj; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng
editeng/source/outliner/outliner.cxx | 20 ++-- editeng/source/outliner/overflowingtxt.cxx | 22 ++ include/editeng/overflowingtxt.hxx |9 + 3 files changed, 49 insertions(+), 2 deletions(-) New commits: commit 7007bf784049586639835a3df436e5a8ef00ce8b Author: matteocam Date: Wed Jul 1 13:29:32 2015 -0400 EditTetxObj approach for OverflowingText; only para juxtaposition Change-Id: I98c2fe3d3d4583a8d8a5880a0df39ded30f2bed2 diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 4fde0ce..bfd4189 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2210,20 +2210,36 @@ OverflowingText *Outliner::GetOverflowingText() const OutlinerParaObject *pMidParas = NULL; -sal_uInt32 nHeadPara = pEditEngine->GetOverflowingParaNum(); +sal_Int32 nHeadPara = pEditEngine->GetOverflowingParaNum(); sal_uInt32 nParaCount = GetParagraphCount(); -sal_uInt32 nTailPara = nParaCount-1; +sal_Int32 nTailPara = nParaCount-1; sal_Int32 nMidParas = nTailPara-nHeadPara-1; // Set the head text // XXX: Is there a proper method to join lines in a single string? OUString aWholeTxtHeadPara = GetText(GetParagraph(nHeadPara)); + + sal_uInt32 nLen = 0; for ( sal_Int32 nLine = 0; nLine < pEditEngine->GetOverflowingLineNum(); nLine++) { nLen += GetLineLen(nHeadPara, nLine); } + +/* BEGIN experiment ESEL */ +sal_uInt32 nOverflowingPara = pEditEngine->GetOverflowingParaNum(); +ESelection aOverflowingTextSel; +sal_Int32 nLastPara = nParaCount-1; +sal_Int32 nLastParaLen = GetText(GetParagraph(nOverflowingPara-1)).getLength(); +aOverflowingTextSel = ESelection(nOverflowingPara, nLen, + nLastPara, nLastParaLen); + +EditTextObject *pTObj = pEditEngine->CreateTextObject(aOverflowingTextSel); +return new OverflowingText(pTObj); + +/* END experiment ESel */ + // XXX: Any separator to be included? aHeadTxt = aWholeTxtHeadPara.copy(nLen); diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 23246fb..5a7b15c 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -88,6 +88,20 @@ OUString OverflowingText::GetHeadingLines() const return mHeadTxt; } +OutlinerParaObject *OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, OutlinerParaObject *pNextPObj) +{ +if (mpContentTextObj == NULL) { +fprintf(stderr, "[Chaining] OverflowingText's mpContentTextObj is NULL!\n"); +return NULL; +} + +// Simply Juxtaposing; no within para-merging +OutlinerParaObject *pOverflowingPObj = new OutlinerParaObject(*mpContentTextObj); +pOutl->SetText(*pOverflowingPObj); +pOutl->AddText(*pNextPObj); +return pOutl->CreateParaObject(); +} + OFlowChainedText::OFlowChainedText(Outliner *pOutl) { @@ -97,6 +111,13 @@ OFlowChainedText::OFlowChainedText(Outliner *pOutl) OutlinerParaObject *OFlowChainedText::CreateOverflowingParaObject(Outliner *pOutliner, OutlinerParaObject *pTextToBeMerged) { +// Just return the roughly merged paras fpr now +if (mpOverflowingTxt == NULL || pTextToBeMerged == NULL) +return NULL; + +return mpOverflowingTxt->GetJuxtaposedParaObject(pOutliner, pTextToBeMerged ); + +/* if (mpOverflowingTxt == NULL || pTextToBeMerged == NULL) return NULL; @@ -162,6 +183,7 @@ OutlinerParaObject *OFlowChainedText::CreateOverflowingParaObject(Outliner *pOut // Draw everything OutlinerParaObject *pNewText = pOutliner->CreateParaObject(); return pNewText; +* */ } OutlinerParaObject *OFlowChainedText::CreateNonOverflowingParaObject(Outliner *pOutliner) diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 12e1e7c..3e9ce3a 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -50,9 +50,18 @@ public: mTailTxt(tailTxt) { } +OverflowingText(EditTextObject *pTObj) : mpContentTextObj(pTObj) +{ +} + +OutlinerParaObject *GetJuxtaposedParaObject(Outliner *, OutlinerParaObject *); + OUString GetHeadingLines() const; OUString GetEndingLines() const; bool HasOtherParas() const { return !(mTailTxt == "" && mpMidParas == NULL); } + +private: +const EditTextObject *mpContentTextObj; }; class NonOverflowingText { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng svx/source
editeng/source/outliner/outliner.cxx | 21 editeng/source/outliner/overflowingtxt.cxx |4 ++ include/editeng/overflowingtxt.hxx | 48 + svx/source/svdraw/textchainflow.cxx|1 4 files changed, 48 insertions(+), 26 deletions(-) New commits: commit 70a2ad32027cb16163e6075a994a4a5ffc47e551 Author: matteocam Date: Tue Jun 30 17:59:43 2015 -0400 Using EditTextObject for NonOverflowingText Change-Id: I148835df1e6f856913e9b6146ccc5431ff4fca97 diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index e63c7ff..4fde0ce 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2147,6 +2147,27 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const nLen += GetLineLen(nOverflowingPara, nLine); } +/* BEGIN Experiment with ESelection and EditTextobject */ +sal_Int32 nStartPara = 0; +sal_Int32 nStartPos = 0; +ESelection aNonOverflowingTextSelection; +if (nLen == 0) { +// XXX: What happens inside this case might be dependent on the joining paragraps or not-thingy +// Overflowing paragraph is empty: it's not "Non-Overflowing" text then +sal_Int32 nParaLen = GetText(GetParagraph(nOverflowingPara-1)).getLength(); +aNonOverflowingTextSelection = +ESelection(nStartPara, nStartPos, nOverflowingPara-1, nParaLen); +} else { +// We take until we have to from the overflowing paragraph +aNonOverflowingTextSelection = +ESelection(nStartPara, nStartPos, nOverflowingPara, nLen); +} +EditTextObject *pTObj = pEditEngine->CreateTextObject(aNonOverflowingTextSelection); +return new NonOverflowingText(pTObj); + + +/* END Experiment with ESelection and EditTextobject */ + // XXX: Any separator to be included? aPreOverflowingTxt = aWholeTxtHeadPara.copy(0, nLen); } diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 6565a44..23246fb 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -22,10 +22,14 @@ #include #include +#include OutlinerParaObject *NonOverflowingText::ToParaObject(Outliner *pOutliner) const { +if (mpContentTextObj) +return new OutlinerParaObject(*mpContentTextObj); + // XXX: Possibility: let the NonUnderflowingParaObject just be a TextEditObject created by the Outliner (by means of a selection). /* The overflow in SdrTextObj can occur: diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index b559921..12e1e7c 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -30,9 +30,6 @@ class OutlinerParaObject; class EditTextObject; class Outliner; -typedef EditTextObject FormattedTextPortion; - - class OverflowingText { @@ -64,21 +61,26 @@ class NonOverflowingText { // NOTE: mPreOverflowingTxt might be empty // Constructor -NonOverflowingText( -const OutlinerParaObject *pHeadParas, -const OUString &preOverflowingTxt) -: mpHeadParas(pHeadParas), - mPreOverflowingTxt(preOverflowingTxt) -{ -if (pHeadParas == NULL) // Redundant line for debugging -DBG_ASSERT( pHeadParas != NULL, "pHeadParas is null?! All text is overflowing then" ); -} +NonOverflowingText(const OutlinerParaObject *pHeadParas, + const OUString &preOverflowingTxt) +: mpHeadParas(pHeadParas), + mPreOverflowingTxt(preOverflowingTxt), mpContentTextObj(NULL) +{ +if (pHeadParas == NULL) // Redundant line for debugging +DBG_ASSERT( pHeadParas != NULL, "pHeadParas is null?! All text is overflowing then" ); +} + +NonOverflowingText(const EditTextObject *pTObj) +: mpContentTextObj(pTObj) +{ } OutlinerParaObject *ToParaObject(Outliner *) const; private: const OutlinerParaObject *mpHeadParas; OUString mPreOverflowingTxt; + +const EditTextObject *mpContentTextObj; }; @@ -90,35 +92,31 @@ class NonOverflowingText { class EDITENG_DLLPUBLIC OFlowChainedText { public: -OFlowChainedText(Outliner *); +OFlowChainedText(Outliner *); -OutlinerParaObject *CreateOverflowingParaObject(Outliner *, OutlinerParaObject *); -OutlinerParaObject *CreateNonOverflowingParaObject(Outliner *); +OutlinerParaObject *CreateOverflowingParaObject(Outliner *, OutlinerParaObject *); +OutlinerParaObject *CreateNonOverflowingParaObject(Outliner *); protected: -void impSetOutlinerToEmptyTxt(Outliner *)
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng
editeng/source/outliner/overflowingtxt.cxx | 73 ++--- include/editeng/overflowingtxt.hxx |7 +- 2 files changed, 50 insertions(+), 30 deletions(-) New commits: commit 7dc421a02393f091b741f160e3895b884866cb06 Author: matteocam Date: Tue Jun 30 16:36:45 2015 -0400 Moved and commented code to get ParaObject in NonOverflowingText Change-Id: I8a011c3c0143d2f074281b9327398082a8053dc8 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 533be0d..6565a44 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -23,6 +23,51 @@ #include #include +OutlinerParaObject *NonOverflowingText::ToParaObject(Outliner *pOutliner) const +{ + +// XXX: Possibility: let the NonUnderflowingParaObject just be a TextEditObject created by the Outliner (by means of a selection). + +/* The overflow in SdrTextObj can occur: + * (a) exactly at the end of a paragraph, or + * (b) in the middle of a paragraph. + * + * In case (a), a NonUnderflowingText object contains only the + * paragraphs occurred before the overflow. + * In case (b), a NonUnderflowingText contains also the text of the + * paragraph that was cut by overflow. +*/ + +bool bOverflowOccurredAtEndOfPara = +(mPreOverflowingTxt == "") && +(mpHeadParas != NULL); + +if (bOverflowOccurredAtEndOfPara) { +// Case (a) above: +// Only (possibly empty) paragraphs before overflowing one. +pOutliner->SetText(*mpHeadParas); +} else { +// Case (b): some text is non included in any OutlinerParaObject. +// We have to include the non-overflowing lines from the overfl. para + +// first make a ParaObject for the strings +pOutliner->SetToEmptyText(); +Paragraph *pTmpPara0 = pOutliner->GetParagraph(0); +pOutliner->SetText(mPreOverflowingTxt, pTmpPara0); +OutlinerParaObject *pPObj = pOutliner->CreateParaObject(); + +if (mpHeadParas != NULL) { +pOutliner->SetText(*mpHeadParas); +pOutliner->AddText(*pPObj); + } else if (mPreOverflowingTxt != "") { // only preoverflowing txt +pOutliner->SetText(*pPObj); +} else { // no text // This case is redundant but it doesn't hurt for now +pOutliner->SetToEmptyText(); +} +} + + return pOutliner->CreateParaObject(); +} OUString OverflowingText::GetEndingLines() const { @@ -120,33 +165,7 @@ OutlinerParaObject *OFlowChainedText::CreateNonOverflowingParaObject(Outliner *p if (mpNonOverflowingTxt == NULL) return NULL; -if (mpNonOverflowingTxt->mPreOverflowingTxt == "" && -mpNonOverflowingTxt->mpHeadParas != NULL) { -// Only (possibly empty) paragraphs before overflowing one -pOutliner->SetText(*mpNonOverflowingTxt->mpHeadParas); -} else { // We have to include the non-overflowing lines from the overfl. para - -// first make a ParaObject for the strings -pOutliner->SetToEmptyText(); -Paragraph *pTmpPara0 = pOutliner->GetParagraph(0); -pOutliner->SetText(mpNonOverflowingTxt->mPreOverflowingTxt, pTmpPara0); -OutlinerParaObject *pPObj = pOutliner->CreateParaObject(); -//pOutliner->Clear(); -//pOutliner->SetStyleSheet( 0, pEdtOutl->GetStyleSheet(0)); - -if (mpNonOverflowingTxt->mpHeadParas != NULL) { -pOutliner->SetText(*mpNonOverflowingTxt->mpHeadParas); -pOutliner->AddText(*pPObj); - } else if (mpNonOverflowingTxt->mPreOverflowingTxt != "") { // only preoverflowing txt -//OutlinerParaObject *pEmptyPObj = pOutliner->GetEmptyParaObject(); -//pOutliner->SetText(*pEmptyPObj); -pOutliner->SetText(*pPObj); -} else { // no text // This case is redundant but it doesn't hurt for now -pOutliner->Clear(); -} -} - - return pOutliner->CreateParaObject(); +return mpNonOverflowingTxt->ToParaObject(pOutliner); } diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 58ff247..8f67004 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -74,13 +74,14 @@ class EDITENG_DLLPUBLIC NonOverflowingText { if (pHeadParas == NULL) // Redundant line for debugging DBG_ASSERT( pHeadParas != NULL, "pHeadParas is null?! All text is overflowing then" ); } + +OutlinerParaObject *ToParaObject(Outliner *) const; }; -// XXX: Do we also need a class for Underflow here? /* - * classes ?FlowChainedText: - * contains and handles the state of a text broken _after_ a flow event. + * classes OFlowChainedText and UFlowChainedText: + * contain and handle the state of a broken up text _after_ a flow event. * */ ___
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng svx/source
editeng/source/outliner/overflowingtxt.cxx |9 - include/editeng/overflowingtxt.hxx |7 ++- svx/source/svdraw/textchainflow.cxx|4 ++-- 3 files changed, 8 insertions(+), 12 deletions(-) New commits: commit e7d28b8d3b6e77ccfb4228cf814c200de55856a7 Author: matteocam Date: Tue Jun 30 11:44:38 2015 -0400 For OF: Passing text to be merged last minute; otherwise might be old Change-Id: I12553f4aa5145c8ebad77977506700cc6c530e1f diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 85aa0b2..9e1ee3d 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -40,19 +40,18 @@ OUString OverflowingText::GetHeadingLines() const } -OFlowChainedText::OFlowChainedText(Outliner *pOutl, OutlinerParaObject* pTextToBeMerged) - : mpTextToBeMerged(pTextToBeMerged) +OFlowChainedText::OFlowChainedText(Outliner *pOutl) { mpOverflowingTxt = pOutl->GetOverflowingText(); mpNonOverflowingTxt = pOutl->GetNonOverflowingText(); } -OutlinerParaObject *OFlowChainedText::CreateOverflowingParaObject(Outliner *pOutliner) +OutlinerParaObject *OFlowChainedText::CreateOverflowingParaObject(Outliner *pOutliner, OutlinerParaObject *pTextToBeMerged) { -if (mpOverflowingTxt == NULL) +if (mpOverflowingTxt == NULL || pTextToBeMerged == NULL) return NULL; -pOutliner->SetText(*mpTextToBeMerged); +pOutliner->SetText(*pTextToBeMerged); // Get text of first paragraph of destination box Paragraph *pOldPara0 = pOutliner->GetParagraph(0); diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 3920af3..a2602ad 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -85,13 +85,11 @@ class EDITENG_DLLPUBLIC NonOverflowingText { */ class EDITENG_DLLPUBLIC OFlowChainedText { public: -OFlowChainedText(Outliner *, OutlinerParaObject *); +OFlowChainedText(Outliner *); -OutlinerParaObject *CreateOverflowingParaObject(Outliner *); +OutlinerParaObject *CreateOverflowingParaObject(Outliner *, OutlinerParaObject *); OutlinerParaObject *CreateNonOverflowingParaObject(Outliner *); -OutlinerParaObject *GetTextToBeMerged() const { return mpTextToBeMerged; } - protected: void impSetOutlinerToEmptyTxt(Outliner *); @@ -101,7 +99,6 @@ class EDITENG_DLLPUBLIC OFlowChainedText { NonOverflowingText *mpNonOverflowingTxt; OverflowingText *mpOverflowingTxt; -OutlinerParaObject *mpTextToBeMerged; }; diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index 0e4be0b..b3dcd80 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -87,7 +87,7 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p bUnderflow = !bIsPageOverflow && mpNextLink && mpNextLink->HasText(); // Set (Non)OverflowingTxt here -mpOverflChText = bOverflow ? new OFlowChainedText(pFlowOutl, mpNextLink->GetOutlinerParaObject()) : NULL; +mpOverflChText = bOverflow ? new OFlowChainedText(pFlowOutl) : NULL; //mpOverflowingTxt = bOverflow ? pFlowOutl->GetOverflowingText() : NULL; //mpNonOverflowingTxt = bOverflow ? pFlowOutl->GetNonOverflowingText() : NULL; @@ -197,7 +197,7 @@ SdrTextObj *TextChainFlow::GetNextLink() const OutlinerParaObject *TextChainFlow::impGetOverflowingParaObject(SdrOutliner *pOutliner) { -return mpOverflChText->CreateOverflowingParaObject(pOutliner); +return mpOverflChText->CreateOverflowingParaObject(pOutliner, mpNextLink->GetOutlinerParaObject()); } TextChain *TextChainFlow::GetTextChain() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng
editeng/source/outliner/overflowingtxt.cxx | 113 - include/editeng/overflowingtxt.hxx |5 + 2 files changed, 117 insertions(+), 1 deletion(-) New commits: commit 094a55ed52794a9a676ec2d8a5e8fe401fbac13a Author: matteocam Date: Tue Jun 30 10:58:21 2015 -0400 OFlowChainedText now creates OutlinerParaObject-s for chainging Change-Id: I1f3f37fa92472471f77362c029e9525523ea6d09 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index ca0af38..85aa0b2 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -21,6 +21,7 @@ #include #include +#include OUString OverflowingText::GetEndingLines() const @@ -42,7 +43,117 @@ OUString OverflowingText::GetHeadingLines() const OFlowChainedText::OFlowChainedText(Outliner *pOutl, OutlinerParaObject* pTextToBeMerged) : mpTextToBeMerged(pTextToBeMerged) { -// Initialize stuff here +mpOverflowingTxt = pOutl->GetOverflowingText(); +mpNonOverflowingTxt = pOutl->GetNonOverflowingText(); +} + +OutlinerParaObject *OFlowChainedText::CreateOverflowingParaObject(Outliner *pOutliner) +{ +if (mpOverflowingTxt == NULL) +return NULL; + +pOutliner->SetText(*mpTextToBeMerged); + +// Get text of first paragraph of destination box +Paragraph *pOldPara0 = pOutliner->GetParagraph(0); +OUString aOldPara0Txt; +if (pOldPara0) +aOldPara0Txt = pOutliner->GetText(pOldPara0); + +// Get other paras of destination box (from second on) +OutlinerParaObject *pOldParasTail = NULL; +if (pOutliner->GetParagraphCount() > 1) +pOldParasTail = pOutliner->CreateParaObject(1); + +// Create ParaObject appending old first para in the dest. box +// to last part of overflowing text +Paragraph *pTmpPara0 = NULL; +OutlinerParaObject *pJoiningPara = NULL; + +if (pOldPara0) { +//pOutliner->Clear(); // you need a clear outliner here +impSetOutlinerToEmptyTxt(pOutliner); + +pTmpPara0 = pOutliner->GetParagraph(0); +pOutliner->SetText(mpOverflowingTxt->GetEndingLines() + aOldPara0Txt, pTmpPara0); +pJoiningPara = pOutliner->CreateParaObject(); +} + +// Create a Para Object out of mpMidParas +// (in order to use the SfxItemPool of the current outliner +// instead of the ones currently in mpMidParas) + +// start actual composition +//pOutliner->Clear(); +impSetOutlinerToEmptyTxt(pOutliner); + +// Set headText at the beginning of box +OUString aHeadTxt = mpOverflowingTxt->GetHeadingLines(); +// If we haven't used heading text yet +if (mpOverflowingTxt->HasOtherParas()) { +Paragraph *pNewPara0 = pOutliner->GetParagraph(0); +pOutliner->SetText(aHeadTxt, pNewPara0); +} + +// Set all the intermediate Paras +if (mpOverflowingTxt->mpMidParas) +pOutliner->AddText(*mpOverflowingTxt->mpMidParas); + +// Append old first para in the destination box to +// last part of overflowing text +if (pJoiningPara && mpOverflowingTxt->HasOtherParas()) +pOutliner->AddText(*pJoiningPara); +// this second case is if there is to avoid getting an empty line before pJoiningPara +else if (pJoiningPara && !mpOverflowingTxt->HasOtherParas()) +pOutliner->SetText(*pJoiningPara); + +// Append all other old paras +if (pOldParasTail) +pOutliner->AddText(*pOldParasTail); + +// Draw everything +OutlinerParaObject *pNewText = pOutliner->CreateParaObject(); +return pNewText; +} + +OutlinerParaObject *OFlowChainedText::CreateNonOverflowingParaObject(Outliner *pOutliner) +{ +if (mpNonOverflowingTxt == NULL) +return NULL; + +if (mpNonOverflowingTxt->mPreOverflowingTxt == "" && +mpNonOverflowingTxt->mpHeadParas != NULL) { +// Only (possibly empty) paragraphs before overflowing one +pOutliner->SetText(*mpNonOverflowingTxt->mpHeadParas); +} else { // We have to include the non-overflowing lines from the overfl. para + +// first make a ParaObject for the strings +impSetOutlinerToEmptyTxt(pOutliner); +Paragraph *pTmpPara0 = pOutliner->GetParagraph(0); +pOutliner->SetText(mpNonOverflowingTxt->mPreOverflowingTxt, pTmpPara0); +OutlinerParaObject *pPObj = pOutliner->CreateParaObject(); +//pOutliner->Clear(); +//pOutliner->SetStyleSheet( 0, pEdtOutl->GetStyleSheet(0)); + +if (mpNonOverflowingTxt->mpHeadParas != NULL) { +pOutliner->SetText(*mpNonOverflowingTxt->mpHeadParas); +pOutliner->AddText(*pPObj); + } else if (mpNonOverflowingTxt->mPreOverflowingTxt != "") { // only preoverflowing txt +//OutlinerParaObject *pEmptyPObj = pOutliner->GetEmptyParaObject(); +//pOutliner->SetText(*pEmptyPObj); +pOutliner->SetText(*pPObj); +} else { // no text //
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng
editeng/source/outliner/overflowingtxt.cxx |3 ++- include/editeng/overflowingtxt.hxx | 12 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) New commits: commit fc30b3010ebcb57a0b2142d15360a55712f6f787 Author: matteocam Date: Tue Jun 30 10:21:56 2015 -0400 Changed to specialized OFlowChainedText class Change-Id: Iad2b98f5793bc4b8a49012811718a65ab2fbade0 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 8ecd05c..ca0af38 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -39,7 +39,8 @@ OUString OverflowingText::GetHeadingLines() const } -ChainedText::ChainedText(Outliner *pOutl) +OFlowChainedText::OFlowChainedText(Outliner *pOutl, OutlinerParaObject* pTextToBeMerged) + : mpTextToBeMerged(pTextToBeMerged) { // Initialize stuff here } diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 5399f4b..0c42d53 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -83,13 +83,21 @@ class EDITENG_DLLPUBLIC NonOverflowingText { * contains and handles the state of a text broken _after_ a flow event. * */ -class EDITENG_DLLPUBLIC ChainedText { +class EDITENG_DLLPUBLIC OFlowChainedText { public: -ChainedText(Outliner *); +OFlowChainedText(Outliner *, OutlinerParaObject *); + +OutlinerParaObject *CreateOverflowingParaObject(Outliner *); +OutlinerParaObject *CreateNonOverflowingParaObject(Outliner *); + +OutlinerParaObject *GetTextToBeMerged() const { return mpTextToBeMerged; } private: NonOverflowingText *mpNonOverflowingTxt; OverflowingText *mpOverflowingTxt; + +OutlinerParaObject *mpTextToBeMerged; + }; #endif ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng svx/source
editeng/source/outliner/overflowingtxt.cxx |6 ++ include/editeng/overflowingtxt.hxx | 21 + svx/source/svdraw/svdmodel.cxx |2 +- svx/source/svdraw/textchainflow.cxx| 18 +- 4 files changed, 45 insertions(+), 2 deletions(-) New commits: commit ecc3fcd988b222af17eb93bbf3fbc7ec55dec9d6 Author: matteocam Date: Tue Jun 30 10:04:11 2015 -0400 Added ChainedText as a further abstraction on top of (Non)OverflowingText Change-Id: I7607aacc856fd9af7ae2087e81a362f071163bd5 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 196d1f8..8ecd05c 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -39,4 +39,10 @@ OUString OverflowingText::GetHeadingLines() const } +ChainedText::ChainedText(Outliner *pOutl) +{ +// Initialize stuff here +} + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index e4f9a2d..5399f4b 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -27,6 +27,11 @@ class OUString; class OutlinerParaObject; +class EditTextObject; +class Outliner; + +typedef EditTextObject FormattedTextPortion; + class EDITENG_DLLPUBLIC OverflowingText @@ -71,6 +76,22 @@ class EDITENG_DLLPUBLIC NonOverflowingText { } }; +// XXX: Do we also need a class for Underflow here? + +/* + * class ChainedText: + * contains and handles the state of a text broken _after_ a flow event. + * +*/ +class EDITENG_DLLPUBLIC ChainedText { +public: +ChainedText(Outliner *); + +private: +NonOverflowingText *mpNonOverflowingTxt; +OverflowingText *mpOverflowingTxt; +}; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 19652f4..efe280d 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -220,7 +220,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe pChainingOutliner = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, this ); ImpSetOutlinerDefaults(pChainingOutliner, true); -// Make a TextChain +// Make a TextChain //XXX: There should not be only one - XXX: Prototype code pTextChain = new TextChain; /* End Text Chaining related code */ diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index 723c7f7..1261175 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -255,6 +255,10 @@ OutlinerParaObject *TextChainFlow::impGetOverflowingParaObject(SdrOutliner *pOut pJoiningPara = pOutliner->CreateParaObject(); } +// Create a Para Object out of mpMidParas +// (in order to use the SfxItemPool of the current outliner +// instead of the ones currently in mpMidParas) + // start actual composition //pOutliner->Clear(); impSetOutlinerToEmptyTxt(pOutliner); @@ -347,8 +351,20 @@ void EditingTextChainFlow::impSetFlowOutlinerParams(SdrOutliner *pFlowOutl, SdrO pFlowOutl->SetMinAutoPaperSize(pParamOutl->GetMinAutoPaperSize()); pFlowOutl->SetPaperSize(pParamOutl->GetPaperSize()); -// Set right text attributes +// Set right text attributes // XXX: Not enough: it does not handle complex attributes pFlowOutl->SetEditTextObjectPool(pParamOutl->GetEditTextObjectPool()); } +/* + * + * Some notes on how to set style sheets: + * - save whole edittexts instead of strings only for (Non)OverflowingText; this can be done by the EditEngine::CreateTextObject method and using a selection - probably from ImpEditEngine) + * - first, refactor the impGet*ParaObject stuff moving it in some (static?) class in overflowingtxt.hxx. Probably each of these methods should be split in smaller routines. + * - for the refactoring of the previous point we may also add an option for whether we are joining paragraphs or not + * - When making new OutlinerParaObjs and joining paragraphs we need to first add the string (as we already do) and then, with the appropriate selection, use Outliner::QuickSetAttribs(SfxItemSet(txtObj->GetPool()), aSelectionOfTheNewText) + * - having all this in a whole class that contains Overflowing and NonOverflowingText would not be bad. This same class could be used to handle a cursor later on. + * + * + * + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/impedit3.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 4bf0c3ebb5faa2d28c2e30f80c5e717da725a9a5 Author: matteocam Date: Mon Jun 22 15:29:14 2015 -0400 Removed IsModified() check for chaining handler Change-Id: Ib1b7d000afe762e3be38ac2bc79d2bdf928e1d66 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 892a297..4d6e66e 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -493,8 +493,8 @@ void ImpEditEngine::FormatDoc() CallStatusHdl();// If Modified... //FIXME(matteocam) -if (IsModified()) -CallChainingEventHdl(); // For chaining + +CallChainingEventHdl(); // For chaining LeaveBlockNotifications(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source
editeng/source/outliner/overflowingtxt.cxx |2 +- svx/source/svdraw/svdotextdecomposition.cxx |8 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) New commits: commit 83e85d7477b962454d8dd39f208fa7c276fe25fb Author: matteocam Date: Fri Jun 19 00:09:29 2015 -0400 Changed way of adding ending lines for overwriting case (no insert) Change-Id: Ie13acc2e6eadb0d9b87ceaa44e21d1b9952d606e diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 99b2250..196d1f8 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -27,7 +27,7 @@ OUString OverflowingText::GetEndingLines() const { // If the only overflowing part is some lines in a paragraph, // the end of the overflowing text is its head. -if (mTailTxt == "" && mpMidParas == NULL) +if (!HasOtherParas()) return mHeadTxt; return mTailTxt; diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 7fb4dc6..0868bf7 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -805,16 +805,20 @@ OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutlin GetTextChain()->SetOverwriteOnOverflow(pNextTextObj, false); if (mpOverflowingText->HasOtherParas()) { -// Make first paragraph +// Make Para Object from the ending lines (to be appended later) impSetOutlinerToEmptyTxt(pOutliner); Paragraph *pFstPara = pOutliner->GetParagraph(0); +pOutliner->SetText(mpOverflowingText->GetEndingLines(), pFstPara); +OutlinerParaObject *pLastPara = pOutliner->CreateParaObject(); + +// Set heading lines as first paragraph pOutliner->SetText(mpOverflowingText->GetHeadingLines(), pFstPara); // Add middle paragraphs if (mpOverflowingText->mpMidParas) pOutliner->AddText(*mpOverflowingText->mpMidParas); -pOutliner->Insert(mpOverflowingText->GetEndingLines()); +pOutliner->AddText(*pLastPara); } else { impSetOutlinerToEmptyTxt(pOutliner); Paragraph *pFstPara = pOutliner->GetParagraph(0); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/impedit3.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit e88cc3616e730655ba34095d90e11177c1d69ed3 Author: matteocam Date: Thu Jun 18 22:57:40 2015 -0400 Check for changes in editing Change-Id: I04e1e642c877d15c8c751f8a69ac6b2da1489bf1 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 5d6ce0b..892a297 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -493,7 +493,8 @@ void ImpEditEngine::FormatDoc() CallStatusHdl();// If Modified... //FIXME(matteocam) -CallChainingEventHdl(); // For chaining +if (IsModified()) +CallChainingEventHdl(); // For chaining LeaveBlockNotifications(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/svx svx/source
editeng/source/editeng/impedit3.cxx |1 - include/svx/svdotext.hxx|4 ++-- svx/source/svdraw/svdotext.cxx | 11 --- 3 files changed, 10 insertions(+), 6 deletions(-) New commits: commit 8aeead9b031b0d9415ea2fe740f9c626401b0d1f Author: matteocam Date: Wed Jun 17 15:39:58 2015 -0400 Moved overflow check from ImpEditEng to SdrTextObj during editing mode Change-Id: I023d3960a3f6952bc9c21114bcd84d0be1a6ff42 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 13e6030..5d6ce0b 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -4081,7 +4081,6 @@ void ImpEditEngine::CallChainingEventHdl() // only if it's the right ImpEditEngine (with right info on changes in text) if ( aChainingHdlLink.IsSet() /* && aStatus.GetStatusWord() */) { -CheckPageOverflow(); aChainingHdlLink.Call( &mbNeedsChainingHandling ); } diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index bbc9207..32321f4 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -549,7 +549,7 @@ public: /** called from the SdrObjEditView during text edit when the status of the edit outliner changes */ virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus ); -virtual void onOverflowStatusEvent( bool bIsPageOverflow ); +virtual void onOverflowStatusEvent( ); @@ -621,7 +621,7 @@ public: OutlinerParaObject *impGetNonOverflowingParaObject(SdrOutliner *pOutliner) const; // Handler for Chained Text -DECL_LINK(ImpDecomposeChainedText,bool*); +DECL_LINK(ImpDecomposeChainedText,void*); // timing generators void impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const; diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index cc17892..e67f5e6 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1964,11 +1964,16 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus ) } } -void SdrTextObj::onOverflowStatusEvent( bool bIsPageOverflow ) +void SdrTextObj::onOverflowStatusEvent( ) { if (!IsChainable()) return; +if (!pEdtOutl) +return; + +bool bIsPageOverflow = pEdtOutl->IsPageOverflow(); + if ( GetNextLinkInChain() != NULL ) // is there anything to transfer text to? { // set whether there is need for chaining @@ -2090,9 +2095,9 @@ bool SdrTextObj::GetPreventChainable() const return pClone; } -IMPL_LINK(SdrTextObj,ImpDecomposeChainedText,bool*,bIsPageOverflow) +IMPL_LINK_NOARG(SdrTextObj,ImpDecomposeChainedText) { -onOverflowStatusEvent( *bIsPageOverflow ); +onOverflowStatusEvent(); return 0; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng svx/source
editeng/source/outliner/overflowingtxt.cxx |5 + include/editeng/overflowingtxt.hxx |1 + svx/source/svdraw/svdotextdecomposition.cxx |7 +-- svx/source/svdraw/textchain.cxx |3 ++- 4 files changed, 13 insertions(+), 3 deletions(-) New commits: commit 2565e304894e0b0e85a82cd858f0b78a72748b04 Author: matteocam Date: Tue Jun 16 16:58:21 2015 -0400 Uses GetHeadingLines() to check before introducing the same text twice Change-Id: Iddb38eb05a7848adb8890003a2af95ffc4b1778d diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index f591dac..99b2250 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -33,5 +33,10 @@ OUString OverflowingText::GetEndingLines() const return mTailTxt; } +OUString OverflowingText::GetHeadingLines() const +{ +return mHeadTxt; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 40eaa28..baec920 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -48,6 +48,7 @@ public: mTailTxt(tailTxt) { } +OUString GetHeadingLines() const; OUString GetEndingLines() const; }; diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 6d1a0c4..b5f70fc 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -832,8 +832,11 @@ OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutlin impSetOutlinerToEmptyTxt(pOutliner); // Set headText at the beginning of box -Paragraph *pNewPara0 = pOutliner->GetParagraph(0); -pOutliner->SetText(mpOverflowingText->mHeadTxt, pNewPara0); +OUString aHeadTxt = mpOverflowingText->GetHeadingLines(); +if (aHeadTxt != "") { +Paragraph *pNewPara0 = pOutliner->GetParagraph(0); +pOutliner->SetText(aHeadTxt, pNewPara0); +} // Set all the intermediate Paras if (mpOverflowingText->mpMidParas) diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx index 28daf86..a4495b0 100644 --- a/svx/source/svdraw/textchain.cxx +++ b/svx/source/svdraw/textchain.cxx @@ -35,6 +35,7 @@ SdrTextObj *TextChain::GetNextLink(SdrTextObj *) bool TextChain::GetLinksHaveMergeableFirstPara(SdrTextObj *pPrevLink, SdrTextObj *pNextLink) { - +// XXX +return false; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/overflowingtxt.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 5e4e1e32407b40d526e54e58c69256a7d740ced2 Author: matteocam Date: Tue Jun 16 16:39:41 2015 -0400 Fixed GetEndingLines() Change-Id: I41adadae9b5ff4d9f3221b48fd939202ef93f9bb diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index d5fa910..f591dac 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -25,8 +25,9 @@ OUString OverflowingText::GetEndingLines() const { -// Only some lines in the same para overflowing, thus the head gives the ending lines -if (mHeadTxt == "" && mpMidParas == NULL) +// If the only overflowing part is some lines in a paragraph, +// the end of the overflowing text is its head. +if (mTailTxt == "" && mpMidParas == NULL) return mHeadTxt; return mTailTxt; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng
editeng/source/outliner/overflowingtxt.cxx |2 -- include/editeng/overflowingtxt.hxx |6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) New commits: commit fe51929b1c4cc8e4b28c88d056addf560636176d Author: matteocam Date: Tue Jun 16 13:52:50 2015 -0400 Fixed namespace line Change-Id: Ic2421db661e4cba6a8c589355349ebca922beb84 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 2661c41..d5fa910 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -22,8 +22,6 @@ #include -using namespace ::rtl; - OUString OverflowingText::GetEndingLines() const { diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index a921b2c..ef1cfc8 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -20,9 +20,9 @@ #ifndef INCLUDED_EDITENG_OVERFLOWINGTXT_HXX #define INCLUDED_EDITENG_OVERFLOWINGTXT_HXX -namespace rtl { -class OUString; -} + +class OUString; + class OutlinerParaObject; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/overflowingtxt.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 19014e70ab1ea433594e32899eca15dff79724b0 Author: matteocam Date: Tue Jun 16 13:42:21 2015 -0400 GetEndingLines should return head if everything is empty Change-Id: I4921c7a337f1cfe0a5b48d49492ddde9117332d1 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 0f02900..2661c41 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -27,11 +27,11 @@ using namespace ::rtl; OUString OverflowingText::GetEndingLines() const { -// Only some lines in the same para overflowing +// Only some lines in the same para overflowing, thus the head gives the ending lines if (mHeadTxt == "" && mpMidParas == NULL) -return mTailTxt; +return mHeadTxt; -return mHeadTxt; +return mTailTxt; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source
editeng/source/editeng/impedit3.cxx |8 +++- svx/source/svdraw/svdotextdecomposition.cxx |4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) New commits: commit f43791f1a6e6f3d978eeb46479b3a26b51b53ec6 Author: matteocam Date: Mon Jun 15 15:47:45 2015 -0400 No overflow if only empty para (prevents infinite loop) Change-Id: Ic11b127239542bf3cd8fde725ff9d88db4a29928 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 91c6d58..13e6030 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -592,7 +592,13 @@ void ImpEditEngine::CheckPageOverflow() sal_uInt32 nTxtHeight = CalcTextHeight(NULL); -if (nTxtHeight > nBoxHeight) +sal_uInt32 nParaCount = GetParaPortions().Count(); +sal_uInt32 nFirstLineCount = GetLineCount(0); +bool bOnlyOneEmptyPara = (nParaCount == 1) && +(nFirstLineCount == 1) && +(GetLineLen(0,0) == 0); + +if (nTxtHeight > nBoxHeight && !bOnlyOneEmptyPara) { // which paragraph is the first to cause higher size of the box? ImplUpdateOverflowingParaNum( nBoxHeight); // XXX: currently only for horizontal text diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 87e0559..45edac2 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -765,10 +765,12 @@ OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOut if (pNonOverflowingTxt->mpHeadParas != NULL) { pOutliner->SetText(*pNonOverflowingTxt->mpHeadParas); pOutliner->AddText(*pPObj); - } else { // set empty paraObj + } else if (pNonOverflowingTxt->mPreOverflowingTxt != "") { // only preoverflowing txt //OutlinerParaObject *pEmptyPObj = pOutliner->GetEmptyParaObject(); //pOutliner->SetText(*pEmptyPObj); pOutliner->SetText(*pPObj); +} else { // no text // This case is redundant but it doesn't hurt for now +pOutliner->Clear(); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng svx/source
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 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 voidDepthChangedHdl(); voidSetDepthChangedHdl(const Link& rLink){aDepthChangedHdl=rLink;} LinkGetDepthChangedHdl() 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
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng svx/source
editeng/source/editeng/editeng.cxx |5 + editeng/source/editeng/impedit.hxx |2 +- editeng/source/editeng/impedit3.cxx | 16 ++-- editeng/source/outliner/outliner.cxx|5 + include/editeng/editeng.hxx |1 + include/editeng/outliner.hxx|1 + svx/source/svdraw/svdotextdecomposition.cxx | 26 -- 7 files changed, 23 insertions(+), 33 deletions(-) New commits: commit c6391cf90e9885d4bf92d44733047f40c8ad5e18 Author: matteocam Date: Wed Jun 10 16:09:59 2015 -0400 Checking overflowing and cutting text in impChainedTextDecomposition Change-Id: I0d28e46770269e4703cec193d510036b8a036286 diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 6aaf967..82881af 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -2794,6 +2794,11 @@ void EditEngine::ClearOverflowingParaNum() { pImpEditEngine->ClearOverflowingParaNum(); } +bool EditEngine::IsPageOverflow() { +pImpEditEngine->CheckPageOverflow(); +return pImpEditEngine->IsPageOverflow(); +} + EFieldInfo::EFieldInfo() { pFieldItem = NULL; diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 578371d..9b8d675 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -737,7 +737,7 @@ public: const Size& GetMaxAutoPaperSize() const { return aMaxAutoPaperSize; } voidSetMaxAutoPaperSize( const Size& rSz ) { aMaxAutoPaperSize = rSz; } -bool IsPageOverflow( const Size aCurPaperSize, const Size aPrevPaperSize ) const; +bool IsPageOverflow( ) const; voidFormatDoc(); voidFormatFullDoc(); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 6e06ac2..91c6d58 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -353,21 +353,9 @@ void ImpEditEngine::FormatFullDoc() FormatDoc(); } -bool ImpEditEngine::IsPageOverflow( const Size aCurPaperSize, const Size aPrevPaperSize ) const +bool ImpEditEngine::IsPageOverflow( ) const { -const bool bTextGrowX=(aStatus.GetControlWord() & EE_STAT_TEXTWIDTHCHANGED) !=0; -const bool bTextGrowY=(aStatus.GetControlWord() & EE_STAT_TEXTHEIGHTCHANGED) !=0; - -const bool bPageExpansionX = ( aPrevPaperSize.Width() != 0 ) && // XXX -( aCurPaperSize.Width() > aPrevPaperSize.Width() ); -const bool bPageExpansionY = ( aPrevPaperSize.Height() != 0 ) && // XXX -( aCurPaperSize.Height() > aPrevPaperSize.Height() ); - -// Has text size changed (in the right vertical direction) AND -// is this change an expansion? -return ( bTextGrowY && !IsVertical() && bPageExpansionY ) || - ( bTextGrowX && IsVertical() && bPageExpansionX ); - +return mbNeedsChainingHandling; } void ImpEditEngine::FormatDoc() diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 9e3e8f6..a4c285b 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2089,6 +2089,11 @@ bool Outliner::HasParaFlag( const Paragraph* pPara, sal_uInt16 nFlag ) const return pPara && pPara->HasFlag( nFlag ); } +bool Outliner::IsPageOverflow() +{ +return pEditEngine->IsPageOverflow(); +} + NonOverflowingText *Outliner::GetNonOverflowingText() const { /* XXX: diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index 1f9fafb..ede68be 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -604,6 +604,7 @@ public: sal_Int32 GetOverflowingParaNum() const; sal_Int32 GetOverflowingLineNum() const; void ClearOverflowingParaNum(); +bool IsPageOverflow(); }; #endif // INCLUDED_EDITENG_EDITENG_HXX diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index 0105caf3..76f0157 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -763,6 +763,7 @@ public: NonOverflowingText *GetNonOverflowingText() const; OverflowingText *GetOverflowingText() const; void ClearOverflowingParaNum(); +bool IsPageOverflow(); virtual voidDepthChangedHdl(); voidSetDepthChangedHdl(const Link& rLink){aDepthChangedHdl=rLink;} diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index dfaa1d8..3e9e262 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -1605,22 +1605,6 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( // Text const OutlinerParaObject* pOutlinerParaObject = rSdrChainedTextPrimitive.getSdrText()->GetOutlinerParaObject(); - -// FIXME -
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/svx svx/source
editeng/source/editeng/impedit.hxx |7 +++--- editeng/source/editeng/impedit3.cxx | 31 +--- include/svx/svdotext.hxx|2 - svx/source/svdraw/svdotext.cxx |4 +-- svx/source/svdraw/svdotextdecomposition.cxx | 14 +--- 5 files changed, 32 insertions(+), 26 deletions(-) New commits: commit 2e80a08b2b600069452c0109e598736de5138639 Author: matteocam Date: Mon Jun 8 17:00:11 2015 -0400 Fixed chaining handlers in ImpEditEng. Checked for pEdtOutl Change-Id: I193d623a109ee751af30971c5b51e4715c59d147 diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 4bc4eb5..578371d 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -467,6 +467,7 @@ private: // For Chaining sal_Int32 mnOverflowingPara = -1; sal_Int32 mnOverflowingLine = -1; +bool mbNeedsChainingHandling = false; IdleFormattter aIdleFormatter; @@ -476,7 +477,7 @@ private: // this should not happen immediately (critical section): Timer aStatusTimer; LinkaStatusHdlLink; -LinkaStatusHdlLinkChaining; +LinkaChainingHdlLink; LinkaNotifyHdl; LinkaImportHdl; LinkaBeginMovingParagraphsHdl; @@ -848,7 +849,7 @@ public: voidSetStatusEventHdl( const Link& rLink ) { aStatusHdlLink = rLink; } LinkGetStatusEventHdl() const { return aStatusHdlLink; } -voidSetChainingEventHdl( const Link& rLink ) { aStatusHdlLinkChaining = rLink; } +voidSetChainingEventHdl( const Link& rLink ) { aChainingHdlLink = rLink; } voidSetNotifyHdl( const Link& rLink ) { aNotifyHdl = rLink; } LinkGetNotifyHdl() const{ return aNotifyHdl; } @@ -886,7 +887,7 @@ public: InternalEditStatus& GetStatus() { return aStatus; } voidCallStatusHdl(); -voidCallStatusHdlChaining(); +voidCallChainingEventHdl(); voidDelayedCallStatusHdl() { aStatusTimer.Start(); } voidCallNotify( EENotify& rNotify ); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 54554af..6e06ac2 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -505,26 +505,11 @@ void ImpEditEngine::FormatDoc() CallStatusHdl();// If Modified... //FIXME(matteocam) -CallStatusHdlChaining(); // XXX: hard coded for chaining +CallChainingEventHdl(); // For chaining LeaveBlockNotifications(); } -void ImpEditEngine::CallStatusHdlChaining() -{ -// only if it's the right ImpEditEngine (with right info on changes in text) -if ( aStatusHdlLinkChaining.IsSet() /* && aStatus.GetStatusWord() */) -{ -CheckPageOverflow(); -// The Status has to be reset before the Call, -// since other Flags might be set in the handler... -EditStatus aTmpStatus( aStatus ); -aStatus.Clear(); -aStatusHdlLinkChaining.Call( &aTmpStatus ); -aStatusTimer.Stop();// If called by hand ... -} -} - bool ImpEditEngine::ImpCheckRefMapMode() { bool bChange = false; @@ -624,10 +609,12 @@ void ImpEditEngine::CheckPageOverflow() // which paragraph is the first to cause higher size of the box? ImplUpdateOverflowingParaNum( nBoxHeight); // XXX: currently only for horizontal text aStatus.SetPageOverflow(true); +mbNeedsChainingHandling = true; } else { // No overflow if withing box boundaries aStatus.SetPageOverflow(false); +mbNeedsChainingHandling = false; } } @@ -4095,6 +4082,18 @@ void ImpEditEngine::CallStatusHdl() } } +void ImpEditEngine::CallChainingEventHdl() +{ +// only if it's the right ImpEditEngine (with right info on changes in text) +if ( aChainingHdlLink.IsSet() /* && aStatus.GetStatusWord() */) +{ +CheckPageOverflow(); +aChainingHdlLink.Call( &mbNeedsChainingHandling ); + +} +} + + ContentNode* ImpEditEngine::GetPrevVisNode( ContentNode* pCurNode ) { const ParaPortion* pPortion = FindParaPortion( pCurNode ); diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index 1da98d9..7583736 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -612,7 +612,7 @@ public: void impLeaveOnlyNonOverflowingText() const; // Handler for Chained Text -DECL_LINK(ImpDecomposeChainedText,bool); +DECL_LINK(ImpDecomposeChainedText,bool*); // timing generators void impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const; diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng include/svx svx/source
editeng/source/editeng/editeng.cxx|4 - editeng/source/editeng/impedit.hxx|3 - editeng/source/outliner/outlin2.cxx | 17 --- include/editeng/editeng.hxx |5 +- include/editeng/editstat.hxx |3 - include/editeng/outliner.hxx |5 +- include/svx/svdotext.hxx |4 + svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx |2 svx/source/svdraw/svdedxv.cxx |2 svx/source/svdraw/svdotext.cxx| 53 -- svx/source/svdraw/svdotextdecomposition.cxx |4 - svx/source/svdraw/svdotxed.cxx|8 +++ svx/source/svdraw/svdoutl.cxx |3 + 13 files changed, 74 insertions(+), 39 deletions(-) New commits: commit 8814f293560bda0859a98c86bc0098064af154f5 Author: matteocam Date: Mon Jun 8 15:24:26 2015 -0400 Changed handlers from onEditOutlinerStatusEvent to BegTextEdit+SetTextObj Change-Id: I3234f33bca4b9e74dc7942b0106be6e943925ff5 diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index a86e088..6aaf967 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -1528,9 +1528,9 @@ void EditEngine::SetStatusEventHdl( const Link& rLink ) pImpEditEngine->SetStatusEventHdl( rLink ); } -void EditEngine::SetStatusEventHdl1( const Link& rLink ) +void EditEngine::SetChainingEventHdl( const Link& rLink ) { -pImpEditEngine->SetStatusEventHdlChaining( rLink ); +pImpEditEngine->SetChainingEventHdl( rLink ); } Link EditEngine::GetStatusEventHdl() const diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 6eabd9c..4bc4eb5 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -847,7 +847,8 @@ public: voidSetStatusEventHdl( const Link& rLink ) { aStatusHdlLink = rLink; } LinkGetStatusEventHdl() const { return aStatusHdlLink; } -voidSetStatusEventHdlChaining( const Link& rLink ) { aStatusHdlLinkChaining = rLink; } + +voidSetChainingEventHdl( const Link& rLink ) { aStatusHdlLinkChaining = rLink; } voidSetNotifyHdl( const Link& rLink ) { aNotifyHdl = rLink; } LinkGetNotifyHdl() const{ return aNotifyHdl; } diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx index ca69fcd..1bf8a7d 100644 --- a/editeng/source/outliner/outlin2.cxx +++ b/editeng/source/outliner/outlin2.cxx @@ -118,6 +118,18 @@ Link Outliner::GetModifyHdl() const return pEditEngine->GetModifyHdl(); } +void Outliner::SetChainingEventHdl( const Link& rLink ) +{ +pEditEngine->SetChainingEventHdl( rLink ); +} + +/* +Link Outliner::GetChainingEventHdl() const +{ +return pEditEngine->GetChainingEventHdl(); +} +*/ + void Outliner::SetNotifyHdl( const Link& rLink ) { pEditEngine->aOutlinerNotifyHdl = rLink; @@ -139,11 +151,6 @@ Link Outliner::GetStatusEventHdl() const return pEditEngine->GetStatusEventHdl(); } -void Outliner::SetStatusEventHdl1( const Link& rLink ) -{ -pEditEngine->SetStatusEventHdl1( rLink ); -} - void Outliner::SetDefTab( sal_uInt16 nTab ) { pEditEngine->SetDefTab( nTab ); diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index 08c6522..1f9fafb 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -359,9 +359,12 @@ public: sal_uLong Write( SvStream& rOutput, EETextFormat ); voidSetStatusEventHdl( const Link& rLink ); -voidSetStatusEventHdl1( const Link& rLink ); // for chaining LinkGetStatusEventHdl() const; +voidSetChainingEventHdl( const Link& rLink ); +//LinkGetChainingEventHdl( const Link& rLink ); + + voidSetNotifyHdl( const Link& rLink ); LinkGetNotifyHdl() const; diff --git a/include/editeng/editstat.hxx b/include/editeng/editstat.hxx index 36a816d..0c89b94 100644 --- a/include/editeng/editstat.hxx +++ b/include/editeng/editstat.hxx @@ -71,7 +71,6 @@ #define EE_STAT_TEXTWIDTHCHANGED0x0020 #define EE_STAT_TEXTHEIGHTCHANGED 0x0040 #define EE_STAT_WRONGWORDCHANGED0x0080 -#define EE_STAT_CHAININGSET 0x0100 // #define EE_STAT_MODIFIED 0x0100 /* @@ -114,7 +113,7 @@ public: sal_Int32& GetPrevParagraph() { return nPrevPara; } boolIsPageOverflow() const { return bIsPageOverflow; } -voidSetPageOverflow(bool isOverflow) { GetStatusWord() |= EE_STAT_CHAININGSET; bIsPageOverflow = isOverflow; } +voidSetPageOverflow(bool isOverflow) { bIsPageOverflow = isOverflow; } }; #define SPELLCMD_IGNOREWORD 0x0001 diff --g
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng include/svx svx/source
editeng/source/outliner/outliner.cxx| 38 +++- include/editeng/outliner.hxx|3 +- include/editeng/overflowingtxt.hxx | 21 ++- include/svx/svdotext.hxx|3 -- svx/source/svdraw/svdotext.cxx |5 +++ svx/source/svdraw/svdotextdecomposition.cxx | 30 +++--- svx/source/svdraw/svdotxed.cxx | 12 +++- 7 files changed, 96 insertions(+), 16 deletions(-) New commits: commit 598dc8b516d313da6a0b1d13d48139b7b041ae8f Author: matteocam Date: Tue Jun 2 19:34:22 2015 -0400 Added NonOverflowingText and logic to leave it in editing text Change-Id: I2cf4ad519917c80c51f9f693f9e27d5e3e655ffc diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index d289e78..9e3e8f6 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2089,7 +2089,7 @@ bool Outliner::HasParaFlag( const Paragraph* pPara, sal_uInt16 nFlag ) const return pPara && pPara->HasFlag( nFlag ); } -OutlinerParaObject *Outliner::GetNonOverflowingParaObject() const +NonOverflowingText *Outliner::GetNonOverflowingText() const { /* XXX: * nCount should be the number of paragraphs of the non overflowing text @@ -2101,7 +2101,8 @@ OutlinerParaObject *Outliner::GetNonOverflowingParaObject() const // last non-overflowing paragraph is before the first overflowing one sal_Int32 nCount = pEditEngine->GetOverflowingParaNum(); -//sal_Int32 nCount = 1; +sal_Int32 nOverflowLine = pEditEngine->GetOverflowingLineNum(); +OUString aPreOverflowingTxt(""); // Defensive check: oveflowing para index beyond actual # of paragraphs? if ( nCount > GetParagraphCount()-1) { @@ -2112,19 +2113,44 @@ OutlinerParaObject *Outliner::GetNonOverflowingParaObject() const return NULL; } -if ( nCount == 0 ) // Only overflowing text, i.e. 1st paragraph overflowing +// 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 pPObj; +return new NonOverflowingText(pPObj, ""); -} else if (nCount < 0) // No overflowing Text +} else if (nCount < 0) { // No overflowing Text: all para-s included nCount = GetParagraphCount(); +// aPreOverflowingText == "" +} else { // Get the lines that of the overflowing para fit in the box -return CreateParaObject(0, nCount); +// XXX: Is there a proper method to join lines in a single string? +sal_Int32 nOverflowingPara = nCount; +OUString aWholeTxtHeadPara = GetText(GetParagraph(nOverflowingPara)); +sal_uInt32 nLen = 0; + +for ( sal_Int32 nLine = 0; + nLine < pEditEngine->GetOverflowingLineNum(); + nLine++) +{ +nLen += GetLineLen(nOverflowingPara, nLine); +} + +// XXX: Any separator to be included? +aPreOverflowingTxt = aWholeTxtHeadPara.copy(0, nLen); +} + +OutlinerParaObject *pHeadParas; +if (nCount == 0) // No text to save expect for the one in the overflowing para (i.e. aPreOverflowingTxt) +pHeadParas = NULL; +else +pHeadParas = CreateParaObject(0, nCount); + +return new NonOverflowingText(pHeadParas, aPreOverflowingTxt); } OverflowingText *Outliner::GetOverflowingText() const diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index c493a7c..7093835 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -45,6 +45,7 @@ class EditUndo; class ParagraphList; class OutlinerParaObject; class OverflowingText; +class NonOverflowingText; class SvStream; class SvxBulletItem; class SvxFont; @@ -759,7 +760,7 @@ public: voidSetParaRemovingHdl(const Link& rLink){aParaRemovingHdl=rLink;} LinkGetParaRemovingHdl() const { return aParaRemovingHdl; } -OutlinerParaObject *GetNonOverflowingParaObject() const; +NonOverflowingText *GetNonOverflowingText() const; OverflowingText *GetOverflowingText() const; void ClearOverflowingParaNum(); diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 287d237..98aa612 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -34,14 +34,31 @@ class OverflowingText { // Constructor OverflowingText( const OUString &headTxt, -const OutlinerParaObject *pMidParas = NULL, -const OUString &tailTxt = "") +const OutlinerParaObject *pMidParas, +const OUString &tailTxt) : mHeadTxt(he
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/outliner.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 30371b6f7fd10a0d349e74205e26bdf95daf9b98 Author: matteocam Date: Mon Jun 1 19:43:11 2015 -0400 Fixed crashes Change-Id: I1e15664bf26a427b54bcebdbd1ceaee778fb04c6 diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index a6b3a83..d289e78 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2149,7 +2149,7 @@ OverflowingText *Outliner::GetOverflowingText() const sal_uInt32 nHeadPara = pEditEngine->GetOverflowingParaNum(); sal_uInt32 nParaCount = GetParagraphCount(); sal_uInt32 nTailPara = nParaCount-1; -sal_uInt32 nMidParas = nTailPara-nHeadPara-1; +sal_Int32 nMidParas = nTailPara-nHeadPara-1; // Set the head text // XXX: Is there a proper method to join lines in a single string? ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng include/svx svx/source
editeng/source/editeng/editeng.cxx |5 + editeng/source/outliner/outliner.cxx| 78 +-- include/editeng/editeng.hxx |1 include/editeng/outliner.hxx|3 include/svx/svdotext.hxx|6 - svx/source/svdraw/svdotext.cxx |4 - svx/source/svdraw/svdotextdecomposition.cxx | 94 svx/source/svdraw/svdotxed.cxx |2 8 files changed, 71 insertions(+), 122 deletions(-) New commits: commit fed813654b69ca34e6890ff85799af844206af95 Author: matteocam Date: Mon Jun 1 19:20:05 2015 -0400 Making right overflowing line flow in dest box. Currently crashing Change-Id: Idfae9fa4f606b4f1314fd0eba0e509d3840aba95 diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 6193b98..a86e088 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -59,7 +59,6 @@ #include #include #include -#include #include #include @@ -2787,6 +2786,10 @@ sal_Int32 EditEngine::GetOverflowingParaNum() const { return pImpEditEngine->GetOverflowingParaNum(); } +sal_Int32 EditEngine::GetOverflowingLineNum() const { +return pImpEditEngine->GetOverflowingLineNum(); +} + void EditEngine::ClearOverflowingParaNum() { pImpEditEngine->ClearOverflowingParaNum(); } diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 909e821..a6b3a83 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2099,7 +2099,6 @@ OutlinerParaObject *Outliner::GetNonOverflowingParaObject() const if ( GetParagraphCount() < 1 ) return NULL; -sal_Int32 nStartPara = 0; // last non-overflowing paragraph is before the first overflowing one sal_Int32 nCount = pEditEngine->GetOverflowingParaNum(); //sal_Int32 nCount = 1; @@ -2125,48 +2124,59 @@ OutlinerParaObject *Outliner::GetNonOverflowingParaObject() const } else if (nCount < 0) // No overflowing Text nCount = GetParagraphCount(); -// code inspired from Outliner::CreateParaObject +return CreateParaObject(0, nCount); +} -// we need a paragraph data vector and the actual text -ParagraphDataVector aParagraphDataVector(nCount); -const sal_Int32 nLastPara(nStartPara + nCount - 1); +OverflowingText *Outliner::GetOverflowingText() const +{ +if ( pEditEngine->GetOverflowingParaNum() < 0) +return NULL; -for(sal_Int32 nPara(nStartPara); nPara <= nLastPara; nPara++) -{ -aParagraphDataVector[nPara-nStartPara] = *GetParagraph(nPara); + +// Defensive check: oveflowing para index beyond actual # of paragraphs? +if ( pEditEngine->GetOverflowingParaNum() > GetParagraphCount()-1) { +fprintf(stderr, +"[Overflowing] Ops, trying to retrieve para %d when max index is %d\n", +pEditEngine->GetOverflowingParaNum(), +GetParagraphCount()-1); +return NULL; } -EditTextObject* pText = pEditEngine->CreateTextObject( nStartPara, nCount ); -const bool bIsEditDoc(OUTLINERMODE_TEXTOBJECT == ImplGetOutlinerMode()); +OUString aHeadTxt, aTailTxt(""); +OutlinerParaObject *pMidParas = NULL; -OutlinerParaObject* pPObj = new OutlinerParaObject(*pText, aParagraphDataVector, bIsEditDoc); -pPObj->SetOutlinerMode(GetMode()); -delete pText; -return pPObj; -} -OutlinerParaObject *Outliner::GetOverflowingParaObject() const -{ -if ( pEditEngine->GetOverflowingParaNum() >= 0) { -// Defensive check: oveflowing para index beyond actual # of paragraphs? -if ( pEditEngine->GetOverflowingParaNum() > GetParagraphCount()-1) { -fprintf(stderr, -"[Overflowing] Ops, trying to retrieve para %d when max index is %d\n", -pEditEngine->GetOverflowingParaNum(), -GetParagraphCount()-1); -return NULL; +sal_uInt32 nHeadPara = pEditEngine->GetOverflowingParaNum(); +sal_uInt32 nParaCount = GetParagraphCount(); +sal_uInt32 nTailPara = nParaCount-1; +sal_uInt32 nMidParas = nTailPara-nHeadPara-1; + +// Set the head text +// XXX: Is there a proper method to join lines in a single string? +OUString aWholeTxtHeadPara = GetText(GetParagraph(nHeadPara)); +sal_uInt32 nLen = 0; +for ( sal_Int32 nLine = 0; + nLine < pEditEngine->GetOverflowingLineNum(); + nLine++) { +nLen += GetLineLen(nHeadPara, nLine); } -return CreateParaObject( pEditEngine->GetOverflowingParaNum() ); +// XXX: Any separator to be included? +aHeadTxt = aWholeTxtHeadPara.copy(nLen); + + +// If there is at least one more paragraph overflowing +if (nTailPara > nHeadPara) { +// Get text of last paragraph +aTailTxt = GetText(GetParagraph(nTailPara)); } -ret
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source
editeng/source/editeng/editeng.cxx |1 + editeng/source/outliner/outliner.cxx|1 + svx/source/svdraw/svdotextdecomposition.cxx | 18 +- 3 files changed, 3 insertions(+), 17 deletions(-) New commits: commit 80150428de1867ae4bafd61b32c79b8dcc587885 Author: matteocam Date: Mon Jun 1 16:58:05 2015 -0400 Created header for OverflowingText Change-Id: I98cd9c8ea91ce065efc242a9302ca59976f5bb20 diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 35e6515..6193b98 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -59,6 +59,7 @@ #include #include #include +#include #include #include diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 52a0f18..909e821 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index bf81c09..30f1fcc 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -49,6 +49,7 @@ #include #include #include +#include #include @@ -744,23 +745,6 @@ void SdrTextObj::impCopyTextInTextObj2(SdrTextObj *pNextTextObj) const rOutliner.SetStatusEventHdl1(LINK(this,SdrTextObj,ImpDecomposeChainedText)); -struct OverflowingText { -OUString mHeadTxt; -const OutlinerParaObject *mpMidParas; -OUString mTailTxt; -// NOTE: mpMidParas and mTailTxt might be empty - -// Constructor -OverflowingText( -const OUString &headTxt, -const OutlinerParaObject *pMidParas = NULL, -const OUString &tailTxt = "") -: mHeadTxt(headTxt), - mpMidParas(pMidParas), - mTailTxt(tailTxt) -{ } -}; - OverflowingText aOverflowingTxt = OverflowingText("headTxt (On its own)", NULL, "I'm Appended to #"); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source
editeng/source/editeng/impedit.hxx |6 ++-- editeng/source/editeng/impedit3.cxx | 40 svx/source/svdraw/svdotextdecomposition.cxx |2 - 3 files changed, 40 insertions(+), 8 deletions(-) New commits: commit 10c03833f92274e5cbb063ccec910a2b379341fa Author: matteocam Date: Mon Jun 1 16:35:43 2015 -0400 Can detect first line of overflowing Change-Id: I18f4f00a49be9b257ea8d3f5acb7e811905b1548 diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 559a1dd..6eabd9c 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -466,6 +466,7 @@ private: // For Chaining sal_Int32 mnOverflowingPara = -1; +sal_Int32 mnOverflowingLine = -1; IdleFormattter aIdleFormatter; @@ -691,6 +692,8 @@ private: const ParaPortionList& GetParaPortions() const { return aParaPortionList; } ParaPortionList&GetParaPortions() { return aParaPortionList; } +void ImplUpdateOverflowingParaNum( sal_uInt32 ); +void ImplUpdateOverflowingLineNum( sal_uInt32, sal_uInt32, sal_uInt32 ); protected: virtual voidNotify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE; @@ -1028,9 +1031,8 @@ public: boolIsFirstWordCapitalization() const { return bFirstWordCapitalization; } sal_Int32 GetOverflowingParaNum() const { return mnOverflowingPara; } -void SetOverflowingParaNum(sal_Int32 nPara) { mnOverflowingPara = nPara; } +sal_Int32 GetOverflowingLineNum() const { return mnOverflowingLine; } void ClearOverflowingParaNum() { mnOverflowingPara = -1; } -void UpdateOverflowingParaNum( sal_uInt32 ); }; inline EPaM ImpEditEngine::CreateEPaM( const EditPaM& rPaM ) diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 3f8895f..54554af 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -617,10 +617,12 @@ void ImpEditEngine::CheckPageOverflow() fprintf(stderr, "[OVERFLOW-CHECK] Current MaxAutoPaperSize is %d\n", nBoxHeight); fprintf(stderr, "[CONTROL_STATUS] AutoPageSize is %s", ( aStatus.GetControlWord() & EE_CNTRL_AUTOPAGESIZE ) ? "ON\n" : "OFF\n" ); -if (CalcTextHeight(NULL) > nBoxHeight) +sal_uInt32 nTxtHeight = CalcTextHeight(NULL); + +if (nTxtHeight > nBoxHeight) { // which paragraph is the first to cause higher size of the box? -UpdateOverflowingParaNum( nBoxHeight); // XXX: currently only for horizontal text +ImplUpdateOverflowingParaNum( nBoxHeight); // XXX: currently only for horizontal text aStatus.SetPageOverflow(true); } else { @@ -4632,7 +4634,7 @@ void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* } } -void ImpEditEngine::UpdateOverflowingParaNum(sal_uInt32 nPaperHeight) +void ImpEditEngine::ImplUpdateOverflowingParaNum(sal_uInt32 nPaperHeight) { sal_uInt32 nY = 0; sal_uInt32 nPH; @@ -4643,11 +4645,39 @@ void ImpEditEngine::UpdateOverflowingParaNum(sal_uInt32 nPaperHeight) nY += nPH; if ( nY > nPaperHeight /*nCurTextHeight*/ ) // found first paragraph overflowing { -SetOverflowingParaNum( nPara ); -fprintf(stderr, "[CHAINING] Setting first overflowing para: %d\n", nPara); +mnOverflowingPara = nPara; +fprintf(stderr, "[CHAINING] Setting first overflowing #Para#: %d\n", nPara); +ImplUpdateOverflowingLineNum( nPaperHeight, nPara, nY-nPH); return; } } } +void ImpEditEngine::ImplUpdateOverflowingLineNum(sal_uInt32 nPaperHeight, + sal_uInt32 nOverflowingPara, + sal_uInt32 nHeightBeforeOverflowingPara) +{ +sal_uInt32 nY = nHeightBeforeOverflowingPara; +sal_uInt32 nLH; + +ParaPortion *pPara = GetParaPortions()[nOverflowingPara]; + +// Like UpdateOverflowingParaNum but for each line in the first +// overflowing paragraph. +for ( sal_Int32 nLine = 0; nLine < pPara->GetLines().Count(); nLine++ ) { +EditLine *pLine = pPara->GetLines()[nLine]; +nLH = pLine->GetHeight(); +nY += nLH; +if ( nY > nPaperHeight ) // found first line overflowing +{ +mnOverflowingLine = nLine; +fprintf(stderr, "[CHAINING] Setting first overflowing -Line- to: %d\n", nLine); +return; +} +} + + + +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 6f29f26..bf81c09 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -762,7 +762,7 @@ void SdrTextObj::impCopyTextInTextObj2(SdrTextObj *pNextTextObj) const };
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/editdbg.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 7b9ed149ed4918b44cebfdf3591d5169e185a53a Author: matteocam Date: Sun May 24 00:15:44 2015 -0400 Fixed compilation error with SvxColorBackgroundItem in dbgutil Change-Id: Ie753e6054cca8bc0b3753a70723b943570d275ba diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx index 4e4f55b..8703a6a 100644 --- a/editeng/source/editeng/editdbg.cxx +++ b/editeng/source/editeng/editdbg.cxx @@ -180,7 +180,7 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem) case EE_CHAR_BKGCOLOR: { aDebStr.append("FillColor= "); -Color aColor( ((SvxColorBackgroundItem&)rItem).GetValue() ); +Color aColor( ((SvxBackgroundColorItem&)rItem).GetValue() ); aDebStr.append(static_cast(aColor.GetRed())); aDebStr.append(", "); aDebStr.append(static_cast(aColor.GetGreen())); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source
editeng/source/editeng/impedit3.cxx |2 + svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |4 +++ svx/source/svdraw/svdotext.cxx | 22 --- 3 files changed, 25 insertions(+), 3 deletions(-) New commits: commit 9b08fb53a582938267c2470be5fcd1d41e43b074 Author: matteocam Date: Sun Sep 21 20:22:51 2014 -0400 Added debugging output for referred SdrTextObj when making a new text prim. Change-Id: I808456d0fa051a7040c4247c51e4ed4925cff010 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index db962b5..3f8895f 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -614,6 +614,8 @@ void ImpEditEngine::CheckPageOverflow() // setting overflow status sal_uInt32 nBoxHeight = GetMaxAutoPaperSize().Height(); +fprintf(stderr, "[OVERFLOW-CHECK] Current MaxAutoPaperSize is %d\n", nBoxHeight); +fprintf(stderr, "[CONTROL_STATUS] AutoPageSize is %s", ( aStatus.GetControlWord() & EE_CNTRL_AUTOPAGESIZE ) ? "ON\n" : "OFF\n" ); if (CalcTextHeight(NULL) > nBoxHeight) { diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index a61e61e..612a862 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -291,6 +291,10 @@ namespace drawinglayer aAnchorTransform = basegfx::tools::createShearXRotateTranslateB2DHomMatrix(fShearX, fRotate, aTranslate) * aAnchorTransform; +// FIXME(matteocam) +SdrTextObj *pReferredTextObj = &rText.getSdrText().GetObject(); +fprintf(stderr, "[MkTextPrimitive] Referring to text object: %p\n", pReferredTextObj); + if(rText.isFitToSize()) { // streched text in range diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index e287961..178f0b9 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1953,13 +1953,29 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus ) ImpAutoFitText(*pEdtOutl); mbInDownScale = false; } -else if ( GetNextLinkInChain() != NULL ) +else if ( GetNextLinkInChain() != NULL ) // is this a chainable object? { -// set the need for chaining +// set whether there is need for chaining SetToBeChained( pEditStatus->IsPageOverflow() ); fprintf(stderr, "[CHAINING] Need for Chaining is %s\n", pEditStatus->IsPageOverflow() ? "TRUE" : "FALSE"); -//impDecomposeChainedTextPrimitive(); + +/* + * XXX: I can see problems with circular chains here: + *If there is such a circular chain we get back + *to the first box and so on... +*/ + +//if ( IsRecursiveChaining() ) { +// set non overflowing text + +/* + * XXX: what's with the Outliner? + * It may be that we are calling it in the wrong moment. + * But if we don't call it here, where? +*/ + +//} } } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source
editeng/source/editeng/impedit3.cxx |1 - svx/source/svdraw/svdotext.cxx |2 +- svx/source/svdraw/svdoutl.cxx |2 +- 3 files changed, 2 insertions(+), 3 deletions(-) New commits: commit 2b0286e8a4d07f1972de12e73615d1f8f16c8d91 Author: matteocam Date: Thu Sep 4 00:10:32 2014 +0200 De-embedded other height. Embedded height in ImpInitDrawOutliner Change-Id: I8943c2ca5da14a251b530b36a69d74448e4e0c5b diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index a4a323a..db962b5 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -614,7 +614,6 @@ void ImpEditEngine::CheckPageOverflow() // setting overflow status sal_uInt32 nBoxHeight = GetMaxAutoPaperSize().Height(); -fprintf(stderr, "[OVERFLOW-CHECK] Current MaxAutoPaperSize is %d\n", nBoxHeight); if (CalcTextHeight(NULL) > nBoxHeight) { diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index ebfa40d..e287961 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1237,7 +1237,7 @@ void SdrTextObj::ImpInitDrawOutliner( SdrOutliner& rOutl ) const nStat&=~(EE_CNTRL_STRETCHING|EE_CNTRL_AUTOPAGESIZE); rOutl.SetControlWord(nStat); Size aNullSize; -Size aMaxSize(10,10); +Size aMaxSize(10,2418); rOutl.SetMinAutoPaperSize(aNullSize); rOutl.SetMaxAutoPaperSize(aMaxSize); rOutl.SetPaperSize(aMaxSize); diff --git a/svx/source/svdraw/svdoutl.cxx b/svx/source/svdraw/svdoutl.cxx index a1b609b..3b14316 100644 --- a/svx/source/svdraw/svdoutl.cxx +++ b/svx/source/svdraw/svdoutl.cxx @@ -56,7 +56,7 @@ void SdrOutliner::SetTextObj( const SdrTextObj* pObj ) SetControlWord(nStat); Size aNullSize; -Size aMaxSize( 10,2418 ); // FIXME(matteocam) +Size aMaxSize( 10, 10 ); SetMinAutoPaperSize( aNullSize ); SetMaxAutoPaperSize( aMaxSize ); SetPaperSize( aMaxSize ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/impedit3.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit e88ceb25c11b3c303ca8aadf81588e574ce9c403 Author: matteocam Date: Wed Sep 3 23:52:58 2014 +0200 Added debugging output for overflow Change-Id: Ib6ec14d9d3e2dc5b563917904338e33cd86b4dc7 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index db962b5..a4a323a 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -614,6 +614,7 @@ void ImpEditEngine::CheckPageOverflow() // setting overflow status sal_uInt32 nBoxHeight = GetMaxAutoPaperSize().Height(); +fprintf(stderr, "[OVERFLOW-CHECK] Current MaxAutoPaperSize is %d\n", nBoxHeight); if (CalcTextHeight(NULL) > nBoxHeight) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng svx/source
editeng/source/editeng/editeng.cxx |6 ++ editeng/source/editeng/impedit.hxx |2 ++ editeng/source/editeng/impedit4.cxx |8 editeng/source/outliner/outliner.cxx | 13 ++--- include/editeng/editeng.hxx |2 ++ svx/source/svdraw/svdotxed.cxx |2 +- 6 files changed, 29 insertions(+), 4 deletions(-) New commits: commit 764d0fdb8ff6069b2486d5a52b8a01b300cb20e5 Author: matteocam Date: Wed Sep 3 22:47:10 2014 +0200 First para-s overflowing are chained correctly: no more null text obj-s Change-Id: If496de707743b9ac69cb7c440662ac7d4200b456 diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 9e6f25d..35e6515 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -1494,6 +1494,12 @@ EditTextObject* EditEngine::CreateTextObject( const ESelection& rESelection ) return pImpEditEngine->CreateTextObject( aSel ); } +EditTextObject* EditEngine::GetEmptyTextObject() const +{ +return pImpEditEngine->GetEmptyTextObject(); +} + + void EditEngine::SetText( const EditTextObject& rTextObject ) { pImpEditEngine->EnterBlockNotifications(); diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index e8ede1b..559a1dd 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -534,6 +534,8 @@ private: voidParaAttribsToCharAttribs( ContentNode* pNode ); voidGetCharAttribs( sal_Int32 nPara, std::vector& rLst ) const; +EditTextObject* GetEmptyTextObject(); + EditTextObject* CreateTextObject( EditSelection aSelection, SfxItemPool*, bool bAllowBigObjects = false, sal_Int32 nBigObjStart = 0 ); EditSelection InsertTextObject( const EditTextObject&, EditPaM aPaM ); EditSelection InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxDataObj, const OUString& rBaseURL, const EditPaM& rPaM, bool bUseSpecial ); diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 77827e4..ebfc4a9 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -991,6 +991,14 @@ sal_uInt32 ImpEditEngine::WriteHTML( SvStream&, EditSelection ) return 0; } +EditTextObject* ImpEditEngine::GetEmptyTextObject() +{ +EditSelection aEmptySel; +aEmptySel.Min() = aEditDoc.GetStartPaM(); +aEmptySel.Max() = aEditDoc.GetStartPaM(); + +return CreateTextObject( aEmptySel ); +} EditTextObject* ImpEditEngine::CreateTextObject() { diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 38f66f2..52a0f18 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2112,9 +2112,16 @@ OutlinerParaObject *Outliner::GetNonOverflowingParaObject() const return NULL; } -if ( nCount == 0 ) // Only overflowing text -return NULL; -else if (nCount < 0) // No overflowing Text +if ( nCount == 0 ) // Only overflowing text, i.e. 1st paragraph overflowing +{ +EditTextObject *pEmptyText = pEditEngine->GetEmptyTextObject(); +OutlinerParaObject* pPObj = new OutlinerParaObject( *pEmptyText ); +pPObj->SetOutlinerMode(GetMode()); + +delete pEmptyText; +return pPObj; + +} else if (nCount < 0) // No overflowing Text nCount = GetParagraphCount(); // code inspired from Outliner::CreateParaObject diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index 7bd1656..dda4e29 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -290,6 +290,8 @@ public: EditTextObject* CreateTextObject( const ESelection& rESelection ); voidSetText( const EditTextObject& rTextObject ); +EditTextObject* GetEmptyTextObject() const; + voidRemoveParagraph(sal_Int32 nPara); voidInsertParagraph(sal_Int32 nPara, const EditTextObject& rTxtObj); voidInsertParagraph(sal_Int32 nPara, const OUString& rText); diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index 5ca8a05..840fbe3 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -277,7 +277,7 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl) if ( IsToBeChained() && GetNextLinkInChain() != this) // XXX: defensive check { // set non overflow part of text to current box -pNewText = rOutl.GetNonOverflowingParaObject(); +pNewText = rOutl.GetNonOverflowingParaObject(); // empty text obj. if 1st para is overflowing // set overflowing text for SdrChainedTextPrimitive2D pNextText = rOutl.GetOverflowingParaObject(); mpOverflowingText = pNextText; ___ Lib
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source
editeng/source/editeng/impedit3.cxx |9 + svx/source/svdraw/svdotext.cxx |6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) New commits: commit eb8d180f4fabbf57e0babba0f3b0dca402c65172 Author: matteocam Date: Thu Aug 14 23:30:05 2014 +0200 Generalizing chaining to more than 2 objects Change-Id: If3dec97d383abbb42c3fa4310025ed3b353108e0 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index e299061..db962b5 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -612,12 +612,13 @@ void ImpEditEngine::CheckPageOverflow() /* fprintf( stderr, IsPageOverflow(aPaperSize, aPrevPaperSize) ? "YES Overflow!\n" : "NO Overflow!\n" ); */ // setting overflow status -sal_uInt32 nBoxHeight = 1783; // XXX: hard coded for testing -//if ( IsPageOverflow( aPaperSize, aPrevPaperSize ) ) { -if (CalcTextHeight(NULL) > nBoxHeight) // XXX: CalcTextHeight here?? + +sal_uInt32 nBoxHeight = GetMaxAutoPaperSize().Height(); + +if (CalcTextHeight(NULL) > nBoxHeight) { // which paragraph is the first to cause higher size of the box? -UpdateOverflowingParaNum( nBoxHeight /*aPrevPaperSize.Height()*/ ); // XXX: currently only for horizontal text +UpdateOverflowingParaNum( nBoxHeight); // XXX: currently only for horizontal text aStatus.SetPageOverflow(true); } else { diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index a93d7bc..d15d67c 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2017,9 +2017,9 @@ SdrTextObj* SdrTextObj::GetNextLinkInChain() const SdrTextObj *pNextTextObj = NULL; if ( pPage && pPage->GetObjCount() > 1) { -pNextTextObj = dynamic_cast< SdrTextObj * >( pPage->GetObj(1) ); -if ( pNextTextObj == NULL) -return NULL; +int nextIndex = (GetOrdNum()+1) % pPage->GetObjCount(); +pNextTextObj = dynamic_cast< SdrTextObj * >( pPage->GetObj( nextIndex ) ); + return pNextTextObj; } else { fprintf(stderr, "Make New Object please\n"); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source
editeng/source/editeng/impedit3.cxx |2 +- svx/source/svdraw/svdotext.cxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit 89f2fa2febecbb1a1ed2667b18eb3bc1b148c895 Author: matteocam Date: Thu Aug 14 15:45:19 2014 +0200 No clearing of status after handling chainging Change-Id: I421fcf3d015026c3e06a99c4a726bbc2f2111296 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index b0bf25e..b0db341 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -517,7 +517,7 @@ void ImpEditEngine::CallStatusHdlChaining() // The Status has to be reset before the Call, // since other Flags might be set in the handler... EditStatus aTmpStatus( aStatus ); -aStatus.Clear(); // No need for this with chaining. It does not affect it either way. +//aStatus.Clear(); // No need for this with chaining. It does not affect it either way. aStatusHdlLinkChaining.Call( &aTmpStatus ); aStatusTimer.Stop();// If called by hand ... } diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index be2d8fd..dd16447 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1936,7 +1936,7 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus ) const bool bGrowX=(nStat & EE_STAT_TEXTWIDTHCHANGED) !=0; const bool bGrowY=(nStat & EE_STAT_TEXTHEIGHTCHANGED) !=0; const bool bOverflow = (nStat & 0x0100) != 0; -if(bTextFrame && (bGrowX || bGrowY)) +if(bTextFrame && (bGrowX || bGrowY || !nStat)) { if ((bGrowX && IsAutoGrowWidth()) || (bGrowY && IsAutoGrowHeight())) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source
editeng/source/editeng/impedit3.cxx |2 +- svx/source/svdraw/svdotext.cxx |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) New commits: commit 651a5edee2991a4ed6fa7227fb7ddb8f7168d66b Author: matteocam Date: Thu Aug 14 15:20:36 2014 +0200 Removed status words'checks for overflow Change-Id: I10a5032be60a83dd6ca7b4429a967f9a9b80edcb diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 6393b29..b0bf25e 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -518,7 +518,7 @@ void ImpEditEngine::CallStatusHdlChaining() // since other Flags might be set in the handler... EditStatus aTmpStatus( aStatus ); aStatus.Clear(); // No need for this with chaining. It does not affect it either way. -//aStatusHdlLinkChaining.Call( &aTmpStatus ); +aStatusHdlLinkChaining.Call( &aTmpStatus ); aStatusTimer.Stop();// If called by hand ... } } diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 0e32745..be2d8fd 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1936,7 +1936,7 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus ) const bool bGrowX=(nStat & EE_STAT_TEXTWIDTHCHANGED) !=0; const bool bGrowY=(nStat & EE_STAT_TEXTHEIGHTCHANGED) !=0; const bool bOverflow = (nStat & 0x0100) != 0; -if(bTextFrame && (bGrowX || bGrowY || bOverflow)) +if(bTextFrame && (bGrowX || bGrowY)) { if ((bGrowX && IsAutoGrowWidth()) || (bGrowY && IsAutoGrowHeight())) { @@ -1953,7 +1953,7 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus ) ImpAutoFitText(*pEdtOutl); mbInDownScale = false; } -else if ( GetNextLinkInChain() != NULL && pEditStatus->IsPageOverflow() && !nStat ) // do it only if it is a call explicitly for chaining (status word already cleared) +else if ( GetNextLinkInChain() != NULL && !nStat ) // do it only if it is a call explicitly for chaining (status word already cleared) { // set the need for chaining SetToBeChained( pEditStatus->IsPageOverflow() ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source
editeng/source/editeng/impedit3.cxx |2 +- svx/source/svdraw/svdotext.cxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit 8aebd168df66261279b178444853b8ffcb845372 Author: matteocam Date: Thu Aug 14 15:12:39 2014 +0200 TextObj's chaining changed only if called for it in onEditOutlinerStatusEvent Change-Id: I8736b039f3a4be519e68e3e60f87e7c32a8b2153 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 8f95bce..6393b29 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -512,7 +512,7 @@ void ImpEditEngine::FormatDoc() void ImpEditEngine::CallStatusHdlChaining() { -if ( aStatusHdlLinkChaining.IsSet() && aStatus.GetStatusWord() ) +if ( aStatusHdlLinkChaining.IsSet() /* && aStatus.GetStatusWord() */) { // The Status has to be reset before the Call, // since other Flags might be set in the handler... diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index fe9dcd6..0e32745 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1953,7 +1953,7 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus ) ImpAutoFitText(*pEdtOutl); mbInDownScale = false; } -else if ( GetNextLinkInChain() != NULL) +else if ( GetNextLinkInChain() != NULL && pEditStatus->IsPageOverflow() && !nStat ) // do it only if it is a call explicitly for chaining (status word already cleared) { // set the need for chaining SetToBeChained( pEditStatus->IsPageOverflow() ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng svx/source
editeng/source/editeng/editeng.cxx |5 + editeng/source/editeng/impedit.hxx |3 +++ editeng/source/editeng/impedit3.cxx | 16 editeng/source/outliner/outlin2.cxx |5 + include/editeng/editeng.hxx |1 + include/editeng/outliner.hxx|1 + svx/source/svdraw/svdedxv.cxx |2 ++ 7 files changed, 33 insertions(+) New commits: commit 40fcecfce85b12b60518ef8258378a6f085023cb Author: matteocam Date: Thu Aug 14 14:59:30 2014 +0200 Hard coded call to onEditOutlinerStatusEvent for chaining Change-Id: I663263170a29a290cc37b89f540f9a8daa9c9f73 diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 2709740..9e6f25d 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -1522,6 +1522,11 @@ void EditEngine::SetStatusEventHdl( const Link& rLink ) pImpEditEngine->SetStatusEventHdl( rLink ); } +void EditEngine::SetStatusEventHdl1( const Link& rLink ) +{ +pImpEditEngine->SetStatusEventHdlChaining( rLink ); +} + Link EditEngine::GetStatusEventHdl() const { return pImpEditEngine->GetStatusEventHdl(); diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index d53e5fd..ac95eaa 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -475,6 +475,7 @@ private: // this should not happen immediately (critical section): Timer aStatusTimer; LinkaStatusHdlLink; +LinkaStatusHdlLinkChaining; LinkaNotifyHdl; LinkaImportHdl; LinkaBeginMovingParagraphsHdl; @@ -839,6 +840,7 @@ public: voidSetStatusEventHdl( const Link& rLink ) { aStatusHdlLink = rLink; } LinkGetStatusEventHdl() const { return aStatusHdlLink; } +voidSetStatusEventHdlChaining( const Link& rLink ) { aStatusHdlLinkChaining = rLink; } voidSetNotifyHdl( const Link& rLink ) { aNotifyHdl = rLink; } LinkGetNotifyHdl() const{ return aNotifyHdl; } @@ -876,6 +878,7 @@ public: InternalEditStatus& GetStatus() { return aStatus; } voidCallStatusHdl(); +voidCallStatusHdlChaining(); voidDelayedCallStatusHdl() { aStatusTimer.Start(); } voidCallNotify( EENotify& rNotify ); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 7ea5a51..8f95bce 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -504,9 +504,25 @@ void ImpEditEngine::FormatDoc() CallStatusHdl();// If Modified... +//FIXME(matteocam) +CallStatusHdlChaining(); // XXX: hard coded for chaining + LeaveBlockNotifications(); } +void ImpEditEngine::CallStatusHdlChaining() +{ +if ( aStatusHdlLinkChaining.IsSet() && aStatus.GetStatusWord() ) +{ +// The Status has to be reset before the Call, +// since other Flags might be set in the handler... +EditStatus aTmpStatus( aStatus ); +aStatus.Clear(); // No need for this with chaining. It does not affect it either way. +//aStatusHdlLinkChaining.Call( &aTmpStatus ); +aStatusTimer.Stop();// If called by hand ... +} +} + bool ImpEditEngine::ImpCheckRefMapMode() { bool bChange = false; diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx index 43ca90b..ca69fcd 100644 --- a/editeng/source/outliner/outlin2.cxx +++ b/editeng/source/outliner/outlin2.cxx @@ -139,6 +139,11 @@ Link Outliner::GetStatusEventHdl() const return pEditEngine->GetStatusEventHdl(); } +void Outliner::SetStatusEventHdl1( const Link& rLink ) +{ +pEditEngine->SetStatusEventHdl1( rLink ); +} + void Outliner::SetDefTab( sal_uInt16 nTab ) { pEditEngine->SetDefTab( nTab ); diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index 33dd8f0..7bd1656 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -357,6 +357,7 @@ public: sal_uLong Write( SvStream& rOutput, EETextFormat ); voidSetStatusEventHdl( const Link& rLink ); +voidSetStatusEventHdl1( const Link& rLink ); // for chaining LinkGetStatusEventHdl() const; voidSetNotifyHdl( const Link& rLink ); diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index dedc476..8889adf 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -802,6 +802,7 @@ public: voidSetStatusEventHdl( const Link& rLink ); LinkGetStatusEventHdl() const; +voidSetStatusEventHdl1( const Link& rLink ); voidDraw( OutputDevice* pOutDev, const Rectangle& rOutRect );
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source
editeng/source/editeng/impedit3.cxx |1 + editeng/source/outliner/outliner.cxx |2 +- svx/source/svdraw/svdotext.cxx |3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) New commits: commit 9f61bda430ff71ea509697ba33014fb77150676a Author: matteocam Date: Wed Aug 13 18:39:04 2014 +0200 Change in status word when text overflowing Change-Id: I92439e46b72b757f396f9116d46a646e0314f43a diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 8751d05..7ea5a51 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -554,6 +554,7 @@ void ImpEditEngine::CheckAutoPageSize() // which paragraph is the first to cause higher size of the box? UpdateOverflowingParaNum( nBoxHeight /*aPrevPaperSize.Height()*/ ); // XXX: currently only for horizontal text aStatus.SetPageOverflow(true); +aStatus.GetStatusWord() |= 0x0100; } else { // No overflow if withing box boundaries diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 50fa881..38f66f2 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2144,7 +2144,7 @@ OutlinerParaObject *Outliner::GetOverflowingParaObject() const if ( pEditEngine->GetOverflowingParaNum() > GetParagraphCount()-1) { fprintf(stderr, "[Overflowing] Ops, trying to retrieve para %d when max index is %d\n", -nCount, +pEditEngine->GetOverflowingParaNum(), GetParagraphCount()-1); return NULL; } diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 7bdbda4..fe9dcd6 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1935,7 +1935,8 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus ) const sal_uInt32 nStat = pEditStatus->GetStatusWord(); const bool bGrowX=(nStat & EE_STAT_TEXTWIDTHCHANGED) !=0; const bool bGrowY=(nStat & EE_STAT_TEXTHEIGHTCHANGED) !=0; -if(bTextFrame && (bGrowX || bGrowY)) +const bool bOverflow = (nStat & 0x0100) != 0; +if(bTextFrame && (bGrowX || bGrowY || bOverflow)) { if ((bGrowX && IsAutoGrowWidth()) || (bGrowY && IsAutoGrowHeight())) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/outliner.cxx | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) New commits: commit 891d6e558e9b78a6e40980bc8cda3903c05126f5 Author: matteocam Date: Wed Aug 13 16:11:07 2014 +0200 Check that overflowing paragraphs are within indices Change-Id: I0937753facfa051b4fc6b5d21479855879ba64a1 diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 1ecef6b..50fa881 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2103,6 +2103,15 @@ OutlinerParaObject *Outliner::GetNonOverflowingParaObject() const sal_Int32 nCount = pEditEngine->GetOverflowingParaNum(); //sal_Int32 nCount = 1; +// Defensive check: oveflowing para index beyond actual # of paragraphs? +if ( nCount > GetParagraphCount()-1) { +fprintf(stderr, +"[Overflowing] Ops, trying to retrieve para %d when max index is %d\n", +nCount, +GetParagraphCount()-1); +return NULL; +} + if ( nCount == 0 ) // Only overflowing text return NULL; else if (nCount < 0) // No overflowing Text @@ -2130,8 +2139,17 @@ OutlinerParaObject *Outliner::GetNonOverflowingParaObject() const } OutlinerParaObject *Outliner::GetOverflowingParaObject() const { -if ( pEditEngine->GetOverflowingParaNum() >= 0) +if ( pEditEngine->GetOverflowingParaNum() >= 0) { +// Defensive check: oveflowing para index beyond actual # of paragraphs? +if ( pEditEngine->GetOverflowingParaNum() > GetParagraphCount()-1) { +fprintf(stderr, +"[Overflowing] Ops, trying to retrieve para %d when max index is %d\n", +nCount, +GetParagraphCount()-1); +return NULL; +} return CreateParaObject( pEditEngine->GetOverflowingParaNum() ); +} return NULL; /* ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng
editeng/source/editeng/impedit3.cxx | 12 include/editeng/editstat.hxx|2 +- 2 files changed, 9 insertions(+), 5 deletions(-) New commits: commit a9a2911235bc50c7a601f4cfee7f037fc414d504 Author: matteocam Date: Tue Aug 12 18:42:24 2014 +0200 aStatus.isPageOverflow cleared only explicitly Change-Id: Ibee0dd287cd99b01bd8e18857bd4a069bee7b78a diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 5e0c19b..736e594 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -546,14 +546,18 @@ void ImpEditEngine::CheckAutoPageSize() // FIXME(matteocam) /* fprintf( stderr, IsPageOverflow(aPaperSize, aPrevPaperSize) ? "YES Overflow!\n" : "NO Overflow!\n" ); */ -fprintf( stderr, "aPaperSize.Height = %d\n", aPaperSize.Height() ); // setting overflow status -sal_uInt32 nHeight = 1783; // XXX: hard coded for testing +sal_uInt32 nBoxHeight = 1783; // XXX: hard coded for testing //if ( IsPageOverflow( aPaperSize, aPrevPaperSize ) ) { -if (GetTextHeight() > 1783) // XXX: CalcTextHeight here?? +if (GetTextHeight() > nBoxHeight) // XXX: CalcTextHeight here?? +{ // which paragraph is the first to cause higher size of the box? -UpdateOverflowingParaNum( 1783 /*aPrevPaperSize.Height()*/ ); // XXX: currently only for horizontal text +UpdateOverflowingParaNum( nBoxHeight /*aPrevPaperSize.Height()*/ ); // XXX: currently only for horizontal text aStatus.SetPageOverflow(true); +} else +{ +// No overflow if withing box boundaries +aStatus.SetPageOverflow(false); } if ( aPaperSize != aPrevPaperSize ) diff --git a/include/editeng/editstat.hxx b/include/editeng/editstat.hxx index 3ab90bc..0aadd3d 100644 --- a/include/editeng/editstat.hxx +++ b/include/editeng/editstat.hxx @@ -98,7 +98,7 @@ public: EditStatus(){ nStatusBits = 0; nControlBits = 0; nPrevPara = -1; bIsPageOverflow = false; } -voidClear() { nStatusBits = 0; bIsPageOverflow = false; } +voidClear() { nStatusBits = 0; /*bIsPageOverflow = false;*/ } voidSetControlBits( sal_uLong nMask, bool bOn ) { SetFlags( nControlBits, nMask, bOn ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source
editeng/source/editeng/impedit3.cxx |1 + svx/source/svdraw/svdotext.cxx |2 ++ svx/source/svdraw/svdotxed.cxx |1 + 3 files changed, 4 insertions(+) New commits: commit 585a092eddcc9c4ac3f39abd798c69bc2f34a0d2 Author: matteocam Date: Tue Aug 12 14:45:22 2014 +0200 Experiment: setting fixed Max height from SdrTextObj Change-Id: I734400203befe89803a07ad73b8b9a83b61e58f3 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 9944878..a9b7483 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -546,6 +546,7 @@ void ImpEditEngine::CheckAutoPageSize() // FIXME(matteocam) /* fprintf( stderr, IsPageOverflow(aPaperSize, aPrevPaperSize) ? "YES Overflow!\n" : "NO Overflow!\n" ); */ +fprintf( stderr, "aPaperSize.Height = %d\n", aPaperSize.Height() ); // setting overflow status if ( IsPageOverflow( aPaperSize, aPrevPaperSize ) ) { // which paragraph is the first to cause higher size of the box? diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index cbdec1e..aefaca8 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -750,6 +750,8 @@ void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, boo else { nHgt = 100; +// FIXME(matteocam) +nHgt = 2000; } rOutliner.SetMaxAutoPaperSize(Size(nWdt,nHgt)); diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index 9151fe4..4f62e0b 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -189,6 +189,7 @@ void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* p else { nMaxHgt = 100; +nMaxHgt = 2000; } aPaperMax.Width()=nMaxWdt; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/impedit.hxx |2 +- editeng/source/editeng/impedit3.cxx |4 ++-- editeng/source/outliner/outliner.cxx |6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) New commits: commit 1671b24b4d64875f56967bed4e9068c0d7e693f9 Author: matteocam Date: Fri Aug 8 16:38:14 2014 +0200 Fixed off-by-one in Outliner::GetNonOverflowingParaObject Change-Id: Ifbb3e0282735e69d17a2c6ebd1586ed26ddcb9e2 diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 2ed9175..d53e5fd 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -1023,7 +1023,7 @@ public: sal_Int32 GetOverflowingParaNum() const { return mnOverflowingPara; } void SetOverflowingParaNum(sal_Int32 nPara) { mnOverflowingPara = nPara; } void ClearOverflowingParaNum() { mnOverflowingPara = -1; } -void UpdateOverflowingParaNum(); +void UpdateOverflowingParaNum( sal_uInt32 ); }; inline EPaM ImpEditEngine::CreateEPaM( const EditPaM& rPaM ) diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index a29e3ad..9944878 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -4601,7 +4601,7 @@ void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* } } -void ImpEditEngine::UpdateOverflowingParaNum() +void ImpEditEngine::UpdateOverflowingParaNum(sal_uInt32 nPaperHeight) { sal_uInt32 nY = 0; sal_uInt32 nPH; @@ -4610,7 +4610,7 @@ void ImpEditEngine::UpdateOverflowingParaNum() ParaPortion* pPara = GetParaPortions()[nPara]; nPH = pPara->GetHeight(); nY += nPH; -if ( nY > aPaperSize.Height() /*nCurTextHeight*/ ) // found first paragraph overflowing +if ( nY > nPaperHeight /*nCurTextHeight*/ ) // found first paragraph overflowing { SetOverflowingParaNum( nPara ); fprintf(stderr, "[CHAINING] Setting first overflowing para: %d\n", nPara); diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 66d9cd4..1ecef6b 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2098,9 +2098,9 @@ OutlinerParaObject *Outliner::GetNonOverflowingParaObject() const if ( GetParagraphCount() < 1 ) return NULL; -// XXX: returns first paragraph sal_Int32 nStartPara = 0; -sal_Int32 nCount = pEditEngine->GetOverflowingParaNum()-1; +// last non-overflowing paragraph is before the first overflowing one +sal_Int32 nCount = pEditEngine->GetOverflowingParaNum(); //sal_Int32 nCount = 1; if ( nCount == 0 ) // Only overflowing text @@ -2130,7 +2130,7 @@ OutlinerParaObject *Outliner::GetNonOverflowingParaObject() const } OutlinerParaObject *Outliner::GetOverflowingParaObject() const { -if ( pEditEngine->GetOverflowingParaNum() ) +if ( pEditEngine->GetOverflowingParaNum() >= 0) return CreateParaObject( pEditEngine->GetOverflowingParaNum() ); return NULL; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/impedit3.cxx | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) New commits: commit 88db808fb7c825914eb9fb4f7586b93bba40db4b Author: matteocam Date: Fri Aug 8 16:18:38 2014 +0200 Using page size instead of current text size for overflowing para Change-Id: I3f90cb372c3a20900b7f04618bcb4dcc0241e326 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 98744b6..a29e3ad 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -467,10 +467,6 @@ void ImpEditEngine::FormatDoc() aInvalidRect.Left() = 0; aInvalidRect.Right() = !IsVertical() ? aPaperSize.Width() : aPaperSize.Height(); } -} else if ( nNewHeight > nCurTextHeight ) // possible page overflow // FIXME(matteocam) -{ -// which paragraph is the first to cause higher size of the box? -UpdateOverflowingParaNum(); } nCurTextHeight = nNewHeight; @@ -551,8 +547,12 @@ void ImpEditEngine::CheckAutoPageSize() /* fprintf( stderr, IsPageOverflow(aPaperSize, aPrevPaperSize) ? "YES Overflow!\n" : "NO Overflow!\n" ); */ // setting overflow status -if ( IsPageOverflow( aPaperSize, aPrevPaperSize ) ) +if ( IsPageOverflow( aPaperSize, aPrevPaperSize ) ) { +// which paragraph is the first to cause higher size of the box? +UpdateOverflowingParaNum( aPrevPaperSize.Height() ); // XXX: currently only for horizontal text + aStatus.SetPageOverflow(true); +} if ( aPaperSize != aPrevPaperSize ) { @@ -4610,14 +4610,13 @@ void ImpEditEngine::UpdateOverflowingParaNum() ParaPortion* pPara = GetParaPortions()[nPara]; nPH = pPara->GetHeight(); nY += nPH; -if ( nY > nCurTextHeight ) // found first paragraph overflowing +if ( nY > aPaperSize.Height() /*nCurTextHeight*/ ) // found first paragraph overflowing { SetOverflowingParaNum( nPara ); fprintf(stderr, "[CHAINING] Setting first overflowing para: %d\n", nPara); return; } } -fprintf(stderr, "[CHAINING] Warning: Overflowing paragraph not found\n"); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/impedit.hxx |2 +- editeng/source/editeng/impedit3.cxx | 32 +++- 2 files changed, 20 insertions(+), 14 deletions(-) New commits: commit b082a055e9f2d40fc2840e4b3c6f8af373992aa5 Author: matteocam Date: Fri Aug 8 15:43:12 2014 +0200 Scanning paragraphs to find overflowing one Change-Id: Ib6769f663251f35fbd91eb43031ce60f555f897b diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index de32cbd..2ed9175 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -1023,7 +1023,7 @@ public: sal_Int32 GetOverflowingParaNum() const { return mnOverflowingPara; } void SetOverflowingParaNum(sal_Int32 nPara) { mnOverflowingPara = nPara; } void ClearOverflowingParaNum() { mnOverflowingPara = -1; } -void UpdateOverflowingParaNum(sal_Int32); +void UpdateOverflowingParaNum(); }; inline EPaM ImpEditEngine::CreateEPaM( const EditPaM& rPaM ) diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 973ae96..98744b6 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -425,13 +425,6 @@ void ImpEditEngine::FormatDoc() if ( IsCallParaInsertedOrDeleted() ) GetEditEnginePtr()->ParagraphHeightChanged( nPara ); pParaPortion->SetMustRepaint( false ); - -// FIXME(matteocam) -// set possible point for chaining - -// XXX: This may not work all the time: imp. edit engine is a shared resource!! -// Can it be that two boxes modify it before it's used? -UpdateOverflowingParaNum( nPara ); } // InvalidRect set only once... @@ -474,6 +467,10 @@ void ImpEditEngine::FormatDoc() aInvalidRect.Left() = 0; aInvalidRect.Right() = !IsVertical() ? aPaperSize.Width() : aPaperSize.Height(); } +} else if ( nNewHeight > nCurTextHeight ) // possible page overflow // FIXME(matteocam) +{ +// which paragraph is the first to cause higher size of the box? +UpdateOverflowingParaNum(); } nCurTextHeight = nNewHeight; @@ -4604,14 +4601,23 @@ void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* } } -void ImpEditEngine::UpdateOverflowingParaNum(sal_Int32 nPara) +void ImpEditEngine::UpdateOverflowingParaNum() { -// update if not already updated -if ( mnOverflowingPara == -1 ) { -mnOverflowingPara = nPara; -fprintf(stderr, "[CHAINING] Setting first overflowing para: %d\n", nPara); +sal_uInt32 nY = 0; +sal_uInt32 nPH; + +for ( sal_Int32 nPara = 0; nPara < GetParaPortions().Count(); nPara++ ) { +ParaPortion* pPara = GetParaPortions()[nPara]; +nPH = pPara->GetHeight(); +nY += nPH; +if ( nY > nCurTextHeight ) // found first paragraph overflowing +{ +SetOverflowingParaNum( nPara ); +fprintf(stderr, "[CHAINING] Setting first overflowing para: %d\n", nPara); +return; +} } -// XXX: where is this reset? +fprintf(stderr, "[CHAINING] Warning: Overflowing paragraph not found\n"); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/impedit.hxx |1 + editeng/source/editeng/impedit3.cxx |6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) New commits: commit c016277686979e769a403cbac6d0cee1b68c5425 Author: matteocam Date: Thu Aug 7 22:02:57 2014 +0200 Moved debugging output for UpdateOverflowingParaNum in the right place Change-Id: If8a58e434794639f7fcdffbe4a71c92ffd460234 diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 426d235..de32cbd 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -1023,6 +1023,7 @@ public: sal_Int32 GetOverflowingParaNum() const { return mnOverflowingPara; } void SetOverflowingParaNum(sal_Int32 nPara) { mnOverflowingPara = nPara; } void ClearOverflowingParaNum() { mnOverflowingPara = -1; } +void UpdateOverflowingParaNum(sal_Int32); }; inline EPaM ImpEditEngine::CreateEPaM( const EditPaM& rPaM ) diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 4c27985..973ae96 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -432,8 +432,6 @@ void ImpEditEngine::FormatDoc() // XXX: This may not work all the time: imp. edit engine is a shared resource!! // Can it be that two boxes modify it before it's used? UpdateOverflowingParaNum( nPara ); - -fprintf(stderr, "[CHAINING] Setting first overflowing para: %d\n", nPara); } // InvalidRect set only once... @@ -4609,8 +4607,10 @@ void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* void ImpEditEngine::UpdateOverflowingParaNum(sal_Int32 nPara) { // update if not already updated -if ( mnOverflowingPara == -1 ) +if ( mnOverflowingPara == -1 ) { mnOverflowingPara = nPara; +fprintf(stderr, "[CHAINING] Setting first overflowing para: %d\n", nPara); +} // XXX: where is this reset? } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng svx/source
editeng/source/editeng/editeng.cxx |3 +++ editeng/source/editeng/impedit.hxx |2 +- editeng/source/editeng/impedit3.cxx |4 ++-- editeng/source/outliner/outliner.cxx |9 - include/editeng/editeng.hxx |1 + include/editeng/outliner.hxx |1 + svx/source/svdraw/svdotxed.cxx |6 +- 7 files changed, 21 insertions(+), 5 deletions(-) New commits: commit b687077202c921033a67a867e9ded55aa92e735c Author: matteocam Date: Thu Aug 7 20:22:06 2014 +0200 Reset mnOverflowPara Change-Id: Ie07ee16d0f181bfedfe1d2459ab6915984235b20 diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 6cbac8d..2709740 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -2775,6 +2775,9 @@ sal_Int32 EditEngine::GetOverflowingParaNum() const { return pImpEditEngine->GetOverflowingParaNum(); } +void EditEngine::ClearOverflowingParaNum() { +pImpEditEngine->ClearOverflowingParaNum(); +} EFieldInfo::EFieldInfo() { diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 533b47d..426d235 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -466,7 +466,6 @@ private: // For Chaining sal_Int32 mnOverflowingPara = -1; -void SetOverflowingParaNum(); IdleFormattter aIdleFormatter; @@ -1023,6 +1022,7 @@ public: sal_Int32 GetOverflowingParaNum() const { return mnOverflowingPara; } void SetOverflowingParaNum(sal_Int32 nPara) { mnOverflowingPara = nPara; } +void ClearOverflowingParaNum() { mnOverflowingPara = -1; } }; inline EPaM ImpEditEngine::CreateEPaM( const EditPaM& rPaM ) diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index e810501..4c27985 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -431,7 +431,7 @@ void ImpEditEngine::FormatDoc() // XXX: This may not work all the time: imp. edit engine is a shared resource!! // Can it be that two boxes modify it before it's used? -UpdateOverflowingPara( nPara ); +UpdateOverflowingParaNum( nPara ); fprintf(stderr, "[CHAINING] Setting first overflowing para: %d\n", nPara); } @@ -4606,7 +4606,7 @@ void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* } } -void ImpEditEngine::SetOverflowingParaNum(int nPara) +void ImpEditEngine::UpdateOverflowingParaNum(sal_Int32 nPara) { // update if not already updated if ( mnOverflowingPara == -1 ) diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index e4c2614..66d9cd4 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2131,7 +2131,9 @@ OutlinerParaObject *Outliner::GetNonOverflowingParaObject() const OutlinerParaObject *Outliner::GetOverflowingParaObject() const { if ( pEditEngine->GetOverflowingParaNum() ) -return CreateParaObject( pEditEngine->GetOverflowingParaNum() ); +return CreateParaObject( pEditEngine->GetOverflowingParaNum() ); + +return NULL; /* // XXX: returns second paragraph if there is one, first otherwise if ( GetParagraphCount() >= 2 ) @@ -2141,4 +2143,9 @@ OutlinerParaObject *Outliner::GetOverflowingParaObject() const */ } +void Outliner::ClearOverflowingParaNum() +{ +pEditEngine->ClearOverflowingParaNum(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index a66c6d1..33dd8f0 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -596,6 +596,7 @@ public: bool Redo(EditView* pView); sal_Int32 GetOverflowingParaNum() const; +void ClearOverflowingParaNum(); }; #endif // INCLUDED_EDITENG_EDITENG_HXX diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index b00d8c7..dedc476 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -760,6 +760,7 @@ public: OutlinerParaObject *GetNonOverflowingParaObject() const; OutlinerParaObject *GetOverflowingParaObject() const; +void ClearOverflowingParaNum(); virtual voidDepthChangedHdl(); voidSetDepthChangedHdl(const Link& rLink){aDepthChangedHdl=rLink;} diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index 76d3296..b32a8be 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -268,7 +268,11 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl) // set overflowing text for SdrChainedTextPrimitive2D pNextText = rOutl.GetOverflowingParaObject(); mpOverflowingText = pNextText; -//SetOverflowingText( pNextText ); +// we do not need th
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/impedit.hxx |1 + editeng/source/editeng/impedit3.cxx | 16 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) New commits: commit 32d7b1b4f452fbb27bf7722d5e54824d03938023 Author: matteocam Date: Thu Aug 7 18:51:37 2014 +0200 Check that overflowing para hasn't been updated yet. No reset. Change-Id: Id1346ff9f203978a08e6af80b408f30033bb88cb diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index a1ddccc..533b47d 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -466,6 +466,7 @@ private: // For Chaining sal_Int32 mnOverflowingPara = -1; +void SetOverflowingParaNum(); IdleFormattter aIdleFormatter; diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index a6a21ae..e810501 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -427,8 +427,12 @@ void ImpEditEngine::FormatDoc() pParaPortion->SetMustRepaint( false ); // FIXME(matteocam) -// set possible point for chainging -mnOverflowingPara = nPara; +// set possible point for chaining + +// XXX: This may not work all the time: imp. edit engine is a shared resource!! +// Can it be that two boxes modify it before it's used? +UpdateOverflowingPara( nPara ); + fprintf(stderr, "[CHAINING] Setting first overflowing para: %d\n", nPara); } @@ -4602,4 +4606,12 @@ void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* } } +void ImpEditEngine::SetOverflowingParaNum(int nPara) +{ +// update if not already updated +if ( mnOverflowingPara == -1 ) +mnOverflowingPara = nPara; +// XXX: where is this reset? +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng
editeng/source/editeng/editeng.cxx |5 + editeng/source/editeng/impedit.hxx |6 ++ editeng/source/editeng/impedit3.cxx |6 ++ editeng/source/outliner/outliner.cxx | 12 +++- include/editeng/editeng.hxx |3 ++- 5 files changed, 30 insertions(+), 2 deletions(-) New commits: commit 8dbcf9c50f2f7093e7864d94a736efa9388d806b Author: matteocam Date: Sun Aug 3 19:04:36 2014 +0300 Overflowing paragraph number depends on breakup point. Change-Id: I2bcc12b69a7d6729ad69760191ef76cd1f097768 diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 7b4d94a..6cbac8d 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -2771,6 +2771,11 @@ EditPaM EditEngine::InsertLineBreak(const EditSelection& rEditSelection) return pImpEditEngine->InsertLineBreak(rEditSelection); } +sal_Int32 EditEngine::GetOverflowingParaNum() const { +return pImpEditEngine->GetOverflowingParaNum(); +} + + EFieldInfo::EFieldInfo() { pFieldItem = NULL; diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 506d597..a1ddccc 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -464,6 +464,9 @@ private: sal_uInt32 nCurTextHeightNTP; // without trailing empty paragraphs sal_uInt16 nOnePixelInRef; +// For Chaining +sal_Int32 mnOverflowingPara = -1; + IdleFormattter aIdleFormatter; Timer aOnlineSpellTimer; @@ -1016,6 +1019,9 @@ public: /// specifies if auto-correction should capitalize the first word or not (default is on) voidSetFirstWordCapitalization( bool bCapitalize ) { bFirstWordCapitalization = bCapitalize; } boolIsFirstWordCapitalization() const { return bFirstWordCapitalization; } + +sal_Int32 GetOverflowingParaNum() const { return mnOverflowingPara; } +void SetOverflowingParaNum(sal_Int32 nPara) { mnOverflowingPara = nPara; } }; inline EPaM ImpEditEngine::CreateEPaM( const EditPaM& rPaM ) diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 77264b4..db1aad8 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -363,6 +363,8 @@ bool ImpEditEngine::IsPageOverflow( const Size aCurPaperSize, const Size aPrevPa const bool bPageExpansionY = ( aPrevPaperSize.Height() != 0 ) && // XXX ( aCurPaperSize.Height() > aPrevPaperSize.Height() ); +// Has text size changed (in the right vertical direction) AND +// is this change an expansion? return ( bTextGrowY && !IsVertical() && bPageExpansionY ) || ( bTextGrowX && IsVertical() && bPageExpansionX ); @@ -423,6 +425,10 @@ void ImpEditEngine::FormatDoc() if ( IsCallParaInsertedOrDeleted() ) GetEditEnginePtr()->ParagraphHeightChanged( nPara ); pParaPortion->SetMustRepaint( false ); + +// FIXME(matteocam) +// set possible point for chainging +mnOverflowingPara = nPara; } // InvalidRect set only once... diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index f196875..e4c2614 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2100,7 +2100,13 @@ OutlinerParaObject *Outliner::GetNonOverflowingParaObject() const // XXX: returns first paragraph sal_Int32 nStartPara = 0; -sal_Int32 nCount = 1; +sal_Int32 nCount = pEditEngine->GetOverflowingParaNum()-1; +//sal_Int32 nCount = 1; + +if ( nCount == 0 ) // Only overflowing text +return NULL; +else if (nCount < 0) // No overflowing Text +nCount = GetParagraphCount(); // code inspired from Outliner::CreateParaObject @@ -2124,11 +2130,15 @@ OutlinerParaObject *Outliner::GetNonOverflowingParaObject() const } OutlinerParaObject *Outliner::GetOverflowingParaObject() const { +if ( pEditEngine->GetOverflowingParaNum() ) +return CreateParaObject( pEditEngine->GetOverflowingParaNum() ); +/* // XXX: returns second paragraph if there is one, first otherwise if ( GetParagraphCount() >= 2 ) return CreateParaObject(1, 1); else return CreateParaObject(0, 1); +*/ } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index bb5efa3..a66c6d1 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -186,7 +186,6 @@ private: protected: - public: EditEngine( SfxItemPool* pItemPool ); virtual ~EditEngine(); @@ -595,6 +594,8 @@ public: bool Undo(EditView* pView); bool Redo(EditView* pView); + +sal_Int32 GetOverflowingParaNu
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/svx svx/source
editeng/source/outliner/outliner.cxx | 38 +-- include/svx/svdotext.hxx | 13 --- svx/source/svdraw/svdotext.cxx | 17 +++ svx/source/svdraw/svdotxed.cxx |8 +++ 4 files changed, 58 insertions(+), 18 deletions(-) New commits: commit 664055f31a4a1178dd88e2b642d27930bb64568e Author: matteocam Date: Thu Jul 31 18:58:16 2014 +0300 Copy second paragraph when breakup occurs Change-Id: I937c80f0f07b3bf1d5052d962bfd5d075159014f diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index ff9217a..f196875 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2090,11 +2090,45 @@ bool Outliner::HasParaFlag( const Paragraph* pPara, sal_uInt16 nFlag ) const OutlinerParaObject *Outliner::GetNonOverflowingParaObject() const { -return NULL; +/* XXX: + * nCount should be the number of paragraphs of the non overflowing text + * nStart should be the starting paragraph of the non overflowing text (XXX: Always 0?) +*/ + +if ( GetParagraphCount() < 1 ) +return NULL; + +// XXX: returns first paragraph +sal_Int32 nStartPara = 0; +sal_Int32 nCount = 1; + +// code inspired from Outliner::CreateParaObject + +// we need a paragraph data vector and the actual text +ParagraphDataVector aParagraphDataVector(nCount); +const sal_Int32 nLastPara(nStartPara + nCount - 1); + +for(sal_Int32 nPara(nStartPara); nPara <= nLastPara; nPara++) +{ +aParagraphDataVector[nPara-nStartPara] = *GetParagraph(nPara); +} + +EditTextObject* pText = pEditEngine->CreateTextObject( nStartPara, nCount ); +const bool bIsEditDoc(OUTLINERMODE_TEXTOBJECT == ImplGetOutlinerMode()); + +OutlinerParaObject* pPObj = new OutlinerParaObject(*pText, aParagraphDataVector, bIsEditDoc); +pPObj->SetOutlinerMode(GetMode()); + +delete pText; +return pPObj; } OutlinerParaObject *Outliner::GetOverflowingParaObject() const { -return NULL; +// XXX: returns second paragraph if there is one, first otherwise +if ( GetParagraphCount() >= 2 ) +return CreateParaObject(1, 1); +else +return CreateParaObject(0, 1); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index 841bf54..b5fa059 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -349,18 +349,7 @@ public: // Chaining bool IsToBeChained() const; -SdrTextObj *GetNextLinkInChain() const { -/* FIXME(matteocam) return mpNextInChain; */ -if ( pPage && pPage->GetObjCount() > 1) { -pNextTextObj = dynamic_cast< SdrTextObj * >( pPage->GetObj(1) ); -if ( pNextTextObj == NULL) -return NULL; -return pNextTextObj; -} else { -fprintf(stderr, "Make New Object please\n"); -return NULL; -} -} +SdrTextObj *GetNextLinkInChain() const; SdrObjKind GetTextKind() const { return eTextKind; } diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 0b5e690..1c6a524 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2004,6 +2004,23 @@ void SdrTextObj::SetObjectItemNoBroadcast(const SfxPoolItem& rItem) static_cast< sdr::properties::TextProperties& >(GetProperties()).SetObjectItemNoBroadcast(rItem); } +SdrTextObj* SdrTextObj::GetNextLinkInChain() const +{ +/* FIXME(matteocam) return mpNextInChain; */ +SdrTextObj *pNextTextObj = NULL; + +if ( pPage && pPage->GetObjCount() > 1) { +pNextTextObj = dynamic_cast< SdrTextObj * >( pPage->GetObj(1) ); +if ( pNextTextObj == NULL) +return NULL; +return pNextTextObj; +} else { +fprintf(stderr, "Make New Object please\n"); +return NULL; +} + +} + // The concept of the text object: diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index af34e51..f6d3fba 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -251,11 +251,11 @@ void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* p void SdrTextObj::EndTextEdit(SdrOutliner& rOutl) { +OutlinerParaObject* pNewText = NULL; +OutlinerParaObject* pNextText = NULL; + if(rOutl.IsModified()) { -OutlinerParaObject* pNewText = NULL; -OutlinerParaObject* pOverflownText = NULL; - // to make the gray field background vanish again rOutl.UpdateFields(); @@ -295,7 +295,7 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl) // sets text to next box if (pNextText != NULL) { SdrTextObj *pNextTextObj = GetNextLinkInChain(); -pNextTextObj->SetOutlinerParaObject( pOverflownText ); +pNextTextObj->SetOutlinerParaObject( pNextTe
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng include/svx svx/source
editeng/source/outliner/outliner.cxx |9 + include/editeng/outliner.hxx |3 +++ include/svx/svdotext.hxx | 15 +++ svx/source/svdraw/svdotxed.cxx |3 ++- 4 files changed, 29 insertions(+), 1 deletion(-) New commits: commit 1f0d780c33958ea7b27f8c055d0c5d3fa369ae10 Author: matteocam Date: Wed Jul 30 21:54:36 2014 +0300 Sketched Outliner methods for (non)overflowing portions Change-Id: If7a0295589747f99cc7a934b9dd276b414c08faa diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 08f0b79..ff9217a 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2088,4 +2088,13 @@ bool Outliner::HasParaFlag( const Paragraph* pPara, sal_uInt16 nFlag ) const return pPara && pPara->HasFlag( nFlag ); } +OutlinerParaObject *Outliner::GetNonOverflowingParaObject() const +{ +return NULL; +} +OutlinerParaObject *Outliner::GetOverflowingParaObject() const +{ +return NULL; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index bcf1791..b00d8c7 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -758,6 +758,9 @@ public: voidSetParaRemovingHdl(const Link& rLink){aParaRemovingHdl=rLink;} LinkGetParaRemovingHdl() const { return aParaRemovingHdl; } +OutlinerParaObject *GetNonOverflowingParaObject() const; +OutlinerParaObject *GetOverflowingParaObject() const; + virtual voidDepthChangedHdl(); voidSetDepthChangedHdl(const Link& rLink){aDepthChangedHdl=rLink;} LinkGetDepthChangedHdl() const { return aDepthChangedHdl; } diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index f0f917d..841bf54 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -346,7 +346,22 @@ public: bool IsAutoFit() const; /// returns true if the old feature for fitting shape content should into shape is enabled. implies IsAutoFit()==false! bool IsFitToSize() const; + +// Chaining bool IsToBeChained() const; +SdrTextObj *GetNextLinkInChain() const { +/* FIXME(matteocam) return mpNextInChain; */ +if ( pPage && pPage->GetObjCount() > 1) { +pNextTextObj = dynamic_cast< SdrTextObj * >( pPage->GetObj(1) ); +if ( pNextTextObj == NULL) +return NULL; +return pNextTextObj; +} else { +fprintf(stderr, "Make New Object please\n"); +return NULL; +} +} + SdrObjKind GetTextKind() const { return eTextKind; } // #i121917# diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index b8deb75..af34e51 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -260,10 +260,11 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl) rOutl.UpdateFields(); // FIXME(matteocam) +// TODO: move this to one level higher if ( IsToBeChained() ) { // set non overflow part of text to current box -pNewText = rOutl.GetNotOverflowingParaObject(); +pNewText = rOutl.GetNonOverflowingParaObject(); pNextText = rOutl.GetOverflowingParaObject(); // XXX: should this SdrTextObj know "how much text to ask" by CreateParaObject? ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/svx svx/inc svx/source
editeng/source/editeng/impedit3.cxx |4 +- include/svx/sdr/primitive2d/svx_primitivetypes2d.hxx |2 - svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx | 27 +++ svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |5 +++ svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx| 23 5 files changed, 58 insertions(+), 3 deletions(-) New commits: commit 7427a65ad93a68ac3814d8c88f831474194351c0 Author: matteocam Date: Tue Jul 22 15:57:18 2014 +0300 Basic SdrChainedTextPrimitive2D class definition Change-Id: I3bab06d061b1bde6804c0d539df3cf81bb363857 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 196d0ee..77264b4 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -542,8 +542,8 @@ void ImpEditEngine::CheckAutoPageSize() SetValidPaperSize( aPaperSize );// consider Min, Max // FIXME(matteocam) -fprintf( stderr, IsPageOverflow(aPaperSize, aPrevPaperSize) -? "YES Overflow!\n" : "NO Overflow!\n" ); +/* fprintf( stderr, IsPageOverflow(aPaperSize, aPrevPaperSize) +? "YES Overflow!\n" : "NO Overflow!\n" ); */ // setting overflow status if ( IsPageOverflow( aPaperSize, aPrevPaperSize ) ) aStatus.SetPageOverflow(true); diff --git a/include/svx/sdr/primitive2d/svx_primitivetypes2d.hxx b/include/svx/sdr/primitive2d/svx_primitivetypes2d.hxx index 0fae52a..cc7aca0 100644 --- a/include/svx/sdr/primitive2d/svx_primitivetypes2d.hxx +++ b/include/svx/sdr/primitive2d/svx_primitivetypes2d.hxx @@ -48,7 +48,7 @@ #define PRIMITIVE2D_ID_SDRCONTROLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 21) #define PRIMITIVE2D_ID_SDROLECONTENTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 22) #define PRIMITIVE2D_ID_SDRAUTOFITTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 23) - +#define PRIMITIVE2D_ID_SDRCHAINEDTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 24) #endif // INCLUDED_SVX_SDR_PRIMITIVE2D_SVX_PRIMITIVETYPES2D_HXX diff --git a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx index fa8a13f..44b82ae 100644 --- a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx +++ b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx @@ -331,6 +331,33 @@ namespace drawinglayer } // end of namespace primitive2d } // end of namespace drawinglayer +namespace drawinglayer +{ +namespace primitive2d +{ +class SdrChainedTextPrimitive2D : public SdrTextPrimitive2D +{ +private: +// XXX: might have position of overflowing text +protected: +// local decomposition. +virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const SAL_OVERRIDE; + +public: +SdrChainedTextPrimitive2D( +const SdrText* pSdrText, +const OutlinerParaObject& rOutlinerParaObjectPtrs); + +// get data + +// compare operator +//virtual bool operator==(const BasePrimitive2D& rPrimitive) const SAL_OVERRIDE; + +// provide unique ID +DeclPrimitive2DIDBlock() +}; +} // end of namespace primitive2d +} // end of namespace drawinglayer #endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRTEXTPRIMITIVE2D_HXX diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index a12ff99..7e2a705 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -302,6 +302,11 @@ namespace drawinglayer } else if(rText.isAutoFit()) { +// FIXME(matteocam) +bool b = false; +if (b) +pNew = new SdrChainedTextPrimitive2D( &rText.getSdrText(), rText.getOutlinerParaObject() ); +else // end FIXME // isotrophically scaled text in range pNew = new SdrAutoFitTextPrimitive2D(&rText.getSdrText(), rText.getOutlinerParaObject(), aAnchorTransform, bWordWrap); } diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx index 158a0d0..8ba2909 100644 --- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx @@ -480,6 +480,29 @@ namespace drawinglayer } // end of namespace primitive2d } // end of namespace drawinglayer +namespace drawinglayer +{ +namespace primitive2d +{ + +SdrChainedTextPrimitive2D::SdrChainedTextPrimitive2D( +const SdrText* pSdrText, +const OutlinerParaObject& rOutlinerParaObject) +: SdrTextPrimitive2D(pSdrText, rOutlinerParaObject) +
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source
editeng/source/editeng/impedit3.cxx |2 +- svx/source/svdraw/svdotextdecomposition.cxx |6 +- 2 files changed, 6 insertions(+), 2 deletions(-) New commits: commit 64dad97fcac516bc83f31ffb79763f55948292d0 Author: matteocam Date: Mon Jul 21 22:33:56 2014 +0300 Removed outdated comments. Set para obj in impCopyTextInTextObj Change-Id: I8789403e99f7847f937ead12cd16f34e1ed164f9 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index ce30d8e..196d0ee 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -544,7 +544,7 @@ void ImpEditEngine::CheckAutoPageSize() // FIXME(matteocam) fprintf( stderr, IsPageOverflow(aPaperSize, aPrevPaperSize) ? "YES Overflow!\n" : "NO Overflow!\n" ); -// setting overflow status // XXX: Is status reset somewhere? +// setting overflow status if ( IsPageOverflow( aPaperSize, aPrevPaperSize ) ) aStatus.SetPageOverflow(true); diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 9253a9a..d9ed3e6 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -780,7 +780,7 @@ void SdrTextObj::impCopyTextInTextObj(SdrTextObj *pNextTextObj) const if( pText!=NULL && pText->GetOutlinerParaObject() && pModel!=NULL) { Rectangle &aNextRect = pNextTextObj->aRect; -SdrOutliner& rOutliner = pNextTextObj->ImpGetDrawOutliner(); // XXX: shit seems to happen in here +SdrOutliner& rOutliner = pNextTextObj->ImpGetDrawOutliner(); rOutliner.SetPaperSize( Size( aNextRect.Right()-aNextRect.Left(), @@ -801,6 +801,10 @@ void SdrTextObj::impCopyTextInTextObj(SdrTextObj *pNextTextObj) const if (aNewRect!=aNextRect) { pNextTextObj->SetLogicRect(aNewRect); } + +// Set text object's string +pNextTextObj->SetOutlinerParaObject(*pText->GetOutlinerParaObject()); + } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng
editeng/source/editeng/impedit3.cxx |2 +- include/editeng/editstat.hxx|1 + 2 files changed, 2 insertions(+), 1 deletion(-) New commits: commit 01e4be5815252fd3c9d21161bd7a0f4437f4c7cb Author: matteocam Date: Mon Jul 21 20:17:56 2014 +0200 Added public method EditStatus::SetPageOverflow Change-Id: I8f4f3cc6b2c3ad20db441120f3cd3a4f0ad2e0b9 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index ee23f98..ce30d8e 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -546,7 +546,7 @@ void ImpEditEngine::CheckAutoPageSize() ? "YES Overflow!\n" : "NO Overflow!\n" ); // setting overflow status // XXX: Is status reset somewhere? if ( IsPageOverflow( aPaperSize, aPrevPaperSize ) ) -aStatus.bIsPageOverflow = true; +aStatus.SetPageOverflow(true); if ( aPaperSize != aPrevPaperSize ) { diff --git a/include/editeng/editstat.hxx b/include/editeng/editstat.hxx index e62ef82..148c8c4 100644 --- a/include/editeng/editstat.hxx +++ b/include/editeng/editstat.hxx @@ -112,6 +112,7 @@ public: sal_Int32& GetPrevParagraph() { return nPrevPara; } boolIsPageOverflow() const { return bIsPageOverflow; } +voidSetPageOverflow(bool isOverflow) { bIsPageOverflow = isOverflow; } }; #define SPELLCMD_IGNOREWORD 0x0001 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/impedit3.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 9d22d0ae7dfa98c261bc13e4c2e8ff564e0858a7 Author: matteocam Date: Mon Jul 21 20:05:34 2014 +0200 Set overflow Status in CheckAutoPageSize Change-Id: I07b149495175b110c931b74394dca1eab338df48 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 8d9e41b..ee23f98 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -544,6 +544,9 @@ void ImpEditEngine::CheckAutoPageSize() // FIXME(matteocam) fprintf( stderr, IsPageOverflow(aPaperSize, aPrevPaperSize) ? "YES Overflow!\n" : "NO Overflow!\n" ); +// setting overflow status // XXX: Is status reset somewhere? +if ( IsPageOverflow( aPaperSize, aPrevPaperSize ) ) +aStatus.bIsPageOverflow = true; if ( aPaperSize != aPrevPaperSize ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/svx svx/source
editeng/source/editeng/impedit3.cxx |4 +-- include/svx/svdotext.hxx|1 svx/source/svdraw/svdotext.cxx | 35 +++- svx/source/svdraw/svdotextdecomposition.cxx | 27 - 4 files changed, 37 insertions(+), 30 deletions(-) New commits: commit 9e06714013f1c1f3f66dd14eac15d51d48d07e4a Author: matteocam Date: Fri Jul 18 02:16:45 2014 +0200 SdrTextObj::ImpChainText makes a copy of text Change-Id: Ic44fa0198759fc811c06035d306b91aec7670061 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 48c2450..8d9e41b 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -355,8 +355,8 @@ void ImpEditEngine::FormatFullDoc() bool ImpEditEngine::IsPageOverflow( const Size aCurPaperSize, const Size aPrevPaperSize ) const { -const bool bTextGrowX=(aStatus & EE_STAT_TEXTWIDTHCHANGED) !=0; -const bool bTextGrowY=(aStatus & EE_STAT_TEXTHEIGHTCHANGED) !=0; +const bool bTextGrowX=(aStatus.GetControlWord() & EE_STAT_TEXTWIDTHCHANGED) !=0; +const bool bTextGrowY=(aStatus.GetControlWord() & EE_STAT_TEXTHEIGHTCHANGED) !=0; const bool bPageExpansionX = ( aPrevPaperSize.Width() != 0 ) && // XXX ( aCurPaperSize.Width() > aPrevPaperSize.Width() ); diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index 22fced9..93a48cb 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -269,6 +269,7 @@ private: Rectangle& rPaintRect, Fraction&aFitXKorreg ) const; void ImpAutoFitText( SdrOutliner& rOutliner ) const; +void ImpChainText() const; static void ImpAutoFitText( SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting ); SVX_DLLPRIVATE SdrObject* ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const; SVX_DLLPRIVATE void ImpLinkAnmeldung(); diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index b24d90d..008ebcf 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1925,13 +1925,46 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus ) ImpAutoFitText(*pEdtOutl); mbInDownScale = false; } -else if (IsChained() && pEditStatus->IsOverflow()) +else if (/* TODO: IsChained() && */ pEditStatus->IsPageOverflow()) { } } } + +void SdrTextObj::ImpChainText() const +{ +/* BEGIN Experiments */ +// FIXME(matteocam) + +// we use (text) object 0 and 1 for these experiments: +// copying text from one to the other. + +SdrTextObj *pNextTextObj; +if ( pPage && pPage->GetObjCount() > 1) { +pNextTextObj = dynamic_cast< SdrTextObj * >( +pPage->GetObj(1) ); +if ( pNextTextObj == NULL) +return; +} else { +fprintf(stderr, "Make New Object please\n"); +return; +} + +// for debugging purposes: +// carry out experiments only when setting b=false from gdb +//bool b = true; +//if (!b) { +impCopyTextInTextObj(pNextTextObj); // just do it +//return; +//} + +/* END Experiments */ +} + + + /** returns the currently active text. */ SdrText* SdrTextObj::getActiveText() const { diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 59f5acc..9253a9a 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -809,32 +809,6 @@ void SdrTextObj::impDecomposeAutoFitTextPrimitive( const drawinglayer::primitive2d::SdrAutoFitTextPrimitive2D& rSdrAutofitTextPrimitive, const drawinglayer::geometry::ViewInformation2D& aViewInformation) const { -/* BEGIN Experiments */ -// FIXME(matteocam) - -// we use (text) object 0 and 1 for these experiments: -// copying text from one to the other. - -SdrTextObj *pNextTextObj; -if ( pPage && pPage->GetObjCount() > 1) { -pNextTextObj = dynamic_cast< SdrTextObj * >( -pPage->GetObj(1) ); -if ( pNextTextObj == NULL) -return; -} else { -fprintf(stderr, "Make New Object please\n"); -return; -} - -// for debugging purposes: -// carry out experiments only when setting b=false from gdb -//bool b = true; -//if (!b) { -impCopyTextInTextObj(pNextTextObj); // just do it -//return; -//} - -/* END Experiments */ // decompose matrix to have position and size of text basegfx::B2DVector aScale, aTranslate; @@ -1523,5 +1497,4 @@ void SdrTextObj::impGetScrollTextTiming(drawinglayer::animation::AnimationEntryL } } - /* vim:set shiftwidth=4 softtabstop=4 expandtab:
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/impedit3.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit c9b29b357cd45e964e372241b010c32fcc67eb93 Author: matteocam Date: Wed Jul 16 17:48:36 2014 +0200 IsPageOverflow discards null heights/widths Change-Id: I1f1728deeffaa0571f80776e5f011a594632b8cc diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index ad7e465..b291967 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -359,9 +359,9 @@ bool IsPageOverflow(const sal_uInt32 aStatus, bool isVertical, const bool bTextGrowX=(aStatus & EE_STAT_TEXTWIDTHCHANGED) !=0; const bool bTextGrowY=(aStatus & EE_STAT_TEXTHEIGHTCHANGED) !=0; -const bPageExpansionX = ( aPrevPaperSize.Width() != 0 ) && // XXX +const bool bPageExpansionX = ( aPrevPaperSize.Width() != 0 ) && // XXX ( aPaperSize.Width() > aPrevPaperSize.Width() ); -const bPageExpansionY = ( aPrevPaperSize.Height() != 0 ) && // XXX +const bool bPageExpansionY = ( aPrevPaperSize.Height() != 0 ) && // XXX ( aPaperSize.Height() > aPrevPaperSize.Height() ); return ( bTextGrowY && !isVertical && bPageExpansionY ) || ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/impedit3.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit 8244ce98f5de4e5ff4116556c5955b1c162b3988 Author: matteocam Date: Wed Jul 16 17:08:39 2014 +0200 Debugging output for IsPageOverflow in CheckAutoPageSize Change-Id: I55f7dcf4d8c9a786c2c6d4a1fc09e93bd7e32f7a diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index ad3d2ab..1ad910a 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -537,6 +537,13 @@ void ImpEditEngine::CheckAutoPageSize() SetValidPaperSize( aPaperSize );// consider Min, Max +// FIXME(matteocam) +fprintf( stderr, IsPageOverflow( aStatus.GetStatusWord(), +IsVertical(), +aPrevPaperSize, +aPaperSize) + ? "YES Overflow!\n" : "NO Overflow!\n" ); + if ( aPaperSize != aPrevPaperSize ) { if ( ( !IsVertical() && ( aPaperSize.Width() != aPrevPaperSize.Width() ) ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source
editeng/source/outliner/outliner.cxx|3 +-- svx/source/svdraw/svdotextdecomposition.cxx | 22 ++ 2 files changed, 23 insertions(+), 2 deletions(-) New commits: commit 5625b440f15564f8e12d37119a1b7f9198815d45 Author: matteocam Date: Fri Jul 11 16:38:46 2014 +0200 Truncation in impHandleDrawPortionInfo Change-Id: Ief79063be0ef742148c24a3eb2d4d2cb7530987e diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 34962f4..08f0b79 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -1756,8 +1756,7 @@ void Outliner::DrawingText( const Point& rStartPos, const OUString& rText, sal_I if(aDrawPortionHdl.IsSet()) { -// FIXME(matteocam) -DrawPortionInfo aInfo( rStartPos, rText, nTextStart, std::min(nTextLen,2), rFont, nPara, nIndex, pDXArray, pWrongSpellVector, +DrawPortionInfo aInfo( rStartPos, rText, nTextStart, nTextLen, rFont, nPara, nIndex, pDXArray, pWrongSpellVector, pFieldData, pLocale, rOverlineColor, rTextLineColor, nRightToLeft, false, 0, bEndOfLine, bEndOfParagraph, bEndOfBullet); aDrawPortionHdl.Call( &aInfo ); diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 2f7c4e1..e044d39 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -510,6 +510,28 @@ namespace void impTextBreakupHandler::impHandleDrawPortionInfo(const DrawPortionInfo& rInfo) { +// FIXME(matteocam) + +/* + * We want to break the text at the 10th character if we are at + * the end of the paragraph. + * XXX: How to send it back to editengine? + * [AutoFit uses SetGlobalStretch... from Outliner] + * XXX: how to pass on to the rest of the text "This should be + * drawn somewhere else"? +*/ + +bool bTruncateText = rInfo.mbEndOfParagraph; // arbitrary property + +if ( bTruncateText ) +{ +// truncate it at 4 +int nTruncationPoint = 4; +rInfo.mnTextLen = std::min( rInfo.mnTextLen, nTruncationPoint ); +} + +// END FIXME + impCreateTextPortionPrimitive(rInfo); if(rInfo.mbEndOfLine || rInfo.mbEndOfParagraph) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/impedit3.cxx | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) New commits: commit f839ca859194d0850e33685d7f59d9c75b5e003a Author: matteocam Date: Mon Jun 30 09:29:34 2014 -0400 Resumed nDiff and CheckAutoPageSize: they were not effective Change-Id: I599e7b21dc61a09f9cc3f68533183552caaac0ae diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 94a1b67..e220750 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -436,9 +436,8 @@ void ImpEditEngine::FormatDoc() { sal_uInt32 nNewHeightNTP; sal_uInt32 nNewHeight = CalcTextHeight( &nNewHeightNTP ); -// FIXME(matteocam) -long nDiff = 0; -//long nDiff = nNewHeight - nCurTextHeight; + +long nDiff = nNewHeight - nCurTextHeight; if ( nDiff ) aStatus.GetStatusWord() |= !IsVertical() ? EE_STAT_TEXTHEIGHTCHANGED : EE_STAT_TEXTWIDTHCHANGED; if ( nNewHeight < nCurTextHeight ) @@ -518,11 +517,6 @@ bool ImpEditEngine::ImpCheckRefMapMode() void ImpEditEngine::CheckAutoPageSize() { -// FIXME(matteocam) -SetValidPaperSize( aPaperSize );// consider Min, Max -return; -// END FIXME - Size aPrevPaperSize( GetPaperSize() ); if ( GetStatus().AutoPageWidth() ) @@ -3430,12 +3424,6 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt ' ' == aText[nTextStart + nTextLen - 1] ) --nTextLen; -// FIXME(matteocam) -if (aTmpFont.GetItalic() != ITALIC_NONE) { -Color aColor = COL_BROWN; -aTmpFont.SetFillColor(aColor); -} - // output directly aTmpFont.QuickDrawText( pOutDev, aRealOutPos, aText, nTextStart, nTextLen, pDXArray ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/impedit3.cxx |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit 8be7a99d214f204063dd1219b058ad0f2417282f Author: matteocam Date: Fri Jun 27 23:16:02 2014 +0200 Removing checks on nDiff and CheckAutoPageSize() Change-Id: I351800be530354c046177fcc7e30f05b146d0893 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index ee2f157..2494838 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -436,7 +436,9 @@ void ImpEditEngine::FormatDoc() { sal_uInt32 nNewHeightNTP; sal_uInt32 nNewHeight = CalcTextHeight( &nNewHeightNTP ); -long nDiff = nNewHeight - nCurTextHeight; +// FIXME(matteocam) +long nDiff = 0; +//long nDiff = nNewHeight - nCurTextHeight; if ( nDiff ) aStatus.GetStatusWord() |= !IsVertical() ? EE_STAT_TEXTHEIGHTCHANGED : EE_STAT_TEXTWIDTHCHANGED; if ( nNewHeight < nCurTextHeight ) @@ -454,7 +456,9 @@ void ImpEditEngine::FormatDoc() nCurTextHeight = nNewHeight; nCurTextHeightNTP = nNewHeightNTP; -if ( aStatus.AutoPageSize() ) +// FIXME(matteocam) +//if ( aStatus.AutoPageSize() ) +if (false) CheckAutoPageSize(); else if ( nDiff ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/impedit3.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit bd71d877553fe854d0f1715637c66065e07a1fbf Author: matteocam Date: Fri Jun 27 22:43:17 2014 +0200 Resuming bgrow Change-Id: I14de859adbf911844e936cb7f90650559f2db8bf diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 314ee87..ee2f157 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -403,8 +403,8 @@ void ImpEditEngine::FormatDoc() pPP->GetLines().Reset(); } } -// FIXME(matteocam) -//bGrow = true; + +bGrow = true; if ( IsCallParaInsertedOrDeleted() ) GetEditEnginePtr()->ParagraphHeightChanged( nPara ); pParaPortion->SetMustRepaint( false ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/impedit3.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 5e9943e2346d42b1bfb1cf25c468cfde9ece74d0 Author: matteocam Date: Fri Jun 27 21:39:49 2014 +0200 Setting bgrow=false in CreateLines Change-Id: I7132f059fd2d817c54283f6f0762fe8ea781aeb6 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 4d4a15b..314ee87 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -403,7 +403,8 @@ void ImpEditEngine::FormatDoc() pPP->GetLines().Reset(); } } -bGrow = true; +// FIXME(matteocam) +//bGrow = true; if ( IsCallParaInsertedOrDeleted() ) GetEditEnginePtr()->ParagraphHeightChanged( nPara ); pParaPortion->SetMustRepaint( false ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits