summaryrefslogtreecommitdiff
path: root/sc/source/core/data/column.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-03-15 21:22:02 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-03-15 22:12:42 -0400
commite595fb27c6ba64fd5112d4fd919067f0205ccffa (patch)
treed0528986d6f25cf3795771abc05966c885158355 /sc/source/core/data/column.cxx
parente022d9eb46f5de13306da4a61b9899c79cf6170b (diff)
Actually unknown script type doesn't equal empty script type (0).
Let's differentiate the two types. A new cell starts with an unknown script type, whereas empty cells have a script type of 0 (empty). Change-Id: Id66857100ed213c5cfc37e48789448d94e97a5d2
Diffstat (limited to 'sc/source/core/data/column.cxx')
-rw-r--r--sc/source/core/data/column.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 404dc485a246..e8a39ad580ad 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -61,23 +61,23 @@ ScNeededSizeOptions::ScNeededSizeOptions() :
void ScColumn::SwapScriptTypes( ScriptType& rSrc, SCROW nSrcRow, ScriptType& rDest, SCROW nDestRow )
{
- unsigned short nSrcVal = SC_SCRIPTTYPE_UNKNOWN;
- unsigned short nDestVal = SC_SCRIPTTYPE_UNKNOWN;
+ unsigned short nSrcVal = 0;
+ unsigned short nDestVal = 0;
if (!rSrc.is_empty(nSrcRow))
nSrcVal = rSrc.get<unsigned short>(nSrcRow);
if (!rDest.is_empty(nDestRow))
nDestVal = rDest.get<unsigned short>(nDestRow);
- if (nDestVal == SC_SCRIPTTYPE_UNKNOWN)
- rSrc.set_empty(nSrcRow, nSrcRow);
- else
+ if (nDestVal)
rSrc.set(nSrcRow, nDestVal);
-
- if (nSrcVal == SC_SCRIPTTYPE_UNKNOWN)
- rDest.set_empty(nDestRow, nDestRow);
else
+ rSrc.set_empty(nSrcRow, nSrcRow);
+
+ if (nSrcVal)
rDest.set(nDestRow, nSrcVal);
+ else
+ rDest.set_empty(nDestRow, nDestRow);
}
ScColumn::ScColumn() :