summaryrefslogtreecommitdiff
path: root/vcl/source/outdev
diff options
context:
space:
mode:
authorSimon Long <simon@raspberrypi.org>2015-07-08 18:02:50 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-07-09 15:07:24 +0000
commit74407aef94b6d8dfdd69891c4a6e578587ef3e71 (patch)
treecc8c8f9cde981f90760cb7fdaa02688713989f83 /vcl/source/outdev
parent40ade8d04380083e383d6a6e50e5c254fcde2b2f (diff)
tdf#92630 Enable auto-accelerator behaviour for gtk
Change-Id: I671177dd1f9e535c28a29bcbd6b74f1c789371ea Reviewed-on: https://gerrit.libreoffice.org/16883 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/outdev')
-rw-r--r--vcl/source/outdev/text.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 69e957ecb6eb..51ca684bba20 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -2230,6 +2230,9 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr,
}
}
+ bool accel = ImplGetSVData()->maNWFData.mbEnableAccel;
+ bool autoacc = ImplGetSVData()->maNWFData.mbAutoAccel;
+
if ( nStyle & DrawTextFlags::Disable && ! pVector )
{
Color aOldTextColor;
@@ -2266,7 +2269,8 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr,
SetTextColor( GetSettings().GetStyleSettings().GetDisableColor() );
DrawText( rPos, aStr, nIndex, nLen, pVector, pDisplayText );
- if ( !(GetSettings().GetStyleSettings().GetOptions() & StyleSettingsOptions::NoMnemonics) && !pVector )
+ if ( !(GetSettings().GetStyleSettings().GetOptions() & StyleSettingsOptions::NoMnemonics) && !pVector
+ && accel && (!autoacc || !(nStyle & DrawTextFlags::HideMnemonic)) )
{
if ( nMnemonicPos != -1 )
ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );
@@ -2278,7 +2282,8 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr,
else
{
DrawText( rPos, aStr, nIndex, nLen, pVector, pDisplayText );
- if ( !(GetSettings().GetStyleSettings().GetOptions() & StyleSettingsOptions::NoMnemonics) && !pVector )
+ if ( !(GetSettings().GetStyleSettings().GetOptions() & StyleSettingsOptions::NoMnemonics) && !pVector
+ && accel && (!autoacc || !(nStyle & DrawTextFlags::HideMnemonic)) )
{
if ( nMnemonicPos != -1 )
ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth );