LibreOffice Module cui (master) 1
acccfg.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20// include own files
21
22#include <acccfg.hxx>
23#include <cfgutil.hxx>
24#include <dialmgr.hxx>
25
27#include <sfx2/minfitem.hxx>
28#include <sfx2/sfxresid.hxx>
29
30#include <sal/macros.h>
31#include <vcl/event.hxx>
32
33#include <strings.hrc>
34#include <sfx2/strings.hrc>
35#include <svx/svxids.hrc>
36
37// include interface declarations
38#include <com/sun/star/beans/XPropertySet.hpp>
39#include <com/sun/star/embed/StorageFactory.hpp>
40#include <com/sun/star/embed/XTransactedObject.hpp>
41#include <com/sun/star/embed/ElementModes.hpp>
42#include <com/sun/star/form/XReset.hpp>
43#include <com/sun/star/frame/Desktop.hpp>
44#include <com/sun/star/frame/XController.hpp>
45#include <com/sun/star/frame/XModel.hpp>
46#include <com/sun/star/frame/ModuleManager.hpp>
47#include <com/sun/star/frame/theUICommandDescription.hpp>
48#include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp>
49#include <com/sun/star/ui/theModuleUIConfigurationManagerSupplier.hpp>
50#include <com/sun/star/ui/UIConfigurationManager.hpp>
51#include <com/sun/star/ui/XUIConfigurationManager.hpp>
52#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
53
54// include search util
55#include <com/sun/star/util/SearchFlags.hpp>
56#include <com/sun/star/util/SearchAlgorithms2.hpp>
58
59// include other projects
62#include <vcl/svapp.hxx>
64#include <config_features.h>
65
66#include <com/sun/star/frame/LayoutManager.hpp>
67
68// namespaces
69
70using namespace css;
71
72constexpr OUStringLiteral FOLDERNAME_UICONFIG = u"Configurations2";
73
74constexpr OUStringLiteral MEDIATYPE_PROPNAME = u"MediaType";
75
76const sal_uInt16 KEYCODE_ARRAY[] = { KEY_F1,
77 KEY_F2,
78 KEY_F3,
79 KEY_F4,
80 KEY_F5,
81 KEY_F6,
82 KEY_F7,
83 KEY_F8,
84 KEY_F9,
85 KEY_F10,
86 KEY_F11,
87 KEY_F12,
88 KEY_F13,
89 KEY_F14,
90 KEY_F15,
91 KEY_F16,
92
94 KEY_UP,
98 KEY_END,
106
107 KEY_OPEN,
108 KEY_CUT,
109 KEY_COPY,
110 KEY_PASTE,
111 KEY_UNDO,
113 KEY_FIND,
115 KEY_FRONT,
117 KEY_MENU,
118 KEY_HELP,
119
136
152
153 KEY_MOD1 | KEY_0,
154 KEY_MOD1 | KEY_1,
155 KEY_MOD1 | KEY_2,
156 KEY_MOD1 | KEY_3,
157 KEY_MOD1 | KEY_4,
158 KEY_MOD1 | KEY_5,
159 KEY_MOD1 | KEY_6,
160 KEY_MOD1 | KEY_7,
161 KEY_MOD1 | KEY_8,
162 KEY_MOD1 | KEY_9,
163 KEY_MOD1 | KEY_A,
164 KEY_MOD1 | KEY_B,
165 KEY_MOD1 | KEY_C,
166 KEY_MOD1 | KEY_D,
167 KEY_MOD1 | KEY_E,
168 KEY_MOD1 | KEY_F,
169 KEY_MOD1 | KEY_G,
170 KEY_MOD1 | KEY_H,
171 KEY_MOD1 | KEY_I,
172 KEY_MOD1 | KEY_J,
173 KEY_MOD1 | KEY_K,
174 KEY_MOD1 | KEY_L,
175 KEY_MOD1 | KEY_M,
176 KEY_MOD1 | KEY_N,
177 KEY_MOD1 | KEY_O,
178 KEY_MOD1 | KEY_P,
179 KEY_MOD1 | KEY_Q,
180 KEY_MOD1 | KEY_R,
181 KEY_MOD1 | KEY_S,
182 KEY_MOD1 | KEY_T,
183 KEY_MOD1 | KEY_U,
184 KEY_MOD1 | KEY_V,
185 KEY_MOD1 | KEY_W,
186 KEY_MOD1 | KEY_X,
187 KEY_MOD1 | KEY_Y,
188 KEY_MOD1 | KEY_Z,
200
217
231
237
285
302
318
319 KEY_MOD2 | KEY_0,
320 KEY_MOD2 | KEY_1,
321 KEY_MOD2 | KEY_2,
322 KEY_MOD2 | KEY_3,
323 KEY_MOD2 | KEY_4,
324 KEY_MOD2 | KEY_5,
325 KEY_MOD2 | KEY_6,
326 KEY_MOD2 | KEY_7,
327 KEY_MOD2 | KEY_8,
328 KEY_MOD2 | KEY_9,
329 KEY_MOD2 | KEY_A,
330 KEY_MOD2 | KEY_B,
331 KEY_MOD2 | KEY_C,
332 KEY_MOD2 | KEY_D,
333 KEY_MOD2 | KEY_E,
334 KEY_MOD2 | KEY_F,
335 KEY_MOD2 | KEY_G,
336 KEY_MOD2 | KEY_H,
337 KEY_MOD2 | KEY_I,
338 KEY_MOD2 | KEY_J,
339 KEY_MOD2 | KEY_K,
340 KEY_MOD2 | KEY_L,
341 KEY_MOD2 | KEY_M,
342 KEY_MOD2 | KEY_N,
343 KEY_MOD2 | KEY_O,
344 KEY_MOD2 | KEY_P,
345 KEY_MOD2 | KEY_Q,
346 KEY_MOD2 | KEY_R,
347 KEY_MOD2 | KEY_S,
348 KEY_MOD2 | KEY_T,
349 KEY_MOD2 | KEY_U,
350 KEY_MOD2 | KEY_V,
351 KEY_MOD2 | KEY_W,
352 KEY_MOD2 | KEY_X,
353 KEY_MOD2 | KEY_Y,
354 KEY_MOD2 | KEY_Z,
365
382
397
444
461
477
525
542
556
603
620
635
636#ifdef __APPLE__
637 ,
638 KEY_MOD3 | KEY_0,
639 KEY_MOD3 | KEY_1,
640 KEY_MOD3 | KEY_2,
641 KEY_MOD3 | KEY_3,
642 KEY_MOD3 | KEY_4,
643 KEY_MOD3 | KEY_5,
644 KEY_MOD3 | KEY_6,
645 KEY_MOD3 | KEY_7,
646 KEY_MOD3 | KEY_8,
647 KEY_MOD3 | KEY_9,
648 KEY_MOD3 | KEY_A,
649 KEY_MOD3 | KEY_B,
650 KEY_MOD3 | KEY_C,
651 KEY_MOD3 | KEY_D,
652 KEY_MOD3 | KEY_E,
653 KEY_MOD3 | KEY_F,
654 KEY_MOD3 | KEY_G,
655 KEY_MOD3 | KEY_H,
656 KEY_MOD3 | KEY_I,
657 KEY_MOD3 | KEY_J,
658 KEY_MOD3 | KEY_K,
659 KEY_MOD3 | KEY_L,
660 KEY_MOD3 | KEY_M,
661 KEY_MOD3 | KEY_N,
662 KEY_MOD3 | KEY_O,
663 KEY_MOD3 | KEY_P,
664 KEY_MOD3 | KEY_Q,
665 KEY_MOD3 | KEY_R,
666 KEY_MOD3 | KEY_S,
667 KEY_MOD3 | KEY_T,
668 KEY_MOD3 | KEY_U,
669 KEY_MOD3 | KEY_V,
670 KEY_MOD3 | KEY_W,
671 KEY_MOD3 | KEY_X,
672 KEY_MOD3 | KEY_Y,
673 KEY_MOD3 | KEY_Z,
685
702
716
722
770
787
803#endif
804};
805
806const sal_uInt16 KEYCODE_ARRAY_SIZE = std::size(KEYCODE_ARRAY);
807
811IMPL_LINK(SfxAcceleratorConfigPage, KeyInputHdl, const KeyEvent&, rKey, bool)
812{
813 vcl::KeyCode aCode1 = rKey.GetKeyCode();
814 sal_uInt16 nCode1 = aCode1.GetCode();
815 sal_uInt16 nMod1 = aCode1.GetModifier();
816
817 // is it related to our list box ?
818 if ((nCode1 == KEY_DOWN) || (nCode1 == KEY_UP) || (nCode1 == KEY_LEFT) || (nCode1 == KEY_RIGHT)
819 || (nCode1 == KEY_PAGEUP) || (nCode1 == KEY_PAGEDOWN))
820 // no - handle it as normal dialog input
821 return false;
822
823 for (int i = 0, nCount = m_xEntriesBox->n_children(); i < nCount; ++i)
824 {
825 TAccInfo* pUserData = weld::fromId<TAccInfo*>(m_xEntriesBox->get_id(i));
826 if (pUserData)
827 {
828 sal_uInt16 nCode2 = pUserData->m_aKey.GetCode();
829 sal_uInt16 nMod2 = pUserData->m_aKey.GetModifier();
830
831 if (nCode1 == nCode2 && nMod1 == nMod2)
832 {
833 m_xEntriesBox->select(i);
834 m_xEntriesBox->scroll_to_row(i);
835 return true;
836 }
837 }
838 }
839
840 // no - handle it as normal dialog input
841 return false;
842}
843
845 weld::DialogController* pController,
846 const SfxItemSet& aSet)
847 : SfxTabPage(pPage, pController, "cui/ui/accelconfigpage.ui", "AccelConfigPage", &aSet)
848#if HAVE_FEATURE_SCRIPTING
849 , m_pMacroInfoItem()
850#endif
851 , aLoadAccelConfigStr(CuiResId(RID_CUISTR_LOADACCELCONFIG))
852 , aSaveAccelConfigStr(CuiResId(RID_CUISTR_SAVEACCELCONFIG))
853 , aFilterAllStr(SfxResId(STR_SFX_FILTERNAME_ALL))
854 , aFilterCfgStr(CuiResId(RID_CUISTR_FILTERNAME_CFG))
855 , m_bStylesInfoInitialized(false)
856 , m_aUpdateDataTimer("SfxAcceleratorConfigPage UpdateDataTimer")
857 , m_aFillGroupIdle("SfxAcceleratorConfigPage m_aFillGroupIdle")
858 , m_xEntriesBox(m_xBuilder->weld_tree_view("shortcuts"))
859 , m_xOfficeButton(m_xBuilder->weld_radio_button("office"))
860 , m_xModuleButton(m_xBuilder->weld_radio_button("module"))
861 , m_xChangeButton(m_xBuilder->weld_button("change"))
862 , m_xRemoveButton(m_xBuilder->weld_button("delete"))
863 , m_xGroupLBox(new CuiConfigGroupListBox(m_xBuilder->weld_tree_view("category")))
864 , m_xFunctionBox(new CuiConfigFunctionListBox(m_xBuilder->weld_tree_view("function")))
865 , m_xKeyBox(m_xBuilder->weld_tree_view("keys"))
866 , m_xSearchEdit(m_xBuilder->weld_entry("searchEntry"))
867 , m_xLoadButton(m_xBuilder->weld_button("load"))
868 , m_xSaveButton(m_xBuilder->weld_button("save"))
869 , m_xResetButton(m_xBuilder->weld_button("reset"))
870{
871 Size aSize(m_xEntriesBox->get_approximate_digit_width() * 40,
872 m_xEntriesBox->get_height_rows(10));
873 m_xEntriesBox->set_size_request(aSize.Width(), aSize.Height());
874 aSize = Size(m_xEntriesBox->get_approximate_digit_width() * 19,
875 m_xEntriesBox->get_height_rows(9));
876 m_xGroupLBox->set_size_request(aSize.Width(), aSize.Height());
877 aSize = Size(m_xEntriesBox->get_approximate_digit_width() * 21,
878 m_xEntriesBox->get_height_rows(9));
879 m_xFunctionBox->set_size_request(aSize.Width(), aSize.Height());
880 aSize = Size(m_xEntriesBox->get_approximate_digit_width() * 20,
881 m_xEntriesBox->get_height_rows(9));
882 m_xKeyBox->set_size_request(aSize.Width(), aSize.Height());
883
884 // install handler functions
885 m_xChangeButton->connect_clicked(LINK(this, SfxAcceleratorConfigPage, ChangeHdl));
886 m_xRemoveButton->connect_clicked(LINK(this, SfxAcceleratorConfigPage, RemoveHdl));
887 m_xEntriesBox->connect_changed(LINK(this, SfxAcceleratorConfigPage, SelectHdl));
888 m_xEntriesBox->connect_key_press(LINK(this, SfxAcceleratorConfigPage, KeyInputHdl));
889 m_xGroupLBox->connect_changed(LINK(this, SfxAcceleratorConfigPage, SelectHdl));
890 m_xFunctionBox->connect_changed(LINK(this, SfxAcceleratorConfigPage, SelectHdl));
891 m_xKeyBox->connect_changed(LINK(this, SfxAcceleratorConfigPage, SelectHdl));
892 m_xLoadButton->connect_clicked(LINK(this, SfxAcceleratorConfigPage, Load));
893 m_xSaveButton->connect_clicked(LINK(this, SfxAcceleratorConfigPage, Save));
894 m_xResetButton->connect_clicked(LINK(this, SfxAcceleratorConfigPage, Default));
895 m_xOfficeButton->connect_toggled(LINK(this, SfxAcceleratorConfigPage, RadioHdl));
896 m_xSearchEdit->connect_changed(LINK(this, SfxAcceleratorConfigPage, SearchUpdateHdl));
897 m_xSearchEdit->connect_focus_out(LINK(this, SfxAcceleratorConfigPage, FocusOut_Impl));
898
899 // detect max keyname width
900 int nMaxWidth = 0;
901 for (unsigned short i : KEYCODE_ARRAY)
902 {
903 int nTmp = m_xEntriesBox->get_pixel_size(vcl::KeyCode(i).GetName()).Width();
904 if (nTmp > nMaxWidth)
905 nMaxWidth = nTmp;
906 }
907 // recalc second tab
908 auto nNewTab = nMaxWidth + 5; // additional space
909
910 // initialize Entriesbox
911 std::vector<int> aWidths{ nNewTab };
912 m_xEntriesBox->set_column_fixed_widths(aWidths);
913
914 //Initialize search util
915 m_options.AlgorithmType2 = util::SearchAlgorithms2::ABSOLUTE;
916 m_options.transliterateFlags |= TransliterationFlags::IGNORE_CASE;
918 |= (util::SearchFlags::REG_NOT_BEGINOFLINE | util::SearchFlags::REG_NOT_ENDOFLINE);
919 // initialize GroupBox
920 m_xGroupLBox->SetFunctionListBox(m_xFunctionBox.get());
921
922 // initialize KeyBox
923 m_xKeyBox->make_sorted();
924
927
929 m_aFillGroupIdle.SetPriority(TaskPriority::HIGHEST);
930}
931
933{
935
936 // free memory - remove all dynamic user data
937 for (int i = 0, nCount = m_xEntriesBox->n_children(); i < nCount; ++i)
938 {
939 TAccInfo* pUserData = weld::fromId<TAccInfo*>(m_xEntriesBox->get_id(i));
940 delete pUserData;
941 }
942}
943
945{
946 // already initialized ?
947 if (m_xContext.is())
948 return; // yes -> do nothing
949
950 try
951 {
952 // no - initialize this instance
954
955 m_xUICmdDescription = frame::theUICommandDescription::get(m_xContext);
956
957 // get the current active frame, which should be our "parent"
958 // for this session
959 m_xFrame = GetFrame();
960 if (!m_xFrame.is())
961 {
962 uno::Reference<frame::XDesktop2> xDesktop = frame::Desktop::create(m_xContext);
963 m_xFrame = xDesktop->getActiveFrame();
964 }
965
966 // identify module
968 = frame::ModuleManager::create(m_xContext);
969 m_sModuleLongName = xModuleManager->identify(m_xFrame);
970 comphelper::SequenceAsHashMap lModuleProps(xModuleManager->getByName(m_sModuleLongName));
972 = lModuleProps.getUnpackedValueOrDefault("ooSetupFactoryUIName", OUString());
973
974 // get global accelerator configuration
975 m_xGlobal = css::ui::GlobalAcceleratorConfiguration::create(m_xContext);
976
977 // get module accelerator configuration
978
980 ui::theModuleUIConfigurationManagerSupplier::get(m_xContext));
982 = xModuleCfgSupplier->getUIConfigurationManager(m_sModuleLongName);
983 m_xModule = xUICfgManager->getShortCutManager();
984 }
985 catch (const uno::RuntimeException&)
986 {
987 throw;
988 }
989 catch (const uno::Exception&)
990 {
991 m_xContext.clear();
992 }
993}
994
996{
997 if (!xAccMgr.is())
998 return;
999
1001 {
1004 if (m_xFrame.is())
1005 xController = m_xFrame->getController();
1006 if (xController.is())
1007 xModel = xController->getModel();
1008
1010 m_xGroupLBox->SetStylesInfo(&m_aStylesInfo);
1012 }
1013
1014 // Insert all editable accelerators into list box. It is possible
1015 // that some accelerators are not mapped on the current system/keyboard
1016 // but we don't want to lose these mappings.
1017 for (sal_Int32 i1 = 0; i1 < KEYCODE_ARRAY_SIZE; ++i1)
1018 {
1019 vcl::KeyCode aKey = KEYCODE_ARRAY[i1];
1020 OUString sKey = aKey.GetName();
1021 if (sKey.isEmpty())
1022 continue;
1023 TAccInfo* pEntry = new TAccInfo(i1, 0 /*nListPos*/, aKey);
1024 m_xEntriesBox->append(weld::toId(pEntry), sKey);
1025 int nPos = m_xEntriesBox->n_children() - 1;
1026 m_xEntriesBox->set_text(nPos, OUString(), 1);
1027 m_xEntriesBox->set_sensitive(nPos, true);
1028 }
1029
1030 // Assign all commands to its shortcuts - reading the accelerator config.
1031 uno::Sequence<awt::KeyEvent> lKeys = xAccMgr->getAllKeyEvents();
1032 sal_Int32 c2 = lKeys.getLength();
1033 sal_Int32 i2 = 0;
1034
1035 for (i2 = 0; i2 < c2; ++i2)
1036 {
1037 const awt::KeyEvent& aAWTKey = lKeys[i2];
1038 OUString sCommand = xAccMgr->getCommandByKeyEvent(aAWTKey);
1039 OUString sLabel = GetLabel4Command(sCommand);
1041 sal_Int32 nPos = MapKeyCodeToPos(aKeyCode);
1042
1043 if (nPos == -1)
1044 continue;
1045
1046 m_xEntriesBox->set_text(nPos, sLabel, 1);
1047
1048 TAccInfo* pEntry = weld::fromId<TAccInfo*>(m_xEntriesBox->get_id(nPos));
1049 pEntry->m_bIsConfigurable = true;
1050
1051 pEntry->m_sCommand = sCommand;
1052 }
1053
1054 // Map the VCL hardcoded key codes and mark them as not changeable
1056 size_t i3 = 0;
1057 for (i3 = 0; i3 < c3; ++i3)
1058 {
1059 const vcl::KeyCode* pKeyCode = Application::GetReservedKeyCode(i3);
1060 sal_Int32 nPos = MapKeyCodeToPos(*pKeyCode);
1061
1062 if (nPos == -1)
1063 continue;
1064
1065 // Hardcoded function mapped so no ID possible and mark entry as not changeable
1066 TAccInfo* pEntry = weld::fromId<TAccInfo*>(m_xEntriesBox->get_id(nPos));
1067 pEntry->m_bIsConfigurable = false;
1068
1069 m_xEntriesBox->set_sensitive(nPos, false);
1070 }
1071}
1072
1074{
1075 if (!xAccMgr.is())
1076 return;
1077
1078 // Go through the list from the bottom to the top ...
1079 // because logical accelerator must be preferred instead of
1080 // physical ones!
1081 for (int i = 0, nCount = m_xEntriesBox->n_children(); i < nCount; ++i)
1082 {
1083 TAccInfo* pUserData = weld::fromId<TAccInfo*>(m_xEntriesBox->get_id(i));
1084 OUString sCommand;
1085 awt::KeyEvent aAWTKey;
1086
1087 if (pUserData)
1088 {
1089 sCommand = pUserData->m_sCommand;
1091 }
1092
1093 try
1094 {
1095 if (!sCommand.isEmpty())
1096 xAccMgr->setKeyEvent(aAWTKey, sCommand);
1097 else
1098 xAccMgr->removeKeyEvent(aAWTKey);
1099 }
1100 catch (const uno::RuntimeException&)
1101 {
1102 throw;
1103 }
1104 catch (const uno::Exception&)
1105 {
1106 }
1107 }
1108}
1109
1111
1113{
1114 SelectHdl(m_xGroupLBox->get_widget());
1115}
1116
1118{
1119 m_aUpdateDataTimer.Start();
1120}
1121
1123{
1124 if (m_aUpdateDataTimer.IsActive())
1125 {
1126 m_aUpdateDataTimer.Stop();
1127 m_aUpdateDataTimer.Invoke();
1128 }
1129}
1130
1132{
1133 // ask for filename, where we should load the new config data from
1134 StartFileDialog(StartFileDialogType::Open, aLoadAccelConfigStr);
1135}
1136
1138{
1139 StartFileDialog(StartFileDialogType::SaveAs, aSaveAccelConfigStr);
1140}
1141
1143{
1144 uno::Reference<form::XReset> xReset(m_xAct, uno::UNO_QUERY);
1145 if (xReset.is())
1146 xReset->reset();
1147
1148 m_xEntriesBox->freeze();
1149 ResetConfig();
1150 Init(m_xAct);
1151 m_xEntriesBox->thaw();
1152 m_xEntriesBox->select(0);
1153 SelectHdl(*m_xEntriesBox);
1154}
1155
1157{
1158 int nPos = m_xEntriesBox->get_selected_index();
1159 if (nPos == -1)
1160 return;
1161
1162 TAccInfo* pEntry = weld::fromId<TAccInfo*>(m_xEntriesBox->get_id(nPos));
1163 OUString sNewCommand = m_xFunctionBox->GetCurCommand();
1164 OUString sLabel = m_xFunctionBox->GetCurLabel();
1165 if (sLabel.isEmpty())
1166 sLabel = GetLabel4Command(sNewCommand);
1167
1168 pEntry->m_sCommand = sNewCommand;
1169 m_xEntriesBox->set_text(nPos, sLabel, 1);
1170
1171 SelectHdl(m_xFunctionBox->get_widget());
1172}
1173
1175{
1176 // get selected entry
1177 int nPos = m_xEntriesBox->get_selected_index();
1178 if (nPos == -1)
1179 return;
1180
1181 TAccInfo* pEntry = weld::fromId<TAccInfo*>(m_xEntriesBox->get_id(nPos));
1182
1183 // remove function name from selected entry
1184 m_xEntriesBox->set_text(nPos, OUString(), 1);
1185 pEntry->m_sCommand.clear();
1186
1187 SelectHdl(m_xFunctionBox->get_widget());
1188}
1189
1191{
1192 if (&rListBox == m_xEntriesBox.get())
1193 {
1194 TAccInfo* pEntry = weld::fromId<TAccInfo*>(m_xEntriesBox->get_selected_id());
1195
1196 OUString sPossibleNewCommand = m_xFunctionBox->GetCurCommand();
1197
1198 m_xRemoveButton->set_sensitive(false);
1199 m_xChangeButton->set_sensitive(false);
1200
1201 if (pEntry && pEntry->m_bIsConfigurable)
1202 {
1203 if (pEntry->isConfigured())
1204 m_xRemoveButton->set_sensitive(true);
1205 m_xChangeButton->set_sensitive(pEntry->m_sCommand != sPossibleNewCommand);
1206 }
1207 }
1208 else if (&rListBox == &m_xGroupLBox->get_widget())
1209 {
1210 m_xGroupLBox->GroupSelected();
1211
1212 // Pause redraw (Do not redraw at each removal)
1213 m_xFunctionBox->freeze();
1214 // Apply the search filter to the functions list
1215 OUString aSearchTerm(m_xSearchEdit->get_text());
1216 int nMatchFound = applySearchFilter(aSearchTerm);
1217 // Resume redraw
1218 m_xFunctionBox->thaw();
1219 if (nMatchFound != -1)
1220 {
1221 m_xFunctionBox->select(nMatchFound);
1222 SelectHdl(m_xFunctionBox->get_widget());
1223 }
1224 else
1225 {
1226 m_xKeyBox->clear();
1227 m_xChangeButton->set_sensitive(false);
1228 }
1229 }
1230 else if (&rListBox == &m_xFunctionBox->get_widget())
1231 {
1232 m_xRemoveButton->set_sensitive(false);
1233 m_xChangeButton->set_sensitive(false);
1234
1235 // #i36994 First selected can return null!
1236 TAccInfo* pEntry = weld::fromId<TAccInfo*>(m_xEntriesBox->get_selected_id());
1237 if (pEntry)
1238 {
1239 OUString sPossibleNewCommand = m_xFunctionBox->GetCurCommand();
1240
1241 if (pEntry->m_bIsConfigurable)
1242 {
1243 if (pEntry->isConfigured())
1244 m_xRemoveButton->set_sensitive(true);
1245 m_xChangeButton->set_sensitive(pEntry->m_sCommand != sPossibleNewCommand
1246 && !sPossibleNewCommand.isEmpty());
1247 }
1248
1249 // update key box
1250 m_xKeyBox->clear();
1251 if (!sPossibleNewCommand.isEmpty())
1252 {
1253 for (int i = 0, nCount = m_xEntriesBox->n_children(); i < nCount; ++i)
1254 {
1255 TAccInfo* pUserData = weld::fromId<TAccInfo*>(m_xEntriesBox->get_id(i));
1256 if (pUserData && pUserData->m_sCommand == sPossibleNewCommand)
1257 {
1258 m_xKeyBox->append(weld::toId(pUserData), pUserData->m_aKey.GetName());
1259 }
1260 }
1261 }
1262 }
1263 }
1264 else
1265 {
1266 // goto selected "key" entry of the key box
1267 int nP2 = -1;
1268 TAccInfo* pU2 = weld::fromId<TAccInfo*>(m_xKeyBox->get_selected_id());
1269 if (pU2)
1270 nP2 = MapKeyCodeToPos(pU2->m_aKey);
1271 if (nP2 != -1)
1272 {
1273 m_xEntriesBox->select(nP2);
1274 m_xEntriesBox->scroll_to_row(nP2);
1275 SelectHdl(*m_xEntriesBox);
1276 }
1277 }
1278}
1279
1281{
1283
1284 if (m_xOfficeButton->get_active())
1285 m_xAct = m_xGlobal;
1286 else if (m_xModuleButton->get_active())
1287 m_xAct = m_xModule;
1288
1289 // nothing changed? => do nothing!
1290 if (m_xAct.is() && (xOld == m_xAct))
1291 return;
1292
1293 m_xEntriesBox->freeze();
1294 ResetConfig();
1295 Init(m_xAct);
1296 m_xEntriesBox->thaw();
1297
1298 m_xGroupLBox->Init(m_xContext, m_xFrame, m_sModuleLongName, true);
1299
1300 // pb: #133213# do not select NULL entries
1301 if (m_xEntriesBox->n_children())
1302 m_xEntriesBox->select(0);
1303
1304 m_aFillGroupIdle.Start();
1305}
1306
1308{
1309 // activating the selection, typically "all commands", can take a long time
1310 // -> show wait cursor and disable input
1311 weld::WaitObject aWaitObject(GetFrameWeld());
1312
1313 weld::TreeView& rTreeView = m_xGroupLBox->get_widget();
1314 SelectHdl(rTreeView);
1315}
1316
1318{
1319 assert(m_pFileDlg);
1320
1321 OUString sCfgName;
1322 if (ERRCODE_NONE == m_pFileDlg->GetError())
1323 sCfgName = m_pFileDlg->GetPath();
1324
1325 if (sCfgName.isEmpty())
1326 return;
1327
1328 weld::WaitObject aWaitObject(GetFrameWeld());
1329
1332 xRootStorage; // we must hold the root storage alive, if xCfgMgr is used!
1333
1334 try
1335 {
1336 // don't forget to release the storage afterwards!
1338 embed::StorageFactory::create(m_xContext));
1339 uno::Sequence<uno::Any> lArgs{ uno::Any(sCfgName),
1340 uno::Any(css::embed::ElementModes::READ) };
1341
1342 xRootStorage.set(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY_THROW);
1344 = xRootStorage->openStorageElement(FOLDERNAME_UICONFIG, embed::ElementModes::READ);
1345 if (xUIConfig.is())
1346 {
1348 = ui::UIConfigurationManager::create(m_xContext);
1349 xCfgMgr2->setStorage(xUIConfig);
1350 xCfgMgr.set(xCfgMgr2, uno::UNO_QUERY_THROW);
1351 }
1352
1353 if (xCfgMgr.is())
1354 {
1355 // open the configuration and update our UI
1356 uno::Reference<ui::XAcceleratorConfiguration> xTempAccMgr(xCfgMgr->getShortCutManager(),
1357 uno::UNO_SET_THROW);
1358
1359 m_xEntriesBox->freeze();
1360 ResetConfig();
1361 Init(xTempAccMgr);
1362 m_xEntriesBox->thaw();
1363 if (m_xEntriesBox->n_children())
1364 {
1365 m_xEntriesBox->select(0);
1366 SelectHdl(m_xFunctionBox->get_widget());
1367 }
1368 }
1369
1370 // don't forget to close the new opened storage!
1371 // We are the owner of it.
1372 if (xRootStorage.is())
1373 {
1375 xComponent.set(xCfgMgr, uno::UNO_QUERY);
1376 if (xComponent.is())
1377 xComponent->dispose();
1378 xRootStorage->dispose();
1379 }
1380 }
1381 catch (const uno::RuntimeException&)
1382 {
1383 throw;
1384 }
1385 catch (const uno::Exception&)
1386 {
1387 }
1388}
1389
1391{
1392 assert(m_pFileDlg);
1393
1394 OUString sCfgName;
1395 if (ERRCODE_NONE == m_pFileDlg->GetError())
1396 sCfgName = m_pFileDlg->GetPath();
1397
1398 if (sCfgName.isEmpty())
1399 return;
1400
1401 weld::WaitObject aWaitObject(GetFrameWeld());
1402
1404
1405 try
1406 {
1408 embed::StorageFactory::create(m_xContext));
1409 uno::Sequence<uno::Any> lArgs{ uno::Any(sCfgName), uno::Any(embed::ElementModes::WRITE) };
1410
1411 xRootStorage.set(xStorageFactory->createInstanceWithArguments(lArgs), uno::UNO_QUERY_THROW);
1412
1414 xRootStorage->openStorageElement(FOLDERNAME_UICONFIG, embed::ElementModes::WRITE),
1415 uno::UNO_SET_THROW);
1416 uno::Reference<beans::XPropertySet> xUIConfigProps(xUIConfig, uno::UNO_QUERY_THROW);
1417
1418 // set the correct media type if the storage was new created
1419 OUString sMediaType;
1420 xUIConfigProps->getPropertyValue(MEDIATYPE_PROPNAME) >>= sMediaType;
1421 if (sMediaType.isEmpty())
1422 xUIConfigProps->setPropertyValue(
1423 MEDIATYPE_PROPNAME, uno::Any(OUString("application/vnd.sun.xml.ui.configuration")));
1424
1426 = ui::UIConfigurationManager::create(m_xContext);
1427 xCfgMgr->setStorage(xUIConfig);
1428
1429 // get the target configuration access and update with all shortcuts
1430 // which are set currently at the UI!
1431 // Don't copy the m_xAct content to it... because m_xAct will be updated
1432 // from the UI on pressing the button "OK" only. And inbetween it's not up to date!
1433 uno::Reference<ui::XAcceleratorConfiguration> xTargetAccMgr(xCfgMgr->getShortCutManager(),
1434 uno::UNO_SET_THROW);
1435 Apply(xTargetAccMgr);
1436
1437 // commit (order is important!)
1439 uno::UNO_QUERY_THROW);
1440 uno::Reference<ui::XUIConfigurationPersistence> xCommit2(xCfgMgr, uno::UNO_QUERY_THROW);
1441 xCommit1->store();
1442 xCommit2->store();
1443
1444 if (xRootStorage.is())
1445 {
1446 // Commit root storage
1447 uno::Reference<embed::XTransactedObject> xCommit3(xRootStorage, uno::UNO_QUERY_THROW);
1448 xCommit3->commit();
1449 }
1450
1451 if (xRootStorage.is())
1452 {
1453 if (xCfgMgr.is())
1454 xCfgMgr->dispose();
1455 xRootStorage->dispose();
1456 }
1457 }
1458 catch (const uno::RuntimeException&)
1459 {
1460 throw;
1461 }
1462 catch (const uno::Exception&)
1463 {
1464 }
1465}
1466
1468{
1469 bool bSave = nType == StartFileDialogType::SaveAs;
1470 short nDialogType = bSave ? ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION
1471 : ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE;
1472 m_pFileDlg.reset(
1473 new sfx2::FileDialogHelper(nDialogType, FileDialogFlags::NONE, GetFrameWeld()));
1474
1475 m_pFileDlg->SetTitle(rTitle);
1477 m_pFileDlg->AddFilter(aFilterCfgStr, "*.cfg");
1478 m_pFileDlg->SetCurrentFilter(aFilterCfgStr);
1480
1482 = bSave ? LINK(this, SfxAcceleratorConfigPage, SaveHdl)
1483 : LINK(this, SfxAcceleratorConfigPage, LoadHdl);
1484 m_pFileDlg->StartExecuteModal(aDlgClosedLink);
1485}
1486
1488{
1489 Apply(m_xAct);
1490 try
1491 {
1492 m_xAct->store();
1493 css::uno::Reference<css::beans::XPropertySet> xFrameProps(m_xFrame,
1494 css::uno::UNO_QUERY_THROW);
1495 css::uno::Reference<css::frame::XLayoutManager> xLayoutManager;
1496 xFrameProps->getPropertyValue("LayoutManager") >>= xLayoutManager;
1497 css::uno::Reference<css::beans::XPropertySet> xLayoutProps(xLayoutManager,
1498 css::uno::UNO_QUERY_THROW);
1499 xLayoutProps->setPropertyValue("RefreshContextToolbarToolTip", css::uno::Any(true));
1500 }
1501 catch (const uno::RuntimeException&)
1502 {
1503 throw;
1504 }
1505 catch (const uno::Exception&)
1506 {
1507 return false;
1508 }
1509
1510 return true;
1511}
1512
1514{
1515 // open accelerator configs
1516 // Note: It initialize some other members too, which are needed here ...
1517 // e.g. m_sModuleUIName!
1518 InitAccCfg();
1519
1520 // change the description of the radio button, which switch to the module
1521 // dependent accelerator configuration
1522 OUString sButtonText = m_xModuleButton->get_label();
1523 sButtonText
1524 = m_xModuleButton->strip_mnemonic(sButtonText).replaceFirst("$(MODULE)", m_sModuleUIName);
1525 m_xModuleButton->set_label(sButtonText);
1526
1527 if (m_xModule.is())
1528 m_xModuleButton->set_active(true);
1529 else
1530 {
1531 m_xModuleButton->hide();
1532 m_xOfficeButton->set_active(true);
1533 }
1534
1535 RadioHdl(*m_xOfficeButton);
1536
1537#if HAVE_FEATURE_SCRIPTING
1538 if (const SfxMacroInfoItem* pMacroItem = rSet->GetItemIfSet(SID_MACROINFO))
1539 {
1540 m_pMacroInfoItem = pMacroItem;
1541 m_xGroupLBox->SelectMacro(m_pMacroInfoItem);
1542 }
1543#else
1544 (void)rSet;
1545#endif
1546}
1547
1549{
1550 sal_uInt16 nCode1 = aKey.GetCode() + aKey.GetModifier();
1551 for (int i = 0, nCount = m_xEntriesBox->n_children(); i < nCount; ++i)
1552 {
1553 TAccInfo* pUserData = weld::fromId<TAccInfo*>(m_xEntriesBox->get_id(i));
1554 if (pUserData)
1555 {
1556 sal_uInt16 nCode2 = pUserData->m_aKey.GetCode() + pUserData->m_aKey.GetModifier();
1557 if (nCode1 == nCode2)
1558 return i;
1559 }
1560 }
1561
1562 return -1;
1563}
1564
1565OUString SfxAcceleratorConfigPage::GetLabel4Command(const OUString& sCommand)
1566{
1567 try
1568 {
1569 // check global command configuration first
1571 m_xUICmdDescription->getByName(m_sModuleLongName) >>= xModuleConf;
1572 if (xModuleConf.is())
1573 {
1574 ::comphelper::SequenceAsHashMap lProps(xModuleConf->getByName(sCommand));
1575 OUString sLabel = lProps.getUnpackedValueOrDefault("Name", OUString());
1576 if (!sLabel.isEmpty())
1577 return sLabel;
1578 }
1579 }
1580 catch (const uno::RuntimeException&)
1581 {
1582 throw;
1583 }
1584 catch (const uno::Exception&)
1585 {
1586 }
1587
1588 // may be it's a style URL .. they must be handled special
1589 SfxStyleInfo_Impl aStyle;
1590 aStyle.sCommand = sCommand;
1592 {
1594 return aStyle.sLabel;
1595 }
1596
1597 return sCommand;
1598}
1599
1600/*
1601 * Remove entries which doesn't contain the search term
1602 */
1603int SfxAcceleratorConfigPage::applySearchFilter(OUString const& rSearchTerm)
1604{
1605 if (rSearchTerm.isEmpty())
1606 return -1;
1607
1608 m_options.searchString = rSearchTerm;
1609 utl::TextSearch textSearch(m_options);
1610
1611 for (int i = m_xFunctionBox->n_children(); i > 0; --i)
1612 {
1613 int nEntry = i - 1;
1614 OUString aStr = m_xFunctionBox->get_text(nEntry);
1615 sal_Int32 aStartPos = 0;
1616 sal_Int32 aEndPos = aStr.getLength();
1617
1618 if (!textSearch.SearchForward(aStr, &aStartPos, &aEndPos))
1619 m_xFunctionBox->remove(nEntry);
1620 }
1621
1622 return m_xFunctionBox->n_children() ? 0 : -1;
1623}
1624
1625/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference< XComponentContext > m_xContext
constexpr OUStringLiteral MEDIATYPE_PROPNAME
Definition: acccfg.cxx:74
constexpr OUStringLiteral FOLDERNAME_UICONFIG
Definition: acccfg.cxx:72
const sal_uInt16 KEYCODE_ARRAY[]
Definition: acccfg.cxx:76
IMPL_LINK_NOARG(SfxAcceleratorConfigPage, ImplUpdateDataHdl, Timer *, void)
Definition: acccfg.cxx:1112
IMPL_LINK(SfxAcceleratorConfigPage, KeyInputHdl, const KeyEvent &, rKey, bool)
select the entry, which match the current key input ... excepting keys, which are used for the dialog...
Definition: acccfg.cxx:811
const sal_uInt16 KEYCODE_ARRAY_SIZE
Definition: acccfg.cxx:806
css::uno::Reference< css::lang::XComponent > m_xFrame
constexpr OUStringLiteral sMediaType
StartFileDialogType
static size_t GetReservedKeyCodeCount()
static const vcl::KeyCode * GetReservedKeyCode(size_t i)
css::uno::Reference< css::frame::XFrame > m_xFrame
Definition: acccfg.hxx:99
std::unique_ptr< weld::RadioButton > m_xOfficeButton
Definition: acccfg.hxx:111
css::uno::Reference< css::container::XNameAccess > m_xUICmdDescription
Definition: acccfg.hxx:98
virtual bool FillItemSet(SfxItemSet *) override
Definition: acccfg.cxx:1487
std::unique_ptr< weld::Button > m_xResetButton
Definition: acccfg.hxx:121
std::unique_ptr< weld::Button > m_xLoadButton
Definition: acccfg.hxx:119
std::unique_ptr< sfx2::FileDialogHelper > m_pFileDlg
Definition: acccfg.hxx:85
std::unique_ptr< weld::Button > m_xSaveButton
Definition: acccfg.hxx:120
std::unique_ptr< weld::Entry > m_xSearchEdit
Definition: acccfg.hxx:118
sal_Int32 MapKeyCodeToPos(const vcl::KeyCode &rCode) const
Definition: acccfg.cxx:1548
int applySearchFilter(OUString const &rSearchTerm)
Definition: acccfg.cxx:1603
void StartFileDialog(StartFileDialogType nType, const OUString &rTitle)
Definition: acccfg.cxx:1467
void Init(const css::uno::Reference< css::ui::XAcceleratorConfiguration > &pAccMgr)
Definition: acccfg.cxx:995
std::unique_ptr< weld::TreeView > m_xEntriesBox
Definition: acccfg.hxx:110
void Apply(const css::uno::Reference< css::ui::XAcceleratorConfiguration > &pAccMgr)
Definition: acccfg.cxx:1073
std::unique_ptr< weld::TreeView > m_xKeyBox
Definition: acccfg.hxx:117
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: acccfg.hxx:94
i18nutil::SearchOptions2 m_options
Definition: acccfg.hxx:106
virtual ~SfxAcceleratorConfigPage() override
Definition: acccfg.cxx:932
std::unique_ptr< weld::RadioButton > m_xModuleButton
Definition: acccfg.hxx:112
SfxStylesInfo_Impl m_aStylesInfo
Definition: acccfg.hxx:91
SfxAcceleratorConfigPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rItemSet)
Definition: acccfg.cxx:844
std::unique_ptr< CuiConfigFunctionListBox > m_xFunctionBox
Definition: acccfg.hxx:116
std::unique_ptr< weld::Button > m_xChangeButton
Definition: acccfg.hxx:113
virtual void Reset(const SfxItemSet *) override
Definition: acccfg.cxx:1513
css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xAct
Definition: acccfg.hxx:97
OUString GetLabel4Command(const OUString &rCommand)
Definition: acccfg.cxx:1565
css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xGlobal
Definition: acccfg.hxx:95
OUString m_sModuleLongName
Definition: acccfg.hxx:101
std::unique_ptr< CuiConfigGroupListBox > m_xGroupLBox
Definition: acccfg.hxx:115
std::unique_ptr< weld::Button > m_xRemoveButton
Definition: acccfg.hxx:114
css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xModule
Definition: acccfg.hxx:96
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
css::uno::Reference< css::frame::XFrame > GetFrame() const
weld::Window * GetFrameWeld() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
void SetPriority(TaskPriority ePriority)
void Stop()
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
TValueType getUnpackedValueOrDefault(const OUString &sKey, const TValueType &aDefault) const
static vcl::KeyCode st_AWTKey2VCLKey(const css::awt::KeyEvent &aKey)
static css::awt::KeyEvent st_VCLKey2AWTKey(const vcl::KeyCode &aKey)
bool SearchForward(const OUString &rStr, sal_Int32 *pStart, sal_Int32 *pEnd, css::util::SearchResult *pRes=nullptr)
OUString GetName() const
sal_uInt16 GetCode() const
sal_uInt16 GetModifier() const
void Init()
OUString CuiResId(TranslateId aKey)
Definition: cuiresmgr.cxx:23
int nCount
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
virtual OUString GetName() const override
float u
#define ERRCODE_NONE
constexpr OUStringLiteral FILEDIALOG_FILTER_ALL
constexpr sal_uInt16 KEY_X
constexpr sal_uInt16 KEY_M
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_0
constexpr sal_uInt16 KEY_Q
constexpr sal_uInt16 KEY_SEMICOLON
constexpr sal_uInt16 KEY_R
constexpr sal_uInt16 KEY_F2
constexpr sal_uInt16 KEY_6
constexpr sal_uInt16 KEY_CONTEXTMENU
constexpr sal_uInt16 KEY_8
constexpr sal_uInt16 KEY_F3
constexpr sal_uInt16 KEY_MOD2
constexpr sal_uInt16 KEY_N
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_FIND
constexpr sal_uInt16 KEY_MOD1
constexpr sal_uInt16 KEY_I
constexpr sal_uInt16 KEY_CUT
constexpr sal_uInt16 KEY_K
constexpr sal_uInt16 KEY_BRACKETRIGHT
constexpr sal_uInt16 KEY_HOME
constexpr sal_uInt16 KEY_T
constexpr sal_uInt16 KEY_F15
constexpr sal_uInt16 KEY_7
constexpr sal_uInt16 KEY_1
constexpr sal_uInt16 KEY_ADD
constexpr sal_uInt16 KEY_V
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_F4
constexpr sal_uInt16 KEY_F5
constexpr sal_uInt16 KEY_PAGEDOWN
constexpr sal_uInt16 KEY_EQUAL
constexpr sal_uInt16 KEY_TAB
constexpr sal_uInt16 KEY_COMMA
constexpr sal_uInt16 KEY_J
constexpr sal_uInt16 KEY_B
constexpr sal_uInt16 KEY_4
constexpr sal_uInt16 KEY_POINT
constexpr sal_uInt16 KEY_F6
constexpr sal_uInt16 KEY_U
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_PASTE
constexpr sal_uInt16 KEY_F10
constexpr sal_uInt16 KEY_COLON
constexpr sal_uInt16 KEY_F9
constexpr sal_uInt16 KEY_5
constexpr sal_uInt16 KEY_F7
constexpr sal_uInt16 KEY_COPY
constexpr sal_uInt16 KEY_F1
constexpr sal_uInt16 KEY_MENU
constexpr sal_uInt16 KEY_9
constexpr sal_uInt16 KEY_BRACKETLEFT
constexpr sal_uInt16 KEY_PROPERTIES
constexpr sal_uInt16 KEY_FRONT
constexpr sal_uInt16 KEY_O
constexpr sal_uInt16 KEY_Z
constexpr sal_uInt16 KEY_S
constexpr sal_uInt16 KEY_3
constexpr sal_uInt16 KEY_MOD3
constexpr sal_uInt16 KEY_QUOTERIGHT
constexpr sal_uInt16 KEY_A
constexpr sal_uInt16 KEY_REPEAT
constexpr sal_uInt16 KEY_Y
constexpr sal_uInt16 KEY_UNDO
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_F13
constexpr sal_uInt16 KEY_F
constexpr sal_uInt16 KEY_D
constexpr sal_uInt16 KEY_H
constexpr sal_uInt16 KEY_G
constexpr sal_uInt16 KEY_OPEN
constexpr sal_uInt16 KEY_DELETE
constexpr sal_uInt16 KEY_L
constexpr sal_uInt16 KEY_F8
constexpr sal_uInt16 KEY_F12
constexpr sal_uInt16 KEY_TILDE
constexpr sal_uInt16 KEY_DOWN
constexpr sal_uInt16 KEY_SPACE
constexpr sal_uInt16 KEY_PAGEUP
constexpr sal_uInt16 KEY_F11
constexpr sal_uInt16 KEY_E
constexpr sal_uInt16 KEY_QUOTELEFT
constexpr sal_uInt16 KEY_C
constexpr sal_uInt16 KEY_HELP
constexpr sal_uInt16 KEY_2
constexpr sal_uInt16 KEY_W
constexpr sal_uInt16 KEY_P
constexpr sal_uInt16 KEY_SUBTRACT
constexpr sal_uInt16 KEY_DIVIDE
constexpr sal_uInt16 KEY_F16
constexpr sal_uInt16 KEY_SHIFT
constexpr sal_uInt16 KEY_F14
constexpr sal_uInt16 KEY_RIGHTCURLYBRACKET
constexpr sal_uInt16 KEY_INSERT
constexpr sal_uInt16 KEY_BACKSPACE
constexpr sal_uInt16 KEY_END
constexpr sal_uInt16 KEY_MULTIPLY
sal_uInt16 nPos
if(aStr !=aBuf) UpdateName_Impl(m_xFollowLb.get()
aStr
Reference< XComponentContext > getProcessComponentContext()
int i
OUString toId(const void *pValue)
QPRO_FUNC_TYPE nType
SFX2_DLLPUBLIC OUString SfxResId(TranslateId aId)
static SfxItemSet & rSet
OUString sCommand
Definition: cfgutil.hxx:46
OUString sLabel
Definition: cfgutil.hxx:47
void init(const OUString &rModuleName, const css::uno::Reference< css::frame::XModel > &xModel)
Definition: cfgutil.cxx:72
static bool parseStyleCommand(SfxStyleInfo_Impl &aStyle)
Definition: cfgutil.cxx:95
void getLabel4Style(SfxStyleInfo_Impl &aStyle)
Definition: cfgutil.cxx:128
bool m_bIsConfigurable
Definition: acccfg.hxx:63
vcl::KeyCode m_aKey
Definition: acccfg.hxx:65
bool isConfigured() const
Definition: acccfg.hxx:56
OUString m_sCommand
Definition: acccfg.hxx:64
TransliterationFlags transliterateFlags
Reference< XController > xController
Reference< XModel > xModel
#define EDIT_UPDATEDATA_TIMEOUT