Kaydet (Commit) aa483c1d authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Does this actually want to check for alphabetic characters?

...instead of for non-alphabetic ones, as it does ever since
14620c3b "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
d8ce3f60 "Fix ooo::vba::parseKeyEvent" for
replacing isalpha with rtl::isAsciiAlpha here.)

Change-Id: I6b133c51da64192ec6aef712579ad6f55aae3b1a
üst 10b8a729
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment