git.s-ol.nu inkscape / 41b5402
fix #521 SPIString copy constructor Thomas Holder 2 years ago
1 changed file(s) with 10 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
613613 : SPIBase(inherits)
614614 {}
615615
616 SPIString(const SPIString &rhs) { *this = rhs; }
617
616618 ~SPIString() override {
617619 g_free(_value);
618620 }
624626 void merge( const SPIBase* const parent ) override;
625627
626628 SPIString& operator=(const SPIString& rhs) {
629 if (this == &rhs) {
630 return *this;
631 }
627632 SPIBase::operator=(rhs);
628633 g_free(_value);
629634 _value = g_strdup(rhs._value);
837842 this->clear();
838843 }
839844
845 SPIPaintOrder(const SPIPaintOrder &rhs) { *this = rhs; }
846
840847 ~SPIPaintOrder() override {
841848 g_free( value );
842849 }
856863 void merge( const SPIBase* const parent ) override;
857864
858865 SPIPaintOrder& operator=(const SPIPaintOrder& rhs) {
866 if (this == &rhs) {
867 return *this;
868 }
859869 SPIBase::operator=(rhs);
860870 for( unsigned i = 0; i < PAINT_ORDER_LAYERS; ++i ) {
861871 layer[i] = rhs.layer[i];