[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source

2014-08-23 Thread Miklos Vajna
 writerfilter/CustomTarget_source.mk |1 -
 writerfilter/source/ooxml/model.xml |   27 ---
 2 files changed, 28 deletions(-)

New commits:
commit 552f139d2a4785882d68016cbdf2f630c69f6300
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat Aug 23 11:29:20 2014 +0200

writerfilter: remove mce token generator

Commit af7d4a5ebf3e6a09cd2079f241dee16aa22e0276 (n#820503: initial MCE
support in writerfilter ooxml tokenizer, 2013-07-03) added these, but in
fact only the namespace-alias part was necessary. Now that oox provides
the list of namespaces to be registered, it can be removed completely.

Change-Id: If8f1b0c07602a0170c63b53d806a5b466d485747

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index 2061780..09b2610 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -39,7 +39,6 @@ writerfilter_OOXMLNAMESPACES= \
vml-main \
vml-officeDrawing \
vml-wordprocessingDrawing \
-   mce \
wp14 \
w14 \
a14 \
diff --git a/writerfilter/source/ooxml/model.xml 
b/writerfilter/source/ooxml/model.xml
index 2964196..40beca2 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -10432,33 +10432,6 @@
   value 
tokenid=ooxml:Value_vmlOffice_ST_FillType_backgroundbackground/value
 /resource
   /namespace
-  namespace name=mce
-start name=AlternateContent/
-grammar xmlns=http://relaxng.org/ns/structure/1.0; 
ns=http://schemas.openxmlformats.org/markup-compatibility/2006;
-  define name=nsList
-choice
-data type=NCName/
-/choice
-  /define
-  define name=AlternateContent
-element name=AlternateContent
-ref name=Choice/
-/element
-  /define
-  define name=Choice
-element name=Choice
-  attribute name=Requires
-ref name=nsList/
-  /attribute
-  text/
-/element
-  /define
-/grammar
-resource name=AlternateContent resource=Value/
-resource name=Choice resource=Value
-  attribute name=Requires tokenid=ooxml:mc_Requires/
-/resource
-  /namespace
   namespace name=vml-wordprocessingDrawing 
file=vml-wordprocessingDrawing.rng
 start name=bordertop/
 start name=borderleft/
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source

2014-08-02 Thread Jan Holesovsky
 writerfilter/CustomTarget_source.mk |5 --
 writerfilter/source/ooxml/OOXMLFactory.cxx  |   16 ---
 writerfilter/source/ooxml/OOXMLFactory.hxx  |   10 +---
 writerfilter/source/ooxml/factory_ns.py |2 
 writerfilter/source/ooxml/factory_values.py |   59 
 writerfilter/source/ooxml/factoryimpl_ns.py |   27 +---
 6 files changed, 18 insertions(+), 101 deletions(-)

New commits:
commit 7aa7047eb48e81bc0b32448ff0487c993fe9a4db
Author: Jan Holesovsky ke...@collabora.com
Date:   Sun Aug 3 00:56:26 2014 +0200

writerfilter: Kill ListValueMap(s)  their construction.

ListValueMaps were completely useless; it is always just few values that 
used
to be in the unordered_map, so doing just a normal comparison couldn't be 
too
much worse than all the hash construction etc.

This saves 300k of the libwriterfilter.so size (striped).

If this proves to be less performing than what we used to have (which I
doubt), now when we generate the code using Python, it would be a piece of
cake to construct some deterministic finite automaton in each switch's case 
to
accept the value names, and return the values.

Change-Id: I95d0470b73ade1fbf5c9de2299c4adcc59286bc3

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index 6ff9c09..10d74a7 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -68,7 +68,6 @@ 
writerfilter_GEN_ooxml_NamespaceIds_hxx=$(writerfilter_WORK)/ooxml/OOXMLnamespac
 writerfilter_GEN_ooxml_QNameToStr_cxx=$(writerfilter_WORK)/ooxml/qnametostr.cxx
 
writerfilter_GEN_ooxml_ResourceIds_hxx=$(writerfilter_WORK)/ooxml/resourceids.hxx
 writerfilter_GEN_ooxml_Token_xml=$(writerfilter_WORK)/ooxml/token.xml
-writerfilter_SRC_ooxml_FactoryValues_py=$(writerfilter_SRC)/ooxml/factory_values.py
 writerfilter_SRC_ooxml_FastTokens_py=$(writerfilter_SRC)/ooxml/fasttokens.py
 
writerfilter_SRC_ooxml_GperfFastTokenHandler_py=$(writerfilter_SRC)/ooxml/gperffasttokenhandler.py
 writerfilter_SRC_ooxml_Model=$(writerfilter_SRC)/ooxml/model.xml
@@ -84,10 +83,6 @@ $(writerfilter_GEN_ooxml_Factory_hxx) : 
$(writerfilter_SRC)/ooxml/factoryinc.py
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) $ 
$(writerfilter_GEN_ooxml_Model_processed))  $@
 
-$(writerfilter_GEN_ooxml_FactoryValues_hxx) : 
$(writerfilter_SRC_ooxml_FactoryValues_py) 
$(writerfilter_GEN_ooxml_Model_processed)
-   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
-   $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) 
$(writerfilter_SRC_ooxml_FactoryValues_py) 
$(writerfilter_GEN_ooxml_Model_processed))  $@
-
 $(writerfilter_GEN_ooxml_FastTokens_hxx) : 
$(writerfilter_SRC_ooxml_FastTokens_py) $(writerfilter_GEN_ooxml_Token_xml) | 
$(writerfilter_WORK)/ooxml/.dir
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) 
$(writerfilter_SRC_ooxml_FastTokens_py) $(writerfilter_GEN_ooxml_Token_xml))  
$@
diff --git a/writerfilter/source/ooxml/OOXMLFactory.cxx 
b/writerfilter/source/ooxml/OOXMLFactory.cxx
index afdadf1..5f8512f 100644
--- a/writerfilter/source/ooxml/OOXMLFactory.cxx
+++ b/writerfilter/source/ooxml/OOXMLFactory.cxx
@@ -62,14 +62,6 @@ AttributeToResourceMapPointer 
OOXMLFactory_ns::getAttributeToResourceMap(Id nId)
 return m_AttributesMap[nId];
 }
 
-ListValueMapPointer OOXMLFactory_ns::getListValueMap(Id nId)
-{
-if (m_ListValuesMap.find(nId) == m_ListValuesMap.end())
-m_ListValuesMap[nId] = createListValueMap(nId);
-
-return m_ListValuesMap[nId];
-}
-
 CreateElementMapPointer OOXMLFactory_ns::getCreateElementMap(Id nId)
 {
 if (m_CreateElementsMap.find(nId) == m_CreateElementsMap.end())
@@ -191,13 +183,9 @@ void OOXMLFactory::attributes(OOXMLFastContextHandler * 
pHandler,
 break;
 case RT_List:
 {
-ListValueMapPointer pListValueMap =
-pFactory-getListValueMap(aIt-second.m_nRef);
-
-if (pListValueMap.get() != NULL)
+sal_uInt32 nValue;
+if (pFactory-getListValue(aIt-second.m_nRef, 
Attribs-getValue(nToken), nValue))
 {
-OUString aValue(Attribs-getValue(nToken));
-sal_uInt32 nValue = (*pListValueMap)[aValue];
 OOXMLValue::Pointer_t xValue = 
OOXMLIntegerValue::Create(nValue);
 pHandler-newProperty(nId, xValue);
 pFactory-attributeAction(pHandler, nToken, 
xValue);
diff --git a/writerfilter/source/ooxml/OOXMLFactory.hxx 
b/writerfilter/source/ooxml/OOXMLFactory.hxx
index 76676ac..6167290 100644
--- 

[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source

2014-07-27 Thread Miklos Vajna
 writerfilter/CustomTarget_source.mk  |   11 
 writerfilter/source/ooxml/factoryimpl_ns.py  |  715 
 writerfilter/source/ooxml/factoryimpl_ns.xsl |  945 ---
 writerfilter/source/ooxml/factorytools.xsl   |  262 ---
 4 files changed, 719 insertions(+), 1214 deletions(-)

New commits:
commit 821ab16a1fb0353397914131ab559685d12b92b7
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sun Jul 27 17:46:42 2014 +0200

writerfilter: convert factoryimpl_ns to Python

Change-Id: Ia2380a23e31583f40a368168bc09d7fddd3e4ab7

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index b84e235..6ff9c09 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -12,7 +12,6 @@ $(eval $(call 
gb_CustomTarget_CustomTarget,writerfilter/source))
 writerfilter_WORK := $(call gb_CustomTarget_get_workdir,writerfilter/source)
 writerfilter_SRC := $(SRCDIR)/writerfilter/source
 
-writerfilter_XSLTCOMMAND := $(call gb_ExternalExecutable_get_command,xsltproc)
 writerfilter_PYTHONCOMMAND := $(call gb_ExternalExecutable_get_command,python)
 
 writerfilter_OOXMLNAMESPACES= \
@@ -66,11 +65,9 @@ 
writerfilter_GEN_ooxml_FastTokens_hxx=$(writerfilter_WORK)/ooxml/OOXMLFastTokens
 
writerfilter_GEN_ooxml_GperfFastToken_hxx=$(writerfilter_WORK)/ooxml/gperffasttoken.hxx
 
writerfilter_GEN_ooxml_Model_processed=$(writerfilter_WORK)/ooxml/model_preprocessed.xml
 
writerfilter_GEN_ooxml_NamespaceIds_hxx=$(writerfilter_WORK)/ooxml/OOXMLnamespaceids.hxx
-writerfilter_GEN_ooxml_Namespacesmap_xsl=$(writerfilter_WORK)/ooxml/namespacesmap.xsl
 writerfilter_GEN_ooxml_QNameToStr_cxx=$(writerfilter_WORK)/ooxml/qnametostr.cxx
 
writerfilter_GEN_ooxml_ResourceIds_hxx=$(writerfilter_WORK)/ooxml/resourceids.hxx
 writerfilter_GEN_ooxml_Token_xml=$(writerfilter_WORK)/ooxml/token.xml
-writerfilter_SRC_ooxml_FactoryTools_xsl=$(writerfilter_SRC)/ooxml/factorytools.xsl
 
writerfilter_SRC_ooxml_FactoryValues_py=$(writerfilter_SRC)/ooxml/factory_values.py
 writerfilter_SRC_ooxml_FastTokens_py=$(writerfilter_SRC)/ooxml/fasttokens.py
 
writerfilter_SRC_ooxml_GperfFastTokenHandler_py=$(writerfilter_SRC)/ooxml/gperffasttokenhandler.py
@@ -121,9 +118,9 @@ $(writerfilter_GEN_ooxml_Token_xml) : 
$(SRCDIR)/oox/source/token/tokens.txt $(wr
sed -f $(writerfilter_SRC)/ooxml/tokens-to-xml.sed \
 $(SRCDIR)/oox/source/token/tokens.txt  $@
 
-$(writerfilter_WORK)/ooxml/OOXMLFactory%.cxx : 
$(writerfilter_SRC)/ooxml/factoryimpl_ns.xsl 
$(writerfilter_GEN_ooxml_Model_processed)
-   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
-   $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
--stringparam file $@ $ $(writerfilter_GEN_ooxml_Model_processed))  $@
+$(writerfilter_WORK)/ooxml/OOXMLFactory%.cxx : 
$(writerfilter_SRC)/ooxml/factoryimpl_ns.py 
$(writerfilter_GEN_ooxml_Model_processed)
+   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
+   $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) $ 
$(writerfilter_GEN_ooxml_Model_processed) $@)  $@
 
 $(writerfilter_WORK)/ooxml/OOXMLFactory%.hxx : 
$(writerfilter_SRC)/ooxml/factory_ns.py 
$(writerfilter_GEN_ooxml_Model_processed)
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
@@ -132,6 +129,6 @@ $(writerfilter_WORK)/ooxml/OOXMLFactory%.hxx : 
$(writerfilter_SRC)/ooxml/factory
 
 $(call gb_CustomTarget_get_target,writerfilter/source) : $(writerfilter_ALL)
 
-$(writerfilter_ALL) :| $(call gb_ExternalExecutable_get_dependencies,xsltproc) 
$(call gb_ExternalExecutable_get_dependencies,python) 
$(writerfilter_WORK)/ooxml/.dir
+$(writerfilter_ALL) :| $(call gb_ExternalExecutable_get_dependencies,python) 
$(writerfilter_WORK)/ooxml/.dir
 
 # vim: set noet sw=4 ts=4:
diff --git a/writerfilter/source/ooxml/factoryimpl_ns.py 
b/writerfilter/source/ooxml/factoryimpl_ns.py
new file mode 100644
index 000..4dc8ff0
--- /dev/null
+++ b/writerfilter/source/ooxml/factoryimpl_ns.py
@@ -0,0 +1,715 @@
+#!/usr/bin/env python
+#
+# 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/.
+#
+
+from __future__ import print_function
+from xml.dom import minidom
+import sys
+
+
+# factoryMutexDecl
+
+
+def factoryMutexDecl(nsLabel):
+print(typedef rtl::Staticosl::Mutex, OOXMLFactory_%s 
OOXMLFactory_%s_Mutex; % (nsLabel, nsLabel))
+print()
+
+
+# factoryConstructor
+
+
+def factoryConstructor(nsLabel):
+print(OOXMLFactory_%s::OOXMLFactory_%s()
+{
+// multi-thread-safe mutex for all platforms
+
+osl::MutexGuard aGuard(OOXMLFactory_%s_Mutex::get());
+} % (nsLabel, nsLabel, nsLabel))
+print()
+
+
+# factoryDestructor
+
+
+def factoryDestructor(nsLabel):
+

[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source

2014-07-15 Thread Miklos Vajna
 writerfilter/CustomTarget_source.mk|6 -
 writerfilter/source/ooxml/factory_ns.py|   83 
 writerfilter/source/ooxml/factory_ns.xsl   |  150 -
 writerfilter/source/ooxml/factorytools.xsl |   11 --
 4 files changed, 86 insertions(+), 164 deletions(-)

New commits:
commit 3f2d6c7f7a6ef825b9431a3d270bc75b84069a32
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Jul 15 21:13:01 2014 +0200

writerfilter: convert factory_ns to Python

Change-Id: I64996b3f96f51ba80ade636c13a2919410672a27

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index 9fdaf00..b84e235 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -125,9 +125,9 @@ $(writerfilter_WORK)/ooxml/OOXMLFactory%.cxx : 
$(writerfilter_SRC)/ooxml/factory
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
--stringparam file $@ $ $(writerfilter_GEN_ooxml_Model_processed))  $@
 
-$(writerfilter_WORK)/ooxml/OOXMLFactory%.hxx : 
$(writerfilter_SRC)/ooxml/factory_ns.xsl 
$(writerfilter_GEN_ooxml_Model_processed)
-   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
-   $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
--stringparam file $@ $ $(writerfilter_GEN_ooxml_Model_processed))  $@
+$(writerfilter_WORK)/ooxml/OOXMLFactory%.hxx : 
$(writerfilter_SRC)/ooxml/factory_ns.py 
$(writerfilter_GEN_ooxml_Model_processed)
+   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
+   $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) $ 
$(writerfilter_GEN_ooxml_Model_processed) $@)  $@
 
 
 $(call gb_CustomTarget_get_target,writerfilter/source) : $(writerfilter_ALL)
diff --git a/writerfilter/source/ooxml/factory_ns.py 
b/writerfilter/source/ooxml/factory_ns.py
new file mode 100644
index 000..edd0718
--- /dev/null
+++ b/writerfilter/source/ooxml/factory_ns.py
@@ -0,0 +1,83 @@
+#!/usr/bin/env python
+#
+# 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/.
+#
+
+from __future__ import print_function
+from xml.dom import minidom
+import sys
+
+
+def createHeader(model, ns):
+nsToken = ns.replace('-', '_')
+print(
+#ifndef INCLUDED_OOXML_FACTORY_%s_HXX
+#define INCLUDED_OOXML_FACTORY_%s_HXX
+#include ooxml/OOXMLFactory.hxx
+#include OOXMLFactory_generated.hxx
+#include ooxml/OOXMLnamespaceids.hxx
+#include ooxml/resourceids.hxx
+
+namespace writerfilter {
+namespace ooxml {
+
+/// @cond GENERATED
+ % (nsToken.upper(), nsToken.upper()))
+
+print(class OOXMLFactory_%s : public OOXMLFactory_ns
+{
+public:
+typedef boost::shared_ptr OOXMLFactory_ns Pointer_t;
+
+static Pointer_t getInstance();
+
+virtual AttributeToResourceMapPointer createAttributeToResourceMap(Id nId);
+virtual ListValueMapPointer createListValueMap(Id nId);
+virtual CreateElementMapPointer createCreateElementMap(Id nId);
+virtual TokenToIdMapPointer createTokenToIdMap(Id nId);
+#ifdef DEBUG_DOMAINMAPPER
+virtual string getDefineName(Id nId) const;
+#endif
+ % nsToken)
+
+actions = []
+for nsNode in [i for i in model.getElementsByTagName(namespace) if 
i.getAttribute(name) == ns]:
+for resource in nsNode.getElementsByTagName(resource):
+for action in [i.getAttribute(name) for i in resource.childNodes 
if i.nodeType == minidom.Node.ELEMENT_NODE and i.tagName == action]:
+if action != characters and action not in actions:
+actions.append(action)
+for action in actions:
+print(void %sAction(OOXMLFastContextHandler* pHandler); % action)
+
+print(virtual void charactersAction(OOXMLFastContextHandler* pHandler, 
const OUString  sText);
+virtual void attributeAction(OOXMLFastContextHandler* pHandler, Token_t 
nToken, OOXMLValue::Pointer_t pValue);
+
+#ifdef DEBUG_DOMAINMAPPER
+virtual string getName() const;
+#endif
+
+
+virtual ~OOXMLFactory_%s();
+
+protected:
+static Pointer_t m_pInstance;
+
+OOXMLFactory_%s();
+};
+ % (nsToken, nsToken))
+
+print(/// @endcond
+}}
+#endif //INCLUDED_OOXML_FACTORY_%s_HXX % nsToken.upper())
+
+modelPath = sys.argv[1]
+filePath = sys.argv[2]
+model = minidom.parse(modelPath)
+ns = filePath.split('OOXMLFactory_')[1].split('.hxx')[0]
+createHeader(model, ns)
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/writerfilter/source/ooxml/factory_ns.xsl 
b/writerfilter/source/ooxml/factory_ns.xsl
deleted file mode 100644
index 59a2940..000
--- a/writerfilter/source/ooxml/factory_ns.xsl
+++ /dev/null
@@ -1,150 +0,0 @@
-!--
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the 

[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source

2014-07-12 Thread Miklos Vajna
 writerfilter/CustomTarget_source.mk|6 
 writerfilter/source/ooxml/factoryimpl.py   |  204 +
 writerfilter/source/ooxml/factoryimpl.xsl  |  274 -
 writerfilter/source/ooxml/factorytools.xsl |   20 --
 4 files changed, 207 insertions(+), 297 deletions(-)

New commits:
commit a7706f8a4e79fd36a296e988f7f852dfd549a16f
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat Jul 12 10:09:53 2014 +0200

writerfilter: convert factoryimpl to Python

Change-Id: I2065215db5da0a379e902a74eff419d5c6068d21

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index 989a623..9fdaf00 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -79,9 +79,9 @@ 
writerfilter_SRC_ooxml_Preprocess_py=$(writerfilter_SRC)/ooxml/modelpreprocess.p
 writerfilter_SRC_ooxml_QNameToStr_py=$(writerfilter_SRC)/ooxml/qnametostr.py
 writerfilter_SRC_ooxml_ResourceIds_py=$(writerfilter_SRC)/ooxml/resourceids.py
 
-$(writerfilter_GEN_ooxml_Factory_cxx) : 
$(writerfilter_SRC)/ooxml/factoryimpl.xsl 
$(writerfilter_GEN_ooxml_Model_processed)
-   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
-   $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) $ 
$(writerfilter_GEN_ooxml_Model_processed))  $@
+$(writerfilter_GEN_ooxml_Factory_cxx) : 
$(writerfilter_SRC)/ooxml/factoryimpl.py 
$(writerfilter_GEN_ooxml_Model_processed)
+   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
+   $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) $ 
$(writerfilter_GEN_ooxml_Model_processed))  $@
 
 $(writerfilter_GEN_ooxml_Factory_hxx) : 
$(writerfilter_SRC)/ooxml/factoryinc.py 
$(writerfilter_GEN_ooxml_Model_processed)
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
diff --git a/writerfilter/source/ooxml/factoryimpl.py 
b/writerfilter/source/ooxml/factoryimpl.py
new file mode 100644
index 000..0fb9144
--- /dev/null
+++ b/writerfilter/source/ooxml/factoryimpl.py
@@ -0,0 +1,204 @@
+#!/usr/bin/env python
+#
+# 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/.
+#
+
+from __future__ import print_function
+from xml.dom import minidom
+import sys
+
+
+def getElementsByTagNamesNS(parent, ns, names, ret=minidom.NodeList()):
+for node in parent.childNodes:
+if node.nodeType == minidom.Node.ELEMENT_NODE and node.namespaceURI == 
ns and node.tagName in names:
+ret.append(node)
+getElementsByTagNamesNS(node, ns, names, ret)
+return ret
+
+
+def createFastChildContextFromFactory(model):
+print(uno::Referencexml::sax::XFastContextHandler 
OOXMLFactory::createFastChildContextFromFactory
+(OOXMLFastContextHandler* pHandler, OOXMLFactory_ns::Pointer_t pFactory, 
Token_t Element)
+{
+uno::Reference xml::sax::XFastContextHandler aResult;
+Id nDefine = pHandler-getDefine();
+
+if (pFactory.get() != NULL)
+{
+CreateElementMapPointer pMap = pFactory-getCreateElementMap(nDefine);
+TokenToIdMapPointer pTokenMap = pFactory-getTokenToIdMap(nDefine);
+
+if (pMap.get() != NULL)
+{
+Id nId = (*pTokenMap)[Element];
+CreateElement aCreateElement = (*pMap)[Element];
+
+switch (aCreateElement.m_nResource)
+{)
+resources = [List, Integer, Hex, String, UniversalMeasure, 
Boolean]
+for resource in [r.getAttribute(resource) for r in 
model.getElementsByTagName(resource)]:
+if resource not in resources:
+resources.append(resource)
+print(case RT_%s:
+
aResult.set(OOXMLFastHelperOOXMLFastContextHandler%s::createAndSetParentAndDefine(pHandler,
 Element, nId, aCreateElement.m_nId));
+break; % (resource, resource))
+print(case RT_Any:
+aResult.set(createFastChildContextFromStart(pHandler, 
Element));
+break;
+default:
+break;
+}
+
+}
+}
+
+return aResult;
+}
+)
+
+
+def getFactoryForNamespace(model):
+print(OOXMLFactory_ns::Pointer_t 
OOXMLFactory::getFactoryForNamespace(Id nId)
+{
+OOXMLFactory_ns::Pointer_t pResult;
+
+switch (nId  0x)
+{)
+
+for namespace in [ns.getAttribute(name) for ns in 
model.getElementsByTagName(namespace)]:
+id = namespace.replace('-', '_')
+print(case NN_%s:
+pResult = OOXMLFactory_%s::getInstance();
+break; % (id, id))
+print(default:
+break;
+}
+
+return pResult;
+}
+)
+
+
+def createFastChildContextFromStart(model):
+print(uno::Referencexml::sax::XFastContextHandler 
OOXMLFactory::createFastChildContextFromStart

[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source

2014-07-06 Thread Miklos Vajna
 writerfilter/CustomTarget_source.mk|7 --
 writerfilter/source/ooxml/namespaceids.py  |   53 
 writerfilter/source/ooxml/namespaceids.xsl |   92 -
 writerfilter/source/ooxml/qnametostr.py|1 
 4 files changed, 56 insertions(+), 97 deletions(-)

New commits:
commit 785dc709d5d560666ef3150c4506286f4a20925b
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sun Jul 6 12:42:54 2014 +0200

writerfilter: convert namespaceids to Python

Change-Id: Ia57a41aba91f00f3c1fb63a82c9793bf43434afb

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index a7413d0..989a623 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -75,7 +75,6 @@ 
writerfilter_SRC_ooxml_FactoryValues_py=$(writerfilter_SRC)/ooxml/factory_values
 writerfilter_SRC_ooxml_FastTokens_py=$(writerfilter_SRC)/ooxml/fasttokens.py
 
writerfilter_SRC_ooxml_GperfFastTokenHandler_py=$(writerfilter_SRC)/ooxml/gperffasttokenhandler.py
 writerfilter_SRC_ooxml_Model=$(writerfilter_SRC)/ooxml/model.xml
-writerfilter_SRC_ooxml_NamespaceIds_xsl=$(writerfilter_SRC)/ooxml/namespaceids.xsl
 
writerfilter_SRC_ooxml_Preprocess_py=$(writerfilter_SRC)/ooxml/modelpreprocess.py
 writerfilter_SRC_ooxml_QNameToStr_py=$(writerfilter_SRC)/ooxml/qnametostr.py
 writerfilter_SRC_ooxml_ResourceIds_py=$(writerfilter_SRC)/ooxml/resourceids.py
@@ -105,9 +104,9 @@ $(writerfilter_GEN_ooxml_Model_processed) : 
$(writerfilter_SRC_ooxml_Preprocess_
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) 
$(writerfilter_SRC_ooxml_Preprocess_py) 
$(writerfilter_DEP_ooxml_Namespaces_txt) $(writerfilter_SRC_ooxml_Model))  $@
 
-$(writerfilter_GEN_ooxml_NamespaceIds_hxx) : 
$(writerfilter_SRC_ooxml_NamespaceIds_xsl) 
$(writerfilter_GEN_ooxml_Model_processed) | $(writerfilter_WORK)/ooxml/.dir
-   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
-   $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
$(writerfilter_SRC_ooxml_NamespaceIds_xsl) 
$(writerfilter_GEN_ooxml_Model_processed))  $@
+$(writerfilter_GEN_ooxml_NamespaceIds_hxx) : 
$(writerfilter_SRC)/ooxml/namespaceids.py 
$(writerfilter_GEN_ooxml_Model_processed) | $(writerfilter_WORK)/ooxml/.dir
+   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
+   $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) $ 
$(writerfilter_GEN_ooxml_Model_processed))  $@
 
 $(writerfilter_GEN_ooxml_QNameToStr_cxx): 
$(writerfilter_SRC_ooxml_QNameToStr_py) 
$(writerfilter_GEN_ooxml_Model_processed)
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
diff --git a/writerfilter/source/ooxml/namespaceids.py 
b/writerfilter/source/ooxml/namespaceids.py
new file mode 100644
index 000..2135b48
--- /dev/null
+++ b/writerfilter/source/ooxml/namespaceids.py
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+#
+# 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/.
+#
+
+from __future__ import print_function
+import xml.sax
+import sys
+
+
+class ContentHandler(xml.sax.handler.ContentHandler):
+def __init__(self):
+self.tokens = []
+
+def startDocument(self):
+print(
+#ifndef INCLUDED_OOXML_NAMESPACESIDS_HXX
+#define INCLUDED_OOXML_NAMESPACESIDS_HXX
+
+#include map
+#include vector
+#include boost/shared_ptr.hpp
+#include string
+
+#include resourcemodel/WW8ResourceModel.hxx
+
+namespace writerfilter {
+namespace ooxml {
+using namespace ::std;
+using namespace ::com::sun::star;
+)
+
+def endDocument(self):
+print(
+}}
+#endif //INCLUDED_OOXML_NAMESPACESIDS_HXX)
+
+def startElement(self, name, attrs):
+if name == namespace-alias:
+token = const sal_uInt32 NS_%s = %s; % (attrs[alias], 
attrs[id])
+if token not in self.tokens:
+self.tokens.append(token)
+print(token)
+
+parser = xml.sax.make_parser()
+parser.setContentHandler(ContentHandler())
+parser.parse(sys.argv[1])
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/writerfilter/source/ooxml/namespaceids.xsl 
b/writerfilter/source/ooxml/namespaceids.xsl
deleted file mode 100644
index d92593d..000
--- a/writerfilter/source/ooxml/namespaceids.xsl
+++ /dev/null
@@ -1,92 +0,0 @@
-!--
- * 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
- * 

[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source

2014-07-05 Thread Miklos Vajna
 writerfilter/CustomTarget_source.mk  |8 +-
 writerfilter/source/ooxml/qnametostr.py  |   54 +
 writerfilter/source/ooxml/qnametostr.xsl |   94 ---
 3 files changed, 58 insertions(+), 98 deletions(-)

New commits:
commit 483a36f49230f53b291ba1307c8a3ffcc24a3b12
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat Jul 5 11:04:48 2014 +0200

writerfilter: convert qnametostr to Python

Change-Id: Ie72afbb1a7d384386d3189dae8276444767aac53

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index d991b47..a7413d0 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -77,7 +77,7 @@ 
writerfilter_SRC_ooxml_GperfFastTokenHandler_py=$(writerfilter_SRC)/ooxml/gperff
 writerfilter_SRC_ooxml_Model=$(writerfilter_SRC)/ooxml/model.xml
 
writerfilter_SRC_ooxml_NamespaceIds_xsl=$(writerfilter_SRC)/ooxml/namespaceids.xsl
 
writerfilter_SRC_ooxml_Preprocess_py=$(writerfilter_SRC)/ooxml/modelpreprocess.py
-writerfilter_SRC_ooxml_QNameToStr_xsl=$(writerfilter_SRC)/ooxml/qnametostr.xsl
+writerfilter_SRC_ooxml_QNameToStr_py=$(writerfilter_SRC)/ooxml/qnametostr.py
 writerfilter_SRC_ooxml_ResourceIds_py=$(writerfilter_SRC)/ooxml/resourceids.py
 
 $(writerfilter_GEN_ooxml_Factory_cxx) : 
$(writerfilter_SRC)/ooxml/factoryimpl.xsl 
$(writerfilter_GEN_ooxml_Model_processed)
@@ -109,9 +109,9 @@ $(writerfilter_GEN_ooxml_NamespaceIds_hxx) : 
$(writerfilter_SRC_ooxml_NamespaceI
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
$(writerfilter_SRC_ooxml_NamespaceIds_xsl) 
$(writerfilter_GEN_ooxml_Model_processed))  $@
 
-$(writerfilter_GEN_ooxml_QNameToStr_cxx): 
$(writerfilter_SRC_ooxml_QNameToStr_xsl) 
$(writerfilter_SRC_ooxml_FactoryTools_xsl) 
$(writerfilter_GEN_ooxml_Model_processed)
-   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
-   $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
$(writerfilter_SRC_ooxml_QNameToStr_xsl) 
$(writerfilter_GEN_ooxml_Model_processed))  $@
+$(writerfilter_GEN_ooxml_QNameToStr_cxx): 
$(writerfilter_SRC_ooxml_QNameToStr_py) 
$(writerfilter_GEN_ooxml_Model_processed)
+   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
+   $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) 
$(writerfilter_SRC_ooxml_QNameToStr_py) 
$(writerfilter_GEN_ooxml_Model_processed))  $@
 
 $(writerfilter_GEN_ooxml_ResourceIds_hxx) : 
$(writerfilter_SRC_ooxml_ResourceIds_py) 
$(writerfilter_GEN_ooxml_Model_processed) | $(writerfilter_WORK)/ooxml/.dir
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
diff --git a/writerfilter/source/ooxml/qnametostr.py 
b/writerfilter/source/ooxml/qnametostr.py
new file mode 100644
index 000..520f135
--- /dev/null
+++ b/writerfilter/source/ooxml/qnametostr.py
@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+#
+# 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/.
+#
+
+from __future__ import print_function
+import xml.sax
+import sys
+
+
+class ContentHandler(xml.sax.handler.ContentHandler):
+def __init__(self):
+self.tokens = []
+
+def startDocument(self):
+print(
+#include ooxml/resourceids.hxx
+#include resourcemodel/QNameToString.hxx
+
+namespace writerfilter
+{
+
+void QNameToString::init_ooxml()
+{
+#ifdef DEBUG_DOMAINMAPPER
+/* ooxml */
+)
+
+def endDocument(self):
+print(#endif
+}
+
+}
+)
+
+def startElement(self, name, attrs):
+pass
+for k, v in list(attrs.items()):
+if k == tokenid:
+if v.startswith(ooxml:):
+token = v.replace('ooxml:', '')
+if token not in self.tokens:
+print(mMap[NS_ooxml::LN_%s] = ooxml:%s; % 
(token, token))
+self.tokens.append(token)
+
+parser = xml.sax.make_parser()
+parser.setContentHandler(ContentHandler())
+parser.parse(sys.argv[1])
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/writerfilter/source/ooxml/qnametostr.xsl 
b/writerfilter/source/ooxml/qnametostr.xsl
deleted file mode 100644
index 8aec26d..000
--- a/writerfilter/source/ooxml/qnametostr.xsl
+++ /dev/null
@@ -1,94 +0,0 @@
-!--
- * 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 

[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source

2014-06-29 Thread Miklos Vajna
 writerfilter/CustomTarget_source.mk  |8 +-
 writerfilter/source/ooxml/factory_values.py  |   59 ++
 writerfilter/source/ooxml/factory_values.xsl |   85 ---
 3 files changed, 63 insertions(+), 89 deletions(-)

New commits:
commit 3b8ab58008fcbca3c581ef827e5af07eb72b23ee
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sun Jun 29 10:53:49 2014 +0200

writerfilter: convert factory_values to Python

Change-Id: I4dca13159a25ed137153c2a7a66ca4f87f612e87

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index a52445b..39270a4 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -71,7 +71,7 @@ 
writerfilter_GEN_ooxml_QNameToStr_cxx=$(writerfilter_WORK)/ooxml/qnametostr.cxx
 
writerfilter_GEN_ooxml_ResourceIds_hxx=$(writerfilter_WORK)/ooxml/resourceids.hxx
 writerfilter_GEN_ooxml_Token_xml=$(writerfilter_WORK)/ooxml/token.xml
 
writerfilter_SRC_ooxml_FactoryTools_xsl=$(writerfilter_SRC)/ooxml/factorytools.xsl
-writerfilter_SRC_ooxml_FactoryValues_xsl=$(writerfilter_SRC)/ooxml/factory_values.xsl
+writerfilter_SRC_ooxml_FactoryValues_py=$(writerfilter_SRC)/ooxml/factory_values.py
 writerfilter_SRC_ooxml_FastTokens_py=$(writerfilter_SRC)/ooxml/fasttokens.py
 
writerfilter_SRC_ooxml_GperfFastTokenHandler_py=$(writerfilter_SRC)/ooxml/gperffasttokenhandler.py
 writerfilter_SRC_ooxml_Model=$(writerfilter_SRC)/ooxml/model.xml
@@ -88,9 +88,9 @@ $(writerfilter_GEN_ooxml_Factory_hxx) : 
$(writerfilter_SRC)/ooxml/factoryinc.py
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) $ 
$(writerfilter_GEN_ooxml_Model_processed))  $@
 
-$(writerfilter_GEN_ooxml_FactoryValues_hxx) : 
$(writerfilter_SRC_ooxml_FactoryValues_xsl) 
$(writerfilter_GEN_ooxml_Model_processed)
-   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
-   $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
$(writerfilter_SRC_ooxml_FactoryValues_xsl) 
$(writerfilter_GEN_ooxml_Model_processed))  $@
+$(writerfilter_GEN_ooxml_FactoryValues_hxx) : 
$(writerfilter_SRC_ooxml_FactoryValues_py) 
$(writerfilter_GEN_ooxml_Model_processed)
+   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
+   $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) 
$(writerfilter_SRC_ooxml_FactoryValues_py) 
$(writerfilter_GEN_ooxml_Model_processed))  $@
 
 $(writerfilter_GEN_ooxml_FastTokens_hxx) : 
$(writerfilter_SRC_ooxml_FastTokens_py) $(writerfilter_GEN_ooxml_Token_xml) | 
$(writerfilter_WORK)/ooxml/.dir
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
diff --git a/writerfilter/source/ooxml/factory_values.py 
b/writerfilter/source/ooxml/factory_values.py
new file mode 100644
index 000..1279e9d
--- /dev/null
+++ b/writerfilter/source/ooxml/factory_values.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+#
+# 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/.
+#
+
+from __future__ import print_function
+import xml.sax
+import string
+import sys
+
+
+class ContentHandler(xml.sax.handler.ContentHandler):
+def __init__(self):
+self.inValue = False
+self.defines = []
+self.chars = []
+
+def __escape(self, name):
+return name.replace('-', 'm').replace('+', 'p').replace(' ', 
'_').replace(',', '_')
+
+def startDocument(self):
+print('''
+#ifndef INCLUDED_FACTORY_VALUES
+#include rtl/ustring.hxx
+
+#define OOXMLValueString_ ''')
+
+def endDocument(self):
+print(
+#endif // INCLUDED_FACTORY_VALUES)
+
+def startElement(self, name, attrs):
+if name == value:
+self.inValue = True
+
+def endElement(self, name):
+if name == value:
+self.inValue = False
+characters = .join(self.chars)
+self.chars = []
+if len(characters):
+define = '#define OOXMLValueString_%s %s' % 
(self.__escape(characters), characters)
+if not define in self.defines:
+self.defines.append(define)
+print(define)
+
+def characters(self, chars):
+if self.inValue:
+self.chars.append(chars)
+
+parser = xml.sax.make_parser()
+parser.setContentHandler(ContentHandler())
+parser.parse(sys.argv[1])
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/writerfilter/source/ooxml/factory_values.xsl 
b/writerfilter/source/ooxml/factory_values.xsl
deleted file mode 100644
index 5f76b22..000
--- a/writerfilter/source/ooxml/factory_values.xsl
+++ /dev/null
@@ -1,85 +0,0 @@
-!--
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the 

[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source

2014-06-25 Thread Miklos Vajna
 writerfilter/CustomTarget_source.mk   |8 +-
 writerfilter/source/ooxml/resourceids.py  |   60 +++
 writerfilter/source/ooxml/resourceids.xsl |   93 --
 3 files changed, 64 insertions(+), 97 deletions(-)

New commits:
commit e9ef350315a29f15c8c78eb86a00a6de22c75c21
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jun 25 21:16:16 2014 +0200

writerfilter: convert resourceids to Python

Change-Id: If138bb3de8815f9d24aa1db10543b904792a0b37

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index a791bfa..384d4fa 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -78,7 +78,7 @@ 
writerfilter_SRC_ooxml_Model=$(writerfilter_SRC)/ooxml/model.xml
 
writerfilter_SRC_ooxml_NamespaceIds_xsl=$(writerfilter_SRC)/ooxml/namespaceids.xsl
 
writerfilter_SRC_ooxml_Preprocess_py=$(writerfilter_SRC)/ooxml/modelpreprocess.py
 writerfilter_SRC_ooxml_QNameToStr_xsl=$(writerfilter_SRC)/ooxml/qnametostr.xsl
-writerfilter_SRC_ooxml_ResourceIds_xsl=$(writerfilter_SRC)/ooxml/resourceids.xsl
+writerfilter_SRC_ooxml_ResourceIds_py=$(writerfilter_SRC)/ooxml/resourceids.py
 
 $(writerfilter_GEN_ooxml_Factory_cxx) : 
$(writerfilter_SRC)/ooxml/factoryimpl.xsl 
$(writerfilter_GEN_ooxml_Model_processed)
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
@@ -113,9 +113,9 @@ $(writerfilter_GEN_ooxml_QNameToStr_cxx): 
$(writerfilter_SRC_ooxml_QNameToStr_xs
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
$(writerfilter_SRC_ooxml_QNameToStr_xsl) 
$(writerfilter_GEN_ooxml_Model_processed))  $@
 
-$(writerfilter_GEN_ooxml_ResourceIds_hxx) : 
$(writerfilter_SRC_ooxml_ResourceIds_xsl) 
$(writerfilter_GEN_ooxml_Model_processed) | $(writerfilter_WORK)/ooxml/.dir
-   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
-   $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
$(writerfilter_SRC_ooxml_ResourceIds_xsl) 
$(writerfilter_GEN_ooxml_Model_processed))  $@
+$(writerfilter_GEN_ooxml_ResourceIds_hxx) : 
$(writerfilter_SRC_ooxml_ResourceIds_py) 
$(writerfilter_GEN_ooxml_Model_processed) | $(writerfilter_WORK)/ooxml/.dir
+   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
+   $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) 
$(writerfilter_SRC_ooxml_ResourceIds_py) 
$(writerfilter_GEN_ooxml_Model_processed))  $@
 
 $(writerfilter_GEN_ooxml_Token_xml) : $(SRCDIR)/oox/source/token/tokens.txt 
