diff options
author | Michael Stahl <mst@openoffice.org> | 2010-08-27 12:25:34 +0200 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-08-27 12:25:34 +0200 |
commit | caefe9e5f6df6c51d000afc940d2e2eb983471d6 (patch) | |
tree | 48523c3e7bf031a36a7de035d57329ef4034f6b4 /sw | |
parent | 104e5322c5b511105b26b8c811078da66e6d95b9 (diff) |
dba33h: #i112652#: SwTblBoxValue: items with NaN should compare equal
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/attr/cellatr.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sw/source/core/attr/cellatr.cxx b/sw/source/core/attr/cellatr.cxx index 8032d3506a27..f492696ef8ac 100644 --- a/sw/source/core/attr/cellatr.cxx +++ b/sw/source/core/attr/cellatr.cxx @@ -28,9 +28,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include <float.h> +#include <rtl/math.hxx> -#include <float.h> #include <hintids.hxx> // fuer RES_.. #include <cellatr.hxx> #include <calc.hxx> @@ -249,8 +250,12 @@ SwTblBoxValue::SwTblBoxValue( const double nVal ) int SwTblBoxValue::operator==( const SfxPoolItem& rAttr ) const { - ASSERT( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" ); - return nValue == ((SwTblBoxValue&)rAttr).nValue; + ASSERT(SfxPoolItem::operator==(rAttr), "SwTblBoxValue: item not equal"); + SwTblBoxValue const& rOther( static_cast<SwTblBoxValue const&>(rAttr) ); + // items with NaN should be equal to enable pooling + return ::rtl::math::isNan(nValue) + ? ::rtl::math::isNan(rOther.nValue) + : (nValue == rOther.nValue); } |