/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
void ScJumboSheetsTest::testRoundtripColumn2000Xlsx()
{
testRoundtripColumn2000("xlsx/value-in-column-2000.xlsx", "Calc Office Open XML");
}
void ScJumboSheetsTest::testRoundtripColumn2000(constchar* name, constchar* format)
{
createScDoc(name);
{
ScDocument* pDoc = getScDoc(); // Check the value at BXX1 (2000th column).
CPPUNIT_ASSERT_EQUAL(-5.0, pDoc->GetValue(1999, 0, 0)); // Check the formula referencing the value.
CPPUNIT_ASSERT_EQUAL(u"=BXX1"_ustr, pDoc->GetFormula(0, 0, 0)); // Recalc and check value in the reference.
pDoc->CalcAll();
CPPUNIT_ASSERT_EQUAL(-5.0, pDoc->GetValue(0, 0, 0));
}
void ScJumboSheetsTest::testRoundtripNamedRangesXlsx()
{
testRoundtripNamedRanges("ods/ranges-column-2000.ods", "Calc Office Open XML");
}
void ScJumboSheetsTest::testNamedRangeNameConflict()
{ // The document contains named ranges named 'num1' and 'num2', that should be still treated // as named references even though with 16k columns those are normally NUM1 and NUM2 cells.
createScDoc("ods/named-range-conflict.ods");
// Without the fix in place, this test would have failed here
CPPUNIT_ASSERT(pOleObj);
// Sorry, the charts so severely suffer from DPI dependency, that I can't find motivation // to add huge tolerances (around 350!) here to make it pass on non-default DPI, with no // guarantee that the test would have any value after that. So just skip it. // FIXME: the DPI check should be removed when either (1) the test is fixed to work with // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. if (!IsDefaultDPI()) return;
CPPUNIT_ASSERT_EQUAL(tools::Long(12741), pOleObj->GetLogicRect().getOpenWidth());
CPPUNIT_ASSERT_EQUAL(tools::Long(7620), pOleObj->GetLogicRect().getOpenHeight());
CPPUNIT_ASSERT_EQUAL(tools::Long(1700), pOleObj->GetLogicRect().getX()); // tdf#147458: Without the fix in place, this test would have failed with // - Expected: 2117 // - Actual : -7421
CPPUNIT_ASSERT_EQUAL(tools::Long(2117), pOleObj->GetLogicRect().getY());
}
void ScJumboSheetsTest::testTdf134392()
{ // Without the fix in place, the file would have crashed
createScDoc("xlsx/tdf134392.xlsx");
ScDocument* pDoc = getScDoc();
pDoc->CalcAll(); // perform hard re-calculation.
}
// Without the fix in place, this test would have failed with // - Expected: // - Actual : B
CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(1, 0, 0)));
CPPUNIT_ASSERT_EQUAL(u"B"_ustr, pDoc->GetString(ScAddress(2, 0, 0)));
}
void ScJumboSheetsTest::testTdf109061()
{ // Without the fix in place, the file would have crashed
createScDoc("xlsx/tdf109061.xlsx");
ScDocument* pDoc = getScDoc();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.