[Libreoffice-commits] core.git: oox/source
Stephan Bergmann
sbergman at redhat.com
Tue Mar 21 08:27:59 UTC 2017
oox/source/ole/vbamodule.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit aa483c1d6f3edeccc7afc3329cbd66e361928e56
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 21 09:22:54 2017 +0100
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
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
More information about the Libreoffice-commits
mailing list