| 1 |
# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- |
| 2 |
# |
| 3 |
# This file is part of the LibreOffice project. |
| 4 |
# |
| 5 |
# This Source Code Form is subject to the terms of the Mozilla Public |
| 6 |
# License, v. 2.0. If a copy of the MPL was not distributed with this |
| 7 |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 8 |
# |
| 9 |
|
| 10 |
from uitest.uihelper.common import get_state_as_dict |
| 11 |
from libreoffice.uno.propertyvalue import mkPropertyValues |
| 12 |
from uitest.framework import UITestCase |
| 13 |
|
| 14 |
class Tdf133713(UITestCase): |
| 15 |
|
| 16 |
def test_Tdf133713(self): |
| 17 |
with self.ui_test.create_doc_in_start_center("impress") as document: |
| 18 |
|
| 19 |
xTemplateDlg = self.xUITest.getTopFocusWindow() |
| 20 |
xCancelBtn = xTemplateDlg.getChild("close") |
| 21 |
self.ui_test.close_dialog_through_button(xCancelBtn) |
| 22 |
|
| 23 |
xDoc = self.xUITest.getTopFocusWindow() |
| 24 |
xEditWin = xDoc.getChild("impress_win") |
| 25 |
|
| 26 |
xEditWin.executeAction("SELECT", mkPropertyValues({"OBJECT":"Unnamed Drawinglayer object 1"})) |
| 27 |
self.assertEqual("com.sun.star.drawing.SvxShapeCollection", document.CurrentSelection.getImplementationName()) |
| 28 |
|
| 29 |
xEditWin.executeAction("TYPE", mkPropertyValues({"TEXT":"one"})) |
| 30 |
xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) |
| 31 |
xEditWin.executeAction("TYPE", mkPropertyValues({"TEXT":"two"})) |
| 32 |
xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) |
| 33 |
xEditWin.executeAction("TYPE", mkPropertyValues({"TEXT":"three"})) |
| 34 |
|
| 35 |
self.xUITest.executeCommand(".uno:SelectAll") |
| 36 |
|
| 37 |
with self.ui_test.execute_dialog_through_command(".uno:OutlineBullet") as xDialog: |
| 38 |
xNumFormat = xDialog.getChild("numfmtlb") |
| 39 |
xSelection = xDialog.getChild("selectionrb") |
| 40 |
xIndent = xDialog.getChild("indentmf") |
| 41 |
xRelSize = xDialog.getChild("relsize") |
| 42 |
|
| 43 |
# Check some default values |
| 44 |
self.assertEqual("Bullet", get_state_as_dict(xNumFormat)["DisplayText"]) |
| 45 |
self.assertEqual("true", get_state_as_dict(xSelection)["Checked"]) |
| 46 |
self.assertEqual("0", get_state_as_dict(xIndent)["Value"]) |
| 47 |
self.assertEqual("45%", get_state_as_dict(xRelSize)["Text"]) |
| 48 |
|
| 49 |
drawPage = document.getDrawPages()[0] |
| 50 |
shape = drawPage[1] |
| 51 |
xEnumeration = shape.Text.createEnumeration() |
| 52 |
|
| 53 |
# Without the fix in place, this test would have failed with |
| 54 |
# AssertionError: 0 is not None |
| 55 |
for i in range(3): |
| 56 |
self.assertEqual(0, xEnumeration.nextElement().NumberingLevel) |
| 57 |
|
| 58 |
# vim: set shiftwidth=4 softtabstop=4 expandtab: |