summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-08-23 22:22:32 +0300
committerTor Lillqvist <tml@collabora.com>2014-08-23 22:33:30 +0300
commit30ae83c268125383866d47a7ee3e4a5dfcf59f71 (patch)
treeab52f8ecd7ed9517d70e13b22843b7948f20c9e9 /cui
parent02f6c270e79879188b2be670c6db4feb56bb064e (diff)
fdo#82577: Handle KeyCode
Put the VCL KeyCode class in the vcl namespace. Avoids clash with the X11 KeyCode typedef. Change-Id: I624c9d937f7c5f5986d313b6c5f060bd8bb7e028
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/acccfg.cxx22
-rw-r--r--cui/source/customize/cfg.cxx2
-rw-r--r--cui/source/dialogs/SpellDialog.cxx2
-rw-r--r--cui/source/dialogs/colorpicker.cxx2
-rw-r--r--cui/source/dialogs/hangulhanjadlg.cxx8
-rw-r--r--cui/source/dialogs/thesdlg.cxx2
-rw-r--r--cui/source/inc/acccfg.hxx6
-rw-r--r--cui/source/options/optaboutconfig.cxx2
-rw-r--r--cui/source/options/optdict.cxx2
-rw-r--r--cui/source/options/optinet2.cxx2
-rw-r--r--cui/source/options/treeopt.cxx2
-rw-r--r--cui/source/tabpages/autocdlg.cxx6
12 files changed, 29 insertions, 29 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 311804cfd6c2..037abce3d564 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -688,9 +688,9 @@ void SfxAccCfgTabListBox_Impl::InitEntry(SvTreeListEntry* pEntry,
*/
void SfxAccCfgTabListBox_Impl::KeyInput(const KeyEvent& aKey)
{
- KeyCode aCode1 = aKey.GetKeyCode();
- sal_uInt16 nCode1 = aCode1.GetCode();
- sal_uInt16 nMod1 = aCode1.GetModifier();
+ vcl::KeyCode aCode1 = aKey.GetKeyCode();
+ sal_uInt16 nCode1 = aCode1.GetCode();
+ sal_uInt16 nMod1 = aCode1.GetModifier();
// is it related to our list box ?
if (
@@ -795,7 +795,7 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( Window* pParent, const SfxIt
long nMaxWidth = 0;
for ( sal_uInt16 i = 0; i < KEYCODE_ARRAY_SIZE; ++i )
{
- long nTmp = GetTextWidth( KeyCode( KEYCODE_ARRAY[i] ).GetName() );
+ long nTmp = GetTextWidth( vcl::KeyCode( KEYCODE_ARRAY[i] ).GetName() );
if ( nTmp > nMaxWidth )
nMaxWidth = nTmp;
}
@@ -930,8 +930,8 @@ void SfxAcceleratorConfigPage::Init(const css::uno::Reference< css::ui::XAcceler
sal_Int32 nListPos = 0;
for (i1=0; i1<c1; ++i1)
{
- KeyCode aKey = KEYCODE_ARRAY[i1];
- OUString sKey = aKey.GetName();
+ vcl::KeyCode aKey = KEYCODE_ARRAY[i1];
+ OUString sKey = aKey.GetName();
if (sKey.isEmpty())
continue;
TAccInfo* pEntry = new TAccInfo(i1, nListPos, aKey);
@@ -950,8 +950,8 @@ void SfxAcceleratorConfigPage::Init(const css::uno::Reference< css::ui::XAcceler
const css::awt::KeyEvent& aAWTKey = lKeys[i2];
OUString sCommand = xAccMgr->getCommandByKeyEvent(aAWTKey);
OUString sLabel = GetLabel4Command(sCommand);
- KeyCode aKeyCode = ::svt::AcceleratorExecute::st_AWTKey2VCLKey(aAWTKey);
- sal_uLong nPos = MapKeyCodeToPos(aKeyCode);
+ vcl::KeyCode aKeyCode = ::svt::AcceleratorExecute::st_AWTKey2VCLKey(aAWTKey);
+ sal_uLong nPos = MapKeyCodeToPos(aKeyCode);
if (nPos == TREELIST_ENTRY_NOTFOUND)
continue;
@@ -971,8 +971,8 @@ void SfxAcceleratorConfigPage::Init(const css::uno::Reference< css::ui::XAcceler
sal_uLong i3 = 0;
for (i3=0; i3<c3; ++i3)
{
- const KeyCode* pKeyCode = Application::GetReservedKeyCode(i3);
- sal_uLong nPos = MapKeyCodeToPos(*pKeyCode);
+ const vcl::KeyCode* pKeyCode = Application::GetReservedKeyCode(i3);
+ sal_uLong nPos = MapKeyCodeToPos(*pKeyCode);
if (nPos == TREELIST_ENTRY_NOTFOUND)
continue;
@@ -1483,7 +1483,7 @@ void SfxAcceleratorConfigPage::Reset( const SfxItemSet* rSet )
}
-sal_uLong SfxAcceleratorConfigPage::MapKeyCodeToPos(const KeyCode& aKey) const
+sal_uLong SfxAcceleratorConfigPage::MapKeyCodeToPos(const vcl::KeyCode& aKey) const
{
sal_uInt16 nCode1 = aKey.GetCode()+aKey.GetModifier();
SvTreeListEntry* pEntry = m_pEntriesBox->First();
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 34edd30e19e5..56d4bff2c6b0 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -1487,7 +1487,7 @@ TriState SvxMenuEntriesListBox::NotifyCopying(
void SvxMenuEntriesListBox::KeyInput( const KeyEvent& rKeyEvent )
{
- KeyCode keycode = rKeyEvent.GetKeyCode();
+ vcl::KeyCode keycode = rKeyEvent.GetKeyCode();
// support DELETE for removing the current entry
if ( keycode == KEY_DELETE )
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index a62e70292ff4..df7500531e31 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -1380,7 +1380,7 @@ bool SentenceEditWindow_Impl::PreNotify( NotifyEvent& rNEvt )
nSelectionType == INVALID, "cui.dialogs",
"selection type not set");
- const KeyCode& rKeyCode = rKeyEvt.GetKeyCode();
+ const vcl::KeyCode& rKeyCode = rKeyEvt.GetKeyCode();
bool bDelete = rKeyCode.GetCode() == KEY_DELETE;
bool bBackspace = rKeyCode.GetCode() == KEY_BACKSPACE;
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index 092c3823a59a..d972c2c02341 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -243,7 +243,7 @@ void HexColorControl::Paste()
bool HexColorControl::ImplProcessKeyInput( const KeyEvent& rKEv )
{
- const KeyCode& rKeyCode = rKEv.GetKeyCode();
+ const vcl::KeyCode& rKeyCode = rKEv.GetKeyCode();
if( rKeyCode.GetGroup() == KEYGROUP_ALPHA && !rKeyCode.IsMod1() && !rKeyCode.IsMod2() )
{
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index 5953a2128bb8..99a5b1f7b75b 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -1367,10 +1367,10 @@ namespace svx
bool nHandled = false;
if( rNEvt.GetType() == EVENT_KEYINPUT )
{
- const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
- const KeyCode& rKeyCode = pKEvt->GetKeyCode();
- sal_uInt16 nMod = rKeyCode.GetModifier();
- sal_uInt16 nCode = rKeyCode.GetCode();
+ const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
+ const vcl::KeyCode& rKeyCode = pKEvt->GetKeyCode();
+ sal_uInt16 nMod = rKeyCode.GetModifier();
+ sal_uInt16 nCode = rKeyCode.GetCode();
if( nCode == KEY_TAB && ( !nMod || KEY_SHIFT == nMod ) )
{
bool bUp = KEY_SHIFT == nMod;
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index 162862dbfa1a..d9d6ec7682aa 100644
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -236,7 +236,7 @@ SvTreeListEntry * ThesaurusAlternativesCtrl::AddEntry( sal_Int32 nVal, const OUS
void ThesaurusAlternativesCtrl::KeyInput( const KeyEvent& rKEvt )
{
- const KeyCode& rKey = rKEvt.GetKeyCode();
+ const vcl::KeyCode& rKey = rKEvt.GetKeyCode();
if (rKey.GetCode() == KEY_RETURN || rKey.GetCode() == KEY_ESCAPE)
GetParent()->KeyInput( rKEvt ); // parent will close dialog...
diff --git a/cui/source/inc/acccfg.hxx b/cui/source/inc/acccfg.hxx
index 9a3a1a30c128..7ece823d5b88 100644
--- a/cui/source/inc/acccfg.hxx
+++ b/cui/source/inc/acccfg.hxx
@@ -83,7 +83,7 @@ struct TAccInfo
public:
TAccInfo( sal_Int32 nKeyPos ,
sal_Int32 nListPos,
- const KeyCode& aKey )
+ const vcl::KeyCode& aKey )
: m_nKeyPos (nKeyPos )
, m_nListPos (nListPos )
, m_bIsConfigurable(true ) /**< its important to set sal_True as default -
@@ -101,7 +101,7 @@ struct TAccInfo
sal_Int32 m_nListPos;
bool m_bIsConfigurable;
OUString m_sCommand;
- KeyCode m_aKey;
+ vcl::KeyCode m_aKey;
};
namespace sfx2
@@ -160,7 +160,7 @@ private:
OUString GetLabel4Command(const OUString& rCommand);
void InitAccCfg();
- sal_uLong MapKeyCodeToPos( const KeyCode &rCode ) const;
+ sal_uLong MapKeyCodeToPos( const vcl::KeyCode &rCode ) const;
css::uno::Reference< css::frame::XModel > SearchForAlreadyLoadedDoc(const OUString& sName);
void StartFileDialog( WinBits nBits, const OUString& rTitle );
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index e918c8a6b702..2baf4f9e6a7d 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -68,7 +68,7 @@ void CuiCustomMultilineEdit::KeyInput( const KeyEvent& rKeyEvent )
bool bNonSpace = rKeyEvent.GetKeyCode().GetCode() != KEY_SPACE;
if( bNumericOnly && bNonSpace )
{
- const KeyCode& rKeyCode = rKeyEvent.GetKeyCode();
+ const vcl::KeyCode& rKeyCode = rKeyEvent.GetKeyCode();
sal_uInt16 nGroup = rKeyCode.GetGroup();
sal_uInt16 nKey = rKeyCode.GetCode();
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index 23c7d2355e55..f7ca6510f43f 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -779,7 +779,7 @@ IMPL_LINK(SvxEditDictionaryDialog, ModifyHdl, Edit*, pEdt)
void SvxDictEdit::KeyInput( const KeyEvent& rKEvt )
{
- const KeyCode aKeyCode = rKEvt.GetKeyCode();
+ const vcl::KeyCode aKeyCode = rKEvt.GetKeyCode();
const sal_uInt16 nModifier = aKeyCode.GetModifier();
if( aKeyCode.GetCode() == KEY_RETURN )
{
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 45f2a5423ba3..4909b894ebe6 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -106,7 +106,7 @@ void SvxNoSpaceEdit::KeyInput( const KeyEvent& rKEvent )
bool bValid = rKEvent.GetKeyCode().GetCode() != KEY_SPACE;
if (bValid && bOnlyNumeric)
{
- const KeyCode& rKeyCode = rKEvent.GetKeyCode();
+ const vcl::KeyCode& rKeyCode = rKEvent.GetKeyCode();
sal_uInt16 nGroup = rKeyCode.GetGroup();
sal_uInt16 nKey = rKeyCode.GetCode();
bValid = ( KEYGROUP_NUM == nGroup || KEYGROUP_CURSOR == nGroup ||
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index f6a48c5b3236..d7293b8bb1b5 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -888,7 +888,7 @@ bool OfaTreeOptionsDialog::Notify( NotifyEvent& rNEvt )
if ( rNEvt.GetType() == EVENT_KEYINPUT )
{
const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
- const KeyCode aKeyCode = pKEvt->GetKeyCode();
+ const vcl::KeyCode aKeyCode = pKEvt->GetKeyCode();
if( aKeyCode.GetCode() == KEY_PAGEUP ||
aKeyCode.GetCode() == KEY_PAGEDOWN)
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 27c0ba1b4194..29ed3c2e3e82 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -1693,7 +1693,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeAutoCorrEdit(Window *pParen
void AutoCorrEdit::KeyInput( const KeyEvent& rKEvt )
{
- const KeyCode aKeyCode = rKEvt.GetKeyCode();
+ const vcl::KeyCode aKeyCode = rKEvt.GetKeyCode();
const sal_uInt16 nModifier = aKeyCode.GetModifier();
if( aKeyCode.GetCode() == KEY_RETURN )
{
@@ -2130,7 +2130,7 @@ OfaAutoCompleteTabPage::OfaAutoCompleteTabPage(Window* pParent,
for( const sal_uInt16* pKeys = aKeyCodes; *pKeys; ++pKeys )
{
- KeyCode aKCode( *pKeys );
+ vcl::KeyCode aKCode( *pKeys );
sal_Int32 nPos = m_pDCBExpandKey->InsertEntry( aKCode.GetName() );
m_pDCBExpandKey->SetEntryData( nPos, (void*)(sal_uLong)*pKeys );
if( KEY_RETURN == *pKeys ) // default to RETURN
@@ -2326,7 +2326,7 @@ bool OfaAutoCompleteTabPage::AutoCompleteMultiListBox::PreNotify(
if( !nHandled && EVENT_KEYUP == rNEvt.GetType() )
{
- const KeyCode& rKeyCode = rNEvt.GetKeyEvent()->GetKeyCode();
+ const vcl::KeyCode& rKeyCode = rNEvt.GetKeyEvent()->GetKeyCode();
switch( rKeyCode.GetModifier() | rKeyCode.GetCode() )
{
case KEY_DELETE: