[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - include/svx svx/source
matteocam
matteo.campanelli at gmail.com
Mon Jun 29 00:56:45 PDT 2015
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.campanelli at 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 class TextChain;
friend class TextChainFlow;
+ friend class EditingTextChainFlow;
// 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_cast<SdrTextObj*>(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_cast<SdrTextObj*>(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())
{
More information about the Libreoffice-commits
mailing list