summaryrefslogtreecommitdiff
path: root/sw/qa/python
diff options
context:
space:
mode:
authorMayank Suman <mayanksuman@live.com>2019-10-03 19:37:36 +0530
committerMichael Stahl <michael.stahl@cib.de>2019-10-24 14:23:45 +0200
commitd5dc19402e2b390aedd92ed94d0cd2444fd4478f (patch)
treef48f56a56d0a175161cc6a4ebf05f5881e4827bd /sw/qa/python
parentc1f60d7d113e29dd36c6dcf0d1b58cfd8912228a (diff)
tdf#97361: Removed getByIndex in calc and writer
Change-Id: I477e1129d7b8deb91920b3ffd715bc217e606d20 Reviewed-on: https://gerrit.libreoffice.org/80140 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw/qa/python')
-rw-r--r--sw/qa/python/check_styles.py8
-rw-r--r--sw/qa/python/var_fields.py2
2 files changed, 5 insertions, 5 deletions
diff --git a/sw/qa/python/check_styles.py b/sw/qa/python/check_styles.py
index 8746c479fbbe..c0c3a24e2a02 100644
--- a/sw/qa/python/check_styles.py
+++ b/sw/qa/python/check_styles.py
@@ -77,10 +77,10 @@ class CheckStyle(unittest.TestCase):
self.assertListEqual(vNames, vExpectedNames)
def __test_StyleFamilyIndex(self, xFamily, vExpectedNames, sElementImplName):
- self.assertEqual(xFamily.Count, len(vExpectedNames))
+ self.assertEqual(len(xFamily), len(vExpectedNames))
- for nIndex in range(xFamily.Count):
- xStyle = xFamily.getByIndex(nIndex)
+ for nIndex in range(len(xFamily)):
+ xStyle = xFamily[nIndex]
self.assertEqual(xStyle.ImplementationName, sElementImplName)
self.assertIn(xStyle.Name, vExpectedNames)
self.assertFalse(xStyle.isUserDefined())
@@ -176,7 +176,7 @@ class CheckStyle(unittest.TestCase):
self.assertIsNotNone(xTableStyles.getByName(sStyleName))
#check SwXTextCellStyles
vCellStyles = ["first-row", "last-row", "first-column", "last-column", "body", "even-rows", "odd-rows", "even-columns", "odd-columns", "background"]
- xDefaultTableStyle = xTableStyles.getByIndex(0)
+ xDefaultTableStyle = xTableStyles[0]
for sCellStyle in vCellStyles:
xCellStyle = xDefaultTableStyle.getByName(sCellStyle)
self.assertIsNotNone(xCellStyle.getPropertyValue("BackColor"))
diff --git a/sw/qa/python/var_fields.py b/sw/qa/python/var_fields.py
index e793aaa5f7ec..0c88b5357732 100644
--- a/sw/qa/python/var_fields.py
+++ b/sw/qa/python/var_fields.py
@@ -126,7 +126,7 @@ class TestVarFields(unittest.TestCase):
xDoc.storeToURL(url, tuple(list(range(0))))
# 19. retrieve the section
- xSection = xDoc.getTextSections().getByIndex(0)
+ xSection = xDoc.getTextSections()[0]
# 20. retrieve the condition property of that section
read_content = xSection.getPropertyValue("Condition")