diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2004-11-26 15:16:26 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2004-11-26 15:16:26 +0000 |
commit | a250b0cdb2575b4be42f62d531109e7ddefc07b6 (patch) | |
tree | 781ee2aa18e7b3c685125953974a173b71ed075f /sfx2/source/doc/guisaveas.cxx | |
parent | fcf40ba6c7e99e2a48ee0ed5991b0afce544a328 (diff) |
INTEGRATION: CWS cd03 (1.3.4); FILE MERGED
2004/11/17 17:32:34 mav 1.3.4.1: #i37232# allow to provide some arguments on save operation
Diffstat (limited to 'sfx2/source/doc/guisaveas.cxx')
-rw-r--r-- | sfx2/source/doc/guisaveas.cxx | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index e3b98f84a4..b11321f747 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -2,9 +2,9 @@ * * $RCSfile: guisaveas.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: obo $ $Date: 2004-11-17 15:34:06 $ + * last change: $Author: rt $ $Date: 2004-11-26 16:16:26 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -110,6 +110,9 @@ #ifndef _COM_SUN_STAR_FRAME_XSTORABLE_HPP_ #include <com/sun/star/frame/XStorable.hpp> #endif +#ifndef _COM_SUN_STAR_FRAME_XSTORABLE2_HPP_ +#include <com/sun/star/frame/XStorable2.hpp> +#endif #ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HPP_ #include <com/sun/star/frame/XDispatchProvider.hpp> #endif @@ -238,6 +241,7 @@ class ModelData_Impl SfxStoringHelper* m_pOwner; uno::Reference< frame::XModel > m_xModel; uno::Reference< frame::XStorable > m_xStorable; + uno::Reference< frame::XStorable2 > m_xStorable2; uno::Reference< util::XModifiable > m_xModifiable; ::rtl::OUString m_aDocumentServiceName; @@ -257,6 +261,7 @@ public: uno::Reference< frame::XModel > GetModel(); uno::Reference< frame::XStorable > GetStorable(); + uno::Reference< frame::XStorable2 > GetStorable2(); uno::Reference< util::XModifiable > GetModifiable(); ::comphelper::SequenceAsHashMap& GetMediaDescr() { return m_aMediaDescrHM; } @@ -345,6 +350,19 @@ uno::Reference< frame::XStorable > ModelData_Impl::GetStorable() } //------------------------------------------------------------------------- +uno::Reference< frame::XStorable2 > ModelData_Impl::GetStorable2() +{ + if ( !m_xStorable2.is() ) + { + m_xStorable2 = uno::Reference< frame::XStorable2 >( m_xModel, uno::UNO_QUERY ); + if ( !m_xStorable2.is() ) + throw uno::RuntimeException(); + } + + return m_xStorable2; +} + +//------------------------------------------------------------------------- uno::Reference< util::XModifiable > ModelData_Impl::GetModifiable() { if ( !m_xModifiable.is() ) @@ -1161,7 +1179,25 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& { // Document properties can contain streams that should be freed before storing aModelData.FreeDocumentProps(); - aModelData.GetStorable()->store(); + + if ( aModelData.GetStorable2().is() ) + { + try + { + aModelData.GetStorable2()->storeSelf( aModelData.GetMediaDescr().getAsConstPropertyValueList() ); + } + catch( lang::IllegalArgumentException& ) + { + OSL_ENSURE( sal_False, "ModelData didn't handle illegal parameters, all the parameters are ignored!\n" ); + aModelData.GetStorable()->store(); + } + } + else + { + OSL_ENSURE( sal_False, "XStorable2 is not supported by the model!\n" ); + aModelData.GetStorable()->store(); + } + return sal_False; } else |