[Libreoffice-commits] core.git: 2 commits - .git-hooks/commit-msg sfx2/source
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Tue Dec 3 19:24:05 UTC 2019
.git-hooks/commit-msg | 2 -
sfx2/source/doc/sfxbasemodel.cxx | 53 +++++++++++++++++++++++++++------------
2 files changed, 38 insertions(+), 17 deletions(-)
New commits:
commit ebd70d476c392b2c5a87295e01b8ea9c2e8de258
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 3 13:56:57 2019 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Dec 3 20:22:03 2019 +0100
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 at redhat.com>
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index f6068448e531..caa45967c99f 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1078,43 +1078,64 @@ 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 (!ok)
{
throw lang::IllegalArgumentException("Setting property not supported: " + rArg.Name,
comphelper::getProcessComponentContext(), 0);
commit 8eb8d64fa113091d3d4dec960faabf365d263149
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 3 13:55:08 2019 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Dec 3 20:21:33 2019 +0100
Don't count terminating newline when determining line length
Change-Id: I3a5d306f32697e160f008e73de38fc53f2f1dbda
Reviewed-on: https://gerrit.libreoffice.org/84349
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/.git-hooks/commit-msg b/.git-hooks/commit-msg
index 64fb7924956b..2c788fb0f622 100755
--- a/.git-hooks/commit-msg
+++ b/.git-hooks/commit-msg
@@ -41,7 +41,7 @@ fi
# ...and that it is not too long
-len="`head -n 1 $1 | wc -c`"
+len="`head -n 1 $1 | tr -d '\n' | wc -c`"
if [ "$len" -gt 79 ] ; then
abort "$1" "The first line is $len characters, please try to fit into 79 characters."
fi
More information about the Libreoffice-commits
mailing list