From 295869ce95c00a0e0b192ea6bf62753f91badaf2 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Sun, 9 Feb 2014 11:34:11 -0500 Subject: fdo#74479: Treat empty cells as if they have a value of 0. Change-Id: I3701848016c230138e8791f683a2c8b97219198d --- sc/source/core/tool/scmatrix.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 74f7fa3d9528..090cada23e71 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -1612,7 +1612,16 @@ public: } break; case mdds::mtm::element_empty: - std::advance(miPos, node.size); + { + // Empty element is equivalent of having a numeric value of 0.0. + for (size_t i = 0; i < node.size; ++i, ++miPos) + { + if (rtl::math::isNan(*miPos)) + continue; + + *miPos = op(*miPos, 0.0); + } + } default: ; } -- cgit v1.2.3