[Libreoffice-commits] core.git: include/xmloff xmloff/source
Mohammed Abdul Azeem
azeemmysore at gmail.com
Tue Mar 21 11:36:29 UTC 2017
include/xmloff/xmltoken.hxx | 2 ++
xmloff/source/core/xmlimp.cxx | 14 ++++++++++++++
xmloff/source/core/xmltoken.cxx | 2 ++
xmloff/source/token/tokens.txt | 2 ++
4 files changed, 20 insertions(+)
New commits:
commit 0a0f205775807d63e7f6dd910de368bb12b11a49
Author: Mohammed Abdul Azeem <azeemmysore at gmail.com>
Date: Sat Mar 18 23:24:26 2017 +0530
tdf#105686 - fixed wrongly imported named expressions:
It is necessary to extract and set ODF version for fast
events also.
While debugging I found a couple of tokens which were
not in the list, and added them (not needed for bug fix).
Change-Id: I7aaab99688a067ee2fd2c9814deec1a359a758ab
Reviewed-on: https://gerrit.libreoffice.org/35410
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 70b57d1b0f8d..4430d298d63b 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -245,6 +245,7 @@ namespace xmloff { namespace token {
XML_APPLICATION_DATA,
XML_APPLICATION_XML,
XML_APPLY,
+ XML_APPLY_DESIGN_MODE,
XML_APPLY_STYLE_NAME,
XML_AQUA,
XML_ARC,
@@ -275,6 +276,7 @@ namespace xmloff { namespace token {
XML_AUTO_UPDATE,
XML_AUTOMATIC,
XML_AUTOMATIC_FIND_LABELS,
+ XML_AUTOMATIC_FOCUS,
XML_AUTOMATIC_ORDER,
XML_AUTOMATIC_STYLES,
XML_AUTOMATIC_UPDATE,
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 36de2638a874..c213c05b053a 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -783,6 +783,20 @@ void SAL_CALL SvXMLImport::setDocumentLocator( const uno::Reference< xml::sax::X
void SAL_CALL SvXMLImport::startFastElement (sal_Int32 Element,
const uno::Reference< xml::sax::XFastAttributeList > & Attribs)
{
+ if ( Attribs.is() && Attribs->hasAttribute( NAMESPACE_TOKEN( XML_NAMESPACE_OFFICE ) | XML_VERSION ) )
+ {
+ mpImpl->aODFVersion = Attribs->getValue( NAMESPACE_TOKEN( XML_NAMESPACE_OFFICE ) | XML_VERSION );
+
+ // the ODF version in content.xml and manifest.xml must be the same starting from ODF1.2
+ if ( mpImpl->mStreamName == "content.xml" && !IsODFVersionConsistent( mpImpl->aODFVersion ) )
+ {
+ throw xml::sax::SAXException("Inconsistent ODF versions in content.xml and manifest.xml!",
+ uno::Reference< uno::XInterface >(),
+ uno::makeAny(
+ packages::zip::ZipIOException("Inconsistent ODF versions in content.xml and manifest.xml!" ) ) );
+ }
+ }
+
//Namespace handling is unnecessary. It is done by the fastparser itself.
uno::Reference<XFastContextHandler> xContext;
if (!maFastContexts.empty())
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 813c864ca264..5ee0ce8dfa84 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -247,6 +247,7 @@ namespace xmloff { namespace token {
TOKEN( "application-data", XML_APPLICATION_DATA ),
TOKEN( "application-xml", XML_APPLICATION_XML ),
TOKEN( "apply", XML_APPLY ),
+ TOKEN( "apply-design-mode", XML_APPLY_DESIGN_MODE ),
TOKEN( "apply-style-name", XML_APPLY_STYLE_NAME ),
TOKEN( "aqua", XML_AQUA ),
TOKEN( "arc", XML_ARC ),
@@ -277,6 +278,7 @@ namespace xmloff { namespace token {
TOKEN( "auto-update", XML_AUTO_UPDATE ),
TOKEN( "automatic", XML_AUTOMATIC ),
TOKEN( "automatic-find-labels", XML_AUTOMATIC_FIND_LABELS ),
+ TOKEN( "automatic-focus", XML_AUTOMATIC_FOCUS ),
TOKEN( "automatic-order", XML_AUTOMATIC_ORDER ),
TOKEN( "automatic-styles", XML_AUTOMATIC_STYLES ),
TOKEN( "automatic-update", XML_AUTOMATIC_UPDATE ),
diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt
index 3c9d08360b12..e8878d8ec6c1 100644
--- a/xmloff/source/token/tokens.txt
+++ b/xmloff/source/token/tokens.txt
@@ -169,6 +169,7 @@ applet-name
application-data
application-xml
apply
+apply-design-mode
apply-style-name
aqua
arc
@@ -199,6 +200,7 @@ auto-text-indent
auto-update
automatic
automatic-find-labels
+automatic-focus
automatic-order
automatic-styles
automatic-update
More information about the Libreoffice-commits
mailing list