$(writerfilter_SRC)/ooxml/tokens-to-xml.sed | $(writerfilter_WORK)/.dir
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,CAT,1)
diff --git a/writerfilter/source/ooxml/resourceids.py 
b/writerfilter/source/ooxml/resourceids.py
new file mode 100644
index 000..c612e77
--- /dev/null
+++ b/writerfilter/source/ooxml/resourceids.py
@@ -0,0 +1,60 @@
+#!/usr/bin/env python
+#
+# 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/.
+#
+
+from __future__ import print_function
+import xml.sax
+import sys
+
+
+class ContentHandler(xml.sax.handler.ContentHandler):
+def __init__(self):
+self.tokens = []
+self.counter = 90001
+
+def startDocument(self):
+print(
+/*
+
+THIS FILE IS GENERATED AUTOMATICALLY! DO NOT EDIT!
+
+*/
+
+
+#ifndef INCLUDED_OOXML_RESOURCEIDS_HXX
+#define INCLUDED_OOXML_RESOURCEIDS_HXX
+
+#include resourcemodel/WW8ResourceModel.hxx
+
+namespace writerfilter {
+
+namespace NS_ooxml
+{)
+
+def endDocument(self):
+print(}
+
+
+}
+#endif // INCLUDED_OOXML_RESOURCEIDS_HXX)
+
+def startElement(self, name, attrs):
+for k, v in attrs.items():
+if k in (tokenid, sendtokenid):
+if v.startswith(ooxml:):
+token = v.replace('ooxml:', '')
+if token not in self.tokens:
+print(const Id LN_%s = %s; % (token, 
self.counter))
+self.tokens.append(token)
+self.counter += 1
+
+parser = xml.sax.make_parser()
+parser.setContentHandler(ContentHandler())
+parser.parse(sys.argv[1])
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/writerfilter/source/ooxml/resourceids.xsl 
b/writerfilter/source/ooxml/resourceids.xsl
deleted file mode 100644
index ca5e87a..000
--- a/writerfilter/source/ooxml/resourceids.xsl
+++ /dev/null
@@ -1,93 +0,0 @@
-?xml version=1.0 encoding=utf-8?
-!--
- * 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/.
- 

[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source

2014-06-22 Thread Miklos Vajna
 writerfilter/CustomTarget_source.mk|6 +-
 writerfilter/source/ooxml/factoryinc.py|   50 
 writerfilter/source/ooxml/factoryinc.xsl   |   86 -
 writerfilter/source/ooxml/factorytools.xsl |   14 
 4 files changed, 53 insertions(+), 103 deletions(-)

New commits:
commit 76d9ad4b535aa51efd85e66c727546803e09e456
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sun Jun 22 16:07:51 2014 +0200

writerfilter: convert factoryinc to Python

Change-Id: I23ee4844fcc034f1d586c10d6a16db71a4db5363

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index 55ba50a..a791bfa 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -84,9 +84,9 @@ $(writerfilter_GEN_ooxml_Factory_cxx) : 
$(writerfilter_SRC)/ooxml/factoryimpl.xs
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) $ 
$(writerfilter_GEN_ooxml_Model_processed))  $@
 
-$(writerfilter_GEN_ooxml_Factory_hxx) : 
$(writerfilter_SRC)/ooxml/factoryinc.xsl 
$(writerfilter_GEN_ooxml_Model_processed)
-   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
-   $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) $ 
$(writerfilter_GEN_ooxml_Model_processed))  $@
+$(writerfilter_GEN_ooxml_Factory_hxx) : 
$(writerfilter_SRC)/ooxml/factoryinc.py 
$(writerfilter_GEN_ooxml_Model_processed)
+   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
+   $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) $ 
$(writerfilter_GEN_ooxml_Model_processed))  $@
 
 $(writerfilter_GEN_ooxml_FactoryValues_hxx) : 
$(writerfilter_SRC_ooxml_FactoryValues_xsl) 
$(writerfilter_GEN_ooxml_Model_processed)
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
diff --git a/writerfilter/source/ooxml/factoryinc.py 
b/writerfilter/source/ooxml/factoryinc.py
new file mode 100644
index 000..f29462d
--- /dev/null
+++ b/writerfilter/source/ooxml/factoryinc.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python
+#
+# 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/.
+#
+
+from __future__ import print_function
+from xml.dom import minidom
+import sys
+
+
+def createInclude(model):
+print(
+#ifndef OOXML_FACTORY_GENERATED_HXX
+#define OOXML_FACTORY_GENERATED_HXX
+
+namespace writerfilter {
+namespace ooxml {
+
+/// @cond GENERATED
+)
+
+# Create namespaces.
+counter = 1
+for namespace in sorted([ns.getAttribute(name) for ns in 
model.getElementsByTagName(namespace)]):
+print(const Id NN_%s = %s  16; % (namespace.replace('-', '_'), 
counter))
+counter += 1
+
+# Create defines.
+counter = 1
+defines = []
+for define in sorted([ns.getAttribute(name) for ns in 
model.getElementsByTagName(define)]):
+if define not in defines:
+print(const Id DEFINE_%s = %s; % (define, counter))
+defines.append(define)
+counter += 1
+print(/// @endcond
+}}
+
+#endif // OOXML_FACTORY_GENERATED_HXX)
+
+
+modelPath = sys.argv[1]
+model = minidom.parse(modelPath)
+createInclude(model)
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/writerfilter/source/ooxml/factoryinc.xsl 
b/writerfilter/source/ooxml/factoryinc.xsl
deleted file mode 100644
index a72cffd..000
--- a/writerfilter/source/ooxml/factoryinc.xsl
+++ /dev/null
@@ -1,86 +0,0 @@
-!--
- * 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 .
---
-xsl:stylesheet
-version=1.0
-xmlns:xsl=http://www.w3.org/1999/XSL/Transform; 
-xmlns:office=urn:oasis:names:tc:opendocument:xmlns:office:1.0 
-xmlns:style=urn:oasis:names:tc:opendocument:xmlns:style:1.0 
-xmlns:text=urn:oasis:names:tc:opendocument:xmlns:text:1.0 
-xmlns:table=urn:oasis:names:tc:opendocument:xmlns:table:1.0 
-xmlns:draw=urn:oasis:names:tc:opendocument:xmlns:drawing:1.0 
-

[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source

2014-06-21 Thread Miklos Vajna
 writerfilter/CustomTarget_source.mk   |   19 -
 writerfilter/source/ooxml/modelpreprocess.py  |  183 
 writerfilter/source/ooxml/modelpreprocess.xsl |  213 --
 writerfilter/source/resourcemodel/namespace_preprocess.pl |   68 
 4 files changed, 187 insertions(+), 296 deletions(-)

New commits:
commit 40befea0363918488b9bedbaf693e9c7b3b8e44e
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Sat Jun 21 10:51:49 2014 +0200

writerfilter: convert modelpreprocess to Python

Change-Id: I8c63d8d1bcf4247491e4be22d1e37e1eefe1e7d1

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index 4452c54..55ba50a 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -67,18 +67,16 @@ 
writerfilter_GEN_ooxml_GperfFastToken_hxx=$(writerfilter_WORK)/gperffasttoken.hx
 
writerfilter_GEN_ooxml_Model_processed=$(writerfilter_WORK)/model_preprocessed.xml
 
writerfilter_GEN_ooxml_NamespaceIds_hxx=$(writerfilter_WORK)/ooxml/OOXMLnamespaceids.hxx
 writerfilter_GEN_ooxml_Namespacesmap_xsl=$(writerfilter_WORK)/namespacesmap.xsl
-writerfilter_GEN_ooxml_Preprocess_xsl=$(writerfilter_WORK)/modelpreprocess.xsl
 writerfilter_GEN_ooxml_QNameToStr_cxx=$(writerfilter_WORK)/ooxml/qnametostr.cxx
 
writerfilter_GEN_ooxml_ResourceIds_hxx=$(writerfilter_WORK)/ooxml/resourceids.hxx
 writerfilter_GEN_ooxml_Token_xml=$(writerfilter_WORK)/token.xml
-writerfilter_SRC_model_NamespacePreprocess=$(writerfilter_SRC)/resourcemodel/namespace_preprocess.pl
 
writerfilter_SRC_ooxml_FactoryTools_xsl=$(writerfilter_SRC)/ooxml/factorytools.xsl
 
writerfilter_SRC_ooxml_FactoryValues_xsl=$(writerfilter_SRC)/ooxml/factory_values.xsl
 writerfilter_SRC_ooxml_FastTokens_py=$(writerfilter_SRC)/ooxml/fasttokens.py
 
writerfilter_SRC_ooxml_GperfFastTokenHandler_py=$(writerfilter_SRC)/ooxml/gperffasttokenhandler.py
 writerfilter_SRC_ooxml_Model=$(writerfilter_SRC)/ooxml/model.xml
 
writerfilter_SRC_ooxml_NamespaceIds_xsl=$(writerfilter_SRC)/ooxml/namespaceids.xsl
-writerfilter_SRC_ooxml_Preprocess_xsl=$(writerfilter_SRC)/ooxml/modelpreprocess.xsl
+writerfilter_SRC_ooxml_Preprocess_py=$(writerfilter_SRC)/ooxml/modelpreprocess.py
 writerfilter_SRC_ooxml_QNameToStr_xsl=$(writerfilter_SRC)/ooxml/qnametostr.xsl
 
writerfilter_SRC_ooxml_ResourceIds_xsl=$(writerfilter_SRC)/ooxml/resourceids.xsl
 
@@ -103,23 +101,14 @@ $(writerfilter_GEN_ooxml_GperfFastToken_hxx) : 
$(writerfilter_SRC_ooxml_GperfFas
$(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) 
$(writerfilter_SRC_ooxml_GperfFastTokenHandler_py) 
$(writerfilter_GEN_ooxml_Token_xml)) \
| tr -d '\r' | $(GPERF) -c -E -G -I  -LC++ -S1 -t   $@
 
-$(writerfilter_GEN_ooxml_Model_processed) : 
$(writerfilter_GEN_ooxml_Namespacesmap_xsl) 
$(writerfilter_GEN_ooxml_Preprocess_xsl) $(writerfilter_SRC_ooxml_Model)
-   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
-   $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
$(writerfilter_GEN_ooxml_Namespacesmap_xsl) $(writerfilter_SRC_ooxml_Model))  
$@
+$(writerfilter_GEN_ooxml_Model_processed) : 
$(writerfilter_SRC_ooxml_Preprocess_py) 
$(writerfilter_DEP_ooxml_Namespaces_txt) $(writerfilter_SRC_ooxml_Model) | 
$(writerfilter_WORK)/.dir
+   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
+   $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) 
$(writerfilter_SRC_ooxml_Preprocess_py) 
$(writerfilter_DEP_ooxml_Namespaces_txt) $(writerfilter_SRC_ooxml_Model))  $@
 
 $(writerfilter_GEN_ooxml_NamespaceIds_hxx) : 
$(writerfilter_SRC_ooxml_NamespaceIds_xsl) 
$(writerfilter_GEN_ooxml_Model_processed) | $(writerfilter_WORK)/ooxml/.dir
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
$(writerfilter_SRC_ooxml_NamespaceIds_xsl) 
$(writerfilter_GEN_ooxml_Model_processed))  $@
 
-$(writerfilter_GEN_ooxml_Namespacesmap_xsl) : $(writerfilter_SRC_ooxml_Model) 
$(writerfilter_DEP_ooxml_Namespaces_txt) \
-   $(writerfilter_SRC_model_NamespacePreprocess) | 
$(writerfilter_WORK)/.dir
-   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PRL,1)
-   $(PERL) $(writerfilter_SRC_model_NamespacePreprocess) 
$(writerfilter_DEP_ooxml_Namespaces_txt)  $@
-
-$(writerfilter_GEN_ooxml_Preprocess_xsl) : 
$(writerfilter_SRC_ooxml_Preprocess_xsl) | $(writerfilter_WORK)/.dir
-   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,CPY,1)
-   cp -f $(writerfilter_SRC_ooxml_Preprocess_xsl) $@
-
 $(writerfilter_GEN_ooxml_QNameToStr_cxx): 
$(writerfilter_SRC_ooxml_QNameToStr_xsl) 
$(writerfilter_SRC_ooxml_FactoryTools_xsl) 
$(writerfilter_GEN_ooxml_Model_processed)
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 

[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source

2014-06-12 Thread Miklos Vajna
 writerfilter/CustomTarget_source.mk|6 -
 writerfilter/source/ooxml/analyzemodel.xsl |  121 -
 2 files changed, 127 deletions(-)

New commits:
commit 0e8c06660b3d651900a0f20abd2b1429c854a1c8
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Thu Jun 12 08:50:38 2014 +0200

writerfilter: remove unused analyzemodel.xsl

Change-Id: Ic9e44d0050413c9225b030a4be6f71f5adc654fc

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index e9cc479..4452c54 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -64,7 +64,6 @@ 
writerfilter_GEN_ooxml_Factory_cxx=$(writerfilter_WORK)/OOXMLFactory_generated.c
 
writerfilter_GEN_ooxml_Factory_hxx=$(writerfilter_WORK)/OOXMLFactory_generated.hxx
 
writerfilter_GEN_ooxml_FastTokens_hxx=$(writerfilter_WORK)/ooxml/OOXMLFastTokens.hxx
 
writerfilter_GEN_ooxml_GperfFastToken_hxx=$(writerfilter_WORK)/gperffasttoken.hxx
-writerfilter_GEN_ooxml_Model_analyzed=$(writerfilter_WORK)/ooxml/model_analyzed.xml
 
writerfilter_GEN_ooxml_Model_processed=$(writerfilter_WORK)/model_preprocessed.xml
 
writerfilter_GEN_ooxml_NamespaceIds_hxx=$(writerfilter_WORK)/ooxml/OOXMLnamespaceids.hxx
 writerfilter_GEN_ooxml_Namespacesmap_xsl=$(writerfilter_WORK)/namespacesmap.xsl
@@ -73,7 +72,6 @@ 
writerfilter_GEN_ooxml_QNameToStr_cxx=$(writerfilter_WORK)/ooxml/qnametostr.cxx
 
writerfilter_GEN_ooxml_ResourceIds_hxx=$(writerfilter_WORK)/ooxml/resourceids.hxx
 writerfilter_GEN_ooxml_Token_xml=$(writerfilter_WORK)/token.xml
 
writerfilter_SRC_model_NamespacePreprocess=$(writerfilter_SRC)/resourcemodel/namespace_preprocess.pl
-writerfilter_SRC_ooxml_Analyze_model_xsl=$(writerfilter_SRC)/ooxml/analyzemodel.xsl
 
writerfilter_SRC_ooxml_FactoryTools_xsl=$(writerfilter_SRC)/ooxml/factorytools.xsl
 
writerfilter_SRC_ooxml_FactoryValues_xsl=$(writerfilter_SRC)/ooxml/factory_values.xsl
 writerfilter_SRC_ooxml_FastTokens_py=$(writerfilter_SRC)/ooxml/fasttokens.py
@@ -105,10 +103,6 @@ $(writerfilter_GEN_ooxml_GperfFastToken_hxx) : 
$(writerfilter_SRC_ooxml_GperfFas
$(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) 
$(writerfilter_SRC_ooxml_GperfFastTokenHandler_py) 
$(writerfilter_GEN_ooxml_Token_xml)) \
| tr -d '\r' | $(GPERF) -c -E -G -I  -LC++ -S1 -t   $@
 
-$(writerfilter_GEN_ooxml_Model_analyzed) : 
$(writerfilter_SRC_ooxml_Analyze_model_xsl) $(writerfilter_SRC_ooxml_Model) | 
$(writerfilter_WORK)/ooxml/.dir
-   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
-   $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) $^)  $@
-
 $(writerfilter_GEN_ooxml_Model_processed) : 
$(writerfilter_GEN_ooxml_Namespacesmap_xsl) 
$(writerfilter_GEN_ooxml_Preprocess_xsl) $(writerfilter_SRC_ooxml_Model)
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
$(writerfilter_GEN_ooxml_Namespacesmap_xsl) $(writerfilter_SRC_ooxml_Model))  
$@
diff --git a/writerfilter/source/ooxml/analyzemodel.xsl 
b/writerfilter/source/ooxml/analyzemodel.xsl
deleted file mode 100644
index 63ad772..000
--- a/writerfilter/source/ooxml/analyzemodel.xsl
+++ /dev/null
@@ -1,121 +0,0 @@
-?xml version=1.0 encoding=UTF-8?
-!--
- * 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 .
---
-
-xsl:stylesheet version=1.0
-   xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
-   xmlns:rng=http://relaxng.org/ns/structure/1.0;
-
-xsl:include href=factorytools.xsl/
-xsl:output method=xml/
-
-xsl:template match=/
-   analyze
-   xsl:for-each select=/model/namespace[not(@todo='ignore')]
-   xsl:call-template name=analyzegrammar/
-   /xsl:for-each
-   /analyze
-/xsl:template
-
-xsl:template name=analyzegrammar
-   xsl:variable name=nsname select=@name/
-   xsl:for-each select=rng:grammar/rng:define
-   xsl:variable name=defname select=@name/
-   xsl:for-each select=.//rng:attribute|.//rng:element
-   xsl:choose
-   xsl:when test=local-name()='element'

-

[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source

2014-06-11 Thread Miklos Vajna
 writerfilter/CustomTarget_source.mk |6 -
 writerfilter/source/ooxml/gperffasttokenhandler.py  |   50 
 writerfilter/source/ooxml/gperffasttokenhandler.xsl |   83 
 3 files changed, 53 insertions(+), 86 deletions(-)

New commits:
commit dd5dfc8e2a0fc3c0307c0a782ae563b79ba8a84e
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Jun 11 09:06:23 2014 +0200

writerfilter: convert gperffasttokenhandler to Python

Change-Id: I56ae09cb89da7d078f64906e15677de58296c119

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index c4ad0a4..e9cc479 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -77,7 +77,7 @@ 
writerfilter_SRC_ooxml_Analyze_model_xsl=$(writerfilter_SRC)/ooxml/analyzemodel.
 
writerfilter_SRC_ooxml_FactoryTools_xsl=$(writerfilter_SRC)/ooxml/factorytools.xsl
 
writerfilter_SRC_ooxml_FactoryValues_xsl=$(writerfilter_SRC)/ooxml/factory_values.xsl
 writerfilter_SRC_ooxml_FastTokens_py=$(writerfilter_SRC)/ooxml/fasttokens.py
-writerfilter_SRC_ooxml_GperfFastTokenHandler_xsl=$(writerfilter_SRC)/ooxml/gperffasttokenhandler.xsl
+writerfilter_SRC_ooxml_GperfFastTokenHandler_py=$(writerfilter_SRC)/ooxml/gperffasttokenhandler.py
 writerfilter_SRC_ooxml_Model=$(writerfilter_SRC)/ooxml/model.xml
 
writerfilter_SRC_ooxml_NamespaceIds_xsl=$(writerfilter_SRC)/ooxml/namespaceids.xsl
 
writerfilter_SRC_ooxml_Preprocess_xsl=$(writerfilter_SRC)/ooxml/modelpreprocess.xsl
@@ -100,9 +100,9 @@ $(writerfilter_GEN_ooxml_FastTokens_hxx) : 
$(writerfilter_SRC_ooxml_FastTokens_p
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) 
$(writerfilter_SRC_ooxml_FastTokens_py) $(writerfilter_GEN_ooxml_Token_xml))  
$@
 
-$(writerfilter_GEN_ooxml_GperfFastToken_hxx) : 
$(writerfilter_SRC_ooxml_GperfFastTokenHandler_xsl) 
$(writerfilter_GEN_ooxml_Token_xml)
+$(writerfilter_GEN_ooxml_GperfFastToken_hxx) : 
$(writerfilter_SRC_ooxml_GperfFastTokenHandler_py) 
$(writerfilter_GEN_ooxml_Token_xml)
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,GPF,1)
-   $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
$(writerfilter_SRC_ooxml_GperfFastTokenHandler_xsl) 
$(writerfilter_GEN_ooxml_Token_xml)) \
+   $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) 
$(writerfilter_SRC_ooxml_GperfFastTokenHandler_py) 
$(writerfilter_GEN_ooxml_Token_xml)) \
| tr -d '\r' | $(GPERF) -c -E -G -I  -LC++ -S1 -t   $@
 
 $(writerfilter_GEN_ooxml_Model_analyzed) : 
$(writerfilter_SRC_ooxml_Analyze_model_xsl) $(writerfilter_SRC_ooxml_Model) | 
$(writerfilter_WORK)/ooxml/.dir
diff --git a/writerfilter/source/ooxml/gperffasttokenhandler.py 
b/writerfilter/source/ooxml/gperffasttokenhandler.py
new file mode 100644
index 000..103a944
--- /dev/null
+++ b/writerfilter/source/ooxml/gperffasttokenhandler.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python
+#
+# 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/.
+#
+
+from __future__ import print_function
+import xml.sax
+import sys
+
+
+class ContentHandler(xml.sax.handler.ContentHandler):
+def __init__(self):
+self.inFasttoken = False
+
+def startElement(self, name, attrs):
+if name == fasttoken:
+self.inFasttoken = True
+
+def endElement(self, name):
+if name == fasttoken:
+self.inFasttoken = False
+
+def characters(self, characters):
+if self.inFasttoken:
+token = characters.replace('-', '_')
+print(%s, OOXML_%s % (token, token))
+
+print(
+%{
+#include ooxml/OOXMLFastTokens.hxx
+
+namespace writerfilter { namespace ooxml { namespace tokenmap {
+%}
+struct token { const char * name; Token_t nToken; };
+%%)
+
+parser = xml.sax.make_parser()
+parser.setContentHandler(ContentHandler())
+parser.parse(sys.argv[1])
+
+print(FAST_TOKENS_END, OOXML_FAST_TOKENS_END
+%%
+
+}}})
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/writerfilter/source/ooxml/gperffasttokenhandler.xsl 
b/writerfilter/source/ooxml/gperffasttokenhandler.xsl
deleted file mode 100644
index 15a36ec..000
--- a/writerfilter/source/ooxml/gperffasttokenhandler.xsl
+++ /dev/null
@@ -1,83 +0,0 @@
-!--
- * 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 

[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source

2014-06-10 Thread Miklos Vajna
 writerfilter/CustomTarget_source.mk  |   11 +--
 writerfilter/source/ooxml/fasttokens.py  |   74 ++
 writerfilter/source/ooxml/fasttokens.xsl |  103 ---
 3 files changed, 80 insertions(+), 108 deletions(-)

New commits:
commit f3160a7effe70f10c669b085c840bfc77b8ef671
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Tue Jun 10 09:08:50 2014 +0200

writerfilter: convert fasttokens to Python

It's shorter and f9bf15e19ec823a58ee32bf94da81f3bb1a147bc (writerfilter:
initial strict DOCX support, 2014-03-07) shows it's a pain to do anything
non-trivial with XSLT 1.0 -- in that case black magic was needed to do a 
simple
unique sort.

Change-Id: Icf4e7b580ce1db6826989500dbf4a012d79acdb9

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index 98da398..c4ad0a4 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -13,6 +13,7 @@ writerfilter_WORK := $(call 
gb_CustomTarget_get_workdir,writerfilter/source)
 writerfilter_SRC := $(SRCDIR)/writerfilter/source
 
 writerfilter_XSLTCOMMAND := $(call gb_ExternalExecutable_get_command,xsltproc)
+writerfilter_PYTHONCOMMAND := $(call gb_ExternalExecutable_get_command,python)
 
 writerfilter_OOXMLNAMESPACES= \
dml-baseStylesheet \
@@ -75,7 +76,7 @@ 
writerfilter_SRC_model_NamespacePreprocess=$(writerfilter_SRC)/resourcemodel/nam
 
writerfilter_SRC_ooxml_Analyze_model_xsl=$(writerfilter_SRC)/ooxml/analyzemodel.xsl
 
writerfilter_SRC_ooxml_FactoryTools_xsl=$(writerfilter_SRC)/ooxml/factorytools.xsl
 
writerfilter_SRC_ooxml_FactoryValues_xsl=$(writerfilter_SRC)/ooxml/factory_values.xsl
-writerfilter_SRC_ooxml_FastTokens_xsl=$(writerfilter_SRC)/ooxml/fasttokens.xsl
+writerfilter_SRC_ooxml_FastTokens_py=$(writerfilter_SRC)/ooxml/fasttokens.py
 
writerfilter_SRC_ooxml_GperfFastTokenHandler_xsl=$(writerfilter_SRC)/ooxml/gperffasttokenhandler.xsl
 writerfilter_SRC_ooxml_Model=$(writerfilter_SRC)/ooxml/model.xml
 
writerfilter_SRC_ooxml_NamespaceIds_xsl=$(writerfilter_SRC)/ooxml/namespaceids.xsl
@@ -95,9 +96,9 @@ $(writerfilter_GEN_ooxml_FactoryValues_hxx) : 
$(writerfilter_SRC_ooxml_FactoryVa
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
$(writerfilter_SRC_ooxml_FactoryValues_xsl) 
$(writerfilter_GEN_ooxml_Model_processed))  $@
 
-$(writerfilter_GEN_ooxml_FastTokens_hxx) : 
$(writerfilter_SRC_ooxml_FastTokens_xsl) $(writerfilter_GEN_ooxml_Token_xml) | 
$(writerfilter_WORK)/ooxml/.dir
-   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
-   $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
$(writerfilter_SRC_ooxml_FastTokens_xsl) $(writerfilter_GEN_ooxml_Token_xml))  
$@
+$(writerfilter_GEN_ooxml_FastTokens_hxx) : 
$(writerfilter_SRC_ooxml_FastTokens_py) $(writerfilter_GEN_ooxml_Token_xml) | 
$(writerfilter_WORK)/ooxml/.dir
+   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1)
+   $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) 
$(writerfilter_SRC_ooxml_FastTokens_py) $(writerfilter_GEN_ooxml_Token_xml))  
$@
 
 $(writerfilter_GEN_ooxml_GperfFastToken_hxx) : 
$(writerfilter_SRC_ooxml_GperfFastTokenHandler_xsl) 
$(writerfilter_GEN_ooxml_Token_xml)
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,GPF,1)
@@ -149,6 +150,6 @@ $(writerfilter_WORK)/OOXMLFactory%.hxx : 
$(writerfilter_SRC)/ooxml/factory_ns.xs
 
 $(call gb_CustomTarget_get_target,writerfilter/source) : $(writerfilter_ALL)
 
-$(writerfilter_ALL) :| $(call gb_ExternalExecutable_get_dependencies,xsltproc) 
$(writerfilter_WORK)/.dir
+$(writerfilter_ALL) :| $(call gb_ExternalExecutable_get_dependencies,xsltproc) 
$(call gb_ExternalExecutable_get_dependencies,python) $(writerfilter_WORK)/.dir
 
 # vim: set noet sw=4 ts=4:
