diff options
author | Katarina Behrens <bubli@bubli.org> | 2014-09-17 21:40:34 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <s.mehrbrodt@gmail.com> | 2014-09-25 13:17:07 +0000 |
commit | a895a27c6bd0af5c4880bcd9e6238b99af0eed51 (patch) | |
tree | 3e021408a1a4bd225086cab6a33de09c198d37fc /sd | |
parent | 52b8b3d3a55d38c49e183ec5d6ed5cc012f6f1d0 (diff) |
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/11495
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/unoidl/UnoDocumentSettings.cxx | 29 | ||||
-rw-r--r-- | sd/source/ui/view/drvwshrg.cxx | 1 |
2 files changed, 29 insertions, 1 deletions
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index a0de11fb609f..1a9c67f62b68 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -139,7 +139,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 }; @@ -200,6 +200,7 @@ enum SdDocumentSettingsPropertyHandles { OUString("PrinterIndependentLayout"),HANDLE_PRINTER_INDEPENDENT_LAYOUT,::cppu::UnoType<sal_Int16>::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 } @@ -388,6 +389,10 @@ uno::Sequence<beans::PropertyValue> return aRet; } +// Most of the code reading/writing UNO document settings is the same in +// sd, sc and sw and it is mostly copy-pasted back and forth. +// TODO: Move _setPropertyValues and _getPropertyValues to some shared +// place, at least for the settings that are common to sd, sc and sw void DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any* pValues) @@ -898,6 +903,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<PropertyValue> 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; @@ -1149,6 +1170,12 @@ throw (UnknownPropertyException, WrappedTargetException, RuntimeException) } break; + case HANDLE_MODIFY_PASSWD: + { + *pValue <<= pDocSh->GetModifyPasswordInfo(); + } + break; + case HANDLE_SAVE_VERSION: { *pValue <<= pDocSh->IsSaveVersionOnClose(); diff --git a/sd/source/ui/view/drvwshrg.cxx b/sd/source/ui/view/drvwshrg.cxx index 0e39e0adca41..321c1044f940 100644 --- a/sd/source/ui/view/drvwshrg.cxx +++ b/sd/source/ui/view/drvwshrg.cxx @@ -95,6 +95,7 @@ void GraphicViewShell::InitInterface_Impl() GetStaticInterface()->RegisterChildWindow(SID_NAVIGATOR, true); GetStaticInterface()->RegisterChildWindow(SfxTemplateDialogWrapper::GetChildWindowId()); + GetStaticInterface()->RegisterChildWindow(SfxInfoBarContainerChild::GetChildWindowId()); GetStaticInterface()->RegisterChildWindow(SvxFontWorkChildWindow::GetChildWindowId()); GetStaticInterface()->RegisterChildWindow(SvxColorChildWindow::GetChildWindowId()); GetStaticInterface()->RegisterChildWindow(Svx3DChildWindow::GetChildWindowId()); |