diff options
author | Justin Luth <jluth@mail.com> | 2022-07-28 09:03:13 -0400 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-08-02 08:15:26 +0200 |
commit | f7b5eefc36f6a7627e867651bafe38bdeb2f9c00 (patch) | |
tree | 33929a5368d034e3ebace2988d9e2dc20a11537f /sd | |
parent | 339d47a352650285c8ea14f9d8c0b36616b0ed7c (diff) |
tdf#148810 pptx import: Depth set by EE_PARA_OUTLLEVEL
It isn't enough to do Paragraph->SetDepth().
It must match the property EE_PARA_OUTLLEVEL.
So I was hoping that the only thing I needed was the
"set property" helper. But unit tests showed that I also needed
"get property" to return an empty aAny instead of a -1.
My confidence level on this one is fairly low.
This code is way too tangled and weird.
I'm sure the concept is right (that the property is the
most important thing) but all of the wonkiness around
the level means any changes to the implementation
will be fragile.
make UITest_impress_tests \
UITEST_TEST_NAME=tdf148810.Tdf148810.test_Tdf148810
Change-Id: I4aa62fe28ecbc483d5df0d1532fecd172afc54b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137569
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/uitest/data/tdf148810_PARA_OUTLLEVEL.pptx | bin | 0 -> 21210 bytes | |||
-rwxr-xr-x | sd/qa/uitest/impress_tests/tdf148810.py | 55 |
2 files changed, 55 insertions, 0 deletions
diff --git a/sd/qa/uitest/data/tdf148810_PARA_OUTLLEVEL.pptx b/sd/qa/uitest/data/tdf148810_PARA_OUTLLEVEL.pptx Binary files differnew file mode 100644 index 000000000000..b2f4a13da549 --- /dev/null +++ b/sd/qa/uitest/data/tdf148810_PARA_OUTLLEVEL.pptx diff --git a/sd/qa/uitest/impress_tests/tdf148810.py b/sd/qa/uitest/impress_tests/tdf148810.py new file mode 100755 index 000000000000..31f591a6282f --- /dev/null +++ b/sd/qa/uitest/impress_tests/tdf148810.py @@ -0,0 +1,55 @@ +# -*- 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.uihelper.common import get_state_as_dict, get_url_for_data_file +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.framework import UITestCase +import time + + +class Tdf148810(UITestCase): + + def test_Tdf148810(self): + with self.ui_test.load_file(get_url_for_data_file("tdf148810_PARA_OUTLLEVEL.pptx")): + document = self.ui_test.get_component() + + xDoc = self.xUITest.getTopFocusWindow() + xEditWin = xDoc.getChild("impress_win") + + xEditWin.executeAction("SELECT", mkPropertyValues({"OBJECT":"TextShape 2"})) + + # type something to get into text editing mode (instead of shape selection). + xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) + #time.sleep(2) + + # get to the front of the text (behind the bullet point) + xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "HOME"})) + # remove the numbering bullet point + xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"})) + + #xShape = xEditWin.getChild("TextShape 2") + #print(xShape) + #print(xShape.getChildren()) + #print(get_state_as_dict(xShape)) + #print(dir(xShape) + + xText = document.DrawPages[0].getByIndex(1).createEnumeration().nextElement() + #print(xText) + # this is the first numbering level (as opposed to either -1 or None for no numbering) + self.assertEqual(0, xText.NumberingLevel) + #time.sleep(2) + + self.xUITest.executeCommand(".uno:Undo") + #time.sleep(2) + + xText = document.DrawPages[0].getByIndex(1).createEnumeration().nextElement() + # This was failing with "None" + self.assertEqual(0, xText.NumberingLevel) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: |