diff options
author | Eike Rathke <erack@redhat.com> | 2018-03-02 17:15:47 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2018-03-15 17:04:07 +0100 |
commit | feb3da3dc53c9b702e39ec12b037b07a67bedcbd (patch) | |
tree | 4f5a8c30ff736699bab6dae7e4f80631047edf6b /sc | |
parent | 1c354750f9e52bfa241e3edffeb6d84dd8b92e5e (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"
Reviewed-on: https://gerrit.libreoffice.org/50642
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
(cherry picked from commit ce4fc2fc08be8ea2773194e303ed42d2579e93a0)
Backported.
Conflicts:
svl/source/numbers/zforscan.cxx
Change-Id: I49383d71fce972fdd7ad9b19ce3bc150d02aba62
Reviewed-on: https://gerrit.libreoffice.org/50645
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 5 |
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 1a1ff8fa6452..38e348fe3785 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -441,7 +441,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; @@ -451,7 +452,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(); |