diff options
author | Oliver Bolte <obo@openoffice.org> | 2004-06-04 07:47:00 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2004-06-04 07:47:00 +0000 |
commit | 2b6d4aff6983708e9832c7ef5d97d26a5e662f9d (patch) | |
tree | 96ac9d88883d4308df018ba14b36817d112f6cbe /sw/source/core/txtnode/atrfld.cxx | |
parent | d5d99073bbb43d11e1abb1226556ec089eb5824a (diff) |
INTEGRATION: CWS fmebugs02 (1.5.50); FILE MERGED
2004/05/14 08:22:33 od 1.5.50.1: #i29146# <SwFmtFld::operator==(..)> - check fields and add condition
Diffstat (limited to 'sw/source/core/txtnode/atrfld.cxx')
-rw-r--r-- | sw/source/core/txtnode/atrfld.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index 7e028eb233c9..0c17f8535b6a 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -2,9 +2,9 @@ * * $RCSfile: atrfld.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: kz $ $Date: 2004-05-18 14:04:55 $ + * last change: $Author: obo $ $Date: 2004-06-04 08:47:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -170,8 +170,13 @@ void SwFmtFld::SetFld(SwField * _pField) int SwFmtFld::operator==( const SfxPoolItem& rAttr ) const { ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" ); - return pField->GetTyp() == ((SwFmtFld&)rAttr).GetFld()->GetTyp() && - pField->GetFormat() == ((SwFmtFld&)rAttr).GetFld()->GetFormat(); + // OD 2004-05-14 #i29146# - correction: check, if <pField> and + // <((SwFmtFld&)rAttr).GetFld()> are set. + // OD 2004-05-14 #i29146# - items are equal, if both fields aren't set. + return ( pField && ((SwFmtFld&)rAttr).GetFld() && + pField->GetTyp() == ((SwFmtFld&)rAttr).GetFld()->GetTyp() && + pField->GetFormat() == ((SwFmtFld&)rAttr).GetFld()->GetFormat() ) || + ( !pField && !((SwFmtFld&)rAttr).GetFld() ); } SfxPoolItem* SwFmtFld::Clone( SfxItemPool* ) const |