[Libreoffice-bugs] [Bug 134112] Python script freezes when access text field master in MailMerge event for the second time

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Thu Jun 18 15:44:26 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=134112

--- Comment #4 from Oleg Shchelykalnov <olegshtch at yandex.ru> ---
I suppose it could be caught with tests:

diff --git a/sw/qa/python/xtextfieldssupplier.py
b/sw/qa/python/xtextfieldssupplier.py
index ab1e96f89..f99b0fc85 100755
--- a/sw/qa/python/xtextfieldssupplier.py
+++ b/sw/qa/python/xtextfieldssupplier.py
@@ -69,8 +69,11 @@ class TestXTextFieldsSupplier(unittest.TestCase):
         for masterName in masterNames:
             self.assertTrue(xFieldMasters.hasByName(masterName),
                             "TextFieldMaster has no element " + masterName)
-            self.assertIsNotNone(xFieldMasters.getByName(masterName),
+            master = xFieldMasters.getByName(masterName)
+            self.assertIsNotNone(master,
                                  "can't get " + masterName + " from
TextFieldMaster")
+            self.assertIsNotNone(master.getPropertyValue("Name"),
+                                 "can't get Name property from TextFieldMaster
" + masterName)

         # Ensure that invalid elements are not accessible
         invalidMasterName =
"com.sun.star.text.fieldmaster.SetExpression.NoSuchMaster"

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200618/9b1dd0b8/attachment.htm>


More information about the Libreoffice-bugs mailing list