summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authormatteocam <matteo.campanelli@gmail.com>2015-09-07 11:37:27 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2015-09-20 13:05:15 +0200
commitaa77b170cb8aee744aa207f5b1ecfdd0bc0e90e2 (patch)
treef4cd747a95d4b3684e3a1307278ad7d6241a085d /svx
parente910e775cf9982b6e14df2630ca21026efe09d65 (diff)
chained editeng: Add chaining attributes and chaining primitive creation logic
Change-Id: I957d5261dd847fe5e950441585e879cfd5ae2fb2
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sdr/attribute/sdrtextattribute.cxx39
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx9
-rw-r--r--svx/source/sdr/primitive2d/sdrdecompositiontools.cxx13
3 files changed, 53 insertions, 8 deletions
diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx
index ddd1ce1fd41c..cefefb19e775 100644
--- a/svx/source/sdr/attribute/sdrtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrtextattribute.cxx
@@ -67,6 +67,10 @@ namespace drawinglayer
bool mbFixedCellHeight : 1;
bool mbWrongSpell : 1;
+ bool mbToBeChained : 1;
+ bool mbChainable : 1;
+
+
public:
ImpSdrTextAttribute(
const SdrText* pSdrText,
@@ -86,7 +90,9 @@ namespace drawinglayer
bool bScroll,
bool bInEditMode,
bool bFixedCellHeight,
- bool bWrongSpell)
+ bool bWrongSpell,
+ bool bToBeChained,
+ bool bChainable)
: mpSdrText(pSdrText),
mxOutlinerParaObject(new OutlinerParaObject(rOutlinerParaObject)),
maSdrFormTextAttribute(),
@@ -105,7 +111,9 @@ namespace drawinglayer
mbScroll(bScroll),
mbInEditMode(bInEditMode),
mbFixedCellHeight(bFixedCellHeight),
- mbWrongSpell(bWrongSpell)
+ mbWrongSpell(bWrongSpell),
+ mbToBeChained(bToBeChained),
+ mbChainable(bChainable)
{
if(pSdrText)
{
@@ -141,7 +149,9 @@ namespace drawinglayer
mbScroll(false),
mbInEditMode(false),
mbFixedCellHeight(false),
- mbWrongSpell(false)
+ mbWrongSpell(false),
+ mbToBeChained(false),
+ mbChainable(false)
{
}
@@ -167,6 +177,8 @@ namespace drawinglayer
bool isInEditMode() const { return mbInEditMode; }
bool isFixedCellHeight() const { return mbFixedCellHeight; }
bool isWrongSpell() const { return mbWrongSpell; }
+ bool isToBeChained() const { return mbToBeChained; }
+ bool isChainable() const { return mbChainable; }
const SdrFormTextAttribute& getSdrFormTextAttribute() const { return maSdrFormTextAttribute; }
sal_Int32 getTextLeftDistance() const { return maTextLeftDistance; }
sal_Int32 getTextUpperDistance() const { return maTextUpperDistance; }
@@ -225,7 +237,8 @@ namespace drawinglayer
&& isScroll() == rCandidate.isScroll()
&& isInEditMode() == rCandidate.isInEditMode()
&& isFixedCellHeight() == rCandidate.isFixedCellHeight()
- && isWrongSpell() == rCandidate.isWrongSpell());
+ && isWrongSpell() == rCandidate.isWrongSpell()
+ && isToBeChained() == rCandidate.isToBeChained() );
}
};
@@ -253,13 +266,16 @@ namespace drawinglayer
bool bScroll,
bool bInEditMode,
bool bFixedCellHeight,
- bool bWrongSpell)
+ bool bWrongSpell,
+ bool bIsToBeChained,
+ bool bChainable)
: mpSdrTextAttribute(
ImpSdrTextAttribute(
&rSdrText, rOutlinerParaObject, eFormTextStyle, aTextLeftDistance,
aTextUpperDistance, aTextRightDistance, aTextLowerDistance,
aSdrTextHorzAdjust, aSdrTextVertAdjust, bContour, bFitToSize, bAutoFit,
- bHideContour, bBlink, bScroll, bInEditMode, bFixedCellHeight, bWrongSpell))
+ bHideContour, bBlink, bScroll, bInEditMode, bFixedCellHeight, bWrongSpell,
+ bIsToBeChained, bChainable))
{
}
@@ -342,6 +358,17 @@ namespace drawinglayer
return mpSdrTextAttribute->isInEditMode();
}
+ bool SdrTextAttribute::isToBeChained() const
+ {
+ return mpSdrTextAttribute->isToBeChained();
+ }
+
+ bool SdrTextAttribute::isChainable() const
+ {
+ return mpSdrTextAttribute->isChainable();
+ }
+
+
bool SdrTextAttribute::isFixedCellHeight() const
{
return mpSdrTextAttribute->isFixedCellHeight();
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 522236729c62..2ec29edf342f 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -520,6 +520,11 @@ namespace drawinglayer
{
const SdrTextObj& rTextObj = rText.GetObject();
+ // Save chaining attributes
+ bool bToBeChained = rTextObj.IsToBeChained();
+ bool bChainable = rTextObj.IsChainable();
+
+
if(rText.GetOutlinerParaObject() && rText.GetModel())
{
// added TextEdit text suppression
@@ -578,7 +583,9 @@ namespace drawinglayer
SDRTEXTANI_SCROLL == eAniKind || SDRTEXTANI_ALTERNATE == eAniKind || SDRTEXTANI_SLIDE == eAniKind,
bInEditMode,
static_cast<const SdrTextFixedCellHeightItem&>(rSet.Get(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue(),
- bWrongSpell);
+ bWrongSpell,
+ bToBeChained,
+ bChainable);
}
return attribute::SdrTextAttribute();
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index ddc66088a187..390683f2be3b 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -307,7 +307,18 @@ namespace drawinglayer
else if(rText.isAutoFit())
{
// isotrophically scaled text in range
- pNew = new SdrAutoFitTextPrimitive2D(&rText.getSdrText(), rText.getOutlinerParaObject(), aAnchorTransform, bWordWrap);
+ pNew = new SdrAutoFitTextPrimitive2D(
+ &rText.getSdrText(),
+ rText.getOutlinerParaObject(),
+ aAnchorTransform,
+ bWordWrap);
+ }
+ else if( rText.isChainable() && !rText.isInEditMode() )
+ {
+ pNew = new SdrChainedTextPrimitive2D(
+ &rText.getSdrText(),
+ rText.getOutlinerParaObject(),
+ aAnchorTransform );
}
else // text in range
{