summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2013-03-26 23:39:49 +0100
committerPetr Mladek <pmladek@suse.cz>2013-03-28 13:03:19 +0000
commit089311bb3d8f421d3c1455779c5112fe110010e1 (patch)
tree45726ce53500773aa02e3f70210dd79c2f0b0bab /forms
parenta756c8857b682dbc363ef34f07bda4a494e61a36 (diff)
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@suse.cz> Tested-by: Petr Mladek <pmladek@suse.cz>
Diffstat (limited to 'forms')
-rw-r--r--forms/source/richtext/rtattributes.hxx18
1 files changed, 6 insertions, 12 deletions
diff --git a/forms/source/richtext/rtattributes.hxx b/forms/source/richtext/rtattributes.hxx
index 3f19c98e736a..825ed17c3fa1 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