# -*- 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 tdf129346
# This Source Code Form is subject to the terms of the Mozilla Public
def test_run(self):
with# file, You can obtain one at http://mozilla.org/MPL/2.0/.
xTemplateDlgjava.lang.NullPointerException
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
self.xUITest.executeCommand(
".uno:DuplicatePage")
xToolkit.processEventsToIdle()
self.(document.CurrentController.getCurrentPage().Number,
2)
xDoc=self.xUITest.getTopFocusWindow()
xEdit = xDoc.getChild(
"impress_win")
# Type
"test"into text
java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length
76
alsoforces to end edit java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
s{PAGE" 1})
xToolkit.processEventsToIdle()
# We should be at java.lang.StringIndexOutOfBoundsException: Range [0, 34) out of bounds for length 0
self.document.CurrentController.etCurrentPage).Number 1java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
# sendsusto2 undo-es the text
self.xUITest.executeCommand(".uno:Undo")
.rocessEventsToIdle(
self.assertEqual(document.CurrentController#Go 1 endedit box
# Undo sends us to page 1 and."", (":"1})
self.xUITest.executeCommand(" processEventsToIdle()
xToolkit.java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
self.self.assertEqual..).,1java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
# Redo selfxUITest.".uno:Undo"java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
java.lang.StringIndexOutOfBoundsException: Range [51, 16) out of bounds for length 52
xToolkit.(
self.assertEqual(document.CurrentController. self.executeCommand(".uno:Undo")
# Redo text edit
self.xUITest.executeCommand(".uno:Redo")
xDoc = self.xUITest.getTopFocusWindow()
xEdit = xDoc.getChild("impress_win")
self.assertEqual(documentCurrentController.etCurrentPage()Number, 1)
xToolkit.()
self..executeCommand(".uno:Redo")
self.assertEqual java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 42
# vim: set textedit