From 00ae1cec08ae970f0640c0cc5d612eb0b9035207 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Mon, 16 Jul 2012 22:54:38 +0200 Subject: Change form of checking self-assignment + cleaning before assigning Change-Id: Idc8e8445b870805b99d2b9434cf1f752c63cc6a0 --- lotuswordpro/source/filter/xfilter/xfparastyle.cxx | 86 +++++++++++----------- 1 file changed, 45 insertions(+), 41 deletions(-) (limited to 'lotuswordpro') diff --git a/lotuswordpro/source/filter/xfilter/xfparastyle.cxx b/lotuswordpro/source/filter/xfilter/xfparastyle.cxx index 1bccbcdcbd71..64296a2da497 100644 --- a/lotuswordpro/source/filter/xfilter/xfparastyle.cxx +++ b/lotuswordpro/source/filter/xfilter/xfparastyle.cxx @@ -116,7 +116,7 @@ XFParaStyle::XFParaStyle(const XFParaStyle& other) : XFStyle(other) m_aLineHeight = other.m_aLineHeight; m_aPadding = other.m_aPadding; m_aBreaks = other.m_aBreaks; -// m_aTabs = other.m_aTabs; + for (size_t i=0; i(pStyle); - if( pTabStyle ) + const IXFStyle *pStyle = other.m_aTabs.Item(i); + if( pStyle ) { - XFTabStyle *pCopyStyle = new XFTabStyle(*pTabStyle); - m_aTabs.AddStyle(pCopyStyle); + const XFTabStyle *pTabStyle = dynamic_cast(pStyle); + if( pTabStyle ) + { + XFTabStyle *pCopyStyle = new XFTabStyle(*pTabStyle); + m_aTabs.AddStyle(pCopyStyle); + } } } } - return *this; } -- cgit