diff options
author | Mohammed Abdul Azeem <azeemmysore@gmail.com> | 2017-03-18 23:24:26 +0530 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2017-03-21 11:36:06 +0000 |
commit | 0a0f205775807d63e7f6dd910de368bb12b11a49 (patch) | |
tree | 7ca7c6eea86d2bcf5e1cbb21b8b1f440a63a39e7 /xmloff/source | |
parent | 4e26af2df9d26aba83f61ba7ea0fbe876d4ed288 (diff) |
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@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'xmloff/source')
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 14 | ||||
-rw-r--r-- | xmloff/source/core/xmltoken.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/token/tokens.txt | 2 |
3 files changed, 18 insertions, 0 deletions
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 |