From e5222cf76a94c4ec20664b3e6f5a48e00ee9669f Mon Sep 17 00:00:00 2001 From: Katarina Behrens Date: Wed, 17 Sep 2014 21:40:34 +0200 Subject: fdo#63483: support for modify passwd in Impress and Draw iow, allow opening Impress and Draw ODF documents read-only Change-Id: I379b9f92b9bfb20e99998177d9a5fae80069d98f Reviewed-on: https://gerrit.libreoffice.org/11758 Reviewed-by: David Tardon Tested-by: David Tardon --- filter/source/config/fragments/filters/draw8.xcu | 2 +- .../config/fragments/filters/draw8_template.xcu | 2 +- .../source/config/fragments/filters/impress8.xcu | 2 +- .../config/fragments/filters/impress8_draw.xcu | 2 +- .../config/fragments/filters/impress8_template.xcu | 2 +- sd/source/ui/unoidl/UnoDocumentSettings.cxx | 25 +++++++++++++++++++++- 6 files changed, 29 insertions(+), 6 deletions(-) diff --git a/filter/source/config/fragments/filters/draw8.xcu b/filter/source/config/fragments/filters/draw8.xcu index 6738cd849b97..70167a74db76 100644 --- a/filter/source/config/fragments/filters/draw8.xcu +++ b/filter/source/config/fragments/filters/draw8.xcu @@ -16,7 +16,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> - IMPORT EXPORT TEMPLATE OWN DEFAULT PREFERRED ENCRYPTION + IMPORT EXPORT TEMPLATE OWN DEFAULT PREFERRED ENCRYPTION PASSWORDTOMODIFY XML diff --git a/filter/source/config/fragments/filters/draw8_template.xcu b/filter/source/config/fragments/filters/draw8_template.xcu index b81730ea9f8b..4103a27f661d 100644 --- a/filter/source/config/fragments/filters/draw8_template.xcu +++ b/filter/source/config/fragments/filters/draw8_template.xcu @@ -16,7 +16,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> - IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ENCRYPTION + IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ENCRYPTION PASSWORDTOMODIFY CXMLV diff --git a/filter/source/config/fragments/filters/impress8.xcu b/filter/source/config/fragments/filters/impress8.xcu index 90e11daca149..9e564c833d63 100644 --- a/filter/source/config/fragments/filters/impress8.xcu +++ b/filter/source/config/fragments/filters/impress8.xcu @@ -16,7 +16,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> - IMPORT EXPORT TEMPLATE OWN DEFAULT PREFERRED ENCRYPTION + IMPORT EXPORT TEMPLATE OWN DEFAULT PREFERRED ENCRYPTION PASSWORDTOMODIFY XML diff --git a/filter/source/config/fragments/filters/impress8_draw.xcu b/filter/source/config/fragments/filters/impress8_draw.xcu index 5a5d5a23b003..47e0be952317 100644 --- a/filter/source/config/fragments/filters/impress8_draw.xcu +++ b/filter/source/config/fragments/filters/impress8_draw.xcu @@ -16,7 +16,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> - IMPORT EXPORT TEMPLATE OWN ENCRYPTION + IMPORT EXPORT TEMPLATE OWN ENCRYPTION PASSWORDTOMODIFY XML diff --git a/filter/source/config/fragments/filters/impress8_template.xcu b/filter/source/config/fragments/filters/impress8_template.xcu index c812fd2b240c..fb3cf0c4f960 100644 --- a/filter/source/config/fragments/filters/impress8_template.xcu +++ b/filter/source/config/fragments/filters/impress8_template.xcu @@ -16,7 +16,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> - IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ENCRYPTION + IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ENCRYPTION PASSWORDTOMODIFY CXMLV diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index 9ba698d32e12..65a646d88ef8 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -140,7 +140,7 @@ enum SdDocumentSettingsPropertyHandles HANDLE_PRINTERNAME, HANDLE_PRINTERJOB, HANDLE_PARAGRAPHSUMMATION, HANDLE_CHARCOMPRESS, HANDLE_ASIANPUNCT, HANDLE_UPDATEFROMTEMPLATE, HANDLE_PRINTER_INDEPENDENT_LAYOUT // #i33095# - ,HANDLE_LOAD_READONLY, HANDLE_SAVE_VERSION + ,HANDLE_LOAD_READONLY, HANDLE_MODIFY_PASSWD, HANDLE_SAVE_VERSION ,HANDLE_SLIDESPERHANDOUT, HANDLE_HANDOUTHORIZONTAL, HANDLE_EMBED_FONTS }; @@ -201,6 +201,7 @@ enum SdDocumentSettingsPropertyHandles { OUString("PrinterIndependentLayout"),HANDLE_PRINTER_INDEPENDENT_LAYOUT,::cppu::UnoType::get(), 0, 0 }, // --> #i33095# { OUString("LoadReadonly"), HANDLE_LOAD_READONLY, ::getBooleanCppuType(), 0, 0 }, + { OUString("ModifyPasswordInfo"), HANDLE_MODIFY_PASSWD, ::getCppuType((uno::Sequence < beans::PropertyValue > *)0), 0, 0 }, { OUString("SaveVersionOnClose"), HANDLE_SAVE_VERSION, ::getBooleanCppuType(), 0, 0 }, { OUString("EmbedFonts"), HANDLE_EMBED_FONTS, ::getBooleanCppuType(), 0, 0 }, { OUString(), 0, css::uno::Type(), 0, 0 } @@ -899,6 +900,22 @@ throw (UnknownPropertyException, PropertyVetoException, } break; + case HANDLE_MODIFY_PASSWD: + { + uno::Sequence< beans::PropertyValue > aInfo; + if ( !( *pValues >>= aInfo ) ) + throw lang::IllegalArgumentException( + OUString( "Value of type Sequence expected!" ), + uno::Reference< uno::XInterface >(), + 2 ); + + if ( !pDocSh->SetModifyPasswordInfo( aInfo ) ) + throw beans::PropertyVetoException( + "The hash is not allowed to be changed now!" ); + + } + break; + case HANDLE_SAVE_VERSION: { bool bNewValue = false; @@ -1150,6 +1167,12 @@ throw (UnknownPropertyException, WrappedTargetException, RuntimeException) } break; + case HANDLE_MODIFY_PASSWD: + { + *pValue <<= pDocSh->GetModifyPasswordInfo(); + } + break; + case HANDLE_SAVE_VERSION: { *pValue <<= pDocSh->IsSaveVersionOnClose(); -- cgit v1.2.3