summaryrefslogtreecommitdiff
path: root/sd/qa/unit/misc-tests.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/qa/unit/misc-tests.cxx')
-rw-r--r--sd/qa/unit/misc-tests.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index 4747cf3ffe9e..105c071d1a8e 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -24,12 +24,16 @@
#include <FactoryIds.hxx>
#include <sdmod.hxx>
#include <tools/shl.hxx>
+#include <svx/sdr/table/tablecontroller.hxx>
+#include <sfx2/request.hxx>
+#include <svx/svxids.hrc>
#include <ImpressViewShellBase.hxx>
#include <SlideSorterViewShell.hxx>
#include <SlideSorter.hxx>
#include <controller/SlideSorterController.hxx>
#include <controller/SlsClipboard.hxx>
#include <controller/SlsPageSelector.hxx>
+#include <undo/undomanager.hxx>
#include <chrono>
using namespace ::com::sun::star;
@@ -40,10 +44,12 @@ class SdMiscTest : public SdModelTestBase
public:
void testTdf96206();
void testTdf96708();
+ void testTdf99396();
CPPUNIT_TEST_SUITE(SdMiscTest);
CPPUNIT_TEST(testTdf96206);
CPPUNIT_TEST(testTdf96708);
+ CPPUNIT_TEST(testTdf99396);
CPPUNIT_TEST_SUITE_END();
private:
@@ -135,6 +141,29 @@ void SdMiscTest::testTdf96708()
xDocSh->DoClose();
}
+void SdMiscTest::testTdf99396()
+{
+ // Load the document and select the table.
+ sd::DrawDocShellRef xDocSh = Load(m_directories.getURLFromSrc("/sd/qa/unit/data/tdf99396.odp"), ODP);
+ sd::ViewShell *pViewShell = xDocSh->GetViewShell();
+ SdPage* pPage = pViewShell->GetActualPage();
+ SdrObject* pObject = pPage->GetObj(0);
+ SdrView* pView = pViewShell->GetView();
+ pView->MarkObj(pObject, pView->GetSdrPageView());
+
+ // Make sure that the undo stack is empty.
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), xDocSh->GetDoc()->GetUndoManager()->GetUndoActionCount());
+
+ // Set the vertical alignment of the cells to bottom.
+ sdr::table::SvxTableController* pTableController = dynamic_cast<sdr::table::SvxTableController*>(pView->getSelectionController().get());
+ SfxRequest aRequest(pViewShell->GetViewFrame(), SID_TABLE_VERT_BOTTOM);
+ pTableController->Execute(aRequest);
+ // This was 0, it wasn't possible to undo a vertical alignment change.
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), xDocSh->GetDoc()->GetUndoManager()->GetUndoActionCount());
+
+ xDocSh->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdMiscTest);
CPPUNIT_PLUGIN_IMPLEMENT();