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
81ff7cfd
Kaydet (Commit)
81ff7cfd
authored
Kas 17, 2015
tarafından
Samuel Mehrbrodt
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tdf#95845 Add methods for menu labels to CommandInfoProvider
Change-Id: Ibf6a26940ec194f540255584776f8ebcefbb94ae
üst
2e88fbd7
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
39 additions
and
99 deletions
+39
-99
mischelper.hxx
framework/inc/helper/mischelper.hxx
+0
-8
statusbarmanager.hxx
framework/inc/uielement/statusbarmanager.hxx
+0
-1
mischelper.cxx
framework/source/fwi/helper/mischelper.cxx
+0
-71
macrosmenucontroller.cxx
framework/source/uielement/macrosmenucontroller.cxx
+2
-7
menubarmanager.cxx
framework/source/uielement/menubarmanager.cxx
+3
-4
statusbarmanager.cxx
framework/source/uielement/statusbarmanager.cxx
+2
-6
commandinfoprovider.hxx
include/vcl/commandinfoprovider.hxx
+8
-0
commandinfoprovider.cxx
vcl/source/helper/commandinfoprovider.cxx
+24
-2
No files found.
framework/inc/helper/mischelper.hxx
Dosyayı görüntüle @
81ff7cfd
...
...
@@ -121,14 +121,6 @@ public:
css
::
uno
::
Reference
<
css
::
linguistic2
::
XLanguageGuessing
>
GetGuesser
()
const
;
};
FWI_DLLPUBLIC
OUString
RetrieveLabelFromCommand
(
const
OUString
&
aCmdURL
,
const
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>&
_xContext
,
css
::
uno
::
Reference
<
css
::
container
::
XNameAccess
>&
_xUICommandLabels
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
_xFrame
,
OUString
&
_rModuleIdentifier
,
bool
&
_rIni
,
const
sal_Char
*
_pName
);
FWI_DLLPUBLIC
void
FillLangItems
(
std
::
set
<
OUString
>
&
rLangItems
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
&
rxFrame
,
const
LanguageGuessingHelper
&
rLangGuessHelper
,
...
...
framework/inc/uielement/statusbarmanager.hxx
Dosyayı görüntüle @
81ff7cfd
...
...
@@ -89,7 +89,6 @@ class StatusBarManager : public ::cppu::WeakImplHelper<
DECL_LINK_TYPED
(
DoubleClick
,
StatusBar
*
,
void
);
void
RemoveControllers
();
OUString
RetrieveLabelFromCommand
(
const
OUString
&
aCmdURL
);
void
CreateControllers
();
void
UpdateControllers
();
void
AddFrameActionListener
();
...
...
framework/source/fwi/helper/mischelper.cxx
Dosyayı görüntüle @
81ff7cfd
...
...
@@ -59,77 +59,6 @@ uno::Reference< linguistic2::XLanguageGuessing > LanguageGuessingHelper::GetGues
return
m_xLanguageGuesser
;
}
OUString
RetrieveLabelFromCommand
(
const
OUString
&
aCmdURL
,
const
uno
::
Reference
<
uno
::
XComponentContext
>&
_xContext
,
uno
::
Reference
<
container
::
XNameAccess
>&
_xUICommandLabels
,
const
uno
::
Reference
<
frame
::
XFrame
>&
_xFrame
,
OUString
&
_rModuleIdentifier
,
bool
&
_rIni
,
const
sal_Char
*
_pName
)
{
OUString
aLabel
;
// Retrieve popup menu labels
if
(
!
_xUICommandLabels
.
is
()
)
{
try
{
if
(
!
_rIni
)
{
_rIni
=
true
;
Reference
<
XModuleManager2
>
xModuleManager
=
ModuleManager
::
create
(
_xContext
);
try
{
_rModuleIdentifier
=
xModuleManager
->
identify
(
_xFrame
);
}
catch
(
const
Exception
&
)
{
}
}
Reference
<
XNameAccess
>
xNameAccess
=
frame
::
theUICommandDescription
::
get
(
_xContext
);
xNameAccess
->
getByName
(
_rModuleIdentifier
)
>>=
_xUICommandLabels
;
}
catch
(
const
Exception
&
)
{
}
}
if
(
_xUICommandLabels
.
is
()
)
{
try
{
if
(
!
aCmdURL
.
isEmpty
()
)
{
OUString
aStr
;
Sequence
<
PropertyValue
>
aPropSeq
;
if
(
_xUICommandLabels
->
hasByName
(
aCmdURL
)
)
{
if
(
_xUICommandLabels
->
getByName
(
aCmdURL
)
>>=
aPropSeq
)
{
for
(
sal_Int32
i
=
0
;
i
<
aPropSeq
.
getLength
();
i
++
)
{
if
(
aPropSeq
[
i
].
Name
.
equalsAscii
(
_pName
/*"Label"*/
))
{
aPropSeq
[
i
].
Value
>>=
aStr
;
break
;
}
}
}
}
aLabel
=
aStr
;
}
}
catch
(
const
css
::
uno
::
Exception
&
)
{
}
}
return
aLabel
;
}
void
FillLangItems
(
std
::
set
<
OUString
>
&
rLangItems
,
const
uno
::
Reference
<
frame
::
XFrame
>
&
rxFrame
,
const
LanguageGuessingHelper
&
rLangGuessHelper
,
...
...
framework/source/uielement/macrosmenucontroller.cxx
Dosyayı görüntüle @
81ff7cfd
...
...
@@ -32,6 +32,7 @@
#include <comphelper/processfactory.hxx>
#include <vcl/svapp.hxx>
#include <vcl/i18nhelp.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <rtl/ustrbuf.hxx>
#include "helper/mischelper.hxx"
#include "helpid.hrc"
...
...
@@ -85,7 +86,7 @@ void MacrosMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPo
// insert basic
OUString
aCommand
(
".uno:MacroDialog"
);
OUString
aDisplayName
=
RetrieveLabelFromCommand
(
aCommand
);
OUString
aDisplayName
=
vcl
::
CommandInfoProvider
::
Instance
().
GetMenuLabelForCommand
(
aCommand
,
m_xFrame
);
pPopupMenu
->
InsertItem
(
2
,
aDisplayName
);
pPopupMenu
->
SetItemCommand
(
2
,
aCommand
);
...
...
@@ -122,12 +123,6 @@ void SAL_CALL MacrosMenuController::statusChanged( const FeatureStateEvent& ) th
}
}
OUString
MacrosMenuController
::
RetrieveLabelFromCommand
(
const
OUString
&
rCmdURL
)
{
bool
bModuleIdentified
=
!
m_aModuleIdentifier
.
isEmpty
();
return
framework
::
RetrieveLabelFromCommand
(
rCmdURL
,
m_xContext
,
m_xUICommandLabels
,
m_xFrame
,
m_aModuleIdentifier
,
bModuleIdentified
,
"Label"
);
}
void
MacrosMenuController
::
addScriptItems
(
PopupMenu
*
pPopupMenu
,
sal_uInt16
startItemId
)
{
const
OUString
aCmdBase
(
".uno:ScriptOrganizer?ScriptOrganizer.Language:string="
);
...
...
framework/source/uielement/menubarmanager.cxx
Dosyayı görüntüle @
81ff7cfd
...
...
@@ -69,6 +69,7 @@
#include <vcl/window.hxx>
#include <vcl/menu.hxx>
#include <vcl/settings.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <osl/mutex.hxx>
#include <osl/file.hxx>
#include <cppuhelper/implbase.hxx>
...
...
@@ -1099,11 +1100,9 @@ OUString MenuBarManager::RetrieveLabelFromCommand(const OUString& rCmdURL)
if
(
!
m_bHasMenuBar
)
{
// This is a context menu, prefer "PopupLabel" over "Label".
OUString
aPopupLabel
=
framework
::
RetrieveLabelFromCommand
(
rCmdURL
,
m_xContext
,
m_xUICommandLabels
,
m_xFrame
,
m_aModuleIdentifier
,
m_bModuleIdentified
,
"PopupLabel"
);
if
(
!
aPopupLabel
.
isEmpty
()
)
return
aPopupLabel
;
return
vcl
::
CommandInfoProvider
::
Instance
().
GetPopupLabelForCommand
(
rCmdURL
,
m_xFrame
);
}
return
framework
::
RetrieveLabelFromCommand
(
rCmdURL
,
m_xContext
,
m_xUICommandLabels
,
m_xFrame
,
m_aModuleIdentifier
,
m_bModuleIdentified
,
"Label"
);
return
vcl
::
CommandInfoProvider
::
Instance
().
GetMenuLabelForCommand
(
rCmdURL
,
m_xFrame
);
}
bool
MenuBarManager
::
CreatePopupMenuController
(
MenuItemHandler
*
pMenuItemHandler
)
...
...
framework/source/uielement/statusbarmanager.cxx
Dosyayı görüntüle @
81ff7cfd
...
...
@@ -48,6 +48,7 @@
#include <vcl/status.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <functional>
...
...
@@ -300,11 +301,6 @@ void StatusBarManager::RemoveControllers()
m_aControllerMap
.
clear
();
}
OUString
StatusBarManager
::
RetrieveLabelFromCommand
(
const
OUString
&
aCmdURL
)
{
return
framework
::
RetrieveLabelFromCommand
(
aCmdURL
,
m_xContext
,
m_xUICommandLabels
,
m_xFrame
,
m_aModuleIdentifier
,
m_bModuleIdentified
,
"Name"
);
}
void
StatusBarManager
::
CreateControllers
()
{
uno
::
Reference
<
awt
::
XWindow
>
xStatusbarWindow
=
VCLUnoHelper
::
GetInterface
(
m_pStatusBar
);
...
...
@@ -475,7 +471,7 @@ void StatusBarManager::FillStatusBar( const uno::Reference< container::XIndexAcc
if
((
nType
==
css
::
ui
::
ItemType
::
DEFAULT
)
&&
!
aCommandURL
.
isEmpty
()
)
{
OUString
aString
(
RetrieveLabelFromCommand
(
aCommandURL
));
OUString
aString
(
vcl
::
CommandInfoProvider
::
Instance
().
GetLabelForCommand
(
aCommandURL
,
m_xFrame
));
sal_uInt16
nItemBits
(
impl_convertItemStyleToItemBits
(
nStyle
));
m_pStatusBar
->
InsertItem
(
nId
,
nWidth
,
nItemBits
,
nOffset
);
...
...
include/vcl/commandinfoprovider.hxx
Dosyayı görüntüle @
81ff7cfd
...
...
@@ -59,6 +59,14 @@ public:
const
OUString
&
rsCommandName
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
);
OUString
GetMenuLabelForCommand
(
const
OUString
&
rsCommandName
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
);
OUString
GetPopupLabelForCommand
(
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:
...
...
vcl/source/helper/commandinfoprovider.cxx
Dosyayı görüntüle @
81ff7cfd
...
...
@@ -103,7 +103,6 @@ CommandInfoProvider::~CommandInfoProvider()
}
}
OUString
CommandInfoProvider
::
GetLabelForCommand
(
const
OUString
&
rsCommandName
,
const
Reference
<
frame
::
XFrame
>&
rxFrame
)
...
...
@@ -113,6 +112,29 @@ OUString CommandInfoProvider::GetLabelForCommand (
return
GetCommandProperty
(
"Name"
,
rsCommandName
);
}
OUString
CommandInfoProvider
::
GetMenuLabelForCommand
(
const
OUString
&
rsCommandName
,
const
Reference
<
frame
::
XFrame
>&
rxFrame
)
{
SetFrame
(
rxFrame
);
// Here we want to use "Label", not "Name". "Name" is a stripped-down version of "Label" without accelerators
// and ellipsis. In the menu, we want to have those accelerators and ellipsis.
return
GetCommandProperty
(
"Label"
,
rsCommandName
);
}
OUString
CommandInfoProvider
::
GetPopupLabelForCommand
(
const
OUString
&
rsCommandName
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
)
{
SetFrame
(
rxFrame
);
OUString
sPopupLabel
(
GetCommandProperty
(
"PopupLabel"
,
rsCommandName
));
if
(
!
sPopupLabel
.
isEmpty
())
return
sPopupLabel
;
return
GetCommandProperty
(
"Label"
,
rsCommandName
);
}
OUString
CommandInfoProvider
::
GetTooltipForCommand
(
const
OUString
&
rsCommandName
,
const
Reference
<
frame
::
XFrame
>&
rxFrame
,
...
...
@@ -122,7 +144,7 @@ OUString CommandInfoProvider::GetTooltipForCommand (
OUString
sLabel
(
GetCommandProperty
(
"TooltipLabel"
,
rsCommandName
));
if
(
sLabel
.
isEmpty
())
sLabel
=
Get
LabelForCommand
(
rsCommandName
,
rxFr
ame
);
sLabel
=
Get
CommandProperty
(
"Name"
,
rsCommandN
ame
);
if
(
bIncludeShortcut
)
{
const
OUString
sShortCut
(
GetCommandShortcut
(
rsCommandName
,
rxFrame
));
...
...
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