summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-03-02 17:15:47 +0100
committerEike Rathke <erack@redhat.com>2018-03-02 20:27:45 +0100
commitce4fc2fc08be8ea2773194e303ed42d2579e93a0 (patch)
tree3bf54c4b1ce7c914b5f2f71a4d727e433892af4b /sc
parentc8cd02629d0c17c248eae42369fff246f49ae9d7 (diff)
Resolves: tdf#115351 convert boolean equivalent format codes to proper Boolean
Because Excel does not know a Boolean number format, BOOLEAN is saved to Excel as "TRUE";"TRUE";"FALSE" with implicit conditions [>0] and [<0]. This when loaded has no boolean property. Then saved to ODF it is loaded as [>0]"TRUE";[<0]"TRUE";"FALSE" with explicit conditions, which has identical meaning. Convert both equivalent format codes to proper BOOLEAN when reading. Locale dependent representations are treated the same, e.g. "WAHR";"WAHR";"FALSCH" Change-Id: I49383d71fce972fdd7ad9b19ce3bc150d02aba62 Reviewed-on: https://gerrit.libreoffice.org/50642 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 5332bc77722e..6742e12b999e 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -459,7 +459,8 @@ void ScFiltersTest::testBooleanFormatXLSX()
ScDocShellRef xDocSh = loadDoc("check-boolean.", FORMAT_XLSX);
ScDocument& rDoc = xDocSh->GetDocument();
SvNumberFormatter* pNumFormatter = rDoc.GetFormatTable();
- const OUString aBooleanTypeStr = "\"TRUE\";\"TRUE\";\"FALSE\"";
+ // Saved as >"TRUE";"TRUE";"FALSE"< but reading converted back to >BOOLEAN<
+ const OUString aBooleanTypeStr = "BOOLEAN";
CPPUNIT_ASSERT_MESSAGE("Failed to load check-boolean.xlsx", xDocSh.is());
sal_uInt32 nNumberFormat;
@@ -469,7 +470,7 @@ void ScFiltersTest::testBooleanFormatXLSX()
rDoc.GetNumberFormat(0, i, 0, nNumberFormat);
const SvNumberformat* pNumberFormat = pNumFormatter->GetEntry(nNumberFormat);
const OUString& rFormatStr = pNumberFormat->GetFormatstring();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("Number format != boolean", rFormatStr, aBooleanTypeStr);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Number format != boolean", aBooleanTypeStr, rFormatStr);
}
xDocSh->DoClose();