summaryrefslogtreecommitdiff
path: root/sc/source/filter/xml/xmlwrap.cxx
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2005-11-10 15:37:31 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2005-11-10 15:37:31 +0000
commitf09b5e1b09ffaff3e967bf843fd7ab9e8a8c81a8 (patch)
tree8a5c036a8e4f81ce3d93654fd81a6365428b36aa /sc/source/filter/xml/xmlwrap.cxx
parentd16b4b8ee7270cc2223001eb1adbb7419be97033 (diff)
INTEGRATION: CWS impress76 (1.61.8); FILE MERGED
2005/11/08 09:23:07 cl 1.61.8.1: #i56896# tunnel BuildId from meta.xml to ole objects
Diffstat (limited to 'sc/source/filter/xml/xmlwrap.cxx')
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx44
1 files changed, 42 insertions, 2 deletions
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index eb922c873d45..4c791b4a7807 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: xmlwrap.cxx,v $
*
- * $Revision: 1.61 $
+ * $Revision: 1.62 $
*
- * last change: $Author: hr $ $Date: 2005-10-27 14:04:02 $
+ * last change: $Author: rt $ $Date: 2005-11-10 16:37:31 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -68,6 +68,12 @@
#include <tools/urlobj.hxx>
#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_
+#include <com/sun/star/container/XChild.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HPP_
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#endif
#include <com/sun/star/xml/sax/XErrorHandler.hpp>
#include <com/sun/star/xml/sax/XEntityResolver.hpp>
#include <com/sun/star/xml/sax/InputSource.hpp>
@@ -462,6 +468,25 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
};
uno::Reference< beans::XPropertySet > xInfoSet( comphelper::GenericPropertySet_CreateInstance( new comphelper::PropertySetInfo( aImportInfoMap ) ) );
+ // ---- get BuildId from parent container if available
+
+ uno::Reference< container::XChild > xChild( xModel, uno::UNO_QUERY );
+ if( xChild.is() )
+ {
+ uno::Reference< beans::XPropertySet > xParentSet( xChild->getParent(), uno::UNO_QUERY );
+ if( xParentSet.is() )
+ {
+ uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xParentSet->getPropertySetInfo() );
+ OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("BuildId" ) );
+ if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(sPropName) )
+ {
+ xInfoSet->setPropertyValue( sPropName, xParentSet->getPropertyValue(sPropName) );
+ }
+ }
+ }
+
+ // -------------------------------------
+
uno::Reference<task::XStatusIndicator> xStatusIndicator(GetStatusIndicator());
if (xStatusIndicator.is())
{
@@ -635,6 +660,21 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
bRet = sal_True;
}
+ // set BuildId on XModel for later OLE object loading
+ if( xInfoSet.is() )
+ {
+ uno::Reference< beans::XPropertySet > xModelSet( xModel, uno::UNO_QUERY );
+ if( xModelSet.is() )
+ {
+ uno::Reference< beans::XPropertySetInfo > xModelSetInfo( xModelSet->getPropertySetInfo() );
+ OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("BuildId" ) );
+ if( xModelSetInfo.is() && xModelSetInfo->hasPropertyByName(sPropName) )
+ {
+ xModelSet->setPropertyValue( sPropName, xInfoSet->getPropertyValue(sPropName) );
+ }
+ }
+ }
+
// Don't test bStylesRetval and bMetaRetval, because it could be an older file which not contain such streams
return bRet;//!bStylesOnly ? bDocRetval : bStylesRetval;
}