include/svx/svdotext.hxx | 1 svx/source/svdraw/svdotextdecomposition.cxx | 62 ++++++++++++++-------------- 2 files changed, 33 insertions(+), 30 deletions(-)
New commits: commit cf9aae1558581a6e3851ab1db039bb16e86699be Author: matteocam <matteo.campane...@gmail.com> Date: Fri Jul 10 17:35:24 2015 -0400 Use a separate method for static chaining Change-Id: I289b411b5867c5e2b06f75633790f407bc3dbba1 diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index 4ab6313..761c4e0 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -626,6 +626,7 @@ public: drawinglayer::primitive2d::Primitive2DSequence& rTarget, const drawinglayer::primitive2d::SdrChainedTextPrimitive2D& rSdrChainedTextPrimitive, const drawinglayer::geometry::ViewInformation2D& aViewInformation) const; + void impHandleChainingEventsDuringDecomposition(SdrOutliner &rOutliner) const; // timing generators diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 241ec8b..b627b77 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -1423,6 +1423,37 @@ void SdrTextObj::impGetScrollTextTiming(drawinglayer::animation::AnimationEntryL } } +void SdrTextObj::impHandleChainingEventsDuringDecomposition(SdrOutliner &rOutliner) const +{ + GetTextChain()->SetNilChainingEvent(this, true); + + TextChainFlow aTxtChainFlow(const_cast<SdrTextObj*>(this)); + bool bIsOverflow; + + aTxtChainFlow.CheckForFlowEvents(&rOutliner); + + if (aTxtChainFlow.IsUnderflow() && !IsInEditMode()) + { + // underflow-induced overflow + aTxtChainFlow.ExecuteUnderflow(&rOutliner); + bIsOverflow = aTxtChainFlow.IsOverflow(); + } else { + // standard overflow (no underlow before) + bIsOverflow = aTxtChainFlow.IsOverflow(); + } + + if (bIsOverflow && !IsInEditMode()) { + // Initialize Chaining Outliner + 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); + } + + GetTextChain()->SetNilChainingEvent(this, false); +} + void SdrTextObj::impDecomposeChainedTextPrimitive( drawinglayer::primitive2d::Primitive2DSequence& rTarget, const drawinglayer::primitive2d::SdrChainedTextPrimitive2D& rSdrChainedTextPrimitive, @@ -1486,36 +1517,7 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( /* Begin overflow/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 - GetTextChain()->SetNilChainingEvent(this, true); - TextChainFlow aTxtChainFlow(const_cast<SdrTextObj*>(this)); - bool bIsOverflow; - - aTxtChainFlow.CheckForFlowEvents(&rOutliner); - - if (aTxtChainFlow.IsUnderflow() && !IsInEditMode()) - { - // underflow-induced overflow - aTxtChainFlow.ExecuteUnderflow(&rOutliner); - bIsOverflow = aTxtChainFlow.IsOverflow(); - } else { - // standard overflow (no underlow before) - bIsOverflow = aTxtChainFlow.IsOverflow(); - } - - if (bIsOverflow && !IsInEditMode()) { - // Initialize Chaining Outliner - 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); - } - - GetTextChain()->SetNilChainingEvent(this, false); + impHandleChainingEventsDuringDecomposition(rOutliner); /* End overflow/underflow handling */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits