diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-02-14 20:39:18 -0500 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2014-02-18 15:04:04 +0100 |
commit | 931ac18da7c7da6f4bdb955ed2d6ce264cf97159 (patch) | |
tree | 13239b45eaa9b8c480377a6afe27b0a4559ea0c9 | |
parent | 593f753b9b449ca9ab632fb68d1621d33d48b909 (diff) |
fdo#72691: Allow overwriting of string value with numeric one.
This can legitimately happen when you have a matrix with a reference to
another cell inside, and the referenced cell originally contained a
string value then later overwritten by a numeric value.
Example. Put a "Text" in A1, and in B1 put a 1x1 matrix {=A1}. It
displays "Text" in B1. Then put 11 in A1. Prior to this change, B1
would become blank. With this change, B1 will display 11.
Change-Id: I3feba3a8658e1a5ebf6f9e5ac34de2d579464ddb
(cherry picked from commit 9bf907a8278cecd816368db7b8c4ab745a914a59)
Reviewed-on: https://gerrit.libreoffice.org/8065
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Jacobo Aragunde Pérez <jaragunde@igalia.com>
Tested-by: Jacobo Aragunde Pérez <jaragunde@igalia.com>
-rw-r--r-- | sc/source/core/tool/token.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index ff456eb4a12d..fc9ad75e476d 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1146,6 +1146,9 @@ void ScMatrixFormulaCellToken::SetUpperLeftDouble( double f ) case svDouble: const_cast<FormulaToken*>(xUpperLeft.get())->GetDoubleAsReference() = f; break; + case svString: + xUpperLeft = new FormulaDoubleToken( f); + break; case svUnknown: if (!xUpperLeft) { |