summaryrefslogtreecommitdiff
path: root/svx/source/sdr/attribute/sdrtextattribute.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/sdr/attribute/sdrtextattribute.cxx')
-rw-r--r--svx/source/sdr/attribute/sdrtextattribute.cxx96
1 files changed, 91 insertions, 5 deletions
diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx
index 591fcb026a..09f5299654 100644
--- a/svx/source/sdr/attribute/sdrtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrtextattribute.cxx
@@ -30,11 +30,18 @@
************************************************************************/
#include "precompiled_svx.hxx"
+
#include <svx/sdr/attribute/sdrtextattribute.hxx>
+#include <svx/sdr/attribute/sdrformtextattribute.hxx>
#include <svx/svdotext.hxx>
#include <svx/outlobj.hxx>
#include <svx/editobj.hxx>
#include <svx/flditem.hxx>
+#include <svx/sdr/properties/properties.hxx>
+
+//////////////////////////////////////////////////////////////////////////////
+// pointer compare define
+#define pointerOrContentEqual(p, q) ((p == q) || (p && q && *p == *q))
//////////////////////////////////////////////////////////////////////////////
@@ -56,13 +63,14 @@ namespace drawinglayer
bool bBlink,
bool bScroll,
bool bInEditMode)
- : mrSdrText(rSdrText),
+ : mpSdrText(&rSdrText),
maOutlinerParaObject(rOutlinerParaObject),
- meFormTextStyle(eFormTextStyle),
+ mpSdrFormTextAttribute(0),
maTextLeftDistance(aTextLeftDistance),
maTextUpperDistance(aTextUpperDistance),
maTextRightDistance(aTextRightDistance),
maTextLowerDistance(aTextLowerDistance),
+ maPropertiesVersion(0),
mbContour(bContour),
mbFitToSize(bFitToSize),
mbHideContour(bHideContour),
@@ -70,16 +78,94 @@ namespace drawinglayer
mbScroll(bScroll),
mbInEditMode(bInEditMode)
{
+ if(XFT_NONE != eFormTextStyle)
+ {
+ // text on path. Create FormText attribute
+ const SfxItemSet& rSet = getSdrText().GetItemSet();
+ mpSdrFormTextAttribute = new SdrFormTextAttribute(rSet);
+ }
+
+ // #i101556# init with version number to detect changes of single text
+ // attribute and/or style sheets in primitive data without having to
+ // copy that data locally (which would be better from principle)
+ maPropertiesVersion = rSdrText.GetObject().GetProperties().getVersion();
+ }
+
+ SdrTextAttribute::~SdrTextAttribute()
+ {
+ if(mpSdrFormTextAttribute)
+ {
+ delete mpSdrFormTextAttribute;
+ mpSdrFormTextAttribute = 0;
+ }
+ }
+
+ SdrTextAttribute::SdrTextAttribute(const SdrTextAttribute& rCandidate)
+ : mpSdrText(&rCandidate.getSdrText()),
+ maOutlinerParaObject(rCandidate.getOutlinerParaObject()),
+ mpSdrFormTextAttribute(0),
+ maTextLeftDistance(rCandidate.getTextLeftDistance()),
+ maTextUpperDistance(rCandidate.getTextUpperDistance()),
+ maTextRightDistance(rCandidate.getTextRightDistance()),
+ maTextLowerDistance(rCandidate.getTextLowerDistance()),
+ mbContour(rCandidate.isContour()),
+ mbFitToSize(rCandidate.isFitToSize()),
+ mbHideContour(rCandidate.isHideContour()),
+ mbBlink(rCandidate.isBlink()),
+ mbScroll(rCandidate.isScroll()),
+ mbInEditMode(rCandidate.isInEditMode())
+ {
+ if(rCandidate.getSdrFormTextAttribute())
+ {
+ mpSdrFormTextAttribute = new SdrFormTextAttribute(*rCandidate.getSdrFormTextAttribute());
+ }
+ }
+
+ SdrTextAttribute& SdrTextAttribute::operator=(const SdrTextAttribute& rCandidate)
+ {
+ mpSdrText = &rCandidate.getSdrText();
+ maOutlinerParaObject = rCandidate.getOutlinerParaObject();
+
+ if(mpSdrFormTextAttribute)
+ {
+ delete mpSdrFormTextAttribute;
+ }
+
+ mpSdrFormTextAttribute = 0;
+
+ if(rCandidate.getSdrFormTextAttribute())
+ {
+ mpSdrFormTextAttribute = new SdrFormTextAttribute(*rCandidate.getSdrFormTextAttribute());
+ }
+
+ maTextLeftDistance = rCandidate.getTextLeftDistance();
+ maTextUpperDistance = rCandidate.getTextUpperDistance();
+ maTextRightDistance = rCandidate.getTextRightDistance();
+ maTextLowerDistance = rCandidate.getTextLowerDistance();
+ mbContour = rCandidate.isContour();
+ mbFitToSize = rCandidate.isFitToSize();
+ mbHideContour = rCandidate.isHideContour();
+ mbBlink = rCandidate.isBlink();
+ mbScroll = rCandidate.isScroll();
+ mbInEditMode = rCandidate.isInEditMode();
+
+ return *this;
}
bool SdrTextAttribute::operator==(const SdrTextAttribute& rCandidate) const
{
return (getOutlinerParaObject() == rCandidate.getOutlinerParaObject()
- && getFormTextStyle() == rCandidate.getFormTextStyle()
+ // #i102062# for primitive visualisation, the WrongList (SpellChecking)
+ // is important, too, so use isWrongListEqual since there is no WrongList
+ // comparison in the regular OutlinerParaObject compare (since it's
+ // not-persistent data)
+ && getOutlinerParaObject().isWrongListEqual(rCandidate.getOutlinerParaObject())
+ && pointerOrContentEqual(getSdrFormTextAttribute(), rCandidate.getSdrFormTextAttribute())
&& getTextLeftDistance() == rCandidate.getTextLeftDistance()
&& getTextUpperDistance() == rCandidate.getTextUpperDistance()
&& getTextRightDistance() == rCandidate.getTextRightDistance()
&& getTextLowerDistance() == rCandidate.getTextLowerDistance()
+ && getPropertiesVersion() == rCandidate.getPropertiesVersion()
&& isContour() == rCandidate.isContour()
&& isFitToSize() == rCandidate.isFitToSize()
&& isHideContour() == rCandidate.isHideContour()
@@ -92,7 +178,7 @@ namespace drawinglayer
{
if(isBlink())
{
- mrSdrText.GetObject().impGetBlinkTextTiming(rAnimList);
+ mpSdrText->GetObject().impGetBlinkTextTiming(rAnimList);
}
}
@@ -100,7 +186,7 @@ namespace drawinglayer
{
if(isScroll())
{
- mrSdrText.GetObject().impGetScrollTextTiming(rAnimList, fFrameLength, fTextLength);
+ mpSdrText->GetObject().impGetScrollTextTiming(rAnimList, fFrameLength, fTextLength);
}
}
} // end of namespace attribute