sw/qa/python/var_fields.py | 20 ++++++++++---------- sw/source/core/doc/DocumentFieldsManager.cxx | 1 + sw/source/core/doc/docnew.cxx | 1 + 3 files changed, 12 insertions(+), 10 deletions(-)
New commits: commit 19efa546ab88ea4b3943bb05405752dee7e57623 Author: Michael Stahl <mst...@redhat.com> Date: Thu Aug 14 14:15:03 2014 +0200 sw: assert that UnlockExpFlds() isn't called when it's not locked Change-Id: Ibe2394978b776dd4a91a253856040fc45f81c7e9 diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx index b9b3607..870685e 100644 --- a/sw/source/core/doc/DocumentFieldsManager.cxx +++ b/sw/source/core/doc/DocumentFieldsManager.cxx @@ -1207,6 +1207,7 @@ void DocumentFieldsManager::LockExpFlds() void DocumentFieldsManager::UnlockExpFlds() { + assert(mnLockExpFld != 0); if( mnLockExpFld ) --mnLockExpFld; } commit 85fde3735afb306b4c3aba72a9c99d19c71546fa Author: Michael Stahl <mst...@redhat.com> Date: Thu Aug 14 13:37:41 2014 +0200 sw: initialize SwDoc::mbInReading This was causing intermittent failure at least in sw_python test. (regression from 5494954b269267f6ee3bdd5ac73e7513fa69978f) Change-Id: I8452536cfbb7bc5bd07e6405bc255e31a5007185 diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 1e129bf..0b2c0d1 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -260,6 +260,7 @@ SwDoc::SwDoc() mReferenceCount(0), mbGlossDoc(false), mbDtor(false), + mbInReading(false), mbInXMLImport(false), mbUpdateTOX(false), mbInLoadAsynchron(false), commit 29f0b74a74c80edf89868b3eb586c266472454a2 Author: Michael Stahl <mst...@redhat.com> Date: Thu Aug 14 12:51:55 2014 +0200 sw: use less confusing variable names in python test Change-Id: Ie07fe4761a634c3ae55e82e1ed70c9424dc33213 diff --git a/sw/qa/python/var_fields.py b/sw/qa/python/var_fields.py index 3222f17..b6b3ff1 100644 --- a/sw/qa/python/var_fields.py +++ b/sw/qa/python/var_fields.py @@ -74,35 +74,35 @@ class TestVarFields(unittest.TestCase): xBodyText.insertControlCharacter(xCursor, PARAGRAPH_BREAK, False ) xBodyText.insertString(xCursor, "new paragraph", False) # 13. Access fields to refresh the document - xEnumerationAccess = xDoc.getTextFields() + xTextFields = xDoc.getTextFields() # 14. refresh document to update the fields - xEnumerationAccess.refresh() + xTextFields.refresh() # 15. retrieve the field - xFieldEnum = xEnumerationAccess.createEnumeration() + xFieldEnum = xTextFields.createEnumeration() # Note: we have only one field here, that why nextElement() is just fine here - xPropSet = xFieldEnum.nextElement() + xField = xFieldEnum.nextElement() # check - readContent = xPropSet.getPropertyValue("Content") + readContent = xField.getPropertyValue("Content") self.assertEqual("0", readContent) - readContent = xPropSet.getPropertyValue("Value") + readContent = xField.getPropertyValue("Value") self.assertEqual(0.0, readContent) # 16. change the value of the field from 0 to 1 and check self.__class__._uno.checkProperties( - xPropSet, + xField, {"Value": 1.0, "Content": "1" }, self ) # 17. refresh document to update the fields again - xEnumerationAccess.refresh() + xTextFields.refresh() # 18. store document url = os.path.join(os.environ["TestUserDir"], "VarFields.odt") xDoc.storeToURL(url, tuple(list(range(0)))) # 19. retrieve the section - xPropSet = xDoc.getTextSections().getByIndex(0) + xSection = xDoc.getTextSections().getByIndex(0) # 20. retrieve the condition property of that section - readContent = xPropSet.getPropertyValue("Condition") + readContent = xSection.getPropertyValue("Condition") # 21. check # expected: #self.assertEqual("foo EQ 1", readContent) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits