summaryrefslogtreecommitdiff
path: root/sfx2/source/doc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-12-03 13:56:57 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-01-25 11:18:52 +0100
commitc859556fad59a66c9c3a1cc117ae942229cfa441 (patch)
tree07c72dcdcf399def61e356ac796b1ce841ea5246 /sfx2/source/doc
parent1e1e386752c95d1a1b106f5c92732d9a049e41ce (diff)
Also throw IllegalArgumentException for arguments of wrong type
Change-Id: I1b52accc3f0eec3e6232b8211bf7bcbf65ed18f8 Reviewed-on: https://gerrit.libreoffice.org/84350 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit ebd70d476c392b2c5a87295e01b8ea9c2e8de258)
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx60
1 files changed, 42 insertions, 18 deletions
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 9849ac86d642..cf27e3493bf0 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1063,48 +1063,72 @@ void SAL_CALL SfxBaseModel::setArgs(const Sequence<beans::PropertyValue>& aArgs)
{
OUString sValue;
bool bValue;
-
+ bool ok = false;
if (rArg.Name == "SuggestedSaveAsName")
{
- rArg.Value >>= sValue;
- pMedium->GetItemSet()->Put(SfxStringItem(SID_SUGGESTEDSAVEASNAME, sValue));
+ if (rArg.Value >>= sValue)
+ {
+ pMedium->GetItemSet()->Put(SfxStringItem(SID_SUGGESTEDSAVEASNAME, sValue));
+ ok = true;
+ }
}
else if (rArg.Name == "SuggestedSaveAsDir")
{
- rArg.Value >>= sValue;
- pMedium->GetItemSet()->Put(SfxStringItem(SID_SUGGESTEDSAVEASDIR, sValue));
+ if (rArg.Value >>= sValue)
+ {
+ pMedium->GetItemSet()->Put(SfxStringItem(SID_SUGGESTEDSAVEASDIR, sValue));
+ ok = true;
+ }
}
else if (rArg.Name == "LockContentExtraction")
{
- rArg.Value >>= bValue;
- pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_CONTENT_EXTRACTION, bValue));
+ if (rArg.Value >>= bValue)
+ {
+ pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_CONTENT_EXTRACTION, bValue));
+ ok = true;
+ }
}
else if (rArg.Name == "LockExport")
{
- rArg.Value >>= bValue;
- pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_EXPORT, bValue));
+ if (rArg.Value >>= bValue)
+ {
+ pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_EXPORT, bValue));
+ ok = true;
+ }
}
else if (rArg.Name == "LockPrint")
{
- rArg.Value >>= bValue;
- pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_PRINT, bValue));
+ if (rArg.Value >>= bValue)
+ {
+ pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_PRINT, bValue));
+ ok = true;
+ }
}
else if (rArg.Name == "LockSave")
{
- rArg.Value >>= bValue;
- pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_SAVE, bValue));
+ if (rArg.Value >>= bValue)
+ {
+ pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_SAVE, bValue));
+ ok = true;
+ }
}
else if (rArg.Name == "LockEditDoc")
{
- rArg.Value >>= bValue;
- pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_EDITDOC, bValue));
+ if (rArg.Value >>= bValue)
+ {
+ pMedium->GetItemSet()->Put(SfxBoolItem(SID_LOCK_EDITDOC, bValue));
+ ok = true;
+ }
}
else if (rArg.Name == "Replaceable")
{
- rArg.Value >>= bValue;
- pMedium->GetItemSet()->Put(SfxBoolItem(SID_REPLACEABLE, bValue));
+ if (rArg.Value >>= bValue)
+ {
+ pMedium->GetItemSet()->Put(SfxBoolItem(SID_REPLACEABLE, bValue));
+ ok = true;
+ }
}
- else
+ if (!ok)
{
throw lang::IllegalArgumentException("Setting property not supported: " + rArg.Name,
comphelper::getProcessComponentContext(), 0);