/* -*- 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/.
*/
// Without the fix in place, this test would have failed with // - Expected: Accent 1 // - Actual : Default
CPPUNIT_ASSERT_EQUAL(u"Accent 1"_ustr, pStyleSheet->GetName());
dispatchCommand(mxComponent, u".uno:SelectAll"_ustr,
{}); // test should crash here without the fix
CPPUNIT_ASSERT_EQUAL(u"Control Height will change from 0.65 to 0.61 cm with 120dpi ..."_ustr,
pDoc->GetString(ScAddress(3, 1, 1)));
dispatchCommand(mxComponent, u".uno:Cut"_ustr, {});
// Move the shape to the right
lcl_SelectObjectByName(*getViewShell(), u"Shape 1");
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_RIGHT);
Scheduler::ProcessEventsToIdle();
//position has changed
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5084), xShape->getPosition().X);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1381), xShape->getPosition().Y);
// Type into the shape
typeString(u"x");
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_ESCAPE);
pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_ESCAPE);
Scheduler::ProcessEventsToIdle();
// Without the fix in place, this test would have failed with // - Expected: 4984 // - Actual : 5084
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4984), xShape->getPosition().X);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1381), xShape->getPosition().Y);
// tdf#141816: Without the fix in place, this test would have failed with // - Expected: // - Actual : x
uno::Reference<text::XText> xText
= uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText();
CPPUNIT_ASSERT_EQUAL(u""_ustr, xText->getString());
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf131455)
{ // Note that tdf#131455 and tdf#126904 were actually incorrect, // but keep the test with a fixed version of the document.
createScDoc("tdf131455-fixed.ods");
ScDocShell* pDocSh = getScDocShell();
//Cursor can't move forward to the right for (size_t i = 0; i < 5; ++i)
{
dispatchCommand(mxComponent, u".uno:GoRight"_ustr, {});
lcl_AssertCurrentCursorPosition(*pDocSh, u"N5");
}
//Cursor can't move forward to the right for (size_t i = 0; i < 5; ++i)
{
dispatchCommand(mxComponent, u".uno:GoRight"_ustr, {});
lcl_AssertCurrentCursorPosition(*pDocSh, u"N5");
}
}
// The actual result is completely unrelated to this test and behaviour of // OFFSET() was changed as of tdf#85551 and here result of that test // document is now Err:502 instead of 0. static constexpr OUString aExpectedResult(u"Err:502"_ustr);
lcl_AssertCurrentCursorPosition(*pDocSh, u"D10");
CPPUNIT_ASSERT_EQUAL(aExpectedResult, pDoc->GetString(ScAddress(3, 9, 0)));
//Without the fix, it would crash
dispatchCommand(mxComponent, u".uno:InsertRowsBefore"_ustr, {});
CPPUNIT_ASSERT_EQUAL(u""_ustr, pDoc->GetString(ScAddress(3, 9, 0)));
dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT_EQUAL(aExpectedResult, pDoc->GetString(ScAddress(3, 9, 0)));
}
// Without the fix in place, this test would have failed with // - Expected: =MOD(G$71+$D72,9) // - Actual : =MOD(G$71+$K72,9)
CPPUNIT_ASSERT_EQUAL(u"=MOD(G$71+$D72,9)"_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(5.0, pDoc->GetValue(ScAddress(6, 71, 0)));
// Without the fix in place, it would crash here due to an out of bounds array access
dispatchCommand(mxComponent, u".uno:InsertColumnsBefore"_ustr, {});
CPPUNIT_ASSERT_EQUAL(u"Column2"_ustr, pDoc->GetString(ScAddress(2, 0, 0)));
dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT_EQUAL(u"Column2"_ustr, pDoc->GetString(ScAddress(1, 0, 0)));
}
// Without the fix in place, it would crash here with // uncaught exception of type std::exception (or derived). // - vector::_M_fill_insert
insertStringToCell(u"H220"_ustr, u"=SUMIFS($H$2:$DB$198,B$2:B$198,G220)");
CPPUNIT_ASSERT(!pDoc->RowHidden(0, 0)); // tdf#131073: Without the fix in place, the second row would not be hidden
CPPUNIT_ASSERT(pDoc->RowHidden(1, 0));
CPPUNIT_ASSERT(!pDoc->RowHidden(2, 0)); const sal_uInt16 nStdRowHeight = pDoc->GetRowHeight(4, 0);
CPPUNIT_ASSERT_EQUAL(nStdRowHeight, pDoc->GetRowHeight(0, 0));
CPPUNIT_ASSERT_EQUAL(nStdRowHeight, pDoc->GetRowHeight(1, SCTAB(0), false));
CPPUNIT_ASSERT_EQUAL(nStdRowHeight, pDoc->GetRowHeight(2, 0));
CPPUNIT_ASSERT(!pDoc->ColHidden(0, 0)); // tdf#131073: Without the fix in place, the second column would not be hidden
CPPUNIT_ASSERT(pDoc->ColHidden(1, 0));
CPPUNIT_ASSERT(!pDoc->ColHidden(2, 0)); const sal_uInt16 nStdColWidth = pDoc->GetColWidth(0, 0);
CPPUNIT_ASSERT_EQUAL(nStdColWidth, pDoc->GetColWidth(0, 0));
CPPUNIT_ASSERT_EQUAL(nStdColWidth, pDoc->GetColWidth(1, SCTAB(0), false));
CPPUNIT_ASSERT_EQUAL(nStdColWidth, pDoc->GetColWidth(2, 0));
}
// Without the fix in place, this test would have failed with // - Expected: 283 // - Actual : 1552
CPPUNIT_ASSERT_EQUAL(nRow2Height, pDoc->GetRowHeight(1, 0));
CPPUNIT_ASSERT_EQUAL(nRow3Height, pDoc->GetRowHeight(2, 0));
}
// Restore previous status
aInputOption.SetReplaceCellsWarn(bOldStatus);
pMod->SetInputOptions(aInputOption);
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf148669)
{ // Without the fix in place, this test would have failed with an assert
createScDoc("tdf148669.xlsx");
ScDocument* pDoc = getScDoc();
CPPUNIT_ASSERT_MESSAGE("There should be a note", pDoc->HasNote(ScAddress(701, 0, 0)));
}
// Add a new comment
uno::Sequence<beans::PropertyValue> aArgs
= comphelper::InitPropertySequence({ { "Text", uno::Any(u"Comment"_ustr) } });
dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, aArgs);
ScDocument* pDoc = getScDoc();
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There shouldn't be a note on B1", !pDoc->HasNote(ScAddress(1, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There should be a note on B1", pDoc->HasNote(ScAddress(1, 0, 0)));
// Without the fix in place, this test would have crashed here
dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There shouldn't be a note on B1", !pDoc->HasNote(ScAddress(1, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There shouldn't be a note on A1", !pDoc->HasNote(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There shouldn't be a note on B1", !pDoc->HasNote(ScAddress(1, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There shouldn't be a note on B1", !pDoc->HasNote(ScAddress(1, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There should be a note on A1", pDoc->HasNote(ScAddress(0, 0, 0)));
CPPUNIT_ASSERT_MESSAGE("There should be a note on B1", pDoc->HasNote(ScAddress(1, 0, 0)));
}
// Without the fix in place, this test would have failed with // - Expected: (empty) // - Actual :
CPPUNIT_ASSERT_EQUAL(u"(empty)"_ustr, pDoc->GetString(ScAddress(1, 0, 0)));
}
// Without the fix in place, this test would have failed with // - Expected: #DIV/0! // - Actual : 0.5
CPPUNIT_ASSERT_EQUAL(u"#DIV/0!"_ustr, pDoc->GetString(ScAddress(6, 2, 0)));
CPPUNIT_ASSERT_EQUAL(u"0.5"_ustr, pDoc->GetString(ScAddress(6, 3, 0)));
CPPUNIT_ASSERT_EQUAL(u"0.666666666666667"_ustr, pDoc->GetString(ScAddress(6, 4, 0)));
CPPUNIT_ASSERT_EQUAL(u"0.833333333333333"_ustr, pDoc->GetString(ScAddress(6, 5, 0)));
}
// Without the fix in place, this test would have failed with // - Expected: =SUM(A1:A3) // - Actual : =SUM(A2:A3)
CPPUNIT_ASSERT_EQUAL(u"=SUM(A1:A3)"_ustr, aFormula);
}
// Without the fix in place, this test would have failed with // - Expected: 3 // - Actual : 0
CPPUNIT_ASSERT_EQUAL(3.0, pDoc->GetValue(ScAddress(0, 3, 0)));
// Without the fix in place, this test would have failed with // - Expected: {=IF(SUM(B2:B4) > 0, SUM(B2:B4*D2:D4/C2:C4), 0)} // - Actual : {=IF(SUM(B2:B4) > 0, SUM(B2:B4*D2:D4/C2:C4), 0.175)}
CPPUNIT_ASSERT_EQUAL(u"{=IF(SUM(B2:B4) > 0, SUM(B2:B4*D2:D4/C2:C4), 0)}"_ustr, aFormula);
CPPUNIT_ASSERT_EQUAL(0.175, pDoc->GetValue(ScAddress(1, 6, 0)));
}
// Without the fix in place, this test would have crashed
CPPUNIT_ASSERT_EQUAL(u".uno:Bold"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
CPPUNIT_ASSERT_EQUAL(u".uno:Paste"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
CPPUNIT_ASSERT_EQUAL(u".uno:Save"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
CPPUNIT_ASSERT_EQUAL(u".uno:Undo"_ustr, pDoc->GetString(ScAddress(0, 4, 0)));
// Without the fix in place, this test would have crashed
CPPUNIT_ASSERT_EQUAL(u".uno:Undo"_ustr, pDoc->GetString(ScAddress(0, 1, 0)));
CPPUNIT_ASSERT_EQUAL(u".uno:Save"_ustr, pDoc->GetString(ScAddress(0, 2, 0)));
CPPUNIT_ASSERT_EQUAL(u".uno:Paste"_ustr, pDoc->GetString(ScAddress(0, 3, 0)));
CPPUNIT_ASSERT_EQUAL(u".uno:Bold"_ustr, pDoc->GetString(ScAddress(0, 4, 0)));
for (size_t i = 1; i < 24; ++i)
{ // Without the fix in place, this test would have failed here with // - Expected: A // - Actual :
CPPUNIT_ASSERT_EQUAL(u"A"_ustr, pDoc->GetString(ScAddress(i, 0, 0)));
}
}
// Without the fix in place, this test would have failed with // - Expected: 2 // - Actual : 4
CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(ScAddress(1, 2, 0)));
aFormula = pDoc->GetFormula(1, 2, 0);
CPPUNIT_ASSERT_EQUAL(u"=SUM(B1:B2)"_ustr, aFormula);
// Toggling the grid of a sheet, must set the document modified state
ScDocShell* pDocSh = getScDocShell();
CPPUNIT_ASSERT(!pDocSh->IsModified());
dispatchCommand(mxComponent, u".uno:ToggleSheetGrid"_ustr, {});
CPPUNIT_ASSERT(pDocSh->IsModified());
}
// Without the fix in place, this test would have failed with // - Expected: $Test.$A$3:$D$7 // - Actual : $Test.$A$3:$G$7
CPPUNIT_ASSERT_EQUAL(u"$Test.$A$3:$D$7"_ustr, pRD->GetSymbol());
// Without the fix in place, this test would have failed with // - Expected: 1 // - Actual : 3 // - Incorrect Column in position B1
lcl_AssertCurrentCursorPosition(*pDocSh, u"B1");
// Without the fix in place, this test would have failed with // - Expected: 16 // - Actual : 7
CPPUNIT_ASSERT_EQUAL(16.0, pDoc->GetValue(ScAddress(2, 6, 0)));
CPPUNIT_ASSERT_EQUAL(17.0, pDoc->GetValue(ScAddress(2, 7, 0)));
CPPUNIT_ASSERT_EQUAL(18.0, pDoc->GetValue(ScAddress(2, 8, 0)));
}
// Without the fix in place, this test would have failed with // - Expected: This // - Actual : 0
CPPUNIT_ASSERT_EQUAL(u"This"_ustr, pDoc->GetString(ScAddress(1, 1, 0)));
}
// Without the fix in place, this test would have failed with // - Expected: {=MINVERSE(A1:C3)} // - Actual : =MINVERSE(A1:C3)
CPPUNIT_ASSERT_EQUAL(u"{=MINVERSE(A1:C3)}"_ustr, pDoc->GetFormula(0, 0, 0));
// Without the fix in place, this test would have failed with // - Expected: #N/A // - Actual : 1
CPPUNIT_ASSERT_EQUAL(u"#N/A"_ustr, pDoc2->GetString(ScAddress(0, 0, 0)));
}
// Except for first 1 cell make the entire first row bold.
assert(INITIALCOLCOUNT >= 1);
goToCell("B1:" + pDoc->MaxColAsString() + "1");
dispatchCommand(mxComponent, u".uno:Bold"_ustr, {});
// That shouldn't need allocating more columns, just changing the default attribute.
CPPUNIT_ASSERT_EQUAL(INITIALCOLCOUNT, pDoc->GetAllocatedColumnsCount(0));
vcl::Font aFont;
pDoc->GetPattern(pDoc->MaxCol(), 0, 0)->fillFontOnly(aFont);
CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD,
aFont.GetWeightMaybeAskConfig());
goToCell(u"A2:CV2"_ustr); // first 100 cells in row 2
dispatchCommand(mxComponent, u".uno:Bold"_ustr, {}); // These need to be explicitly allocated.
CPPUNIT_ASSERT_EQUAL(SCCOL(100), pDoc->GetAllocatedColumnsCount(0));
pDoc->GetPattern(99, 1, 0)->fillFontOnly(aFont);
CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD,
aFont.GetWeightMaybeAskConfig());
pDoc->GetPattern(100, 1, 0)->fillFontOnly(aFont);
CPPUNIT_ASSERT_EQUAL_MESSAGE("font should not be bold", WEIGHT_NORMAL,
aFont.GetWeightMaybeAskConfig());
goToCell("CW3:" + pDoc->MaxColAsString() + "3"); // All but first 100 cells in row 3.
dispatchCommand(mxComponent, u".uno:Bold"_ustr, {}); // First 100 columns need to be allocated to not be bold, the rest should be handled // by the default attribute.
CPPUNIT_ASSERT_EQUAL(SCCOL(100), pDoc->GetAllocatedColumnsCount(0));
pDoc->GetPattern(99, 2, 0)->fillFontOnly(aFont);
CPPUNIT_ASSERT_EQUAL_MESSAGE("font should not be bold", WEIGHT_NORMAL,
aFont.GetWeightMaybeAskConfig());
pDoc->GetPattern(100, 2, 0)->fillFontOnly(aFont);
CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD,
aFont.GetWeightMaybeAskConfig());
}
//Sum on range and Sum on Sum's
goToCell(u"B10"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(ScAddress(1, 9, 0)));
CPPUNIT_ASSERT_EQUAL(u"=SUM(B8:B9)"_ustr, pDoc->GetFormula(1, 9, 0));
//Autosum on column with selected empty cell for result
goToCell(u"B59:B64"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(1, 63, 0)));
CPPUNIT_ASSERT_EQUAL(u"=SUM(B59:B63)"_ustr, pDoc->GetFormula(1, 63, 0));
//Subtotal on column with selected empty cell for result
goToCell(u"C92:C101"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(19.0, pDoc->GetValue(ScAddress(2, 100, 0)));
CPPUNIT_ASSERT_EQUAL(u"=SUBTOTAL(9,C92:C100)"_ustr, pDoc->GetFormula(2, 100, 0));
//Autosum on column without selected empty cell for result
goToCell(u"B109:B113"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(1, 113, 0)));
CPPUNIT_ASSERT_EQUAL(u"=SUM(B109:B113)"_ustr, pDoc->GetFormula(1, 113, 0));
//Subtotal on column without selected empty cell for result
goToCell(u"C142:C149"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(19.0, pDoc->GetValue(ScAddress(2, 150, 0)));
CPPUNIT_ASSERT_EQUAL(u"=SUBTOTAL(9,C142:C149)"_ustr, pDoc->GetFormula(2, 150, 0));
//Autosum on multiselected columns without selected empty cell for result
goToCell(u"B160:D164"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(1, 164, 0)));
CPPUNIT_ASSERT_EQUAL(u"=SUM(B160:B164)"_ustr, pDoc->GetFormula(1, 164, 0));
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(2, 164, 0)));
CPPUNIT_ASSERT_EQUAL(u"=SUM(C160:C164)"_ustr, pDoc->GetFormula(2, 164, 0));
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(3, 164, 0)));
CPPUNIT_ASSERT_EQUAL(u"=SUM(D160:D164)"_ustr, pDoc->GetFormula(3, 164, 0));
//Autosum on columns with formula results without selected empty cell for result
goToCell(u"B173:D177"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(2.54, std::floor(pDoc->GetValue(ScAddress(1, 177, 0)) * 100.0) / 100.0);
CPPUNIT_ASSERT_EQUAL(u"=SUM(B173:B177)"_ustr, pDoc->GetFormula(1, 177, 0));
CPPUNIT_ASSERT_EQUAL(-4.91, std::floor(pDoc->GetValue(ScAddress(2, 177, 0)) * 100.0) / 100.0);
CPPUNIT_ASSERT_EQUAL(u"=SUM(C173:C177)"_ustr, pDoc->GetFormula(2, 177, 0));
CPPUNIT_ASSERT_EQUAL(5500.0, pDoc->GetValue(ScAddress(3, 177, 0)));
CPPUNIT_ASSERT_EQUAL(u"=SUM(D173:D177)"_ustr, pDoc->GetFormula(3, 177, 0));
//Autosum on column with filled cell under selected area
goToCell(u"B186:D190"_ustr);
executeAutoSum();
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(1, 191, 0)));
CPPUNIT_ASSERT_EQUAL(u"=SUM(B186:B190)"_ustr, pDoc->GetFormula(1, 191, 0));
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(2, 191, 0)));
CPPUNIT_ASSERT_EQUAL(u"=SUM(C186:C190)"_ustr, pDoc->GetFormula(2, 191, 0));
CPPUNIT_ASSERT_EQUAL(150.0, pDoc->GetValue(ScAddress(3, 191, 0)));
CPPUNIT_ASSERT_EQUAL(u"=SUM(D186:D190)"_ustr, pDoc->GetFormula(3, 191, 0));
// Without the fix in place, this test would have failed with // - Expected: Sheet1.A1:Sheet1.A3 // - Actual : Sheet1.A1:Sheet1.A5
CPPUNIT_ASSERT_EQUAL(u"Sheet1.A1:Sheet1.A3"_ustr, aMarkedAreaString);
}
CPPUNIT_ASSERT_EQUAL(INITIALCOLCOUNT, pDoc->GetAllocatedColumnsCount(0)); for (SCCOL i = 0; i <= pDoc->MaxCol(); ++i)
{
OString msg = "i=" + OString::number(i);
CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.getStr(), COL_AUTO, getBackColor(i));
}
// Set the background color of A1:CV1 auto aColorArg(
comphelper::InitPropertySequence({ { "BackgroundColor", uno::Any(COL_LIGHTBLUE) } }));
goToCell(u"A1:CV1"_ustr);
dispatchCommand(mxComponent, u".uno:BackgroundColor"_ustr, aColorArg);
// Partial row range allocates necessary columns
CPPUNIT_ASSERT_EQUAL(SCCOL(100), pDoc->GetAllocatedColumnsCount(0));
// Check that settings are applied for (SCCOL i = 0; i < 100; ++i)
{
OString msg = "i=" + OString::number(i);
CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.getStr(), COL_LIGHTBLUE, getBackColor(i));
}
// Check that all the cells have restored the setting for (SCCOL i = 0; i < 100; ++i)
{
OString msg = "i=" + OString::number(i); // Without the fix in place, this would fail with // - Expected: rgba[ffffff00] // - Actual : rgba[0000ffff] // - i=1
CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.getStr(), COL_AUTO, getBackColor(i));
}
// Also check the whole row selection case - it is handled specially: columns are not allocated. // See commit 3db91487e57277f75d64d95d06d4ddcc29f1c4e0 (set properly attributes for cells in // unallocated Calc columns, 2022-03-04).
goToCell("A1:" + pDoc->MaxColAsString() + "1");
dispatchCommand(mxComponent, u".uno:BackgroundColor"_ustr, aColorArg);
// Check that settings are applied for (SCCOL i = 0; i <= pDoc->MaxCol(); ++i)
{
OString msg = "i=" + OString::number(i);
CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.getStr(), COL_LIGHTBLUE, getBackColor(i));
}
// Undo
pUndoMgr->Undo();
// No additional columns have been allocated for whole-row range
CPPUNIT_ASSERT_EQUAL(SCCOL(100), pDoc->GetAllocatedColumnsCount(0));
// Check that all the cells have restored the setting for (SCCOL i = 0; i <= pDoc->MaxCol(); ++i)
{
OString msg = "i=" + OString::number(i);
CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.getStr(), COL_AUTO, getBackColor(i));
}
}
CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf140027)
{ // testing the correct import of autofilter from XLSB
createScDoc("tdf140027.ods");
// check we have no any unnecessary flags
ScDocument* pDoc = getScDoc(); auto nFlag = pDoc->GetAttr(0, 0, 1, ATTR_MERGE_FLAG)->GetValue();
CPPUNIT_ASSERT_EQUAL(ScMF::NONE, nFlag);
const ScPatternAttr* pPattern = pDoc->GetPattern(1, 0, 1); const ScPatternAttr aDefPattern = pPattern->getCellAttributeHelper().getDefaultCellAttribute(); // check that the default pattern is not changed
CPPUNIT_ASSERT(ScPatternAttr::areSame(pPattern, &aDefPattern));
}
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.