Kaydet (Commit) b7381c51 authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Markus Mohrhard

make more places aware of OOXML strict relations

Change-Id: I292217537eb592cbad9af11f87402baa9f4cc442
üst 54ca9821
...@@ -131,12 +131,21 @@ void SAL_CALL DocumentPropertiesImport::importProperties( ...@@ -131,12 +131,21 @@ void SAL_CALL DocumentPropertiesImport::importProperties(
throw IllegalArgumentException(); throw IllegalArgumentException();
Sequence< InputSource > aCoreStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "metadata/core-properties" ) ); 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 // MS Office seems to have a bug, so we have to do similar handling
if( !aCoreStreams.hasElements() ) if( !aCoreStreams.hasElements() )
aCoreStreams = lclGetRelatedStreams( rxSource, CREATE_PACKAGE_RELATION_TYPE( "metadata/core-properties" ) ); aCoreStreams = lclGetRelatedStreams( rxSource, CREATE_PACKAGE_RELATION_TYPE( "metadata/core-properties" ) );
Sequence< InputSource > aExtStreams = lclGetRelatedStreams( rxSource, CREATE_OFFICEDOC_RELATION_TYPE( "extended-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" ) ); 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() ) if( aCoreStreams.hasElements() || aExtStreams.hasElements() || aCustomStreams.hasElements() )
{ {
......
...@@ -60,7 +60,7 @@ bool QuickDiagrammingImport::importDocument() throw() ...@@ -60,7 +60,7 @@ bool QuickDiagrammingImport::importDocument() throw()
OOX_DUMP_FILE( ::oox::dump::pptx::Dumper ); OOX_DUMP_FILE( ::oox::dump::pptx::Dumper );
OUString aEmpty; OUString aEmpty;
OUString aFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "diagramLayout" ) ); OUString aFragmentPath = getFragmentPathFromFirstTypeFromOfficeDoc( "diagramLayout" );
Reference<drawing::XShapes> xParentShape(getParentShape(), Reference<drawing::XShapes> xParentShape(getParentShape(),
UNO_QUERY_THROW); UNO_QUERY_THROW);
......
...@@ -80,9 +80,9 @@ bool PowerPointImport::importDocument() throw() ...@@ -80,9 +80,9 @@ bool PowerPointImport::importDocument() throw()
file:///<path-to-oox-module>/source/dump/pptxdumper.ini. */ file:///<path-to-oox-module>/source/dump/pptxdumper.ini. */
OOX_DUMP_FILE( ::oox::dump::pptx::Dumper ); 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 ) ); FragmentHandlerRef xPresentationFragmentHandler( new PresentationFragmentHandler( *this, aFragmentPath ) );
maTableStyleListPath = xPresentationFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "tableStyles" ) ); maTableStyleListPath = xPresentationFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( "tableStyles" );
return importFragment( xPresentationFragmentHandler ); return importFragment( xPresentationFragmentHandler );
......
...@@ -163,13 +163,13 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, sal_Bool bFirst ...@@ -163,13 +163,13 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, sal_Bool bFirst
FragmentHandlerRef xSlideFragmentHandler( new SlideFragmentHandler( rFilter, aSlideFragmentPath, pSlidePersistPtr, Slide ) ); FragmentHandlerRef xSlideFragmentHandler( new SlideFragmentHandler( rFilter, aSlideFragmentPath, pSlidePersistPtr, Slide ) );
// importing the corresponding masterpage/layout // importing the corresponding masterpage/layout
OUString aLayoutFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "slideLayout" ) ); OUString aLayoutFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( "slideLayout" );
OUString aCommentFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "comments" ) ); OUString aCommentFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( "comments" );
if ( !aLayoutFragmentPath.isEmpty() ) if ( !aLayoutFragmentPath.isEmpty() )
{ {
// importing layout // importing layout
RelationsRef xLayoutRelations = rFilter.importRelations( aLayoutFragmentPath ); RelationsRef xLayoutRelations = rFilter.importRelations( aLayoutFragmentPath );
OUString aMasterFragmentPath = xLayoutRelations->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "slideMaster" ) ); OUString aMasterFragmentPath = xLayoutRelations->getFragmentPathFromFirstTypeFromOfficeDoc( "slideMaster" );
if( !aMasterFragmentPath.isEmpty() ) if( !aMasterFragmentPath.isEmpty() )
{ {
// check if the corresponding masterpage+layout has already been imported // check if the corresponding masterpage+layout has already been imported
...@@ -204,7 +204,7 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, sal_Bool bFirst ...@@ -204,7 +204,7 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, sal_Bool bFirst
FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, aMasterFragmentPath, pMasterPersistPtr, Master ) ); FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, aMasterFragmentPath, pMasterPersistPtr, Master ) );
// set the correct theme // set the correct theme
OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "theme" ) ); OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( "theme" );
if( !aThemeFragmentPath.isEmpty() ) if( !aThemeFragmentPath.isEmpty() )
{ {
std::map< OUString, oox::drawingml::ThemePtr >& rThemes( rFilter.getThemes() ); std::map< OUString, oox::drawingml::ThemePtr >& rThemes( rFilter.getThemes() );
...@@ -255,7 +255,7 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, sal_Bool bFirst ...@@ -255,7 +255,7 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, sal_Bool bFirst
if(bImportNotesPage) { if(bImportNotesPage) {
// now importing the notes page // now importing the notes page
OUString aNotesFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "notesSlide" ) ); OUString aNotesFragmentPath = xSlideFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( "notesSlide" );
if( !aNotesFragmentPath.isEmpty() ) if( !aNotesFragmentPath.isEmpty() )
{ {
Reference< XPresentationPage > xPresentationPage( xSlide, UNO_QUERY ); Reference< XPresentationPage > xPresentationPage( xSlide, UNO_QUERY );
......
...@@ -54,7 +54,7 @@ SlideFragmentHandler::SlideFragmentHandler( XmlFilterBase& rFilter, const OUStri ...@@ -54,7 +54,7 @@ SlideFragmentHandler::SlideFragmentHandler( XmlFilterBase& rFilter, const OUStri
, mpSlidePersistPtr( pPersistPtr ) , mpSlidePersistPtr( pPersistPtr )
, meShapeLocation( eShapeLocation ) , meShapeLocation( eShapeLocation )
{ {
OUString aVMLDrawingFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "vmlDrawing" ) ); OUString aVMLDrawingFragmentPath = getFragmentPathFromFirstTypeFromOfficeDoc( "vmlDrawing" );
if( !aVMLDrawingFragmentPath.isEmpty() ) if( !aVMLDrawingFragmentPath.isEmpty() )
getFilter().importFragment( new oox::vml::DrawingFragment( getFilter().importFragment( new oox::vml::DrawingFragment(
getFilter(), aVMLDrawingFragmentPath, *pPersistPtr->getDrawing() ) ); getFilter(), aVMLDrawingFragmentPath, *pPersistPtr->getDrawing() ) );
...@@ -87,7 +87,7 @@ SlideFragmentHandler::~SlideFragmentHandler() throw() ...@@ -87,7 +87,7 @@ SlideFragmentHandler::~SlideFragmentHandler() throw()
{ {
// Import notesMaster // Import notesMaster
PowerPointImport& rFilter = dynamic_cast< PowerPointImport& >( getFilter() ); 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 >& rMasterPages( rFilter.getMasterPages() );
std::vector< SlidePersistPtr >::iterator aIter( rMasterPages.begin() ); std::vector< SlidePersistPtr >::iterator aIter( rMasterPages.begin() );
......
...@@ -279,7 +279,7 @@ void SAL_CALL ShapeContextHandler::startFastElement ...@@ -279,7 +279,7 @@ void SAL_CALL ShapeContextHandler::startFastElement
if (!msRelationFragmentPath.isEmpty()) if (!msRelationFragmentPath.isEmpty())
{ {
FragmentHandlerRef rFragmentHandler(new ShapeFragmentHandler(*mxFilterBase, msRelationFragmentPath)); FragmentHandlerRef rFragmentHandler(new ShapeFragmentHandler(*mxFilterBase, msRelationFragmentPath));
OUString aThemeFragmentPath = rFragmentHandler->getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "theme" ) ); OUString aThemeFragmentPath = rFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( "theme" );
if(!aThemeFragmentPath.isEmpty()) if(!aThemeFragmentPath.isEmpty())
{ {
uno::Reference<xml::sax::XFastSAXSerializable> xDoc(mxFilterBase->importFragment(aThemeFragmentPath), uno::UNO_QUERY_THROW); uno::Reference<xml::sax::XFastSAXSerializable> xDoc(mxFilterBase->importFragment(aThemeFragmentPath), uno::UNO_QUERY_THROW);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment