summaryrefslogtreecommitdiff
path: root/svtools/source/uno/unoevent.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-22 15:32:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-23 09:04:48 +0200
commitee6bdeec8d618f039e72d496dff44beb5b99abb2 (patch)
treeeabd23b280c8a819137b3a2b22507ed8f1bfb858 /svtools/source/uno/unoevent.cxx
parenta8622c77d26ca7a635afc95bba9a5054dc31eb7c (diff)
loplugin:flatten in svl..svx
and implement a check in the plugin to prevent us modifying the same patch of source code twice. This logic should probably be moved into plugin.cxx at some point. Change-Id: I7ebff6424cc8733bb2c8f7dba75eaaec68649290 Reviewed-on: https://gerrit.libreoffice.org/42660 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools/source/uno/unoevent.cxx')
-rw-r--r--svtools/source/uno/unoevent.cxx50
1 files changed, 24 insertions, 26 deletions
diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx
index 351f6a76b999..7125562135b6 100644
--- a/svtools/source/uno/unoevent.cxx
+++ b/svtools/source/uno/unoevent.cxx
@@ -196,39 +196,37 @@ void getMacroFromAny(
// else: unknown PropertyValue -> ignore
}
- if (bTypeOK)
+ if (!bTypeOK)
{
- if (bNone)
+ // no valid type: abort
+ throw IllegalArgumentException();
+ }
+
+ if (bNone)
+ {
+ // return empty macro
+ rMacro = SvxMacro( "", "" );
+ }
+ else
+ {
+ if (eType == STARBASIC)
{
- // return empty macro
- rMacro = SvxMacro( "", "" );
+ // create macro and return
+ SvxMacro aMacro(sMacroVal, sLibVal, eType);
+ rMacro = aMacro;
+ }
+ else if (eType == EXTENDED_STYPE)
+ {
+ SvxMacro aMacro(sScriptVal, sScript);
+ rMacro = aMacro;
}
else
{
- if (eType == STARBASIC)
- {
- // create macro and return
- SvxMacro aMacro(sMacroVal, sLibVal, eType);
- rMacro = aMacro;
- }
- else if (eType == EXTENDED_STYPE)
- {
- SvxMacro aMacro(sScriptVal, sScript);
- rMacro = aMacro;
- }
- else
- {
- // we can't process type: abort
- // TODO: JavaScript macros
- throw IllegalArgumentException();
- }
+ // we can't process type: abort
+ // TODO: JavaScript macros
+ throw IllegalArgumentException();
}
}
- else
- {
- // no valid type: abort
- throw IllegalArgumentException();
- }
}
}