filter/source/config/fragments/filters/draw8.xcu | 2 filter/source/config/fragments/filters/draw8_template.xcu | 2 filter/source/config/fragments/filters/impress8.xcu | 2 filter/source/config/fragments/filters/impress8_draw.xcu | 2 filter/source/config/fragments/filters/impress8_template.xcu | 2 sd/source/ui/unoidl/UnoDocumentSettings.cxx | 29 ++++++++++- sd/source/ui/view/drvwshrg.cxx | 1 7 files changed, 34 insertions(+), 6 deletions(-)
New commits: commit a895a27c6bd0af5c4880bcd9e6238b99af0eed51 Author: Katarina Behrens <bu...@bubli.org> Date: Wed Sep 17 21:40:34 2014 +0200 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.mehrbr...@gmail.com> Tested-by: Samuel Mehrbrodt <s.mehrbr...@gmail.com> diff --git a/filter/source/config/fragments/filters/draw8.xcu b/filter/source/config/fragments/filters/draw8.xcu index 6738cd8..70167a7 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 . --> <node oor:name="draw8" oor:op="replace"> - <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN DEFAULT PREFERRED ENCRYPTION</value></prop> + <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN DEFAULT PREFERRED ENCRYPTION PASSWORDTOMODIFY</value></prop> <prop oor:name="UIComponent"/> <prop oor:name="FilterService"/> <prop oor:name="UserData"><value>XML</value></prop> diff --git a/filter/source/config/fragments/filters/draw8_template.xcu b/filter/source/config/fragments/filters/draw8_template.xcu index b81730e..4103a27 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 . --> <node oor:name="draw8_template" oor:op="replace"> - <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ENCRYPTION</value></prop> + <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ENCRYPTION PASSWORDTOMODIFY</value></prop> <prop oor:name="UIComponent"/> <prop oor:name="FilterService"/> <prop oor:name="UserData"><value>CXMLV</value></prop> diff --git a/filter/source/config/fragments/filters/impress8.xcu b/filter/source/config/fragments/filters/impress8.xcu index 90e11da..9e564c8 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 . --> <node oor:name="impress8" oor:op="replace"> - <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN DEFAULT PREFERRED ENCRYPTION</value></prop> + <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN DEFAULT PREFERRED ENCRYPTION PASSWORDTOMODIFY</value></prop> <prop oor:name="UIComponent"/> <prop oor:name="FilterService"/> <prop oor:name="UserData"><value>XML</value></prop> diff --git a/filter/source/config/fragments/filters/impress8_draw.xcu b/filter/source/config/fragments/filters/impress8_draw.xcu index 5a5d5a2..47e0be9 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 . --> <node oor:name="impress8_draw" oor:op="replace"> - <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ENCRYPTION</value></prop> + <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE OWN ENCRYPTION PASSWORDTOMODIFY</value></prop> <prop oor:name="UIComponent"/> <prop oor:name="FilterService"/> <prop oor:name="UserData"><value>XML</value></prop> diff --git a/filter/source/config/fragments/filters/impress8_template.xcu b/filter/source/config/fragments/filters/impress8_template.xcu index c812fd2..fb3cf0c 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 . --> <node oor:name="impress8_template" oor:op="replace"> - <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ENCRYPTION</value></prop> + <prop oor:name="Flags"><value>IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ENCRYPTION PASSWORDTOMODIFY</value></prop> <prop oor:name="UIComponent"/> <prop oor:name="FilterService"/> <prop oor:name="UserData"><value>CXMLV</value></prop> diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index a0de11f..1a9c67f 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 0e39e0a..321c104 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()); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits