summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatarina Behrens <bubli@bubli.org>2014-09-17 21:40:34 +0200
committerDavid Tardon <dtardon@redhat.com>2014-10-02 08:22:43 +0000
commite5222cf76a94c4ec20664b3e6f5a48e00ee9669f (patch)
treef44443c1d098de556afd8fd76475d90fa9592532
parent06ec4f077cd3204d685f24bf5d245868df2ac211 (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/11758 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
-rw-r--r--filter/source/config/fragments/filters/draw8.xcu2
-rw-r--r--filter/source/config/fragments/filters/draw8_template.xcu2
-rw-r--r--filter/source/config/fragments/filters/impress8.xcu2
-rw-r--r--filter/source/config/fragments/filters/impress8_draw.xcu2
-rw-r--r--filter/source/config/fragments/filters/impress8_template.xcu2
-rw-r--r--sd/source/ui/unoidl/UnoDocumentSettings.cxx25
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 .
-->
<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 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 .
-->
<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 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 .
-->
<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 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 .
-->
<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 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 .
-->
<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 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<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 }
@@ -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<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;
@@ -1150,6 +1167,12 @@ throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
}
break;
+ case HANDLE_MODIFY_PASSWD:
+ {
+ *pValue <<= pDocSh->GetModifyPasswordInfo();
+ }
+ break;
+
case HANDLE_SAVE_VERSION:
{
*pValue <<= pDocSh->IsSaveVersionOnClose();