Kaydet (Commit) 4c875612 authored tarafından Tamás Zolnai's avatar Tamás Zolnai Kaydeden (comit) Jan Holesovsky

LOK: Update failing unit tests

Change-Id: Ib30be297d87fa40c03974e0a97f243812dc488f3
üst e75c67bd
......@@ -867,11 +867,11 @@ void SdTiledRenderingTest::testResizeTable()
auto pTableObject = dynamic_cast<sdr::table::SdrTableObj*>(pObject);
CPPUNIT_ASSERT(pTableObject);
// Select the table by marking it + starting and ending text edit.
SdrView* pView = pViewShell->GetView();
pView->MarkObj(pObject, pView->GetSdrPageView());
pView->SdrBeginTextEdit(pObject);
pView->SdrEndTextEdit();
SdrHdlList handleList(nullptr);
pObject->AddToHdlList(handleList);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(14), handleList.GetHdlCount());
// Take the top left handle
SdrHdl* pHdl = handleList.GetHdl(0);
// Remember the original row heights.
uno::Reference<table::XColumnRowRange> xTable(pTableObject->getTable(), uno::UNO_QUERY);
......@@ -882,15 +882,14 @@ void SdTiledRenderingTest::testResizeTable()
sal_Int32 nExpectedRow2 = xRow2->getPropertyValue("Size").get<sal_Int32>();
// Resize the upper row, decrease its height by 1 cm.
Point aInnerRowEdge = pObject->GetSnapRect().Center();
pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_START, convertMm100ToTwip(aInnerRowEdge.getX()), convertMm100ToTwip(aInnerRowEdge.getY()));
pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_END, convertMm100ToTwip(aInnerRowEdge.getX()), convertMm100ToTwip(aInnerRowEdge.getY() - 1000));
pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_START, convertMm100ToTwip(pHdl->GetPos().getX()), convertMm100ToTwip(pHdl->GetPos().getY()));
pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_END, convertMm100ToTwip(pHdl->GetPos().getX()), convertMm100ToTwip(pHdl->GetPos().getY() + 1000));
// Remember the resized row heights.
sal_Int32 nResizedRow1 = xRow1->getPropertyValue("Size").get<sal_Int32>();
CPPUNIT_ASSERT(nResizedRow1 < nExpectedRow1);
sal_Int32 nResizedRow2 = xRow2->getPropertyValue("Size").get<sal_Int32>();
CPPUNIT_ASSERT_EQUAL(nExpectedRow2, nResizedRow2);
CPPUNIT_ASSERT(nResizedRow2 < nExpectedRow2);
// Now undo the resize.
pXImpressDocument->GetDocShell()->GetUndoManager()->Undo();
......@@ -900,7 +899,7 @@ void SdTiledRenderingTest::testResizeTable()
CPPUNIT_ASSERT_EQUAL(nExpectedRow1, nActualRow1);
sal_Int32 nActualRow2 = xRow2->getPropertyValue("Size").get<sal_Int32>();
// Expected was 4000, actual was 4572, i.e. the second row after undo was larger than expected.
CPPUNIT_ASSERT_EQUAL(nExpectedRow2, nActualRow2);
CPPUNIT_ASSERT_DOUBLES_EQUAL(nExpectedRow2, nActualRow2, 1.0);
comphelper::LibreOfficeKit::setActive(false);
}
......@@ -915,11 +914,11 @@ void SdTiledRenderingTest::testResizeTableColumn()
auto pTableObject = dynamic_cast<sdr::table::SdrTableObj*>(pObject);
CPPUNIT_ASSERT(pTableObject);
// Select the table by marking it + starting and ending text edit.
SdrView* pView = pViewShell->GetView();
pView->MarkObj(pObject, pView->GetSdrPageView());
pView->SdrBeginTextEdit(pObject);
pView->SdrEndTextEdit();
SdrHdlList handleList(nullptr);
pObject->AddToHdlList(handleList);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(14), handleList.GetHdlCount());
// Take the top left handle
SdrHdl* pHdl = handleList.GetHdl(0);
// Remember the original cell widths.
xmlDocPtr pXmlDoc = parseXmlDump();
......@@ -930,16 +929,15 @@ void SdTiledRenderingTest::testResizeTableColumn()
pXmlDoc = nullptr;
// Resize the left column, decrease its width by 1 cm.
Point aInnerRowEdge = pObject->GetSnapRect().Center();
pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_START, convertMm100ToTwip(aInnerRowEdge.getX()), convertMm100ToTwip(aInnerRowEdge.getY()));
pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_END, convertMm100ToTwip(aInnerRowEdge.getX() - 1000), convertMm100ToTwip(aInnerRowEdge.getY()));
pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_START, convertMm100ToTwip(pHdl->GetPos().getX()), convertMm100ToTwip(pHdl->GetPos().getY()));
pXImpressDocument->setGraphicSelection(LOK_SETGRAPHICSELECTION_END, convertMm100ToTwip(pHdl->GetPos().getX() + 1000), convertMm100ToTwip(pHdl->GetPos().getY()));
// Remember the resized column widths.
pXmlDoc = parseXmlDump();
sal_Int32 nResizedColumn1 = getXPath(pXmlDoc, aPrefix + "TableLayouter_Layout[1]", "size").toInt32();
CPPUNIT_ASSERT(nResizedColumn1 < nExpectedColumn1);
sal_Int32 nResizedColumn2 = getXPath(pXmlDoc, aPrefix + "TableLayouter_Layout[2]", "size").toInt32();
CPPUNIT_ASSERT(nResizedColumn2 > nExpectedColumn2);
CPPUNIT_ASSERT(nResizedColumn2 < nExpectedColumn2);
xmlFreeDoc(pXmlDoc);
pXmlDoc = nullptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment