summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2011-03-22 17:38:22 +0100
committerVladimir Glazunov <vg@openoffice.org>2011-03-22 17:38:22 +0100
commit7190fafc9f7f40a55373a2ea67cad2dbff48d575 (patch)
treeaf768001a0ef4ce7ccc921c52288ce01c2804fc5
parent5491e6ccd42905d3f34d218814a32f49d3b9a2a2 (diff)
parent0b8da0dbafb0acde660b634fe944f575aebec24f (diff)
CWS-TOOLING: integrate CWS sw34bf04ooo/DEV300_m104
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx23
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx36
2 files changed, 43 insertions, 16 deletions
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 7855e0297..b19534a78 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1912,7 +1912,7 @@ SvXMLImportContext *ScXMLImport::CreateMetaContext(
{
SvXMLImportContext *pContext(0);
- if( !IsStylesOnlyMode() && (getImportFlags() & IMPORT_META))
+ if (getImportFlags() & IMPORT_META)
{
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
mxServiceFactory->createInstance(::rtl::OUString::createFromAscii(
@@ -1920,9 +1920,11 @@ SvXMLImportContext *ScXMLImport::CreateMetaContext(
uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
GetModel(), uno::UNO_QUERY_THROW);
+ uno::Reference<document::XDocumentProperties> const xDocProps(
+ (IsStylesOnlyMode()) ? 0 : xDPS->getDocumentProperties());
pContext = new SvXMLMetaDocumentContext(*this,
XML_NAMESPACE_OFFICE, rLocalName,
- xDPS->getDocumentProperties(), xDocBuilder);
+ xDocProps, xDocBuilder);
}
if( !pContext )
@@ -2636,6 +2638,23 @@ throw( ::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeE
}
}
+ uno::Reference< beans::XPropertySet > const xImportInfo( getImportInfo() );
+ uno::Reference< beans::XPropertySetInfo > const xPropertySetInfo(
+ xImportInfo.is() ? xImportInfo->getPropertySetInfo() : 0);
+ if (xPropertySetInfo.is())
+ {
+ ::rtl::OUString const sOrganizerMode(
+ RTL_CONSTASCII_USTRINGPARAM("OrganizerMode"));
+ if (xPropertySetInfo->hasPropertyByName(sOrganizerMode))
+ {
+ sal_Bool bStyleOnly(sal_False);
+ if (xImportInfo->getPropertyValue(sOrganizerMode) >>= bStyleOnly)
+ {
+ bLoadDoc = !bStyleOnly;
+ }
+ }
+ }
+
UnlockSolarMutex();
}
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 479b855a8..8a7806f4c 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -429,6 +429,8 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
{ MAP_LEN( "BuildId" ), 0, &::getCppuType( (OUString *)0 ), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 },
{ MAP_LEN( "VBACompatibilityMode" ), 0, &::getBooleanCppuType(), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 },
{ MAP_LEN( "ScriptConfiguration" ), 0, &::getCppuType((uno::Reference<container::XNameAccess> *)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 }
};
@@ -488,26 +490,32 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
}
}
+ if (bStylesOnly)
+ {
+ ::rtl::OUString const sOrganizerMode(
+ RTL_CONSTASCII_USTRINGPARAM("OrganizerMode"));
+ xInfoSet->setPropertyValue(sOrganizerMode, uno::makeAny(sal_True));
+ }
+
sal_Bool bOasis = ( SotStorage::GetVersion( xStorage ) > SOFFICE_FILEFORMAT_60 );
+ // #i103539#: always read meta.xml for generator
sal_uInt32 nMetaRetval(0);
- if(!bStylesOnly)
- {
- uno::Sequence<uno::Any> aMetaArgs(1);
- uno::Any* pMetaArgs = aMetaArgs.getArray();
- pMetaArgs[0] <<= xInfoSet;
+ uno::Sequence<uno::Any> aMetaArgs(1);
+ uno::Any* pMetaArgs = aMetaArgs.getArray();
+ pMetaArgs[0] <<= xInfoSet;
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "meta import start" );
+ RTL_LOGFILE_CONTEXT_TRACE( aLog, "meta import start" );
- nMetaRetval = ImportFromComponent(xServiceFactory, xModel, xXMLParser, aParserInput,
- bOasis ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLOasisMetaImporter"))
- : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLMetaImporter")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("meta.xml")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Meta.xml")), aMetaArgs,
- sal_False);
+ nMetaRetval = ImportFromComponent(
+ xServiceFactory, xModel, xXMLParser, aParserInput,
+ bOasis ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLOasisMetaImporter"))
+ : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLMetaImporter")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("meta.xml")),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Meta.xml")), aMetaArgs,
+ sal_False);
- RTL_LOGFILE_CONTEXT_TRACE( aLog, "meta import end" );
- }
+ RTL_LOGFILE_CONTEXT_TRACE( aLog, "meta import end" );
SvXMLGraphicHelper* pGraphicHelper = NULL;
uno::Reference< document::XGraphicObjectResolver > xGrfContainer;