void ParagraphStyle::eraseStyle(const ParagraphStyle& other) { other.validate(); Style::eraseStyle(other); m_cstyle.eraseCharStyle(other.charStyle()); m_cstyleContext.invalidate(); #define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \ if (!inh_##attr_NAME && m_##attr_NAME == other.m_##attr_NAME) \ reset##attr_NAME(); #include "paragraphstyle.attrdefs.cxx" #undef ATTRDEF }
void ParagraphStyle::setStyle(const ParagraphStyle & other) { other.validate(); setParent(other.parent()); m_contextversion = -1; m_cstyle.setStyle(other.charStyle()); m_cstyleContext.invalidate(); #define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \ inh_##attr_NAME = other.inh_##attr_NAME; \ m_##attr_NAME = other.m_##attr_NAME; #include "paragraphstyle.attrdefs.cxx" #undef ATTRDEF }
ParagraphStyle::ParagraphStyle(const ParagraphStyle& other) : Style(other), m_cstyleContext(NULL), m_cstyleContextIsInh(other.m_cstyleContextIsInh), m_cstyle(other.charStyle()) { if (m_cstyleContextIsInh) m_cstyle.setContext(NULL); else m_cstyle.setContext(other.charStyle().context()); m_cstyleContext.setDefaultStyle( &m_cstyle ); // qDebug() << QString("ParagraphStyle(%2) %1").arg(reinterpret_cast<uint>(&other)).arg(reinterpret_cast<uint>(this)); other.validate(); #define ATTRDEF(attr_TYPE, attr_GETTER, attr_NAME, attr_DEFAULT) \ m_##attr_NAME = other.m_##attr_NAME; \ inh_##attr_NAME = other.inh_##attr_NAME; #include "paragraphstyle.attrdefs.cxx" #undef ATTRDEF }