[Libreoffice-commits] core.git: forms/source
Julien Nabet
serval2412 at yahoo.fr
Thu Mar 28 06:03:40 PDT 2013
forms/source/richtext/rtattributes.hxx | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
New commits:
commit 089311bb3d8f421d3c1455779c5112fe110010e1
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Tue Mar 26 23:39:49 2013 +0100
coverity#704145 Resource leak in object
also cleaned up comments
Change-Id: Ia676d215cf8ef4830e31a1caf4153e33af84c200
Reviewed-on: https://gerrit.libreoffice.org/3071
Reviewed-by: Petr Mladek <pmladek at suse.cz>
Tested-by: Petr Mladek <pmladek at suse.cz>
diff --git a/forms/source/richtext/rtattributes.hxx b/forms/source/richtext/rtattributes.hxx
index 3f19c98..825ed17 100644
--- a/forms/source/richtext/rtattributes.hxx
+++ b/forms/source/richtext/rtattributes.hxx
@@ -24,10 +24,8 @@
#include <sal/types.h>
#include <svl/poolitem.hxx>
-//........................................................................
namespace frm
{
-//........................................................................
//====================================================================
//= misc
@@ -62,10 +60,10 @@ namespace frm
public:
AttributeCheckState eSimpleState;
- //................................................................
inline AttributeState( );
inline explicit AttributeState( AttributeCheckState _eCheckState );
inline AttributeState( const AttributeState& _rSource );
+ inline ~AttributeState( );
inline AttributeState& operator=( const AttributeState& _rSource );
@@ -78,21 +76,18 @@ namespace frm
//====================================================================
//= AttributeState (inline implementation)
//====================================================================
- //................................................................
inline AttributeState::AttributeState( )
:pItemHandle( NULL )
,eSimpleState( eIndetermined )
{
}
- //................................................................
inline AttributeState::AttributeState( AttributeCheckState _eCheckState )
:pItemHandle( NULL )
,eSimpleState( _eCheckState )
{
}
- //................................................................
inline AttributeState::AttributeState( const AttributeState& _rSource )
:pItemHandle( NULL )
,eSimpleState( eIndetermined )
@@ -100,7 +95,11 @@ namespace frm
operator=( _rSource );
}
- //................................................................
+ inline AttributeState::~AttributeState( )
+ {
+ delete(pItemHandle);
+ }
+
inline AttributeState& AttributeState::operator=( const AttributeState& _rSource )
{
if ( &_rSource == this )
@@ -111,13 +110,11 @@ namespace frm
return *this;
}
- //................................................................
inline const SfxPoolItem* AttributeState::getItem() const
{
return pItemHandle ? &pItemHandle->GetItem() : NULL;
}
- //................................................................
inline void AttributeState::setItem( const SfxPoolItem* _pItem )
{
if ( pItemHandle )
@@ -128,7 +125,6 @@ namespace frm
pItemHandle = NULL;
}
- //................................................................
inline bool AttributeState::operator==( const AttributeState& _rRHS )
{
if ( eSimpleState != _rRHS.eSimpleState )
@@ -159,9 +155,7 @@ namespace frm
~IMultiAttributeDispatcher() {}
};
-//........................................................................
} // namespace frm
-//........................................................................
#endif // FORMS_SOURCE_RICHTEXT_RTATTRIBUTES_HXX
More information about the Libreoffice-commits
mailing list