From b5cffc10b0b21aa88bcd533bee65d020c6cc0eea Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 1 Mar 2011 16:05:30 +0100 Subject: sw34bf04: #i103539#: always import meta.xml, to extract the BuildId: SvXMLMetaDocumentContext: refactor to not require DocumentProperties, and always set the BuildId from the meta:generator element. {Sc,Sd,Sw}XMLImport::CreateMetaContext(): always create context. sc, sd: add OrganizerMode property to ODF import. --- sd/source/filter/xml/sdxmlwrp.cxx | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'sd/source/filter/xml/sdxmlwrp.cxx') diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx index 0ebc716e863b..53c95050ec8a 100755 --- a/sd/source/filter/xml/sdxmlwrp.cxx +++ b/sd/source/filter/xml/sdxmlwrp.cxx @@ -513,6 +513,9 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError ) { MAP_LEN( "BuildId" ), 0, &::getCppuType( (OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, + { MAP_LEN( "OrganizerMode" ), 0, + &::getBooleanCppuType(), + ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 }, { NULL, 0, 0, NULL, 0, 0 } }; @@ -630,6 +633,13 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError ) } } + if (SDXMLMODE_Organizer == meFilterMode) + { + ::rtl::OUString const sOrganizerMode( + RTL_CONSTASCII_USTRINGPARAM("OrganizerMode")); + xInfoSet->setPropertyValue(sOrganizerMode, uno::makeAny(sal_True)); + } + // ------------------------------------- if( 0 == nRet ) @@ -655,13 +665,14 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError ) sal_uInt32 nWarn = 0; sal_uInt32 nWarn2 = 0; // read storage streams + // #i103539#: always read meta.xml for generator + nWarn = ReadThroughComponent( + xStorage, xModelComp, "meta.xml", "Meta.xml", xServiceFactory, + pServices->mpMeta, + aEmptyArgs, aName, sal_False ); + if( meFilterMode != SDXMLMODE_Organizer ) { - nWarn = ReadThroughComponent( - xStorage, xModelComp, "meta.xml", "Meta.xml", xServiceFactory, - pServices->mpMeta, - aEmptyArgs, aName, sal_False ); - nWarn2 = ReadThroughComponent( xStorage, xModelComp, "settings.xml", NULL, xServiceFactory, pServices->mpSettings, -- cgit