fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / cui / source / customize / acccfg.cxx
blob77ec9c30d87fba7ec05b136e4b6492cae57d1e71
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 //-----------------------------------------------
21 // include own files
23 #include "acccfg.hxx"
24 #include "cfgutil.hxx"
25 #include <dialmgr.hxx>
27 #include <sfx2/msg.hxx>
28 #include <sfx2/app.hxx>
29 #include <sfx2/filedlghelper.hxx>
30 #include <sfx2/minfitem.hxx>
31 #include <sfx2/sfxresid.hxx>
32 #include <svl/stritem.hxx>
33 #include "svtools/treelistentry.hxx"
35 #include <sal/macros.h>
37 #include "cuires.hrc"
38 #include "acccfg.hrc"
40 #include <svx/svxids.hrc> // SID_CHARMAP, SID_ATTR_SPECIALCHAR
42 //-----------------------------------------------
43 // include interface declarations
44 #include <com/sun/star/awt/KeyModifier.hpp>
45 #include <com/sun/star/embed/StorageFactory.hpp>
46 #include <com/sun/star/embed/XTransactedObject.hpp>
47 #include <com/sun/star/embed/ElementModes.hpp>
48 #include <com/sun/star/form/XReset.hpp>
49 #include <com/sun/star/frame/Desktop.hpp>
50 #include <com/sun/star/frame/XFramesSupplier.hpp>
51 #include <com/sun/star/frame/XFrame.hpp>
52 #include <com/sun/star/frame/XController.hpp>
53 #include <com/sun/star/frame/XModel.hpp>
54 #include <com/sun/star/frame/ModuleManager.hpp>
55 #include <com/sun/star/frame/UICommandDescription.hpp>
56 #include <com/sun/star/ui/GlobalAcceleratorConfiguration.hpp>
57 #include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp>
58 #include <com/sun/star/ui/UIConfigurationManager.hpp>
59 #include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
60 #include <com/sun/star/ui/XUIConfigurationManager.hpp>
61 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
63 //-----------------------------------------------
64 // include other projects
65 #include <comphelper/processfactory.hxx>
66 #include <svtools/acceleratorexecute.hxx>
67 #include <svtools/svlbitm.hxx>
68 #include <vcl/svapp.hxx>
69 #include <vcl/help.hxx>
70 #include <rtl/ustrbuf.hxx>
71 #include <comphelper/sequenceashashmap.hxx>
73 //-----------------------------------------------
74 // namespaces
76 using namespace com::sun::star;
79 //-----------------------------------------------
81 static OUString MODULEPROP_SHORTNAME ("ooSetupFactoryShortName" );
82 static OUString MODULEPROP_UINAME ("ooSetupFactoryUIName" );
83 static OUString CMDPROP_UINAME ("Name" );
85 static OUString FOLDERNAME_UICONFIG ("Configurations2" );
87 static OUString MEDIATYPE_PROPNAME ("MediaType" );
88 static OUString MEDIATYPE_UICONFIG ("application/vnd.sun.xml.ui.configuration");
90 //-----------------------------------------------
91 static sal_uInt16 KEYCODE_ARRAY[] =
93 KEY_F1 ,
94 KEY_F2 ,
95 KEY_F3 ,
96 KEY_F4 ,
97 KEY_F5 ,
98 KEY_F6 ,
99 KEY_F7 ,
100 KEY_F8 ,
101 KEY_F9 ,
102 KEY_F10 ,
103 KEY_F11 ,
104 KEY_F12 ,
105 KEY_F13 ,
106 KEY_F14 ,
107 KEY_F15 ,
108 KEY_F16 ,
110 KEY_DOWN ,
111 KEY_UP ,
112 KEY_LEFT ,
113 KEY_RIGHT ,
114 KEY_HOME ,
115 KEY_END ,
116 KEY_PAGEUP ,
117 KEY_PAGEDOWN ,
118 KEY_RETURN ,
119 KEY_ESCAPE ,
120 KEY_BACKSPACE,
121 KEY_INSERT ,
122 KEY_DELETE ,
124 KEY_OPEN ,
125 KEY_CUT ,
126 KEY_COPY ,
127 KEY_PASTE ,
128 KEY_UNDO ,
129 KEY_REPEAT ,
130 KEY_FIND ,
131 KEY_PROPERTIES ,
132 KEY_FRONT ,
133 KEY_CONTEXTMENU ,
134 KEY_MENU ,
135 KEY_HELP ,
137 KEY_F1 | KEY_SHIFT,
138 KEY_F2 | KEY_SHIFT,
139 KEY_F3 | KEY_SHIFT,
140 KEY_F4 | KEY_SHIFT,
141 KEY_F5 | KEY_SHIFT,
142 KEY_F6 | KEY_SHIFT,
143 KEY_F7 | KEY_SHIFT,
144 KEY_F8 | KEY_SHIFT,
145 KEY_F9 | KEY_SHIFT,
146 KEY_F10 | KEY_SHIFT,
147 KEY_F11 | KEY_SHIFT,
148 KEY_F12 | KEY_SHIFT,
149 KEY_F13 | KEY_SHIFT,
150 KEY_F14 | KEY_SHIFT,
151 KEY_F15 | KEY_SHIFT,
152 KEY_F16 | KEY_SHIFT,
154 KEY_DOWN | KEY_SHIFT,
155 KEY_UP | KEY_SHIFT,
156 KEY_LEFT | KEY_SHIFT,
157 KEY_RIGHT | KEY_SHIFT,
158 KEY_HOME | KEY_SHIFT,
159 KEY_END | KEY_SHIFT,
160 KEY_PAGEUP | KEY_SHIFT,
161 KEY_PAGEDOWN | KEY_SHIFT,
162 KEY_RETURN | KEY_SHIFT,
163 KEY_SPACE | KEY_SHIFT,
164 KEY_ESCAPE | KEY_SHIFT,
165 KEY_BACKSPACE | KEY_SHIFT,
166 KEY_INSERT | KEY_SHIFT,
167 KEY_DELETE | KEY_SHIFT,
169 KEY_0 | KEY_MOD1 ,
170 KEY_1 | KEY_MOD1 ,
171 KEY_2 | KEY_MOD1 ,
172 KEY_3 | KEY_MOD1 ,
173 KEY_4 | KEY_MOD1 ,
174 KEY_5 | KEY_MOD1 ,
175 KEY_6 | KEY_MOD1 ,
176 KEY_7 | KEY_MOD1 ,
177 KEY_8 | KEY_MOD1 ,
178 KEY_9 | KEY_MOD1 ,
179 KEY_A | KEY_MOD1 ,
180 KEY_B | KEY_MOD1 ,
181 KEY_C | KEY_MOD1 ,
182 KEY_D | KEY_MOD1 ,
183 KEY_E | KEY_MOD1 ,
184 KEY_F | KEY_MOD1 ,
185 KEY_G | KEY_MOD1 ,
186 KEY_H | KEY_MOD1 ,
187 KEY_I | KEY_MOD1 ,
188 KEY_J | KEY_MOD1 ,
189 KEY_K | KEY_MOD1 ,
190 KEY_L | KEY_MOD1 ,
191 KEY_M | KEY_MOD1 ,
192 KEY_N | KEY_MOD1 ,
193 KEY_O | KEY_MOD1 ,
194 KEY_P | KEY_MOD1 ,
195 KEY_Q | KEY_MOD1 ,
196 KEY_R | KEY_MOD1 ,
197 KEY_S | KEY_MOD1 ,
198 KEY_T | KEY_MOD1 ,
199 KEY_U | KEY_MOD1 ,
200 KEY_V | KEY_MOD1 ,
201 KEY_W | KEY_MOD1 ,
202 KEY_X | KEY_MOD1 ,
203 KEY_Y | KEY_MOD1 ,
204 KEY_Z | KEY_MOD1 ,
205 KEY_SEMICOLON | KEY_MOD1 ,
206 KEY_BRACKETLEFT | KEY_MOD1 ,
207 KEY_BRACKETRIGHT | KEY_MOD1,
208 KEY_POINT | KEY_MOD1 ,
210 KEY_F1 | KEY_MOD1 ,
211 KEY_F2 | KEY_MOD1 ,
212 KEY_F3 | KEY_MOD1 ,
213 KEY_F4 | KEY_MOD1 ,
214 KEY_F5 | KEY_MOD1 ,
215 KEY_F6 | KEY_MOD1 ,
216 KEY_F7 | KEY_MOD1 ,
217 KEY_F8 | KEY_MOD1 ,
218 KEY_F9 | KEY_MOD1 ,
219 KEY_F10 | KEY_MOD1 ,
220 KEY_F11 | KEY_MOD1 ,
221 KEY_F12 | KEY_MOD1 ,
222 KEY_F13 | KEY_MOD1 ,
223 KEY_F14 | KEY_MOD1 ,
224 KEY_F15 | KEY_MOD1 ,
225 KEY_F16 | KEY_MOD1 ,
227 KEY_DOWN | KEY_MOD1 ,
228 KEY_UP | KEY_MOD1 ,
229 KEY_LEFT | KEY_MOD1 ,
230 KEY_RIGHT | KEY_MOD1 ,
231 KEY_HOME | KEY_MOD1 ,
232 KEY_END | KEY_MOD1 ,
233 KEY_PAGEUP | KEY_MOD1 ,
234 KEY_PAGEDOWN | KEY_MOD1 ,
235 KEY_RETURN | KEY_MOD1 ,
236 KEY_SPACE | KEY_MOD1 ,
237 KEY_BACKSPACE | KEY_MOD1 ,
238 KEY_INSERT | KEY_MOD1 ,
239 KEY_DELETE | KEY_MOD1 ,
241 KEY_ADD | KEY_MOD1 ,
242 KEY_SUBTRACT | KEY_MOD1 ,
243 KEY_MULTIPLY | KEY_MOD1 ,
244 KEY_DIVIDE | KEY_MOD1 ,
246 KEY_0 | KEY_SHIFT | KEY_MOD1,
247 KEY_1 | KEY_SHIFT | KEY_MOD1,
248 KEY_2 | KEY_SHIFT | KEY_MOD1,
249 KEY_3 | KEY_SHIFT | KEY_MOD1,
250 KEY_4 | KEY_SHIFT | KEY_MOD1,
251 KEY_5 | KEY_SHIFT | KEY_MOD1,
252 KEY_6 | KEY_SHIFT | KEY_MOD1,
253 KEY_7 | KEY_SHIFT | KEY_MOD1,
254 KEY_8 | KEY_SHIFT | KEY_MOD1,
255 KEY_9 | KEY_SHIFT | KEY_MOD1,
256 KEY_A | KEY_SHIFT | KEY_MOD1,
257 KEY_B | KEY_SHIFT | KEY_MOD1,
258 KEY_C | KEY_SHIFT | KEY_MOD1,
259 KEY_D | KEY_SHIFT | KEY_MOD1,
260 KEY_E | KEY_SHIFT | KEY_MOD1,
261 KEY_F | KEY_SHIFT | KEY_MOD1,
262 KEY_G | KEY_SHIFT | KEY_MOD1,
263 KEY_H | KEY_SHIFT | KEY_MOD1,
264 KEY_I | KEY_SHIFT | KEY_MOD1,
265 KEY_J | KEY_SHIFT | KEY_MOD1,
266 KEY_K | KEY_SHIFT | KEY_MOD1,
267 KEY_L | KEY_SHIFT | KEY_MOD1,
268 KEY_M | KEY_SHIFT | KEY_MOD1,
269 KEY_N | KEY_SHIFT | KEY_MOD1,
270 KEY_O | KEY_SHIFT | KEY_MOD1,
271 KEY_P | KEY_SHIFT | KEY_MOD1,
272 KEY_Q | KEY_SHIFT | KEY_MOD1,
273 KEY_R | KEY_SHIFT | KEY_MOD1,
274 KEY_S | KEY_SHIFT | KEY_MOD1,
275 KEY_T | KEY_SHIFT | KEY_MOD1,
276 KEY_U | KEY_SHIFT | KEY_MOD1,
277 KEY_V | KEY_SHIFT | KEY_MOD1,
278 KEY_W | KEY_SHIFT | KEY_MOD1,
279 KEY_X | KEY_SHIFT | KEY_MOD1,
280 KEY_Y | KEY_SHIFT | KEY_MOD1,
281 KEY_Z | KEY_SHIFT | KEY_MOD1,
282 KEY_SEMICOLON | KEY_SHIFT | KEY_MOD1 ,
283 KEY_BRACKETLEFT | KEY_SHIFT | KEY_MOD1 ,
284 KEY_BRACKETRIGHT | KEY_SHIFT | KEY_MOD1,
285 KEY_POINT | KEY_SHIFT | KEY_MOD1,
287 KEY_F1 | KEY_SHIFT | KEY_MOD1,
288 KEY_F2 | KEY_SHIFT | KEY_MOD1,
289 KEY_F3 | KEY_SHIFT | KEY_MOD1,
290 KEY_F4 | KEY_SHIFT | KEY_MOD1,
291 KEY_F5 | KEY_SHIFT | KEY_MOD1,
292 KEY_F6 | KEY_SHIFT | KEY_MOD1,
293 KEY_F7 | KEY_SHIFT | KEY_MOD1,
294 KEY_F8 | KEY_SHIFT | KEY_MOD1,
295 KEY_F9 | KEY_SHIFT | KEY_MOD1,
296 KEY_F10 | KEY_SHIFT | KEY_MOD1,
297 KEY_F11 | KEY_SHIFT | KEY_MOD1,
298 KEY_F12 | KEY_SHIFT | KEY_MOD1,
299 KEY_F13 | KEY_SHIFT | KEY_MOD1,
300 KEY_F14 | KEY_SHIFT | KEY_MOD1,
301 KEY_F15 | KEY_SHIFT | KEY_MOD1,
302 KEY_F16 | KEY_SHIFT | KEY_MOD1,
304 KEY_DOWN | KEY_SHIFT | KEY_MOD1,
305 KEY_UP | KEY_SHIFT | KEY_MOD1,
306 KEY_LEFT | KEY_SHIFT | KEY_MOD1,
307 KEY_RIGHT | KEY_SHIFT | KEY_MOD1,
308 KEY_HOME | KEY_SHIFT | KEY_MOD1,
309 KEY_END | KEY_SHIFT | KEY_MOD1,
310 KEY_PAGEUP | KEY_SHIFT | KEY_MOD1,
311 KEY_PAGEDOWN | KEY_SHIFT | KEY_MOD1,
312 KEY_RETURN | KEY_SHIFT | KEY_MOD1,
313 KEY_SPACE | KEY_SHIFT | KEY_MOD1,
314 KEY_BACKSPACE | KEY_SHIFT | KEY_MOD1,
315 KEY_INSERT | KEY_SHIFT | KEY_MOD1,
316 KEY_DELETE | KEY_SHIFT | KEY_MOD1,
318 KEY_0 | KEY_MOD2 ,
319 KEY_1 | KEY_MOD2 ,
320 KEY_2 | KEY_MOD2 ,
321 KEY_3 | KEY_MOD2 ,
322 KEY_4 | KEY_MOD2 ,
323 KEY_5 | KEY_MOD2 ,
324 KEY_6 | KEY_MOD2 ,
325 KEY_7 | KEY_MOD2 ,
326 KEY_8 | KEY_MOD2 ,
327 KEY_9 | KEY_MOD2 ,
328 KEY_A | KEY_MOD2 ,
329 KEY_B | KEY_MOD2 ,
330 KEY_C | KEY_MOD2 ,
331 KEY_D | KEY_MOD2 ,
332 KEY_E | KEY_MOD2 ,
333 KEY_F | KEY_MOD2 ,
334 KEY_G | KEY_MOD2 ,
335 KEY_H | KEY_MOD2 ,
336 KEY_I | KEY_MOD2 ,
337 KEY_J | KEY_MOD2 ,
338 KEY_K | KEY_MOD2 ,
339 KEY_L | KEY_MOD2 ,
340 KEY_M | KEY_MOD2 ,
341 KEY_N | KEY_MOD2 ,
342 KEY_O | KEY_MOD2 ,
343 KEY_P | KEY_MOD2 ,
344 KEY_Q | KEY_MOD2 ,
345 KEY_R | KEY_MOD2 ,
346 KEY_S | KEY_MOD2 ,
347 KEY_T | KEY_MOD2 ,
348 KEY_U | KEY_MOD2 ,
349 KEY_V | KEY_MOD2 ,
350 KEY_W | KEY_MOD2 ,
351 KEY_X | KEY_MOD2 ,
352 KEY_Y | KEY_MOD2 ,
353 KEY_Z | KEY_MOD2 ,
354 KEY_SEMICOLON | KEY_MOD2 ,
355 KEY_BRACKETLEFT | KEY_MOD2 ,
356 KEY_BRACKETRIGHT | KEY_MOD2,
357 KEY_POINT | KEY_MOD2 ,
359 KEY_F1 | KEY_MOD2 ,
360 KEY_F2 | KEY_MOD2 ,
361 KEY_F3 | KEY_MOD2 ,
362 KEY_F4 | KEY_MOD2 ,
363 KEY_F5 | KEY_MOD2 ,
364 KEY_F6 | KEY_MOD2 ,
365 KEY_F7 | KEY_MOD2 ,
366 KEY_F8 | KEY_MOD2 ,
367 KEY_F9 | KEY_MOD2 ,
368 KEY_F10 | KEY_MOD2 ,
369 KEY_F11 | KEY_MOD2 ,
370 KEY_F12 | KEY_MOD2 ,
371 KEY_F13 | KEY_MOD2 ,
372 KEY_F14 | KEY_MOD2 ,
373 KEY_F15 | KEY_MOD2 ,
374 KEY_F16 | KEY_MOD2 ,
376 KEY_DOWN | KEY_MOD2 ,
377 KEY_UP | KEY_MOD2 ,
378 KEY_LEFT | KEY_MOD2 ,
379 KEY_RIGHT | KEY_MOD2 ,
380 KEY_HOME | KEY_MOD2 ,
381 KEY_END | KEY_MOD2 ,
382 KEY_PAGEUP | KEY_MOD2 ,
383 KEY_PAGEDOWN | KEY_MOD2 ,
384 KEY_RETURN | KEY_MOD2 ,
385 KEY_SPACE | KEY_MOD2 ,
386 KEY_BACKSPACE | KEY_MOD2 ,
387 KEY_INSERT | KEY_MOD2 ,
388 KEY_DELETE | KEY_MOD2 ,
390 KEY_0 | KEY_SHIFT | KEY_MOD2,
391 KEY_1 | KEY_SHIFT | KEY_MOD2,
392 KEY_2 | KEY_SHIFT | KEY_MOD2,
393 KEY_3 | KEY_SHIFT | KEY_MOD2,
394 KEY_4 | KEY_SHIFT | KEY_MOD2,
395 KEY_5 | KEY_SHIFT | KEY_MOD2,
396 KEY_6 | KEY_SHIFT | KEY_MOD2,
397 KEY_7 | KEY_SHIFT | KEY_MOD2,
398 KEY_8 | KEY_SHIFT | KEY_MOD2,
399 KEY_9 | KEY_SHIFT | KEY_MOD2,
400 KEY_A | KEY_SHIFT | KEY_MOD2,
401 KEY_B | KEY_SHIFT | KEY_MOD2,
402 KEY_C | KEY_SHIFT | KEY_MOD2,
403 KEY_D | KEY_SHIFT | KEY_MOD2,
404 KEY_E | KEY_SHIFT | KEY_MOD2,
405 KEY_F | KEY_SHIFT | KEY_MOD2,
406 KEY_G | KEY_SHIFT | KEY_MOD2,
407 KEY_H | KEY_SHIFT | KEY_MOD2,
408 KEY_I | KEY_SHIFT | KEY_MOD2,
409 KEY_J | KEY_SHIFT | KEY_MOD2,
410 KEY_K | KEY_SHIFT | KEY_MOD2,
411 KEY_L | KEY_SHIFT | KEY_MOD2,
412 KEY_M | KEY_SHIFT | KEY_MOD2,
413 KEY_N | KEY_SHIFT | KEY_MOD2,
414 KEY_O | KEY_SHIFT | KEY_MOD2,
415 KEY_P | KEY_SHIFT | KEY_MOD2,
416 KEY_Q | KEY_SHIFT | KEY_MOD2,
417 KEY_R | KEY_SHIFT | KEY_MOD2,
418 KEY_S | KEY_SHIFT | KEY_MOD2,
419 KEY_T | KEY_SHIFT | KEY_MOD2,
420 KEY_U | KEY_SHIFT | KEY_MOD2,
421 KEY_V | KEY_SHIFT | KEY_MOD2,
422 KEY_W | KEY_SHIFT | KEY_MOD2,
423 KEY_X | KEY_SHIFT | KEY_MOD2,
424 KEY_Y | KEY_SHIFT | KEY_MOD2,
425 KEY_Z | KEY_SHIFT | KEY_MOD2,
426 KEY_SEMICOLON | KEY_SHIFT | KEY_MOD2 ,
427 KEY_BRACKETLEFT | KEY_SHIFT | KEY_MOD2 ,
428 KEY_BRACKETRIGHT | KEY_SHIFT | KEY_MOD2,
429 KEY_POINT | KEY_SHIFT | KEY_MOD2,
431 KEY_F1 | KEY_SHIFT | KEY_MOD2,
432 KEY_F2 | KEY_SHIFT | KEY_MOD2,
433 KEY_F3 | KEY_SHIFT | KEY_MOD2,
434 KEY_F4 | KEY_SHIFT | KEY_MOD2,
435 KEY_F5 | KEY_SHIFT | KEY_MOD2,
436 KEY_F6 | KEY_SHIFT | KEY_MOD2,
437 KEY_F7 | KEY_SHIFT | KEY_MOD2,
438 KEY_F8 | KEY_SHIFT | KEY_MOD2,
439 KEY_F9 | KEY_SHIFT | KEY_MOD2,
440 KEY_F10 | KEY_SHIFT | KEY_MOD2,
441 KEY_F11 | KEY_SHIFT | KEY_MOD2,
442 KEY_F12 | KEY_SHIFT | KEY_MOD2,
443 KEY_F13 | KEY_SHIFT | KEY_MOD2,
444 KEY_F14 | KEY_SHIFT | KEY_MOD2,
445 KEY_F15 | KEY_SHIFT | KEY_MOD2,
446 KEY_F16 | KEY_SHIFT | KEY_MOD2,
448 KEY_DOWN | KEY_SHIFT | KEY_MOD2,
449 KEY_UP | KEY_SHIFT | KEY_MOD2,
450 KEY_LEFT | KEY_SHIFT | KEY_MOD2,
451 KEY_RIGHT | KEY_SHIFT | KEY_MOD2,
452 KEY_HOME | KEY_SHIFT | KEY_MOD2,
453 KEY_END | KEY_SHIFT | KEY_MOD2,
454 KEY_PAGEUP | KEY_SHIFT | KEY_MOD2,
455 KEY_PAGEDOWN | KEY_SHIFT | KEY_MOD2,
456 KEY_RETURN | KEY_SHIFT | KEY_MOD2,
457 KEY_SPACE | KEY_SHIFT | KEY_MOD2,
458 KEY_BACKSPACE | KEY_SHIFT | KEY_MOD2,
459 KEY_INSERT | KEY_SHIFT | KEY_MOD2,
460 KEY_DELETE | KEY_SHIFT | KEY_MOD2,
462 KEY_0 | KEY_MOD1 | KEY_MOD2 ,
463 KEY_1 | KEY_MOD1 | KEY_MOD2 ,
464 KEY_2 | KEY_MOD1 | KEY_MOD2 ,
465 KEY_3 | KEY_MOD1 | KEY_MOD2 ,
466 KEY_4 | KEY_MOD1 | KEY_MOD2 ,
467 KEY_5 | KEY_MOD1 | KEY_MOD2 ,
468 KEY_6 | KEY_MOD1 | KEY_MOD2 ,
469 KEY_7 | KEY_MOD1 | KEY_MOD2 ,
470 KEY_8 | KEY_MOD1 | KEY_MOD2 ,
471 KEY_9 | KEY_MOD1 | KEY_MOD2 ,
472 KEY_A | KEY_MOD1 | KEY_MOD2 ,
473 KEY_B | KEY_MOD1 | KEY_MOD2 ,
474 KEY_C | KEY_MOD1 | KEY_MOD2 ,
475 KEY_D | KEY_MOD1 | KEY_MOD2 ,
476 KEY_E | KEY_MOD1 | KEY_MOD2 ,
477 KEY_F | KEY_MOD1 | KEY_MOD2 ,
478 KEY_G | KEY_MOD1 | KEY_MOD2 ,
479 KEY_H | KEY_MOD1 | KEY_MOD2 ,
480 KEY_I | KEY_MOD1 | KEY_MOD2 ,
481 KEY_J | KEY_MOD1 | KEY_MOD2 ,
482 KEY_K | KEY_MOD1 | KEY_MOD2 ,
483 KEY_L | KEY_MOD1 | KEY_MOD2 ,
484 KEY_M | KEY_MOD1 | KEY_MOD2 ,
485 KEY_N | KEY_MOD1 | KEY_MOD2 ,
486 KEY_O | KEY_MOD1 | KEY_MOD2 ,
487 KEY_P | KEY_MOD1 | KEY_MOD2 ,
488 KEY_Q | KEY_MOD1 | KEY_MOD2 ,
489 KEY_R | KEY_MOD1 | KEY_MOD2 ,
490 KEY_S | KEY_MOD1 | KEY_MOD2 ,
491 KEY_T | KEY_MOD1 | KEY_MOD2 ,
492 KEY_U | KEY_MOD1 | KEY_MOD2 ,
493 KEY_V | KEY_MOD1 | KEY_MOD2 ,
494 KEY_W | KEY_MOD1 | KEY_MOD2 ,
495 KEY_X | KEY_MOD1 | KEY_MOD2 ,
496 KEY_Y | KEY_MOD1 | KEY_MOD2 ,
497 KEY_Z | KEY_MOD1 | KEY_MOD2 ,
499 KEY_F1 | KEY_MOD1 | KEY_MOD2 ,
500 KEY_F2 | KEY_MOD1 | KEY_MOD2 ,
501 KEY_F3 | KEY_MOD1 | KEY_MOD2 ,
502 KEY_F4 | KEY_MOD1 | KEY_MOD2 ,
503 KEY_F5 | KEY_MOD1 | KEY_MOD2 ,
504 KEY_F6 | KEY_MOD1 | KEY_MOD2 ,
505 KEY_F7 | KEY_MOD1 | KEY_MOD2 ,
506 KEY_F8 | KEY_MOD1 | KEY_MOD2 ,
507 KEY_F9 | KEY_MOD1 | KEY_MOD2 ,
508 KEY_F10 | KEY_MOD1 | KEY_MOD2 ,
509 KEY_F11 | KEY_MOD1 | KEY_MOD2 ,
510 KEY_F12 | KEY_MOD1 | KEY_MOD2 ,
511 KEY_F13 | KEY_MOD1 | KEY_MOD2 ,
512 KEY_F14 | KEY_MOD1 | KEY_MOD2 ,
513 KEY_F15 | KEY_MOD1 | KEY_MOD2 ,
514 KEY_F16 | KEY_MOD1 | KEY_MOD2 ,
516 KEY_DOWN | KEY_MOD1 | KEY_MOD2 ,
517 KEY_UP | KEY_MOD1 | KEY_MOD2 ,
518 KEY_LEFT | KEY_MOD1 | KEY_MOD2 ,
519 KEY_RIGHT | KEY_MOD1 | KEY_MOD2 ,
520 KEY_HOME | KEY_MOD1 | KEY_MOD2 ,
521 KEY_END | KEY_MOD1 | KEY_MOD2 ,
522 KEY_PAGEUP | KEY_MOD1 | KEY_MOD2 ,
523 KEY_PAGEDOWN | KEY_MOD1 | KEY_MOD2 ,
524 KEY_RETURN | KEY_MOD1 | KEY_MOD2 ,
525 KEY_SPACE | KEY_MOD1 | KEY_MOD2 ,
526 KEY_BACKSPACE | KEY_MOD1 | KEY_MOD2 ,
527 KEY_INSERT | KEY_MOD1 | KEY_MOD2 ,
528 KEY_DELETE | KEY_MOD1 | KEY_MOD2 ,
530 KEY_0 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
531 KEY_1 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
532 KEY_2 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
533 KEY_3 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
534 KEY_4 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
535 KEY_5 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
536 KEY_6 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
537 KEY_7 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
538 KEY_8 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
539 KEY_9 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
540 KEY_A | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
541 KEY_B | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
542 KEY_C | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
543 KEY_D | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
544 KEY_E | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
545 KEY_F | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
546 KEY_G | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
547 KEY_H | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
548 KEY_I | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
549 KEY_J | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
550 KEY_K | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
551 KEY_L | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
552 KEY_M | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
553 KEY_N | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
554 KEY_O | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
555 KEY_P | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
556 KEY_Q | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
557 KEY_R | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
558 KEY_S | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
559 KEY_T | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
560 KEY_U | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
561 KEY_V | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
562 KEY_W | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
563 KEY_X | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
564 KEY_Y | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
565 KEY_Z | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
566 KEY_SEMICOLON | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
567 KEY_BRACKETLEFT | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
568 KEY_BRACKETRIGHT | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
569 KEY_POINT | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
571 KEY_F1 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
572 KEY_F2 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
573 KEY_F3 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
574 KEY_F4 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
575 KEY_F5 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
576 KEY_F6 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
577 KEY_F7 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
578 KEY_F8 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
579 KEY_F9 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
580 KEY_F10 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
581 KEY_F11 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
582 KEY_F12 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
583 KEY_F13 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
584 KEY_F14 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
585 KEY_F15 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
586 KEY_F16 | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
588 KEY_DOWN | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
589 KEY_UP | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
590 KEY_LEFT | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
591 KEY_RIGHT | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
592 KEY_HOME | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
593 KEY_END | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
594 KEY_PAGEUP | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
595 KEY_PAGEDOWN | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
596 KEY_RETURN | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
597 KEY_SPACE | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
598 KEY_BACKSPACE | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
599 KEY_INSERT | KEY_SHIFT | KEY_MOD1 | KEY_MOD2,
600 KEY_DELETE | KEY_SHIFT | KEY_MOD1 | KEY_MOD2
603 static sal_uInt16 KEYCODE_ARRAY_SIZE = SAL_N_ELEMENTS(KEYCODE_ARRAY);
605 //-----------------------------------------------
606 // seems to be needed to layout the list box, which shows all
607 // assignable shortcuts
608 static long AccCfgTabs[] =
610 2, // Number of Tabs
612 120 // Function
615 //-----------------------------------------------
616 class SfxAccCfgLBoxString_Impl : public SvLBoxString
618 public:
619 SfxAccCfgLBoxString_Impl( SvTreeListEntry* pEntry,
620 sal_uInt16 nFlags,
621 const String& sText );
623 virtual ~SfxAccCfgLBoxString_Impl();
625 virtual void Paint(
626 const Point& aPos, SvTreeListBox& rDevice, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
629 //-----------------------------------------------
630 SfxAccCfgLBoxString_Impl::SfxAccCfgLBoxString_Impl( SvTreeListEntry* pEntry,
631 sal_uInt16 nFlags,
632 const String& sText )
633 : SvLBoxString(pEntry, nFlags, sText)
637 //-----------------------------------------------
638 SfxAccCfgLBoxString_Impl::~SfxAccCfgLBoxString_Impl()
642 void SfxAccCfgLBoxString_Impl::Paint(
643 const Point& aPos, SvTreeListBox& rDevice, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry)
645 if (!pEntry)
646 return;
648 TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData();
649 if (!pUserData)
650 return;
652 if (pUserData->m_bIsConfigurable)
653 rDevice.DrawText(aPos, GetText());
654 else
655 rDevice.DrawCtrlText(aPos, GetText(), 0, STRING_LEN, TEXT_DRAW_DISABLE);
659 //-----------------------------------------------
660 void SfxAccCfgTabListBox_Impl::InitEntry(SvTreeListEntry* pEntry,
661 const OUString& rText,
662 const Image& rImage1,
663 const Image& rImage2,
664 SvLBoxButtonKind eButtonKind)
666 SvTabListBox::InitEntry(pEntry, rText, rImage1, rImage2, eButtonKind);
669 //-----------------------------------------------
670 /** select the entry, which match the current key input ... excepting
671 keys, which are used for the dialog itself.
673 void SfxAccCfgTabListBox_Impl::KeyInput(const KeyEvent& aKey)
675 KeyCode aCode1 = aKey.GetKeyCode();
676 sal_uInt16 nCode1 = aCode1.GetCode();
677 sal_uInt16 nMod1 = aCode1.GetModifier();
679 // is it related to our list box ?
680 if (
681 (nCode1 != KEY_DOWN ) &&
682 (nCode1 != KEY_UP ) &&
683 (nCode1 != KEY_LEFT ) &&
684 (nCode1 != KEY_RIGHT ) &&
685 (nCode1 != KEY_PAGEUP ) &&
686 (nCode1 != KEY_PAGEDOWN)
689 SvTreeListEntry* pEntry = First();
690 while (pEntry)
692 TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData();
693 if (pUserData)
695 sal_uInt16 nCode2 = pUserData->m_aKey.GetCode();
696 sal_uInt16 nMod2 = pUserData->m_aKey.GetModifier();
697 if (
698 (nCode1 == nCode2) &&
699 (nMod1 == nMod2 )
702 Select (pEntry);
703 MakeVisible(pEntry);
704 return;
707 pEntry = Next(pEntry);
711 // no - handle it as normal dialog input
712 SvTabListBox::KeyInput(aKey);
715 //-----------------------------------------------
716 SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( Window* pParent, const SfxItemSet& aSet )
717 : SfxTabPage (pParent, CUI_RES(RID_SVXPAGE_KEYBOARD), aSet)
718 , m_pMacroInfoItem ()
719 , m_pStringItem ()
720 , m_pFontItem ()
721 , m_pFileDlg (NULL)
722 , aEntriesBox (this , this, CUI_RES(BOX_ACC_ENTRIES ))
723 , aKeyboardGroup (this , CUI_RES(GRP_ACC_KEYBOARD ))
724 , aOfficeButton (this , CUI_RES(RB_OFFICE ))
725 , aModuleButton (this , CUI_RES(RB_MODULE ))
726 , aChangeButton (this , CUI_RES(BTN_ACC_CHANGE ))
727 , aRemoveButton (this , CUI_RES(BTN_ACC_REMOVE ))
728 , aGroupText (this , CUI_RES(TXT_ACC_GROUP ))
729 , pGroupLBox(new SfxConfigGroupListBox_Impl( this, CUI_RES(BOX_ACC_GROUP), SFX_SLOT_ACCELCONFIG ))
730 , aFunctionText (this , CUI_RES(TXT_ACC_FUNCTION ))
731 , pFunctionBox(new SfxConfigFunctionListBox_Impl( this, CUI_RES( BOX_ACC_FUNCTION )))
732 , aKeyText (this , CUI_RES(TXT_ACC_KEY ))
733 , aKeyBox (this , CUI_RES(BOX_ACC_KEY ))
734 , aFunctionsGroup (this , CUI_RES(GRP_ACC_FUNCTIONS ))
735 , aLoadButton (this , CUI_RES(BTN_LOAD ))
736 , aSaveButton (this , CUI_RES(BTN_SAVE ))
737 , aResetButton (this , CUI_RES(BTN_RESET ))
738 , aLoadAccelConfigStr ( CUI_RES( STR_LOADACCELCONFIG ) )
739 , aSaveAccelConfigStr ( CUI_RES( STR_SAVEACCELCONFIG ) )
740 , aFilterCfgStr ( CUI_RES( STR_FILTERNAME_CFG ) )
741 , m_bStylesInfoInitialized(sal_False)
742 , m_xGlobal ()
743 , m_xModule ()
744 , m_xAct ()
746 FreeResource();
748 aFilterAllStr = String( SfxResId( STR_SFX_FILTERNAME_ALL ) );
750 // install handler functions
751 aChangeButton.SetClickHdl( LINK( this, SfxAcceleratorConfigPage, ChangeHdl ));
752 aRemoveButton.SetClickHdl( LINK( this, SfxAcceleratorConfigPage, RemoveHdl ));
753 aEntriesBox.SetSelectHdl ( LINK( this, SfxAcceleratorConfigPage, SelectHdl ));
754 pGroupLBox->SetSelectHdl ( LINK( this, SfxAcceleratorConfigPage, SelectHdl ));
755 pFunctionBox->SetSelectHdl( LINK( this, SfxAcceleratorConfigPage, SelectHdl ));
756 aKeyBox.SetSelectHdl ( LINK( this, SfxAcceleratorConfigPage, SelectHdl ));
757 aLoadButton.SetClickHdl ( LINK( this, SfxAcceleratorConfigPage, Load ));
758 aSaveButton.SetClickHdl ( LINK( this, SfxAcceleratorConfigPage, Save ));
759 aResetButton.SetClickHdl ( LINK( this, SfxAcceleratorConfigPage, Default ));
760 aOfficeButton.SetClickHdl( LINK( this, SfxAcceleratorConfigPage, RadioHdl ));
761 aModuleButton.SetClickHdl( LINK( this, SfxAcceleratorConfigPage, RadioHdl ));
763 // initialize Entriesbox
764 aEntriesBox.SetStyle(aEntriesBox.GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN);
765 aEntriesBox.SetSelectionMode(SINGLE_SELECTION);
766 aEntriesBox.SetTabs(&AccCfgTabs[0], MAP_APPFONT);
767 aEntriesBox.Resize(); // OS: Hack for right selection
768 aEntriesBox.SetSpaceBetweenEntries(0);
769 aEntriesBox.SetDragDropMode(0);
771 // detect max keyname width
772 long nMaxWidth = 0;
773 for ( sal_uInt16 i = 0; i < KEYCODE_ARRAY_SIZE; ++i )
775 long nTmp = GetTextWidth( KeyCode( KEYCODE_ARRAY[i] ).GetName() );
776 if ( nTmp > nMaxWidth )
777 nMaxWidth = nTmp;
779 // recalc second tab
780 long nNewTab = PixelToLogic( Size( nMaxWidth, 0 ), MAP_APPFONT ).Width();
781 nNewTab = nNewTab + 5; // additional space
782 aEntriesBox.SetTab( 1, nNewTab );
784 // initialize GroupBox
785 pGroupLBox->SetFunctionListBox(pFunctionBox);
787 // initialize KeyBox
788 aKeyBox.SetStyle(aKeyBox.GetStyle()|WB_CLIPCHILDREN|WB_HSCROLL|WB_SORT);
791 //-----------------------------------------------
792 SfxAcceleratorConfigPage::~SfxAcceleratorConfigPage()
794 // free memory - remove all dynamic user data
795 SvTreeListEntry* pEntry = aEntriesBox.First();
796 while (pEntry)
798 TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData();
799 if (pUserData)
800 delete pUserData;
801 pEntry = aEntriesBox.Next(pEntry);
804 pEntry = aKeyBox.First();
805 while (pEntry)
807 TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData();
808 if (pUserData)
809 delete pUserData;
810 pEntry = aKeyBox.Next(pEntry);
813 aEntriesBox.Clear();
814 aKeyBox.Clear();
816 delete m_pFileDlg;
817 delete pGroupLBox;
818 delete pFunctionBox;
821 //-----------------------------------------------
822 void SfxAcceleratorConfigPage::InitAccCfg()
824 // already initialized ?
825 if (m_xContext.is())
826 return; // yes -> do nothing
830 // no - initialize this instance
831 m_xContext = ::comphelper::getProcessComponentContext();
833 m_xUICmdDescription = css::frame::UICommandDescription::create(m_xContext);
835 // get the current active frame, which should be our "parent"
836 // for this session
837 m_xFrame = GetFrame();
838 if ( !m_xFrame.is() )
840 css::uno::Reference< css::frame::XDesktop2 > xDesktop = css::frame::Desktop::create( m_xContext );
841 m_xFrame = xDesktop->getActiveFrame();
844 // identify module
845 css::uno::Reference< css::frame::XModuleManager2 > xModuleManager =
846 css::frame::ModuleManager::create(m_xContext);
847 m_sModuleLongName = xModuleManager->identify(m_xFrame);
848 ::comphelper::SequenceAsHashMap lModuleProps(xModuleManager->getByName(m_sModuleLongName));
849 m_sModuleShortName = lModuleProps.getUnpackedValueOrDefault(MODULEPROP_SHORTNAME, OUString());
850 m_sModuleUIName = lModuleProps.getUnpackedValueOrDefault(MODULEPROP_UINAME , OUString());
852 // get global accelerator configuration
853 m_xGlobal = css::ui::GlobalAcceleratorConfiguration::create(m_xContext);
855 // get module accelerator configuration
857 css::uno::Reference< css::ui::XModuleUIConfigurationManagerSupplier > xModuleCfgSupplier( css::ui::ModuleUIConfigurationManagerSupplier::create(m_xContext) );
858 css::uno::Reference< css::ui::XUIConfigurationManager > xUICfgManager = xModuleCfgSupplier->getUIConfigurationManager(m_sModuleLongName);
859 m_xModule = css::uno::Reference< css::ui::XAcceleratorConfiguration >(xUICfgManager->getShortCutManager(), css::uno::UNO_QUERY_THROW);
861 catch(const css::uno::RuntimeException&)
862 { throw; }
863 catch(const css::uno::Exception&)
864 { m_xContext.clear(); }
867 //-----------------------------------------------
868 /** Initialize text columns with own class to enable custom painting
869 This is needed as we have to paint disabled entries by ourself. No support for that in the
870 original SvTabListBox!
872 void SfxAcceleratorConfigPage::CreateCustomItems( SvTreeListEntry* pEntry,
873 const String& sCol1 ,
874 const String& sCol2 )
876 SfxAccCfgLBoxString_Impl* pStringItem = new SfxAccCfgLBoxString_Impl(pEntry, 0, sCol1);
877 pEntry->ReplaceItem(pStringItem, 1);
879 pStringItem = new SfxAccCfgLBoxString_Impl(pEntry, 0, sCol2);
880 pEntry->ReplaceItem(pStringItem, 2);
883 //-----------------------------------------------
884 void SfxAcceleratorConfigPage::Init(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xAccMgr)
886 if (!xAccMgr.is())
887 return;
889 if (!m_bStylesInfoInitialized)
891 css::uno::Reference< css::frame::XController > xController;
892 css::uno::Reference< css::frame::XModel > xModel;
893 if (m_xFrame.is())
894 xController = m_xFrame->getController();
895 if (xController.is())
896 xModel = xController->getModel();
898 m_aStylesInfo.setModel(xModel);
899 pFunctionBox->SetStylesInfo(&m_aStylesInfo);
900 pGroupLBox->SetStylesInfo(&m_aStylesInfo);
901 m_bStylesInfoInitialized = sal_True;
904 // Insert all editable accelerators into list box. It is possible
905 // that some accelerators are not mapped on the current system/keyboard
906 // but we don't want to lose these mappings.
907 sal_uInt16 c1 = KEYCODE_ARRAY_SIZE;
908 sal_uInt16 i1 = 0;
909 sal_uInt16 nListPos = 0;
910 for (i1=0; i1<c1; ++i1)
912 KeyCode aKey = KEYCODE_ARRAY[i1];
913 String sKey = aKey.GetName();
914 if (!sKey.Len())
915 continue;
916 TAccInfo* pEntry = new TAccInfo(i1, nListPos, aKey);
917 SvTreeListEntry* pLBEntry = aEntriesBox.InsertEntryToColumn(sKey, 0L, LIST_APPEND, 0xFFFF);
918 pLBEntry->SetUserData(pEntry);
921 // Assign all commands to its shortcuts - reading the accelerator config.
922 css::uno::Sequence< css::awt::KeyEvent > lKeys = xAccMgr->getAllKeyEvents();
923 sal_Int32 c2 = lKeys.getLength();
924 sal_Int32 i2 = 0;
925 sal_uInt16 nCol = aEntriesBox.TabCount()-1;
927 for (i2=0; i2<c2; ++i2)
929 const css::awt::KeyEvent& aAWTKey = lKeys[i2];
930 OUString sCommand = xAccMgr->getCommandByKeyEvent(aAWTKey);
931 String sLabel = GetLabel4Command(sCommand);
932 KeyCode aKeyCode = ::svt::AcceleratorExecute::st_AWTKey2VCLKey(aAWTKey);
933 sal_uInt16 nPos = MapKeyCodeToPos(aKeyCode);
935 if (nPos == LISTBOX_ENTRY_NOTFOUND)
936 continue;
938 aEntriesBox.SetEntryText(sLabel, nPos, nCol);
940 SvTreeListEntry* pLBEntry = aEntriesBox.GetEntry(0, nPos);
941 TAccInfo* pEntry = (TAccInfo*)pLBEntry->GetUserData();
943 pEntry->m_bIsConfigurable = sal_True;
944 pEntry->m_sCommand = sCommand;
945 CreateCustomItems(pLBEntry, aEntriesBox.GetEntryText(pLBEntry, 0), sLabel);
948 // Map the VCL hardcoded key codes and mark them as not changeable
949 sal_uLong c3 = Application::GetReservedKeyCodeCount();
950 sal_uLong i3 = 0;
951 for (i3=0; i3<c3; ++i3)
953 const KeyCode* pKeyCode = Application::GetReservedKeyCode(i3);
954 sal_uInt16 nPos = MapKeyCodeToPos(*pKeyCode);
956 if (nPos == LISTBOX_ENTRY_NOTFOUND)
957 continue;
959 // Hardcoded function mapped so no ID possible and mark entry as not changeable
960 SvTreeListEntry* pLBEntry = aEntriesBox.GetEntry(0, nPos);
961 TAccInfo* pEntry = (TAccInfo*)pLBEntry->GetUserData();
963 pEntry->m_bIsConfigurable = sal_False;
964 CreateCustomItems(pLBEntry, aEntriesBox.GetEntryText(pLBEntry, 0), String());
968 //-----------------------------------------------
969 void SfxAcceleratorConfigPage::Apply(const css::uno::Reference< css::ui::XAcceleratorConfiguration >& xAccMgr)
971 if (!xAccMgr.is())
972 return;
974 // Go through the list from the bottom to the top ...
975 // because logical accelerator must be preferred instead of
976 // physical ones!
977 SvTreeListEntry* pEntry = aEntriesBox.First();
978 while (pEntry)
980 TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData();
981 OUString sCommand ;
982 css::awt::KeyEvent aAWTKey ;
984 if (pUserData)
986 sCommand = pUserData->m_sCommand;
987 aAWTKey = ::svt::AcceleratorExecute::st_VCLKey2AWTKey(pUserData->m_aKey);
992 if (!sCommand.isEmpty())
993 xAccMgr->setKeyEvent(aAWTKey, sCommand);
994 else
995 xAccMgr->removeKeyEvent(aAWTKey);
997 catch(const css::uno::RuntimeException&)
998 { throw; }
999 catch(const css::uno::Exception&)
1002 pEntry = aEntriesBox.Next(pEntry);
1006 //-----------------------------------------------
1007 void SfxAcceleratorConfigPage::ResetConfig()
1009 aEntriesBox.Clear();
1012 //-----------------------------------------------
1013 IMPL_LINK_NOARG(SfxAcceleratorConfigPage, Load)
1015 // ask for filename, where we should load the new config data from
1016 StartFileDialog( 0, aLoadAccelConfigStr );
1017 return 0;
1020 //-----------------------------------------------
1021 IMPL_LINK_NOARG(SfxAcceleratorConfigPage, Save)
1023 StartFileDialog( WB_SAVEAS, aSaveAccelConfigStr );
1024 return 0;
1027 //-----------------------------------------------
1028 IMPL_LINK_NOARG(SfxAcceleratorConfigPage, Default)
1030 css::uno::Reference< css::form::XReset > xReset(m_xAct, css::uno::UNO_QUERY);
1031 if (xReset.is())
1032 xReset->reset();
1034 aEntriesBox.SetUpdateMode(sal_False);
1035 ResetConfig();
1036 Init(m_xAct);
1037 aEntriesBox.SetUpdateMode(sal_True);
1038 aEntriesBox.Invalidate();
1039 aEntriesBox.Select(aEntriesBox.GetEntry(0, 0));
1041 return 0;
1044 //-----------------------------------------------
1045 IMPL_LINK_NOARG(SfxAcceleratorConfigPage, ChangeHdl)
1047 sal_uInt16 nPos = (sal_uInt16) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() );
1048 TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData();
1049 String sNewCommand = pFunctionBox->GetCurCommand();
1050 String sLabel = pFunctionBox->GetCurLabel();
1051 if (!sLabel.Len())
1052 sLabel = GetLabel4Command(sNewCommand);
1054 pEntry->m_sCommand = sNewCommand;
1055 sal_uInt16 nCol = aEntriesBox.TabCount() - 1;
1056 aEntriesBox.SetEntryText(sLabel, nPos, nCol);
1058 ((Link &) pFunctionBox->GetSelectHdl()).Call( pFunctionBox );
1059 return 0;
1062 //-----------------------------------------------
1063 IMPL_LINK_NOARG(SfxAcceleratorConfigPage, RemoveHdl)
1065 // get selected entry
1066 sal_uInt16 nPos = (sal_uInt16) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() );
1067 TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData();
1069 // remove function name from selected entry
1070 sal_uInt16 nCol = aEntriesBox.TabCount() - 1;
1071 aEntriesBox.SetEntryText( String(), nPos, nCol );
1072 pEntry->m_sCommand = OUString();
1074 ((Link &) pFunctionBox->GetSelectHdl()).Call( pFunctionBox );
1075 return 0;
1078 //-----------------------------------------------
1079 IMPL_LINK( SfxAcceleratorConfigPage, SelectHdl, Control*, pListBox )
1081 // disable help
1082 Help::ShowBalloon( this, Point(), String() );
1083 if ( pListBox == &aEntriesBox )
1085 sal_uInt16 nPos = (sal_uInt16) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() );
1086 TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData();
1087 OUString sPossibleNewCommand = pFunctionBox->GetCurCommand();
1089 aRemoveButton.Enable( sal_False );
1090 aChangeButton.Enable( sal_False );
1092 if (pEntry->m_bIsConfigurable)
1094 if (pEntry->isConfigured())
1095 aRemoveButton.Enable( sal_True );
1096 aChangeButton.Enable( pEntry->m_sCommand != sPossibleNewCommand );
1099 else if ( pListBox == pGroupLBox )
1101 pGroupLBox->GroupSelected();
1102 if ( !pFunctionBox->FirstSelected() )
1103 aChangeButton.Enable( sal_False );
1105 else if ( pListBox == pFunctionBox )
1107 aRemoveButton.Enable( sal_False );
1108 aChangeButton.Enable( sal_False );
1110 // #i36994 First selected can return zero!
1111 SvTreeListEntry* pLBEntry = aEntriesBox.FirstSelected();
1112 if ( pLBEntry != 0 )
1114 sal_uInt16 nPos = (sal_uInt16) aEntriesBox.GetModel()->GetRelPos( pLBEntry );
1115 TAccInfo* pEntry = (TAccInfo*)aEntriesBox.GetEntry(0, nPos)->GetUserData();
1116 OUString sPossibleNewCommand = pFunctionBox->GetCurCommand();
1118 if (pEntry->m_bIsConfigurable)
1120 if (pEntry->isConfigured())
1121 aRemoveButton.Enable( sal_True );
1122 aChangeButton.Enable( pEntry->m_sCommand != sPossibleNewCommand );
1125 // update key box
1126 aKeyBox.Clear();
1127 SvTreeListEntry* pIt = aEntriesBox.First();
1128 while ( pIt )
1130 TAccInfo* pUserData = (TAccInfo*)pIt->GetUserData();
1131 if ( pUserData && pUserData->m_sCommand == sPossibleNewCommand )
1133 TAccInfo* pU1 = new TAccInfo(-1, -1, pUserData->m_aKey);
1134 SvTreeListEntry* pE1 = aKeyBox.InsertEntry( pUserData->m_aKey.GetName(), 0L, sal_True, LIST_APPEND );
1135 pE1->SetUserData(pU1);
1136 pE1->EnableChildrenOnDemand( sal_False );
1138 pIt = aEntriesBox.Next(pIt);
1142 else
1144 // goto selected "key" entry of the key box
1145 SvTreeListEntry* pE2 = 0;
1146 TAccInfo* pU2 = 0;
1147 sal_uInt16 nP2 = LISTBOX_ENTRY_NOTFOUND;
1148 SvTreeListEntry* pE3 = 0;
1150 pE2 = aKeyBox.FirstSelected();
1151 if (pE2)
1152 pU2 = (TAccInfo*)pE2->GetUserData();
1153 if (pU2)
1154 nP2 = MapKeyCodeToPos(pU2->m_aKey);
1155 if (nP2 != LISTBOX_ENTRY_NOTFOUND)
1156 pE3 = aEntriesBox.GetEntry( 0, nP2 );
1157 if (pE3)
1159 aEntriesBox.Select( pE3 );
1160 aEntriesBox.MakeVisible( pE3 );
1164 return 0;
1167 //-----------------------------------------------
1168 IMPL_LINK_NOARG(SfxAcceleratorConfigPage, RadioHdl)
1170 css::uno::Reference< css::ui::XAcceleratorConfiguration > xOld = m_xAct;
1172 if (aOfficeButton.IsChecked())
1173 m_xAct = m_xGlobal;
1174 else if (aModuleButton.IsChecked())
1175 m_xAct = m_xModule;
1177 // nothing changed? => do nothing!
1178 if ( m_xAct.is() && ( xOld == m_xAct ) )
1179 return 0;
1181 aEntriesBox.SetUpdateMode( sal_False );
1182 ResetConfig();
1183 Init(m_xAct);
1184 aEntriesBox.SetUpdateMode( sal_True );
1185 aEntriesBox.Invalidate();
1187 pGroupLBox->Init(m_xContext, m_xFrame, m_sModuleLongName);
1189 // pb: #133213# do not select NULL entries
1190 SvTreeListEntry* pEntry = aEntriesBox.GetEntry( 0, 0 );
1191 if ( pEntry )
1192 aEntriesBox.Select( pEntry );
1193 pEntry = pGroupLBox->GetEntry( 0, 0 );
1194 if ( pEntry )
1195 pGroupLBox->Select( pEntry );
1197 ((Link &) pFunctionBox->GetSelectHdl()).Call( pFunctionBox );
1198 return 1L;
1201 //-----------------------------------------------
1202 IMPL_LINK_NOARG(SfxAcceleratorConfigPage, LoadHdl)
1204 assert(m_pFileDlg);
1206 OUString sCfgName;
1207 if ( ERRCODE_NONE == m_pFileDlg->GetError() )
1208 sCfgName = m_pFileDlg->GetPath();
1210 if ( sCfgName.isEmpty() )
1211 return 0;
1213 GetTabDialog()->EnterWait();
1215 css::uno::Reference< css::frame::XModel > xDoc ;
1216 css::uno::Reference< css::ui::XUIConfigurationManager > xCfgMgr ;
1217 css::uno::Reference< css::embed::XStorage > xRootStorage; // we must hold the root storage alive, if xCfgMgr is used!
1221 // first check if URL points to a document already loaded
1222 xDoc = SearchForAlreadyLoadedDoc(sCfgName);
1223 if (xDoc.is())
1225 // Get ui config manager. There should always be one at the model.
1226 css::uno::Reference< css::ui::XUIConfigurationManagerSupplier > xCfgSupplier(xDoc, css::uno::UNO_QUERY_THROW);
1227 xCfgMgr = xCfgSupplier->getUIConfigurationManager();
1229 else
1231 // URL doesn't point to a loaded document, try to access it as a single storage
1232 // dont forget to release the storage afterwards!
1233 css::uno::Reference< css::lang::XSingleServiceFactory > xStorageFactory( css::embed::StorageFactory::create( m_xContext ) );
1234 css::uno::Sequence< css::uno::Any > lArgs(2);
1235 lArgs[0] <<= sCfgName;
1236 lArgs[1] <<= css::embed::ElementModes::READ;
1238 xRootStorage = css::uno::Reference< css::embed::XStorage >(xStorageFactory->createInstanceWithArguments(lArgs), css::uno::UNO_QUERY_THROW);
1239 css::uno::Reference< css::embed::XStorage > xUIConfig = xRootStorage->openStorageElement(FOLDERNAME_UICONFIG, css::embed::ElementModes::READ);
1240 if (xUIConfig.is())
1242 css::uno::Reference< css::ui::XUIConfigurationManager2 > xCfgMgr2 = css::ui::UIConfigurationManager::create( m_xContext );
1243 xCfgMgr2->setStorage(xUIConfig);
1244 xCfgMgr.set( xCfgMgr2, css::uno::UNO_QUERY_THROW );
1248 if (xCfgMgr.is())
1250 // open the configuration and update our UI
1251 css::uno::Reference< css::ui::XAcceleratorConfiguration > xTempAccMgr(xCfgMgr->getShortCutManager(), css::uno::UNO_QUERY_THROW);
1253 aEntriesBox.SetUpdateMode(sal_False);
1254 ResetConfig();
1255 Init(xTempAccMgr);
1256 aEntriesBox.SetUpdateMode(sal_True);
1257 aEntriesBox.Invalidate();
1258 aEntriesBox.Select(aEntriesBox.GetEntry(0, 0));
1262 // dont forget to close the new opened storage!
1263 // We are the owner of it.
1264 if (xRootStorage.is())
1266 css::uno::Reference< css::lang::XComponent > xComponent;
1267 xComponent = css::uno::Reference< css::lang::XComponent >(xCfgMgr, css::uno::UNO_QUERY);
1268 if (xComponent.is())
1269 xComponent->dispose();
1270 xComponent = css::uno::Reference< css::lang::XComponent >(xRootStorage, css::uno::UNO_QUERY);
1271 if (xComponent.is())
1272 xComponent->dispose();
1275 catch(const css::uno::RuntimeException&)
1276 { throw; }
1277 catch(const css::uno::Exception&)
1280 GetTabDialog()->LeaveWait();
1282 return 0;
1285 //-----------------------------------------------
1286 IMPL_LINK_NOARG(SfxAcceleratorConfigPage, SaveHdl)
1288 assert(m_pFileDlg);
1290 OUString sCfgName;
1291 if ( ERRCODE_NONE == m_pFileDlg->GetError() )
1292 sCfgName = m_pFileDlg->GetPath();
1294 if ( sCfgName.isEmpty() )
1295 return 0;
1297 GetTabDialog()->EnterWait();
1299 css::uno::Reference< css::frame::XModel > xDoc ;
1300 css::uno::Reference< css::ui::XUIConfigurationManager > xCfgMgr ;
1301 css::uno::Reference< css::embed::XStorage > xRootStorage;
1305 // first check if URL points to a document already loaded
1306 xDoc = SearchForAlreadyLoadedDoc(sCfgName);
1307 if (xDoc.is())
1309 // get config manager, force creation if there was none before
1310 css::uno::Reference< css::ui::XUIConfigurationManagerSupplier > xCfgSupplier(xDoc, css::uno::UNO_QUERY_THROW);
1311 xCfgMgr = xCfgSupplier->getUIConfigurationManager();
1313 else
1315 // URL doesn't point to a loaded document, try to access it as a single storage
1316 css::uno::Reference< css::lang::XSingleServiceFactory > xStorageFactory( css::embed::StorageFactory::create( m_xContext ) );
1317 css::uno::Sequence< css::uno::Any > lArgs(2);
1318 lArgs[0] <<= sCfgName;
1319 lArgs[1] <<= css::embed::ElementModes::WRITE;
1321 xRootStorage = css::uno::Reference< css::embed::XStorage >(
1322 xStorageFactory->createInstanceWithArguments(lArgs),
1323 css::uno::UNO_QUERY_THROW);
1325 css::uno::Reference< css::embed::XStorage > xUIConfig(
1326 xRootStorage->openStorageElement(FOLDERNAME_UICONFIG, css::embed::ElementModes::WRITE),
1327 css::uno::UNO_QUERY_THROW);
1328 css::uno::Reference< css::beans::XPropertySet > xUIConfigProps(
1329 xUIConfig,
1330 css::uno::UNO_QUERY_THROW);
1332 // set the correct media type if the storage was new created
1333 OUString sMediaType;
1334 xUIConfigProps->getPropertyValue(MEDIATYPE_PROPNAME) >>= sMediaType;
1335 if (sMediaType.isEmpty())
1336 xUIConfigProps->setPropertyValue(MEDIATYPE_PROPNAME, css::uno::makeAny(MEDIATYPE_UICONFIG));
1338 css::uno::Reference< css::ui::XUIConfigurationManager2 > xCfgMgr2 = css::ui::UIConfigurationManager::create( m_xContext );
1339 xCfgMgr2->setStorage(xUIConfig);
1340 xCfgMgr.set( xCfgMgr2, css::uno::UNO_QUERY_THROW );
1343 if (xCfgMgr.is())
1345 // get the target configuration access and update with all shortcuts
1346 // which are set currently at the UI !
1347 // Dont copy the m_xAct content to it ... because m_xAct will be updated
1348 // from the UI on pressing the button "OK" only. And inbetween it's not up to date !
1349 css::uno::Reference< css::ui::XAcceleratorConfiguration > xTargetAccMgr(xCfgMgr->getShortCutManager(), css::uno::UNO_QUERY_THROW);
1350 Apply(xTargetAccMgr);
1352 // commit (order is important!)
1353 css::uno::Reference< css::ui::XUIConfigurationPersistence > xCommit1(xTargetAccMgr, css::uno::UNO_QUERY_THROW);
1354 css::uno::Reference< css::ui::XUIConfigurationPersistence > xCommit2(xCfgMgr , css::uno::UNO_QUERY_THROW);
1355 xCommit1->store();
1356 xCommit2->store();
1358 if (xRootStorage.is())
1360 // Commit root storage
1361 css::uno::Reference< css::embed::XTransactedObject > xCommit3(xRootStorage, css::uno::UNO_QUERY_THROW);
1362 xCommit3->commit();
1366 if (xRootStorage.is())
1368 css::uno::Reference< css::lang::XComponent > xComponent(xCfgMgr, css::uno::UNO_QUERY);
1369 if (xComponent.is())
1370 xComponent->dispose();
1371 xComponent.set(xRootStorage, css::uno::UNO_QUERY);
1372 if (xComponent.is())
1373 xComponent->dispose();
1376 catch(const css::uno::RuntimeException&)
1377 { throw; }
1378 catch(const css::uno::Exception&)
1381 GetTabDialog()->LeaveWait();
1383 return 0;
1386 //-----------------------------------------------
1387 void SfxAcceleratorConfigPage::StartFileDialog( WinBits nBits, const String& rTitle )
1389 bool bSave = ( ( nBits & WB_SAVEAS ) == WB_SAVEAS );
1390 short nDialogType = bSave ? css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION
1391 : css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE;
1392 if ( m_pFileDlg )
1393 delete m_pFileDlg;
1394 m_pFileDlg = new sfx2::FileDialogHelper( nDialogType, 0 );
1396 m_pFileDlg->SetTitle( rTitle );
1397 m_pFileDlg->AddFilter( aFilterAllStr, OUString(FILEDIALOG_FILTER_ALL) );
1398 m_pFileDlg->AddFilter( aFilterCfgStr, OUString("*.cfg") );
1399 m_pFileDlg->SetCurrentFilter( aFilterCfgStr );
1401 Link aDlgClosedLink = bSave ? LINK( this, SfxAcceleratorConfigPage, SaveHdl )
1402 : LINK( this, SfxAcceleratorConfigPage, LoadHdl );
1403 m_pFileDlg->StartExecuteModal( aDlgClosedLink );
1406 //-----------------------------------------------
1407 sal_Bool SfxAcceleratorConfigPage::FillItemSet( SfxItemSet& )
1409 Apply(m_xAct);
1412 m_xAct->store();
1414 catch(const css::uno::RuntimeException&)
1415 { throw; }
1416 catch(const css::uno::Exception&)
1417 { return sal_False; }
1419 return sal_True;
1422 //-----------------------------------------------
1423 void SfxAcceleratorConfigPage::Reset( const SfxItemSet& rSet )
1425 // open accelerator configs
1426 // Note: It initialize some other members too, which are needed here ...
1427 // e.g. m_sModuleUIName!
1428 InitAccCfg();
1430 // change te description of the radio button, which switch to the module
1431 // dependend accelerator configuration
1432 String sButtonText = aModuleButton.GetText();
1433 sButtonText.SearchAndReplace(OUString("$(MODULE)"), m_sModuleUIName);
1434 aModuleButton.SetText(sButtonText);
1436 if (m_xModule.is())
1437 aModuleButton.Check();
1438 else
1440 aModuleButton.Hide();
1441 aOfficeButton.Check();
1444 RadioHdl(0);
1446 const SfxPoolItem* pMacroItem=0;
1447 if( SFX_ITEM_SET == rSet.GetItemState( SID_MACROINFO, sal_True, &pMacroItem ) )
1449 m_pMacroInfoItem = PTR_CAST( SfxMacroInfoItem, pMacroItem );
1450 pGroupLBox->SelectMacro( m_pMacroInfoItem );
1452 else
1454 const SfxPoolItem* pStringItem=0;
1455 if( SFX_ITEM_SET == rSet.GetItemState( SID_CHARMAP, sal_True, &pStringItem ) )
1456 m_pStringItem = PTR_CAST( SfxStringItem, pStringItem );
1458 const SfxPoolItem* pFontItem=0;
1459 if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_SPECIALCHAR, sal_True, &pFontItem ) )
1460 m_pFontItem = PTR_CAST( SfxStringItem, pFontItem );
1464 //-----------------------------------------------
1465 sal_uInt16 SfxAcceleratorConfigPage::MapKeyCodeToPos(const KeyCode& aKey) const
1467 sal_uInt16 nCode1 = aKey.GetCode()+aKey.GetModifier();
1468 SvTreeListEntry* pEntry = aEntriesBox.First();
1469 sal_uInt16 i = 0;
1471 while (pEntry)
1473 TAccInfo* pUserData = (TAccInfo*)pEntry->GetUserData();
1474 if (pUserData)
1476 sal_uInt16 nCode2 = pUserData->m_aKey.GetCode()+pUserData->m_aKey.GetModifier();
1477 if (nCode1 == nCode2)
1478 return i;
1480 pEntry = aEntriesBox.Next(pEntry);
1481 ++i;
1484 return LISTBOX_ENTRY_NOTFOUND;
1487 //-----------------------------------------------
1488 String SfxAcceleratorConfigPage::GetLabel4Command(const String& sCommand)
1492 // check global command configuration first
1493 css::uno::Reference< css::container::XNameAccess > xModuleConf;
1494 m_xUICmdDescription->getByName(m_sModuleLongName) >>= xModuleConf;
1495 if (xModuleConf.is())
1497 ::comphelper::SequenceAsHashMap lProps(xModuleConf->getByName(sCommand));
1498 String sLabel = String(lProps.getUnpackedValueOrDefault(CMDPROP_UINAME, OUString()));
1499 if (sLabel.Len())
1500 return sLabel;
1503 catch(const css::uno::RuntimeException&)
1504 { throw; }
1505 catch(const css::uno::Exception&)
1508 // may be it's a style URL .. they must be handled special
1509 SfxStyleInfo_Impl aStyle;
1510 aStyle.sCommand = sCommand;
1511 if (m_aStylesInfo.parseStyleCommand(aStyle))
1513 m_aStylesInfo.getLabel4Style(aStyle);
1514 return aStyle.sLabel;
1516 else
1518 String aRet(OUString("Symbols: "));
1519 xub_StrLen nPos = sCommand.SearchAscii(".uno:InsertSymbol?Symbols:string=");
1520 if ( nPos == 0 )
1522 aRet += String( sCommand, 34, sCommand.Len()-34 );
1523 return aRet;
1527 return sCommand;
1530 SfxTabPage* SfxAcceleratorConfigPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
1532 return new SfxAcceleratorConfigPage( pParent, rAttrSet );
1535 //-----------------------------------------------
1536 css::uno::Reference< css::frame::XModel > SfxAcceleratorConfigPage::SearchForAlreadyLoadedDoc(const String& /*sName*/)
1538 return css::uno::Reference< css::frame::XModel >();
1541 SvxShortcutAssignDlg::SvxShortcutAssignDlg( Window* pParent, const uno::Reference< frame::XFrame >& rxDocumentFrame, const SfxItemSet& rSet )
1542 : SfxNoLayoutSingleTabDialog( pParent, rSet, 0 )
1544 SfxTabPage* pPage = SfxAcceleratorConfigPage::Create( this, rSet );
1545 pPage->SetFrame( rxDocumentFrame );
1546 SetTabPage( pPage );
1550 SvxShortcutAssignDlg::~SvxShortcutAssignDlg()
1555 // .uno:InsertSymbol?Symbols:string=bla
1557 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */