[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - include/svx svx/source
include/svx/textchainflow.hxx |3 +++ svx/source/svdraw/textchainflow.cxx | 20 2 files changed, 23 insertions(+) New commits: commit bbe782455d41af44bb42f39b7f0a2ffc73af1fb5 Author: matteocam matteo.campane...@gmail.com Date: Mon Jul 6 16:35:38 2015 -0400 Update cursor event Change-Id: Iad5429e73e8a5fdf3ffd6c88759cbcaf772a5a31 diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx index 5489bb1..aa17f1e 100644 --- a/include/svx/textchainflow.hxx +++ b/include/svx/textchainflow.hxx @@ -76,6 +76,9 @@ class TextChainFlow { // -- Private Members -- private: + +void impUpdateCursorEvent(SdrOutliner *, bool); + SdrTextObj *mpTargetLink; SdrTextObj *mpNextLink; diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index 1e63cc7..74f15a1 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -73,6 +73,8 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p bool bIsPageOverflow = pFlowOutl-IsPageOverflow(); +impUpdateCursorEvent(pFlowOutl, bIsPageOverflow); + if (pParamOutl != NULL) { pFlowOutl-SetUpdateMode(bOldUpdateMode); // XXX: Plausibly should be the prev. state @@ -90,6 +92,24 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p } +void TextChainFlow::impUpdateCursorEvent(SdrOutliner *pFlowOutl, bool bIsOverflow) +{ +// XXX: Current implementation might create problems with UF- +// In fact UF causes a + + +if (bIsOverflow) { +bool bCursorOut = true; // XXX: Should have real check +if (bCursorOut) { +GetTextChain()-SetCursorEvent(GetLinkTarget(), + CursorChainingEvent::TO_NEXT_LINK); +} +} else { +GetTextChain()-SetCursorEvent(GetLinkTarget(), + CursorChainingEvent::UNCHANGED); +} +} + void TextChainFlow::CheckForFlowEvents(SdrOutliner *pFlowOutl) { impCheckForFlowEvents(pFlowOutl, 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' - include/svx svx/source
include/svx/svdedxv.hxx |2 +- include/svx/textchain.hxx | 11 +++ svx/source/svdraw/svdedxv.cxx | 31 +++ svx/source/svdraw/textchain.cxx | 13 + 4 files changed, 44 insertions(+), 13 deletions(-) New commits: commit 5d5b0c29b59557ace847ffd34a1aa15220c806cd Author: matteocam matteo.campane...@gmail.com Date: Mon Jul 6 15:57:03 2015 -0400 Adds CursorChainEvent and related code in SdrObjEditView Change-Id: Ife00e7cd5c67ec127961ef7c89f8cf6b3a87f5a5 diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx index 67945b58b..010032e 100644 --- a/include/svx/svdedxv.hxx +++ b/include/svx/svdedxv.hxx @@ -125,7 +125,7 @@ protected: void ImpMacroUp(const Point rUpPos); void ImpMacroDown(const Point rDownPos); - DECL_LINK( BeginPasteOrDropHdl, PasteOrDropInfos* ); +DECL_LINK( BeginPasteOrDropHdl, PasteOrDropInfos* ); DECL_LINK( EndPasteOrDropHdl, PasteOrDropInfos* ); protected: diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx index 8032747..730489b 100644 --- a/include/svx/textchain.hxx +++ b/include/svx/textchain.hxx @@ -32,6 +32,12 @@ namespace rtl { typedef rtl::OUString ChainLinkId; typedef std::map ChainLinkId, ImpChainLinkProperties * LinkPropertiesMap; +enum class CursorChainingEvent +{ +TO_NEXT_LINK, +TO_PREV_LINK, +UNCHANGED +}; class ImpChainLinkProperties { @@ -40,7 +46,9 @@ class ImpChainLinkProperties ImpChainLinkProperties(); +// NOTE: Remember to set default value in contructor when adding field bool bNilChainingEvent; +CursorChainingEvent aCursorEvent; // XXX: replace with enum instead of bool? }; @@ -54,6 +62,9 @@ class TextChain { bool IsLinkInChain(SdrTextObj *) const; SdrTextObj *GetNextLink(SdrTextObj *) const; +CursorChainingEvent GetCursorEvent(SdrTextObj *); +void SetCursorEvent(SdrTextObj *, CursorChainingEvent); + ChainLinkId GetId(SdrTextObj *) const; ImpChainLinkProperties *GetLinkProperties(SdrTextObj *); diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 74a14e1..bc5bfb0 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -51,6 +51,7 @@ #include svx/svdstr.hrc #include svdglob.hxx #include svx/globl3d.hxx +#include svx/textchain.hxx #include editeng/outliner.hxx #include editeng/adjustitem.hxx #include svtools/colorcfg.hxx @@ -495,8 +496,24 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl) // trigger actual chaining pTextObj-onChainingEvent(); +// XXX: this logic could be put in a separate approppriate class /* Cursor motion stuff */ +CursorChainingEvent aCursorEvent = pTextObj-GetTextChain()-GetCursorEvent(pTextObj); +SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain(); +switch (aCursorEvent) { + +case CursorChainingEvent::UNCHANGED: +pOLV-SetSelection(aPreChainingSel); +break; +case CursorChainingEvent::TO_NEXT_LINK: +SdrEndTextEdit(); +SdrBeginTextEdit(pNextLink); +break; +case CursorChainingEvent::TO_PREV_LINK: +// XXX: To be handled +break; +} // Find last Para /* @@ -508,8 +525,6 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl) ESelection aEndSel(nLastParaIndex,nLenLastPara,nLastParaIndex,nLenLastPara); */ -pOLV-SetSelection(aPreChainingSel); - } else { // XXX fprintf(stderr, [OnChaining] No Edit Outliner View\n); @@ -758,7 +773,8 @@ bool SdrObjEditView::SdrBeginTextEdit( pTextEditOutlinerView-ShowCursor(); pTextEditOutliner-SetStatusEventHdl(LINK(this,SdrObjEditView,ImpOutlinerStatusEventHdl)); - pTextEditOutliner-SetChainingEventHdl(LINK(this,SdrObjEditView,ImpChainingEventHdl) ); +if (pTextObj-IsChainable()) + pTextEditOutliner-SetChainingEventHdl(LINK(this,SdrObjEditView,ImpChainingEventHdl) ); #ifdef DBG_UTIL if (pItemBrowser!=nullptr) pItemBrowser-SetDirty(); @@ -808,15 +824,6 @@ bool SdrObjEditView::SdrBeginTextEdit( } } -// FIXME(matteocam) -// XXX: Trying to get to the next text obj directly -if (pTextObj-IsChainable()) { -SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain(); -SdrEndTextEdit(); -SdrBeginTextEdit(pNextLink); -} - - return true; // ran fine, let TextEdit run now } else diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx index 09911f4..37bca69 100644 --- a/svx/source/svdraw/textchain.cxx +++ b/svx/source/svdraw
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - 2 commits - svx/source
svx/source/svdraw/svdedxv.cxx | 14 +- svx/source/svdraw/svdotext.cxx |7 --- 2 files changed, 13 insertions(+), 8 deletions(-) New commits: commit 7f44515aa8ac339757d6fdf3d1ce6fc15849d940 Author: matteocam matteo.campane...@gmail.com Date: Mon Jul 6 16:49:12 2015 -0400 Fixed function name Change-Id: I3187547ac920725e448d9053893c857dbd17d427 diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 61c1593..cc16d53 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -490,13 +490,14 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl) OutlinerView* pOLV = GetTextEditOutlinerView(); if( pTextObj pOLV) { +TextChain *pTextChain = pTextObj-GetTextChain(); // This is true during an underflow-caused overflow (with pEdtOutl-SetText()) -if (GetTextChain()-GetNilChainingEvent(pTextObj)) { +if (pTextChain-GetNilChainingEvent(pTextObj)) { return 0; } // We prevent to trigger further handling of overflow/underflow for pTextObj -GetTextChain()-SetNilChainingEvent(pTextObj, true); +pTextChain-SetNilChainingEvent(pTextObj, true); // Save previous selection pos ESelection aPreChainingSel(pOLV-GetSelection()); @@ -507,7 +508,7 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl) // XXX: this logic could be put in a separate approppriate class /* Cursor motion stuff */ -CursorChainingEvent aCursorEvent = pTextObj-GetTextChain()-GetCursorEvent(pTextObj); +CursorChainingEvent aCursorEvent = pTextChain-GetCursorEvent(pTextObj); SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain(); switch (aCursorEvent) { @@ -534,8 +535,8 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl) ESelection aEndSel(nLastParaIndex,nLenLastPara,nLastParaIndex,nLenLastPara); */ -// XXX: Must be called -GetTextChain()-SetNilChainingEvent(pTextObj, false); +// NOTE: Must be called. Don't let the function return if you set it to true and not reset it +pTextChain-SetNilChainingEvent(pTextObj, false); } else { // XXX fprintf(stderr, [OnChaining] No Edit Outliner View\n); commit f0618282407e22d2486da761af7a8d033babcfdd Author: matteocam matteo.campane...@gmail.com Date: Mon Jul 6 16:47:24 2015 -0400 NilChainingEvents handled in SdrObjEditView Change-Id: I30dd131b849c3a8a97d5a75a61fc013b3d17b89e diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index bc5bfb0..61c1593 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -490,6 +490,14 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl) OutlinerView* pOLV = GetTextEditOutlinerView(); if( pTextObj pOLV) { +// This is true during an underflow-caused overflow (with pEdtOutl-SetText()) +if (GetTextChain()-GetNilChainingEvent(pTextObj)) { +return 0; +} + +// We prevent to trigger further handling of overflow/underflow for pTextObj +GetTextChain()-SetNilChainingEvent(pTextObj, true); + // Save previous selection pos ESelection aPreChainingSel(pOLV-GetSelection()); @@ -498,6 +506,7 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl) // XXX: this logic could be put in a separate approppriate class /* Cursor motion stuff */ + CursorChainingEvent aCursorEvent = pTextObj-GetTextChain()-GetCursorEvent(pTextObj); SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain(); @@ -525,6 +534,8 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl) ESelection aEndSel(nLastParaIndex,nLenLastPara,nLastParaIndex,nLenLastPara); */ +// XXX: Must be called +GetTextChain()-SetNilChainingEvent(pTextObj, false); } else { // XXX fprintf(stderr, [OnChaining] No Edit Outliner View\n); diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 3455c97..531e41c 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1992,12 +1992,6 @@ void SdrTextObj::onChainingEvent() if (!pEdtOutl) return; -// This is true during an underflow-caused overflow (with pEdtOutl-SetText()) -if (GetTextChain()-GetNilChainingEvent(this)) { - -return; -} - // Outliner for text transfer SdrOutliner aDrawOutliner = ImpGetDrawOutliner(); @@ -2027,7 +2021,6 @@ void SdrTextObj::onChainingEvent() } } -GetTextChain()-SetNilChainingEvent(this, false); } ___ Libreoffice-commits mailing list
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
svx/source/svdraw/svdotext.cxx |2 -- 1 file changed, 2 deletions(-) New commits: commit ca45dff10b9ffa6b0272af09c56139fcefa08344 Author: matteocam matteo.campane...@gmail.com Date: Mon Jul 6 16:58:19 2015 -0400 NilChainingEvents handled in SdrObjEditView Change-Id: Ifc52c165b84d12d4b5f677bbfc3f94084678bda1 diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 531e41c..0a33fa4 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1998,8 +1998,6 @@ void SdrTextObj::onChainingEvent() EditingTextChainFlow aTxtChainFlow(this); aTxtChainFlow.CheckForFlowEvents(pEdtOutl); -// We prevent to trigger further handling of overflow/underflow for this SdrTextObj -GetTextChain()-SetNilChainingEvent(this, true); if (aTxtChainFlow.IsOverflow()) { fprintf(stderr, [CHAINING] Overflow going on\n); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
svx/source/svdraw/svdedxv.cxx | 14 ++ 1 file changed, 14 insertions(+) New commits: commit 133b8446a7054505f77e5ad37d959802db7b1122 Author: matteocam matteo.campane...@gmail.com Date: Mon Jul 6 12:52:04 2015 -0400 Move cursor at end of editing space after chaining Change-Id: Idca4d59e8361992aa4574d7833c45bd5ba25f7cc diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 0f4a273..92fd231 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -489,6 +489,20 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl) if( pTextObj ) { pTextObj-onChainingEvent(); + +/* Cursor motion stuff */ +OutlinerView* pOLV = GetTextEditOutlinerView(); + +// Find last Para +const sal_Int32 nParaCount = pTextEditOutliner-GetParagraphCount(); +const sal_Int32 nLastParaIndex = nParaCount 1 ? nParaCount - 1 : 0; +Paragraph* pLastPara = pTextEditOutliner-GetParagraph( nLastParaIndex); +const sal_Int32 nLenLastPara = pTextEditOutliner-GetText(pLastPara).getLength(); +// End of editing space +ESelection aSel = ESelection(nLastParaIndex,nLenLastPara,nLastParaIndex,nLenLastPara); + +pOLV-SetSelection(aSel); + } } return 0; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
svx/source/svdraw/svdedxv.cxx | 16 1 file changed, 12 insertions(+), 4 deletions(-) New commits: commit c97795e6edf9613292b7ccef0283582dd4cbe8a9 Author: matteocam matteo.campane...@gmail.com Date: Mon Jul 6 13:04:09 2015 -0400 Go to previous position Change-Id: Iaa4954ee8a0a99ccdce70653ba5d84ef2acf1c79 diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 92fd231..c775ab1 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -488,20 +488,28 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl) SdrTextObj* pTextObj = dynamic_cast SdrTextObj * ( mxTextEditObj.get() ); if( pTextObj ) { +OutlinerView* pOLV = GetTextEditOutlinerView(); +assert(pOLV); +// Save previous selection pos +ESelection aPreChainingSel(pOLV-GetSelection()); + +// trigger actual chaining pTextObj-onChainingEvent(); /* Cursor motion stuff */ -OutlinerView* pOLV = GetTextEditOutlinerView(); + // Find last Para +/* const sal_Int32 nParaCount = pTextEditOutliner-GetParagraphCount(); const sal_Int32 nLastParaIndex = nParaCount 1 ? nParaCount - 1 : 0; Paragraph* pLastPara = pTextEditOutliner-GetParagraph( nLastParaIndex); const sal_Int32 nLenLastPara = pTextEditOutliner-GetText(pLastPara).getLength(); -// End of editing space -ESelection aSel = ESelection(nLastParaIndex,nLenLastPara,nLastParaIndex,nLenLastPara); +// Selection at end of editing area +ESelection aEndSel(nLastParaIndex,nLenLastPara,nLastParaIndex,nLenLastPara); +*/ -pOLV-SetSelection(aSel); +pOLV-SetSelection(aPreChainingSel); } } ___ 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' - svx/source
svx/source/svdraw/svdedxv.cxx |9 + 1 file changed, 9 insertions(+) New commits: commit 146c0beb1faf6694518aa3b86b7c2d3324734bcd Author: matteocam matteo.campane...@gmail.com Date: Mon Jul 6 15:05:35 2015 -0400 Moving to next box in SdrBeginTextEdit Change-Id: I6dc83a8f2f6a19e5cfa4af083e68b8a6a453d02a diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 34e12d2..74a14e1 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -808,6 +808,15 @@ bool SdrObjEditView::SdrBeginTextEdit( } } +// FIXME(matteocam) +// XXX: Trying to get to the next text obj directly +if (pTextObj-IsChainable()) { +SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain(); +SdrEndTextEdit(); +SdrBeginTextEdit(pNextLink); +} + + return true; // ran fine, let TextEdit run now } else ___ 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' - svx/source
svx/source/svdraw/svdedxv.cxx | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) New commits: commit bc4cc289ad04b6a80f6558c9577950395e8141c6 Author: matteocam matteo.campane...@gmail.com Date: Mon Jul 6 14:47:18 2015 -0400 Set empty chaining link after edit ends. Error msg for OutlView. Change-Id: I693f7a884274de0f98a26b3e4d197501877289af diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index c775ab1..34e12d2 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -486,10 +486,9 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl) if(pTextEditOutliner ) { SdrTextObj* pTextObj = dynamic_cast SdrTextObj * ( mxTextEditObj.get() ); -if( pTextObj ) +OutlinerView* pOLV = GetTextEditOutlinerView(); +if( pTextObj pOLV) { -OutlinerView* pOLV = GetTextEditOutlinerView(); -assert(pOLV); // Save previous selection pos ESelection aPreChainingSel(pOLV-GetSelection()); @@ -511,6 +510,9 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl) pOLV-SetSelection(aPreChainingSel); +} else { +// XXX +fprintf(stderr, [OnChaining] No Edit Outliner View\n); } } return 0; @@ -947,6 +949,8 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally) pTEOutliner-SetBeginPasteOrDropHdl(Link()); pTEOutliner-SetEndPasteOrDropHdl(Link()); +pTEOutliner-SetChainingEventHdl(Link()); + const bool bUndo = IsUndoEnabled(); if( bUndo ) { ___ 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' - svx/source
svx/source/svdraw/svdedxv.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 778373d9408c1a47e8a8511ebd4a7445e5fc3883 Author: matteocam matteo.campane...@gmail.com Date: Mon Jul 6 17:38:13 2015 -0400 Changed parameters to Sdr*TextEdit Change-Id: Ic6faf12a2a0aeea756a25dc82e0d2768bcf39813 diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index cc16d53..8cb9779 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -517,8 +517,8 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl) pOLV-SetSelection(aPreChainingSel); break; case CursorChainingEvent::TO_NEXT_LINK: -SdrEndTextEdit(); -SdrBeginTextEdit(pNextLink); +SdrEndTextEdit(true); +SdrBeginTextEdit(pNextLink, nullptr, nullptr, false, nullptr, nullptr, true, true); break; case CursorChainingEvent::TO_PREV_LINK: // XXX: To be handled ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/outliner.cxx |2 +- editeng/source/outliner/overflowingtxt.cxx | 11 +-- 2 files changed, 10 insertions(+), 3 deletions(-) New commits: commit 20f4c1f5c025afd2afb1abd612753f421186ee39 Author: matteocam matteo.campane...@gmail.com Date: Wed Jul 1 14:15:40 2015 -0400 Fixed Outliner mode issue; Fixed wrong para index Change-Id: I88024bcc8280d017db10570f636f101a25d270b9 diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index bfd4189..63c40a1 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2231,7 +2231,7 @@ OverflowingText *Outliner::GetOverflowingText() const sal_uInt32 nOverflowingPara = pEditEngine-GetOverflowingParaNum(); ESelection aOverflowingTextSel; sal_Int32 nLastPara = nParaCount-1; -sal_Int32 nLastParaLen = GetText(GetParagraph(nOverflowingPara-1)).getLength(); +sal_Int32 nLastParaLen = GetText(GetParagraph(nLastPara-1)).getLength(); aOverflowingTextSel = ESelection(nOverflowingPara, nLen, nLastPara, nLastParaLen); diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 5a7b15c..666f53b 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -28,7 +28,11 @@ OutlinerParaObject *NonOverflowingText::ToParaObject(Outliner *pOutliner) const { if (mpContentTextObj) -return new OutlinerParaObject(*mpContentTextObj); +{ +OutlinerParaObject *pPObj = new OutlinerParaObject(*mpContentTextObj); +pPObj-SetOutlinerMode(pOutliner-GetOutlinerMode()); +return pPObj; +} // XXX: Possibility: let the NonUnderflowingParaObject just be a TextEditObject created by the Outliner (by means of a selection). @@ -99,7 +103,10 @@ OutlinerParaObject *OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou OutlinerParaObject *pOverflowingPObj = new OutlinerParaObject(*mpContentTextObj); pOutl-SetText(*pOverflowingPObj); pOutl-AddText(*pNextPObj); -return pOutl-CreateParaObject(); + +OutlinerParaObject *pPObj = pOutl-CreateParaObject(); +pPObj-SetOutlinerMode(pOutl-GetOutlinerMode()); +return pPObj; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/outliner.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f04017fd48443d1fef48822585fb440945854801 Author: matteocam matteo.campane...@gmail.com Date: Wed Jul 1 14:32:11 2015 -0400 Fixed other wrong para index Change-Id: Ia15a01fa61870753339d6edbf75faa31e85bb602 diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 63c40a1..961f1bd 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2231,7 +2231,7 @@ OverflowingText *Outliner::GetOverflowingText() const sal_uInt32 nOverflowingPara = pEditEngine-GetOverflowingParaNum(); ESelection aOverflowingTextSel; sal_Int32 nLastPara = nParaCount-1; -sal_Int32 nLastParaLen = GetText(GetParagraph(nLastPara-1)).getLength(); +sal_Int32 nLastParaLen = GetText(GetParagraph(nLastPara)).getLength(); aOverflowingTextSel = ESelection(nOverflowingPara, nLen, nLastPara, nLastParaLen); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
svx/source/svdraw/textchainflow.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit a5d68528d27dae37edf7541bd066a38be28a59a5 Author: matteocam matteo.campane...@gmail.com Date: Wed Jul 1 14:49:11 2015 -0400 No more rough setting of outliner attribs in EditingTextChainFlow Change-Id: I4c84699f383bb44981fa3ef23e334ed434900834 diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index 036327c..1e63cc7 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -259,7 +259,7 @@ void EditingTextChainFlow::impSetFlowOutlinerParams(SdrOutliner *pFlowOutl, SdrO pFlowOutl-SetPaperSize(pParamOutl-GetPaperSize()); // Set right text attributes // XXX: Not enough: it does not handle complex attributes -pFlowOutl-SetEditTextObjectPool(pParamOutl-GetEditTextObjectPool()); +//pFlowOutl-SetEditTextObjectPool(pParamOutl-GetEditTextObjectPool()); } /* ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/overflowingtxt.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 720f3bb602d574cea191ffc659c596064be3be74 Author: matteocam matteo.campane...@gmail.com Date: Wed Jul 1 15:24:04 2015 -0400 Moved setting outliner mode Change-Id: I442a08d76fe201a0f26eb4d64a59ae00c9df1fed diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 3e40b92..49284f6 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -57,11 +57,13 @@ OutlinerParaObject *OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou // Simply Juxtaposing; no within-para merging OutlinerParaObject *pOverflowingPObj = new OutlinerParaObject(*mpContentTextObj); +// the OutlinerParaObject constr. at the prev line gives no valid outliner mode, so we set it +pOverflowingPObj-SetOutlinerMode(pOutl-GetOutlinerMode()); pOutl-SetText(*pOverflowingPObj); pOutl-AddText(*pNextPObj); OutlinerParaObject *pPObj = pOutl-CreateParaObject(); -pPObj-SetOutlinerMode(pOutl-GetOutlinerMode()); +//pPObj-SetOutlinerMode(pOutl-GetOutlinerMode()); return pPObj; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng
editeng/source/outliner/outliner.cxx | 64 + editeng/source/outliner/overflowingtxt.cxx | 56 ++--- include/editeng/overflowingtxt.hxx | 31 +- 3 files changed, 22 insertions(+), 129 deletions(-) New commits: commit d82ca32c357d35b3e00379273e695281dafc22e1 Author: matteocam 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
[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); +pOutliner-SetText(*pPObj
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - include/svx svx/source
include/svx/textchainflow.hxx | 30 +--- svx/source/svdraw/svdotext.cxx |1 svx/source/svdraw/textchainflow.cxx | 133 ++-- 3 files changed, 44 insertions(+), 120 deletions(-) New commits: commit ffc855ced5099d07fa71230448ef376fe4ba33e3 Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 30 11:13:09 2015 -0400 Use OFlowChainedText in TextChainFlow Change-Id: I2aaa472590ba90880c545ca767069860623b8089 diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx index 776dc22..3215194 100644 --- a/include/svx/textchainflow.hxx +++ b/include/svx/textchainflow.hxx @@ -26,12 +26,13 @@ class NonOverflowingText; class OverflowingText; class TextChain; class OutlinerParaObject; +class OFlowChainedText; -// XXX: Specialize class for Editing mode and non editing mode? // XXX: const qualifiers? class TextChainFlow { +// -- Public Members -- public: TextChainFlow(SdrTextObj *pChainTarget); virtual ~TextChainFlow(); @@ -39,16 +40,22 @@ class TextChainFlow { // Check for flow events in Outliner virtual void CheckForFlowEvents(SdrOutliner *); -bool IsOverflow(); -bool IsUnderflow(); - void ExecuteUnderflow(SdrOutliner *); // Uses two outliners: one for the non-overfl text and one for overflowing (might be the same) virtual void ExecuteOverflow(SdrOutliner *, SdrOutliner *); -SdrTextObj *GetLinkTarget(); +// Getters + +bool IsOverflow() const; +bool IsUnderflow() const; + +SdrTextObj *GetLinkTarget() const; +SdrTextObj *GetNextLink() const; + +OFlowChainedText *GetOverflowChainedText() const; +// -- Protected Members -- protected: void impCheckForFlowEvents(SdrOutliner *, SdrOutliner *); @@ -62,11 +69,11 @@ class TextChainFlow { OutlinerParaObject *impGetNonOverflowingParaObject(SdrOutliner *pOutliner); OutlinerParaObject *impGetOverflowingParaObject(SdrOutliner *pOutliner); +// impGetMergedUnderflowingParaObject merges underflowing text with the one in the next box +OutlinerParaObject *impGetMergedUnderflowingParaObject(SdrOutliner *pOutliner); +// -- Private Members -- private: - -void impSetOutlinerToEmptyTxt(SdrOutliner *pOutliner); - SdrTextObj *mpTargetLink; SdrTextObj *mpNextLink; @@ -77,8 +84,10 @@ class TextChainFlow { bool bUnderflow; bool bOverflow; -OverflowingText *mpOverflowingTxt; -NonOverflowingText *mpNonOverflowingTxt; +OFlowChainedText *mpOverflChText; + +//OverflowingText *mpOverflowingTxt; +//NonOverflowingText *mpNonOverflowingTxt; OutlinerParaObject *mpUnderflowingPObj; @@ -93,7 +102,6 @@ class EditingTextChainFlow : public TextChainFlow //virtual void ExecuteOverflow(SdrOutliner *, SdrOutliner *) SAL_OVERRIDE; - protected: virtual void impLeaveOnlyNonOverflowingText(SdrOutliner *) SAL_OVERRIDE; diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index d0443fa..fbb76d0 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -50,7 +50,6 @@ #include svx/textchainflow.hxx #include svl/style.hxx #include editeng/editeng.hxx -#include editeng/overflowingtxt.hxx #include svl/itemiter.hxx #include svx/sdr/properties/textproperties.hxx #include vcl/metaact.hxx diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index 1261175..0e4be0b 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -34,8 +34,9 @@ TextChainFlow::TextChainFlow(SdrTextObj *pChainTarget) bUnderflow = bOverflow = false; -mpOverflowingTxt = NULL; -mpNonOverflowingTxt = NULL; +mpOverflChText = NULL; +//mpOverflowingTxt = NULL; +//mpNonOverflowingTxt = NULL; mpUnderflowingPObj = NULL; @@ -86,9 +87,10 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p bUnderflow = !bIsPageOverflow mpNextLink mpNextLink-HasText(); // Set (Non)OverflowingTxt here +mpOverflChText = bOverflow ? new OFlowChainedText(pFlowOutl, mpNextLink-GetOutlinerParaObject()) : NULL; -mpOverflowingTxt = bOverflow ? pFlowOutl-GetOverflowingText() : NULL; -mpNonOverflowingTxt = bOverflow ? pFlowOutl-GetNonOverflowingText() : NULL; +//mpOverflowingTxt = bOverflow ? pFlowOutl-GetOverflowingText() : NULL; +//mpNonOverflowingTxt = bOverflow ? pFlowOutl-GetNonOverflowingText() : NULL; // Set current underflowing text (if any) mpUnderflowingPObj = bUnderflow ? pFlowOutl-CreateParaObject() : NULL; @@ -101,12 +103,12 @@ void TextChainFlow::CheckForFlowEvents(SdrOutliner *pFlowOutl) } -bool TextChainFlow::IsOverflow() +bool TextChainFlow::IsOverflow() const { return bOverflow; } -bool TextChainFlow::IsUnderflow() +bool TextChainFlow::IsUnderflow() const { return bUnderflow; } @@ -178,118 +180,24
[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' - include/svx svx/source
include/svx/textchainflow.hxx |1 + svx/source/svdraw/svdotext.cxx |8 ++-- svx/source/svdraw/textchainflow.cxx |6 +- 3 files changed, 8 insertions(+), 7 deletions(-) New commits: commit 878920775d8a436c16e0553b20783b70b278231c Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 30 12:04:48 2015 -0400 Prevent recursive underflow/overflow calls (for the same object) Change-Id: I76705d41da739e327be0c9a67245da055b77 diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx index 3215194..ce6d728 100644 --- a/include/svx/textchainflow.hxx +++ b/include/svx/textchainflow.hxx @@ -94,6 +94,7 @@ class TextChainFlow { }; +// NOTE: EditingTextChainFlow might be strongly coupled with behavior in SdrTextObj::onChainingEvent class EditingTextChainFlow : public TextChainFlow { public: diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index fbb76d0..948428c 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1975,7 +1975,7 @@ void SdrTextObj::onChainingEvent() // This is true during an underflow-caused overflow (with pEdtOutl-SetText()) if (GetTextChain()-GetNilChainingEvent(this)) { -GetTextChain()-SetNilChainingEvent(this, false); + return; } @@ -1985,6 +1985,8 @@ void SdrTextObj::onChainingEvent() EditingTextChainFlow aTxtChainFlow(this); aTxtChainFlow.CheckForFlowEvents(pEdtOutl); +// We prevent to trigger further handling of overflow/underflow for this SdrTextObj +GetTextChain()-SetNilChainingEvent(this, true); if (aTxtChainFlow.IsOverflow()) { fprintf(stderr, [CHAINING] Overflow going on\n); @@ -2000,11 +2002,13 @@ void SdrTextObj::onChainingEvent() if (bIsOverflowFromUnderflow) { fprintf(stderr, [CHAINING] Overflow going on (underflow induced)\n); // prevents infinite loops when setting text for editing outliner -GetTextChain()-SetNilChainingEvent(const_castSdrTextObj*(this), true); + aTxtChainFlow.ExecuteOverflow(aDrawOutliner, aDrawOutliner); + } } +GetTextChain()-SetNilChainingEvent(this, false); } diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index b3dcd80..93bb2f1 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -122,9 +122,7 @@ void TextChainFlow::ExecuteUnderflow(SdrOutliner *pOutl) OutlinerParaObject *pNextLinkWholeText = mpNextLink-GetOutlinerParaObject(); // making whole text -OutlinerParaObject *pCurText; // XXX: at next line we have editing outliner in editing version -//pCurText = pOutl-CreateParaObject(); - +OutlinerParaObject *pCurText; // We saved this text already pCurText = mpUnderflowingPObj; @@ -183,8 +181,6 @@ OutlinerParaObject *TextChainFlow::impGetNonOverflowingParaObject(SdrOutliner *p return mpOverflChText-CreateNonOverflowingParaObject(pOutliner); } - - SdrTextObj *TextChainFlow::GetLinkTarget() const { return mpTargetLink; ___ 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' - 2 commits - editeng/source include/editeng include/svx svx/source
editeng/source/outliner/outliner.cxx |6 +++ editeng/source/outliner/overflowingtxt.cxx | 23 ++ include/editeng/outliner.hxx |2 + include/editeng/overflowingtxt.hxx | 17 +- include/svx/textchainflow.hxx | 11 +++--- svx/source/svdraw/textchainflow.cxx| 47 - 6 files changed, 67 insertions(+), 39 deletions(-) New commits: commit 191ed1adffa8b33ffdb1b0c18a303c907123 Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 30 13:04:25 2015 -0400 Added UFlowChainedText constructor Change-Id: Iad9542c624148a4d717724a9f6bc7a453c650c90 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 8ccbf6f..533be0d 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -149,6 +149,12 @@ OutlinerParaObject *OFlowChainedText::CreateNonOverflowingParaObject(Outliner *p return pOutliner-CreateParaObject(); } + +UFlowChainedText::UFlowChainedText(Outliner *pOutl) +{ +mpUnderflowPObj = pOutl-CreateParaObject(); +} + OutlinerParaObject *UFlowChainedText::CreateMergedUnderflowParaObject(Outliner *pOutl, OutlinerParaObject *pNextLinkWholeText) { OutlinerParaObject *pCurText = mpUnderflowPObj; commit fa9b4a5d9782252417a89a1ba8ccdf6b3d93485b Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 30 13:02:34 2015 -0400 UFlowChainedText used to deal with underflow Change-Id: I6942b09f016756a81f411ba27ba3f7fcc2fa1aa1 diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 060e628..e63c7ff 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -415,6 +415,12 @@ OutlinerParaObject* Outliner::CreateParaObject( sal_Int32 nStartPara, sal_Int32 return pPObj; } +void Outliner::SetToEmptyText() +{ +OutlinerParaObject *pEmptyTxt = GetEmptyParaObject(); +SetText(*pEmptyTxt); +} + void Outliner::SetText( const OUString rText, Paragraph* pPara ) { DBG_ASSERT(pPara,SetText:No Para); diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 9e1ee3d..8ccbf6f 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -71,7 +71,7 @@ OutlinerParaObject *OFlowChainedText::CreateOverflowingParaObject(Outliner *pOut if (pOldPara0) { //pOutliner-Clear(); // you need a clear outliner here -impSetOutlinerToEmptyTxt(pOutliner); +pOutliner-SetToEmptyText(); pTmpPara0 = pOutliner-GetParagraph(0); pOutliner-SetText(mpOverflowingTxt-GetEndingLines() + aOldPara0Txt, pTmpPara0); @@ -84,7 +84,7 @@ OutlinerParaObject *OFlowChainedText::CreateOverflowingParaObject(Outliner *pOut // start actual composition //pOutliner-Clear(); -impSetOutlinerToEmptyTxt(pOutliner); +pOutliner-SetToEmptyText(); // Set headText at the beginning of box OUString aHeadTxt = mpOverflowingTxt-GetHeadingLines(); @@ -127,7 +127,7 @@ OutlinerParaObject *OFlowChainedText::CreateNonOverflowingParaObject(Outliner *p } else { // We have to include the non-overflowing lines from the overfl. para // first make a ParaObject for the strings -impSetOutlinerToEmptyTxt(pOutliner); +pOutliner-SetToEmptyText(); Paragraph *pTmpPara0 = pOutliner-GetParagraph(0); pOutliner-SetText(mpNonOverflowingTxt-mPreOverflowingTxt, pTmpPara0); OutlinerParaObject *pPObj = pOutliner-CreateParaObject(); @@ -149,11 +149,16 @@ OutlinerParaObject *OFlowChainedText::CreateNonOverflowingParaObject(Outliner *p return pOutliner-CreateParaObject(); } -void OFlowChainedText::impSetOutlinerToEmptyTxt(Outliner *pOutliner) +OutlinerParaObject *UFlowChainedText::CreateMergedUnderflowParaObject(Outliner *pOutl, OutlinerParaObject *pNextLinkWholeText) { -OutlinerParaObject *pEmptyTxt = pOutliner-GetEmptyParaObject(); -pOutliner-SetText(*pEmptyTxt); -} +OutlinerParaObject *pCurText = mpUnderflowPObj; + +// NewTextForCurBox = Txt(CurBox) ++ Txt(NextBox) +pOutl-SetText(*pCurText); +pOutl-AddText(*pNextLinkWholeText); +OutlinerParaObject *pNewText = pOutl-CreateParaObject(); +return pNewText; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index 0cef0cc..ffbb1b7 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -698,6 +698,8 @@ public: voidSetText( const OUString rText, Paragraph* pParagraph ); OUStringGetText( Paragraph* pPara, sal_Int32 nParaCount=1 ) const; +voidSetToEmptyText(); + OutlinerParaObject* CreateParaObject( sal_Int32 nStartPara = 0, sal_Int32 nParaCount = EE_PARA_ALL ) const; const
[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' - include/editeng
include/editeng/overflowingtxt.hxx | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) New commits: commit 5ef201c3a2016105bdc7795620e34ec36c44ed87 Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 30 16:41:34 2015 -0400 Change access properties of Overflow classes Change-Id: I1ec816f7fe4d0aa0b25b6cacba6f84eb6b3c595b diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 8f67004..b559921 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -34,7 +34,7 @@ typedef EditTextObject FormattedTextPortion; -class EDITENG_DLLPUBLIC OverflowingText +class OverflowingText { public: @@ -58,10 +58,9 @@ public: bool HasOtherParas() const { return !(mTailTxt == mpMidParas == NULL); } }; -class EDITENG_DLLPUBLIC NonOverflowingText { +class NonOverflowingText { public: -const OutlinerParaObject *mpHeadParas; -OUString mPreOverflowingTxt; + // NOTE: mPreOverflowingTxt might be empty // Constructor @@ -76,6 +75,10 @@ class EDITENG_DLLPUBLIC NonOverflowingText { } OutlinerParaObject *ToParaObject(Outliner *) const; + +private: +const OutlinerParaObject *mpHeadParas; +OUString mPreOverflowingTxt; }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/editeng svx/source
editeng/source/outliner/outliner.cxx | 21 editeng/source/outliner/overflowingtxt.cxx |4 ++ include/editeng/overflowingtxt.hxx | 48 + svx/source/svdraw/textchainflow.cxx|1 4 files changed, 48 insertions(+), 26 deletions(-) New commits: commit 70a2ad32027cb16163e6075a994a4a5ffc47e551 Author: matteocam 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' - svx/source
svx/source/svdraw/textchainflow.cxx | 306 1 file changed, 306 insertions(+) New commits: commit e0783b00219987051add4c71ebf2319e4fa70fc1 Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 29 06:24:22 2015 -0400 Introduced a check before setting (non)overflowing text Change-Id: I23db9ed9c558486df1ddcd6c5680e6b6f90b447a diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx new file mode 100644 index 000..e759387 --- /dev/null +++ b/svx/source/svdraw/textchainflow.cxx @@ -0,0 +1,306 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + + +#include svx/textchain.hxx +#include svx/svdotext.hxx +#include svx/svdoutl.hxx +#include editeng/outlobj.hxx +#include editeng/overflowingtxt.hxx +#include svx/textchainflow.hxx + +TextChainFlow::TextChainFlow(SdrTextObj *pChainTarget) +: mpTargetLink(pChainTarget) +{ +mpTextChain = mpTargetLink-GetTextChain(); +mpNextLink = mpTargetLink-GetNextLinkInChain(); +bCheckedFlowEvents = false; + +bUnderflow = bOverflow = false; + +mpOverflowingTxt = NULL; +mpNonOverflowingTxt = NULL; + +mpUnderflowingPObj = NULL; + +// XXX: Set the next link here? + + +} + + +TextChainFlow::~TextChainFlow() +{ + +} + +/* + * Check for overflow in the state of pFlowOutl. + * If pParamOutl is not NULL sets some parameters from there. + * This is useful in case the outliner is not set for overflow + * (e.g. in editing mode we check for overflow in drawing outl but + * parameters come from editing outliner) +*/ +void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *pParamOutl) +{ +// NOTE: Nah you probably don't need this +if (pParamOutl != NULL) +{ +// XXX: Set parameters +// XXX: does this work if you do it before setting the text? +pFlowOutl-SetUpdateMode(true); +pFlowOutl-SetMaxAutoPaperSize(pParamOutl-GetMaxAutoPaperSize()); +pFlowOutl-SetMinAutoPaperSize(pParamOutl-GetMinAutoPaperSize()); +pFlowOutl-SetPaperSize(pParamOutl-GetPaperSize()); +} + +bool bIsPageOverflow = pFlowOutl-IsPageOverflow(); + +// NOTE: overflow and underflow cannot be both true +bOverflow = bIsPageOverflow mpNextLink; +bUnderflow = !bIsPageOverflow mpNextLink mpNextLink-HasText(); + +// Set (Non)OverflowingTxt here + +mpOverflowingTxt = bOverflow ? pFlowOutl-GetOverflowingText() : NULL; +mpNonOverflowingTxt = bOverflow ? pFlowOutl-GetNonOverflowingText() : NULL; + +// Set current underflowing text (if any) +mpUnderflowingPObj = bUnderflow ? pFlowOutl-CreateParaObject() : NULL; + +} + +void TextChainFlow::CheckForFlowEvents(SdrOutliner *pFlowOutl) +{ +impCheckForFlowEvents(pFlowOutl, NULL); +} + + +bool TextChainFlow::IsOverflow() +{ +return bOverflow; +} + +bool TextChainFlow::IsUnderflow() +{ +return bUnderflow; +} + + +// XXX: In editing mode you need to get underflowing text from editing outliner, so it's kinda separate from the drawing one! + +// XXX:Would it be possible to unify undeflow and its possibly following overrflow? +void TextChainFlow::ExecuteUnderflow(SdrOutliner *pOutl) +{ +OutlinerParaObject *pNextLinkWholeText = mpNextLink-GetOutlinerParaObject(); + +// making whole text +OutlinerParaObject *pCurText; // XXX: at next line we have editing outliner in editing version +//pCurText = pOutl-CreateParaObject(); + +// We saved this text already +pCurText = mpUnderflowingPObj; + +// NewTextForCurBox = Txt(CurBox) ++ Txt(NextBox) +pOutl-SetText(*pCurText); +pOutl-AddText(*pNextLinkWholeText); +OutlinerParaObject *pNewText = pOutl-CreateParaObject(); + +// Set the other box empty so if overflow does not occur we are fine +if (!mpTargetLink-GetPreventChainable()) +mpNextLink-NbcSetOutlinerParaObject(pOutl-GetEmptyParaObject()); + +mpTargetLink-NbcSetOutlinerParaObject(pNewText); + +// Check for new overflow +CheckForFlowEvents(pOutl); // XXX: How do you know you don't need to set parameters here? +} + +void
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
svx/source/svdraw/textchainflow.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit b6b90d8d4e5b37c89fc66a68bbcd62cb62aa0830 Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 29 07:40:40 2015 -0400 Setting update=false in chaining Change-Id: I1be2c97d74870bc2934e8cdd50a8d4cc985d02ec diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index e759387..ec5dc9a 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -72,6 +72,11 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p bool bIsPageOverflow = pFlowOutl-IsPageOverflow(); +if (pParamOutl != NULL) +{ +pFlowOutl-SetUpdateMode(false); // XXX: Plausibly should be the prev. state +} + // NOTE: overflow and underflow cannot be both true bOverflow = bIsPageOverflow mpNextLink; bUnderflow = !bIsPageOverflow mpNextLink mpNextLink-HasText(); ___ 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' - include/svx svx/source
include/svx/textchainflow.hxx | 15 ++--- svx/source/svdraw/textchainflow.cxx | 40 ++-- 2 files changed, 46 insertions(+), 9 deletions(-) New commits: commit f175965e22c57565ee2ffd2105b4c26a817835ca Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 29 13:59:33 2015 -0400 Moved editing-specific code Change-Id: I9fa410a60fb6341c5f031cc152141c03975b409e diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx index 8528a9f..10ba90a 100644 --- a/include/svx/textchainflow.hxx +++ b/include/svx/textchainflow.hxx @@ -45,7 +45,7 @@ class TextChainFlow { void ExecuteUnderflow(SdrOutliner *); // Uses two outliners: one for the non-overfl text and one for overflowing (might be the same) -void ExecuteOverflow(SdrOutliner *, SdrOutliner *); +virtual void ExecuteOverflow(SdrOutliner *, SdrOutliner *); SdrTextObj *GetLinkTarget(); @@ -55,8 +55,8 @@ class TextChainFlow { TextChain *GetTextChain(); -void impLeaveOnlyNonOverflowingText(SdrOutliner *); -void impMoveChainedTextToNextLink(SdrOutliner *); +virtual void impLeaveOnlyNonOverflowingText(SdrOutliner *); +virtual void impMoveChainedTextToNextLink(SdrOutliner *); OutlinerParaObject *impGetNonOverflowingParaObject(SdrOutliner *pOutliner); OutlinerParaObject *impGetOverflowingParaObject(SdrOutliner *pOutliner); @@ -88,6 +88,15 @@ class EditingTextChainFlow : public TextChainFlow public: EditingTextChainFlow(SdrTextObj *); virtual void CheckForFlowEvents(SdrOutliner *) SAL_OVERRIDE; + +//virtual void ExecuteOverflow(SdrOutliner *, SdrOutliner *) SAL_OVERRIDE; + + +protected: +virtual void impLeaveOnlyNonOverflowingText(SdrOutliner *) SAL_OVERRIDE; + +virtual void impSetTextForEditingOutliner(OutlinerParaObject *); + }; #endif // INCLUDED_SVX_TEXTCHAINFLOW_HXX diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index ec5dc9a..652e803 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -63,7 +63,7 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p if (pParamOutl != NULL) { // XXX: Set parameters -// XXX: does this work if you do it before setting the text? +// XXX: does this work if you do it before setting the text? Seems so. pFlowOutl-SetUpdateMode(true); pFlowOutl-SetMaxAutoPaperSize(pParamOutl-GetMaxAutoPaperSize()); pFlowOutl-SetMinAutoPaperSize(pParamOutl-GetMinAutoPaperSize()); @@ -152,15 +152,11 @@ void TextChainFlow::ExecuteOverflow(SdrOutliner *pNonOverflOutl, SdrOutliner *pO void TextChainFlow::impLeaveOnlyNonOverflowingText(SdrOutliner *pNonOverflOutl) { OutlinerParaObject *pNewText = impGetNonOverflowingParaObject(pNonOverflOutl); - -// XXX -if (mpTargetLink-pEdtOutl != NULL) { -mpTargetLink-pEdtOutl-SetText(*pNewText); -} // adds it to current outliner anyway (useful in static decomposition) pNonOverflOutl-SetText(*pNewText); mpTargetLink-NbcSetOutlinerParaObject(pNewText); + } void TextChainFlow::impMoveChainedTextToNextLink(SdrOutliner *pOverflOutl) @@ -308,4 +304,36 @@ void EditingTextChainFlow::CheckForFlowEvents(SdrOutliner *pFlowOutl) } +/* +void EditingTextChainFlow::ExecuteOverflow(SdrOutliner *pOutl1, SdrOutliner *pOutl2) +{ + + +impSetTextForEditingOutliner + +// Set cursor +pEditView-pImpEditView-SetEditSelection( aCurSel ); +pEditView-pImpEditView-DrawSelection(); +pEditView-ShowCursor( true, false ); + + +} +* +* */ + +void EditingTextChainFlow::impLeaveOnlyNonOverflowingText(SdrOutliner *pNonOverflOutl) +{ +OutlinerParaObject *pNewText = impGetNonOverflowingParaObject(pNonOverflOutl); +impSetTextForEditingOutliner(pNewText); + +GetLinkTarget()-NbcSetOutlinerParaObject(pNewText); +} + +void EditingTextChainFlow::impSetTextForEditingOutliner(OutlinerParaObject *pNewText) +{ +if (GetLinkTarget()-pEdtOutl != NULL) { +GetLinkTarget()-pEdtOutl-SetText(*pNewText); +} +} + /* 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' - svx/source
svx/source/svdraw/svdotxed.cxx |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) New commits: commit d5baf1b5b2c7b703bf5fdeeb1a7852fbc6a04baa Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 29 18:05:07 2015 -0400 Disable AutoPageSize only if object is chainable in BegTextEdit Change-Id: I75d4497e2876f35dfc42847787f513cf2bff6a89 diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index 3487cd5..b8059af 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -64,10 +64,9 @@ bool SdrTextObj::BegTextEdit(SdrOutliner rOutl) } // FIXME(matteocam) -bool bIsChained = true; // XXX: get it from a method -// What is this?? + // disable AUTOPAGESIZE -if ( bIsChained ) { +if ( IsChainable() ) { sal_uIntPtr nStat1=rOutl.GetControlWord(); nStat1 =~EE_CNTRL_AUTOPAGESIZE; rOutl.SetControlWord(nStat1); ___ 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' - include/svx svx/source
include/svx/textchainflow.hxx |4 svx/source/svdraw/textchainflow.cxx | 23 +++ 2 files changed, 23 insertions(+), 4 deletions(-) New commits: commit 88c71f468817eac65a17b6a56e729661b4365704 Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 29 18:28:14 2015 -0400 Drawing outliner's item pool set to that of editing outl Change-Id: I5ba711fda7df498e0405f351eca953db615e232b diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx index 10ba90a..776dc22 100644 --- a/include/svx/textchainflow.hxx +++ b/include/svx/textchainflow.hxx @@ -58,6 +58,8 @@ class TextChainFlow { virtual void impLeaveOnlyNonOverflowingText(SdrOutliner *); virtual void impMoveChainedTextToNextLink(SdrOutliner *); +virtual void impSetFlowOutlinerParams(SdrOutliner *, SdrOutliner *); + OutlinerParaObject *impGetNonOverflowingParaObject(SdrOutliner *pOutliner); OutlinerParaObject *impGetOverflowingParaObject(SdrOutliner *pOutliner); @@ -97,6 +99,8 @@ class EditingTextChainFlow : public TextChainFlow virtual void impSetTextForEditingOutliner(OutlinerParaObject *); +virtual void impSetFlowOutlinerParams(SdrOutliner *, SdrOutliner *) SAL_OVERRIDE; + }; #endif // INCLUDED_SVX_TEXTCHAINFLOW_HXX diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index 652e803..723c7f7 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -50,6 +50,11 @@ TextChainFlow::~TextChainFlow() } +void TextChainFlow::impSetFlowOutlinerParams(SdrOutliner *, SdrOutliner *) +{ +// Nothing to do if not in editing mode +} + /* * Check for overflow in the state of pFlowOutl. * If pParamOutl is not NULL sets some parameters from there. @@ -59,22 +64,21 @@ TextChainFlow::~TextChainFlow() */ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *pParamOutl) { +bool bOldUpdateMode = pFlowOutl-GetUpdateMode(); // NOTE: Nah you probably don't need this if (pParamOutl != NULL) { // XXX: Set parameters // XXX: does this work if you do it before setting the text? Seems so. pFlowOutl-SetUpdateMode(true); -pFlowOutl-SetMaxAutoPaperSize(pParamOutl-GetMaxAutoPaperSize()); -pFlowOutl-SetMinAutoPaperSize(pParamOutl-GetMinAutoPaperSize()); -pFlowOutl-SetPaperSize(pParamOutl-GetPaperSize()); + impSetFlowOutlinerParams(pFlowOutl, pParamOutl); } bool bIsPageOverflow = pFlowOutl-IsPageOverflow(); if (pParamOutl != NULL) { -pFlowOutl-SetUpdateMode(false); // XXX: Plausibly should be the prev. state +pFlowOutl-SetUpdateMode(bOldUpdateMode); // XXX: Plausibly should be the prev. state } // NOTE: overflow and underflow cannot be both true @@ -336,4 +340,15 @@ void EditingTextChainFlow::impSetTextForEditingOutliner(OutlinerParaObject *pNew } } +void EditingTextChainFlow::impSetFlowOutlinerParams(SdrOutliner *pFlowOutl, SdrOutliner *pParamOutl) +{ +// Set right size for overflow +pFlowOutl-SetMaxAutoPaperSize(pParamOutl-GetMaxAutoPaperSize()); +pFlowOutl-SetMinAutoPaperSize(pParamOutl-GetMinAutoPaperSize()); +pFlowOutl-SetPaperSize(pParamOutl-GetPaperSize()); + +// Set right text attributes +pFlowOutl-SetEditTextObjectPool(pParamOutl-GetEditTextObjectPool()); +} + /* 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' - include/svx svx/source
include/svx/svdotext.hxx|8 - svx/source/svdraw/svdotext.cxx | 110 -- svx/source/svdraw/svdotextdecomposition.cxx | 211 3 files changed, 6 insertions(+), 323 deletions(-) New commits: commit ac2de02674bd624064a4875894d4f1e18134e420 Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 29 04:33:56 2015 -0400 Cleaned text transferring code in SdrTextObj class Change-Id: I9dbd71749bce1643bbdbd119463dd584cb235156 diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index 6e81767..dee2912 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -326,10 +326,6 @@ protected: virtual ~SdrTextObj(); -virtual void onOverflowStatusEvent( ); -virtual void onUnderflowStatusEvent( ); - - public: TYPEINFO_OVERRIDE(); @@ -622,10 +618,6 @@ public: const drawinglayer::primitive2d::SdrChainedTextPrimitive2D rSdrChainedTextPrimitive, const drawinglayer::geometry::ViewInformation2D aViewInformation) const; -void impMoveChainedTextToNextLink(SdrOutliner *pOutliner, SdrTextObj *pNextTextObj) const; -OutlinerParaObject *impGetOverflowingParaObject(SdrOutliner *pOutliner, SdrTextObj *pNextTextObj) const; -void impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const; -OutlinerParaObject *impGetNonOverflowingParaObject(SdrOutliner *pOutliner) const; // timing generators void impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList rAnimList) const; diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index b3b7332..d0443fa 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1966,82 +1966,8 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus ) } } -void SdrTextObj::onOverflowStatusEvent( ) -{ -// Pushes text in next link on the fly -if ( mbToBeChained ) { -SdrOutliner aDrawOutliner = ImpGetDrawOutliner(); - - if (pEdtOutl != NULL) -mpOverflowingText = pEdtOutl-GetOverflowingText(); -else { -assert(0); // Should never happen. FIXME(matteocam) -} - -SdrTextObj *pNextTextObj = GetNextLinkInChain(); - -impLeaveOnlyNonOverflowingText(aDrawOutliner); - -// Transfer overflowing text -impMoveChainedTextToNextLink(aDrawOutliner, pNextTextObj); -} -} - -void SdrTextObj::onUnderflowStatusEvent( ) -{ -SdrTextObj *pNextLink = GetNextLinkInChain(); -SdrOutliner aDrawOutliner = ImpGetDrawOutliner(); - -if (!pNextLink-HasText()) -return; - -// Get the text of the other guy and add it to the last paragraph -// XXX: For now it's not merging anything just adding the while thing as a separate para -OutlinerParaObject *pNextLinkWholeText = pNextLink-GetOutlinerParaObject(); -if (!pNextLinkWholeText) -return; - -OutlinerParaObject *pCurText; - -pCurText = pEdtOutl-CreateParaObject(); - -// NewTextForCurBox = Txt(CurBox) ++ Txt(NextBox) -// prepare for checking overflow -aDrawOutliner.SetUpdateMode(true); -aDrawOutliner.SetMaxAutoPaperSize(pEdtOutl-GetMaxAutoPaperSize()); -aDrawOutliner.SetMinAutoPaperSize(pEdtOutl-GetMinAutoPaperSize()); -aDrawOutliner.SetPaperSize(pEdtOutl-GetPaperSize()); -aDrawOutliner.SetText(*pCurText); -aDrawOutliner.AddText(*pNextLinkWholeText); - -bool bIsOverflowFromUnderflow = aDrawOutliner.IsPageOverflow(); -// Save mpOverflowingText (important for overflow handlers below) // XXX: Change the wayt this is done? -if (bIsOverflowFromUnderflow) -mpOverflowingText = aDrawOutliner.GetOverflowingText(); - -OutlinerParaObject *pNewText = aDrawOutliner.CreateParaObject(); - -// Set the other box empty so if overflow does not occur we are fine -pNextLink-NbcSetOutlinerParaObject(aDrawOutliner.GetEmptyParaObject()); - -// handle overflow -if (bIsOverflowFromUnderflow) { -// prevents infinite loops when setting text for editing outliner -GetTextChain()-SetNilChainingEvent(const_castSdrTextObj*(this), true); - -impLeaveOnlyNonOverflowingText(aDrawOutliner); -impMoveChainedTextToNextLink(aDrawOutliner, pNextLink); -} else { -// No overflow: set the whole thing -const_castSdrTextObj*(this)-SetOutlinerParaObject(pNewText); -} -} - - void SdrTextObj::onChainingEvent() { - - if (!IsChainable() || GetNextLinkInChain() == NULL) return; @@ -2057,56 +1983,28 @@ void SdrTextObj::onChainingEvent() // Outliner for text transfer SdrOutliner aDrawOutliner = ImpGetDrawOutliner(); -// XXX: Specializing the class? -// OBS: you don't need all the setting parameters crap for underflow with this EditingTextChainFlow aTxtChainFlow(this); aTxtChainFlow.CheckForFlowEvents(pEdtOutl); if (aTxtChainFlow.IsOverflow
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - include/svx
include/svx/textchainflow.hxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit f438fe420349da7e656b6a44110cf1d7b377caec Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 29 02:40:13 2015 -0400 Saving current underflowing text at underflowing time Change-Id: I62d05e4682d8145ac3f3e825eaf14ff653c453a5 diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx index d76f371..1ae66f2 100644 --- a/include/svx/textchainflow.hxx +++ b/include/svx/textchainflow.hxx @@ -25,6 +25,7 @@ class SdrOutliner; class NonOverflowingText; class OverflowingText; class TextChain; +class OutlinerParaObject; // XXX: Specialize class for Editing mode and non editing mode? // XXX: const qualifiers? @@ -71,6 +72,8 @@ class TextChainFlow { OverflowingText *mpOverflowingTxt; NonOverflowingText *mpNonOverflowingTxt; +OutlinerParaObject *mpUnderflowingPObj; + }; #endif // INCLUDED_SVX_TEXTCHAINFLOW_HXX ___ 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' - include/svx svx/source
include/svx/textchainflow.hxx |2 + svx/source/svdraw/svdotext.cxx | 42 svx/source/svdraw/svdotextdecomposition.cxx |3 +- 3 files changed, 46 insertions(+), 1 deletion(-) New commits: commit cb012b74d38f963f89eb1e16c6687e8f63f7bddb Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 29 02:19:38 2015 -0400 TextChainFlow used for OF/UF in editing mode too Change-Id: If894d1e27240d5c7c7b37ed5cfcf2a9b468c81db diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx index e581965..d76f371 100644 --- a/include/svx/textchainflow.hxx +++ b/include/svx/textchainflow.hxx @@ -41,6 +41,8 @@ class TextChainFlow { bool IsUnderflow(); void ExecuteUnderflow(SdrOutliner *); + +// Uses two outliners: one for the non-overfl text and one for overflowing (might be the same) void ExecuteOverflow(SdrOutliner *, SdrOutliner *); protected: diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 1e8d526..8b47a40 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2040,6 +2040,8 @@ void SdrTextObj::onUnderflowStatusEvent( ) void SdrTextObj::onChainingEvent() { + + if (!IsChainable() || GetNextLinkInChain() == NULL) return; @@ -2052,6 +2054,46 @@ void SdrTextObj::onChainingEvent() return; } +// Outliner for text transfer +SdrOutliner aDrawOutliner = ImpGetDrawOutliner(); + +// XXX: Specializing the class? +// OBS: you don't need all the setting parameters crap for underflow with this +TextChainFlow aTxtChainFlow(this); +aTxtChainFlow.CheckForFlowEvents(pEdtOutl, NULL); + + +if (aTxtChainFlow.IsOverflow()) { +fprintf(stderr, Overflow going on\n); + +// One outliner is for non-overflowing text, the other for overflowing text +// In this case they can both be the drawing outliner +aTxtChainFlow.ExecuteOverflow(aDrawOutliner, aDrawOutliner); +} else if (aTxtChainFlow.IsUnderflow()) { +fprintf(stderr, Underflow going on\n); +// underflow-induced overflow +aTxtChainFlow.ExecuteUnderflow(aDrawOutliner); +bool bIsOverflowFromUnderflow = aTxtChainFlow.IsOverflow(); + +// handle overflow +if (bIsOverflowFromUnderflow) { +fprintf(stderr, Overflow going on (underflow induced)\n); +// prevents infinite loops when setting text for editing outliner +GetTextChain()-SetNilChainingEvent(const_castSdrTextObj*(this), true); + +aTxtChainFlow.ExecuteOverflow(aDrawOutliner, aDrawOutliner); +} +// Probably not necessary +//else { +//// No overflow: set the whole thing +//const_castSdrTextObj*(this)-SetOutlinerParaObject(pNewText); +//} +} + +return; + +// Begin old code + bool bIsPageOverflow; bIsPageOverflow = pEdtOutl-IsPageOverflow(); diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 2ba2012..0479632 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -1654,6 +1654,7 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( aTxtChainFlow.ExecuteUnderflow(rOutliner); bIsOverflow = aTxtChainFlow.IsOverflow(); } else { +// standard overflow (no underlow before) bIsOverflow = aTxtChainFlow.IsOverflow(); } @@ -1662,7 +1663,7 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( SdrOutliner rChainingOutl = pModel-GetChainingOutliner(this); ImpInitDrawOutliner( rChainingOutl ); rChainingOutl.SetUpdateMode(true); - +// We must pass the chaining outliner otherwise we would mess up decomposition aTxtChainFlow.ExecuteOverflow(rOutliner, rChainingOutl); } ___ 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' - include/svx svx/source
include/svx/svdotext.hxx|1 + include/svx/textchainflow.hxx | 18 -- svx/source/svdraw/svdotext.cxx |6 +++--- svx/source/svdraw/svdotextdecomposition.cxx |2 +- 4 files changed, 21 insertions(+), 6 deletions(-) New commits: commit f1d992435c64257114a68fb4c02e4379ea745b48 Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 29 03:55:31 2015 -0400 Using EditingTextChainFlow in editing mode Change-Id: Id49b9ed246e40436287e557b8218761f92127e49 diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index b5dde0f..6e81767 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -139,6 +139,7 @@ private: friend classTextChain; friend classTextChainFlow; +friend classEditingTextChainFlow; // CustomShapeproperties need to access the bTextFrame member: friend class sdr::properties::CustomShapeProperties; diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx index 1ae66f2..8528a9f 100644 --- a/include/svx/textchainflow.hxx +++ b/include/svx/textchainflow.hxx @@ -34,9 +34,10 @@ class TextChainFlow { public: TextChainFlow(SdrTextObj *pChainTarget); -~TextChainFlow(); +virtual ~TextChainFlow(); -void CheckForFlowEvents(SdrOutliner *, SdrOutliner *); +// Check for flow events in Outliner +virtual void CheckForFlowEvents(SdrOutliner *); bool IsOverflow(); bool IsUnderflow(); @@ -46,7 +47,12 @@ class TextChainFlow { // Uses two outliners: one for the non-overfl text and one for overflowing (might be the same) void ExecuteOverflow(SdrOutliner *, SdrOutliner *); +SdrTextObj *GetLinkTarget(); + protected: + +void impCheckForFlowEvents(SdrOutliner *, SdrOutliner *); + TextChain *GetTextChain(); void impLeaveOnlyNonOverflowingText(SdrOutliner *); @@ -76,6 +82,14 @@ class TextChainFlow { }; + +class EditingTextChainFlow : public TextChainFlow +{ +public: +EditingTextChainFlow(SdrTextObj *); +virtual void CheckForFlowEvents(SdrOutliner *) SAL_OVERRIDE; +}; + #endif // INCLUDED_SVX_TEXTCHAINFLOW_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 8b47a40..b3b7332 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2059,8 +2059,8 @@ void SdrTextObj::onChainingEvent() // XXX: Specializing the class? // OBS: you don't need all the setting parameters crap for underflow with this -TextChainFlow aTxtChainFlow(this); -aTxtChainFlow.CheckForFlowEvents(pEdtOutl, NULL); +EditingTextChainFlow aTxtChainFlow(this); +aTxtChainFlow.CheckForFlowEvents(pEdtOutl); if (aTxtChainFlow.IsOverflow()) { @@ -2082,7 +2082,7 @@ void SdrTextObj::onChainingEvent() GetTextChain()-SetNilChainingEvent(const_castSdrTextObj*(this), true); aTxtChainFlow.ExecuteOverflow(aDrawOutliner, aDrawOutliner); -} +} // XXX: For the code below // Probably not necessary //else { //// No overflow: set the whole thing diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 0479632..cd107d5 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -1646,7 +1646,7 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( TextChainFlow aTxtChainFlow(const_castSdrTextObj*(this)); bool bIsOverflow; -aTxtChainFlow.CheckForFlowEvents(rOutliner, NULL); // seconod parameter is to check whether you have to prepare the outliner's parameters +aTxtChainFlow.CheckForFlowEvents(rOutliner); if (aTxtChainFlow.IsUnderflow() !IsInEditMode()) { ___ 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' - include/svx svx/source
include/svx/svdotext.hxx |2 + include/svx/textchainflow.hxx | 44 + svx/source/svdraw/svdotext.cxx |1 3 files changed, 47 insertions(+) New commits: commit 61a2e01298b89f1a53a2ed7d553145dcf19b3623 Author: matteocam matteo.campane...@gmail.com Date: Thu Jun 25 15:33:29 2015 -0400 Added header for TextChainFlow Change-Id: I64371ecb081025f81e9066c3183b58875803db56 diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index e66dff0..b5dde0f 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -45,6 +45,7 @@ class SvxFieldItem; class ImpSdrObjTextLink; class EditStatus; class TextChain; +class TextChainFlow; namespace sdr { namespace properties { class TextProperties; @@ -137,6 +138,7 @@ private: friend classsdr::table::SdrTableRTFParser; friend classTextChain; +friend classTextChainFlow; // CustomShapeproperties need to access the bTextFrame member: friend class sdr::properties::CustomShapeProperties; diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx new file mode 100644 index 000..5b4b7b5 --- /dev/null +++ b/include/svx/textchainflow.hxx @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_TEXTCHAINFLOW_HXX +#define INCLUDED_SVX_TEXTCHAINFLOW_HXX + +#include map + + +class SdrTextObj; + +namespace rtl { +class OUString; +} + +class TextChainFlow { + +public: +TextChainFlow() {} +~TextChainFlow() {} + +protected: +}; + +#endif // INCLUDED_SVX_TEXTCHAINFLOW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ + diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index cfe7cbd..1e8d526 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -47,6 +47,7 @@ #include svx/svdpool.hxx #include svx/xflclit.hxx #include svx/textchain.hxx +#include svx/textchainflow.hxx #include svl/style.hxx #include editeng/editeng.hxx #include editeng/overflowingtxt.hxx ___ 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' - svx/Library_svxcore.mk
svx/Library_svxcore.mk |1 + 1 file changed, 1 insertion(+) New commits: commit d0113fe14d7f773aced9e15bbb94dd204e0c74d6 Author: matteocam matteo.campane...@gmail.com Date: Thu Jun 25 15:40:25 2015 -0400 Added source for TextChainFlow Change-Id: I663c91786e5c2b7163daf021f990d5396db58779 diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index 816bae4..b482e57 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -326,6 +326,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\ svx/source/svdraw/svdviter \ svx/source/svdraw/svdxcgv \ svx/source/svdraw/textchain \ +svx/source/svdraw/textchainflow \ svx/source/table/cell \ svx/source/table/cellcursor \ svx/source/table/cellrange \ ___ 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' - include/svx svx/source
include/svx/textchainflow.hxx | 49 +++- svx/source/svdraw/svdotextdecomposition.cxx | 44 + 2 files changed, 79 insertions(+), 14 deletions(-) New commits: commit d694690fd619c7be735551378f753cf6b84bb55f Author: matteocam matteo.campane...@gmail.com Date: Thu Jun 25 18:14:28 2015 -0400 Written mechanisms for static OF/UF in proper classes Change-Id: Ica4b774670ae2bf25b5f6ee66f55c120e3e6b005 diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx index 5b4b7b5..e581965 100644 --- a/include/svx/textchainflow.hxx +++ b/include/svx/textchainflow.hxx @@ -20,22 +20,55 @@ #ifndef INCLUDED_SVX_TEXTCHAINFLOW_HXX #define INCLUDED_SVX_TEXTCHAINFLOW_HXX -#include map - - class SdrTextObj; +class SdrOutliner; +class NonOverflowingText; +class OverflowingText; +class TextChain; -namespace rtl { -class OUString; -} +// XXX: Specialize class for Editing mode and non editing mode? +// XXX: const qualifiers? class TextChainFlow { public: -TextChainFlow() {} -~TextChainFlow() {} +TextChainFlow(SdrTextObj *pChainTarget); +~TextChainFlow(); + +void CheckForFlowEvents(SdrOutliner *, SdrOutliner *); + +bool IsOverflow(); +bool IsUnderflow(); + +void ExecuteUnderflow(SdrOutliner *); +void ExecuteOverflow(SdrOutliner *, SdrOutliner *); protected: +TextChain *GetTextChain(); + +void impLeaveOnlyNonOverflowingText(SdrOutliner *); +void impMoveChainedTextToNextLink(SdrOutliner *); + +OutlinerParaObject *impGetNonOverflowingParaObject(SdrOutliner *pOutliner); +OutlinerParaObject *impGetOverflowingParaObject(SdrOutliner *pOutliner); + +private: + +void impSetOutlinerToEmptyTxt(SdrOutliner *pOutliner); + +SdrTextObj *mpTargetLink; +SdrTextObj *mpNextLink; + +TextChain *mpTextChain; + +bool bCheckedFlowEvents; + +bool bUnderflow; +bool bOverflow; + +OverflowingText *mpOverflowingTxt; +NonOverflowingText *mpNonOverflowingTxt; + }; #endif // INCLUDED_SVX_TEXTCHAINFLOW_HXX diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 70c4f2c..2ba2012 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -24,6 +24,7 @@ #include svx/svdotext.hxx #include svx/svdmodel.hxx #include svx/textchain.hxx +#include svx/textchainflow.hxx #include basegfx/vector/b2dvector.hxx #include sdr/primitive2d/sdrtextprimitive2d.hxx #include drawinglayer/primitive2d/textprimitive2d.hxx @@ -861,7 +862,7 @@ OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutlin // Draw everything OutlinerParaObject *pNewText = pOutliner-CreateParaObject(); return pNewText; - } +} void SdrTextObj::impMoveChainedTextToNextLink(SdrOutliner *pOutliner, SdrTextObj *pNextTextObj) const { @@ -1638,6 +1639,36 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( /* Begin underflow handling */ + // any parameter in the constructor? + // We need the outliner we get the overflow info from as well as + // the outliner for drawing (e.g. a drawing or chaining outliner) + // maybe the latter ones can be passed at the time of overflow and such +TextChainFlow aTxtChainFlow(const_castSdrTextObj*(this)); +bool bIsOverflow; + +aTxtChainFlow.CheckForFlowEvents(rOutliner, NULL); // seconod parameter is to check whether you have to prepare the outliner's parameters + +if (aTxtChainFlow.IsUnderflow() !IsInEditMode()) +{ +// underflow-induced overflow +aTxtChainFlow.ExecuteUnderflow(rOutliner); +bIsOverflow = aTxtChainFlow.IsOverflow(); +} else { +bIsOverflow = aTxtChainFlow.IsOverflow(); +} + +if (bIsOverflow !IsInEditMode()) { +// Initialize Chaining Outliner +SdrOutliner rChainingOutl = pModel-GetChainingOutliner(this); +ImpInitDrawOutliner( rChainingOutl ); +rChainingOutl.SetUpdateMode(true); + +aTxtChainFlow.ExecuteOverflow(rOutliner, rChainingOutl); +} + +/* + +// Begin old code bool bIsPageUnderflow = !rOutliner.IsPageOverflow() !IsInEditMode(); if (bIsPageUnderflow) { @@ -1646,7 +1677,6 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( OutlinerParaObject *pNextLinkWholeText = pNextLink-GetOutlinerParaObject(); // making whole text - OutlinerParaObject *pCurText; pCurText = rOutliner.CreateParaObject(); // XXX: this is editing outliner in editing version @@ -1662,19 +1692,19 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( const_castSdrTextObj*(this)-NbcSetOutlinerParaObject(pNewText); } } // You might be done at this point, unless there is an overflow and that's handled in std way. - +*/ /* End underflow handling */ /* Begin overflow handling
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
svx/source/svdraw/svdotext.cxx |3 +++ svx/source/svdraw/svdotextdecomposition.cxx |3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) New commits: commit e7123b1b7f92be21dcdb1b9edfe839d4926a30c7 Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 23 17:57:16 2015 -0400 Fixed source of (non)overflowing text after UF-caused OF Change-Id: I432120ef6476c3ab373206b7015e2444ed4dedff diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index df1a01b..c38170e 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2051,6 +2051,8 @@ void SdrTextObj::onUnderflowStatusEvent( ) aDrawOutliner.AddText(*pNextLinkWholeText); bool bIsOverflowFromUnderflow = aDrawOutliner.IsPageOverflow(); +if (bIsOverflowFromUnderflow) +mpOverflowingText = aDrawOutliner.GetOverflowingText(); OutlinerParaObject *pNewText = aDrawOutliner.CreateParaObject(); @@ -2066,6 +2068,7 @@ void SdrTextObj::onUnderflowStatusEvent( ) // handle overflow if (bIsOverflowFromUnderflow) { + // prevents infinite loops when setting text for editing outliner GetTextChain()-SetNilChainingEvent(const_castSdrTextObj*(this), true); impLeaveOnlyNonOverflowingText(aDrawOutliner); diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 2ad4c40..dcb4ad2 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -739,7 +739,8 @@ OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOut { NonOverflowingText *pNonOverflowingTxt; // We have to get text from the editing outliner if this is set -if (pEdtOutl != NULL) +if (pEdtOutl != NULL + !GetTextChain()-GetNilChainingEvent(const_castSdrTextObj*(this))) // this is equivalent to checking for not(underflow-caused overflow) pNonOverflowingTxt = pEdtOutl-GetNonOverflowingText(); else ___ 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' - svx/source
svx/source/svdraw/svdotext.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit e0459b4291926491c268eee6ac13409d52de2121 Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 23 18:56:31 2015 -0400 Setting paper size from editing outl to properly check for OF Change-Id: I8fdcdf64a227adc2fb5df9428dc77f8036f35a22 diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index c38170e..c6adc5a 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2047,6 +2047,8 @@ void SdrTextObj::onUnderflowStatusEvent( ) // prepare for checking overflow aDrawOutliner.SetUpdateMode(true); aDrawOutliner.SetMaxAutoPaperSize(pEdtOutl-GetMaxAutoPaperSize()); +aDrawOutliner.SetMinAutoPaperSize(pEdtOutl-GetMinAutoPaperSize()); +aDrawOutliner.SetPaperSize(pEdtOutl-GetPaperSize()); aDrawOutliner.SetText(*pCurText); aDrawOutliner.AddText(*pNextLinkWholeText); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - include/svx svx/source
include/svx/textchain.hxx |4 -- svx/source/svdraw/svdotext.cxx | 54 +--- svx/source/svdraw/textchain.cxx | 13 - 3 files changed, 2 insertions(+), 69 deletions(-) New commits: commit 374be8c82ea75bb5908ed44d0e358deab433341e Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 23 19:07:07 2015 -0400 Removed references to HandlingOveflow property Change-Id: Icef338d4e3d286ef4b2a0640ede1984cbf71e699 diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx index 9290f22..56b0af8 100644 --- a/include/svx/textchain.hxx +++ b/include/svx/textchain.hxx @@ -41,7 +41,6 @@ class ImpChainLinkProperties ImpChainLinkProperties(); bool bOverwriteOnOverflow; -bool bHandlingUnderflow; bool bNilChainingEvent; }; @@ -65,9 +64,6 @@ class TextChain { void SetOverwriteOnOverflow(SdrTextObj *, bool ); bool GetOverwriteOnOverflow(SdrTextObj *pTarget); -bool GetLinkHandlingUnderflow(SdrTextObj *pTarget); -void SetLinkHandlingUnderflow(SdrTextObj *, bool); - bool GetNilChainingEvent(SdrTextObj *pTarget); void SetNilChainingEvent(SdrTextObj *, bool); diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index c6adc5a..71fe911 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1971,16 +1971,7 @@ void SdrTextObj::onOverflowStatusEvent( ) if ( mbToBeChained ) { SdrOutliner aDrawOutliner = ImpGetDrawOutliner(); -// If this is the a post-underflow-type of overflow then we cannot -//trust the editing outl on the text since it has still the old one -if(GetTextChain()-GetLinkHandlingUnderflow(this)) { -OutlinerParaObject *pPObj = GetOutlinerParaObject(); -aDrawOutliner.SetUpdateMode(true); -aDrawOutliner.SetMaxAutoPaperSize(pEdtOutl-GetMaxAutoPaperSize()); -aDrawOutliner.SetText(*pPObj); -aDrawOutliner.IsPageOverflow(); // Check for overflow to set flags -mpOverflowingText = aDrawOutliner.GetOverflowingText(); -} else if (pEdtOutl != NULL) + if (pEdtOutl != NULL) mpOverflowingText = pEdtOutl-GetOverflowingText(); else { assert(0); // Should never happen. FIXME(matteocam) @@ -1989,21 +1980,6 @@ void SdrTextObj::onOverflowStatusEvent( ) SdrTextObj *pNextTextObj = GetNextLinkInChain(); impLeaveOnlyNonOverflowingText(aDrawOutliner); -if (GetTextChain()-GetLinkHandlingUnderflow(this)) -{ -// reset underflow handling -GetTextChain()-SetLinkHandlingUnderflow(this, false); -/* We are about to call set text on underflowing text, - * since there is nothing more to be handled this should be nil -*/ -GetTextChain()-SetNilChainingEvent(this, true); -// Set text for editing outliner; will trigger onChainingEvent (which will return immediately) -OutlinerParaObject *pPObj = GetOutlinerParaObject(); -pEdtOutl-SetText(*pPObj); -// XXX: not sure if next lines necessary -OutlinerParaObject *pNewPObj = pEdtOutl-CreateParaObject(); -NbcSetOutlinerParaObject(pNewPObj); -} // Transfer overflowing text impMoveChainedTextToNextLink(aDrawOutliner, pNextTextObj); @@ -2015,21 +1991,6 @@ void SdrTextObj::onUnderflowStatusEvent( ) SdrTextObj *pNextLink = GetNextLinkInChain(); SdrOutliner aDrawOutliner = ImpGetDrawOutliner(); -if (GetTextChain()-GetLinkHandlingUnderflow(this)) -{ -// possibly coming from an overflow -if (pEdtOutl) { -GetTextChain()-SetLinkHandlingUnderflow(this, false); -GetTextChain()-SetNilChainingEvent(this, true); -OutlinerParaObject *pPObj = GetOutlinerParaObject(); -pEdtOutl-SetText(*pPObj); -OutlinerParaObject *pNewPObj = pEdtOutl-CreateParaObject(); -SetOutlinerParaObject(pNewPObj); -} - -return; -} - if (!pNextLink-HasText()) return; @@ -2106,18 +2067,7 @@ void SdrTextObj::onChainingEvent() bool bIsPageOverflow; -if (GetTextChain()-GetLinkHandlingUnderflow(this)) -{ -// If handling underflow we check for overflow in the object -Outliner aDrawOutliner = ImpGetDrawOutliner(); -aDrawOutliner.SetUpdateMode(true); -aDrawOutliner.SetMaxAutoPaperSize(pEdtOutl-GetMaxAutoPaperSize()); -OutlinerParaObject *pPObj = GetOutlinerParaObject(); -aDrawOutliner.SetText(*pPObj); -bIsPageOverflow = aDrawOutliner.IsPageOverflow(); -} else { -bIsPageOverflow = pEdtOutl-IsPageOverflow(); -} +bIsPageOverflow = pEdtOutl-IsPageOverflow(); // Propagates the need for change SetToBeChained( bIsPageOverflow ); diff --git a/svx/source/svdraw/textchain.cxx b/svx/source
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
svx/source/svdraw/svdotext.cxx | 14 +++--- svx/source/svdraw/svdotextdecomposition.cxx |5 +++-- 2 files changed, 6 insertions(+), 13 deletions(-) New commits: commit df9fccced03eee9092d86d579f46d93583a82433 Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 23 19:42:20 2015 -0400 Minor changes Change-Id: I36d52878596750bc275a4ddd7dc79a9e2191becb diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 7625ca6..cfe7cbd 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2027,20 +2027,13 @@ void SdrTextObj::onUnderflowStatusEvent( ) if (bIsOverflowFromUnderflow) { // prevents infinite loops when setting text for editing outliner GetTextChain()-SetNilChainingEvent(const_castSdrTextObj*(this), true); + impLeaveOnlyNonOverflowingText(aDrawOutliner); impMoveChainedTextToNextLink(aDrawOutliner, pNextLink); } else { +// No overflow: set the whole thing const_castSdrTextObj*(this)-SetOutlinerParaObject(pNewText); } - -/* -if (pEdtOutl != NULL) -pEdtOutl-SetText(*pNewText); -*/ - -// Don't need this if handling everything here -//const_castSdrTextObj*(this)-SetOutlinerParaObject(pNewText); - } @@ -2052,7 +2045,7 @@ void SdrTextObj::onChainingEvent() if (!pEdtOutl) return; - +// This is true during an underflow-caused overflow (with pEdtOutl-SetText()) if (GetTextChain()-GetNilChainingEvent(this)) { GetTextChain()-SetNilChainingEvent(this, false); return; @@ -2072,7 +2065,6 @@ void SdrTextObj::onChainingEvent() } else { onUnderflowStatusEvent(); } -return; } diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 83f9a0c..70c4f2c 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -738,9 +738,10 @@ void SdrTextObj::impDecomposeContourTextPrimitive( OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOutliner) const { NonOverflowingText *pNonOverflowingTxt; -// We have to get text from the editing outliner if this is set +// We have to get text from the editing outliner if this is set (but not if this is part of an underflow process since pEdtOutl does not know much in that case) +bool bThereIsUnderflowGoingOn = GetTextChain()-GetNilChainingEvent(const_castSdrTextObj*(this)); if (pEdtOutl != NULL - !GetTextChain()-GetNilChainingEvent(const_castSdrTextObj*(this))) // this is equivalent to checking for not(underflow-caused overflow) + !bThereIsUnderflowGoingOn) // this is equivalent to checking for not(underflow-caused overflow) pNonOverflowingTxt = pEdtOutl-GetNonOverflowingText(); else ___ 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' - include/svx svx/source
include/svx/textchain.hxx |4 -- svx/source/svdraw/svdotext.cxx | 11 + svx/source/svdraw/svdotextdecomposition.cxx | 55 +--- svx/source/svdraw/textchain.cxx | 13 -- 4 files changed, 4 insertions(+), 79 deletions(-) New commits: commit 3119dabf25d33f805bd8943c2e4857934d97e1a7 Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 23 19:22:45 2015 -0400 Removed references to SetOverwriteOnOverflow Change-Id: I17271e25f9e5fc8feeafdc1c09916674f1e6d494 diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx index 56b0af8..8032747 100644 --- a/include/svx/textchain.hxx +++ b/include/svx/textchain.hxx @@ -40,7 +40,6 @@ class ImpChainLinkProperties ImpChainLinkProperties(); -bool bOverwriteOnOverflow; bool bNilChainingEvent; }; @@ -61,9 +60,6 @@ class TextChain { // return whether a paragraph is split between the two links in the argument bool GetLinksHaveMergeableFirstPara(SdrTextObj *, SdrTextObj *); -void SetOverwriteOnOverflow(SdrTextObj *, bool ); -bool GetOverwriteOnOverflow(SdrTextObj *pTarget); - bool GetNilChainingEvent(SdrTextObj *pTarget); void SetNilChainingEvent(SdrTextObj *, bool); diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 71fe911..7625ca6 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1994,7 +1994,7 @@ void SdrTextObj::onUnderflowStatusEvent( ) if (!pNextLink-HasText()) return; -// 1) get the text of the other guy and add it to the last paragraph +// Get the text of the other guy and add it to the last paragraph // XXX: For now it's not merging anything just adding the while thing as a separate para OutlinerParaObject *pNextLinkWholeText = pNextLink-GetOutlinerParaObject(); if (!pNextLinkWholeText) @@ -2014,24 +2014,17 @@ void SdrTextObj::onUnderflowStatusEvent( ) aDrawOutliner.AddText(*pNextLinkWholeText); bool bIsOverflowFromUnderflow = aDrawOutliner.IsPageOverflow(); +// Save mpOverflowingText (important for overflow handlers below) // XXX: Change the wayt this is done? if (bIsOverflowFromUnderflow) mpOverflowingText = aDrawOutliner.GetOverflowingText(); OutlinerParaObject *pNewText = aDrawOutliner.CreateParaObject(); -// 2) Set the text of the next guy to what is left -// (since this happens automatically by overflow we just order to reset the destination box's text) -GetTextChain()-SetOverwriteOnOverflow(pNextLink, true); - -// We make sure we don't handle underflow while handling underflow -//GetTextChain()-SetLinkHandlingUnderflow(this, true); - // Set the other box empty so if overflow does not occur we are fine pNextLink-NbcSetOutlinerParaObject(aDrawOutliner.GetEmptyParaObject()); // handle overflow if (bIsOverflowFromUnderflow) { - // prevents infinite loops when setting text for editing outliner GetTextChain()-SetNilChainingEvent(const_castSdrTextObj*(this), true); impLeaveOnlyNonOverflowingText(aDrawOutliner); diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index dcb4ad2..83f9a0c 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -784,9 +784,7 @@ void SdrTextObj::impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const { OutlinerParaObject *pNewText = impGetNonOverflowingParaObject(pOutliner); -//bool bInUnderflow = GetTextChain()-GetLinkHandlingUnderflow(const_castSdrTextObj*(this)); -// we need this when we are in editing mode (AND this is not an underflow-caused overflow) -if (pEdtOutl != NULL /* !bInUnderflow */) { +if (pEdtOutl != NULL) { pEdtOutl-SetText(*pNewText); } // adds it to current outliner anyway (useful in static decomposition) @@ -803,38 +801,6 @@ OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutlin if (mpOverflowingText == NULL) return NULL; -// XXX: Put following code in a separate method (possibly in another class) -if ( GetTextChain()-GetOverwriteOnOverflow(pNextTextObj) ) -{ -// We only make three blocks of paragraphs and ignore the rest - -// reset behavior -GetTextChain()-SetOverwriteOnOverflow(pNextTextObj, false); - -if (mpOverflowingText-HasOtherParas()) { -// Make Para Object from the ending lines (to be appended later) -impSetOutlinerToEmptyTxt(pOutliner); -Paragraph *pFstPara = pOutliner-GetParagraph(0); -pOutliner-SetText(mpOverflowingText-GetEndingLines(), pFstPara); -OutlinerParaObject *pLastPara = pOutliner-CreateParaObject(); - -// Set heading lines as first paragraph -pOutliner-SetText(mpOverflowingText
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
svx/source/svdraw/svdotextdecomposition.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 1786bcb6285c056aa74fcd3b552ada7d300496ec Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 22 16:10:59 2015 -0400 Fixed Underflow condition: should be not(overflow) Change-Id: I58c6f2c0e3518ec200e3653f13804373580b4d25 diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 37c2384..6b00aacc 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -1669,7 +1669,7 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( /* Begin underflow handling */ -bool bIsPageUnderflow = rOutliner.IsPageOverflow() !IsInEditMode(); +bool bIsPageUnderflow = !rOutliner.IsPageOverflow() !IsInEditMode(); if (bIsPageUnderflow) { SdrTextObj *pNextLink = GetNextLinkInChain(); ___ 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' - svx/source
svx/source/svdraw/svdotext.cxx | 55 ++-- svx/source/svdraw/svdotextdecomposition.cxx |5 +- 2 files changed, 40 insertions(+), 20 deletions(-) New commits: commit 5c5e9a24af2fc406234145a0bc99ec1ac8c8c2c6 Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 22 16:56:34 2015 -0400 Handle UF and consequent OF in the same pass in editing mode Change-Id: Ic46137a666342d9cea99973fc1ce1a3ff759824a diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 49ef5b2..df1a01b 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2036,33 +2036,52 @@ void SdrTextObj::onUnderflowStatusEvent( ) // 1) get the text of the other guy and add it to the last paragraph // XXX: For now it's not merging anything just adding the while thing as a separate para OutlinerParaObject *pNextLinkWholeText = pNextLink-GetOutlinerParaObject(); -if (pNextLinkWholeText) { -OutlinerParaObject *pCurText; +if (!pNextLinkWholeText) +return; + +OutlinerParaObject *pCurText; -pCurText = pEdtOutl-CreateParaObject(); +pCurText = pEdtOutl-CreateParaObject(); -// NewTextForCurBox = Txt(CurBox) ++ Txt(NextBox) -aDrawOutliner.SetText(*pCurText); -aDrawOutliner.AddText(*pNextLinkWholeText); -OutlinerParaObject *pNewText = aDrawOutliner.CreateParaObject(); +// NewTextForCurBox = Txt(CurBox) ++ Txt(NextBox) +// prepare for checking overflow +aDrawOutliner.SetUpdateMode(true); +aDrawOutliner.SetMaxAutoPaperSize(pEdtOutl-GetMaxAutoPaperSize()); +aDrawOutliner.SetText(*pCurText); +aDrawOutliner.AddText(*pNextLinkWholeText); -// 2) Set the text of the next guy to what is left -// (since this happens automatically by overflow we just order to reset the destination box's text) -GetTextChain()-SetOverwriteOnOverflow(pNextLink, true); +bool bIsOverflowFromUnderflow = aDrawOutliner.IsPageOverflow(); -// We make sure we don't handle underflow while handling underflow -GetTextChain()-SetLinkHandlingUnderflow(this, true); +OutlinerParaObject *pNewText = aDrawOutliner.CreateParaObject(); -// Set the other box empty so if overflow does not occur we are fine - pNextLink-NbcSetOutlinerParaObject(aDrawOutliner.GetEmptyParaObject()); +// 2) Set the text of the next guy to what is left +// (since this happens automatically by overflow we just order to reset the destination box's text) +GetTextChain()-SetOverwriteOnOverflow(pNextLink, true); -/* -if (pEdtOutl != NULL) -pEdtOutl-SetText(*pNewText); -*/ +// We make sure we don't handle underflow while handling underflow +//GetTextChain()-SetLinkHandlingUnderflow(this, true); +// Set the other box empty so if overflow does not occur we are fine +pNextLink-NbcSetOutlinerParaObject(aDrawOutliner.GetEmptyParaObject()); + +// handle overflow +if (bIsOverflowFromUnderflow) { +// prevents infinite loops when setting text for editing outliner +GetTextChain()-SetNilChainingEvent(const_castSdrTextObj*(this), true); +impLeaveOnlyNonOverflowingText(aDrawOutliner); +impMoveChainedTextToNextLink(aDrawOutliner, pNextLink); +} else { const_castSdrTextObj*(this)-SetOutlinerParaObject(pNewText); } + +/* +if (pEdtOutl != NULL) +pEdtOutl-SetText(*pNewText); +*/ + +// Don't need this if handling everything here +//const_castSdrTextObj*(this)-SetOutlinerParaObject(pNewText); + } diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 6b00aacc..2ad4c40 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -783,10 +783,11 @@ void SdrTextObj::impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const { OutlinerParaObject *pNewText = impGetNonOverflowingParaObject(pOutliner); -bool bInUnderflow = GetTextChain()-GetLinkHandlingUnderflow(const_castSdrTextObj*(this)); +//bool bInUnderflow = GetTextChain()-GetLinkHandlingUnderflow(const_castSdrTextObj*(this)); // we need this when we are in editing mode (AND this is not an underflow-caused overflow) -if (pEdtOutl != NULL !bInUnderflow) +if (pEdtOutl != NULL /* !bInUnderflow */) { pEdtOutl-SetText(*pNewText); +} // adds it to current outliner anyway (useful in static decomposition) pOutliner-SetText(*pNewText); /*if (bInUnderflow) // must make a broadcast to reset underflow (XXX: can I reset it from here?) ___ 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' - svx/source
svx/source/svdraw/svdotextdecomposition.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 9bac753c5cf1436bd4b9681543f8b451366e77b1 Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 22 15:02:12 2015 -0400 Don't broadcast changes during UF-caused OF: OF itself should clean up Change-Id: I7a4c843f787b3feb863c2cc377ae08e56913ec42 diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index d4a3438..caa361e 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -789,10 +789,10 @@ void SdrTextObj::impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const pEdtOutl-SetText(*pNewText); // adds it to current outliner anyway (useful in static decomposition) pOutliner-SetText(*pNewText); -if (bInUnderflow) // must make a broadcast to reset underflow (XXX: can I reset it from here?) +/*if (bInUnderflow) // must make a broadcast to reset underflow (XXX: can I reset it from here?) const_castSdrTextObj*(this)-SetOutlinerParaObject(pNewText); -else -const_castSdrTextObj*(this)-NbcSetOutlinerParaObject(pNewText); +else*/ +const_castSdrTextObj*(this)-NbcSetOutlinerParaObject(pNewText); } OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutliner, SdrTextObj *pNextTextObj) 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' - svx/source
svx/source/svdraw/svdotext.cxx |4 1 file changed, 4 insertions(+) New commits: commit 14e4ea9c23c874ee9faabc6ed1f97ed5d2838f15 Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 22 14:16:06 2015 -0400 Reducing FSM size: set IsUF=0 at UF-caused OF Change-Id: Ib89e50f073414c8280a1eb0768f4e78ff9d5af17 diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 5b6d9a7..02c1519 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1974,12 +1974,16 @@ void SdrTextObj::onOverflowStatusEvent( ) // If this is the a post-underflow-type of overflow then we cannot //trust the editing outl on the text since it has still the old one if(GetTextChain()-GetLinkHandlingUnderflow(this)) { +// XXX: Maybe you can get this info directly from editing outl? OutlinerParaObject *pPObj = GetOutlinerParaObject(); aDrawOutliner.SetUpdateMode(true); aDrawOutliner.SetMaxAutoPaperSize(pEdtOutl-GetMaxAutoPaperSize()); aDrawOutliner.SetText(*pPObj); aDrawOutliner.IsPageOverflow(); // Check for overflow to set flags mpOverflowingText = aDrawOutliner.GetOverflowingText(); + +// reset underflow handling +GetTextChain()-SetLinkHandlingUnderflow(this, false); } else if (pEdtOutl != NULL) mpOverflowingText = pEdtOutl-GetOverflowingText(); else { ___ 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' - svx/source
svx/source/svdraw/svdotext.cxx | 106 ++--- 1 file changed, 59 insertions(+), 47 deletions(-) New commits: commit 80b60bbf45c56e7a61ecfc6d015ca7e1b2d43f9f Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 22 14:51:08 2015 -0400 Another FSM; passing by UF temporarily while in UF-caused OF Change-Id: I994011dc8962b8b8c915ec129f88e56874587a36 diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 02c1519..49ef5b2 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1974,16 +1974,12 @@ void SdrTextObj::onOverflowStatusEvent( ) // If this is the a post-underflow-type of overflow then we cannot //trust the editing outl on the text since it has still the old one if(GetTextChain()-GetLinkHandlingUnderflow(this)) { -// XXX: Maybe you can get this info directly from editing outl? OutlinerParaObject *pPObj = GetOutlinerParaObject(); aDrawOutliner.SetUpdateMode(true); aDrawOutliner.SetMaxAutoPaperSize(pEdtOutl-GetMaxAutoPaperSize()); aDrawOutliner.SetText(*pPObj); aDrawOutliner.IsPageOverflow(); // Check for overflow to set flags mpOverflowingText = aDrawOutliner.GetOverflowingText(); - -// reset underflow handling -GetTextChain()-SetLinkHandlingUnderflow(this, false); } else if (pEdtOutl != NULL) mpOverflowingText = pEdtOutl-GetOverflowingText(); else { @@ -1993,6 +1989,21 @@ void SdrTextObj::onOverflowStatusEvent( ) SdrTextObj *pNextTextObj = GetNextLinkInChain(); impLeaveOnlyNonOverflowingText(aDrawOutliner); +if (GetTextChain()-GetLinkHandlingUnderflow(this)) +{ +// reset underflow handling +GetTextChain()-SetLinkHandlingUnderflow(this, false); +/* We are about to call set text on underflowing text, + * since there is nothing more to be handled this should be nil +*/ +GetTextChain()-SetNilChainingEvent(this, true); +// Set text for editing outliner; will trigger onChainingEvent (which will return immediately) +OutlinerParaObject *pPObj = GetOutlinerParaObject(); +pEdtOutl-SetText(*pPObj); +// XXX: not sure if next lines necessary +OutlinerParaObject *pNewPObj = pEdtOutl-CreateParaObject(); +NbcSetOutlinerParaObject(pNewPObj); +} // Transfer overflowing text impMoveChainedTextToNextLink(aDrawOutliner, pNextTextObj); @@ -2054,6 +2065,50 @@ void SdrTextObj::onUnderflowStatusEvent( ) } } + +void SdrTextObj::onChainingEvent() +{ +if (!IsChainable() || GetNextLinkInChain() == NULL) +return; + +if (!pEdtOutl) +return; + + +if (GetTextChain()-GetNilChainingEvent(this)) { +GetTextChain()-SetNilChainingEvent(this, false); +return; +} + +bool bIsPageOverflow; + +if (GetTextChain()-GetLinkHandlingUnderflow(this)) +{ +// If handling underflow we check for overflow in the object +Outliner aDrawOutliner = ImpGetDrawOutliner(); +aDrawOutliner.SetUpdateMode(true); +aDrawOutliner.SetMaxAutoPaperSize(pEdtOutl-GetMaxAutoPaperSize()); +OutlinerParaObject *pPObj = GetOutlinerParaObject(); +aDrawOutliner.SetText(*pPObj); +bIsPageOverflow = aDrawOutliner.IsPageOverflow(); +} else { +bIsPageOverflow = pEdtOutl-IsPageOverflow(); +} + +// Propagates the need for change +SetToBeChained( bIsPageOverflow ); +fprintf(stderr, [CHAINING] Need for Chaining is %s\n, +bIsPageOverflow ? TRUE : FALSE); + +if ( bIsPageOverflow ) { +onOverflowStatusEvent(); +} else { +onUnderflowStatusEvent(); +} +return; +} + + /** returns the currently active text. */ SdrText* SdrTextObj::getActiveText() const { @@ -2147,49 +2202,6 @@ bool SdrTextObj::GetPreventChainable() const return pClone; } -void SdrTextObj::onChainingEvent() -{ -if (!IsChainable() || GetNextLinkInChain() == NULL) -return; - -if (!pEdtOutl) -return; - - -if (GetTextChain()-GetNilChainingEvent(this)) { -GetTextChain()-SetNilChainingEvent(this, false); -return; -} - -bool bIsPageOverflow; - -if (GetTextChain()-GetLinkHandlingUnderflow(this)) -{ -// If handling underflow we check for overflow in the object -Outliner aDrawOutliner = ImpGetDrawOutliner(); -aDrawOutliner.SetUpdateMode(true); -aDrawOutliner.SetMaxAutoPaperSize(pEdtOutl-GetMaxAutoPaperSize()); -OutlinerParaObject *pPObj = GetOutlinerParaObject(); -aDrawOutliner.SetText(*pPObj); -bIsPageOverflow = aDrawOutliner.IsPageOverflow(); -} else { -bIsPageOverflow = pEdtOutl-IsPageOverflow(); -} - -// Propagates the need
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/impedit3.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 4bf0c3ebb5faa2d28c2e30f80c5e717da725a9a5 Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 22 15:29:14 2015 -0400 Removed IsModified() check for chaining handler Change-Id: Ib1b7d000afe762e3be38ac2bc79d2bdf928e1d66 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 892a297..4d6e66e 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -493,8 +493,8 @@ void ImpEditEngine::FormatDoc() CallStatusHdl();// If Modified... //FIXME(matteocam) -if (IsModified()) -CallChainingEventHdl(); // For chaining + +CallChainingEventHdl(); // For chaining LeaveBlockNotifications(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
svx/source/svdraw/svdotextdecomposition.cxx | 39 +++- 1 file changed, 38 insertions(+), 1 deletion(-) New commits: commit 06ee5333d625bc56a7401d824dc6df6490cdde26 Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 22 16:08:58 2015 -0400 Underflow handling in static mode Change-Id: I2540ee4d5f26e7515bcedd127f6464ef81591443 diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index caa361e..37c2384 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -1667,7 +1667,44 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( // Sets original text rOutliner.SetText(*pOutlinerParaObject); -/* Begin overflow handling */ +/* Begin underflow handling */ + +bool bIsPageUnderflow = rOutliner.IsPageOverflow() !IsInEditMode(); +if (bIsPageUnderflow) { + +SdrTextObj *pNextLink = GetNextLinkInChain(); +if (pNextLink pNextLink-HasText()) { +OutlinerParaObject *pNextLinkWholeText = pNextLink-GetOutlinerParaObject(); + +// making whole text + +OutlinerParaObject *pCurText; +pCurText = rOutliner.CreateParaObject(); // XXX: this is editing outliner in editing version + +// NewTextForCurBox = Txt(CurBox) ++ Txt(NextBox) +rOutliner.SetText(*pCurText); +rOutliner.AddText(*pNextLinkWholeText); +OutlinerParaObject *pNewText = rOutliner.CreateParaObject(); + +// 2) Set the text of the next guy to what is left +// (since this happens automatically by overflow we just order to reset the destination box's text) +GetTextChain()-SetOverwriteOnOverflow(pNextLink, true); + +// We make sure we don't handle underflow while handling underflow +//GetTextChain()-SetLinkHandlingUnderflow(this, true); // we don't need this in static decomp. + +// Set the other box empty so if overflow does not occur we are fine +if (!GetPreventChainable()) + pNextLink-NbcSetOutlinerParaObject(rOutliner.GetEmptyParaObject()); + +const_castSdrTextObj*(this)-NbcSetOutlinerParaObject(pNewText); +} +} // You might be done at this point, unless there is an overflow and that's handled in std way. + +/* End underflow handling */ + + +/* Begin overflow handling */ // might be caused from underflow handling above // If overflow occurs we have to cut the text at the right point // If in edit mode ImpEditEngine should have taken care of this ___ 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' - svx/source
svx/source/svdraw/svdotext.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit db6cb513f87e4261e8899799b5474b38c6ca92f9 Author: matteocam matteo.campane...@gmail.com Date: Fri Jun 19 20:03:04 2015 -0400 Don't set immediately text in editing outliner in overflow Change-Id: Ia6d7c5902dc971b3881dfd0ed37149f5f7770bf2 diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 02ce10b..ca45989 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2023,8 +2023,10 @@ void SdrTextObj::onUnderflowStatusEvent( ) // Set the other box empty so if overflow does not occur we are fine pNextLink-NbcSetOutlinerParaObject(aDrawOutliner.GetEmptyParaObject()); +/* if (pEdtOutl != NULL) pEdtOutl-SetText(*pNewText); +*/ const_castSdrTextObj*(this)-NbcSetOutlinerParaObject(pNewText); } ___ 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' - svx/source
svx/source/svdraw/svdotext.cxx | 28 +--- 1 file changed, 25 insertions(+), 3 deletions(-) New commits: commit 0aab59ad3ab459b271bc9d6bab8d4002695845c1 Author: matteocam matteo.campane...@gmail.com Date: Fri Jun 19 21:19:06 2015 -0400 Finding out overflow by drawing outl if coming from underflow Change-Id: Ic19c17944b0c3d7d76e4a6623984fd5207b6eea8 diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index ca45989..b6a90e0 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1972,8 +1972,14 @@ void SdrTextObj::onOverflowStatusEvent( ) SdrOutliner aDrawOutliner = ImpGetDrawOutliner(); if (pEdtOutl != NULL) mpOverflowingText = pEdtOutl-GetOverflowingText(); -else +else if(GetTextChain()-GetLinkHandlingUnderflow(this)) { +OutlinerParaObject *pPObj = GetOutlinerParaObject(); +aDrawOutliner.SetText(*pPObj); +aDrawOutliner.IsPageOverflow(); // Check for overflow to set flags mpOverflowingText = aDrawOutliner.GetOverflowingText(); +} else { +assert(0); // Should never happen. FIXME(matteocam) +} SdrTextObj *pNextTextObj = GetNextLinkInChain(); @@ -1991,6 +1997,11 @@ void SdrTextObj::onUnderflowStatusEvent( ) if (GetTextChain()-GetLinkHandlingUnderflow(this)) { +// possibly coming from an overflow +if (pEdtOutl) { +OutlinerParaObject *pPObj = GetOutlinerParaObject(); +pEdtOutl-SetText(*pPObj); +} GetTextChain()-SetLinkHandlingUnderflow(this, false); return; } @@ -2028,7 +2039,7 @@ void SdrTextObj::onUnderflowStatusEvent( ) pEdtOutl-SetText(*pNewText); */ -const_castSdrTextObj*(this)-NbcSetOutlinerParaObject(pNewText); +const_castSdrTextObj*(this)-SetOutlinerParaObject(pNewText); } } @@ -2133,7 +2144,18 @@ void SdrTextObj::onChainingEvent() if (!pEdtOutl) return; -bool bIsPageOverflow = pEdtOutl-IsPageOverflow(); +bool bIsPageOverflow; + +if (GetTextChain()-GetLinkHandlingUnderflow(this)) +{ +// If handling underflow we check for overflow in the object +Outliner aDrawOutliner = ImpGetDrawOutliner(); +OutlinerParaObject *pPObj = GetOutlinerParaObject(); +aDrawOutliner.SetText(*pPObj); +bIsPageOverflow = aDrawOutliner.IsPageOverflow(); +} else { +bIsPageOverflow = pEdtOutl-IsPageOverflow(); +} // Propagates the need for change SetToBeChained( bIsPageOverflow ); ___ 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' - svx/source
svx/source/svdraw/svdotext.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 0b6f9623414d9c70de2519476e6978388715ab8d Author: matteocam matteo.campane...@gmail.com Date: Fri Jun 19 22:57:25 2015 -0400 Make sure to call underflow one more time (not sure if really useful) Change-Id: I7a32305e2c53994c1e7b5c51bceef171a6c136f7 diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 51c75a0..5b6d9a7 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2008,6 +2008,8 @@ void SdrTextObj::onUnderflowStatusEvent( ) GetTextChain()-SetNilChainingEvent(this, true); OutlinerParaObject *pPObj = GetOutlinerParaObject(); pEdtOutl-SetText(*pPObj); +OutlinerParaObject *pNewPObj = pEdtOutl-CreateParaObject(); +SetOutlinerParaObject(pNewPObj); } return; @@ -2149,6 +2151,7 @@ void SdrTextObj::onChainingEvent() if (!pEdtOutl) return; + if (GetTextChain()-GetNilChainingEvent(this)) { GetTextChain()-SetNilChainingEvent(this, false); return; ___ 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' - svx/source
svx/source/svdraw/svdotextdecomposition.cxx |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit d89a98a71ecd9211fcb494a3524d2f75717ac6f1 Author: matteocam matteo.campane...@gmail.com Date: Fri Jun 19 22:11:26 2015 -0400 Don't set nonOverflowing text to editing outl if in underflow Change-Id: I471cb8c7e2eedbdf169c45b0fde0ade16b67d1a3 diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 0868bf7..a4de09d 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -782,8 +782,10 @@ OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOut void SdrTextObj::impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const { OutlinerParaObject *pNewText = impGetNonOverflowingParaObject(pOutliner); -// we need this when we are in editing mode -if (pEdtOutl != NULL) + +bool bInUnderflow = GetTextChain()-GetLinkHandlingUnderflow(const_castSdrTextObj*(this)); +// we need this when we are in editing mode (AND this is not an underflow-caused overflow) +if (pEdtOutl != NULL !bInUnderflow) pEdtOutl-SetText(*pNewText); // adds it to current outliner anyway (useful in static decomposition) pOutliner-SetText(*pNewText); ___ 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' - include/svx svx/source
include/svx/textchain.hxx |4 svx/source/svdraw/svdotext.cxx |9 - svx/source/svdraw/svdotextdecomposition.cxx |5 - svx/source/svdraw/textchain.cxx | 13 + 4 files changed, 29 insertions(+), 2 deletions(-) New commits: commit 56c559b69e9549611b2ae5dad67842b60880646b Author: matteocam matteo.campane...@gmail.com Date: Fri Jun 19 22:43:26 2015 -0400 Adding one more state to underflow processing Change-Id: I130935fc96ea270c7661b324e473ab825547b45b diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx index a03bf57..9290f22 100644 --- a/include/svx/textchain.hxx +++ b/include/svx/textchain.hxx @@ -42,6 +42,7 @@ class ImpChainLinkProperties bool bOverwriteOnOverflow; bool bHandlingUnderflow; +bool bNilChainingEvent; }; @@ -67,6 +68,9 @@ class TextChain { bool GetLinkHandlingUnderflow(SdrTextObj *pTarget); void SetLinkHandlingUnderflow(SdrTextObj *, bool); +bool GetNilChainingEvent(SdrTextObj *pTarget); +void SetNilChainingEvent(SdrTextObj *, bool); + protected: LinkPropertiesMap maLinkPropertiesMap; }; diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 3c394de..51c75a0 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2004,10 +2004,12 @@ void SdrTextObj::onUnderflowStatusEvent( ) { // possibly coming from an overflow if (pEdtOutl) { +GetTextChain()-SetLinkHandlingUnderflow(this, false); +GetTextChain()-SetNilChainingEvent(this, true); OutlinerParaObject *pPObj = GetOutlinerParaObject(); pEdtOutl-SetText(*pPObj); } -GetTextChain()-SetLinkHandlingUnderflow(this, false); + return; } @@ -2147,6 +2149,11 @@ void SdrTextObj::onChainingEvent() if (!pEdtOutl) return; +if (GetTextChain()-GetNilChainingEvent(this)) { +GetTextChain()-SetNilChainingEvent(this, false); +return; +} + bool bIsPageOverflow; if (GetTextChain()-GetLinkHandlingUnderflow(this)) diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index a4de09d..d4a3438 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -789,7 +789,10 @@ void SdrTextObj::impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const pEdtOutl-SetText(*pNewText); // adds it to current outliner anyway (useful in static decomposition) pOutliner-SetText(*pNewText); -const_castSdrTextObj*(this)-NbcSetOutlinerParaObject(pNewText); +if (bInUnderflow) // must make a broadcast to reset underflow (XXX: can I reset it from here?) +const_castSdrTextObj*(this)-SetOutlinerParaObject(pNewText); +else +const_castSdrTextObj*(this)-NbcSetOutlinerParaObject(pNewText); } OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutliner, SdrTextObj *pNextTextObj) const diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx index 3e4f546..1fd7f92 100644 --- a/svx/source/svdraw/textchain.cxx +++ b/svx/source/svdraw/textchain.cxx @@ -26,6 +26,7 @@ ImpChainLinkProperties::ImpChainLinkProperties() // give defaults bOverwriteOnOverflow = false; bHandlingUnderflow = false; +bNilChainingEvent = false; } // XXX: All getters in the class assume that the guy is in the chain @@ -72,6 +73,18 @@ void TextChain::SetLinkHandlingUnderflow(SdrTextObj *pTarget, bool bHandlingUnde pLinkProperties-bHandlingUnderflow = bHandlingUnderflow; } +bool TextChain::GetNilChainingEvent(SdrTextObj *pTarget) +{ +ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget); +return pLinkProperties-bNilChainingEvent; +} + +void TextChain::SetNilChainingEvent(SdrTextObj *pTarget, bool bNilChainingEvent) +{ +ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget); +pLinkProperties-bNilChainingEvent = bNilChainingEvent; +} + void TextChain::SetOverwriteOnOverflow(SdrTextObj *pTarget, bool bOverwrite) { ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget); ___ 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' - svx/source
svx/source/svdraw/svdotext.cxx | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) New commits: commit d910aeb4e8b73e9679cdbc954cbf82217b02ff3e Author: matteocam matteo.campane...@gmail.com Date: Fri Jun 19 21:52:56 2015 -0400 Other changes related to finding overflow in drawing outl Change-Id: I7f5b1996c622cce53a4497e7faf579efdbb8646f diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index b6a90e0..3c394de 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1970,14 +1970,19 @@ void SdrTextObj::onOverflowStatusEvent( ) // Pushes text in next link on the fly if ( mbToBeChained ) { SdrOutliner aDrawOutliner = ImpGetDrawOutliner(); -if (pEdtOutl != NULL) -mpOverflowingText = pEdtOutl-GetOverflowingText(); -else if(GetTextChain()-GetLinkHandlingUnderflow(this)) { + +// If this is the a post-underflow-type of overflow then we cannot +//trust the editing outl on the text since it has still the old one +if(GetTextChain()-GetLinkHandlingUnderflow(this)) { OutlinerParaObject *pPObj = GetOutlinerParaObject(); +aDrawOutliner.SetUpdateMode(true); +aDrawOutliner.SetMaxAutoPaperSize(pEdtOutl-GetMaxAutoPaperSize()); aDrawOutliner.SetText(*pPObj); aDrawOutliner.IsPageOverflow(); // Check for overflow to set flags mpOverflowingText = aDrawOutliner.GetOverflowingText(); -} else { +} else if (pEdtOutl != NULL) +mpOverflowingText = pEdtOutl-GetOverflowingText(); +else { assert(0); // Should never happen. FIXME(matteocam) } @@ -2014,11 +2019,9 @@ void SdrTextObj::onUnderflowStatusEvent( ) OutlinerParaObject *pNextLinkWholeText = pNextLink-GetOutlinerParaObject(); if (pNextLinkWholeText) { OutlinerParaObject *pCurText; -if (pEdtOutl) { -pCurText = pEdtOutl-CreateParaObject(); -} else { -pCurText = GetOutlinerParaObject(); -} + +pCurText = pEdtOutl-CreateParaObject(); + // NewTextForCurBox = Txt(CurBox) ++ Txt(NextBox) aDrawOutliner.SetText(*pCurText); aDrawOutliner.AddText(*pNextLinkWholeText); @@ -2150,6 +2153,8 @@ void SdrTextObj::onChainingEvent() { // If handling underflow we check for overflow in the object Outliner aDrawOutliner = ImpGetDrawOutliner(); +aDrawOutliner.SetUpdateMode(true); +aDrawOutliner.SetMaxAutoPaperSize(pEdtOutl-GetMaxAutoPaperSize()); OutlinerParaObject *pPObj = GetOutlinerParaObject(); aDrawOutliner.SetText(*pPObj); bIsPageOverflow = aDrawOutliner.IsPageOverflow(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
svx/source/svdraw/svdotext.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit bdce1b0f28fb483b041d00c5d3ea6dda250f78f9 Author: matteocam matteo.campane...@gmail.com Date: Fri Jun 19 11:05:01 2015 -0400 Changes the next link to empty after underflow even before causing overflow Change-Id: I79afb65701162cfc3ff419cab809cf2e61042b8f diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 2048418..02ce10b 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2020,6 +2020,9 @@ void SdrTextObj::onUnderflowStatusEvent( ) // We make sure we don't handle underflow while handling underflow GetTextChain()-SetLinkHandlingUnderflow(this, true); +// Set the other box empty so if overflow does not occur we are fine + pNextLink-NbcSetOutlinerParaObject(aDrawOutliner.GetEmptyParaObject()); + if (pEdtOutl != NULL) pEdtOutl-SetText(*pNewText); ___ 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' - svx/source
svx/source/svdraw/svdotext.cxx |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit 73ea279ee0a28b3a785569998919e03a0bc2a117 Author: matteocam matteo.campane...@gmail.com Date: Fri Jun 19 10:42:16 2015 -0400 Taking first part of text for underflow from editing outliner Change-Id: I07d29b9e94103aeeb36d6d8b6c5c8fd53f943a4e diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index b6b390e..26ffb78 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2002,8 +2002,12 @@ void SdrTextObj::onUnderflowStatusEvent( ) // XXX: For now it's not merging anything just adding the while thing as a separate para OutlinerParaObject *pNextLinkWholeText = pNextLink-GetOutlinerParaObject(); if (pNextLinkWholeText) { - -OutlinerParaObject *pCurText = GetOutlinerParaObject(); +OutlinerParaObject *pCurText; +if (pEdtOutl) { +pCurText = pEdtOutl-CreateParaObject(); +} else { +pCurText = GetOutlinerParaObject(); +} // NewTextForCurBox = Txt(CurBox) ++ Txt(NextBox) aDrawOutliner.SetText(*pCurText); aDrawOutliner.AddText(*pNextLinkWholeText); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
svx/source/svdraw/svdotext.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit eea907d97f884b6523a9f168f4346a99e2e2a460 Author: matteocam matteo.campane...@gmail.com Date: Fri Jun 19 10:57:15 2015 -0400 Using NbCSetOutlinerParaObject after setting text for editing outliner Change-Id: I9fdb0bc3601765b31078f8d5991144df244a153e diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 26ffb78..2048418 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2023,7 +2023,7 @@ void SdrTextObj::onUnderflowStatusEvent( ) if (pEdtOutl != NULL) pEdtOutl-SetText(*pNewText); -//const_castSdrTextObj*(this)-NbcSetOutlinerParaObject(pNewText); +const_castSdrTextObj*(this)-NbcSetOutlinerParaObject(pNewText); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source
editeng/source/outliner/overflowingtxt.cxx |2 +- svx/source/svdraw/svdotextdecomposition.cxx |8 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) New commits: commit 83e85d7477b962454d8dd39f208fa7c276fe25fb Author: matteocam matteo.campane...@gmail.com Date: Fri Jun 19 00:09:29 2015 -0400 Changed way of adding ending lines for overwriting case (no insert) Change-Id: Ie13acc2e6eadb0d9b87ceaa44e21d1b9952d606e diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 99b2250..196d1f8 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -27,7 +27,7 @@ OUString OverflowingText::GetEndingLines() const { // If the only overflowing part is some lines in a paragraph, // the end of the overflowing text is its head. -if (mTailTxt == mpMidParas == NULL) +if (!HasOtherParas()) return mHeadTxt; return mTailTxt; diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 7fb4dc6..0868bf7 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -805,16 +805,20 @@ OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutlin GetTextChain()-SetOverwriteOnOverflow(pNextTextObj, false); if (mpOverflowingText-HasOtherParas()) { -// Make first paragraph +// Make Para Object from the ending lines (to be appended later) impSetOutlinerToEmptyTxt(pOutliner); Paragraph *pFstPara = pOutliner-GetParagraph(0); +pOutliner-SetText(mpOverflowingText-GetEndingLines(), pFstPara); +OutlinerParaObject *pLastPara = pOutliner-CreateParaObject(); + +// Set heading lines as first paragraph pOutliner-SetText(mpOverflowingText-GetHeadingLines(), pFstPara); // Add middle paragraphs if (mpOverflowingText-mpMidParas) pOutliner-AddText(*mpOverflowingText-mpMidParas); -pOutliner-Insert(mpOverflowingText-GetEndingLines()); +pOutliner-AddText(*pLastPara); } else { impSetOutlinerToEmptyTxt(pOutliner); Paragraph *pFstPara = pOutliner-GetParagraph(0); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/editeng/impedit3.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit e88cc3616e730655ba34095d90e11177c1d69ed3 Author: matteocam matteo.campane...@gmail.com Date: Thu Jun 18 22:57:40 2015 -0400 Check for changes in editing Change-Id: I04e1e642c877d15c8c751f8a69ac6b2da1489bf1 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 5d6ce0b..892a297 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -493,7 +493,8 @@ void ImpEditEngine::FormatDoc() CallStatusHdl();// If Modified... //FIXME(matteocam) -CallChainingEventHdl(); // For chaining +if (IsModified()) +CallChainingEventHdl(); // For chaining LeaveBlockNotifications(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - include/svx svx/source
include/svx/textchain.hxx |6 +- svx/source/svdraw/svdotext.cxx | 11 +++ svx/source/svdraw/textchain.cxx | 13 + 3 files changed, 29 insertions(+), 1 deletion(-) New commits: commit 465d9d703de940244adb218e60a4f2f77b7c036d Author: matteocam matteo.campane...@gmail.com Date: Thu Jun 18 23:33:28 2015 -0400 Controlling for underflow handling Change-Id: I26fb6b4878e1bca1ea09872624631578a568896d diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx index 01798d5..a03bf57 100644 --- a/include/svx/textchain.hxx +++ b/include/svx/textchain.hxx @@ -41,7 +41,7 @@ class ImpChainLinkProperties ImpChainLinkProperties(); bool bOverwriteOnOverflow; -// all kind of stuff such has MergeableFirstParagraphs or if overwrite should occurr on overflow +bool bHandlingUnderflow; }; @@ -60,9 +60,13 @@ class TextChain { // return whether a paragraph is split between the two links in the argument bool GetLinksHaveMergeableFirstPara(SdrTextObj *, SdrTextObj *); + void SetOverwriteOnOverflow(SdrTextObj *, bool ); bool GetOverwriteOnOverflow(SdrTextObj *pTarget); +bool GetLinkHandlingUnderflow(SdrTextObj *pTarget); +void SetLinkHandlingUnderflow(SdrTextObj *, bool); + protected: LinkPropertiesMap maLinkPropertiesMap; }; diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 8ac625e..911dadc 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1999,9 +1999,17 @@ void SdrTextObj::onUnderflowStatusEvent( ) SdrTextObj *pNextLink = GetNextLinkInChain(); SdrOutliner aDrawOutliner = ImpGetDrawOutliner(); +if (GetTextChain()-GetLinkHandlingUnderflow(this)) +{ +GetTextChain()-SetLinkHandlingUnderflow(this, false); +return; +} + if (!pNextLink-HasText()) return; + + // 1) get the text of the other guy and add it to the last paragraph // XXX: For now it's not merging anything just adding the while thing as a separate para OutlinerParaObject *pNextLinkWholeText = pNextLink-GetOutlinerParaObject(); @@ -2016,6 +2024,9 @@ void SdrTextObj::onUnderflowStatusEvent( ) // (since this happens automatically by overflow we just order to reset the destination box's text) GetTextChain()-SetOverwriteOnOverflow(pNextLink, true); +// We make sure we don't handle underflow while handling underflow +GetTextChain()-SetLinkHandlingUnderflow(this, true); + if (pEdtOutl != NULL) pEdtOutl-SetText(*pNewText); diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx index 3637d45..3e4f546 100644 --- a/svx/source/svdraw/textchain.cxx +++ b/svx/source/svdraw/textchain.cxx @@ -25,6 +25,7 @@ ImpChainLinkProperties::ImpChainLinkProperties() { // give defaults bOverwriteOnOverflow = false; +bHandlingUnderflow = false; } // XXX: All getters in the class assume that the guy is in the chain @@ -59,6 +60,18 @@ bool TextChain::GetLinksHaveMergeableFirstPara(SdrTextObj* /* pPrevLink */, SdrT return false; } +bool TextChain::GetLinkHandlingUnderflow(SdrTextObj *pTarget) +{ +ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget); +return pLinkProperties-bHandlingUnderflow; +} + +void TextChain::SetLinkHandlingUnderflow(SdrTextObj *pTarget, bool bHandlingUnderflow) +{ +ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget); +pLinkProperties-bHandlingUnderflow = bHandlingUnderflow; +} + void TextChain::SetOverwriteOnOverflow(SdrTextObj *pTarget, bool bOverwrite) { ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget); ___ 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' - include/svx sd/source svx/source
include/svx/svdedxv.hxx|1 + include/svx/svdotext.hxx | 12 ++-- sd/source/ui/view/outlview.cxx |1 + svx/source/svdraw/svdedxv.cxx | 17 +++-- svx/source/svdraw/svdotext.cxx | 26 +++--- svx/source/svdraw/svdotxed.cxx |7 --- 6 files changed, 30 insertions(+), 34 deletions(-) New commits: commit b4143933ae098e985ec5bf5b7bd92dc4c7b35aa3 Author: matteocam matteo.campane...@gmail.com Date: Fri Jun 19 01:21:04 2015 -0400 Chaining handlers moved from SdrTextObj::*TextEdit to SdrObjEditView Change-Id: I047433cdedeebb076d3e98e44209f3a582e31be1 diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx index 0a8eeac..1bedfce 100644 --- a/include/svx/svdedxv.hxx +++ b/include/svx/svdedxv.hxx @@ -117,6 +117,7 @@ protected: // Handler fuer AutoGrowing und Chained Text bei aktivem Outliner DECL_LINK(ImpOutlinerStatusEventHdl,EditStatus*); +DECL_LINK(ImpChainingEventHdl,void*); DECL_LINK(ImpOutlinerCalcFieldValueHdl,EditFieldInfo*); // link for EndTextEditHdl diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index 9dcb58a..e66dff0 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -323,6 +323,10 @@ protected: virtual ~SdrTextObj(); +virtual void onOverflowStatusEvent( ); +virtual void onUnderflowStatusEvent( ); + + public: TYPEINFO_OVERRIDE(); @@ -548,9 +552,8 @@ public: /** called from the SdrObjEditView during text edit when the status of the edit outliner changes */ virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus ); - -virtual void onOverflowStatusEvent( ); -virtual void onUnderflowStatusEvent( ); + /** called from the SdrObjEditView during text edit when a chain of boxes is to be updated */ +virtual void onChainingEvent(); @@ -621,9 +624,6 @@ public: void impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const; OutlinerParaObject *impGetNonOverflowingParaObject(SdrOutliner *pOutliner) const; -// Handler for Chained Text -DECL_LINK(ImpDecomposeChainedText,void*); - // timing generators void impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList rAnimList) const; void impGetScrollTextTiming(drawinglayer::animation::AnimationEntryList rAnimList, double fFrameLength, double fTextLength) const; diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 4436bdd..543b59c 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -1413,6 +1413,7 @@ void OutlineView::ResetLinks() const mrOutliner.SetDrawPortionHdl(aEmptyLink); mrOutliner.SetBeginPasteOrDropHdl(aEmptyLink); mrOutliner.SetEndPasteOrDropHdl(aEmptyLink); +mrOutliner.SetChainingEventHdl(aEmptyLink); } sal_Int8 OutlineView::AcceptDrop( const AcceptDropEvent, DropTargetHelper, ::sd::Window*, sal_uInt16, sal_uInt16) diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index e334ecc..e6f2cc9 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -472,6 +472,19 @@ IMPL_LINK(SdrObjEditView,ImpOutlinerStatusEventHdl,EditStatus*,pEditStat) return 0; } +IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl) +{ +if(pTextEditOutliner ) +{ +SdrTextObj* pTextObj = dynamic_cast SdrTextObj * ( mxTextEditObj.get() ); +if( pTextObj ) +{ +pTextObj-onChainingEvent(); +} +} +return 0; +} + IMPL_LINK(SdrObjEditView,ImpOutlinerCalcFieldValueHdl,EditFieldInfo*,pFI) { bool bOk=false; @@ -712,8 +725,8 @@ bool SdrObjEditView::SdrBeginTextEdit( pTextEditOutlinerView-ShowCursor(); pTextEditOutliner-SetStatusEventHdl(LINK(this,SdrObjEditView,ImpOutlinerStatusEventHdl)); -// FIXME(matteocam) // For chaining - //pTextEditOutliner-SetStatusEventHdl1(LINK(this,SdrObjEditView,ImpOutlinerStatusEventHdl)); + pTextEditOutliner-SetChainingEventHdl(LINK(this,SdrObjEditView,ImpChainingEventHdl) ); + #ifdef DBG_UTIL if (pItemBrowser!=NULL) pItemBrowser-SetDirty(); #endif diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 911dadc..b6b390e 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1986,16 +1986,6 @@ void SdrTextObj::onOverflowStatusEvent( ) void SdrTextObj::onUnderflowStatusEvent( ) { -// Underflow: -/* - * - * If there is no overflow and other guy has text then: - * 1) get the text of the other guy and add it to the last paragraph - * (if the paragraphs are to be merged, no otherwise). - * 2) Set the text of the other guy to what is left - * -*/ - SdrTextObj *pNextLink = GetNextLinkInChain(); SdrOutliner aDrawOutliner = ImpGetDrawOutliner(); @@ -2008,14 +1998,13 @@ void SdrTextObj::onUnderflowStatusEvent
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
svx/source/svdraw/svdotextdecomposition.cxx | 29 ++-- 1 file changed, 27 insertions(+), 2 deletions(-) New commits: commit d50fd94d02ab9dc97619e788c8607ebfa3482c45 Author: matteocam matteo.campane...@gmail.com Date: Thu Jun 18 16:13:37 2015 -0400 Implements overwriting behavior in SdrTextObj for underflow. Bugged. Change-Id: I20e8d7e7343621f652603ce76d0d7ae92a6e6483 diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 009bb4a..7fb4dc6 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -796,8 +796,33 @@ OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutlin if (mpOverflowingText == NULL) return NULL; -// XXX: Not sure if necessary -//pOutliner-Clear(); +// XXX: Put following code in a separate method (possibly in another class) +if ( GetTextChain()-GetOverwriteOnOverflow(pNextTextObj) ) +{ +// We only make three blocks of paragraphs and ignore the rest + +// reset behavior +GetTextChain()-SetOverwriteOnOverflow(pNextTextObj, false); + +if (mpOverflowingText-HasOtherParas()) { +// Make first paragraph +impSetOutlinerToEmptyTxt(pOutliner); +Paragraph *pFstPara = pOutliner-GetParagraph(0); +pOutliner-SetText(mpOverflowingText-GetHeadingLines(), pFstPara); + +// Add middle paragraphs +if (mpOverflowingText-mpMidParas) +pOutliner-AddText(*mpOverflowingText-mpMidParas); + +pOutliner-Insert(mpOverflowingText-GetEndingLines()); +} else { +impSetOutlinerToEmptyTxt(pOutliner); +Paragraph *pFstPara = pOutliner-GetParagraph(0); +pOutliner-SetText(mpOverflowingText-GetEndingLines(), pFstPara); +} + +return pOutliner-CreateParaObject(); +} OutlinerParaObject *pCurTxt = pNextTextObj-GetOutlinerParaObject(); pOutliner-SetText(*pCurTxt); ___ 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' - svx/source
svx/source/svdraw/svdotext.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit d2f0ea3a37ba07e29d3841ae46818ad2a5e38fc1 Author: matteocam matteo.campane...@gmail.com Date: Thu Jun 18 16:29:06 2015 -0400 Updating editing outliner in case of underflow Change-Id: I4d5fa2c9e33db614dbe3352cddc1e3c6cb8cafd2 diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 2ff88aa..8ac625e 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2016,6 +2016,9 @@ void SdrTextObj::onUnderflowStatusEvent( ) // (since this happens automatically by overflow we just order to reset the destination box's text) GetTextChain()-SetOverwriteOnOverflow(pNextLink, true); +if (pEdtOutl != NULL) +pEdtOutl-SetText(*pNewText); + const_castSdrTextObj*(this)-NbcSetOutlinerParaObject(pNewText); } ___ 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' - include/svx svx/source
include/svx/textchain.hxx | 24 - svx/source/svdraw/textchain.cxx | 44 +--- 2 files changed, 59 insertions(+), 9 deletions(-) New commits: commit d674ed2e472d555a0eb4ec46c7d104ae85907794 Author: matteocam matteo.campane...@gmail.com Date: Thu Jun 18 15:24:10 2015 -0400 Prototype of TextChain having support for overwrite on overflow Change-Id: I6ea6e4053663ecdb3e484d857e0a9dd3b7fc1dae diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx index b3eda9b..01798d5 100644 --- a/include/svx/textchain.hxx +++ b/include/svx/textchain.hxx @@ -29,16 +29,19 @@ namespace rtl { class OUString; } -typedef std::map rtl::OUString, ImpChainLinkProperties LinkPropertiesMaps; +typedef rtl::OUString ChainLinkId; +typedef std::map ChainLinkId, ImpChainLinkProperties * LinkPropertiesMap; class ImpChainLinkProperties { -public: +protected: friend class TextChain; -private: -// all kind of stuff such has MergeableFirstParagraphs or if overflapping should occurr on overflow +ImpChainLinkProperties(); + +bool bOverwriteOnOverflow; +// all kind of stuff such has MergeableFirstParagraphs or if overwrite should occurr on overflow }; @@ -46,13 +49,22 @@ class TextChain { public: TextChain(); +~TextChain(); + void AppendLink(SdrTextObj *); -SdrTextObj *GetNextLink(SdrTextObj *); +bool IsLinkInChain(SdrTextObj *) const; +SdrTextObj *GetNextLink(SdrTextObj *) const; + +ChainLinkId GetId(SdrTextObj *) const; +ImpChainLinkProperties *GetLinkProperties(SdrTextObj *); // return whether a paragraph is split between the two links in the argument -bool GetLinksHaveMergeableFirstPara(SdrTextObj *pPrevLink, SdrTextObj *pNextLink); +bool GetLinksHaveMergeableFirstPara(SdrTextObj *, SdrTextObj *); void SetOverwriteOnOverflow(SdrTextObj *, bool ); bool GetOverwriteOnOverflow(SdrTextObj *pTarget); + +protected: +LinkPropertiesMap maLinkPropertiesMap; }; #endif // INCLUDED_SVX_TEXTCHAIN_HXX diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx index 709d562..3637d45 100644 --- a/svx/source/svdraw/textchain.cxx +++ b/svx/source/svdraw/textchain.cxx @@ -20,20 +20,40 @@ #include svx/textchain.hxx #include svx/svdotext.hxx + +ImpChainLinkProperties::ImpChainLinkProperties() +{ +// give defaults +bOverwriteOnOverflow = false; +} + +// XXX: All getters in the class assume that the guy is in the chain + TextChain::TextChain() { } +TextChain::~TextChain() +{ +// XXX: Should free all LinkProperties +} + +bool TextChain::IsLinkInChain(SdrTextObj *) const +{ +return true;// XXX: Should make an actual check +} + void TextChain::AppendLink(SdrTextObj *) { +// XXX } -SdrTextObj *TextChain::GetNextLink(SdrTextObj *) +SdrTextObj *TextChain::GetNextLink(SdrTextObj *) const { -return NULL; // XXX +return NULL; // XXX: To be changed. It'd be a mess to implement now } -bool TextChain::GetLinksHaveMergeableFirstPara(SdrTextObj *pPrevLink, SdrTextObj *pNextLink) +bool TextChain::GetLinksHaveMergeableFirstPara(SdrTextObj* /* pPrevLink */, SdrTextObj* /* pNextLink */) { // XXX return false; @@ -41,12 +61,30 @@ bool TextChain::GetLinksHaveMergeableFirstPara(SdrTextObj *pPrevLink, SdrTextObj void TextChain::SetOverwriteOnOverflow(SdrTextObj *pTarget, bool bOverwrite) { +ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget); +pLinkProperties-bOverwriteOnOverflow = bOverwrite; +} + +ImpChainLinkProperties *TextChain::GetLinkProperties(SdrTextObj *pLink) +{ +// if the guy does not already have properties in the map make them +ChainLinkId aLinkId = GetId(pLink); +if (maLinkPropertiesMap.find(aLinkId) == maLinkPropertiesMap.end()) { +maLinkPropertiesMap[aLinkId] = new ImpChainLinkProperties; +} +return maLinkPropertiesMap[aLinkId]; } bool TextChain::GetOverwriteOnOverflow(SdrTextObj *pTarget) { +ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget); +return pLinkProperties-bOverwriteOnOverflow; +} +ChainLinkId TextChain::GetId(SdrTextObj *pLink) const +{ +return pLink-GetName(); } /* 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' - svx/source
svx/source/svdraw/svdotextdecomposition.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 65369247ade3795e292a05ebfc184bdd03fe0035 Author: matteocam matteo.campane...@gmail.com Date: Wed Jun 17 14:22:03 2015 -0400 No more empty line at the beginning of dest box after overflow Change-Id: I40e75163868244c0fef06834cf6b5d7ec8d8d023 diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index cd3e2c7..009bb4a 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -845,8 +845,11 @@ OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutlin // Append old first para in the destination box to // last part of overflowing text -if (pJoiningPara) +if (pJoiningPara mpOverflowingText-HasOtherParas()) pOutliner-AddText(*pJoiningPara); +// this second case is if there is to avoid getting an empty line before pJoiningPara +else if (pJoiningPara !mpOverflowingText-HasOtherParas()) +pOutliner-SetText(*pJoiningPara); // Append all other old paras if (pOldParasTail) ___ 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' - svx/source
svx/source/svdraw/svdotext.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit b176420cd51fdcc1d3ee9c49859261a709ab4f77 Author: matteocam matteo.campane...@gmail.com Date: Wed Jun 17 16:01:30 2015 -0400 Fixed return statement Change-Id: If878c18267b5e027395ce1fcb9c6eb17586a2d85 diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 173722b..87cef77 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2079,10 +2079,10 @@ bool SdrTextObj::GetPreventChainable() const IMPL_LINK_NOARG(SdrTextObj,ImpDecomposeChainedText) { if (!IsChainable() || GetNextLinkInChain() == NULL) -return; +return 0; if (!pEdtOutl) -return; +return 0; bool bIsPageOverflow = pEdtOutl-IsPageOverflow(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/svx svx/source
editeng/source/editeng/impedit3.cxx |1 - include/svx/svdotext.hxx|4 ++-- svx/source/svdraw/svdotext.cxx | 11 --- 3 files changed, 10 insertions(+), 6 deletions(-) New commits: commit 8aeead9b031b0d9415ea2fe740f9c626401b0d1f Author: matteocam matteo.campane...@gmail.com Date: Wed Jun 17 15:39:58 2015 -0400 Moved overflow check from ImpEditEng to SdrTextObj during editing mode Change-Id: I023d3960a3f6952bc9c21114bcd84d0be1a6ff42 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 13e6030..5d6ce0b 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -4081,7 +4081,6 @@ void ImpEditEngine::CallChainingEventHdl() // only if it's the right ImpEditEngine (with right info on changes in text) if ( aChainingHdlLink.IsSet() /* aStatus.GetStatusWord() */) { -CheckPageOverflow(); aChainingHdlLink.Call( mbNeedsChainingHandling ); } diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index bbc9207..32321f4 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -549,7 +549,7 @@ public: /** called from the SdrObjEditView during text edit when the status of the edit outliner changes */ virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus ); -virtual void onOverflowStatusEvent( bool bIsPageOverflow ); +virtual void onOverflowStatusEvent( ); @@ -621,7 +621,7 @@ public: OutlinerParaObject *impGetNonOverflowingParaObject(SdrOutliner *pOutliner) const; // Handler for Chained Text -DECL_LINK(ImpDecomposeChainedText,bool*); +DECL_LINK(ImpDecomposeChainedText,void*); // timing generators void impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList rAnimList) const; diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index cc17892..e67f5e6 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1964,11 +1964,16 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus ) } } -void SdrTextObj::onOverflowStatusEvent( bool bIsPageOverflow ) +void SdrTextObj::onOverflowStatusEvent( ) { if (!IsChainable()) return; +if (!pEdtOutl) +return; + +bool bIsPageOverflow = pEdtOutl-IsPageOverflow(); + if ( GetNextLinkInChain() != NULL ) // is there anything to transfer text to? { // set whether there is need for chaining @@ -2090,9 +2095,9 @@ bool SdrTextObj::GetPreventChainable() const return pClone; } -IMPL_LINK(SdrTextObj,ImpDecomposeChainedText,bool*,bIsPageOverflow) +IMPL_LINK_NOARG(SdrTextObj,ImpDecomposeChainedText) { -onOverflowStatusEvent( *bIsPageOverflow ); +onOverflowStatusEvent(); return 0; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
svx/source/svdraw/svdotext.cxx | 68 ++--- 1 file changed, 37 insertions(+), 31 deletions(-) New commits: commit 9b37e4a0f460fb81758cb62a38f0c664b3b4d34a Author: matteocam matteo.campane...@gmail.com Date: Wed Jun 17 15:56:59 2015 -0400 Drafted status change logic to support underflow Change-Id: I8996146dcc3d6c08cdff7c673f43cca829de39a6 diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index e67f5e6..173722b 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1966,39 +1966,20 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus ) void SdrTextObj::onOverflowStatusEvent( ) { -if (!IsChainable()) -return; - -if (!pEdtOutl) -return; - -bool bIsPageOverflow = pEdtOutl-IsPageOverflow(); - -if ( GetNextLinkInChain() != NULL ) // is there anything to transfer text to? -{ -// set whether there is need for chaining -// (used in EndTextEdit to crop the overflowing part) -// XXX: might be removed later when we remove text in real time -SetToBeChained( bIsPageOverflow ); -fprintf(stderr, [CHAINING] Need for Chaining is %s\n, -bIsPageOverflow ? TRUE : FALSE); - -// Pushes text in next link on the fly -if ( bIsPageOverflow ) { -SdrOutliner aDrawOutliner = ImpGetDrawOutliner(); -if (pEdtOutl != NULL) -mpOverflowingText = pEdtOutl-GetOverflowingText(); -else -mpOverflowingText = aDrawOutliner.GetOverflowingText(); +// Pushes text in next link on the fly +if ( mbToBeChained ) { +SdrOutliner aDrawOutliner = ImpGetDrawOutliner(); +if (pEdtOutl != NULL) +mpOverflowingText = pEdtOutl-GetOverflowingText(); +else +mpOverflowingText = aDrawOutliner.GetOverflowingText(); -SdrTextObj *pNextTextObj = GetNextLinkInChain(); +SdrTextObj *pNextTextObj = GetNextLinkInChain(); -impLeaveOnlyNonOverflowingText(aDrawOutliner); - -// Transfer overflowing text -impMoveChainedTextToNextLink(aDrawOutliner, pNextTextObj); -} +impLeaveOnlyNonOverflowingText(aDrawOutliner); +// Transfer overflowing text +impMoveChainedTextToNextLink(aDrawOutliner, pNextTextObj); } } @@ -2097,7 +2078,32 @@ bool SdrTextObj::GetPreventChainable() const IMPL_LINK_NOARG(SdrTextObj,ImpDecomposeChainedText) { -onOverflowStatusEvent(); +if (!IsChainable() || GetNextLinkInChain() == NULL) +return; + +if (!pEdtOutl) +return; + +bool bIsPageOverflow = pEdtOutl-IsPageOverflow(); + +// Propagates the need for change +SetToBeChained( bIsPageOverflow ); +fprintf(stderr, [CHAINING] Need for Chaining is %s\n, +bIsPageOverflow ? TRUE : FALSE); + +if ( bIsPageOverflow ) { +onOverflowStatusEvent(); +} else { +// Underflow: +/* + * + * If there is no overflow and other guy has text then: + * 1) get the text of the other guy and add it to the last paragraph + * (if the paragraphs are to be merged, no otherwise). + * 2) Set the text of the other guy to what is left + * +*/ +} return 0; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
svx/source/svdraw/svdotext.cxx |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) New commits: commit 97d5e2f3161cc7ede179dfeda89658d509c009eb Author: matteocam matteo.campane...@gmail.com Date: Wed Jun 17 16:41:32 2015 -0400 Causing overflow to transfer text in underflowing src box Change-Id: I6fa247a4d0388aedbb9aff0bd7afd502b90c9337 diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index f9212b5..3713040 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1996,7 +1996,7 @@ void SdrTextObj::onUnderflowStatusEvent( ) */ SdrTextObj *pNextLink = GetNextLinkInChain(); -SdrOutliner rOutl = ImpGetDrawOutliner(); +SdrOutliner aDrawOutliner = ImpGetDrawOutliner(); if (!pNextLink-HasText()) return; @@ -2005,7 +2005,12 @@ void SdrTextObj::onUnderflowStatusEvent( ) // XXX: For now it's not merging anything just adding the while thing as a separate para OutlinerParaObject *pNextLinkWholeText = pNextLink-GetOutlinerParaObject(); if (pNextLinkWholeText) { - +// Set text from this object +OutlinerParaObject *pCurText = GetOutlinerParaObject(); +aDrawOutliner.SetText(*pCurText); +aDrawOutliner.AddText(*pNextLinkWholeText); +OutlinerParaObject *pNewText = aDrawOutliner.CreateParaObject(); +const_castSdrTextObj*(this)-NbcSetOutlinerParaObject(pNewText); } } ___ 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' - include/svx svx/source
include/svx/svdotext.hxx |1 + svx/source/svdraw/svdotext.cxx |6 ++ 2 files changed, 7 insertions(+) New commits: commit 95e136712bde6f457184464d0477ec7b720b4b89 Author: matteocam matteo.campane...@gmail.com Date: Wed Jun 17 16:06:32 2015 -0400 Added SdrTextObj::onUnderflowStatusEvent Change-Id: I8661462f01d6ec23bed86275c9bbf7b94a5ab546 diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index 32321f4..9dcb58a 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -550,6 +550,7 @@ public: virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus ); virtual void onOverflowStatusEvent( ); +virtual void onUnderflowStatusEvent( ); diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 87cef77..867423b 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1983,6 +1983,11 @@ void SdrTextObj::onOverflowStatusEvent( ) } } +void SdrTextObj::onUnderflowStatusEvent( ) +{ + +} + /** returns the currently active text. */ SdrText* SdrTextObj::getActiveText() const { @@ -2103,6 +2108,7 @@ IMPL_LINK_NOARG(SdrTextObj,ImpDecomposeChainedText) * 2) Set the text of the other guy to what is left * */ +onUnderflowStatusEvent(); } return 0; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - include/svx svx/source
include/svx/textchain.hxx | 23 ++- svx/source/svdraw/svdotext.cxx |1 + svx/source/svdraw/textchain.cxx | 11 +++ 3 files changed, 34 insertions(+), 1 deletion(-) New commits: commit 5b9dc85fd7134abba82dd1910f9fb726535f9e97 Author: matteocam matteo.campane...@gmail.com Date: Wed Jun 17 17:47:40 2015 -0400 Drafted classes and methods for implemening underflow as overwriting overflow Change-Id: Ie7a904dc0cae0b2403d777390f5ee8eae534a6f7 diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx index 42dc999..b3eda9b 100644 --- a/include/svx/textchain.hxx +++ b/include/svx/textchain.hxx @@ -20,8 +20,28 @@ #ifndef INCLUDED_SVX_TEXTCHAIN_HXX #define INCLUDED_SVX_TEXTCHAIN_HXX +#include map + +class ImpChainLinkProperties; class SdrTextObj; +namespace rtl { +class OUString; +} + +typedef std::map rtl::OUString, ImpChainLinkProperties LinkPropertiesMaps; + + +class ImpChainLinkProperties +{ +public: +friend class TextChain; + +private: +// all kind of stuff such has MergeableFirstParagraphs or if overflapping should occurr on overflow +}; + + class TextChain { public: @@ -31,7 +51,8 @@ class TextChain { // return whether a paragraph is split between the two links in the argument bool GetLinksHaveMergeableFirstPara(SdrTextObj *pPrevLink, SdrTextObj *pNextLink); - +void SetOverwriteOnOverflow(SdrTextObj *, bool ); +bool GetOverwriteOnOverflow(SdrTextObj *pTarget); }; #endif // INCLUDED_SVX_TEXTCHAIN_HXX diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 64d1937..2ff88aa 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -46,6 +46,7 @@ #include svx/xflgrit.hxx #include svx/svdpool.hxx #include svx/xflclit.hxx +#include svx/textchain.hxx #include svl/style.hxx #include editeng/editeng.hxx #include editeng/overflowingtxt.hxx diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx index a4495b0..709d562 100644 --- a/svx/source/svdraw/textchain.cxx +++ b/svx/source/svdraw/textchain.cxx @@ -38,4 +38,15 @@ bool TextChain::GetLinksHaveMergeableFirstPara(SdrTextObj *pPrevLink, SdrTextObj // XXX return false; } + +void TextChain::SetOverwriteOnOverflow(SdrTextObj *pTarget, bool bOverwrite) +{ + +} + +bool TextChain::GetOverwriteOnOverflow(SdrTextObj *pTarget) +{ + +} + /* 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' - svx/source
svx/source/svdraw/svdotext.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 408b16a197b6fdf2dcedecb4531b5507dd5c350f Author: matteocam matteo.campane...@gmail.com Date: Wed Jun 17 17:32:11 2015 -0400 Sets dest box's text by resetting it on underflow Change-Id: I4276e37536e834f79b79acea2b0f2a8b2182f632 diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 3713040..64d1937 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2010,6 +2010,11 @@ void SdrTextObj::onUnderflowStatusEvent( ) aDrawOutliner.SetText(*pCurText); aDrawOutliner.AddText(*pNextLinkWholeText); OutlinerParaObject *pNewText = aDrawOutliner.CreateParaObject(); + +// 2) Set the text of the next guy to what is left +// (since this happens automatically by overflow we just order to reset the destination box's text) +GetTextChain()-SetOverwriteOnOverflow(pNextLink, true); + const_castSdrTextObj*(this)-NbcSetOutlinerParaObject(pNewText); } ___ 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' - svx/source
svx/source/svdraw/svdotext.cxx | 31 ++- 1 file changed, 22 insertions(+), 9 deletions(-) New commits: commit ff877f13e0d4400ae87edb15d8264194c8fdd6d2 Author: matteocam matteo.campane...@gmail.com Date: Wed Jun 17 16:33:03 2015 -0400 Drafted onUnderflowStatusEvent Change-Id: Ib549faad03c4469fd4843db10c02d7425a6db673 diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 867423b..f9212b5 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1985,6 +1985,28 @@ void SdrTextObj::onOverflowStatusEvent( ) void SdrTextObj::onUnderflowStatusEvent( ) { +// Underflow: +/* + * + * If there is no overflow and other guy has text then: + * 1) get the text of the other guy and add it to the last paragraph + * (if the paragraphs are to be merged, no otherwise). + * 2) Set the text of the other guy to what is left + * +*/ + +SdrTextObj *pNextLink = GetNextLinkInChain(); +SdrOutliner rOutl = ImpGetDrawOutliner(); + +if (!pNextLink-HasText()) +return; + +// 1) get the text of the other guy and add it to the last paragraph +// XXX: For now it's not merging anything just adding the while thing as a separate para +OutlinerParaObject *pNextLinkWholeText = pNextLink-GetOutlinerParaObject(); +if (pNextLinkWholeText) { + +} } @@ -2099,15 +2121,6 @@ IMPL_LINK_NOARG(SdrTextObj,ImpDecomposeChainedText) if ( bIsPageOverflow ) { onOverflowStatusEvent(); } else { -// Underflow: -/* - * - * If there is no overflow and other guy has text then: - * 1) get the text of the other guy and add it to the last paragraph - * (if the paragraphs are to be merged, no otherwise). - * 2) Set the text of the other guy to what is left - * -*/ onUnderflowStatusEvent(); } return 0; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - include/svx svx/Library_svxcore.mk svx/source
include/svx/textchain.hxx | 37 svx/Library_svxcore.mk |1 svx/source/svdraw/svdotextdecomposition.cxx |3 ++ svx/source/svdraw/textchain.cxx | 34 + 4 files changed, 75 insertions(+) New commits: commit f19f80e6fc3b15f2fe266fac827ffed75e1f02fe Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 16 11:36:39 2015 -0400 Added textchain.?xx files Change-Id: Ib35e73b791c1e78b06e97e56ed6a210d129c632c diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx new file mode 100644 index 000..e094334 --- /dev/null +++ b/include/svx/textchain.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SVX_TEXTCHAIN_HXX +#define INCLUDED_SVX_TEXTCHAIN_HXX + +class SdrTextObj; + +class TextChain { + +public: +TextChain(); +void AppendLink(SdrTextObj *); +SdrTextObj *GetNextLink(SdrTextObj *); + +}; + +#endif // INCLUDED_SVX_TEXTCHAIN_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ + diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index 7ed776f..816bae4 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -325,6 +325,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\ svx/source/svdraw/svdview \ svx/source/svdraw/svdviter \ svx/source/svdraw/svdxcgv \ +svx/source/svdraw/textchain \ svx/source/table/cell \ svx/source/table/cellcursor \ svx/source/table/cellrange \ diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 45edac2..a0d6823 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -23,6 +23,7 @@ #include svx/svdpage.hxx #include svx/svdotext.hxx #include svx/svdmodel.hxx +#include svx/textchain.hxx #include basegfx/vector/b2dvector.hxx #include sdr/primitive2d/sdrtextprimitive2d.hxx #include drawinglayer/primitive2d/textprimitive2d.hxx @@ -1627,6 +1628,8 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( /* Begin overflow handling */ +TextChain *aTxtChain = new TextChain; + // If overflow occurs we have to cut the text at the right point // If in edit mode ImpEditEngine should have taken care of this if ( rOutliner.IsPageOverflow() !IsInEditMode()) { diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx new file mode 100644 index 000..194d4d4 --- /dev/null +++ b/svx/source/svdraw/textchain.cxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include svx/textchain.hxx +#include svx/svdotext.hxx + +TextChain::TextChain() +{ +} + +void TextChain::AppendLink(SdrTextObj *) +{ +} + +SdrTextObj *TextChain::GetNextLink(SdrTextObj *) +{ +return NULL; // XXX +} ___ 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' - include/svx
include/svx/svdotext.hxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 94cf197e6d786e6e2b9a17221b7a2faa0e5f9e4d Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 16 12:03:51 2015 -0400 TextChain is friend of SdrTextObj Change-Id: I866fe10993296670bcca3883cf1ea5492f2ae5c9 diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index 9fd6262..83b488e 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -44,6 +44,7 @@ class SdrTextObj; class SvxFieldItem; class ImpSdrObjTextLink; class EditStatus; +class TextChain; namespace sdr { namespace properties { class TextProperties; @@ -135,6 +136,8 @@ private: friend classsdr::table::SdrTableRtfExporter; friend classsdr::table::SdrTableRTFParser; +friend classTextChain; + // CustomShapeproperties need to access the bTextFrame member: friend class sdr::properties::CustomShapeProperties; ___ 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' - include/svx svx/source
include/svx/svdmodel.hxx|5 + include/svx/svdotext.hxx|1 + include/svx/textchain.hxx |3 +++ svx/source/svdraw/svdmodel.cxx | 14 ++ svx/source/svdraw/svdotext.cxx |8 svx/source/svdraw/textchain.cxx |5 + 6 files changed, 36 insertions(+) New commits: commit dde308668425a5849d49e3ac5040e2157141cc6c Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 16 12:35:28 2015 -0400 Changed SdrModel and SdrTextObj to use TextChain Change-Id: I3e2e4cbe861f48366e3ab0abbe83c97e0aafe69b diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index bdc992d..c7f7233 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -75,6 +75,8 @@ class SotStorage; class SdrOutlinerCache; class SdrUndoFactory; class ImageMap; +class TextChain; + namespace comphelper { class IEmbeddedHelper; @@ -211,6 +213,8 @@ protected: sal_uInt16 nDefaultTabulator; sal_uInt32 nMaxUndoCount; +TextChain* pTextChain; + // sdr::Comment interface @@ -328,6 +332,7 @@ public: SdrOutliner GetDrawOutliner(const SdrTextObj* pObj=NULL) const; SdrOutliner GetChainingOutliner(const SdrTextObj* pObj=NULL) const; +TextChain *GetTextChain() const; SdrOutliner GetHitTestOutliner() const { return *pHitTestOutliner; } const SdrTextObj*GetFormattingTextObj() const; diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index 83b488e..bbc9207 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -361,6 +361,7 @@ public: bool IsChainable() const { return GetNextLinkInChain() != NULL; } void SetPreventChainable(); bool GetPreventChainable() const; +TextChain *GetTextChain() const; SdrObjKind GetTextKind() const { return eTextKind; } diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx index e094334..42dc999 100644 --- a/include/svx/textchain.hxx +++ b/include/svx/textchain.hxx @@ -29,6 +29,9 @@ class TextChain { void AppendLink(SdrTextObj *); SdrTextObj *GetNextLink(SdrTextObj *); +// return whether a paragraph is split between the two links in the argument +bool GetLinksHaveMergeableFirstPara(SdrTextObj *pPrevLink, SdrTextObj *pNextLink); + }; #endif // INCLUDED_SVX_TEXTCHAIN_HXX diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index ce0ff7a..19652f4 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -54,6 +54,7 @@ #include svx/svdpool.hxx #include svx/svdobj.hxx #include svx/svdotext.hxx +#include svx/textchain.hxx #include svx/svdetc.hxx #include svx/svdoutl.hxx #include svx/svdoole2.hxx @@ -212,9 +213,17 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe pHitTestOutliner = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, this ); ImpSetOutlinerDefaults(pHitTestOutliner, true); +// FIXME(matteocam) +/* Start Text Chaining related code */ + +// Initialize Chaining Outliner pChainingOutliner = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, this ); ImpSetOutlinerDefaults(pChainingOutliner, true); +// Make a TextChain +pTextChain = new TextChain; + +/* End Text Chaining related code */ ImpCreateTables(); } @@ -1977,6 +1986,11 @@ void SdrModel::PageListChanged() { } +TextChain *SdrModel::GetTextChain() const +{ +return pTextChain; +} + const SdrPage* SdrModel::GetMasterPage(sal_uInt16 nPgNum) const { DBG_ASSERT(nPgNum maMaPag.size(), SdrModel::GetMasterPage: Access out of range (!)); diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 03b8388..cc17892 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1543,6 +1543,14 @@ void SdrTextObj::SetToBeChained(bool bToBeChained) mbToBeChained = bToBeChained; } +TextChain *SdrTextObj::GetTextChain() const +{ +if (!IsChainable()) +return NULL; + +return pModel-GetTextChain(); +} + void SdrTextObj::SetVerticalWriting(bool bVertical) { OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject(); diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx index 194d4d4..17595c9 100644 --- a/svx/source/svdraw/textchain.cxx +++ b/svx/source/svdraw/textchain.cxx @@ -32,3 +32,8 @@ SdrTextObj *TextChain::GetNextLink(SdrTextObj *) { return NULL; // XXX } + +bool TextChain::GetLinksHaveMergeableFirstPara(SdrTextObj *pPrevLink, SdrTextObj *pNextLink) +{ + +} ___ 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/Library_editeng.mk editeng/source include/editeng svx/source
editeng/Library_editeng.mk |1 editeng/source/outliner/overflowingtxt.cxx | 38 include/editeng/overflowingtxt.hxx |7 - svx/source/svdraw/svdotextdecomposition.cxx |2 - svx/source/svdraw/textchain.cxx |1 5 files changed, 47 insertions(+), 2 deletions(-) New commits: commit 5d9277e7b55b7eef512113c63f7c852b583dd282 Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 16 13:34:57 2015 -0400 Added overflowingtxt.cxx; merges lines properly in more cases Change-Id: Ibffd65bb53bef7a1fbab87dff93764c4ee1feb3e diff --git a/editeng/Library_editeng.mk b/editeng/Library_editeng.mk index 9ffed0a..0d0be08 100644 --- a/editeng/Library_editeng.mk +++ b/editeng/Library_editeng.mk @@ -99,6 +99,7 @@ $(eval $(call gb_Library_add_exception_objects,editeng,\ editeng/source/outliner/outlundo \ editeng/source/outliner/outlvw \ editeng/source/outliner/paralist \ +editeng/source/outliner/overflowingtxt \ editeng/source/rtf/rtfitem \ editeng/source/rtf/svxrtf \ editeng/source/uno/unoedhlp \ diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx new file mode 100644 index 000..0f02900 --- /dev/null +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the License); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include rtl/ustring.hxx +#include tools/debug.hxx + +#include editeng/overflowingtxt.hxx + +using namespace ::rtl; + + +OUString OverflowingText::GetEndingLines() const +{ +// Only some lines in the same para overflowing +if (mHeadTxt == mpMidParas == NULL) +return mTailTxt; + +return mHeadTxt; +} + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 973729f..a921b2c 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -20,7 +20,10 @@ #ifndef INCLUDED_EDITENG_OVERFLOWINGTXT_HXX #define INCLUDED_EDITENG_OVERFLOWINGTXT_HXX -class OUString; +namespace rtl { +class OUString; +} + class OutlinerParaObject; @@ -40,6 +43,8 @@ class OverflowingText { mpMidParas(pMidParas), mTailTxt(tailTxt) { } + +OUString GetEndingLines() const; }; class NonOverflowingText { diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index a0d6823..1a56f94 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -823,7 +823,7 @@ OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutlin impSetOutlinerToEmptyTxt(pOutliner); pTmpPara0 = pOutliner-GetParagraph(0); -pOutliner-SetText(mpOverflowingText-mTailTxt + aOldPara0Txt, pTmpPara0); +pOutliner-SetText(mpOverflowingText-GetEndingLines() + aOldPara0Txt, pTmpPara0); pJoiningPara = pOutliner-CreateParaObject(); } diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx index 17595c9..28daf86 100644 --- a/svx/source/svdraw/textchain.cxx +++ b/svx/source/svdraw/textchain.cxx @@ -37,3 +37,4 @@ bool TextChain::GetLinksHaveMergeableFirstPara(SdrTextObj *pPrevLink, SdrTextObj { } +/* 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 |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
editeng/source/outliner/overflowingtxt.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 19014e70ab1ea433594e32899eca15dff79724b0 Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 16 13:42:21 2015 -0400 GetEndingLines should return head if everything is empty Change-Id: I4921c7a337f1cfe0a5b48d49492ddde9117332d1 diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 0f02900..2661c41 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -27,11 +27,11 @@ using namespace ::rtl; OUString OverflowingText::GetEndingLines() const { -// Only some lines in the same para overflowing +// Only some lines in the same para overflowing, thus the head gives the ending lines if (mHeadTxt == mpMidParas == NULL) -return mTailTxt; +return mHeadTxt; -return mHeadTxt; +return mTailTxt; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - include/editeng svx/source
include/editeng/overflowingtxt.hxx |1 + svx/source/svdraw/svdotextdecomposition.cxx |3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) New commits: commit fe00f635ab95ddb7050f847b13e65b6d25bf60a3 Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 16 18:25:37 2015 -0400 Checking whether to reuse heading text Change-Id: I0af344132bf577a0e159b871beec961f6a19 diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index baec920..e4f9a2d 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -50,6 +50,7 @@ public: OUString GetHeadingLines() const; OUString GetEndingLines() const; +bool HasOtherParas() const { return !(mTailTxt == mpMidParas == NULL); } }; class EDITENG_DLLPUBLIC NonOverflowingText { diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index b5f70fc..cd3e2c7 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -833,7 +833,8 @@ OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutlin // Set headText at the beginning of box OUString aHeadTxt = mpOverflowingText-GetHeadingLines(); -if (aHeadTxt != ) { +// If we haven't used heading text yet +if (mpOverflowingText-HasOtherParas()) { Paragraph *pNewPara0 = pOutliner-GetParagraph(0); pOutliner-SetText(aHeadTxt, pNewPara0); } ___ 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' - include/editeng svx/source
include/editeng/overflowingtxt.hxx | 10 +++--- svx/source/svdraw/svdotextdecomposition.cxx |2 -- 2 files changed, 7 insertions(+), 5 deletions(-) New commits: commit 17f19d1cca035256176fd0315155a5d4cf27516e Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 16 16:30:08 2015 -0400 Exports (Non)OverflowingText classes Change-Id: I2a4b17e4d08d830cb413fef77af59ed9c031fb1f diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index ef1cfc8..40eaa28 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -20,6 +20,8 @@ #ifndef INCLUDED_EDITENG_OVERFLOWINGTXT_HXX #define INCLUDED_EDITENG_OVERFLOWINGTXT_HXX +#include editeng/macros.hxx +#include editeng/editengdllapi.h class OUString; @@ -27,8 +29,10 @@ class OUString; class OutlinerParaObject; -class OverflowingText { -public: +class EDITENG_DLLPUBLIC OverflowingText +{ + +public: OUString mHeadTxt; const OutlinerParaObject *mpMidParas; OUString mTailTxt; @@ -47,7 +51,7 @@ class OverflowingText { OUString GetEndingLines() const; }; -class NonOverflowingText { +class EDITENG_DLLPUBLIC NonOverflowingText { public: const OutlinerParaObject *mpHeadParas; OUString mPreOverflowingTxt; diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 1a56f94..6d1a0c4 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -1628,8 +1628,6 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( /* Begin overflow handling */ -TextChain *aTxtChain = new TextChain; - // If overflow occurs we have to cut the text at the right point // If in edit mode ImpEditEngine should have taken care of this if ( rOutliner.IsPageOverflow() !IsInEditMode()) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
editeng/source/outliner/overflowingtxt.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 5e4e1e32407b40d526e54e58c69256a7d740ced2 Author: matteocam matteo.campane...@gmail.com Date: Tue Jun 16 16:39:41 2015 -0400 Fixed GetEndingLines() Change-Id: I41adadae9b5ff4d9f3221b48fd939202ef93f9bb diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index d5fa910..f591dac 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -25,8 +25,9 @@ OUString OverflowingText::GetEndingLines() const { -// Only some lines in the same para overflowing, thus the head gives the ending lines -if (mHeadTxt == mpMidParas == NULL) +// If the only overflowing part is some lines in a paragraph, +// the end of the overflowing text is its head. +if (mTailTxt == mpMidParas == NULL) return mHeadTxt; return mTailTxt; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - 3 commits - include/editeng include/svx svx/source
include/editeng/overflowingtxt.hxx |2 - include/svx/svdotext.hxx|7 ++- svx/source/svdraw/svdotext.cxx | 22 +++ svx/source/svdraw/svdotextdecomposition.cxx | 55 +--- 4 files changed, 46 insertions(+), 40 deletions(-) New commits: commit 9aa0cc23f6e7fcf7bad76ec66bec397bb1267b31 Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 15 14:20:20 2015 -0400 Prevent decomposition primitives to be called recursively Change-Id: Iab626d01c7b2850feb1f5d792373615a65e32070 diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 6a0e40d..b030462 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -775,6 +775,7 @@ OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOut return pOutliner-CreateParaObject(); } +/* Following function should not be called while decomposing static text */ void SdrTextObj::impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const { OutlinerParaObject *pNewText = impGetNonOverflowingParaObject(pOutliner); @@ -1566,36 +1567,6 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( const drawinglayer::primitive2d::SdrChainedTextPrimitive2D rSdrChainedTextPrimitive, const drawinglayer::geometry::ViewInformation2D aViewInformation) const { -/* // Previous code - To maybe be resumed later on -// FIXME(matteocam) -// fprintf(stderr, Object #0 = %p, Object #1 = %p\n, -// pPage-GetObj(0), pPage-GetObj(1)); - -//impMoveChainedTextToNextLink(pNextTextObj); // just do it - -// put overflowing text in next text box -if (IsToBeChained()) { -SdrTextObj *pNextTextObj = GetNextLinkInChain(); -assert (pNextTextObj); -// NOTE: Commented because we do not need to do this anymore (maybe and for now) -//impMoveChainedTextToNextLink(pNextTextObj); // XXX: it actually moves the overflowing text currently - -// XXX: -//const_castSdrTextObj*(this)-impLeaveOnlyNonOverflowingText(); -// Let's reset the status now to prevent infinite loops -const_castSdrTextObj*(this)-SetToBeChained( false ); -impLeaveOnlyNonOverflowingText(); - -//SdrOutliner rOutl = pNextTextObj-ImpGetDrawOutliner(); -//pNextTextObj-BegTextEdit( rOutl ); -// XXX: Also, will all those calls currently in impMoveChainedTextToNextLink be necessary too? - -}*/ - -/* -- Beginning code from impDecomposeAutoFitText -- */ -// XXX: The idea is, _for_now_, to do exactly what it does there but without the text stretching, -// hopefully to get a neutral decomposition - // decompose matrix to have position and size of text basegfx::B2DVector aScale, aTranslate; double fRotate, fShearX; @@ -1659,13 +1630,21 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( if ( rOutliner.IsPageOverflow() !IsInEditMode()) { // Save the overflowing text before changing the outliner's state const_castSdrTextObj*(this)-mpOverflowingText = rOutliner.GetOverflowingText(); -impLeaveOnlyNonOverflowingText(rOutliner); + +/* Leave only non overflowing text */ +OutlinerParaObject *pNewTextCurBox = impGetNonOverflowingParaObject(rOutliner); +// we need this when we are in editing mode +// XXX: we use next line just to be sure for now +if (pEdtOutl != NULL) +pEdtOutl-SetText(*pNewTextCurBox); +// adds it to current outliner anyway (useful in static decomposition) +rOutliner.SetText(*pNewTextCurBox); /* Get chaining outliner here */ // Code adapted from ImpGetDrawOutliner SdrOutliner rChainingOutl = pModel-GetChainingOutliner(this); ImpInitDrawOutliner( rChainingOutl ); -rOutliner.SetUpdateMode(true); +rChainingOutl.SetUpdateMode(true); /* Transfer of text to next link */ if (GetNextLinkInChain() commit b570fb9b63b01823d99345736e55385fcc1734fc Author: matteocam matteo.campane...@gmail.com Date: Fri Jun 12 12:11:37 2015 -0400 Special case of dragging handled. Transfer of text by decomposition prevented Change-Id: Ib84d087a73e957583047a3206171dfe3ab906b7f diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 1546835..973729f 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -56,7 +56,7 @@ class NonOverflowingText { mPreOverflowingTxt(preOverflowingTxt) { if (pHeadParas == NULL) // Redundant line for debugging -DBG_ASSERT( pHeadParas != NULL, pHeadParas is null?! ); +DBG_ASSERT( pHeadParas != NULL, pHeadParas is null?! All text is overflowing
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
svx/source/svdraw/svdotextdecomposition.cxx | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) New commits: commit 72a93fb858bce7f4eeeb4d858d8028af035bd5af Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 15 15:00:38 2015 -0400 Fixed NbcSetOutlinerParaObj. Get infinite loop though. Change-Id: Iade699f6b87d1aa22a6d0303accb22087090c1d5 diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index b030462..87e0559 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -762,14 +762,14 @@ OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOut //pOutliner-Clear(); //pOutliner-SetStyleSheet( 0, pEdtOutl-GetStyleSheet(0)); -if (pNonOverflowingTxt-mpHeadParas != NULL) +if (pNonOverflowingTxt-mpHeadParas != NULL) { pOutliner-SetText(*pNonOverflowingTxt-mpHeadParas); -else { // set empty paraObj -OutlinerParaObject *pEmptyPObj = pOutliner-GetEmptyParaObject(); -pOutliner-SetText(*pEmptyPObj); +pOutliner-AddText(*pPObj); + } else { // set empty paraObj +//OutlinerParaObject *pEmptyPObj = pOutliner-GetEmptyParaObject(); +//pOutliner-SetText(*pEmptyPObj); +pOutliner-SetText(*pPObj); } - -pOutliner-AddText(*pPObj); } return pOutliner-CreateParaObject(); @@ -784,7 +784,7 @@ void SdrTextObj::impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const pEdtOutl-SetText(*pNewText); // adds it to current outliner anyway (useful in static decomposition) pOutliner-SetText(*pNewText); -const_castSdrTextObj*(this)-SetOutlinerParaObject(pNewText); +const_castSdrTextObj*(this)-NbcSetOutlinerParaObject(pNewText); } OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutliner, SdrTextObj *pNextTextObj) const @@ -1632,13 +1632,16 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( const_castSdrTextObj*(this)-mpOverflowingText = rOutliner.GetOverflowingText(); /* Leave only non overflowing text */ -OutlinerParaObject *pNewTextCurBox = impGetNonOverflowingParaObject(rOutliner); +impLeaveOnlyNonOverflowingText(rOutliner); + +/*OutlinerParaObject *pNewTextCurBox = impGetNonOverflowingParaObject(rOutliner); // we need this when we are in editing mode // XXX: we use next line just to be sure for now if (pEdtOutl != NULL) pEdtOutl-SetText(*pNewTextCurBox); // adds it to current outliner anyway (useful in static decomposition) rOutliner.SetText(*pNewTextCurBox); +NbcSetOutlinerParaObject(pNewTextCurBox);*/ /* Get chaining outliner here */ // Code adapted from ImpGetDrawOutliner ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source
editeng/source/editeng/impedit3.cxx |8 +++- svx/source/svdraw/svdotextdecomposition.cxx |4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) New commits: commit f43791f1a6e6f3d978eeb46479b3a26b51b53ec6 Author: matteocam matteo.campane...@gmail.com Date: Mon Jun 15 15:47:45 2015 -0400 No overflow if only empty para (prevents infinite loop) Change-Id: Ic11b127239542bf3cd8fde725ff9d88db4a29928 diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 91c6d58..13e6030 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -592,7 +592,13 @@ void ImpEditEngine::CheckPageOverflow() sal_uInt32 nTxtHeight = CalcTextHeight(NULL); -if (nTxtHeight nBoxHeight) +sal_uInt32 nParaCount = GetParaPortions().Count(); +sal_uInt32 nFirstLineCount = GetLineCount(0); +bool bOnlyOneEmptyPara = (nParaCount == 1) +(nFirstLineCount == 1) +(GetLineLen(0,0) == 0); + +if (nTxtHeight nBoxHeight !bOnlyOneEmptyPara) { // which paragraph is the first to cause higher size of the box? ImplUpdateOverflowingParaNum( nBoxHeight); // XXX: currently only for horizontal text diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 87e0559..45edac2 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -765,10 +765,12 @@ OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOut if (pNonOverflowingTxt-mpHeadParas != NULL) { pOutliner-SetText(*pNonOverflowingTxt-mpHeadParas); pOutliner-AddText(*pPObj); - } else { // set empty paraObj + } else if (pNonOverflowingTxt-mPreOverflowingTxt != ) { // only preoverflowing txt //OutlinerParaObject *pEmptyPObj = pOutliner-GetEmptyParaObject(); //pOutliner-SetText(*pEmptyPObj); pOutliner-SetText(*pPObj); +} else { // no text // This case is redundant but it doesn't hurt for now +pOutliner-Clear(); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - 4 commits - include/editeng svx/source
include/editeng/overflowingtxt.hxx |3 +- svx/source/svdraw/svdotext.cxx |9 +--- svx/source/svdraw/svdotextdecomposition.cxx |4 ++- svx/source/svdraw/svdotxed.cxx | 29 +--- 4 files changed, 13 insertions(+), 32 deletions(-) New commits: commit 8504099dfac88007268f77f649f4db8f0db381d9 Author: matteocam matteo.campane...@gmail.com Date: Fri Jun 12 09:41:14 2015 -0400 Save overflowing text _before_ cutting content Change-Id: I166ed763f9c7dc4db3bd447da3ba969522d4739a diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index abc01dd..748e980 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -1656,6 +1656,8 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( // If overflow occurs we have to cut the text at the right point if ( rOutliner.IsPageOverflow() ) { +// Save the overflowing text before changing the outliner's state +const_castSdrTextObj*(this)-mpOverflowingText = rOutliner.GetOverflowingText(); impLeaveOnlyNonOverflowingText(rOutliner); // XXX: Order transfer of stuff in next link here @@ -1666,7 +1668,7 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( rOutliner.SetUpdateMode(true); /* Actual transfer of text */ -const_castSdrTextObj*(this)-mpOverflowingText = rOutliner.GetOverflowingText(); + if (GetNextLinkInChain()) impMoveChainedTextToNextLink(rChainingOutl, GetNextLinkInChain()); commit 280553d9b10a23dc33c0edf84ce78153483ec84e Author: matteocam matteo.campane...@gmail.com Date: Fri Jun 12 09:22:37 2015 -0400 EndTextEdit now does nothing wrt chaining; primitives should do it Change-Id: I50ea0adb6804111c2d7a0eab8082f92ab82825b8 diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index 4811606..3fcd600 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -277,33 +277,8 @@ void SdrTextObj::EndTextEdit(SdrOutliner rOutl) // to make the gray field background vanish again rOutl.UpdateFields(); -// FIXME(matteocam) -// TODO: move this to one level higher -if ( IsToBeChained() GetNextLinkInChain() != this) // XXX: defensive check -{ -// FIXME: matteocam -// for now doing the same as below - probably we don't need -// any more chain checks here but one single default behavior -sal_Int32 nParaAnz = rOutl.GetParagraphCount(); -// XXX: FRESHLY COMMENTED (5/6/15) // FIXME:matteocam -//pNewText = rOutl.CreateParaObject( 0, nParaAnz ); - -pNewText = impGetNonOverflowingParaObject(rOutl); - -// set non overflow part of text to current box - -// XXX XXX XXX XXX: decomment next line and fix const conversion problem -//pNewText = rOutl.GetNonOverflowingText()-mpHeadParas; // empty text obj. if 1st para is overflowing -// set overflowing text for SdrChainedTextPrimitive2D -mpOverflowingText = rOutl.GetOverflowingText(); -// TODO: factor the lines of code above in a single function -} -else // standard case -{ -sal_Int32 nParaAnz = rOutl.GetParagraphCount(); -pNewText = rOutl.CreateParaObject( 0, nParaAnz ); -} - +sal_Int32 nParaAnz = rOutl.GetParagraphCount(); +pNewText = rOutl.CreateParaObject( 0, nParaAnz ); // need to end edit mode early since SetOutlinerParaObject already // uses GetCurrentBoundRect() which needs to take the text into account commit 23df39b2b8fd907e485afb4063d6474985236d2c Author: matteocam matteo.campane...@gmail.com Date: Fri Jun 12 09:19:47 2015 -0400 Added debugging check in NonOverflowingText Change-Id: I83f52e2549850ac695be12c72534c8c0c3f426ea diff --git a/include/editeng/overflowingtxt.hxx b/include/editeng/overflowingtxt.hxx index 98aa612..1546835 100644 --- a/include/editeng/overflowingtxt.hxx +++ b/include/editeng/overflowingtxt.hxx @@ -55,7 +55,8 @@ class NonOverflowingText { : mpHeadParas(pHeadParas), mPreOverflowingTxt(preOverflowingTxt) { -DBG_ASSERT( pHeadParas != NULL, pHeadParas is null?! ); +if (pHeadParas == NULL) // Redundant line for debugging +DBG_ASSERT( pHeadParas != NULL, pHeadParas is null?! ); } }; commit 75eb4d03846bbe9419c5a1254804cf6ae506f08c Author: matteocam matteo.campane...@gmail.com Date: Fri Jun 12 09:07:23 2015 -0400 Added a check on next link Change-Id: Idb50bb11f4a6fef4602853083a1b80a92b9555bc diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 4dbc2ea..cef2fff 100644
[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' - svx/source
svx/source/svdraw/svdotextdecomposition.cxx |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) New commits: commit caa6b1833fb592b42b0549d9f749d0ac265b2ad0 Author: matteocam matteo.campane...@gmail.com Date: Thu Jun 11 13:03:13 2015 -0400 Removed Clear-s. Used Empty Para Obj Change-Id: Ifc8869a6c7aa0c1279c7363ba2591a49417fb6f3 diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index d88dc56..d77e157 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -731,6 +731,7 @@ void SdrTextObj::impDecomposeContourTextPrimitive( OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOutliner) const { NonOverflowingText *pNonOverflowingTxt; +// We have to get text from the editing outliner if this is set if (pEdtOutl != NULL) pNonOverflowingTxt = pEdtOutl-GetNonOverflowingText(); @@ -751,14 +752,14 @@ OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOut Paragraph *pTmpPara0 = pOutliner-GetParagraph(0); pOutliner-SetText(pNonOverflowingTxt-mPreOverflowingTxt, pTmpPara0); OutlinerParaObject *pPObj = pOutliner-CreateParaObject(); -pOutliner-Clear(); +//pOutliner-Clear(); //pOutliner-SetStyleSheet( 0, pEdtOutl-GetStyleSheet(0)); if (pNonOverflowingTxt-mpHeadParas != NULL) pOutliner-SetText(*pNonOverflowingTxt-mpHeadParas); else { // set empty paraObj - -pOutliner-SetText(*emptyParaObj); +OutlinerParaObject *pEmptyPObj = pOutliner-GetEmptyParaObject(); +pOutliner-SetText(*pEmptyPObj); } pOutliner-AddText(*pPObj); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
svx/source/svdraw/svdotextdecomposition.cxx | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) New commits: commit 3ba153bb9323032d6d61cb655b2d075fb9b9d8df Author: matteocam matteo.campane...@gmail.com Date: Thu Jun 11 14:04:26 2015 -0400 Replace some clears with setting empty text Change-Id: I16f5f3f08f5375e6f4052839e8a8967a220a985c diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index d77e157..c17436d 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -778,6 +778,12 @@ void SdrTextObj::impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const const_castSdrTextObj*(this)-SetOutlinerParaObject(pNewText); } +void impSetOutlinerToEmptyTxt(SdrOutliner *pOutliner) +{ +OutlinerParaObject *pEmptyTxt = pOutliner-GetEmptyParaObject(); +pOutliner-SetText(*pEmptyTxt); +} + OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutliner, SdrTextObj *pNextTextObj) const { @@ -807,7 +813,8 @@ OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutlin OutlinerParaObject *pJoiningPara = NULL; if (pOldPara0) { -//pOutliner-Clear(); +//pOutliner-Clear(); // you need a clear outliner here +impSetOutlinerToEmptyTxt(pOutliner); pTmpPara0 = pOutliner-GetParagraph(0); pOutliner-SetText(mpOverflowingText-mTailTxt + aOldPara0Txt, pTmpPara0); @@ -816,6 +823,7 @@ OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutlin // start actual composition //pOutliner-Clear(); +impSetOutlinerToEmptyTxt(pOutliner); // 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' - svx/source
svx/source/svdraw/svdotextdecomposition.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 624ee89b0debce20e4146391294cfe69b2f4ffa2 Author: matteocam matteo.campane...@gmail.com Date: Thu Jun 11 14:21:17 2015 -0400 Replace some clears with setting empty text Change-Id: Iea19544a3a31ac687e30b48fbca8e850e6e8c8ca diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index c17436d..43106a5 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -749,6 +749,7 @@ OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOut } 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(pNonOverflowingTxt-mPreOverflowingTxt, pTmpPara0); OutlinerParaObject *pPObj = pOutliner-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' - svx/source
svx/source/svdraw/svdotextdecomposition.cxx | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) New commits: commit 4a872586656f10dc25957077c36e90c17d541ae4 Author: matteocam matteo.campane...@gmail.com Date: Thu Jun 11 14:23:08 2015 -0400 Replace some clears with setting empty text Change-Id: I8eb03e1a7915ea83b8d01f5c4d8ffe03dae04c5e diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 43106a5..b48e7f9 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -675,6 +675,11 @@ namespace } } // end of anonymous namespace +void impSetOutlinerToEmptyTxt(SdrOutliner *pOutliner) +{ +OutlinerParaObject *pEmptyTxt = pOutliner-GetEmptyParaObject(); +pOutliner-SetText(*pEmptyTxt); +} // primitive decompositions @@ -779,12 +784,6 @@ void SdrTextObj::impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const const_castSdrTextObj*(this)-SetOutlinerParaObject(pNewText); } -void impSetOutlinerToEmptyTxt(SdrOutliner *pOutliner) -{ -OutlinerParaObject *pEmptyTxt = pOutliner-GetEmptyParaObject(); -pOutliner-SetText(*pEmptyTxt); -} - OutlinerParaObject *SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutliner, SdrTextObj *pNextTextObj) 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' - svx/source
svx/source/svdraw/svdotextdecomposition.cxx |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) New commits: commit 1fadb6bb9052d1d6dc66afa11a5ceb29c7cc2272 Author: matteocam matteo.campane...@gmail.com Date: Thu Jun 11 14:29:37 2015 -0400 Setting both outliner's and textObj's text in decomposition Change-Id: I95feefc67295070a5b12d032436d3138e3b9fc81 diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index b48e7f9..e7ada87 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -780,7 +780,8 @@ void SdrTextObj::impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const // we need this when we are in editing mode if (pEdtOutl != NULL) pEdtOutl-SetText(*pNewText); - +// adds it to current outliner anyway (useful in static decomposition) +pOutliner-SetText(*pNewText); const_castSdrTextObj*(this)-SetOutlinerParaObject(pNewText); } @@ -1650,13 +1651,15 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( // Sets original text rOutliner.SetText(*pOutlinerParaObject); +/* Begin overflow handling */ + // If overflow occurs we have to cut the text at the right point if ( rOutliner.IsPageOverflow() ) { -const OutlinerParaObject *pNewTxt = impGetNonOverflowingParaObject(rOutliner); -rOutliner.SetText(*pNewTxt); +impLeaveOnlyNonOverflowingText(rOutliner); // XXX: Order transfer of stuff in next link here } +/* End overflow handling */ // set visualizing page at Outliner; needed e.g. for PageNumberField decomposition rOutliner.setVisualizedPage(GetSdrPageFromXDrawPage(aViewInformation.getVisualizedPage())); ___ 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' - include/svx svx/source
include/svx/svdmodel.hxx|3 +++ svx/source/svdraw/svdmodel.cxx | 10 ++ svx/source/svdraw/svdotext.cxx |2 +- svx/source/svdraw/svdotextdecomposition.cxx | 12 4 files changed, 26 insertions(+), 1 deletion(-) New commits: commit bb57f6094d6172cd936e862f96128cd95ac65b81 Author: matteocam matteo.campane...@gmail.com Date: Thu Jun 11 17:30:00 2015 -0400 Using a second outliner to transfer text Change-Id: Ia11a2befc1ebdb73247ecac1bb7646cf91cdb13c diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index e982cb5..bdc992d 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -170,6 +170,7 @@ protected: m_pEmbeddedHelper; // helper for embedded objects to get rid of the SfxObjectShell SdrOutliner*pDrawOutliner; // an Outliner for outputting text SdrOutliner*pHitTestOutliner;// an Outliner for the HitTest +SdrOutliner*pChainingOutliner; // an Outliner for chaining overflowing text sal_uIntPtr nDefTextHgt;// Default text heigth in logical units OutputDevice* pRefOutDev; // ReferenceDevice for the EditEngine sal_uIntPtr nProgressAkt; // for the @@ -326,6 +327,8 @@ public: SdrOutliner GetDrawOutliner(const SdrTextObj* pObj=NULL) const; +SdrOutliner GetChainingOutliner(const SdrTextObj* pObj=NULL) const; + SdrOutliner GetHitTestOutliner() const { return *pHitTestOutliner; } const SdrTextObj*GetFormattingTextObj() const; // put the TextDefaults (Font,Height,Color) in a Set diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index f3fc337..ce0ff7a 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -212,6 +212,10 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe pHitTestOutliner = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, this ); ImpSetOutlinerDefaults(pHitTestOutliner, true); +pChainingOutliner = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, this ); +ImpSetOutlinerDefaults(pChainingOutliner, true); + + ImpCreateTables(); } @@ -770,6 +774,12 @@ SdrOutliner SdrModel::GetDrawOutliner(const SdrTextObj* pObj) const return *pDrawOutliner; } +SdrOutliner SdrModel::GetChainingOutliner(const SdrTextObj* pObj) const +{ +pChainingOutliner-SetTextObj(pObj); +return *pChainingOutliner; +} + const SdrTextObj* SdrModel::GetFormattingTextObj() const { if (pDrawOutliner!=NULL) { diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 82b883f..4dbc2ea 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -2043,7 +2043,7 @@ SdrTextObj* SdrTextObj::GetNextLinkInChain() const if ( pPage pPage-GetObjCount() 1) { sal_uInt32 nextIndex = (GetOrdNum()+1); // FIXME -if (nextIndex = 3 || nextIndex = pPage-GetObjCount()) { +if (!GetName().startsWith(Chainable)) { fprintf(stderr, [CHAINABLE?] %p is _not_ chainable\n, this); return NULL; } diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index e7ada87..abc01dd 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -22,6 +22,7 @@ #include svx/svdoutl.hxx #include svx/svdpage.hxx #include svx/svdotext.hxx +#include svx/svdmodel.hxx #include basegfx/vector/b2dvector.hxx #include sdr/primitive2d/sdrtextprimitive2d.hxx #include drawinglayer/primitive2d/textprimitive2d.hxx @@ -1658,6 +1659,17 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( impLeaveOnlyNonOverflowingText(rOutliner); // XXX: Order transfer of stuff in next link here +/* Get chaining outliner here */ +// Code adapted from ImpGetDrawOutliner +SdrOutliner rChainingOutl = pModel-GetChainingOutliner(this); +ImpInitDrawOutliner( rChainingOutl ); +rOutliner.SetUpdateMode(true); + +/* Actual transfer of text */ +const_castSdrTextObj*(this)-mpOverflowingText = rOutliner.GetOverflowingText(); +if (GetNextLinkInChain()) +impMoveChainedTextToNextLink(rChainingOutl, GetNextLinkInChain()); + } /* End overflow handling */ ___ 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' - svx/source
svx/source/svdraw/svdotextdecomposition.cxx | 20 1 file changed, 20 insertions(+) New commits: commit 8157aeab46e3bf0afd3f71c3946518826a1dd793 Author: matteocam matteo.campane...@gmail.com Date: Wed Jun 10 14:50:53 2015 -0400 Experiment: cutting paras from impDecomposeChainedText Change-Id: Ic2d013b9f3d986b7c4bf95a5ada46db16c7e1e3d diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index fdb85f9..dfaa1d8 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -1586,6 +1586,7 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( // prepare outliner const SfxItemSet rTextItemSet = rSdrChainedTextPrimitive.getSdrText()-GetItemSet(); SdrOutliner rOutliner = ImpGetDrawOutliner(); + SdrTextVertAdjust eVAdj = GetTextVerticalAdjust(rTextItemSet); SdrTextHorzAdjust eHAdj = GetTextHorizontalAdjust(rTextItemSet); const sal_uInt32 nOriginalControlWord(rOutliner.GetControlWord()); @@ -1601,8 +1602,27 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( // add one to rage sizes to get back to the old Rectangle and outliner measurements const sal_uInt32 nAnchorTextWidth(FRound(aAnchorTextRange.getWidth() + 1L)); const sal_uInt32 nAnchorTextHeight(FRound(aAnchorTextRange.getHeight() + 1L)); + +// Text const OutlinerParaObject* pOutlinerParaObject = rSdrChainedTextPrimitive.getSdrText()-GetOutlinerParaObject(); + +// FIXME +// Experiment: cutting all paragraphs after first (if any) +rOutliner.SetText(*pOutlinerParaObject); +pOutlinerParaObject = rOutliner.CreateParaObject(0,1); + + + +// FIXME(matteocam) +// Experiment: setting only the non overflowing text +// Question: XXX: How do you know there is an overflow in the first place here?? +// Question: what is the page size set at the end of these procedure. Is the real text size anywhere? + +// Sub-experiment: removing the second paragraph if present + + OSL_ENSURE(pOutlinerParaObject, impDecomposeBlockTextPrimitive used with no OutlinerParaObject (!)); + const bool bVerticalWritintg(pOutlinerParaObject-IsVertical()); const Size aAnchorTextSize(Size(nAnchorTextWidth, nAnchorTextHeight)); ___ 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' - svx/source
svx/source/svdraw/svdotextdecomposition.cxx | 78 1 file changed, 35 insertions(+), 43 deletions(-) New commits: commit e921d44aba6d1c224ae03ceedd4938988ef9d6d3 Author: matteocam matteo.campane...@gmail.com Date: Wed Jun 10 16:39:07 2015 -0400 Drafting changes for passing outliner Change-Id: Ia3ff27cce807679b3698a2d3d8d761930af0ecd5 diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 3e9e262..88f6136 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -728,44 +728,38 @@ void SdrTextObj::impDecomposeContourTextPrimitive( rTarget = aConverter.getPrimitive2DSequence(); } -OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject() const +OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOutliner) const { NonOverflowingText *pNonOverflowingTxt; -// Cut non overflowing text -if (pEdtOutl != NULL) -pNonOverflowingTxt = -pEdtOutl-GetNonOverflowingText(); -else -pNonOverflowingTxt = -ImpGetDrawOutliner().GetNonOverflowingText(); +pNonOverflowingTxt = +rOutliner.GetNonOverflowingText(); -SdrOutliner rOutliner = ImpGetDrawOutliner(); -rOutliner.Clear(); -//rOutliner.SetStyleSheet( 0, pEdtOutl-GetStyleSheet(0)); +pOutliner.Clear(); +//pOutliner.SetStyleSheet( 0, pEdtOutl-GetStyleSheet(0)); if (pNonOverflowingTxt-mPreOverflowingTxt == pNonOverflowingTxt-mpHeadParas != NULL) { // Only (possibly empty) paragraphs before overflowing one -rOutliner.SetText(*pNonOverflowingTxt-mpHeadParas); +pOutliner.SetText(*pNonOverflowingTxt-mpHeadParas); } else { // We have to include the non-overflowing lines from the overfl. para // first make a ParaObject for the strings -Paragraph *pTmpPara0 = rOutliner.GetParagraph(0); -rOutliner.SetText(pNonOverflowingTxt-mPreOverflowingTxt, pTmpPara0); -OutlinerParaObject *pPObj = rOutliner.CreateParaObject(); -rOutliner.Clear(); -//rOutliner.SetStyleSheet( 0, pEdtOutl-GetStyleSheet(0)); +Paragraph *pTmpPara0 = pOutliner.GetParagraph(0); +pOutliner.SetText(pNonOverflowingTxt-mPreOverflowingTxt, pTmpPara0); +OutlinerParaObject *pPObj = pOutliner.CreateParaObject(); +pOutliner.Clear(); +//pOutliner.SetStyleSheet( 0, pEdtOutl-GetStyleSheet(0)); if (pNonOverflowingTxt-mpHeadParas != NULL) -rOutliner.SetText(*pNonOverflowingTxt-mpHeadParas); +pOutliner.SetText(*pNonOverflowingTxt-mpHeadParas); -rOutliner.AddText(*pPObj); +pOutliner.AddText(*pPObj); } - return rOutliner.CreateParaObject(); + return pOutliner.CreateParaObject(); } -void SdrTextObj::impLeaveOnlyNonOverflowingText() const +void SdrTextObj::impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const { OutlinerParaObject *pNewText = impGetNonOverflowingParaObject(); // we need this when we are in editing mode @@ -776,33 +770,31 @@ void SdrTextObj::impLeaveOnlyNonOverflowingText() const } -void SdrTextObj::impMoveChainedTextToNextLink(SdrTextObj *pNextTextObj) const +void SdrTextObj::impMoveChainedTextToNextLink(SdrOutliner *pOutliner, SdrTextObj *pNextTextObj) const { // prevent copying text in same box if ( this == pNextTextObj ) return; -SdrOutliner rOutliner = ImpGetDrawOutliner(); - - //rOutliner.SetChainingEventHdl(LINK(this,SdrTextObj,ImpDecomposeChainedText)); + //pOutliner.SetChainingEventHdl(LINK(this,SdrTextObj,ImpDecomposeChainedText)); if (mpOverflowingText != NULL) { // XXX: Not sure if necessary -rOutliner.Clear(); +pOutliner.Clear(); OutlinerParaObject *pCurTxt = pNextTextObj-GetOutlinerParaObject(); -rOutliner.SetText(*pCurTxt); +pOutliner.SetText(*pCurTxt); // Get text of first paragraph of destination box -Paragraph *pOldPara0 = rOutliner.GetParagraph(0); +Paragraph *pOldPara0 = pOutliner.GetParagraph(0); OUString aOldPara0Txt; if (pOldPara0) -aOldPara0Txt = rOutliner.GetText(pOldPara0); +aOldPara0Txt = pOutliner.GetText(pOldPara0); // Get other paras of destination box (from second on) OutlinerParaObject *pOldParasTail = NULL; -if (rOutliner.GetParagraphCount() 1) -pOldParasTail = rOutliner.CreateParaObject(1); +if (pOutliner.GetParagraphCount() 1) +pOldParasTail = pOutliner.CreateParaObject(1); // Create ParaObject appending old first para in the dest. box // to last part of overflowing text @@ -810,39 +802,39 @@ void SdrTextObj::impMoveChainedTextToNextLink(SdrTextObj *pNextTextObj) const OutlinerParaObject *pJoiningPara = NULL
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - include/svx svx/source
include/svx/svdotext.hxx|7 - svx/source/svdraw/svdotext.cxx | 12 +- svx/source/svdraw/svdotextdecomposition.cxx | 138 +++- svx/source/svdraw/svdotxed.cxx |2 4 files changed, 86 insertions(+), 73 deletions(-) New commits: commit 2e66cafe5bdef5a0c64c190b0b73a7db61dcc3a1 Author: matteocam matteo.campane...@gmail.com Date: Wed Jun 10 18:43:29 2015 -0400 Passed right outliner around Change-Id: I7eeb193e53926093e91393667ab9c788ebebda9d diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index 964ee43..0552029 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -608,9 +608,10 @@ public: const drawinglayer::primitive2d::SdrChainedTextPrimitive2D rSdrChainedTextPrimitive, const drawinglayer::geometry::ViewInformation2D aViewInformation) const; -void impMoveChainedTextToNextLink(SdrTextObj *pNextTextObj) const; -OutlinerParaObject *impGetNonOverflowingParaObject() const; -void impLeaveOnlyNonOverflowingText() const; +void impMoveChainedTextToNextLink(SdrOutliner *pOutliner, SdrTextObj *pNextTextObj) const; +OutlinerParaObject *impGetOverflowingParaObject(SdrOutliner *pOutliner, SdrTextObj *pNextTextObj) const; +void impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const; +OutlinerParaObject *impGetNonOverflowingParaObject(SdrOutliner *pOutliner) const; // Handler for Chained Text DECL_LINK(ImpDecomposeChainedText,bool*); diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index bf46cb9..82b883f 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1958,11 +1958,10 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus ) void SdrTextObj::onOverflowStatusEvent( bool bIsPageOverflow ) { -// FIXME: Should have a IsChainable or something. -if (IsAutoGrowWidth() || IsAutoGrowHeight() || IsAutoFit()) +if (!IsChainable()) return; -if ( GetNextLinkInChain() != NULL ) // is this a chainable object? +if ( GetNextLinkInChain() != NULL ) // is there anything to transfer text to? { // set whether there is need for chaining // (used in EndTextEdit to crop the overflowing part) @@ -1973,17 +1972,18 @@ void SdrTextObj::onOverflowStatusEvent( bool bIsPageOverflow ) // Pushes text in next link on the fly if ( bIsPageOverflow ) { +SdrOutliner aDrawOutliner = ImpGetDrawOutliner(); if (pEdtOutl != NULL) mpOverflowingText = pEdtOutl-GetOverflowingText(); else -mpOverflowingText = ImpGetDrawOutliner().GetOverflowingText(); +mpOverflowingText = aDrawOutliner.GetOverflowingText(); SdrTextObj *pNextTextObj = GetNextLinkInChain(); -impLeaveOnlyNonOverflowingText(); +impLeaveOnlyNonOverflowingText(aDrawOutliner); // Transfer overflowing text -impMoveChainedTextToNextLink(pNextTextObj); +impMoveChainedTextToNextLink(aDrawOutliner, pNextTextObj); } } diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 88f6136..9fff4c0 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -732,36 +732,36 @@ OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOut { NonOverflowingText *pNonOverflowingTxt; pNonOverflowingTxt = -rOutliner.GetNonOverflowingText(); +pOutliner-GetNonOverflowingText(); -pOutliner.Clear(); -//pOutliner.SetStyleSheet( 0, pEdtOutl-GetStyleSheet(0)); +pOutliner-Clear(); +//pOutliner-SetStyleSheet( 0, pEdtOutl-GetStyleSheet(0)); if (pNonOverflowingTxt-mPreOverflowingTxt == pNonOverflowingTxt-mpHeadParas != NULL) { // Only (possibly empty) paragraphs before overflowing one -pOutliner.SetText(*pNonOverflowingTxt-mpHeadParas); +pOutliner-SetText(*pNonOverflowingTxt-mpHeadParas); } else { // We have to include the non-overflowing lines from the overfl. para // first make a ParaObject for the strings -Paragraph *pTmpPara0 = pOutliner.GetParagraph(0); -pOutliner.SetText(pNonOverflowingTxt-mPreOverflowingTxt, pTmpPara0); -OutlinerParaObject *pPObj = pOutliner.CreateParaObject(); -pOutliner.Clear(); -//pOutliner.SetStyleSheet( 0, pEdtOutl-GetStyleSheet(0)); +Paragraph *pTmpPara0 = pOutliner-GetParagraph(0); +pOutliner-SetText(pNonOverflowingTxt-mPreOverflowingTxt, pTmpPara0); +OutlinerParaObject *pPObj = pOutliner-CreateParaObject(); +pOutliner-Clear(); +//pOutliner-SetStyleSheet( 0, pEdtOutl-GetStyleSheet(0)); if (pNonOverflowingTxt-mpHeadParas != NULL
[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
svx/source/svdraw/svdotextdecomposition.cxx |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit b35ee177580a9bf9a28572bb5af02abe07faec06 Author: matteocam matteo.campane...@gmail.com Date: Wed Jun 10 19:21:31 2015 -0400 Getting nonoverflowing text from edit outliner if in edit mode Change-Id: I7cc613046194054b60718d89bcfe209eaaaf66c5 diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 9fff4c0..5bcfbe3 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -731,8 +731,12 @@ void SdrTextObj::impDecomposeContourTextPrimitive( OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOutliner) const { NonOverflowingText *pNonOverflowingTxt; -pNonOverflowingTxt = -pOutliner-GetNonOverflowingText(); +if (pEdtOutl != NULL) +pNonOverflowingTxt = +pEdtOutl-GetNonOverflowingText(); +else +pNonOverflowingTxt = +pOutliner-GetNonOverflowingText(); pOutliner-Clear(); //pOutliner-SetStyleSheet( 0, pEdtOutl-GetStyleSheet(0)); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits