summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-03-21 09:22:54 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-03-21 09:27:35 +0100
commitaa483c1d6f3edeccc7afc3329cbd66e361928e56 (patch)
tree7ee65f27eef3c62172e45d30f18c34035067169d /oox
parent10b8a729031f9d940344532622a2ccfdbde67fac (diff)
Does this actually want to check for alphabetic characters?
...instead of for non-alphabetic ones, as it does ever since 14620c3b33cf0315a9b746a0a2418b78d6154821 "support import of key shortcut for macro ( Excel only )"? Things that suggest that that was a typo: * The preceding comment. * The fact that ooo::vba::parseKeyEvent will throw an exception for most input of the form '^' followed by a non-alphabetic character (see parseChar in filter/source/msfilter/msvbahelper.cxx). (Found when auditing uses of <ctype.h> is* functions. See d8ce3f60bad3ebaa0888b35f85ab1a211714bb14 "Fix ooo::vba::parseKeyEvent" for replacing isalpha with rtl::isAsciiAlpha here.) Change-Id: I6b133c51da64192ec6aef712579ad6f55aae3b1a
Diffstat (limited to 'oox')
-rw-r--r--oox/source/ole/vbamodule.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/oox/source/ole/vbamodule.cxx b/oox/source/ole/vbamodule.cxx
index 1451f4985e9e..193b560ec12b 100644
--- a/oox/source/ole/vbamodule.cxx
+++ b/oox/source/ole/vbamodule.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/script/vba/XVBAModuleInfo.hpp>
#include <com/sun/star/awt/KeyEvent.hpp>
#include <osl/diagnose.h>
+#include <rtl/character.hxx>
#include <filter/msfilter/msvbahelper.hxx>
#include "oox/helper/binaryinputstream.hxx"
#include "oox/helper/storagebase.hxx"
@@ -185,7 +186,7 @@ OUString VbaModule::readSourceCode( StorageBase& rVbaStrg ) const
// for Excel short cut key seems limited to cntrl+'a-z, A-Z'
OUString sKey = aCodeLine.copy( aCodeLine.lastIndexOf("= ") + 3, 1 );
// only alpha key valid for key shortcut, however the api will accept other keys
- if ( !isalpha( (char)sKey[ 0 ] ) )
+ if ( rtl::isAsciiAlpha( sKey[ 0 ] ) )
{
// cntrl modifier is explicit ( but could be cntrl+shift ), parseKeyEvent
// will handle and uppercase letter appropriately