fix up const malformed copy ctors and operator=

This commit is contained in:
Caolán McNamara
2012-02-16 09:47:29 +00:00
parent bbd638350f
commit 46087fd1b7
2 changed files with 17 additions and 14 deletions

View File

@@ -206,7 +206,7 @@ PortionObj::PortionObj( ::com::sun::star::uno::Reference< ::com::sun::star::text
}
}
PortionObj::PortionObj( PortionObj& rPortionObj )
PortionObj::PortionObj( const PortionObj& rPortionObj )
: PropStateValue( rPortionObj )
{
ImplConstruct( rPortionObj );
@@ -434,7 +434,7 @@ void PortionObj::ImplClear()
delete[] mpText;
}
void PortionObj::ImplConstruct( PortionObj& rPortionObj )
void PortionObj::ImplConstruct( const PortionObj& rPortionObj )
{
mbLastPortion = rPortionObj.mbLastPortion;
mnTextSize = rPortionObj.mnTextSize;
@@ -628,7 +628,7 @@ sal_uInt32 PortionObj::ImplGetTextField( ::com::sun::star::uno::Reference< ::com
return nRetValue;
}
PortionObj& PortionObj::operator=( PortionObj& rPortionObj )
PortionObj& PortionObj::operator=( const PortionObj& rPortionObj )
{
if ( this != &rPortionObj )
{
@@ -704,7 +704,7 @@ ParagraphObj::ParagraphObj( const ::com::sun::star::uno::Reference< ::com::sun::
}
}
ParagraphObj::ParagraphObj( ParagraphObj& rObj )
ParagraphObj::ParagraphObj( const ParagraphObj& rObj )
: List()
, PropStateValue()
, SOParagraph()
@@ -1174,7 +1174,7 @@ void ParagraphObj::ImplGetParagraphValues( PPTExBulletProvider& rBuProv, sal_Boo
meBiDi = ePropState;
}
void ParagraphObj::ImplConstruct( ParagraphObj& rParagraphObj )
void ParagraphObj::ImplConstruct( const ParagraphObj& rParagraphObj )
{
mnTextSize = rParagraphObj.mnTextSize;
mnTextAdjust = rParagraphObj.mnTextAdjust;
@@ -1187,8 +1187,11 @@ void ParagraphObj::ImplConstruct( ParagraphObj& rParagraphObj )
mbForbiddenRules = rParagraphObj.mbForbiddenRules;
mnBiDi = rParagraphObj.mnBiDi;
for ( void* pPtr = rParagraphObj.First(); pPtr; pPtr = rParagraphObj.Next() )
Insert( new PortionObj( *(PortionObj*)pPtr ), LIST_APPEND );
{
ParagraphObj& rConstApiLossage = const_cast<ParagraphObj&>(rParagraphObj);
for ( const void* pPtr = rConstApiLossage.First(); pPtr; pPtr = rConstApiLossage.Next() )
Insert( new PortionObj( *static_cast<const PortionObj*>(pPtr) ), LIST_APPEND );
}
maTabStop = rParagraphObj.maTabStop;
bExtendedParameters = rParagraphObj.bExtendedParameters;
@@ -1221,7 +1224,7 @@ sal_uInt32 ParagraphObj::ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosi
return mnTextSize;
}
ParagraphObj& ParagraphObj::operator=( ParagraphObj& rParagraphObj )
ParagraphObj& ParagraphObj::operator=( const ParagraphObj& rParagraphObj )
{
if ( this != &rParagraphObj )
{

View File

@@ -118,7 +118,7 @@ class PortionObj : public PropStateValue
protected :
void ImplClear();
void ImplConstruct( PortionObj& rPortionObj );
void ImplConstruct( const PortionObj& rPortionObj );
sal_uInt32 ImplGetTextField( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & rXTextRangeRef,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSetRef, String& rURL );
sal_uInt32 ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition );
@@ -151,13 +151,13 @@ class PortionObj : public PropStateValue
sal_Bool bLast, FontCollection& rFontCollection );
PortionObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSetRef,
FontCollection& rFontCollection );
PortionObj( PortionObj& rPortionObj );
PortionObj( const PortionObj& rPortionObj );
~PortionObj();
void Write( SvStream* pStrm, sal_Bool bLast );
sal_uInt32 Count() const { return mnTextSize; };
PortionObj& operator=( PortionObj& rPortionObj );
PortionObj& operator=( const PortionObj& rPortionObj );
};
struct ParaFlags
@@ -178,7 +178,7 @@ class ParagraphObj : public List, public PropStateValue, public SOParagraph
protected :
void ImplConstruct( ParagraphObj& rParagraphObj );
void ImplConstruct( const ParagraphObj& rParagraphObj );
void ImplClear();
sal_uInt32 ImplCalculateTextPositions( sal_uInt32 nCurrentTextPosition );
void ImplGetParagraphValues( PPTExBulletProvider& rBuProv, sal_Bool bGetPropStateValue = sal_False );
@@ -215,7 +215,7 @@ class ParagraphObj : public List, public PropStateValue, public SOParagraph
ParagraphObj( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & rXTextContentRef,
ParaFlags, FontCollection& rFontCollection,
PPTExBulletProvider& rBuProv );
ParagraphObj( ParagraphObj& rParargraphObj );
ParagraphObj( const ParagraphObj& rParargraphObj );
ParagraphObj( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rXPropSetRef,
PPTExBulletProvider& rBuProv );
@@ -225,7 +225,7 @@ class ParagraphObj : public List, public PropStateValue, public SOParagraph
void Write( SvStream* pStrm );
sal_uInt32 Count() const { return mnTextSize; };
ParagraphObj& operator=( ParagraphObj& rParagraphObj );
ParagraphObj& operator=( const ParagraphObj& rParagraphObj );
};
struct ImplTextObj