Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
099f1016
Kaydet (Commit)
099f1016
authored
Kas 13, 2015
tarafından
Samuel Mehrbrodt
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Cleanup: Consolidate the different ways to get command labels/tooltips
Change-Id: Ieab809a3122c9d592894b84ec2e68195a4e02dde
üst
773a07a9
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
100 additions
and
195 deletions
+100
-195
deletedspecial.cxx
compilerplugins/clang/store/deletedspecial.cxx
+1
-1
toolbarmanager.cxx
framework/source/uielement/toolbarmanager.cxx
+5
-120
ControllerItem.hxx
include/sfx2/sidebar/ControllerItem.hxx
+0
-5
commandinfoprovider.hxx
include/svtools/commandinfoprovider.hxx
+36
-18
Library_sfx.mk
sfx2/Library_sfx.mk
+0
-1
ControllerFactory.cxx
sfx2/source/sidebar/ControllerFactory.cxx
+4
-4
ControllerItem.cxx
sfx2/source/sidebar/ControllerItem.cxx
+2
-9
Library_svt.mk
svtools/Library_svt.mk
+1
-0
commandinfoprovider.cxx
svtools/source/misc/commandinfoprovider.cxx
+51
-36
InsertPropertyPanel.cxx
svx/source/sidebar/insert/InsertPropertyPanel.cxx
+0
-1
No files found.
compilerplugins/clang/store/deletedspecial.cxx
Dosyayı görüntüle @
099f1016
...
...
@@ -118,7 +118,7 @@ bool DeletedSpecial::VisitCXXMethodDecl(CXXMethodDecl const * decl) {
||
whitelist
(
decl
,
"sd::IconCache"
,
"sd/source/ui/inc/tools/IconCache.hxx"
)
||
whitelist
(
decl
,
"sd::RemoteServer"
,
"sd/source/ui/inc/RemoteServer.hxx"
)
||
whitelist
(
decl
,
"sd::slidesorter::cache::PageCacheManager"
,
"sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx"
)
||
whitelist
(
decl
,
"s
fx2::sidebar::CommandInfoProvider"
,
"include/sfx2/sidebar/CommandInfoP
rovider.hxx"
)
||
whitelist
(
decl
,
"s
vt::CommandInfoProvider"
,
"include/svt/commandinfop
rovider.hxx"
)
||
whitelist
(
decl
,
"vcl::SettingsConfigItem"
,
"include/vcl/configsettings.hxx"
)
||
whitelist
(
decl
,
"writerfilter::ooxml::OOXMLFactory"
,
"writerfilter/source/ooxml/OOXMLFactory.hxx"
))
{
...
...
framework/source/uielement/toolbarmanager.cxx
Dosyayı görüntüle @
099f1016
...
...
@@ -69,9 +69,9 @@
#include <vcl/toolbox.hxx>
#include <vcl/settings.hxx>
#include <svtools/commandinfoprovider.hxx>
#include <svtools/menuoptions.hxx>
#include <boost/bind.hpp>
#include <svtools/acceleratorexecute.hxx>
// namespaces
...
...
@@ -1272,8 +1272,8 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
if
((
nType
==
css
::
ui
::
ItemType
::
DEFAULT
)
&&
!
aCommandURL
.
isEmpty
()
)
{
OUString
aString
(
RetrieveFromCommand
(
"Name"
,
aCommandURL
));
OUString
aTooltipFromCommand
(
RetrieveFromCommand
(
"TooltipLabel"
,
aCommandURL
));
OUString
aString
(
svt
::
CommandInfoProvider
::
Instance
().
GetLabelForCommand
(
aCommandURL
,
m_xFrame
));
OUString
aTooltipFromCommand
(
svt
::
CommandInfoProvider
::
Instance
().
GetTooltipForCommand
(
aCommandURL
,
m_xFrame
,
false
));
ToolBoxItemBits
nItemBits
=
ConvertStyleToToolboxItemBits
(
nStyle
);
if
(
aMenuDesc
.
is
()
)
...
...
@@ -1289,8 +1289,8 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
sQuickHelp
=
aTooltip
;
else
if
(
!
aTooltipFromCommand
.
isEmpty
()
)
// Tooltip from uno command (TooltipLabel)
sQuickHelp
=
aTooltipFromCommand
;
OUString
sShortCut
;
if
(
RetrieveShortcut
(
aCommandURL
,
sShortCut
)
)
OUString
sShortCut
=
svt
::
CommandInfoProvider
::
Instance
().
GetCommandShortcut
(
aCommandURL
,
m_xFrame
)
;
if
(
!
sShortCut
.
isEmpty
(
)
)
{
sQuickHelp
+=
" ("
;
sQuickHelp
+=
sShortCut
;
...
...
@@ -2167,121 +2167,6 @@ Image ToolBarManager::QueryAddonsImage( const OUString& aCommandURL, bool bBigIm
Image
aImage
=
framework
::
AddonsOptions
().
GetImageFromURL
(
aCommandURL
,
bBigImages
);
return
aImage
;
}
bool
ToolBarManager
::
impl_RetrieveShortcutsFromConfiguration
(
const
Reference
<
XAcceleratorConfiguration
>&
rAccelCfg
,
const
OUString
&
rCommand
,
OUString
&
rShortCut
)
{
if
(
rAccelCfg
.
is
()
)
{
try
{
css
::
awt
::
KeyEvent
aKeyEvent
;
Sequence
<
OUString
>
aCommands
{
rCommand
};
Sequence
<
Any
>
aSeqKeyCode
(
rAccelCfg
->
getPreferredKeyEventsForCommandList
(
aCommands
)
);
if
(
aSeqKeyCode
.
getLength
()
==
1
)
{
if
(
aSeqKeyCode
[
0
]
>>=
aKeyEvent
)
{
rShortCut
=
svt
::
AcceleratorExecute
::
st_AWTKey2VCLKey
(
aKeyEvent
).
GetName
();
return
true
;
}
}
}
catch
(
const
IllegalArgumentException
&
)
{
}
}
return
false
;
}
bool
ToolBarManager
::
RetrieveShortcut
(
const
OUString
&
rCommandURL
,
OUString
&
rShortCut
)
{
if
(
m_bModuleIdentified
)
{
Reference
<
XAcceleratorConfiguration
>
xDocAccelCfg
(
m_xDocAcceleratorManager
);
Reference
<
XAcceleratorConfiguration
>
xModuleAccelCfg
(
m_xModuleAcceleratorManager
);
Reference
<
XAcceleratorConfiguration
>
xGlobalAccelCfg
(
m_xGlobalAcceleratorManager
);
if
(
!
m_bAcceleratorCfg
)
{
// Retrieve references on demand
m_bAcceleratorCfg
=
true
;
if
(
!
xDocAccelCfg
.
is
()
)
{
Reference
<
XController
>
xController
=
m_xFrame
->
getController
();
Reference
<
XModel
>
xModel
;
if
(
xController
.
is
()
)
{
xModel
=
xController
->
getModel
();
if
(
xModel
.
is
()
)
{
Reference
<
XUIConfigurationManagerSupplier
>
xSupplier
(
xModel
,
UNO_QUERY
);
if
(
xSupplier
.
is
()
)
{
Reference
<
XUIConfigurationManager
>
xDocUICfgMgr
(
xSupplier
->
getUIConfigurationManager
(),
UNO_QUERY
);
if
(
xDocUICfgMgr
.
is
()
)
{
xDocAccelCfg
=
xDocUICfgMgr
->
getShortCutManager
();
m_xDocAcceleratorManager
=
xDocAccelCfg
;
}
}
}
}
}
if
(
!
xModuleAccelCfg
.
is
()
)
{
Reference
<
XModuleUIConfigurationManagerSupplier
>
xModuleCfgMgrSupplier
=
theModuleUIConfigurationManagerSupplier
::
get
(
m_xContext
);
try
{
Reference
<
XUIConfigurationManager
>
xUICfgMgr
=
xModuleCfgMgrSupplier
->
getUIConfigurationManager
(
m_aModuleIdentifier
);
if
(
xUICfgMgr
.
is
()
)
{
xModuleAccelCfg
=
xUICfgMgr
->
getShortCutManager
();
m_xModuleAcceleratorManager
=
xModuleAccelCfg
;
}
}
catch
(
const
RuntimeException
&
)
{
throw
;
}
catch
(
const
Exception
&
)
{
}
}
if
(
!
xGlobalAccelCfg
.
is
()
)
try
{
xGlobalAccelCfg
=
GlobalAcceleratorConfiguration
::
create
(
m_xContext
);
m_xGlobalAcceleratorManager
=
xGlobalAccelCfg
;
}
catch
(
const
css
::
uno
::
DeploymentException
&
)
{
SAL_WARN
(
"fwk.uielement"
,
"GlobalAcceleratorConfiguration"
" not available. This should happen only on mobile platforms."
);
}
}
bool
bFound
=
false
;
if
(
m_xGlobalAcceleratorManager
.
is
()
)
bFound
=
impl_RetrieveShortcutsFromConfiguration
(
xGlobalAccelCfg
,
rCommandURL
,
rShortCut
);
if
(
!
bFound
&&
m_xModuleAcceleratorManager
.
is
()
)
bFound
=
impl_RetrieveShortcutsFromConfiguration
(
xModuleAccelCfg
,
rCommandURL
,
rShortCut
);
if
(
!
bFound
&&
m_xDocAcceleratorManager
.
is
()
)
impl_RetrieveShortcutsFromConfiguration
(
xGlobalAccelCfg
,
rCommandURL
,
rShortCut
);
if
(
bFound
)
return
true
;
}
return
false
;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
include/sfx2/sidebar/ControllerItem.hxx
Dosyayı görüntüle @
099f1016
...
...
@@ -94,11 +94,6 @@ public:
*/
void
RequestUpdate
();
/** Return the label for the command. It contains the keyboard
accelerator when one exists.
*/
::
rtl
::
OUString
GetLabel
()
const
;
/** Return the extended help text for the command.
Returns an empty string when the UNO command name is not available.
*/
...
...
include/s
fx2/sidebar/CommandInfoP
rovider.hxx
→
include/s
vtools/commandinfop
rovider.hxx
Dosyayı görüntüle @
099f1016
...
...
@@ -16,22 +16,22 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_
SFX2_SIDEBA
R_COMMANDINFOPROVIDER_HXX
#define INCLUDED_
SFX2_SIDEBA
R_COMMANDINFOPROVIDER_HXX
#ifndef INCLUDED_
COMPHELPE
R_COMMANDINFOPROVIDER_HXX
#define INCLUDED_
COMPHELPE
R_COMMANDINFOPROVIDER_HXX
#include <s
fx2/
dllapi.h>
#include <s
vtools/svt
dllapi.h>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
namespace
s
fx2
{
namespace
sidebar
{
namespace
s
vt
{
/** Provide information about UNO commands like tooltip text with
keyboard accelerator.
*/
class
S
FX2
_DLLPUBLIC
CommandInfoProvider
class
S
VT
_DLLPUBLIC
CommandInfoProvider
{
public
:
/** Return the singleton instance.
...
...
@@ -51,13 +51,32 @@ public:
@param rxFrame
The frame is used to identify the module and document.
@return
The returned label contains the keyboard accelerator, if
one is defined.
The command labe.
*/
::
rtl
::
OUString
GetLabelForCommand
(
const
::
rtl
::
OUString
&
rsCommandName
,
OUString
GetLabelForCommand
(
const
OUString
&
rsCommandName
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
);
/** Return a tooltip for the given command. Falls back to label if command has no tooltip.
@param rsCommandName
The command name is expected to start with .uno:
@param rxFrame
The frame is used to identify the module and document.
@param bIncludeShortcut
Whether the shortcut should be appended in brackets
@return
The returned label contains the keyboard accelerator, if
one is defined and bIncludeShortcut is true.
*/
OUString
GetTooltipForCommand
(
const
OUString
&
rsCommandName
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
,
bool
bIncludeShortcut
=
true
);
/** Returns the shortcut for a command in human-readable form */
OUString
GetCommandShortcut
(
const
OUString
&
rCommandName
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
);
/** Do not call. Should be part of a local and hidden interface.
*/
void
SetFrame
(
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
);
...
...
@@ -68,7 +87,7 @@ public:
css
::
uno
::
Reference
<
css
::
ui
::
XAcceleratorConfiguration
>
mxCachedDocumentAcceleratorConfiguration
;
css
::
uno
::
Reference
<
css
::
ui
::
XAcceleratorConfiguration
>
mxCachedModuleAcceleratorConfiguration
;
css
::
uno
::
Reference
<
css
::
ui
::
XAcceleratorConfiguration
>
mxCachedGlobalAcceleratorConfiguration
;
::
rtl
::
OUString
msCachedModuleIdentifier
;
OUString
msCachedModuleIdentifier
;
css
::
uno
::
Reference
<
css
::
lang
::
XComponent
>
mxFrameListener
;
CommandInfoProvider
();
...
...
@@ -77,18 +96,17 @@ public:
css
::
uno
::
Reference
<
css
::
ui
::
XAcceleratorConfiguration
>
GetDocumentAcceleratorConfiguration
();
css
::
uno
::
Reference
<
css
::
ui
::
XAcceleratorConfiguration
>
GetModuleAcceleratorConfiguration
();
css
::
uno
::
Reference
<
css
::
ui
::
XAcceleratorConfiguration
>
GetGlobalAcceleratorConfiguration
();
::
rtl
::
OUString
GetModuleIdentifier
();
::
rtl
::
OUString
GetCommandShortcut
(
const
::
rtl
::
OUString
&
rCommandName
);
OUString
GetModuleIdentifier
();
css
::
uno
::
Sequence
<
css
::
beans
::
PropertyValue
>
GetCommandProperties
(
const
::
rtl
::
OUString
&
rsCommandName
);
::
rtl
::
OUString
GetCommandLabel
(
const
::
rtl
::
OUString
&
rsCommandName
);
static
rtl
::
OUString
RetrieveShortcutsFromConfiguration
(
const
OUString
&
rsCommandName
);
OUString
GetCommandProperty
(
const
OUString
&
rsProperty
,
const
OUString
&
rsCommandName
);
static
OUString
RetrieveShortcutsFromConfiguration
(
const
css
::
uno
::
Reference
<
css
::
ui
::
XAcceleratorConfiguration
>&
rxConfiguration
,
const
rtl
::
OUString
&
rsCommandName
);
const
OUString
&
rsCommandName
);
};
}
}
// end of namespace sfx2/framework
}
// end of namespace svt
#endif
#endif
// INCLUDED_COMPHELPER_COMMANDINFOPROVIDER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sfx2/Library_sfx.mk
Dosyayı görüntüle @
099f1016
...
...
@@ -257,7 +257,6 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/sidebar/Accessible \
sfx2/source/sidebar/AccessibleTitleBar \
sfx2/source/sidebar/AsynchronousCall \
sfx2/source/sidebar/CommandInfoProvider \
sfx2/source/sidebar/Context \
sfx2/source/sidebar/ContextChangeBroadcaster \
sfx2/source/sidebar/ContextList \
...
...
sfx2/source/sidebar/ControllerFactory.cxx
Dosyayı görüntüle @
099f1016
...
...
@@ -18,7 +18,6 @@
*/
#include <sfx2/sidebar/ControllerFactory.hxx>
#include <sfx2/sidebar/CommandInfoProvider.hxx>
#include <sfx2/sidebar/Tools.hxx>
#include <com/sun/star/frame/XToolbarController.hpp>
...
...
@@ -28,6 +27,7 @@
#include <framework/sfxhelperfunctions.hxx>
#include <svtools/generictoolboxcontroller.hxx>
#include <svtools/commandinfoprovider.hxx>
#include <comphelper/processfactory.hxx>
#include <toolkit/helper/vclunohelper.hxx>
...
...
@@ -120,13 +120,13 @@ Reference<frame::XToolbarController> ControllerFactory::CreateToolBoxController(
if
(
xUpdatable
.
is
())
xUpdatable
->
update
();
// Add
label
.
// Add
tooltip
.
if
(
xController
.
is
())
{
const
OUString
s
Label
(
sfx2
::
sidebar
::
CommandInfoProvider
::
Instance
().
GetLabel
ForCommand
(
const
OUString
s
Tooltip
(
svt
::
CommandInfoProvider
::
Instance
().
GetTooltip
ForCommand
(
rsCommandName
,
rxFrame
));
pToolBox
->
SetQuickHelpText
(
nItemId
,
s
Label
);
pToolBox
->
SetQuickHelpText
(
nItemId
,
s
Tooltip
);
pToolBox
->
EnableItem
(
nItemId
);
}
}
...
...
sfx2/source/sidebar/ControllerItem.cxx
Dosyayı görüntüle @
099f1016
...
...
@@ -23,7 +23,7 @@
#include <sfx2/imagemgr.hxx>
#include <sfx2/bindings.hxx>
#include <unotools/cmdoptions.hxx>
#include <s
fx2/sidebar/CommandInfoP
rovider.hxx>
#include <s
vtools/commandinfop
rovider.hxx>
#include <vcl/svapp.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/help.hxx>
...
...
@@ -179,13 +179,6 @@ void ControllerItem::ResetFrame()
mxFrame
=
nullptr
;
}
::
rtl
::
OUString
ControllerItem
::
GetLabel
()
const
{
return
CommandInfoProvider
::
Instance
().
GetLabelForCommand
(
".uno:"
+
msCommandName
,
mxFrame
);
}
::
rtl
::
OUString
ControllerItem
::
GetHelpText
()
const
{
Help
*
pHelp
=
Application
::
GetHelp
();
...
...
@@ -211,7 +204,7 @@ ControllerItem::ItemUpdateReceiverInterface::~ItemUpdateReceiverInterface()
void
ControllerItem
::
SetupToolBoxItem
(
ToolBox
&
rToolBox
,
const
sal_uInt16
nIndex
)
{
rToolBox
.
SetQuickHelpText
(
nIndex
,
GetLabel
(
));
rToolBox
.
SetQuickHelpText
(
nIndex
,
svt
::
CommandInfoProvider
::
Instance
().
GetTooltipForCommand
(
".uno:"
+
msCommandName
,
mxFrame
));
rToolBox
.
SetHelpText
(
nIndex
,
GetHelpText
());
rToolBox
.
SetItemImage
(
nIndex
,
GetIcon
());
}
...
...
svtools/Library_svt.mk
Dosyayı görüntüle @
099f1016
...
...
@@ -172,6 +172,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/misc/acceleratorexecute \
svtools/source/misc/bindablecontrolhelper \
svtools/source/misc/cliplistener \
svtools/source/misc/commandinfoprovider \
svtools/source/misc/dialogclosedlistener \
svtools/source/misc/dialogcontrolling \
svtools/source/misc/ehdl \
...
...
s
fx2/source/sidebar/CommandInfoP
rovider.cxx
→
s
vtools/source/misc/commandinfop
rovider.cxx
Dosyayı görüntüle @
099f1016
...
...
@@ -17,10 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sfx2/sidebar/CommandInfoProvider.hxx>
#include <comphelper/processfactory.hxx>
#include <svtools/commandinfoprovider.hxx>
#include <svtools/acceleratorexecute.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/basemutex.hxx>
...
...
@@ -32,7 +31,6 @@
using
namespace
css
;
using
namespace
css
::
uno
;
using
::
rtl
::
OUString
;
namespace
...
...
@@ -45,7 +43,7 @@ namespace
public
FrameListenerInterfaceBase
{
public
:
FrameListener
(
s
fx2
::
sidebar
::
CommandInfoProvider
&
rInfoProvider
,
const
Reference
<
frame
::
XFrame
>&
rxFrame
)
FrameListener
(
s
vt
::
CommandInfoProvider
&
rInfoProvider
,
const
Reference
<
frame
::
XFrame
>&
rxFrame
)
:
FrameListenerInterfaceBase
(
m_aMutex
),
mrInfoProvider
(
rInfoProvider
),
mxFrame
(
rxFrame
)
...
...
@@ -70,12 +68,12 @@ namespace
}
private
:
s
fx2
::
sidebar
::
CommandInfoProvider
&
mrInfoProvider
;
s
vt
::
CommandInfoProvider
&
mrInfoProvider
;
Reference
<
frame
::
XFrame
>
mxFrame
;
};
}
namespace
s
fx2
{
namespace
sidebar
{
namespace
s
vt
{
CommandInfoProvider
&
CommandInfoProvider
::
Instance
()
{
...
...
@@ -110,12 +108,48 @@ OUString CommandInfoProvider::GetLabelForCommand (
{
SetFrame
(
rxFrame
);
const
OUString
sLabel
(
GetCommandLabel
(
rsCommandName
));
const
OUString
sShortCut
(
GetCommandShortcut
(
rsCommandName
));
if
(
sShortCut
.
getLength
()
>
0
)
return
sLabel
+
" ("
+
sShortCut
+
")"
;
else
return
sLabel
;
return
GetCommandProperty
(
"Name"
,
rsCommandName
);
}
OUString
CommandInfoProvider
::
GetTooltipForCommand
(
const
OUString
&
rsCommandName
,
const
Reference
<
frame
::
XFrame
>&
rxFrame
,
bool
bIncludeShortcut
)
{
SetFrame
(
rxFrame
);
OUString
sLabel
(
GetCommandProperty
(
"TooltipLabel"
,
rsCommandName
));
if
(
sLabel
.
isEmpty
())
sLabel
=
GetLabelForCommand
(
rsCommandName
,
rxFrame
);
if
(
bIncludeShortcut
)
{
const
OUString
sShortCut
(
GetCommandShortcut
(
rsCommandName
,
rxFrame
));
if
(
!
sShortCut
.
isEmpty
())
return
sLabel
+
" ("
+
sShortCut
+
")"
;
}
return
sLabel
;
}
OUString
CommandInfoProvider
::
GetCommandShortcut
(
const
OUString
&
rsCommandName
,
const
Reference
<
frame
::
XFrame
>&
rxFrame
)
{
SetFrame
(
rxFrame
);
OUString
sShortcut
;
sShortcut
=
RetrieveShortcutsFromConfiguration
(
GetDocumentAcceleratorConfiguration
(),
rsCommandName
);
if
(
sShortcut
.
getLength
()
>
0
)
return
sShortcut
;
sShortcut
=
RetrieveShortcutsFromConfiguration
(
GetModuleAcceleratorConfiguration
(),
rsCommandName
);
if
(
sShortcut
.
getLength
()
>
0
)
return
sShortcut
;
sShortcut
=
RetrieveShortcutsFromConfiguration
(
GetGlobalAcceleratorConfiguration
(),
rsCommandName
);
if
(
sShortcut
.
getLength
()
>
0
)
return
sShortcut
;
return
OUString
();
}
void
CommandInfoProvider
::
SetFrame
(
const
Reference
<
frame
::
XFrame
>&
rxFrame
)
...
...
@@ -214,25 +248,6 @@ OUString CommandInfoProvider::GetModuleIdentifier()
return
msCachedModuleIdentifier
;
}
OUString
CommandInfoProvider
::
GetCommandShortcut
(
const
OUString
&
rsCommandName
)
{
OUString
sShortcut
;
sShortcut
=
RetrieveShortcutsFromConfiguration
(
GetDocumentAcceleratorConfiguration
(),
rsCommandName
);
if
(
sShortcut
.
getLength
()
>
0
)
return
sShortcut
;
sShortcut
=
RetrieveShortcutsFromConfiguration
(
GetModuleAcceleratorConfiguration
(),
rsCommandName
);
if
(
sShortcut
.
getLength
()
>
0
)
return
sShortcut
;
sShortcut
=
RetrieveShortcutsFromConfiguration
(
GetGlobalAcceleratorConfiguration
(),
rsCommandName
);
if
(
sShortcut
.
getLength
()
>
0
)
return
sShortcut
;
return
OUString
();
}
OUString
CommandInfoProvider
::
RetrieveShortcutsFromConfiguration
(
const
Reference
<
ui
::
XAcceleratorConfiguration
>&
rxConfiguration
,
const
OUString
&
rsCommandName
)
...
...
@@ -260,7 +275,7 @@ OUString CommandInfoProvider::RetrieveShortcutsFromConfiguration(
return
OUString
();
}
Sequence
<
beans
::
PropertyValue
>
CommandInfoProvider
::
GetCommandProperties
(
const
OUString
&
rsCommandName
)
Sequence
<
beans
::
PropertyValue
>
CommandInfoProvider
::
GetCommandProperties
(
const
OUString
&
rsCommandName
)
{
Sequence
<
beans
::
PropertyValue
>
aProperties
;
...
...
@@ -282,12 +297,12 @@ Sequence<beans::PropertyValue> CommandInfoProvider::GetCommandProperties (const
return
aProperties
;
}
OUString
CommandInfoProvider
::
GetCommand
Label
(
const
OUString
&
rsCommandName
)
OUString
CommandInfoProvider
::
GetCommand
Property
(
const
OUString
&
rsProperty
,
const
OUString
&
rsCommandName
)
{
const
Sequence
<
beans
::
PropertyValue
>
aProperties
(
GetCommandProperties
(
rsCommandName
));
for
(
sal_Int32
nIndex
=
0
;
nIndex
<
aProperties
.
getLength
();
++
nIndex
)
{
if
(
aProperties
[
nIndex
].
Name
==
"Name"
)
if
(
aProperties
[
nIndex
].
Name
==
rsProperty
)
{
OUString
sLabel
;
aProperties
[
nIndex
].
Value
>>=
sLabel
;
...
...
@@ -297,6 +312,6 @@ OUString CommandInfoProvider::GetCommandLabel (const OUString& rsCommandName)
return
OUString
();
}
}
}
// end of namespace sfx2/framework
}
// end of namespace svt
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
svx/source/sidebar/insert/InsertPropertyPanel.cxx
Dosyayı görüntüle @
099f1016
...
...
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "InsertPropertyPanel.hxx"
#include "sfx2/sidebar/CommandInfoProvider.hxx"
#include <sfx2/sidebar/Theme.hxx>
#include <sfx2/sidebar/Tools.hxx>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment