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
376e6c3d
Kaydet (Commit)
376e6c3d
authored
Eki 22, 2012
tarafından
Antonio Fernandez
Kaydeden (comit)
Bjoern Michaelsen
Kas 14, 2012
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Some code refactoring.
Change-Id: I47d9be121898ca66f73488be4b46cc16cc4013a9
üst
23395948
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
23 deletions
+23
-23
gtksalmenu.hxx
vcl/inc/unx/gtk/gtksalmenu.hxx
+3
-2
gtkframe.cxx
vcl/unx/gtk/window/gtkframe.cxx
+1
-1
gtksalmenu.cxx
vcl/unx/gtk/window/gtksalmenu.cxx
+19
-20
No files found.
vcl/inc/unx/gtk/gtksalmenu.hxx
Dosyayı görüntüle @
376e6c3d
...
...
@@ -40,7 +40,7 @@ class GtkSalMenuItem;
// Generate the complete structure of a menu.
static
void
GenerateFullMenu
(
GtkSalMenu
*
pSalMenu
);
//
static void GenerateFullMenu( GtkSalMenu* pSalMenu );
class
GtkSalMenu
:
public
SalMenu
...
...
@@ -110,7 +110,8 @@ public:
void
Deactivate
(
const
gchar
*
aMenuCommand
);
void
Display
(
sal_Bool
bVisible
);
bool
PrepUpdate
();
// void UpdateNativeMenu();
void
Update
();
// Update this menu only.
void
UpdateFull
();
// Update full menu hierarchy from this menu.
};
class
GtkSalMenuItem
:
public
SalMenuItem
...
...
vcl/unx/gtk/window/gtkframe.cxx
Dosyayı görüntüle @
376e6c3d
...
...
@@ -572,7 +572,7 @@ void on_registrar_available( GDBusConnection * /*connection*/,
{
GtkSalMenu
*
pGtkSalMenu
=
static_cast
<
GtkSalMenu
*>
(
pSalMenu
);
pGtkSalMenu
->
Display
(
sal_True
);
pGtkSalMenu
->
Update
NativeMenu
();
pGtkSalMenu
->
Update
Full
();
}
}
...
...
vcl/unx/gtk/window/gtksalmenu.cxx
Dosyayı görüntüle @
376e6c3d
...
...
@@ -241,7 +241,7 @@ void RemoveUnusedCommands( GLOActionGroup* pActionGroup, GList* pOldCommandList,
}
}
void
GtkSalMenu
::
Update
NativeMenu
()
void
GtkSalMenu
::
Update
()
{
SolarMutexGuard
aGuard
;
//GTK_YIELD_GRAB();
...
...
@@ -376,17 +376,17 @@ void GtkSalMenu::UpdateNativeMenu()
RemoveUnusedCommands
(
pActionGroup
,
pOldCommandList
,
pNewCommandList
);
}
static
void
GenerateFullMenu
(
GtkSalMenu
*
pSalMenu
)
void
GtkSalMenu
::
UpdateFull
(
)
{
SolarMutexGuard
aGuard
;
//GTK_YIELD_GRAB();
if
(
!
pSalMenu
||
!
pSalMenu
->
PrepUpdate
()
)
if
(
!
PrepUpdate
()
)
return
;
Menu
*
pVCLMenu
=
pSalMenu
->
GetMenu
()
;
GLOMenu
*
pLOMenu
=
G_LO_MENU
(
pSalMenu
->
GetMenuModel
()
);
GLOActionGroup
*
pActionGroup
=
G_LO_ACTION_GROUP
(
pSalMenu
->
GetActionGroup
()
);
Menu
*
pVCLMenu
=
mpVCLMenu
;
GLOMenu
*
pLOMenu
=
G_LO_MENU
(
mpMenuModel
);
GLOActionGroup
*
pActionGroup
=
G_LO_ACTION_GROUP
(
mpActionGroup
);
GList
*
pOldCommandList
=
NULL
;
GList
*
pNewCommandList
=
NULL
;
...
...
@@ -400,11 +400,11 @@ static void GenerateFullMenu( GtkSalMenu* pSalMenu )
sal_Int32
validItems
=
0
;
sal_Int32
nItem
;
for
(
nItem
=
0
;
nItem
<
(
sal_Int32
)
pSalMenu
->
GetItemCount
();
nItem
++
)
{
if
(
pSalMenu
->
IsItemVisible
(
nItem
)
==
sal_False
)
for
(
nItem
=
0
;
nItem
<
(
sal_Int32
)
GetItemCount
();
nItem
++
)
{
if
(
IsItemVisible
(
nItem
)
==
sal_False
)
continue
;
GtkSalMenuItem
*
pSalMenuItem
=
pSalMenu
->
GetItemAtPos
(
nItem
);
GtkSalMenuItem
*
pSalMenuItem
=
GetItemAtPos
(
nItem
);
sal_uInt16
nId
=
pSalMenuItem
->
mnId
;
if
(
pSalMenuItem
->
mnType
==
MENUITEM_SEPARATOR
)
...
...
@@ -440,7 +440,7 @@ static void GenerateFullMenu( GtkSalMenu* pSalMenu )
gboolean
bChecked
=
(
itemChecked
==
sal_True
)
?
TRUE
:
FALSE
;
gboolean
bEnabled
=
(
itemEnabled
==
sal_True
)
?
TRUE
:
FALSE
;
// gchar* aNativeCommand = g_strdup( rtl::OUStringToOString( aCommand, RTL_TEXTENCODING_UTF8 ).getStr() );
gchar
*
aNativeCommand
=
pSalMenu
->
GetCommandForSpecialItem
(
pSalMenuItem
);
gchar
*
aNativeCommand
=
GetCommandForSpecialItem
(
pSalMenuItem
);
// Store current item command in command list.
gchar
*
aCurrentCommand
=
g_lo_menu_get_command_from_item_in_section
(
pLOMenu
,
nSection
,
nItemPos
);
...
...
@@ -449,8 +449,8 @@ static void GenerateFullMenu( GtkSalMenu* pSalMenu )
pOldCommandList
=
g_list_append
(
pOldCommandList
,
aCurrentCommand
);
// Force updating of native menu labels.
pSalMenu
->
NativeSetItemText
(
nSection
,
nItemPos
,
aText
);
pSalMenu
->
NativeSetAccelerator
(
nSection
,
nItemPos
,
nAccelKey
,
nAccelKey
.
GetName
(
GetFrame
()
->
GetWindow
()
)
);
NativeSetItemText
(
nSection
,
nItemPos
,
aText
);
NativeSetAccelerator
(
nSection
,
nItemPos
,
nAccelKey
,
nAccelKey
.
GetName
(
GetFrame
()
->
GetWindow
()
)
);
// Some items are special, so they have different commands.
// if ( g_strcmp0( aNativeCommand, "" ) == 0 )
...
...
@@ -468,9 +468,9 @@ static void GenerateFullMenu( GtkSalMenu* pSalMenu )
if
(
g_strcmp0
(
aNativeCommand
,
""
)
!=
0
&&
pSalMenuItem
->
mpSubMenu
==
NULL
)
{
pSalMenu
->
NativeSetItemCommand
(
nSection
,
nItemPos
,
nId
,
aNativeCommand
,
itemBits
,
bChecked
,
FALSE
);
pSalMenu
->
NativeCheckItem
(
nSection
,
nItemPos
,
itemBits
,
bChecked
);
pSalMenu
->
NativeSetEnableItem
(
aNativeCommand
,
bEnabled
);
NativeSetItemCommand
(
nSection
,
nItemPos
,
nId
,
aNativeCommand
,
itemBits
,
bChecked
,
FALSE
);
NativeCheckItem
(
nSection
,
nItemPos
,
itemBits
,
bChecked
);
NativeSetEnableItem
(
aNativeCommand
,
bEnabled
);
pNewCommandList
=
g_list_append
(
pNewCommandList
,
g_strdup
(
aNativeCommand
)
);
}
...
...
@@ -479,7 +479,7 @@ static void GenerateFullMenu( GtkSalMenu* pSalMenu )
if
(
pSubmenu
&&
pSubmenu
->
GetMenu
()
)
{
pSalMenu
->
NativeSetItemCommand
(
nSection
,
nItemPos
,
nId
,
aNativeCommand
,
itemBits
,
FALSE
,
TRUE
);
NativeSetItemCommand
(
nSection
,
nItemPos
,
nId
,
aNativeCommand
,
itemBits
,
FALSE
,
TRUE
);
pNewCommandList
=
g_list_append
(
pNewCommandList
,
g_strdup
(
aNativeCommand
)
);
GLOMenu
*
pSubMenuModel
=
g_lo_menu_get_submenu_from_item_in_section
(
pLOMenu
,
nSection
,
nItemPos
);
...
...
@@ -500,8 +500,7 @@ static void GenerateFullMenu( GtkSalMenu* pSalMenu )
pSubmenu
->
GetMenu
()
->
Activate
();
pSubmenu
->
GetMenu
()
->
Deactivate
();
GenerateFullMenu
(
pSubmenu
);
//pSubmenu->UpdateNativeMenu();
pSubmenu
->
UpdateFull
();
}
g_free
(
aNativeCommand
);
...
...
@@ -630,7 +629,7 @@ void GtkSalMenu::SetFrame( const SalFrame* pFrame )
// Generate the main menu structure.
if
(
bMenuVisibility
)
Update
NativeMenu
();
Update
Full
();
g_lo_menu_insert_section
(
pMenuModel
,
0
,
NULL
,
mpMenuModel
);
}
...
...
@@ -843,7 +842,7 @@ void GtkSalMenu::Activate( const gchar* aMenuCommand )
if
(
pSalSubMenu
!=
NULL
)
{
MenuBar
*
pMenuBar
=
static_cast
<
MenuBar
*
>
(
mpVCLMenu
);
pMenuBar
->
HandleMenuActivateEvent
(
pSalSubMenu
->
mpVCLMenu
);
pSalSubMenu
->
Update
NativeMenu2
();
pSalSubMenu
->
Update
();
}
}
...
...
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