View | Details | Raw Unified | Return to issue 119411
Collapse All | Expand All

(-)sc/source/filter/xml/xmlwrap.cxx (-1 / +43 lines)
Lines 62-68 Link Here
62
#include <com/sun/star/packages/zip/ZipIOException.hpp>
62
#include <com/sun/star/packages/zip/ZipIOException.hpp>
63
#include <com/sun/star/embed/ElementModes.hpp>
63
#include <com/sun/star/embed/ElementModes.hpp>
64
#include <com/sun/star/script/vba/XVBACompatibility.hpp>
64
#include <com/sun/star/script/vba/XVBACompatibility.hpp>
65
#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
65
66
67
#include <sfx2/DocumentMetadataAccess.hxx>
68
#include <comphelper/componentcontext.hxx>
69
#include <comphelper/documentconstants.hxx>
66
#include <svx/xmleohlp.hxx>
70
#include <svx/xmleohlp.hxx>
67
#include <rtl/logfile.hxx>
71
#include <rtl/logfile.hxx>
68
#include <unotools/saveopt.hxx>
72
#include <unotools/saveopt.hxx>
Lines 466-474 Link Here
466
	    xInfoSet->setPropertyValue( sPropName, uno::makeAny( aBaseURL ) );
470
	    xInfoSet->setPropertyValue( sPropName, uno::makeAny( aBaseURL ) );
467
471
468
		// TODO/LATER: do not do it for embedded links
472
		// TODO/LATER: do not do it for embedded links
473
		OUString aName;
469
	    if( SFX_CREATE_MODE_EMBEDDED == pObjSh->GetCreateMode() )
474
	    if( SFX_CREATE_MODE_EMBEDDED == pObjSh->GetCreateMode() )
470
	    {
475
	    {
471
            OUString aName;
472
			if ( pMedium && pMedium->GetItemSet() )
476
			if ( pMedium && pMedium->GetItemSet() )
473
			{
477
			{
474
				const SfxStringItem* pDocHierarchItem = static_cast<const SfxStringItem*>(
478
				const SfxStringItem* pDocHierarchItem = static_cast<const SfxStringItem*>(
Lines 495-500 Link Here
495
499
496
    	sal_Bool bOasis = ( SotStorage::GetVersion( xStorage ) > SOFFICE_FILEFORMAT_60 );
500
    	sal_Bool bOasis = ( SotStorage::GetVersion( xStorage ) > SOFFICE_FILEFORMAT_60 );
497
501
502
		// RDF metadata: ODF >= 1.2
503
		try
504
		{
505
			::comphelper::ComponentContext aContext( xServiceFactory );
506
			const uno::Reference< rdf::XDocumentMetadataAccess > xDMA(
507
				xModel, uno::UNO_QUERY_THROW );
508
			const uno::Reference< rdf::XURI > xBaseURI(
509
				::sfx2::createBaseURI( aContext.getUNOContext(), xStorage, aBaseURL, aName ) );
510
			const uno::Reference< task::XInteractionHandler > xHandler(
511
				pObjSh->GetMedium()->GetInteractionHandler() );
512
			xDMA->loadMetadataFromStorage( xStorage, xBaseURI, xHandler );
513
		}
514
		catch (uno::Exception &)
515
		{
516
		}
517
498
        // #i103539#: always read meta.xml for generator
518
        // #i103539#: always read meta.xml for generator
499
		sal_uInt32 nMetaRetval(0);
519
		sal_uInt32 nMetaRetval(0);
500
        uno::Sequence<uno::Any> aMetaArgs(1);
520
        uno::Sequence<uno::Any> aMetaArgs(1);
Lines 917-922 Link Here
917
937
918
        sal_Bool bOasis = ( SotStorage::GetVersion( xStorage ) > SOFFICE_FILEFORMAT_60 );
938
        sal_Bool bOasis = ( SotStorage::GetVersion( xStorage ) > SOFFICE_FILEFORMAT_60 );
919
939
940
		// RDF metadata: ODF >= 1.2
941
		if ( bOasis )
942
		{
943
			const uno::Reference< beans::XPropertySet > xPropSet( xStorage, uno::UNO_QUERY_THROW );
944
			try
945
			{
946
				::rtl::OUString aVersion;
947
				if (( xPropSet->getPropertyValue(
948
					rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Version"))) >>= aVersion )
949
					&& !aVersion.equals(ODFVER_010_TEXT)
950
					&& !aVersion.equals(ODFVER_011_TEXT) )
951
				{
952
					const uno::Reference< rdf::XDocumentMetadataAccess > xDMA(
953
						xModel, uno::UNO_QUERY_THROW );
954
					xDMA->storeMetadataToStorage( xStorage );
955
				}
956
			}
957
			catch (uno::Exception &)
958
			{
959
			}
960
		}
961
		
920
		// meta export
962
		// meta export
921
		if (!bStylesOnly && !bMetaRet)
963
		if (!bStylesOnly && !bMetaRet)
922
		{
964
		{

Return to issue 119411