sd/qa/uitest/impress_tests2/tdf130586.py |   54 -------------------------------
 sd/qa/unit/uiimpress.cxx                 |   30 +++++++++++++++++
 2 files changed, 30 insertions(+), 54 deletions(-)

New commits:
commit 2f2de299378be1641d02cb4146d6987c13e70b21
Author:     Xisco Fauli <[email protected]>
AuthorDate: Tue Feb 24 12:24:33 2026 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Tue Feb 24 15:44:42 2026 +0100

    tdf#130586: move UItest to CppUnittest
    
    Change-Id: I01cbdac2c7deb59cef585ffe1d5427d6efcf2d19
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200172
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sd/qa/uitest/impress_tests2/tdf130586.py 
b/sd/qa/uitest/impress_tests2/tdf130586.py
deleted file mode 100644
index 0a8bf5e89205..000000000000
--- a/sd/qa/uitest/impress_tests2/tdf130586.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-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/.
-#
-
-from uitest.framework import UITestCase
-from libreoffice.uno.propertyvalue import mkPropertyValues
-
-class tdf130586(UITestCase):
-
-    def test_run(self):
-        with self.ui_test.create_doc_in_start_center("impress") as document:
-            xTemplateDlg = self.xUITest.getTopFocusWindow()
-            xCancelBtn = xTemplateDlg.getChild("close")
-            self.ui_test.close_dialog_through_button(xCancelBtn)
-
-            xToolkit = 
self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
-
-            
self.assertEqual(document.CurrentController.getCurrentPage().Number, 1)
-
-            # Insert a new slide
-            self.xUITest.executeCommand(".uno:InsertPage")
-            xToolkit.processEventsToIdle()
-            
self.assertEqual(document.CurrentController.getCurrentPage().Number, 2)
-
-            # Change layout on slide 2
-            self.xUITest.executeCommand(".uno:AssignLayout?WhatLayout:long=1")
-            xToolkit.processEventsToIdle()
-            
self.assertEqual(document.CurrentController.getCurrentPage().Number, 2)
-
-            # Undo x2 (undo layout change, then undo insert slide)
-            self.xUITest.executeCommand(".uno:Undo")
-            xToolkit.processEventsToIdle()
-            
self.assertEqual(document.CurrentController.getCurrentPage().Number, 2)
-
-            self.xUITest.executeCommand(".uno:Undo")
-            xToolkit.processEventsToIdle()
-            
self.assertEqual(document.CurrentController.getCurrentPage().Number, 1)
-
-            # Redo x2 (redo insert slide, then redo layout change)
-            self.xUITest.executeCommand(".uno:Redo")
-            xToolkit.processEventsToIdle()
-            
self.assertEqual(document.CurrentController.getCurrentPage().Number, 2)
-
-            self.xUITest.executeCommand(".uno:Redo")
-            xToolkit.processEventsToIdle()
-            # Without the fix, this would fail with AssertionError: 2 != 1
-            
self.assertEqual(document.CurrentController.getCurrentPage().Number, 2)
-
-# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 46beee2caefe..bbd3554ca092 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -2163,6 +2163,36 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, 
testTdf166647_userpaint)
     CPPUNIT_ASSERT_EQUAL(size_t(2), 
pViewShell->GetActualPage()->GetObjCount());
 }
 
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf130586)
+{
+    createSdImpressDoc();
+    checkCurrentPageNumber(1);
+
+    dispatchCommand(mxComponent, u".uno:InsertPage"_ustr, {});
+    checkCurrentPageNumber(2);
+
+    dispatchCommand(mxComponent, u".uno:AssignLayout?WhatLayout:long=1"_ustr, 
{});
+    checkCurrentPageNumber(2);
+
+    // Undo x2 (undo layout change, then undo insert slide)
+    dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
+    checkCurrentPageNumber(2);
+
+    dispatchCommand(mxComponent, u".uno:Undo"_ustr, {});
+    checkCurrentPageNumber(1);
+
+    // Redo x2 (redo insert slide, then redo layout change)
+    dispatchCommand(mxComponent, u".uno:Redo"_ustr, {});
+    checkCurrentPageNumber(2);
+
+    dispatchCommand(mxComponent, u".uno:Redo"_ustr, {});
+
+    // Without the fix, this would fail with
+    // - Expected: 2
+    // - Actual  : 1
+    checkCurrentPageNumber(2);
+}
+
 CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf168835)
 {
     createSdImpressDoc("pptx/tdf168835.pptx");

Reply via email to