diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-01-16 13:03:52 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-01-16 14:54:03 -0500 |
commit | 5159695813b9dc08743de4bbcf7807f41e160b8f (patch) | |
tree | 6c46c8d27b7e2bbd25b2464a99d504b6da200f11 /svx/source/svdraw/svdlayer.cxx | |
parent | ff3e2a4a1ec23548dd42cab2e9a748bcd9156119 (diff) |
Some cleanup of SdrLayer class.
String replacement, proper use of initializer in constructors etc.
Change-Id: Ic5e04c614ad044efcb32329a31540402524afe85
Diffstat (limited to 'svx/source/svdraw/svdlayer.cxx')
-rw-r--r-- | svx/source/svdraw/svdlayer.cxx | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/svx/source/svdraw/svdlayer.cxx b/svx/source/svdraw/svdlayer.cxx index 7e851625132f..a28f307ca917 100644 --- a/svx/source/svdraw/svdlayer.cxx +++ b/svx/source/svdraw/svdlayer.cxx @@ -24,10 +24,6 @@ #include "svx/svdglob.hxx" // StringCache #include "svx/svdstr.hrc" // names taken from the resource -//////////////////////////////////////////////////////////////////////////////////////////////////// -// SetOfByte -//////////////////////////////////////////////////////////////////////////////////////////////////// - sal_Bool SetOfByte::IsEmpty() const { for(sal_uInt16 i(0); i < 32; i++) @@ -104,15 +100,21 @@ void SetOfByte::QueryValue( com::sun::star::uno::Any & rAny ) const rAny <<= aSeq; } -//////////////////////////////////////////////////////////////////////////////////////////////////// -// SdrLayer -//////////////////////////////////////////////////////////////////////////////////////////////////// +SdrLayer::SdrLayer() : pModel(NULL), nType(0), nID(0) {} + +SdrLayer::SdrLayer(SdrLayerID nNewID, const OUString& rNewName) : + maName(rNewName), pModel(NULL), nType(0), nID(nNewID) {} + +void SdrLayer::SetID(SdrLayerID nNewID) +{ + nID = nNewID; +} void SdrLayer::SetStandardLayer(bool bStd) { nType=(sal_uInt16)bStd; if (bStd) { - aName=ImpGetResStr(STR_StandardLayerName); + maName = ImpGetResStr(STR_StandardLayerName); } if (pModel!=NULL) { SdrHint aHint(HINT_LAYERCHG); @@ -121,20 +123,19 @@ void SdrLayer::SetStandardLayer(bool bStd) } } -void SdrLayer::SetName(const XubString& rNewName) +void SdrLayer::SetName(const OUString& rNewName) { - if(!rNewName.Equals(aName)) - { - aName = rNewName; - nType = 0; // user defined + if (rNewName == maName) + return; - if(pModel) - { - SdrHint aHint(HINT_LAYERCHG); + maName = rNewName; + nType = 0; // user defined - pModel->Broadcast(aHint); - pModel->SetChanged(); - } + if (pModel) + { + SdrHint aHint(HINT_LAYERCHG); + pModel->Broadcast(aHint); + pModel->SetChanged(); } } @@ -142,7 +143,7 @@ bool SdrLayer::operator==(const SdrLayer& rCmpLayer) const { return (nID == rCmpLayer.nID && nType == rCmpLayer.nType - && aName.Equals(rCmpLayer.aName)); + && maName == rCmpLayer.maName); } //////////////////////////////////////////////////////////////////////////////////////////////////// |