Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/3028
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/28/3028/1
Ugly Hack: using our own WebConfigSet while the Topic stuff is not integrated.
Change-Id: I0df92af6b01e5eab99212bb1587f7165c70fd59b
---
M wizards/Pyuno_web.mk
A wizards/com/sun/star/wizards/web/WebConfigSet.py
M wizards/com/sun/star/wizards/web/data/CGContent.py
M wizards/com/sun/star/wizards/web/data/CGExporter.py
M wizards/com/sun/star/wizards/web/data/CGSession.py
M wizards/com/sun/star/wizards/web/data/CGSettings.py
6 files changed, 227 insertions(+), 17 deletions(-)
diff --git a/wizards/Pyuno_web.mk b/wizards/Pyuno_web.mk
index 5a6ae77..93b312f 100644
--- a/wizards/Pyuno_web.mk
+++ b/wizards/Pyuno_web.mk
@@ -54,6 +54,7 @@
WebWizardDialogResources.py \
TypeDetection.py \
ExtensionVerifier.py\
+ WebConfigSet.py\
__init__.py \
data/CGArgument.py \
data/CGContent.py \
diff --git a/wizards/com/sun/star/wizards/web/WebConfigSet.py
b/wizards/com/sun/star/wizards/web/WebConfigSet.py
new file mode 100644
index 000..88b49f2
--- /dev/null
+++ b/wizards/com/sun/star/wizards/web/WebConfigSet.py
@@ -0,0 +1,209 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed
+# with this work for additional information regarding copyright
+# ownership. The ASF licenses this file to you under the Apache
+# License, Version 2.0 (the License); you may not use this file
+# except in compliance with the License. You may obtain a copy of
+# the License at http://www.apache.org/licenses/LICENSE-2.0 .
+#
+import traceback
+from ..common.ConfigGroup import ConfigGroup
+from ..common.Configuration import Configuration
+from ..common.XMLProvider import XMLProvider
+
+class WebConfigSet(ConfigGroup):
+'''
+After reading the configuration set items,
+the ConfigSet checks this field.
+If it is true, it will remove any nulls from
+the vector.
+subclasses can change this field in the constructor
+to avoid this deletion of nulls.
+'''
+
+def __init__(self, childType):
+print (DEBUG !!! childType: , childType)
+self.childClass = childType
+self.childrenMap = {}
+self.childrenList = []
+self.noNulls = False
+
+def add(self, name, o):
+print (DEBUG !!! WebConfigSet.add -- name: , name)
+if (o is None):
+print (DEBUG !!! WebConfigSet.add -- Received None object as
argument.)
+oldO = None
+if (name in self.childrenMap):
+oldO = self.childrenMap[name]
+self.childrenMap[name] = o
+try:
+i = int(name)
+print (DEBUG !!! WebConfigSet.add -- name IS an integer.)
+self.childrenList.insert(i, o)
+except Exception:
+print (DEBUG !!! WebConfigSet.add -- name IS NOT an integer.)
+try:
+i = o.cp_Index
+print (DEBUG !!! WebConfigSet.add -- index: , i)
+oldSize = self.getSize()
+print (DEBUG !!! WebConfigSet.add -- oldSize: , oldSize)
+if oldSize i:
+newSize = i - oldSize
+self.childrenList += [None] * newSize
+self.noNulls |= True
+else:
+self.noNulls |= False
+print (DEBUG !!! WebConfigSet.add -- inserting object o: , o)
+self.childrenList.insert(i, o)
+if oldSize i:
+oldSize = i
+except Exception:
+if (oldO is not None):
+print (DEBUG !!! WebConfigSet.add -- No cp_Index
attribute, but element already present, so replace it.)
+i = self.childrenList.index(oldO)
+self.childrenList[i] = o
+else:
+print (DEBUG !!! WebConfigSet.add -- No cp_Index
attribute, so just append it.)
+self.childrenList.append(o)
+
+
+def writeConfiguration(self, configView, param):
+print (DEBUG !!! writeConfiguration --)
+names = self.childrenMap.keys()
+#first I remove all the children from the configuration.
+children = configView.ElementNames
+print (DEBUG !!! writeConfiguration -- children length: ,
len(children))
+if children:
+print (DEBUG !!! writeConfiguration -- removing childrens.)
+for i in children:
+try:
+