diff options
Diffstat (limited to 'embeddedobj/source')
-rw-r--r-- | embeddedobj/source/commonembedding/miscobj.cxx | 8 | ||||
-rw-r--r-- | embeddedobj/source/commonembedding/persistence.cxx | 9 | ||||
-rw-r--r-- | embeddedobj/source/inc/commonembobj.hxx | 8 |
3 files changed, 22 insertions, 3 deletions
diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx index e88092981388..de1bee71c8a7 100644 --- a/embeddedobj/source/commonembedding/miscobj.cxx +++ b/embeddedobj/source/commonembedding/miscobj.cxx @@ -360,6 +360,11 @@ uno::Any SAL_CALL OCommonEmbeddedObject::queryInterface( const uno::Type& rType void * p = static_cast< embed::XEmbeddedObject * >( this ); return uno::Any( &p, rType ); } + else if (rType == cppu::UnoType<embed::XEmbedPersist2>::get()) + { + void* p = static_cast<embed::XEmbedPersist2*>(this); + return uno::Any(&p, rType); + } else aReturn <<= ::cppu::queryInterface( rType, @@ -428,7 +433,8 @@ uno::Sequence< uno::Type > SAL_CALL OCommonEmbeddedObject::getTypes() cppu::UnoType<embed::XInplaceObject>::get(), cppu::UnoType<embed::XCommonEmbedPersist>::get(), cppu::UnoType<container::XChild>::get(), - cppu::UnoType<embed::XEmbedPersist>::get()); + cppu::UnoType<embed::XEmbedPersist>::get(), + cppu::UnoType<embed::XEmbedPersist2>::get()); pTypeCollection = &aTypeCollection ; } diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index 5ef9253276b3..260cce01c40a 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -1790,6 +1790,15 @@ void SAL_CALL OCommonEmbeddedObject::reload( } } +sal_Bool SAL_CALL OCommonEmbeddedObject::isStored() throw (css::uno::RuntimeException, std::exception) +{ + uno::Reference<container::XNameAccess> xNA(m_xObjectStorage, uno::UNO_QUERY); + if (!xNA.is()) + return false; + + return xNA->getElementNames().getLength() > 0; +} + void SAL_CALL OCommonEmbeddedObject::breakLink( const uno::Reference< embed::XStorage >& xStorage, const OUString& sEntName ) diff --git a/embeddedobj/source/inc/commonembobj.hxx b/embeddedobj/source/inc/commonembobj.hxx index ceba61e43198..0808363733ca 100644 --- a/embeddedobj/source/inc/commonembobj.hxx +++ b/embeddedobj/source/inc/commonembobj.hxx @@ -27,7 +27,7 @@ #include <com/sun/star/document/XStorageBasedDocument.hpp> #include <com/sun/star/embed/XEmbeddedObject.hpp> #include <com/sun/star/embed/XVisualObject.hpp> -#include <com/sun/star/embed/XEmbedPersist.hpp> +#include <com/sun/star/embed/XEmbedPersist2.hpp> #include <com/sun/star/embed/XLinkageSupport.hpp> #include <com/sun/star/embed/XClassifiedObject.hpp> #include <com/sun/star/embed/XComponentSupplier.hpp> @@ -72,7 +72,7 @@ namespace comphelper { class Interceptor; class OCommonEmbeddedObject : public ::com::sun::star::embed::XEmbeddedObject - , public ::com::sun::star::embed::XEmbedPersist + , public ::com::sun::star::embed::XEmbedPersist2 , public ::com::sun::star::embed::XLinkageSupport , public ::com::sun::star::embed::XInplaceObject , public ::com::sun::star::container::XChild @@ -429,6 +429,10 @@ public: ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; +// XEmbedPersist2 + + virtual sal_Bool SAL_CALL isStored() + throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; // XInplaceObject |