[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - 2 commits - include/svx svx/source
matteocam
matteo.campanelli at gmail.com
Mon Aug 11 23:48:02 PDT 2014
include/svx/sdr/attribute/sdrtextattribute.hxx | 1 +
svx/source/sdr/attribute/sdrtextattribute.cxx | 7 +++++++
svx/source/sdr/primitive2d/sdrattributecreator.cxx | 14 +-------------
svx/source/svdraw/svdotextdecomposition.cxx | 2 ++
4 files changed, 11 insertions(+), 13 deletions(-)
New commits:
commit 35422761a3eff131dfd698cf64491f05af853bca
Author: matteocam <matteo.campanelli at gmail.com>
Date: Mon Aug 11 19:22:34 2014 +0200
Special treatment of chaining when making text attributes.
Change-Id: Ib0fcdfbc2524968bd633485f7abaec5805d60139
diff --git a/include/svx/sdr/attribute/sdrtextattribute.hxx b/include/svx/sdr/attribute/sdrtextattribute.hxx
index 6d3b738..624c5f0 100644
--- a/include/svx/sdr/attribute/sdrtextattribute.hxx
+++ b/include/svx/sdr/attribute/sdrtextattribute.hxx
@@ -76,6 +76,7 @@ namespace drawinglayer
bool bWrongSpell,
bool bToBeChained);
SdrTextAttribute();
+ SdrTextAttribute(bool bIsToBeChained); // special treatment for text chaining
SdrTextAttribute(const SdrTextAttribute& rCandidate);
SdrTextAttribute& operator=(const SdrTextAttribute& rCandidate);
~SdrTextAttribute();
diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx
index de9a61f..dd1eafe 100644
--- a/svx/source/sdr/attribute/sdrtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrtextattribute.cxx
@@ -297,6 +297,13 @@ namespace drawinglayer
mpSdrTextAttribute->mnRefCount++;
}
+ SdrTextAttribute::SdrTextAttribute(bool bIsToBeChained)
+ : mpSdrTextAttribute(ImpSdrTextAttribute::get_global_default())
+ {
+ mpSdrTextAttribute->mbToBeChained = bIsToBeChained;
+ mpSdrTextAttribute->mnRefCount++;
+ }
+
SdrTextAttribute::SdrTextAttribute(const SdrTextAttribute& rCandidate)
: mpSdrTextAttribute(rCandidate.mpSdrTextAttribute)
{
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 4d1bca5..d13bb39 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -524,8 +524,6 @@ namespace drawinglayer
// FIXME(matteocam)
bool bToBeChained = rTextObj.IsToBeChained();
-
-
if(rText.GetOutlinerParaObject() && rText.GetModel())
{
// added TextEdit text suppression
@@ -588,7 +586,7 @@ namespace drawinglayer
bToBeChained);
}
- return attribute::SdrTextAttribute();
+ return attribute::SdrTextAttribute(bToBeChained);
}
attribute::FillGradientAttribute createNewTransparenceGradientAttribute(const SfxItemSet& rSet)
commit ed720c37f2b016badea4ace09d9b86e156dceefe
Author: matteocam <matteo.campanelli at gmail.com>
Date: Mon Aug 11 18:43:49 2014 +0200
Chaining status for SdrTextObj is reset after chaining occurs
Change-Id: Ie09f615c36bcf4b433a4dc5c286c1a7184119e6c
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 68b44e0..4d1bca5 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -540,16 +540,6 @@ namespace drawinglayer
bInEditMode = rTextObj.IsInEditMode();
}
- // for resetting status
- // FIXME(matteocam)
- // XXX: may not work
- // XXX: this should happen only whether the chaining has occurred though.
- // XXX: violates SPOT rule (the following condition is also in sdrdecompositiontools.cxx)
- if ( !bInEditMode && rTextObj.IsToBeChained() )
- { // XXX: hack
- const_cast<SdrTextObj*>(&rTextObj)->SetToBeChained( false );
- }
-
OutlinerParaObject aOutlinerParaObject(*rText.GetOutlinerParaObject());
if(bInEditMode)
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index cf2f455..4ed8b58 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -1482,6 +1482,8 @@ void SdrTextObj::impDecomposeChainedTextPrimitive(
SdrTextObj *pNextTextObj = GetNextLinkInChain();
assert (pNextTextObj);
impCopyTextInTextObj(pNextTextObj); // XXX: it actually moves the overflowing text currently
+ // Chaining occurred. Let's reset the status
+ const_cast<SdrTextObj*>(this)->SetToBeChained( false );
//pNextTextObj->SetOutlinerParaObject( mpOverflowingText );
//SdrOutliner rOutl = pNextTextObj->ImpGetDrawOutliner();
More information about the Libreoffice-commits
mailing list