diff --git a/writerfilter/source/ooxml/fasttokens.py 
b/writerfilter/source/ooxml/fasttokens.py
new file mode 100644
index 000..c8c2ca0
--- /dev/null
+++ b/writerfilter/source/ooxml/fasttokens.py
@@ -0,0 +1,74 @@
+#!/usr/bin/env python
+#
+# 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/.
+#
+
+from __future__ import print_function
+import xml.sax
+import sys
+
+
+class ContentHandler(xml.sax.handler.ContentHandler):
+def __init__(self):
+self.inFasttoken = False
+self.counter = 0
+
+def startElement(self, name, attrs):
+if name == fasttoken:
+self.inFasttoken = True
+
+def endElement(self, name):
+if name == fasttoken:
+self.inFasttoken = False
+
+def characters(self, characters):
+if self.inFasttoken:
+print(const Token_t OOXML_%s = %s; % (characters.replace('-', 

[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source

2014-06-05 Thread Jan Holesovsky
 writerfilter/CustomTarget_source.mk |9 ++---
 writerfilter/source/ooxml/tokens-to-xml.sed |   19 +++
 writerfilter/source/ooxml/tokenxmlfooter|1 -
 writerfilter/source/ooxml/tokenxmlheader|1 -
 4 files changed, 21 insertions(+), 9 deletions(-)

New commits:
commit d595e5ec4e092344460f53d287b970c147913e99
Author: Jan Holesovsky ke...@collabora.com
Date:   Thu Jun 5 08:56:48 2014 +0200

writerfilter: Avoid a temporary file, sed can handle this by itself.

Change-Id: I7fde1b44809b1886730145f16878e0f1045b2555

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index 249ebca..98da398 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -70,7 +70,6 @@ 
writerfilter_GEN_ooxml_Namespacesmap_xsl=$(writerfilter_WORK)/namespacesmap.xsl
 writerfilter_GEN_ooxml_Preprocess_xsl=$(writerfilter_WORK)/modelpreprocess.xsl
 writerfilter_GEN_ooxml_QNameToStr_cxx=$(writerfilter_WORK)/ooxml/qnametostr.cxx
 
writerfilter_GEN_ooxml_ResourceIds_hxx=$(writerfilter_WORK)/ooxml/resourceids.hxx
-writerfilter_GEN_ooxml_Token_tmp=$(writerfilter_WORK)/token.tmp
 writerfilter_GEN_ooxml_Token_xml=$(writerfilter_WORK)/token.xml
 
writerfilter_SRC_model_NamespacePreprocess=$(writerfilter_SRC)/resourcemodel/namespace_preprocess.pl
 
writerfilter_SRC_ooxml_Analyze_model_xsl=$(writerfilter_SRC)/ooxml/analyzemodel.xsl
@@ -134,15 +133,11 @@ $(writerfilter_GEN_ooxml_ResourceIds_hxx) : 
$(writerfilter_SRC_ooxml_ResourceIds
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
$(writerfilter_SRC_ooxml_ResourceIds_xsl) 
$(writerfilter_GEN_ooxml_Model_processed))  $@
 
-$(writerfilter_GEN_ooxml_Token_tmp) : $(SRCDIR)/oox/source/token/tokens.txt | 
$(writerfilter_WORK)/.dir
+$(writerfilter_GEN_ooxml_Token_xml) : $(SRCDIR)/oox/source/token/tokens.txt 
$(writerfilter_SRC)/ooxml/tokens-to-xml.sed | $(writerfilter_WORK)/.dir
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,CAT,1)
-   sed s/\(.*\)/fasttoken\1\/fasttoken/ \
+   sed -f $(writerfilter_SRC)/ooxml/tokens-to-xml.sed \
 $(SRCDIR)/oox/source/token/tokens.txt  $@
 
-$(writerfilter_GEN_ooxml_Token_xml) : $(writerfilter_SRC)/ooxml/tokenxmlheader 
$(writerfilter_GEN_ooxml_Token_tmp) $(writerfilter_SRC)/ooxml/tokenxmlfooter
-   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,CAT,1)
-   cat $(writerfilter_SRC)/ooxml/tokenxmlheader 
$(writerfilter_GEN_ooxml_Token_tmp) $(writerfilter_SRC)/ooxml/tokenxmlfooter  
$@
-
 $(writerfilter_WORK)/OOXMLFactory%.cxx : 
$(writerfilter_SRC)/ooxml/factoryimpl_ns.xsl 
$(writerfilter_GEN_ooxml_Model_processed)
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
--stringparam file $@ $ $(writerfilter_GEN_ooxml_Model_processed))  $@
diff --git a/writerfilter/source/ooxml/tokens-to-xml.sed 
b/writerfilter/source/ooxml/tokens-to-xml.sed
new file mode 100755
index 000..a45bc6a
--- /dev/null
+++ b/writerfilter/source/ooxml/tokens-to-xml.sed
@@ -0,0 +1,19 @@
+#! /usr/bin/sed -f
+#
+# 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/.
+#
+
+# first line - insert model
+1,1i\
+model
+
+# last line - append /model
+$,$a\
+/model
+
+# everywhere - replace the input line with fasttoken.../fasttoken
+s/\(.*\)/fasttoken\1\/fasttoken/
diff --git a/writerfilter/source/ooxml/tokenxmlfooter 
b/writerfilter/source/ooxml/tokenxmlfooter
deleted file mode 100644
index 6f66407..000
--- a/writerfilter/source/ooxml/tokenxmlfooter
+++ /dev/null
@@ -1 +0,0 @@
-/model
diff --git a/writerfilter/source/ooxml/tokenxmlheader 
b/writerfilter/source/ooxml/tokenxmlheader
deleted file mode 100644
index 25a9243..000
--- a/writerfilter/source/ooxml/tokenxmlheader
+++ /dev/null
@@ -1 +0,0 @@
-model
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source

2014-01-27 Thread Miklos Vajna
 writerfilter/CustomTarget_source.mk |1 
 writerfilter/source/ooxml/model.xml |   40 ++--
 2 files changed, 39 insertions(+), 2 deletions(-)

New commits:
commit d04b688afee5306677f0c6e998428bd744881e67
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Mon Jan 27 14:14:52 2014 +0100

writerfilter: initial wp14 support

This is just the tokenizer part, though all the heavy-lifing in
model.xml should be now done.

Change-Id: Idb65f3c73a077f7fd0ffd74d7101954b9433f98e

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index 367928e..61744c7 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -39,6 +39,7 @@ writerfilter_OOXMLNAMESPACES= \
vml-officeDrawing \
vml-wordprocessingDrawing \
mce \
+   wp14 \
wml
 
 writerfilter_ALL = \
diff --git a/writerfilter/source/ooxml/model.xml 
b/writerfilter/source/ooxml/model.xml
index 1b844df..9f15587 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -35,6 +35,7 @@
   namespace-alias 
name=http://schemas.openxmlformats.org/officeDocument/2006/math; alias=math 
id=officeMath/
   namespace-alias 
name=http://schemas.openxmlformats.org/schemaLibrary/2006/main; 
alias=schemaLibrary id=schema/
   namespace-alias 
name=http://schemas.openxmlformats.org/markup-compatibility/2006; alias=mce 
id=mce/
+  namespace-alias 
name=http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing; 
alias=wp14 id=wp14/
   namespace-alias name=http://sprm; alias=sprm id=sprm/
   token tokenid=ooxml:shape/
   token tokenid=ooxml:token/
@@ -5228,6 +5229,35 @@
   element name=graphic tokenid=ooxml:graphic_graphic/
 /resource
   /namespace
+  namespace name=wp14 file=wp14.rng
+start name=sizeRelH/
+grammar xmlns=http://relaxng.org/ns/structure/1.0; 
ns=http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing; 
datatypeLibrary=http://www.w3.org/2001/XMLSchema-datatypes;
+  define name=ST_SizeRelFromH
+choice
+  valuemargin/value
+/choice
+  /define
+  define name=CT_SizeRelH
+attribute name=relativeFrom
+  ref name=ST_SizeRelFromH/
+/attribute
+  /define
+  define name=sizeRelH
+element name=sizeRelH
+  ref name=CT_SizeRelH/
+/element
+  /define
+/grammar
+  resource name=ST_SizeRelFromH resource=List generated=yes
+value name=margin 
tokenid=ooxml:ST_SizeRelFromH_marginmargin/value
+  /resource
+  resource name=CT_SizeRelH resource=Properties tag=shape
+attribute name=relativeFrom 
tokenid=ooxml:CT_SizeRelH_relativeFrom/
+  /resource
+  resource name=sizeRelH resource=Properties tag=shape
+element name=sizeRelH tokenid=ooxml:sizeRelH_sizeRelH/
+  /resource
+  /namespace
   namespace name=dml-shapeGeometry file=dml-shapeGeometry.rng 
todo=ignore
 grammar xmlns:xsd=http://www.w3.org/2001/XMLSchema; 
xmlns:xs=http://www.w3.org/2001/XMLSchema; 
xmlns:fn=http://www.w3.org/2006/xpath-functions; 
xmlns=http://relaxng.org/ns/structure/1.0; 
ns=http://schemas.openxmlformats.org/drawingml/2006/main; 
datatypeLibrary=http://www.w3.org/2001/XMLSchema-datatypes;
   !-- ISO RELAX NG Schema --
@@ -6360,7 +6390,7 @@
   namespace name=dml-wordprocessingDrawing 
file=dml-wordprocessingDrawing.rng
 start name=inline/
 start name=anchor/
-grammar xmlns:a=http://schemas.openxmlformats.org/drawingml/2006/main; 
xmlns:xsd=http://www.w3.org/2001/XMLSchema; 
xmlns:xs=http://www.w3.org/2001/XMLSchema; 
xmlns:fn=http://www.w3.org/2006/xpath-functions; 
xmlns=http://relaxng.org/ns/structure/1.0; 
ns=http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing; 
datatypeLibrary=http://www.w3.org/2001/XMLSchema-datatypes;
+grammar xmlns:a=http://schemas.openxmlformats.org/drawingml/2006/main; 
xmlns:wp14=http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing;
 xmlns:xsd=http://www.w3.org/2001/XMLSchema; 
xmlns:xs=http://www.w3.org/2001/XMLSchema; 
xmlns:fn=http://www.w3.org/2006/xpath-functions; 
xmlns=http://relaxng.org/ns/structure/1.0; 
ns=http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing; 
datatypeLibrary=http://www.w3.org/2001/XMLSchema-datatypes;
   !-- ISO RELAX NG Schema --
   include href=dml-graphicalObject.rng/
   include href=dml-documentProperties.rng/
@@ -6732,6 +6762,11 @@
   element name=a:graphic
 ref name=BUILT_IN_ANY_TYPE/
   /element
+  optional
+element name=wp14:sizeRelH
+  ref name=BUILT_IN_ANY_TYPE/
+/element
+  /optional
 /group
 optional
   attribute name=distT
@@ -6914,7 +6949,7 @@
   element name=posOffset tokenid=ooxml:CT_PosV_posOffset/
   attribute name=relativeFrom tokenid=ooxml:CT_PosV_relativeFrom/
 

[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source

2013-12-11 Thread Miklos Vajna
 writerfilter/CustomTarget_source.mk  |7 
 writerfilter/source/doctok/resources.xsl |  464 ---
 writerfilter/source/doctok/resourcesimpl.xsl |2 
 3 files changed, 1 insertion(+), 472 deletions(-)

New commits:
commit bbb9f4f74724213d62154bb17876953064cd2d62
Author: Miklos Vajna vmik...@collabora.co.uk
Date:   Wed Dec 11 20:51:26 2013 +0100

writerfilter: remove unused resources.xsl

Change-Id: Id9bb0ae05395fe635aec1a42e8b3c0995cf81463

diff --git a/writerfilter/CustomTarget_source.mk 
b/writerfilter/CustomTarget_source.mk
index 01be99b..57b2b57 100644
--- a/writerfilter/CustomTarget_source.mk
+++ b/writerfilter/CustomTarget_source.mk
@@ -44,7 +44,6 @@ writerfilter_OOXMLNAMESPACES= \
 writerfilter_ALL = \
$(writerfilter_GEN_doctok_ResourceIds_hxx) \
$(writerfilter_GEN_doctok_Resources_cxx) \
-   $(writerfilter_GEN_doctok_Resources_hxx) \
$(writerfilter_GEN_doctok_QNameToStr_cxx) \
$(writerfilter_GEN_doctok_SprmIds_hxx) \
$(writerfilter_GEN_model_SprmCodeToStr_cxx) \
@@ -65,7 +64,6 @@ writerfilter_ALL = \
 writerfilter_DEP_ooxml_Namespaces_txt=$(call 
gb_CustomTarget_get_workdir,oox/generated)/misc/namespaces.txt
 
writerfilter_GEN_doctok_ResourceIds_hxx=$(writerfilter_WORK)/doctok/resourceids.hxx
 writerfilter_GEN_doctok_Resources_cxx=$(writerfilter_WORK)/resources.cxx
-writerfilter_GEN_doctok_Resources_hxx=$(writerfilter_WORK)/doctok/resources.hxx
 
writerfilter_GEN_doctok_QNameToStr_cxx=$(writerfilter_WORK)/doctok/qnametostr.cxx
 writerfilter_GEN_doctok_SprmIds_hxx=$(writerfilter_WORK)/doctok/sprmids.hxx
 writerfilter_GEN_model_SprmCodeToStr_cxx=$(writerfilter_WORK)/sprmcodetostr.cxx
@@ -90,7 +88,6 @@ 
writerfilter_SRC_doctok_QNameToStr_xsl=$(writerfilter_SRC)/doctok/qnametostr.xsl
 
writerfilter_SRC_doctok_ResourceIds_xsl=$(writerfilter_SRC)/doctok/resourceids.xsl
 
writerfilter_SRC_doctok_ResourceTools_xsl=$(writerfilter_SRC)/doctok/resourcetools.xsl
 
writerfilter_SRC_doctok_ResourcesImpl_xsl=$(writerfilter_SRC)/doctok/resourcesimpl.xsl
-writerfilter_SRC_doctok_Resources_xsl=$(writerfilter_SRC)/doctok/resources.xsl
 
writerfilter_SRC_doctok_SprmCodeToStr_xsl=$(writerfilter_SRC)/doctok/sprmcodetostr.xsl
 writerfilter_SRC_doctok_SprmIds_xsl=$(writerfilter_SRC)/doctok/sprmids.xsl
 
writerfilter_SRC_model_NamespacePreprocess=$(writerfilter_SRC)/resourcemodel/namespace_preprocess.pl
@@ -118,10 +115,6 @@ $(writerfilter_GEN_doctok_Resources_cxx) : 
$(writerfilter_SRC_doctok_Model) $(wr
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
$(writerfilter_SRC_doctok_ResourcesImpl_xsl) $(writerfilter_SRC_doctok_Model)) 
 $@
 
-$(writerfilter_GEN_doctok_Resources_hxx) : $(writerfilter_SRC_doctok_Model) 
$(writerfilter_SRC_doctok_Resources_xsl) | $(writerfilter_WORK)/doctok/.dir
-   $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
-   $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
$(writerfilter_SRC_doctok_Resources_xsl) $(writerfilter_SRC_doctok_Model))  $@
-
 $(writerfilter_GEN_doctok_SprmIds_hxx) : $(writerfilter_SRC_doctok_Model) 
$(writerfilter_SRC_doctok_SprmIds_xsl) | $(writerfilter_WORK)/doctok/.dir
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1)
$(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) 
$(writerfilter_SRC_doctok_SprmIds_xsl) $(writerfilter_SRC_doctok_Model))  $@
diff --git a/writerfilter/source/doctok/resources.xsl 
b/writerfilter/source/doctok/resources.xsl
deleted file mode 100644
index a5cdadc..000
--- a/writerfilter/source/doctok/resources.xsl
+++ /dev/null
@@ -1,464 +0,0 @@
-!--
- * 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 .
---
-xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; 
xmlns:office=urn:oasis:names:tc:opendocument:xmlns:office:1.0 
xmlns:style=urn:oasis:names:tc:opendocument:xmlns:style:1.0 
xmlns:text=urn:oasis:names:tc:opendocument:xmlns:text:1.0 
xmlns:table=urn:oasis:names:tc:opendocument:xmlns:table:1.0 
xmlns:draw=urn:oasis:names:tc:opendocument:xmlns:drawing:1.0