calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / sfx2 / qa / python / check_sidebar_registry.py
blob47b8eecdefb99416b73a60d5688a56a7b8bffa7f
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 import unittest
11 import unohelper
12 import os
13 from org.libreoffice.unotest import UnoInProcess
14 import uno
16 class CheckSidebarRegistry(unittest.TestCase):
18 @classmethod
19 def setUpClass(cls):
20 cls._uno = UnoInProcess()
21 cls._uno.setUp()
23 @classmethod
24 def tearDownClass(cls):
25 cls._uno.tearDown()
27 def test_sidebar_registry(self):
29 # assert(result) after whole processing to list defective nodes at once
30 result = True
32 #open registry node in Sidebar.xcu
33 config_provider = self.createUnoService("com.sun.star.configuration.ConfigurationProvider")
35 param = uno.createUnoStruct('com.sun.star.beans.PropertyValue')
36 param.Name = "nodepath"
39 # Deck names consistency
41 param.Value = "org.openoffice.Office.UI.Sidebar/Content/DeckList"
43 sidebar_decks_settings = config_provider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess",
44 (param, ))
45 for nodeName in sidebar_decks_settings:
47 node = sidebar_decks_settings[nodeName]
49 if (node.Id != nodeName):
50 print("\nNon-consistent sidebar.xcu Deck registry names", nodeName, node.Id)
51 result = False
53 # panel names consistency
55 param.Value = "org.openoffice.Office.UI.Sidebar/Content/PanelList"
57 sidebar_panels_settings = config_provider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess",
58 (param, ))
59 for nodeName in sidebar_panels_settings:
61 node = sidebar_panels_settings[nodeName]
63 if (node.Id != nodeName):
64 print("\nNon-consistent sidebar.xcu Panel registry names", nodeName, node.Id)
65 result = False
67 # is panel bound to an existing Deck ?
68 FoundDeckId = False
69 for deckNodeName in sidebar_decks_settings:
70 deck_node = sidebar_decks_settings[deckNodeName]
71 if (node.DeckId == deck_node.Id):
72 FoundDeckId = True
73 if not FoundDeckId:
74 print("\nNon existing DeckId for the panel ",node.Id)
75 result = False
77 # trigger the overall result. details of each error have already be printed
78 assert(result)
81 def createUnoService(self, serviceName):
83 sm = uno.getComponentContext().ServiceManager
84 return sm.createInstanceWithContext(serviceName, uno.getComponentContext())
86 if __name__ == "__main__":
87 unittest.main()
89 # vim: set shiftwidth=4 softtabstop=4 expandtab: