| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
from uitest.framework import UITestCase |
| 11 |
from libreoffice.uno.propertyvalue import mkPropertyValues |
| 12 |
from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file |
| 13 |
|
| 14 |
class tdf137105(UITestCase): |
| 15 |
|
| 16 |
def test_tdf137105(self): |
| 17 |
with self.ui_test.create_doc_in_start_center("writer") as document: |
| 18 |
xWriterDoc = self.xUITest.getTopFocusWindow() |
| 19 |
text = document.getText() |
| 20 |
cursor = text.createTextCursor() |
| 21 |
textGraphic = document.createInstance('com.sun.star.text.TextGraphicObject') |
| 22 |
provider = self.xContext.ServiceManager.createInstance('com.sun.star.graphic.GraphicProvider') |
| 23 |
graphic = provider.queryGraphic( mkPropertyValues({"URL": get_url_for_data_file("LibreOffice.jpg")})) |
| 24 |
textGraphic.Graphic = graphic |
| 25 |
text.insertTextContent(cursor, textGraphic, False) |
| 26 |
|
| 27 |
document.getCurrentController().select(document.getDrawPage()[0]) |
| 28 |
|
| 29 |
xWriterEdit = xWriterDoc.getChild("writer_edit") |
| 30 |
|
| 31 |
self.xUITest.executeCommand(".uno:Sidebar") |
| 32 |
|
| 33 |
xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "InspectorTextPanel"})) |
| 34 |
|
| 35 |
|
| 36 |
self.assertEqual('0', get_state_as_dict(xWriterEdit.getChild('listbox_fonts'))['Children']) |
| 37 |
|
| 38 |
self.xUITest.executeCommand(".uno:Sidebar") |
| 39 |
|
| 40 |
|
| 41 |
|