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
29dd77c7
Kaydet (Commit)
29dd77c7
authored
May 17, 2017
tarafından
Maxim Monastirsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use CommandInfoProvider::GetModuleIdentifier
Change-Id: I09f23360259e794ab2a0d8ad6d8bf6fc18d08597
üst
7d2ca8f2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
37 deletions
+14
-37
addonmenu.cxx
framework/source/fwe/classes/addonmenu.cxx
+8
-28
menubarmanager.cxx
framework/source/uielement/menubarmanager.cxx
+3
-3
addonmenu.hxx
include/framework/addonmenu.hxx
+3
-6
No files found.
framework/source/fwe/classes/addonmenu.cxx
Dosyayı görüntüle @
29dd77c7
...
...
@@ -26,10 +26,9 @@
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/util/URL.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/frame/XModuleManager.hpp>
#include <tools/config.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <vcl/svapp.hxx>
#include <svtools/menuoptions.hxx>
#include <svl/solar.hrc>
...
...
@@ -46,31 +45,13 @@ const sal_uInt16 SID_HELPMENU = (SID_SFX_START + 410);
namespace
framework
{
static
OUString
GetModuleIdentifier
(
const
Reference
<
XComponentContext
>&
rContext
,
const
Reference
<
XFrame
>&
rFrame
)
{
Reference
<
XModuleManager
>
xModuleManager
(
ModuleManager
::
create
(
rContext
));
if
(
xModuleManager
.
is
()
)
{
try
{
return
xModuleManager
->
identify
(
rFrame
);
}
catch
(
Exception
&
)
{
}
}
return
OUString
();
}
bool
AddonMenuManager
::
HasAddonMenuElements
()
{
return
AddonsOptions
().
HasAddonsMenu
();
}
// Create the Add-Ons menu
VclPtr
<
PopupMenu
>
AddonMenuManager
::
CreateAddonMenu
(
const
Reference
<
XFrame
>&
rFrame
,
const
Reference
<
XComponentContext
>&
rContext
)
VclPtr
<
PopupMenu
>
AddonMenuManager
::
CreateAddonMenu
(
const
Reference
<
XFrame
>&
rFrame
)
{
AddonsOptions
aOptions
;
VclPtr
<
PopupMenu
>
pAddonMenu
;
...
...
@@ -80,7 +61,7 @@ VclPtr<PopupMenu> AddonMenuManager::CreateAddonMenu( const Reference< XFrame >&
if
(
rAddonMenuEntries
.
getLength
()
>
0
)
{
pAddonMenu
=
VclPtr
<
PopupMenu
>::
Create
();
::
rtl
::
OUString
aModuleIdentifier
=
GetModuleIdentifier
(
rContext
,
rFrame
);
::
rtl
::
OUString
aModuleIdentifier
=
vcl
::
CommandInfoProvider
::
GetModuleIdentifier
(
rFrame
);
AddonMenuManager
::
BuildMenu
(
pAddonMenu
,
MENU_APPEND
,
nUniqueMenuId
,
rAddonMenuEntries
,
rFrame
,
aModuleIdentifier
);
// Don't return an empty Add-On menu
...
...
@@ -116,8 +97,7 @@ static sal_uInt16 FindMenuId( Menu* pMenu, const OUString& aCommand )
// Merge the Add-Ons help menu items into the given menu bar at a defined pos
void
AddonMenuManager
::
MergeAddonHelpMenu
(
const
Reference
<
XFrame
>&
rFrame
,
MenuBar
*
pMergeMenuBar
,
const
Reference
<
XComponentContext
>&
rContext
)
MenuBar
*
pMergeMenuBar
)
{
if
(
pMergeMenuBar
)
{
...
...
@@ -146,7 +126,7 @@ void AddonMenuManager::MergeAddonHelpMenu( const Reference< XFrame >& rFrame,
if
(
nInsPos
<
nItemCount
&&
pHelpMenu
->
GetItemType
(
nInsPos
)
!=
MenuItemType
::
SEPARATOR
)
nInsSepAfterPos
=
nInsPos
;
::
rtl
::
OUString
aModuleIdentifier
=
GetModuleIdentifier
(
rContext
,
rFrame
);
::
rtl
::
OUString
aModuleIdentifier
=
vcl
::
CommandInfoProvider
::
GetModuleIdentifier
(
rFrame
);
AddonMenuManager
::
BuildMenu
(
pHelpMenu
,
nInsPos
,
nUniqueMenuId
,
rAddonHelpMenuEntries
,
rFrame
,
aModuleIdentifier
);
if
(
pHelpMenu
->
GetItemCount
()
>
nItemCount
)
...
...
@@ -166,8 +146,7 @@ void AddonMenuManager::MergeAddonHelpMenu( const Reference< XFrame >& rFrame,
// Merge the addon popup menus into the given menu bar at the provided pos.
void
AddonMenuManager
::
MergeAddonPopupMenus
(
const
Reference
<
XFrame
>&
rFrame
,
sal_uInt16
nMergeAtPos
,
MenuBar
*
pMergeMenuBar
,
const
Reference
<
XComponentContext
>&
rContext
)
MenuBar
*
pMergeMenuBar
)
{
if
(
pMergeMenuBar
)
{
...
...
@@ -181,7 +160,8 @@ void AddonMenuManager::MergeAddonPopupMenus( const Reference< XFrame >& rFrame,
OUString
aContext
;
Sequence
<
Sequence
<
PropertyValue
>
>
aAddonSubMenu
;
sal_uInt16
nUniqueMenuId
=
ADDONMENU_ITEMID_START
;
OUString
aModuleIdentifier
=
GetModuleIdentifier
(
rContext
,
rFrame
);
OUString
aModuleIdentifier
=
vcl
::
CommandInfoProvider
::
GetModuleIdentifier
(
rFrame
);
const
Sequence
<
Sequence
<
PropertyValue
>
>&
rAddonMenuEntries
=
aAddonsOptions
.
GetAddonsMenuBarPart
();
for
(
sal_Int32
i
=
0
;
i
<
rAddonMenuEntries
.
getLength
();
i
++
)
...
...
framework/source/uielement/menubarmanager.cxx
Dosyayı görüntüle @
29dd77c7
...
...
@@ -1120,13 +1120,13 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
nItemId
==
SID_HELPMENU
||
aCommand
==
aCmdHelpMenu
)
{
// Retrieve addon popup menus and add them to our menu bar
framework
::
AddonMenuManager
::
MergeAddonPopupMenus
(
rFrame
,
nPos
,
static_cast
<
MenuBar
*>
(
pMenu
)
,
m_xContext
);
framework
::
AddonMenuManager
::
MergeAddonPopupMenus
(
rFrame
,
nPos
,
static_cast
<
MenuBar
*>
(
pMenu
)
);
break
;
}
}
// Merge the Add-Ons help menu items into the Office help menu
framework
::
AddonMenuManager
::
MergeAddonHelpMenu
(
rFrame
,
static_cast
<
MenuBar
*>
(
pMenu
)
,
m_xContext
);
framework
::
AddonMenuManager
::
MergeAddonHelpMenu
(
rFrame
,
static_cast
<
MenuBar
*>
(
pMenu
)
);
}
bool
bAccessibilityEnabled
(
Application
::
GetSettings
().
GetMiscSettings
().
GetEnableATToolSupport
()
);
...
...
@@ -1225,7 +1225,7 @@ void MenuBarManager::FillMenuManager( Menu* pMenu, const Reference< XFrame >& rF
AddonMenuManager
::
HasAddonMenuElements
()
)
{
// Create addon popup menu if there exist elements and this is the tools popup menu
VclPtr
<
PopupMenu
>
pSubMenu
=
AddonMenuManager
::
CreateAddonMenu
(
rFrame
,
m_xContext
);
VclPtr
<
PopupMenu
>
pSubMenu
=
AddonMenuManager
::
CreateAddonMenu
(
rFrame
);
if
(
pSubMenu
&&
(
pSubMenu
->
GetItemCount
()
>
0
))
{
sal_uInt16
nCount
=
0
;
...
...
include/framework/addonmenu.hxx
Dosyayı görüntüle @
29dd77c7
...
...
@@ -43,19 +43,16 @@ class FWE_DLLPUBLIC AddonMenuManager
static
bool
IsCorrectContext
(
const
OUString
&
rModuleIdentifier
,
const
OUString
&
rContext
);
// Create the Add-Ons menu
static
VclPtr
<
PopupMenu
>
CreateAddonMenu
(
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rFrame
,
const
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>&
rContext
);
static
VclPtr
<
PopupMenu
>
CreateAddonMenu
(
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rFrame
);
// Merge the Add-Ons help menu items into the given menu bar at a defined pos
static
void
MergeAddonHelpMenu
(
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rFrame
,
MenuBar
*
pMergeMenuBar
,
const
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>&
rContext
);
MenuBar
*
pMergeMenuBar
);
// Merge the addon popup menus into the given menu bar at the provided pos.
static
void
MergeAddonPopupMenus
(
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rFrame
,
sal_uInt16
nMergeAtPos
,
MenuBar
*
pMergeMenuBar
,
const
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>&
rContext
);
MenuBar
*
pMergeMenuBar
);
// Returns the next position to insert a menu item/sub menu
static
sal_uInt16
GetNextPos
(
sal_uInt16
nPos
);
...
...
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