[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 matteo.campane...@gmail.com 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 editeng/editobj.hxx #include editeng/editdata.hxx +// XXX +#include outleeng.hxx +#include ../editeng/editdoc.hxx + #include com/sun/star/datatransfer/clipboard/XClipboard.hpp @@ -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::vectorEditView* 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 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 matteo.campane...@gmail.com Date: Thu Jul 30 13:48:52 2015 +0200 Change name to post-pastecutting 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 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 matteo.campane...@gmail.com 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::vectorParagraph* 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_castSdrTextObj*(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 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 matteo.campane...@gmail.com 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 editeng/editobj.hxx -// 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); -
[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 matteo.campane...@gmail.com 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) { +
[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 matteo.campane...@gmail.com Date: Mon Jul 13 11:29:58 2015 -0400 Add bLastParaInterrupted to NonOverflowingText Change-Id: Ie6864bfbce088fabd3fba65c3e1313bc2fafcbac diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 2b03d26..a8e5be0 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2131,7 +2131,8 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const { ESelection aEmptySel(0,0,0,0); EditTextObject *pTObj = pEditEngine-CreateTextObject(aEmptySel); -return new NonOverflowingText(pTObj); +bool bLastParaInterrupted = true; // Last Para was interrupted since everything overflew +return new NonOverflowingText(pTObj, bLastParaInterrupted); } else { // Get the lines that of the overflowing para fit in the box sal_Int32 nOverflowingPara = nCount; @@ -2159,7 +2160,12 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const ESelection(nStartPara, nStartPos, nOverflowingPara, nLen); } EditTextObject *pTObj = pEditEngine-CreateTextObject(aNonOverflowingTextSelection); -return new NonOverflowingText(pTObj); + +sal_Int32 nLastLine = GetLineCount(nOverflowingPara)-1; +bool bLastParaInterrupted = +pEditEngine-GetOverflowingLineNum() nLastLine; + +return new NonOverflowingText(pTObj, bLastParaInterrupted); } } diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 339a335..9b6da0a 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -55,12 +55,18 @@ ESelection OverflowingText::GetInsertionPointSel() const // class NonOverflowingText -NonOverflowingText::NonOverflowingText(const EditTextObject *pTObj) -: mpContentTextObj(pTObj-Clone()) +NonOverflowingText::NonOverflowingText(const EditTextObject *pTObj, bool bLastParaInterrupted) +: mpContentTextObj(pTObj-Clone()), + mbLastParaInterrupted(bLastParaInterrupted) { // XXX: may have to delete pTObj } +bool NonOverflowingText::IsLastParaInterrupted() const +{ +return mbLastParaInterrupted; +} + OutlinerParaObject *NonOverflowingText::ToParaObject(Outliner *pOutliner) const { diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 72d2355..449ca5a 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -60,13 +60,15 @@ class NonOverflowingText { public: OutlinerParaObject *ToParaObject(Outliner *) const; ESelection GetOverflowPointSel() const; +bool IsLastParaInterrupted() const; private: // Constructor -NonOverflowingText(const EditTextObject *pTObj); +NonOverflowingText(const EditTextObject *pTObj, bool bLastParaInterrupted); friend class Outliner; const EditTextObject *mpContentTextObj; +const bool mbLastParaInterrupted; }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[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 matteo.campane...@gmail.com 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/overflowingtxt.cxx | 22 +- include/editeng/overflowingtxt.hxx | 12 2 files changed, 29 insertions(+), 5 deletions(-) New commits: commit 6c36f1508baf0089f260e4ad7ddff57532bb125f Author: matteocam matteo.campane...@gmail.com 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 editeng/outlobj.hxx #include editeng/editobj.hxx + +// 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 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 matteo.campane...@gmail.com 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 editeng/macros.hxx #include editeng/editengdllapi.h +#include editeng/editdata.hxx 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
[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 matteo.campane...@gmail.com 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 editeng/overflowingtxt.hxx #include editeng/outliner.hxx #include editeng/outlobj.hxx +#include editeng/editobj.hxx + +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 {
[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 matteo.campane...@gmail.com 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
[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 matteo.campane...@gmail.com 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
[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 matteo.campane...@gmail.com 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/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 matteo.campane...@gmail.com 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 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 matteo.campane...@gmail.com 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 tools/debug.hxx #include editeng/overflowingtxt.hxx +#include editeng/outliner.hxx 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); +
[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 matteo.campane...@gmail.com 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 |3 ++- include/editeng/overflowingtxt.hxx | 12 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) New commits: commit fc30b3010ebcb57a0b2142d15360a55712f6f787 Author: matteocam matteo.campane...@gmail.com 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
editeng/source/outliner/overflowingtxt.cxx | 73 ++--- include/editeng/overflowingtxt.hxx |7 +- 2 files changed, 50 insertions(+), 30 deletions(-) New commits: commit 7dc421a02393f091b741f160e3895b884866cb06 Author: matteocam matteo.campane...@gmail.com 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 editeng/overflowingtxt.hxx #include editeng/outliner.hxx +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/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 matteo.campane...@gmail.com 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 editeng/overflowingtxt.hxx #include editeng/outliner.hxx +#include editeng/outlobj.hxx 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
[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 matteo.campane...@gmail.com 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 editeng/overflowingtxt.hxx -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 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 matteo.campane...@gmail.com 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 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 matteo.campane...@gmail.com Date: Thu Jun 11 12:45:36 2015 -0400 Added Outliner::GetEmptyParaObject Change-Id: I233ad3e908fd69791f8b044d2ab4af2cd65d2484 diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index a4c285b..060e628 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2121,12 +2121,8 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const // Only overflowing text, i.e. 1st line of 1st paragraph overflowing if ( nCount == 0 nOverflowLine == 0) { -EditTextObject *pEmptyText = pEditEngine-GetEmptyTextObject(); -OutlinerParaObject* pPObj = new OutlinerParaObject( *pEmptyText ); -pPObj-SetOutlinerMode(GetMode()); - -delete pEmptyText; -return new NonOverflowingText(pPObj, ); +OutlinerParaObject* pEmptyPObj = GetEmptyParaObject(); +return new NonOverflowingText(pEmptyPObj, ); } else if (nCount 0) { // No overflowing Text: all para-s included nCount = GetParagraphCount(); @@ -2158,6 +2154,16 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const return new NonOverflowingText(pHeadParas, aPreOverflowingTxt); } +OutlinerParaObject *Outliner::GetEmptyParaObject() const +{ +EditTextObject *pEmptyText = pEditEngine-GetEmptyTextObject(); +OutlinerParaObject* pPObj = new OutlinerParaObject( *pEmptyText ); +pPObj-SetOutlinerMode(GetMode()); + +delete pEmptyText; +return pPObj; +} + OverflowingText *Outliner::GetOverflowingText() const { if ( pEditEngine-GetOverflowingParaNum() 0) diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index 76f0157..0cef0cc 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -765,6 +765,8 @@ public: void ClearOverflowingParaNum(); bool IsPageOverflow(); +OutlinerParaObject *GetEmptyParaObject() const; + virtual 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 matteo.campane...@gmail.com 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/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 matteo.campane...@gmail.com 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
[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 matteo.campane...@gmail.com 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) :
[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 matteo.campane...@gmail.com 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 editeng/emphasismarkitem.hxx #include editeng/charscaleitem.hxx #include editeng/charreliefitem.hxx -#include editeng/overflowingtxt.hxx #include sot/exchange.hxx #include sot/formats.hxx @@ -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
[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 matteo.campane...@gmail.com 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::vectorEECharAttrib 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;
[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 matteo.campane...@gmail.com 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 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 matteo.campane...@gmail.com 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 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 matteo.campane...@gmail.com 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 ); +//
[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 matteo.campane...@gmail.com 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
[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 matteo.campane...@gmail.com 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/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 matteo.campane...@gmail.com 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