Kaydet (Commit) aa77b170 authored tarafından matteocam's avatar matteocam Kaydeden (comit) Thorsten Behrens

chained editeng: Add chaining attributes and chaining primitive creation logic

Change-Id: I957d5261dd847fe5e950441585e879cfd5ae2fb2
üst e910e775
......@@ -76,7 +76,10 @@ namespace drawinglayer
bool bScroll,
bool bInEditMode,
bool bFixedCellHeight,
bool bWrongSpell);
bool bWrongSpell,
bool bToBeChained,
bool bChainable);
SdrTextAttribute();
SdrTextAttribute(const SdrTextAttribute& rCandidate);
SdrTextAttribute& operator=(const SdrTextAttribute& rCandidate);
......@@ -107,6 +110,10 @@ namespace drawinglayer
SdrTextHorzAdjust getSdrTextHorzAdjust() const;
SdrTextVertAdjust getSdrTextVertAdjust() const;
bool isToBeChained() const;
bool isChainable() const;
// helpers: animation timing generators
void getBlinkTextTiming(
drawinglayer::animation::AnimationEntryList& rAnimList) const;
......
......@@ -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();
......
......@@ -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();
......
......@@ -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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment