make more places aware of OOXML strict relations
Change-Id: I292217537eb592cbad9af11f87402baa9f4cc442
This commit is contained in:
parent
54ca9821b2
commit
b7381c5197
6 changed files with 20 additions and 11 deletions
|
@ -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() )
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue