diff options
author | obo <obo@openoffice.org> | 2010-06-18 10:54:35 +0200 |
---|---|---|
committer | obo <obo@openoffice.org> | 2010-06-18 10:54:35 +0200 |
commit | 3781c0d4846c9dd0adc14e6e809aa342ba5b7013 (patch) | |
tree | 52f672f03a99c91c4ae65ff509ef22dede986156 /oox/source/xls | |
parent | 33750471297793a14d19f783208f7d8019903570 (diff) | |
parent | 17ba50bbd1621c775da790213454acf95f5021a7 (diff) |
CWS-TOOLING: integrate CWS tl78
Diffstat (limited to 'oox/source/xls')
-rw-r--r-- | oox/source/xls/workbooksettings.cxx | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/oox/source/xls/workbooksettings.cxx b/oox/source/xls/workbooksettings.cxx index 40d400da7757..6fc5a330b8dd 100644 --- a/oox/source/xls/workbooksettings.cxx +++ b/oox/source/xls/workbooksettings.cxx @@ -26,9 +26,9 @@ ************************************************************************/ #include "oox/xls/workbooksettings.hxx" +#include <com/sun/star/sheet/XCalculatable.hpp> #include <com/sun/star/util/Date.hpp> #include <com/sun/star/util/XNumberFormatsSupplier.hpp> -#include <com/sun/star/sheet/XCalculatable.hpp> #include <comphelper/mediadescriptor.hxx> #include "properties.hxx" #include "oox/helper/attributelist.hxx" @@ -39,11 +39,16 @@ #include "oox/xls/unitconverter.hxx" using ::rtl::OUString; +using ::com::sun::star::beans::XPropertySet; +using ::com::sun::star::sheet::XCalculatable; +using ::com::sun::star::uno::Any; +using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::UNO_QUERY; +using ::com::sun::star::uno::UNO_QUERY_THROW; using ::com::sun::star::util::Date; using ::com::sun::star::util::XNumberFormatsSupplier; -using ::com::sun::star::sheet::XCalculatable; +using ::comphelper::MediaDescriptor; using ::oox::core::CodecHelper; namespace oox { @@ -293,10 +298,21 @@ void WorkbookSettings::finalizeImport() } // write protection - if( maFileSharing.mbRecommendReadOnly || (maFileSharing.mnPasswordHash != 0) ) + if( maFileSharing.mbRecommendReadOnly || (maFileSharing.mnPasswordHash != 0) ) try + { getBaseFilter().getMediaDescriptor()[ CREATE_OUSTRING( "ReadOnly" ) ] <<= true; - if( maFileSharing.mnPasswordHash != 0 ) - aPropSet.setProperty( PROP_WriteProtectionPassword, static_cast< sal_Int32 >( maFileSharing.mnPasswordHash ) ); + + Reference< XPropertySet > xDocumentSettings( getDocumentFactory()->createInstance( + CREATE_OUSTRING( "com.sun.star.document.Settings" ) ), UNO_QUERY_THROW ); + PropertySet aSettingsProp( xDocumentSettings ); + if( maFileSharing.mbRecommendReadOnly ) + aSettingsProp.setProperty( PROP_LoadReadonly, true ); +// if( maFileSharing.mnPasswordHash != 0 ) +// aSettingsProp.setProperty( PROP_ModifyPasswordHash, static_cast< sal_Int32 >( maFileSharing.mnPasswordHash ) ); + } + catch( Exception& ) + { + } // calculation settings Date aNullDate = getNullDate(); |