test of tdf#146356

Inserts a paragraph in front of a protected table of contents
and inserts text into the new paragraph

Change-Id: I951fa2bea63dc2b5721876268aa27a8df579b210
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164480
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
diff --git a/sw/qa/uitest/data/tdf146356.odt b/sw/qa/uitest/data/tdf146356.odt
new file mode 100755
index 0000000..a143986
--- /dev/null
+++ b/sw/qa/uitest/data/tdf146356.odt
Binary files differ
diff --git a/sw/qa/uitest/writer_tests8/tdf146356.py b/sw/qa/uitest/writer_tests8/tdf146356.py
new file mode 100755
index 0000000..9fd9631
--- /dev/null
+++ b/sw/qa/uitest/writer_tests8/tdf146356.py
@@ -0,0 +1,24 @@
# -*- 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 uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
from libreoffice.uno.propertyvalue import mkPropertyValues
from libreoffice.linguistic.linguservice import get_lingu_service_manager
from com.sun.star.lang import Locale
import time

# insert paragraph in front of a protected table of contents
# and insert text into this new paragraph
class tdf146356(UITestCase):
    def test_tdf146356_insert_para_before_TOX(self):
        with self.ui_test.load_file(get_url_for_data_file("tdf146356.odt")) as writer_doc:
            xWriterDoc = self.xUITest.getTopFocusWindow()
            xWriterEdit = xWriterDoc.getChild("writer_edit")
            xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ALT+RETURN"}))
            xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "Some text"}))