From 0a0f205775807d63e7f6dd910de368bb12b11a49 Mon Sep 17 00:00:00 2001 From: Mohammed Abdul Azeem Date: Sat, 18 Mar 2017 23:24:26 +0530 Subject: 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 Tested-by: Michael Meeks --- xmloff/source/core/xmlimp.cxx | 14 ++++++++++++++ xmloff/source/core/xmltoken.cxx | 2 ++ xmloff/source/token/tokens.txt | 2 ++ 3 files changed, 18 insertions(+) (limited to 'xmloff') 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 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 -- cgit