summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorJakub Trzebiatowski <ubap.dev@gmail.com>2016-06-16 13:40:59 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-06-17 07:18:54 +0000
commit17f440e7e7f1621edebc58f8be5e85b68ee7dcf4 (patch)
tree3ee7574863e74e67dc6a40aac19b66e8e7bd1ecc /sw/qa
parent67afad9f35f1fa7838a2beca43be0d9b330a755a (diff)
GSoC Table Styles, TableStyle isInUse, isUserDefined, mutex fixes
Also added: + SwXTextCellStyle::IsInUse() + check_styles.py SwXTextTableStyle::isUserDefined() tests Change-Id: I76cb166107f186098599c4a8da6f94f7c40cc545 Reviewed-on: https://gerrit.libreoffice.org/26366 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/python/check_styles.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/python/check_styles.py b/sw/qa/python/check_styles.py
index d2ea6a9b02af..7a3e80ea8b42 100644
--- a/sw/qa/python/check_styles.py
+++ b/sw/qa/python/check_styles.py
@@ -183,6 +183,26 @@ class CheckStyle(unittest.TestCase):
xCellStyle.getPropertyValue("foobarbaz")
xDoc.dispose()
+ def test_tableStyleIsInUse(self):
+ # extend when TableStyle insertByName comes
+ xDoc = CheckStyle._uno.openEmptyWriterDoc()
+ xBodyText = xDoc.getText()
+ xCursor = xBodyText.createTextCursor()
+ xTable = xDoc.createInstance("com.sun.star.text.TextTable")
+ xTable.initialize(1, 1)
+ xBodyText.insertTextContent(xCursor, xTable, True)
+ xDefaultTableStyle = xDoc.StyleFamilies.getByName("TableStyles").getByName("Default Style")
+ xDefaultCellStyle = xDoc.StyleFamilies.getByName("CellStyles").getByName("Default Style.1")
+ self.assertFalse(xDefaultTableStyle.isInUse())
+ self.assertFalse(xDefaultCellStyle.isInUse())
+ xTable.setPropertyValue("TableTemplateName", "Default Style")
+ self.assertTrue(xDefaultTableStyle.isInUse())
+ self.assertTrue(xDefaultCellStyle.isInUse())
+ xTable.setPropertyValue("TableTemplateName", "")
+ self.assertFalse(xDefaultTableStyle.isInUse())
+ self.assertFalse(xDefaultCellStyle.isInUse())
+ xDoc.dispose()
+
def test_CellFamily(self):
xDoc = CheckStyle._uno.openEmptyWriterDoc()
xCellStyles = xDoc.StyleFamilies["CellStyles"]