[Libreoffice-commits] core.git: 5 commits - oox/CustomTarget_generated.mk oox/source sax/source sc/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Sun Mar 2 08:56:53 PST 2014


 oox/CustomTarget_generated.mk                  |    7 +-
 oox/source/docprop/ooxmldocpropimport.cxx      |    9 +++
 oox/source/ppt/dgmimport.cxx                   |    2 
 oox/source/ppt/pptimport.cxx                   |    4 -
 oox/source/ppt/presentationfragmenthandler.cxx |   10 +--
 oox/source/ppt/slidefragmenthandler.cxx        |    4 -
 oox/source/shape/ShapeContextHandler.cxx       |    2 
 oox/source/token/namespacemap.cxx              |    2 
 oox/source/token/namespaces-strict.hxx.head    |   27 ---------
 oox/source/token/namespaces-strict.hxx.tail    |   62 ----------------------
 oox/source/token/namespaces-strict.pl          |   70 -------------------------
 oox/source/token/namespaces.pl                 |   30 ++++++++++
 sax/source/fastparser/fastparser.cxx           |   31 -----------
 sc/source/filter/oox/externallinkbuffer.cxx    |    8 +-
 14 files changed, 56 insertions(+), 212 deletions(-)

New commits:
commit 09f27e518bdec21774ff62d7c59ed782bc5c20b1
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sun Mar 2 17:50:15 2014 +0100

    fix strict namespace list generation
    
    The two perl scripts were apparently only generating the same order by
    luck. It did not work on all systems.
    
    Change-Id: Ib83ee5c6572d3bae2e2ac1846850bd65303e7d43

diff --git a/oox/CustomTarget_generated.mk b/oox/CustomTarget_generated.mk
index 89ac97d..14789d6 100644
--- a/oox/CustomTarget_generated.mk
+++ b/oox/CustomTarget_generated.mk
@@ -27,7 +27,7 @@ $(oox_INC)/tokenhash.inc : $(oox_MISC)/tokenhash.gperf
 	$(GPERF) --compare-strncmp $< | sed -e 's/(char\*)0/(char\*)0, 0/g' | grep -v '^#line' > $@
 
 define oox_GenTarget
-$(oox_MISC)/$(2)ids.inc $(oox_INC)/$(2)names.inc $(if $(3),$(oox_MISC)/$(3)) : \
+$(oox_MISC)/$(2)ids.inc $(oox_INC)/$(2)names.inc $(if $(3),$(oox_MISC)/$(3)) $(if $(4),$(oox_INC)/$(4)names.inc) : \
 		$(oox_GENHEADERPATH)/$(1).hxx
 	@touch $$@
 
@@ -37,13 +37,13 @@ $(oox_GENHEADERPATH)/$(1).hxx : $(oox_SRC)/$(1).pl $(oox_SRC)/$(1).txt \
 	mkdir -p $(oox_MISC) $(oox_INC) $(oox_GENHEADERPATH)
 	perl $(oox_SRC)/$(1).pl $(oox_SRC)/$(1).txt $(oox_MISC)/$(2)ids.inc \
 			$(oox_INC)/$(2)names.inc $(if $(3),$(oox_MISC)/$(3)) \
+			$(if $(4),$(oox_SRC)/$(4).txt $(oox_INC)/$(4)names.inc) \
 		&& cat $(oox_SRC)/$(1).hxx.head $(oox_MISC)/$(2)ids.inc \
 			   $(oox_SRC)/$(1).hxx.tail > $(oox_GENHEADERPATH)/$(1).hxx \
 		&& touch $$@
 endef
 
-$(eval $(call oox_GenTarget,namespaces,namespace,namespaces.txt))
-$(eval $(call oox_GenTarget,namespaces-strict,namespace-strict,namespaces-strict.txt))
+$(eval $(call oox_GenTarget,namespaces,namespace,namespaces.txt,namespaces-strict))
 $(eval $(call oox_GenTarget,properties,property,))
 $(eval $(call oox_GenTarget,tokens,token,tokenhash.gperf))
 
@@ -55,7 +55,6 @@ $(call gb_CustomTarget_get_target,oox/generated) : \
 	$(oox_INC)/propertynames.inc \
 	$(oox_GENHEADERPATH)/tokens.hxx \
 	$(oox_GENHEADERPATH)/namespaces.hxx \
-	$(oox_GENHEADERPATH)/namespaces-strict.hxx \
 	$(oox_GENHEADERPATH)/properties.hxx \
 	$(oox_MISC)/namespaces.txt \
 
diff --git a/oox/source/token/namespacemap.cxx b/oox/source/token/namespacemap.cxx
index 65487da..11567fe 100644
--- a/oox/source/token/namespacemap.cxx
+++ b/oox/source/token/namespacemap.cxx
@@ -35,7 +35,7 @@ NamespaceMap::NamespaceMap()
     static const struct NamespaceStrictUrl { sal_Int32 mnId; const sal_Char* mpcUrl; } spNamespaceStrictUrls[] =
     {
 // include auto-generated C array with namespace URLs as C strings
-#include "namespace-strictnames.inc"
+#include "namespaces-strictnames.inc"
         { -1, "" }
     };
 
diff --git a/oox/source/token/namespaces-strict.hxx.head b/oox/source/token/namespaces-strict.hxx.head
deleted file mode 100644
index d00a380..0000000
--- a/oox/source/token/namespaces-strict.hxx.head
+++ /dev/null
@@ -1,27 +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 .
- */
-
-#ifndef OOX_TOKEN_NAMESPACES_HXX
-#define OOX_TOKEN_NAMESPACES_HXX
-
-#include <sal/types.h>
-
-namespace oox {
-
-// ============================================================================
-
diff --git a/oox/source/token/namespaces-strict.hxx.tail b/oox/source/token/namespaces-strict.hxx.tail
deleted file mode 100644
index e0baeae..0000000
--- a/oox/source/token/namespaces-strict.hxx.tail
+++ /dev/null
@@ -1,62 +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 .
- */
-
-// ============================================================================
-
-const sal_Int32 TOKEN_MASK          = static_cast< sal_Int32 >( (1 << NMSP_SHIFT) - 1 );
-const sal_Int32 NMSP_MASK           = static_cast< sal_Int32 >( SAL_MAX_INT32 & ~TOKEN_MASK );
-
-/** Returns the raw token identifier without namespace of the passed token. */
-inline sal_Int32 getBaseToken( sal_Int32 nToken ) { return nToken & TOKEN_MASK; }
-
-/** Returns the namespace without token identifier of the passed token. */
-inline sal_Int32 getNamespace( sal_Int32 nToken ) { return nToken & NMSP_MASK; }
-
-
-// defines for tokens with specific namespaces
-#define OOX_TOKEN( namespace, token ) (::oox::NMSP_##namespace | ::oox::XML_##token)
-
-#define A_TOKEN( token )        OOX_TOKEN( dml, token )
-#define AX_TOKEN( token )       OOX_TOKEN( ax, token )
-#define C_TOKEN( token )        OOX_TOKEN( dmlChart, token )
-#define CDR_TOKEN( token )      OOX_TOKEN( dmlChartDr, token )
-#define DGM_TOKEN( token )      OOX_TOKEN( dmlDiagram, token )
-#define MCE_TOKEN( token )      OOX_TOKEN( mce, token)
-#define O_TOKEN( token )        OOX_TOKEN( vmlOffice, token )
-#define PC_TOKEN( token )       OOX_TOKEN( packageContentTypes, token )
-#define PPT_TOKEN( token )      OOX_TOKEN( ppt, token )
-#define PR_TOKEN( token )       OOX_TOKEN( packageRel, token )
-#define R_TOKEN( token )        OOX_TOKEN( officeRel, token )
-#define VML_TOKEN( token )      OOX_TOKEN( vml, token )
-#define VMLX_TOKEN( token )     OOX_TOKEN( vmlExcel, token )
-#define XDR_TOKEN( token )      OOX_TOKEN( dmlSpreadDr, token )
-#define XLS_TOKEN( token )      OOX_TOKEN( xls, token )
-#define XLS_EXT_TOKEN( token )  OOX_TOKEN( xlsExtLst, token )
-#define XM_TOKEN( token )       OOX_TOKEN( xm, token )
-#define XML_TOKEN( token )      OOX_TOKEN( xml, token )
-#define VMLPPT_TOKEN( token )   OOX_TOKEN( vmlPowerpoint, token )
-#define DSP_TOKEN( token )      OOX_TOKEN( dsp, token )
-#define LC_TOKEN( token )       OOX_TOKEN( dmlLockedCanvas, token )
-#define WPS_TOKEN( token )      OOX_TOKEN( wps, token )
-#define WPG_TOKEN( token )      OOX_TOKEN( wpg, token )
-
-// ============================================================================
-
-} // namespace oox
-
-#endif
diff --git a/oox/source/token/namespaces-strict.pl b/oox/source/token/namespaces-strict.pl
deleted file mode 100644
index 225b8f7..0000000
--- a/oox/source/token/namespaces-strict.pl
+++ /dev/null
@@ -1,70 +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 .
-#
-
-$ARGV0 = shift @ARGV;
-$ARGV1 = shift @ARGV;
-$ARGV2 = shift @ARGV;
-$ARGV3 = shift @ARGV;
-
-# parse input file
-
-open( INFILE, $ARGV0 ) or die "cannot open input file: $!";
-my %namespaces;
-while( <INFILE> )
-{
-    # trim newline
-    chomp( $_ );
-    # trim leading/trailing whitespace
-    $_ =~ s/^\s*//g;
-    $_ =~ s/\s*$//g;
-    # trim comments
-    $_ =~ s/^#.*//;
-    # skip empty lines
-    if( $_ )
-    {
-        # check for valid characters
-        $_ =~ /^([a-zA-Z][a-zA-Z0-9]*)\s+([a-zA-Z0-9-.:\/]+)\s*$/ or die "Error: invalid character in input data";
-        $namespaces{$1} = $2;
-    }
-}
-close( INFILE );
-
-# generate output files
-
-open( IDFILE, ">$ARGV1" ) or die "Error: cannot open output file: $!";
-open( NAMEFILE, ">$ARGV2" ) or die "Error: cannot open output file: $!";
-open( TXTFILE, ">$ARGV3" ) or die "Error: cannot open output file: $!";
-
-# number of bits to shift the namespace identifier
-$shift = 16;
-
-print ( IDFILE "const size_t NMSP_SHIFT = $shift;\n" );
-
-$i = 1;
-foreach( keys( %namespaces ) )
-{
-    print( IDFILE "const sal_Int32 NMSP_$_ = $i << NMSP_SHIFT;\n" );
-    $id = $i << $shift;
-    print( NAMEFILE "{ $id, \"$namespaces{$_}\" },\n" );
-    print( TXTFILE "$id $_ $namespaces{$_}\n" );
-    ++$i;
-}
-
-close( IDFILE );
-close( nameFILE );
-close( TXTFILE );
diff --git a/oox/source/token/namespaces.pl b/oox/source/token/namespaces.pl
index 225b8f7..b7f6083 100644
--- a/oox/source/token/namespaces.pl
+++ b/oox/source/token/namespaces.pl
@@ -20,6 +20,8 @@ $ARGV0 = shift @ARGV;
 $ARGV1 = shift @ARGV;
 $ARGV2 = shift @ARGV;
 $ARGV3 = shift @ARGV;
+$ARGV4 = shift @ARGV;
+$ARGV5 = shift @ARGV;
 
 # parse input file
 
@@ -44,11 +46,35 @@ while( <INFILE> )
 }
 close( INFILE );
 
+# OOXML strict namespaces
+
+open( INFILE_STRICT, $ARGV4 ) or die "cannot open input file: $!";
+my %namespaces_strict;
+while( <INFILE_STRICT> )
+{
+    # trim newline
+    chomp( $_ );
+    # trim leading/trailing whitespace
+    $_ =~ s/^\s*//g;
+    $_ =~ s/\s*$//g;
+    # trim comments
+    $_ =~ s/^#.*//;
+    # skip empty lines
+    if( $_ )
+    {
+        # check for valid characters
+        $_ =~ /^([a-zA-Z][a-zA-Z0-9]*)\s+([a-zA-Z0-9-.:\/]+)\s*$/ or die "Error: invalid character in input data";
+        $namespaces_strict{$1} = $2;
+    }
+}
+close( INFILE_STRICT );
+
 # generate output files
 
 open( IDFILE, ">$ARGV1" ) or die "Error: cannot open output file: $!";
 open( NAMEFILE, ">$ARGV2" ) or die "Error: cannot open output file: $!";
 open( TXTFILE, ">$ARGV3" ) or die "Error: cannot open output file: $!";
+open( NAMEFILE_STRICT, ">$ARGV5" ) or die "Error: cannot open output file: $!";
 
 # number of bits to shift the namespace identifier
 $shift = 16;
@@ -61,10 +87,12 @@ foreach( keys( %namespaces ) )
     print( IDFILE "const sal_Int32 NMSP_$_ = $i << NMSP_SHIFT;\n" );
     $id = $i << $shift;
     print( NAMEFILE "{ $id, \"$namespaces{$_}\" },\n" );
+    print( NAMEFILE_STRICT "{ $id, \"$namespaces_strict{$_}\" },\n" );
     print( TXTFILE "$id $_ $namespaces{$_}\n" );
     ++$i;
 }
 
 close( IDFILE );
-close( nameFILE );
+close( NAMEFILE );
+close( NAMEFILE_STRICT );
 close( TXTFILE );
commit 54ebae0eae8829a9325170002120b984e8934cdf
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sun Mar 2 13:36:12 2014 +0100

    remove whitespaces
    
    Change-Id: I624ca41c3e51ba785e359649c429feb61cc9a647

diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 06af72c..917a757 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -350,31 +350,24 @@ sal_Int32 SAL_CALL FastLocatorImpl::getColumnNumber(void) throw (RuntimeExceptio
     return XML_GetCurrentColumnNumber( mpParser->getEntity().mpParser );
 }
 
-
-
 sal_Int32 SAL_CALL FastLocatorImpl::getLineNumber(void) throw (RuntimeException, std::exception)
 {
     checkDispose();
     return XML_GetCurrentLineNumber( mpParser->getEntity().mpParser );
 }
 
-
-
 OUString SAL_CALL FastLocatorImpl::getPublicId(void) throw (RuntimeException, std::exception)
 {
     checkDispose();
     return mpParser->getEntity().maStructSource.sPublicId;
 }
 
-
 OUString SAL_CALL FastLocatorImpl::getSystemId(void) throw (RuntimeException, std::exception)
 {
     checkDispose();
     return mpParser->getEntity().maStructSource.sSystemId;
 }
 
-
-
 ParserData::ParserData()
     : mpTokenHandler( NULL )
 {}
@@ -382,8 +375,6 @@ ParserData::ParserData()
 ParserData::~ParserData()
 {}
 
-
-
 Entity::Entity(const ParserData& rData)
     : ParserData(rData)
     , mnProducedEventsSize(0)
@@ -632,16 +623,12 @@ FastSaxParserImpl::FastSaxParserImpl( FastSaxParser* pFront ) :
     mxDocumentLocator.set( new FastLocatorImpl( this ) );
 }
 
-
-
 FastSaxParserImpl::~FastSaxParserImpl()
 {
     if( mxDocumentLocator.is() )
         mxDocumentLocator->dispose();
 }
 
-
-
 void FastSaxParserImpl::DefineNamespace( const OString& rPrefix, const sal_Char* pNamespaceURL )
 {
     Entity& rEntity = getEntity();
@@ -658,8 +645,6 @@ void FastSaxParserImpl::DefineNamespace( const OString& rPrefix, const sal_Char*
     }
 }
 
-
-
 sal_Int32 FastSaxParserImpl::GetToken( const sal_Char* pToken, sal_Int32 nLen /* = 0 */ )
 {
     return maTokenLookup.getTokenFromChars( getEntity().mxTokenHandler,
@@ -667,8 +652,6 @@ sal_Int32 FastSaxParserImpl::GetToken( const sal_Char* pToken, sal_Int32 nLen /*
                                             pToken, nLen );
 }
 
-
-
 sal_Int32 FastSaxParserImpl::GetTokenWithPrefix( const sal_Char*pPrefix, int nPrefixLen, const sal_Char* pName, int nNameLen ) throw (SAXException)
 {
     sal_Int32 nNamespaceToken = FastToken::DONTKNOW;
@@ -699,8 +682,6 @@ sal_Int32 FastSaxParserImpl::GetTokenWithPrefix( const sal_Char*pPrefix, int nPr
     return FastToken::DONTKNOW;
 }
 
-
-
 sal_Int32 FastSaxParserImpl::GetNamespaceToken( const OUString& rNamespaceURL )
 {
     NamespaceMap::iterator aIter( maNamespaceMap.find( rNamespaceURL ) );
@@ -710,8 +691,6 @@ sal_Int32 FastSaxParserImpl::GetNamespaceToken( const OUString& rNamespaceURL )
         return FastToken::DONTKNOW;
 }
 
-
-
 OUString FastSaxParserImpl::GetNamespaceURL( const OString& rPrefix ) throw (SAXException)
 {
     Entity& rEntity = getEntity();
@@ -746,8 +725,6 @@ OUString FastSaxParserImpl::GetNamespaceURL( const sal_Char*pPrefix, int nPrefix
     throw SAXException(); // prefix that has no defined namespace url
 }
 
-
-
 sal_Int32 FastSaxParserImpl::GetTokenWithContextNamespace( sal_Int32 nNamespaceToken, const sal_Char* pName, int nNameLen )
 {
     if( nNamespaceToken != FastToken::DONTKNOW )
@@ -760,8 +737,6 @@ sal_Int32 FastSaxParserImpl::GetTokenWithContextNamespace( sal_Int32 nNamespaceT
     return FastToken::DONTKNOW;
 }
 
-
-
 void FastSaxParserImpl::splitName( const XML_Char *pwName, const XML_Char *&rpPrefix, sal_Int32 &rPrefixLen, const XML_Char *&rpName, sal_Int32 &rNameLen )
 {
     XML_Char *p;
@@ -1086,12 +1061,7 @@ void FastSaxParserImpl::parse()
         produce( DONE );
 }
 
-
-
 // The C-Callbacks
-
-
-
 void FastSaxParserImpl::callbackStartElement( const XML_Char* pwName, const XML_Char** awAttributes )
 {
     Entity& rEntity = getEntity();
@@ -1239,7 +1209,6 @@ void FastSaxParserImpl::callbackEndElement( SAL_UNUSED_PARAMETER const XML_Char*
         rEntity.endElement();
 }
 
-
 void FastSaxParserImpl::callbackCharacters( const XML_Char* s, int nLen )
 {
     Entity& rEntity = getEntity();
commit b7381c519794b4959b1993e98ecb11e2ab0d518a
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Mar 1 19:06:15 2014 +0100

    make more places aware of OOXML strict relations
    
    Change-Id: I292217537eb592cbad9af11f87402baa9f4cc442

diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx
index 1e5a392..51bd6d5 100644
--- a/oox/source/docprop/ooxmldocpropimport.cxx
+++ b/oox/source/docprop/ooxmldocpropimport.cxx
@@ -131,12 +131,21 @@ void SAL_CALL DocumentPropertiesImport::importProperties(
         throw IllegalArgumentException();
 
     Sequence< InputSource > aCoreStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "metadata/core-properties" ) );
+    // OOXML strict
+    if( !aCoreStreams.hasElements() )
+        aCoreStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE_STRICT( "metadata/core-properties" ) );
     // MS Office seems to have a bug, so we have to do similar handling
     if( !aCoreStreams.hasElements() )
         aCoreStreams = lclGetRelatedStreams( rxSource, CREATE_PACKAGE_RELATION_TYPE( "metadata/core-properties" ) );
 
     Sequence< InputSource > aExtStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "extended-properties" ) );
+    // OOXML strict
+    if( !aExtStreams.hasElements() )
+        aExtStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE_STRICT( "extended-properties" ) );
     Sequence< InputSource > aCustomStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "custom-properties" ) );
+    // OOXML strict
+    if( !aCustomStreams.hasElements() )
+        aCustomStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE_STRICT( "custom-properties" ) );
 
     if( aCoreStreams.hasElements() || aExtStreams.hasElements() || aCustomStreams.hasElements() )
     {
diff --git a/oox/source/ppt/dgmimport.cxx b/oox/source/ppt/dgmimport.cxx
index 10d1614..602fb72 100644
--- a/oox/source/ppt/dgmimport.cxx
+++ b/oox/source/ppt/dgmimport.cxx
@@ -60,7 +60,7 @@ bool QuickDiagrammingImport::importDocument() throw()
     OOX_DUMP_FILE( ::oox::dump::pptx::Dumper );
 
     OUString aEmpty;
-    OUString aFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "diagramLayout" ) );
+    OUString aFragmentPath = getFragmentPathFromFirstTypeFromOfficeDoc( "diagramLayout" );
 
     Reference<drawing::XShapes> xParentShape(getParentShape(),
                                              UNO_QUERY_THROW);
diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx
index f1d05e0..4be3d26 100644
--- a/oox/source/ppt/pptimport.cxx
+++ b/oox/source/ppt/pptimport.cxx
@@ -80,9 +80,9 @@ bool PowerPointImport::importDocument() throw()
         file:///<path-to-oox-module>/source/dump/pptxdumper.ini. */
     OOX_DUMP_FILE( ::oox::dump::pptx::Dumper );
 
-    OUString aFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "officeDocument" ) );
+    OUString aFragmentPath = getFragmentPathFromFirstTypeFromOfficeDoc( "officeDocument" );
     FragmentHandlerRef xPresentationFragmentHandler( new PresentationFragmentHandler( *this, aFragmentPath ) );
-    maTableStyleListPath = xPresentationFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "tableStyles" ) );
+    maTableStyleListPath = xPresentationFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( "tableStyles" );
     return importFragment( xPresentationFragmentHandler );
 
 
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index 26d3752..5fdf3f7 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -163,13 +163,13 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, sal_Bool bFirst
             FragmentHandlerRef xSlideFragmentHandler( new SlideFragmentHandler( rFilter, aSlideFragmentPath, pSlidePersistPtr, Slide ) );
 
             // importing the corresponding masterpage/layout
-            OUString aLayoutFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "slideLayout" ) );
-            OUString aCommentFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "comments" ) );
+            OUString aLayoutFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( "slideLayout" );
+            OUString aCommentFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( "comments" );
             if ( !aLayoutFragmentPath.isEmpty() )
             {
                 // importing layout
                 RelationsRef xLayoutRelations = rFilter.importRelations( aLayoutFragmentPath );
-                OUString aMasterFragmentPath = xLayoutRelations->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "slideMaster" ) );
+                OUString aMasterFragmentPath = xLayoutRelations->getFragmentPathFromFirstTypeFromOfficeDoc( "slideMaster" );
                 if( !aMasterFragmentPath.isEmpty() )
                 {
                     // check if the corresponding masterpage+layout has already been imported
@@ -204,7 +204,7 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, sal_Bool bFirst
                         FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, aMasterFragmentPath, pMasterPersistPtr, Master ) );
 
                         // set the correct theme
-                        OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "theme" ) );
+                        OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( "theme" );
                         if( !aThemeFragmentPath.isEmpty() )
                         {
                             std::map< OUString, oox::drawingml::ThemePtr >& rThemes( rFilter.getThemes() );
@@ -255,7 +255,7 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, sal_Bool bFirst
             if(bImportNotesPage) {
 
                 // now importing the notes page
-                OUString aNotesFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "notesSlide" ) );
+                OUString aNotesFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( "notesSlide" );
                 if( !aNotesFragmentPath.isEmpty() )
                 {
                     Reference< XPresentationPage > xPresentationPage( xSlide, UNO_QUERY );
diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx
index 9d3772a..b2da147 100644
--- a/oox/source/ppt/slidefragmenthandler.cxx
+++ b/oox/source/ppt/slidefragmenthandler.cxx
@@ -54,7 +54,7 @@ SlideFragmentHandler::SlideFragmentHandler( XmlFilterBase& rFilter, const OUStri
 , mpSlidePersistPtr( pPersistPtr )
 , meShapeLocation( eShapeLocation )
 {
-    OUString aVMLDrawingFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "vmlDrawing" ) );
+    OUString aVMLDrawingFragmentPath = getFragmentPathFromFirstTypeFromOfficeDoc( "vmlDrawing" );
     if( !aVMLDrawingFragmentPath.isEmpty() )
         getFilter().importFragment( new oox::vml::DrawingFragment(
             getFilter(), aVMLDrawingFragmentPath, *pPersistPtr->getDrawing() ) );
@@ -87,7 +87,7 @@ SlideFragmentHandler::~SlideFragmentHandler() throw()
     {
         // Import notesMaster
         PowerPointImport& rFilter = dynamic_cast< PowerPointImport& >( getFilter() );
-        OUString aNotesFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "notesMaster" ) );
+        OUString aNotesFragmentPath = getFragmentPathFromFirstTypeFromOfficeDoc( "notesMaster" );
 
         std::vector< SlidePersistPtr >& rMasterPages( rFilter.getMasterPages() );
         std::vector< SlidePersistPtr >::iterator aIter( rMasterPages.begin() );
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index fe0c9f9..d97069b 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -279,7 +279,7 @@ void SAL_CALL ShapeContextHandler::startFastElement
         if (!msRelationFragmentPath.isEmpty())
         {
             FragmentHandlerRef rFragmentHandler(new ShapeFragmentHandler(*mxFilterBase, msRelationFragmentPath));
-            OUString aThemeFragmentPath = rFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "theme" ) );
+            OUString aThemeFragmentPath = rFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( "theme" );
             if(!aThemeFragmentPath.isEmpty())
             {
                 uno::Reference<xml::sax::XFastSAXSerializable> xDoc(mxFilterBase->importFragment(aThemeFragmentPath), uno::UNO_QUERY_THROW);
commit 54ca9821b2aec23224f4d5559fe6d656affdf315
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Mar 1 18:42:05 2014 +0100

    fix one more relation type for OOXML strict
    
    Change-Id: Ia63309271ac225883540ca0453fc5da21844d3ad

diff --git a/sc/source/filter/oox/externallinkbuffer.cxx b/sc/source/filter/oox/externallinkbuffer.cxx
index 5771cc2..899c1a4 100644
--- a/sc/source/filter/oox/externallinkbuffer.cxx
+++ b/sc/source/filter/oox/externallinkbuffer.cxx
@@ -566,7 +566,8 @@ ExternalNameRef ExternalLink::getNameByIndex( sal_Int32 nIndex ) const
 void ExternalLink::setExternalTargetUrl( const OUString& rTargetUrl, const OUString& rTargetType )
 {
     meLinkType = LINKTYPE_UNKNOWN;
-    if( rTargetType == CREATE_OFFICEDOC_RELATION_TYPE( "externalLinkPath" ) )
+    if( rTargetType == CREATE_OFFICEDOC_RELATION_TYPE( "externalLinkPath" ) ||
+            rTargetType == CREATE_OFFICEDOC_RELATION_TYPE_STRICT( "externalLinkPath" ) )
     {
         maTargetUrl = getBaseFilter().getAbsoluteUrl( rTargetUrl );
         if( !maTargetUrl.isEmpty() )
commit 3e82e55241ba549765381488bad61ebe45f96941
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sat Mar 1 18:40:45 2014 +0100

    no need to add another layer of macros
    
    Change-Id: I49992559a7d10127d55dbf0c7e257c86619fd8d6

diff --git a/sc/source/filter/oox/externallinkbuffer.cxx b/sc/source/filter/oox/externallinkbuffer.cxx
index e4e5d00..5771cc2 100644
--- a/sc/source/filter/oox/externallinkbuffer.cxx
+++ b/sc/source/filter/oox/externallinkbuffer.cxx
@@ -563,19 +563,16 @@ ExternalNameRef ExternalLink::getNameByIndex( sal_Int32 nIndex ) const
 
 // private --------------------------------------------------------------------
 
-#define OOX_TARGETTYPE_EXTLINK      CREATE_OFFICEDOC_RELATION_TYPE( "externalLinkPath" )
-#define OOX_TARGETTYPE_LIBRARY      CREATE_MSOFFICE_RELATION_TYPE( "xlExternalLinkPath/xlLibrary" )
-
 void ExternalLink::setExternalTargetUrl( const OUString& rTargetUrl, const OUString& rTargetType )
 {
     meLinkType = LINKTYPE_UNKNOWN;
-    if( rTargetType == OOX_TARGETTYPE_EXTLINK )
+    if( rTargetType == CREATE_OFFICEDOC_RELATION_TYPE( "externalLinkPath" ) )
     {
         maTargetUrl = getBaseFilter().getAbsoluteUrl( rTargetUrl );
         if( !maTargetUrl.isEmpty() )
             meLinkType = LINKTYPE_EXTERNAL;
     }
-    else if( rTargetType == OOX_TARGETTYPE_LIBRARY )
+    else if( rTargetType == CREATE_MSOFFICE_RELATION_TYPE( "xlExternalLinkPath/xlLibrary" ) )
     {
         meLinkType = LINKTYPE_LIBRARY;
         meFuncLibType = getFormulaParser().getFuncLibTypeFromLibraryName( rTargetUrl );


More information about the Libreoffice-commits mailing list