diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-08-03 11:39:07 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-08-03 11:06:42 +0000 |
commit | 4acac00df5a85ff006ecead06c4018e88caaf401 (patch) | |
tree | 0ac5013cea32e4eaec4e92eaa7b73d8757027a81 /sd/qa | |
parent | 405db7afbdba02eed9a9a4c4f22000fe623b029c (diff) |
svx: track view shell id in SdrUndoAction
This is used in Impress e.g. when resizing a picture.
Change-Id: I2e0a9228ed0ff9ecfd72696ef84e56f88e4c0f70
Reviewed-on: https://gerrit.libreoffice.org/27822
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/tiledrendering/tiledrendering.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 603efff3f0bd..c8dc99369057 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -34,6 +34,7 @@ #include <sdpage.hxx> #include <unomodel.hxx> #include <drawdoc.hxx> +#include <undo/undomanager.hxx> using namespace css; @@ -412,6 +413,18 @@ void SdTiledRenderingTest::testSetGraphicSelection() // Resize. 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)); + + // Assert that view shell ID tracking works. + sal_Int32 nView1 = SfxLokHelper::getView(); + SdDrawDocument* pDocument = pXImpressDocument->GetDoc(); + sd::UndoManager* pUndoManager = pDocument->GetUndoManager(); + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pUndoManager->GetUndoActionCount()); + auto pListAction = dynamic_cast<SfxListUndoAction*>(pUndoManager->GetUndoAction()); + CPPUNIT_ASSERT(pListAction); + for (size_t i = 0; i < pListAction->aUndoActions.size(); ++i) + // The second item was -1 here, view shell ID wasn't known. + CPPUNIT_ASSERT_EQUAL(nView1, pListAction->aUndoActions.GetUndoAction(i)->GetViewShellId()); + Rectangle aShapeAfter = pObject->GetSnapRect(); // Check that a resize happened, but aspect ratio is not kept. CPPUNIT_ASSERT_EQUAL(aShapeBefore.getWidth(), aShapeAfter.getWidth()); |