update to 5.2.0 alpha1

f41
David Tardon 9 years ago
parent ea2fb234f1
commit a4b9630c4c

4
.gitignore vendored

@ -39,3 +39,7 @@
/libreoffice-5.1.3.1.tar.xz /libreoffice-5.1.3.1.tar.xz
/libreoffice-help-5.1.3.1.tar.xz /libreoffice-help-5.1.3.1.tar.xz
/libreoffice-translations-5.1.3.1.tar.xz /libreoffice-translations-5.1.3.1.tar.xz
/ce12af00283eb90d9281956524250d6e-xmlsec1-1.2.20.tar.gz
/libreoffice-5.2.0.0.alpha1.tar.xz
/libreoffice-help-5.2.0.0.alpha1.tar.xz
/libreoffice-translations-5.2.0.0.alpha1.tar.xz

@ -1,30 +0,0 @@
From 86692366b7edbd6dd1ce329a172fb78d402ac328 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Wed, 9 Mar 2016 11:01:43 +0000
Subject: [PATCH] Resolves: rhbz#1315385 use preferred size if widget supports
it
when deciding if a popup needs to be placed up or down to stay
visible on screen
Change-Id: I718e0ee4a79152e919ac95841e15d4b53764ac78
---
vcl/source/window/floatwin.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 00c3b34..6553f94 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -244,7 +244,7 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow,
{
// get window position
Point aPos;
- Size aSize = pWindow->GetSizePixel();
+ Size aSize = ::isLayoutEnabled(pWindow) ? pWindow->get_preferred_size() : pWindow->GetSizePixel();
Rectangle aScreenRect = pWindow->ImplGetFrameWindow()->GetDesktopRectPixel();
FloatingWindow *pFloatingWindow = dynamic_cast<FloatingWindow*>( pWindow );
--
2.7.1

@ -1,52 +0,0 @@
From a7c499a8dcff909693793588c9976a2c039604de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Wed, 20 Apr 2016 11:55:01 +0100
Subject: [PATCH] Resolves: tdf#91778 drawing the background over an active
cursor
will overwrite it, which means that when it toggles "off" afterwards, it uses
invert on the freshly drawn background which will visually make it appear "on"
and not off
Just explictly turn it off and restore it and avoid the whole potential
problem.
Change-Id: Ie21d77e9d704124011e43b42c98b26eaf208eef2
(cherry picked from commit 29a9f433c268414747d8ec7343fc2b5987971738)
---
sc/source/ui/view/gridwin4.cxx | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index e15cb1e..731c560 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -900,6 +900,14 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
aEnd.X() -= 2 * nLayoutSign;
aEnd.Y() -= 2;
+ // toggle the cursor off if its on to ensure the cursor invert
+ // background logic remains valid after the background is cleared on
+ // the next cursor flash
+ vcl::Cursor* pCrsr = pEditView->GetCursor();
+ const bool bVisCursor = pCrsr && pCrsr->IsVisible();
+ if (bVisCursor)
+ pCrsr->Hide();
+
// set the correct mapmode
Rectangle aBackground(aStart, aEnd);
if (bIsTiledRendering)
@@ -916,6 +924,10 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
// paint the editeng text
pEditView->Paint(rDevice.PixelToLogic(Rectangle(Point(nScrX, nScrY), Size(aOutputData.GetScrW(), aOutputData.GetScrH()))), &rDevice);
rDevice.SetMapMode(MAP_PIXEL);
+
+ // restore the cursor it it was originally visible
+ if (bVisCursor)
+ pCrsr->Show();
}
if (pViewData->HasEditView(eWhich))
--
2.7.3

@ -1,123 +0,0 @@
From 66db55aa84e8401a9eccedb02c67150833a344ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Tue, 15 Mar 2016 11:15:40 +0000
Subject: [PATCH] Resolves: tdf#98636
On changing a menu item from a non-submenu to a submenu then update
the newly created menu as if it was the first full update of
the entire menu hierarchy.
On changing a menu item from a submenu to a non-submenu its evidentially
not sufficient to unset the G_LO_MENU_ATTRIBUTE_SUBMENU_ACTION attribute
so remove the submenu-item and add a new non-submenu item to force
its new type
Change-Id: I2030d9198d6849643a5991ddfffc1cc3425ba72e
---
vcl/inc/unx/gtk/gtksalmenu.hxx | 2 +-
vcl/unx/gtk/glomenu.cxx | 1 +
vcl/unx/gtk/gtksalmenu.cxx | 24 ++++++++++++++++++++----
3 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx
index 8dadcfe..0e1cfd1 100644
--- a/vcl/inc/unx/gtk/gtksalmenu.hxx
+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx
@@ -87,7 +87,7 @@ public:
bool IsItemVisible( unsigned nPos );
void NativeSetItemText( unsigned nSection, unsigned nItemPos, const OUString& rText );
- void NativeSetItemCommand( unsigned nSection,
+ bool NativeSetItemCommand( unsigned nSection,
unsigned nItemPos,
sal_uInt16 nId,
const gchar* aCommand,
diff --git a/vcl/unx/gtk/glomenu.cxx b/vcl/unx/gtk/glomenu.cxx
index 835e832..e8529e0 100644
--- a/vcl/unx/gtk/glomenu.cxx
+++ b/vcl/unx/gtk/glomenu.cxx
@@ -294,6 +294,7 @@ g_lo_menu_set_action_and_target_value (GLOMenu *menu,
g_lo_menu_set_attribute_value (menu, position, G_MENU_ATTRIBUTE_ACTION, action_value);
g_lo_menu_set_attribute_value (menu, position, G_MENU_ATTRIBUTE_TARGET, target_value);
+ g_lo_menu_set_attribute_value (menu, position, G_LO_MENU_ATTRIBUTE_SUBMENU_ACTION, nullptr);
g_menu_model_items_changed (G_MENU_MODEL (menu), position, 1, 1);
}
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 91b7f35..48520c2 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -297,7 +297,7 @@ void GtkSalMenu::ImplUpdate(bool bRecurse, bool bRemoveDisabledEntries)
if ( pSubmenu && pSubmenu->GetMenu() )
{
- NativeSetItemCommand( nSection, nItemPos, nId, aNativeCommand, itemBits, FALSE, TRUE );
+ bool bNonMenuChangedToMenu = 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 );
@@ -310,12 +310,12 @@ void GtkSalMenu::ImplUpdate(bool bRecurse, bool bRemoveDisabledEntries)
g_object_unref( pSubMenuModel );
- if ( bRecurse )
+ if (bRecurse || bNonMenuChangedToMenu)
{
SAL_INFO("vcl.unity", "preparing submenu " << pSubMenuModel << " to menu model " << G_MENU_MODEL(pSubMenuModel) << " and action group " << G_ACTION_GROUP(pActionGroup));
pSubmenu->SetMenuModel( G_MENU_MODEL( pSubMenuModel ) );
pSubmenu->SetActionGroup( G_ACTION_GROUP( pActionGroup ) );
- pSubmenu->ImplUpdate(bRecurse, bRemoveDisabledEntries);
+ pSubmenu->ImplUpdate(true, bRemoveDisabledEntries);
}
}
@@ -798,7 +798,7 @@ void GtkSalMenu::NativeSetAccelerator( unsigned nSection, unsigned nItemPos, con
g_free( aCurrentAccel );
}
-void GtkSalMenu::NativeSetItemCommand( unsigned nSection,
+bool GtkSalMenu::NativeSetItemCommand( unsigned nSection,
unsigned nItemPos,
sal_uInt16 nId,
const gchar* aCommand,
@@ -806,6 +806,8 @@ void GtkSalMenu::NativeSetItemCommand( unsigned nSection,
gboolean bChecked,
gboolean bIsSubmenu )
{
+ bool bSubMenuAddedOrRemoved = false;
+
SolarMutexGuard aGuard;
GLOActionGroup* pActionGroup = G_LO_ACTION_GROUP( mpActionGroup );
@@ -845,6 +847,18 @@ void GtkSalMenu::NativeSetItemCommand( unsigned nSection,
if ( aCurrentCommand == nullptr || g_strcmp0( aCurrentCommand, aCommand ) != 0 )
{
+ bool bOldHasSubmenu = g_lo_menu_get_submenu_from_item_in_section(pMenu, nSection, nItemPos) != nullptr;
+ bSubMenuAddedOrRemoved = bOldHasSubmenu != bIsSubmenu;
+ if (bSubMenuAddedOrRemoved)
+ {
+ //tdf#98636 its not good enough to unset the "submenu-action" attribute to change something
+ //from a submenu to a non-submenu item, so remove the old one entirely and re-add it to
+ //support achieving that
+ gchar* pLabel = g_lo_menu_get_label_from_item_in_section(pMenu, nSection, nItemPos);
+ g_lo_menu_remove_from_section(pMenu, nSection, nItemPos);
+ g_lo_menu_insert_in_section(pMenu, nSection, nItemPos, pLabel);
+ }
+
g_lo_menu_set_command_to_item_in_section( pMenu, nSection, nItemPos, aCommand );
gchar* aItemCommand = g_strconcat("win.", aCommand, NULL );
@@ -865,6 +879,8 @@ void GtkSalMenu::NativeSetItemCommand( unsigned nSection,
if (pTarget)
g_variant_unref(pTarget);
+
+ return bSubMenuAddedOrRemoved;
}
GtkSalMenu* GtkSalMenu::GetMenuForItemCommand(gchar* aCommand, int& rDupsToSkip, gboolean bGetSubmenu)
--
2.7.1

@ -1,47 +0,0 @@
From 0ee0e8010f986b67d696111ff4ea269ccf904aba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Mon, 14 Mar 2016 12:50:56 +0000
Subject: [PATCH] Resolves: tdf#98638 sometimes menu grab doesn't take
due to older timestamp vs earlier grab. Which suggests we should probably use
GDK_CURRENT_TIME everywhere or (probably better) use gtk_get_current_event_time
everywhere
Change-Id: Ie04ab254b9fea423143cc9a129d2eecb683ed300
---
vcl/unx/gtk3/gtk3gtkframe.cxx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index bdd5499..742f812 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -2078,9 +2078,9 @@ void GtkSalFrame::grabPointer( bool bGrab, bool bOwnerEvents )
GdkDeviceManager* pDeviceManager = gdk_display_get_device_manager(getGdkDisplay());
GdkDevice* pPointer = gdk_device_manager_get_client_pointer(pDeviceManager);
if (bGrab)
- gdk_device_grab(pPointer, widget_get_window(getMouseEventWidget()), GDK_OWNERSHIP_NONE, bOwnerEvents, (GdkEventMask) nMask, m_pCurrentCursor, GDK_CURRENT_TIME);
+ gdk_device_grab(pPointer, widget_get_window(getMouseEventWidget()), GDK_OWNERSHIP_NONE, bOwnerEvents, (GdkEventMask) nMask, m_pCurrentCursor, gtk_get_current_event_time());
else
- gdk_device_ungrab(pPointer, GDK_CURRENT_TIME);
+ gdk_device_ungrab(pPointer, gtk_get_current_event_time());
}
void GtkSalFrame::grabKeyboard( bool bGrab )
@@ -2098,11 +2098,11 @@ void GtkSalFrame::grabKeyboard( bool bGrab )
if (bGrab)
{
gdk_device_grab(pKeyboard, widget_get_window(m_pWindow), GDK_OWNERSHIP_NONE,
- true, (GdkEventMask)(GDK_KEY_PRESS | GDK_KEY_RELEASE), nullptr, GDK_CURRENT_TIME);
+ true, (GdkEventMask)(GDK_KEY_PRESS | GDK_KEY_RELEASE), nullptr, gtk_get_current_event_time());
}
else
{
- gdk_device_ungrab(pKeyboard, GDK_CURRENT_TIME);
+ gdk_device_ungrab(pKeyboard, gtk_get_current_event_time());
}
}
--
2.7.1

File diff suppressed because it is too large Load Diff

@ -1,26 +0,0 @@
From bba3f7bf8f831bf7f51de6441b3f15ed667e56fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Wed, 16 Dec 2015 11:02:27 +0000
Subject: [PATCH] but only for dialog
Change-Id: I7e4f5c075ca4844f81a59071bed475ea1da4bf91
---
vcl/source/window/syswin.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index 3f2cde1..057b51b 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -1135,7 +1135,7 @@ void SystemWindow::DoInitialLayout()
mbIsCalculatingInitialLayoutSize = false;
mbInitialLayoutDone = true;
}
- else if (!(GetStyle() & WB_SIZEABLE))
+ else if (IsDialog() && !(GetStyle() & WB_SIZEABLE))
{
SetMinOutputSizePixel(GetSizePixel());
}
--
2.5.0

File diff suppressed because it is too large Load Diff

@ -1,48 +0,0 @@
From 235411c9d47ecba88e46d859ea93bcecefb0c46e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Fri, 11 Mar 2016 13:21:23 +0000
Subject: [PATCH] gtk3: various bits means different things again
Change-Id: Iafa1e65fb0cc096513cdfe12a09fb0ef4c4d2db0
---
vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index 403280c..7591f68 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -1124,6 +1124,12 @@ static GtkStyleContext* createStyleContext(GtkControlPart ePart, GtkStyleContext
# define CHECKED GTK_STATE_FLAG_ACTIVE
#endif
+#if GTK_CHECK_VERSION(3,19,11)
+# define ACTIVE_TAB GTK_STATE_FLAG_CHECKED
+#else
+# define ACTIVE_TAB GTK_STATE_FLAG_ACTIVE
+#endif
+
void GtkSalGraphics::PaintCheckOrRadio(cairo_t *cr, GtkStyleContext *context,
const Rectangle& rControlRectangle, bool bIsCheck, bool bInMenu)
{
@@ -1345,7 +1351,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
case CTRL_TAB_ITEM:
context = mpNotebookHeaderTabsTabStyle;
if (nState & ControlState::SELECTED)
- flags = (GtkStateFlags) (flags | GTK_STATE_FLAG_ACTIVE);
+ flags = (GtkStateFlags) (flags | ACTIVE_TAB);
break;
case CTRL_WINDOW_BACKGROUND:
context = gtk_widget_get_style_context(mpWindow);
@@ -2030,7 +2036,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aTextColor = getColor( text_color );
aStyleSet.SetTabRolloverTextColor(aTextColor);
- gtk_style_context_set_state(pCStyle, GTK_STATE_FLAG_ACTIVE);
+ gtk_style_context_set_state(pCStyle, ACTIVE_TAB);
gtk_style_context_get_color(pCStyle, gtk_style_context_get_state(pCStyle), &text_color);
aTextColor = getColor( text_color );
aStyleSet.SetTabHighlightTextColor(aTextColor);
--
2.7.1

@ -0,0 +1,26 @@
From 590d80cea8fcd7c51140cff38392c4c180327330 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Fri, 22 Apr 2016 14:32:07 +0200
Subject: [PATCH] pass original CFLAGS
Change-Id: Ia37fa1ad21a9411d78b0c30c769b3934d43d1389
---
external/libxmlsec/ExternalProject_xmlsec.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/external/libxmlsec/ExternalProject_xmlsec.mk b/external/libxmlsec/ExternalProject_xmlsec.mk
index a22b426..6a81306 100644
--- a/external/libxmlsec/ExternalProject_xmlsec.mk
+++ b/external/libxmlsec/ExternalProject_xmlsec.mk
@@ -55,7 +55,7 @@ $(call gb_ExternalProject_get_state_target,xmlsec,build) :
autoreconf \
&& ./configure \
--with-pic --disable-shared --disable-crypto-dl --without-libxslt --without-gnutls \
- CFLAGS="$(if $(debug),$(gb_COMPILERNOOPTFLAGS) $(gb_DEBUG_CFLAGS),$(gb_COMPILEROPTFLAGS))" \
+ CFLAGS="$(CFLAGS) $(if $(debug),$(gb_COMPILERNOOPTFLAGS) $(gb_DEBUG_CFLAGS),$(gb_COMPILEROPTFLAGS))" \
$(if $(or $(filter-out ANDROID,$(OS)),$(DISABLE_OPENSSL)),--without-openssl,--with-openssl=$(call gb_UnpackedTarball_get_dir,openssl)) \
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
$(if $(SYSTEM_NSS),,$(if $(filter MACOSX,$(OS)),--disable-pkgconfig)) \
--
2.5.0

@ -1,66 +0,0 @@
From d72a33c6aed0ca8f9fe0b90bc6d72e7313985524 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Tue, 8 Mar 2016 05:57:40 +0100
Subject: [PATCH 1/4] reorder
Change-Id: I8ff9f61475fddb475fe08e867c5446c825abb7dc
---
RepositoryExternal.mk | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index c6fe371..c8aab64 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -704,6 +704,21 @@ $(call gb_LinkTarget_use_static_libraries,$(1),\
endef
+define gb_LinkTarget__use_boost_filesystem
+$(call gb_LinkTarget_add_defs,$(1),\
+ -DBOOST_ALL_NO_LIB \
+)
+
+$(call gb_LinkTarget_use_static_libraries,$(1),\
+ boost_filesystem \
+)
+
+endef
+
+define gb_ExternalProject__use_boost_filesystem
+$(call gb_ExternalProject_use_static_libraries,$(1),boost_filesystem)
+endef
+
define gb_LinkTarget__use_boost_iostreams
$(call gb_LinkTarget_add_defs,$(1),\
-DBOOST_ALL_NO_LIB \
@@ -743,25 +758,11 @@ $(call gb_LinkTarget_set_include,$(1),\
endef
-define gb_LinkTarget__use_boost_filesystem
-$(call gb_LinkTarget_add_defs,$(1),\
- -DBOOST_ALL_NO_LIB \
-)
-
-$(call gb_LinkTarget_use_static_libraries,$(1),\
- boost_filesystem \
-)
-
-endef
-
-define gb_ExternalProject__use_boost_filesystem
-$(call gb_ExternalProject_use_static_libraries,$(1),boost_filesystem)
-endef
-
define gb_ExternalProject__use_boost_headers
$(call gb_ExternalProject_use_unpacked,$(1),boost)
endef
+
endif # SYSTEM_BOOST
--
2.5.0

@ -1,110 +0,0 @@
From 830b0e364cb1fec07664e1d5ec8a4c9593009959 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Wed, 20 Jan 2016 18:40:06 +0100
Subject: [PATCH] rhbz#1168757 propagate selected slides to print dialog
Change-Id: Icef119baffb8985ea0cb94d7e59f0daae88023ac
(cherry picked from commit f90f8329fe5e95f25ba449e307fd40d56d68d3bb)
---
sd/source/ui/view/DocumentRenderer.cxx | 41 ++++++++++++++++++++++++++++++----
1 file changed, 37 insertions(+), 4 deletions(-)
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index fd2b69c..d3b0a65 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -33,10 +33,12 @@
#include "FrameView.hxx"
#include "Outliner.hxx"
#include "OutlineViewShell.hxx"
+#include "SlideSorterViewShell.hxx"
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <rtl/ustrbuf.hxx>
#include <sfx2/printer.hxx>
#include <editeng/editstat.hxx>
#include <editeng/outlobj.hxx>
@@ -333,8 +335,9 @@ namespace {
class DialogCreator : Resource
{
public:
- DialogCreator (bool bImpress, sal_Int32 nCurPage)
+ DialogCreator (ViewShellBase &rBase, bool bImpress, sal_Int32 nCurPage)
: Resource(SdResId(_STR_IMPRESS_PRINT_UI_OPTIONS))
+ , mrBase(rBase)
, mbImpress(bImpress)
, mnCurPage(nCurPage)
{
@@ -359,6 +362,7 @@ namespace {
}
private:
+ ViewShellBase &mrBase;
std::vector<beans::PropertyValue> maProperties;
std::vector<sal_Int32> maSlidesPerPage;
bool mbImpress;
@@ -584,19 +588,48 @@ namespace {
aWidgetIds[0] = "printallpages";
aWidgetIds[1] = "printpages";
aWidgetIds[2] = "printselection";
+
+ // check if there is a selection of slides
+ OUString aPageRange(OUString::number(mnCurPage + 1));
+ int nPrintRange(0);
+ using sd::slidesorter::SlideSorterViewShell;
+ SlideSorterViewShell* const pSSViewSh(SlideSorterViewShell::GetSlideSorter(mrBase));
+ if (pSSViewSh)
+ {
+ const std::shared_ptr<SlideSorterViewShell::PageSelection> pPageSelection(pSSViewSh->GetPageSelection());
+ if (bool(pPageSelection) && pPageSelection->size() > 1)
+ {
+ OUStringBuffer aBuf;
+ // TODO: this could be improved by writing ranges instead of consecutive page
+ // numbers if appropriate. Do we have a helper function for that somewhere?
+ bool bFirst(true);
+ for (auto pPage: *pPageSelection)
+ {
+ if (!bFirst)
+ {
+ aBuf.append(',');
+ bFirst = false;
+ }
+ aBuf.append(OUString::number(pPage->GetPageNum() / 2 + 1));
+ }
+ aPageRange = aBuf.getStr();
+ nPrintRange = 1;
+ }
+ }
+
AddDialogControl( vcl::PrinterOptionsHelper::setChoiceRadiosControlOpt(aWidgetIds, "",
aHelpIds,
aPrintRangeName,
CreateChoice(mbImpress
? _STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE
: _STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE),
- 0 )
+ nPrintRange )
);
// create a an Edit dependent on "Pages" selected
vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, true );
AddDialogControl(vcl::PrinterOptionsHelper::setEditControlOpt("pagerange", "",
".HelpID:vcl:PrintDialog:PageRange:Edit", "PageRange",
- OUString::number(mnCurPage + 1), aPageRangeOpt));
+ aPageRange, aPageRangeOpt));
FreeResource();
}
@@ -1140,7 +1173,7 @@ public:
, mpPrintView()
, mbHasOrientationWarningBeenShown(false)
{
- DialogCreator aCreator( mrBase.GetDocShell()->GetDocumentType() == DOCUMENT_TYPE_IMPRESS, GetCurrentPageIndex() );
+ DialogCreator aCreator( mrBase, mrBase.GetDocShell()->GetDocumentType() == DOCUMENT_TYPE_IMPRESS, GetCurrentPageIndex() );
m_aUIProperties = aCreator.GetDialogControls();
maSlidesPerPage = aCreator.GetSlidesPerPage();
--
2.5.0

@ -1,346 +0,0 @@
From a8abbc28deebd6a9642033a47676ae9ba1900b05 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Thu, 24 Mar 2016 14:52:35 +0100
Subject: [PATCH] tdf#39271 allow to export only notes pages
Change-Id: Ia03062cf31b6bab8196dc317a7e8fbcfc86fadf0
---
filter/source/pdf/impdialog.cxx | 22 +++++++++++++
filter/source/pdf/impdialog.hxx | 4 +++
filter/source/pdf/pdfexport.cxx | 18 ++++++----
filter/source/pdf/pdfexport.hxx | 1 +
filter/uiconfig/ui/pdfgeneralpage.ui | 38 +++++++++++++++++-----
.../schema/org/openoffice/Office/Common.xcs | 7 ++++
6 files changed, 75 insertions(+), 15 deletions(-)
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 1fe1474..d51770c 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -84,6 +84,7 @@ ImpPDFTabDialog::ImpPDFTabDialog(vcl::Window* pParent, Sequence< PropertyValue >
mbExportNotes( true ),
mbViewPDF( false ),
mbExportNotesPages( false ),
+ mbExportOnlyNotesPages( false ),
mbUseTransitionEffects( false ),
mbIsSkipEmptyPages( true ),
mbAddStream( false ),
@@ -191,7 +192,10 @@ ImpPDFTabDialog::ImpPDFTabDialog(vcl::Window* pParent, Sequence< PropertyValue >
mbUseTaggedPDF = maConfigItem.ReadBool( "UseTaggedPDF", false );
mnPDFTypeSelection = maConfigItem.ReadInt32( "SelectPdfVersion", 0 );
if ( mbIsPresentation )
+ {
mbExportNotesPages = maConfigItem.ReadBool( "ExportNotesPages", false );
+ mbExportOnlyNotesPages = maConfigItem.ReadBool( "ExportOnlyNotesPages", false );
+ }
mbExportNotes = maConfigItem.ReadBool( "ExportNotes", false );
mbViewPDF = maConfigItem.ReadBool( "ViewPDFAfterExport", false );
@@ -392,7 +396,10 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData()
maConfigItem.WriteInt32("SelectPdfVersion", mnPDFTypeSelection );
if ( mbIsPresentation )
+ {
maConfigItem.WriteBool( "ExportNotesPages", mbExportNotesPages );
+ maConfigItem.WriteBool( "ExportOnlyNotesPages", mbExportOnlyNotesPages );
+ }
maConfigItem.WriteBool( "ExportNotes", mbExportNotes );
maConfigItem.WriteBool( "ViewPDFAfterExport", mbViewPDF );
@@ -540,6 +547,7 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage(vcl::Window* pParent, const SfxItemSe
get(mpCbExportHiddenSlides, "hiddenpages");
get(mpCbExportNotes, "comments");
get(mpCbExportNotesPages, "notes");
+ get(mpCbExportOnlyNotesPages, "onlynotes");
get(mpCbExportEmptyPages, "emptypages");
get(mpCbViewPDF, "viewpdf");
@@ -577,6 +585,7 @@ void ImpPDFTabGeneralPage::dispose()
mpCbExportNotes.clear();
mpCbViewPDF.clear();
mpCbExportNotesPages.clear();
+ mpCbExportOnlyNotesPages.clear();
mpCbExportEmptyPages.clear();
mpCbAddStream.clear();
mpCbWatermark.clear();
@@ -658,6 +667,10 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem( ImpPDFTabDialog* paParent )
mpRbRange->SetText(get<FixedText>("slides")->GetText());
mpCbExportNotesPages->Show();
mpCbExportNotesPages->Check(paParent->mbExportNotesPages);
+ mpCbExportNotesPages->SetToggleHdl( LINK(this, ImpPDFTabGeneralPage, ToggleExportNotesPagesHdl ) );
+ mpCbExportOnlyNotesPages->Show();
+ mpCbExportOnlyNotesPages->Check(paParent->mbExportOnlyNotesPages);
+ mpCbExportOnlyNotesPages->Enable(paParent->mbExportNotesPages);
mpCbExportHiddenSlides->Show();
mpCbExportHiddenSlides->Check(paParent->mbExportHiddenSlides);
}
@@ -665,6 +678,8 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem( ImpPDFTabDialog* paParent )
{
mpCbExportNotesPages->Show(false);
mpCbExportNotesPages->Check(false);
+ mpCbExportOnlyNotesPages->Show(false);
+ mpCbExportOnlyNotesPages->Check(false);
mpCbExportHiddenSlides->Show(false);
mpCbExportHiddenSlides->Check(false);
}
@@ -690,7 +705,10 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* paParent )
paParent->mbExportNotes = mpCbExportNotes->IsChecked();
paParent->mbViewPDF = mpCbViewPDF->IsChecked();
if ( mbIsPresentation )
+ {
paParent->mbExportNotesPages = mpCbExportNotesPages->IsChecked();
+ paParent->mbExportOnlyNotesPages = mpCbExportOnlyNotesPages->IsChecked();
+ }
paParent->mbExportBookmarks = mpCbExportBookmarks->IsChecked();
if ( mbIsPresentation )
paParent->mbExportHiddenSlides = mpCbExportHiddenSlides->IsChecked();
@@ -758,6 +776,10 @@ IMPL_LINK_NOARG_TYPED(ImpPDFTabGeneralPage, ToggleExportFormFieldsHdl, CheckBox&
mpFormsFrame->Enable(mpCbExportFormFields->IsChecked());
}
+IMPL_LINK_NOARG_TYPED(ImpPDFTabGeneralPage, ToggleExportNotesPagesHdl, CheckBox&, void)
+{
+ mpCbExportOnlyNotesPages->Enable(mpCbExportNotesPages->IsChecked());
+}
IMPL_LINK_NOARG_TYPED(ImpPDFTabGeneralPage, ToggleCompressionHdl, RadioButton&, void)
{
diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx
index f4d916e..c1e80d5 100644
--- a/filter/source/pdf/impdialog.hxx
+++ b/filter/source/pdf/impdialog.hxx
@@ -104,6 +104,7 @@ protected:
bool mbExportNotes;
bool mbViewPDF;
bool mbExportNotesPages;
+ bool mbExportOnlyNotesPages;
bool mbUseTransitionEffects;
bool mbIsSkipEmptyPages;
bool mbAddStream;
@@ -218,6 +219,7 @@ class ImpPDFTabGeneralPage : public SfxTabPage
VclPtr<CheckBox> mpCbExportNotes;
VclPtr<CheckBox> mpCbViewPDF;
VclPtr<CheckBox> mpCbExportNotesPages;
+ VclPtr<CheckBox> mpCbExportOnlyNotesPages;
VclPtr<CheckBox> mpCbExportEmptyPages;
VclPtr<CheckBox> mpCbAddStream;
@@ -237,6 +239,8 @@ class ImpPDFTabGeneralPage : public SfxTabPage
DECL_LINK_TYPED( ToggleWatermarkHdl, CheckBox&, void );
DECL_LINK_TYPED( ToggleAddStreamHdl, CheckBox&, void );
DECL_LINK_TYPED( ToggleExportFormFieldsHdl, CheckBox&, void );
+ DECL_LINK_TYPED( ToggleExportNotesPagesHdl, CheckBox&, void );
+
void TogglePagesHdl();
public:
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 5a67041..c5f8f5a 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -100,6 +100,7 @@ PDFExport::PDFExport( const Reference< XComponent >& rxSrcDoc,
mbExportNotes ( true ),
mbViewPDF ( true ),
mbExportNotesPages ( false ),
+ mbExportOnlyNotesPages ( false ),
mbUseTransitionEffects ( true ),
mbExportBookmarks ( true ),
mbExportHiddenSlides ( false ),
@@ -464,6 +465,8 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
rFilterData[ nData ].Value >>= mbViewPDF;
else if ( rFilterData[ nData ].Name == "ExportNotesPages" )
rFilterData[ nData ].Value >>= mbExportNotesPages;
+ else if ( rFilterData[ nData ].Name == "ExportOnlyNotesPages" )
+ rFilterData[ nData ].Value >>= mbExportOnlyNotesPages;
else if ( rFilterData[ nData ].Name == "UseTransitionEffects" )
rFilterData[ nData ].Value >>= mbUseTransitionEffects;
else if ( rFilterData[ nData ].Name == "ExportFormFields" )
@@ -840,7 +843,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
aSelection = Any();
aSelection <<= mxSrcDoc;
}
- bool bSecondPassForImpressNotes = false;
+ bool bExportNotesPages = false;
bool bReChangeToNormalView = false;
const OUString sShowOnlineLayout( "ShowOnlineLayout" );
bool bReHideWhitespace = false;
@@ -879,8 +882,9 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
{
uno::Reference< drawing::XShapes > xShapes; // sj: do not allow to export notes when
if ( ! ( aSelection >>= xShapes ) ) // exporting a selection -> todo: in the dialog
- bSecondPassForImpressNotes = true; // the export notes checkbox needs to be disabled
+ bExportNotesPages = true;
}
+ const bool bExportPages = bExportNotesPages ? !mbExportOnlyNotesPages : true;
if( aPageRange.isEmpty() )
{
@@ -894,18 +898,18 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >&
if ( pResMgr )
{
sal_Int32 nTotalPageCount = aRangeEnum.size();
- if ( bSecondPassForImpressNotes )
+ if ( bExportPages && bExportNotesPages )
nTotalPageCount *= 2;
mxStatusIndicator->start( ResId( PDF_PROGRESS_BAR, *pResMgr ), nTotalPageCount );
}
}
- if( nPageCount > 0 )
+ bRet = nPageCount > 0;
+
+ if ( bRet && bExportPages )
bRet = ExportSelection( *pPDFWriter, xRenderable, aSelection, aRangeEnum, aRenderOptions, nPageCount );
- else
- bRet = false;
- if ( bRet && bSecondPassForImpressNotes )
+ if ( bRet && bExportNotesPages )
{
rExportNotesValue <<= sal_True;
bRet = ExportSelection( *pPDFWriter, xRenderable, aSelection, aRangeEnum, aRenderOptions, nPageCount );
diff --git a/filter/source/pdf/pdfexport.hxx b/filter/source/pdf/pdfexport.hxx
index 75ac0aa4..8754729 100644
--- a/filter/source/pdf/pdfexport.hxx
+++ b/filter/source/pdf/pdfexport.hxx
@@ -49,6 +49,7 @@ private:
bool mbExportNotes;
bool mbViewPDF;
bool mbExportNotesPages;
+ bool mbExportOnlyNotesPages;
bool mbUseTransitionEffects;
bool mbExportBookmarks;
bool mbExportHiddenSlides;
diff --git a/filter/uiconfig/ui/pdfgeneralpage.ui b/filter/uiconfig/ui/pdfgeneralpage.ui
index 7ba4a25..52314ac 100644
--- a/filter/uiconfig/ui/pdfgeneralpage.ui
+++ b/filter/uiconfig/ui/pdfgeneralpage.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.19.0 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkAdjustment" id="adjustment1">
@@ -111,8 +111,8 @@
<object class="GtkLabel" id="slides">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">Slides:</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -191,9 +191,9 @@
<object class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">_Quality:</property>
<property name="use_underline">True</property>
+ <property name="xalign">0</property>
</object>
</child>
</object>
@@ -378,10 +378,10 @@
<object class="GtkLabel" id="watermarklabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">Text:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">watermarkentry</property>
+ <property name="xalign">0</property>
</object>
</child>
</object>
@@ -512,10 +512,10 @@
<object class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">Submit _format:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">format</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -604,7 +604,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">9</property>
+ <property name="top_attach">10</property>
</packing>
</child>
<child>
@@ -619,7 +619,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">10</property>
+ <property name="top_attach">11</property>
</packing>
</child>
<child>
@@ -634,7 +634,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">8</property>
+ <property name="top_attach">9</property>
</packing>
</child>
<child>
@@ -652,6 +652,28 @@
<property name="top_attach">7</property>
</packing>
</child>
+ <child>
+ <object class="GtkAlignment" id="onlynotesframe">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkCheckButton" id="onlynotes">
+ <property name="label" translatable="yes">Export onl_y notes pages</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">8</property>
+ </packing>
+ </child>
</object>
</child>
</object>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 6adfa44a..9fce3d7 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5135,6 +5135,13 @@
</info>
<value>false</value>
</prop>
+ <prop oor:name="ExportOnlyNotesPages" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Specifies if only notes pages (i.e., not slides) are exported to PDF. (Notes pages
+ are available in Impress documents only).</desc>
+ </info>
+ <value>false</value>
+ </prop>
<prop oor:name="UseTransitionEffects" oor:type="xs:boolean" oor:nillable="false">
<info>
<desc>Specifies slide transitions are exported to PDF. This option
--
2.5.0

@ -1,91 +0,0 @@
From e1f3d2cce6e2717189ab8a1e85b98f28df05734b Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Tue, 15 Dec 2015 20:46:54 +0100
Subject: [PATCH] tdf#95450 avoid double swap on big endian arches
AFAICS the swapping is already done at basebmp::BitmapDevice level.
Change-Id: Ie82f2610b4415ed11fc1164a54bc1fe183f523ed
---
vcl/headless/svpbmp.cxx | 28 ----------------------------
1 file changed, 28 deletions(-)
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx
index e6d962f..a3ff4d7 100644
--- a/vcl/headless/svpbmp.cxx
+++ b/vcl/headless/svpbmp.cxx
@@ -202,17 +202,10 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( BitmapAccessMode )
{
nBitCount = 32;
pBuf->mnFormat = BMP_FORMAT_32BIT_TC_MASK;
-#ifdef OSL_BIGENDIAN
- ColorMaskElement aRedMask(0x0000ff00);
- ColorMaskElement aGreenMask(0x00ff0000);
- ColorMaskElement aBlueMask(0xff000000);
- sal_uInt32 nAlphaChannel(0x000000ff);
-#else
ColorMaskElement aRedMask(0x00ff0000);
ColorMaskElement aGreenMask(0x0000ff00);
ColorMaskElement aBlueMask(0x000000ff);
sal_uInt32 nAlphaChannel(0xff000000);
-#endif
aBlueMask.CalcMaskShift();
aRedMask.CalcMaskShift();
aGreenMask.CalcMaskShift();
@@ -223,17 +216,10 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( BitmapAccessMode )
{
nBitCount = 32;
pBuf->mnFormat = BMP_FORMAT_32BIT_TC_MASK;
-#ifdef OSL_BIGENDIAN
- ColorMaskElement aRedMask(0x00ff0000);
- ColorMaskElement aGreenMask(0x0000ff00);
- ColorMaskElement aBlueMask(0x000000ff);
- sal_uInt32 nAlphaChannel(0xff000000);
-#else
ColorMaskElement aRedMask(0x0000ff00);
ColorMaskElement aGreenMask(0x00ff0000);
ColorMaskElement aBlueMask(0xff000000);
sal_uInt32 nAlphaChannel(0x000000ff);
-#endif
aBlueMask.CalcMaskShift();
aRedMask.CalcMaskShift();
aGreenMask.CalcMaskShift();
@@ -244,17 +230,10 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( BitmapAccessMode )
{
nBitCount = 32;
pBuf->mnFormat = BMP_FORMAT_32BIT_TC_MASK;
-#ifdef OSL_BIGENDIAN
- ColorMaskElement aRedMask(0x000000ff);
- ColorMaskElement aGreenMask(0x0000ff00);
- ColorMaskElement aBlueMask(0x00ff0000);
- sal_uInt32 nAlphaChannel(0xff000000);
-#else
ColorMaskElement aRedMask(0xff000000);
ColorMaskElement aGreenMask(0x00ff0000);
ColorMaskElement aBlueMask(0x0000ff00);
sal_uInt32 nAlphaChannel(0x000000ff);
-#endif
aBlueMask.CalcMaskShift();
aRedMask.CalcMaskShift();
aGreenMask.CalcMaskShift();
@@ -265,17 +244,10 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( BitmapAccessMode )
{
nBitCount = 32;
pBuf->mnFormat = BMP_FORMAT_32BIT_TC_MASK;
-#ifdef OSL_BIGENDIAN
- ColorMaskElement aRedMask(0xff000000);
- ColorMaskElement aGreenMask(0x00ff0000);
- ColorMaskElement aBlueMask(0x0000ff00);
- sal_uInt32 nAlphaChannel(0x000000ff);
-#else
ColorMaskElement aRedMask(0x000000ff);
ColorMaskElement aGreenMask(0x0000ff00);
ColorMaskElement aBlueMask(0x00ff0000);
sal_uInt32 nAlphaChannel(0xff000000);
-#endif
aBlueMask.CalcMaskShift();
aRedMask.CalcMaskShift();
aGreenMask.CalcMaskShift();
--
2.5.0

@ -1,329 +0,0 @@
From e51b78efcdd8e55727fb3b75165b11a30bf6a83a Mon Sep 17 00:00:00 2001
From: Maxim Monastirsky <momonasmon@gmail.com>
Date: Sun, 7 Feb 2016 17:53:40 +0200
Subject: [PATCH] tdf#97665 Let's hope that over activation isn't really needed
- MenuBarManager::Activate has a check for duplicate activation,
which makes the second activation attempt fail. Removing this
check or deactivating after each activation will likely affect
performance even more, but on the other hand should solve
lp#1296715, which was the main reason of the over activation
in the first place. So let's activate only one menu at a time,
and do full activation only on the initial update.
- Unfortunately the HUD activation callback doesn't work, so
we still have to keep active status listener for all menu
items. (Which is BTW against the recommendation in
XPopupMenuController::updatePopupMenu IDL doc. Fortunately
the performance problem hardly noticeable on modern hw.)
Reviewed-on: https://gerrit.libreoffice.org/22369
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
(cherry picked from commit 2abdcfd641883f246fe78f2fbe38499c9382c059)
Change-Id: I96affa72412f3f38160fdca4b6efd20ca68d059f
---
framework/source/uielement/menubarmanager.cxx | 11 ++---
include/vcl/menu.hxx | 9 +---
vcl/inc/salmenu.hxx | 1 +
vcl/inc/unx/gtk/gtksalmenu.hxx | 4 +-
vcl/source/window/menu.cxx | 46 +++----------------
vcl/unx/gtk/gloactiongroup.cxx | 2 +-
vcl/unx/gtk/gtkdata.cxx | 18 --------
vcl/unx/gtk/gtksalmenu.cxx | 64 +++++++--------------------
8 files changed, 33 insertions(+), 122 deletions(-)
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 6bb58db..fc80c3e 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -386,10 +386,6 @@ throw ( RuntimeException, std::exception )
OUString aFeatureURL = Event.FeatureURL.Complete;
SolarMutexGuard aSolarGuard;
- if ( m_bHasMenuBar )
- {
- vcl::MenuInvalidator::Invalidated();
- }
{
if ( m_bDisposed )
return;
@@ -488,6 +484,8 @@ throw ( RuntimeException, std::exception )
pMenuItemHandler->xMenuItemDispatch.clear();
}
}
+ if ( m_bHasMenuBar && !m_bActive )
+ m_pVCLMenu->UpdateNativeMenu();
}
}
@@ -893,9 +891,8 @@ IMPL_LINK_TYPED( MenuBarManager, Activate, Menu *, pMenu, bool )
if ( !bPopupMenu )
{
xMenuItemDispatch->addStatusListener( static_cast< XStatusListener* >( this ), aTargetURL );
- xMenuItemDispatch->removeStatusListener( static_cast< XStatusListener* >( this ), aTargetURL );
- if ( m_bHasMenuBar )
- xMenuItemDispatch->addStatusListener( static_cast< XStatusListener* >( this ), aTargetURL );
+ if ( !m_bHasMenuBar )
+ xMenuItemDispatch->removeStatusListener( static_cast< XStatusListener* >( this ), aTargetURL );
}
}
else if ( !bPopupMenu )
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index ade703b..0d6e16a 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -313,6 +313,8 @@ public:
void RemoveDisabledEntries( bool bCheckPopups = true, bool bRemoveEmptyPopups = false );
bool HasValidEntries( bool bCheckPopups = true );
+ void UpdateNativeMenu();
+
void SetItemText( sal_uInt16 nItemId, const OUString& rStr );
OUString GetItemText( sal_uInt16 nItemId ) const;
@@ -407,13 +409,6 @@ public:
};
-namespace vcl { namespace MenuInvalidator {
-
-VCL_DLLPUBLIC void AddMenuInvalidateListener(const Link<LinkParamNone*,void>&);
-VCL_DLLPUBLIC void Invalidated();
-
-}}
-
class VCL_DLLPUBLIC MenuBar : public Menu
{
Link<void*,void> maCloseHdl;
diff --git a/vcl/inc/salmenu.hxx b/vcl/inc/salmenu.hxx
index 287e19e..468994a 100644
--- a/vcl/inc/salmenu.hxx
+++ b/vcl/inc/salmenu.hxx
@@ -80,6 +80,7 @@ public:
virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, FloatWinPopupFlags nFlags);
virtual bool AddMenuBarButton( const SalMenuButtonItem& ); // return false if not implemented or failure
virtual void RemoveMenuBarButton( sal_uInt16 nId );
+ virtual void Update() {}
// TODO: implement show/hide for the Win/Mac VCL native backends
virtual void ShowItem( unsigned nPos, bool bShow ) { EnableItem( nPos, bShow ); }
diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx
index 011c3e4..93259f1 100644
--- a/vcl/inc/unx/gtk/gtksalmenu.hxx
+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx
@@ -96,11 +96,11 @@ public:
void NativeSetAccelerator( unsigned nSection, unsigned nItemPos, const vcl::KeyCode& rKeyCode, const OUString& rKeyName );
void DispatchCommand( gint itemId, const gchar* aCommand );
- void Activate();
+ void Activate( const gchar* aMenuCommand = nullptr );
void Deactivate( const gchar* aMenuCommand );
void Display( bool bVisible );
bool PrepUpdate();
- void Update(); // Update this menu only.
+ virtual void Update() override; // Update this menu only.
void UpdateFull(); // Update full menu hierarchy from this menu.
};
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 3a6e54c..4aa7d41 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2314,6 +2314,12 @@ sal_uLong Menu::DeactivateMenuBar(sal_uLong nFocusId)
return nFocusId;
}
+void Menu::UpdateNativeMenu()
+{
+ if ( ImplGetSalMenu() )
+ ImplGetSalMenu()->Update();
+}
+
void Menu::MenuBarKeyInput(const KeyEvent&)
{
}
@@ -3251,44 +3257,4 @@ ImplMenuDelData::~ImplMenuDelData()
const_cast< Menu* >( mpMenu )->ImplRemoveDel( *this );
}
-namespace vcl { namespace MenuInvalidator {
-
-struct MenuInvalidateListeners : public vcl::DeletionNotifier
-{
- std::vector<Link<LinkParamNone*,void>> m_aListeners;
-};
-
-static MenuInvalidateListeners* pMenuInvalidateListeners = nullptr;
-
-void AddMenuInvalidateListener(const Link<LinkParamNone*,void>& rLink)
-{
- if(!pMenuInvalidateListeners)
- pMenuInvalidateListeners = new MenuInvalidateListeners();
- // ensure uniqueness
- auto& rListeners = pMenuInvalidateListeners->m_aListeners;
- if (std::find(rListeners.begin(), rListeners.end(), rLink) == rListeners.end())
- rListeners.push_back( rLink );
-}
-
-void Invalidated()
-{
- if(!pMenuInvalidateListeners)
- return;
-
- vcl::DeletionListener aDel( pMenuInvalidateListeners );
-
- auto& rYieldListeners = pMenuInvalidateListeners->m_aListeners;
- // Copy the list, because this can be destroyed when calling a Link...
- std::vector<Link<LinkParamNone*,void>> aCopy( rYieldListeners );
- for( Link<LinkParamNone*,void>& rLink : aCopy )
- {
- if (aDel.isDeleted()) break;
- // check this hasn't been removed in some re-enterancy scenario fdo#47368
- if( std::find(rYieldListeners.begin(), rYieldListeners.end(), rLink) != rYieldListeners.end() )
- rLink.Call( nullptr );
- }
-};
-
-} } // namespace vcl::MenuInvalidator
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/gloactiongroup.cxx b/vcl/unx/gtk/gloactiongroup.cxx
index 8385388..e710809 100644
--- a/vcl/unx/gtk/gloactiongroup.cxx
+++ b/vcl/unx/gtk/gloactiongroup.cxx
@@ -201,7 +201,7 @@ g_lo_action_group_perform_submenu_action (GLOActionGroup *group,
SAL_INFO("vcl.unity", "g_lo_action_group_perform_submenu_action on " << group << " to " << bState);
if (bState)
- pSalMenu->Activate();
+ pSalMenu->Activate (action_name);
else
pSalMenu->Deactivate (action_name);
}
diff --git a/vcl/unx/gtk/gtkdata.cxx b/vcl/unx/gtk/gtkdata.cxx
index b5c64e0..9ea6dc9 100644
--- a/vcl/unx/gtk/gtkdata.cxx
+++ b/vcl/unx/gtk/gtkdata.cxx
@@ -1030,22 +1030,4 @@ void GtkSalDisplay::deregisterFrame( SalFrame* pFrame )
SalGenericDisplay::deregisterFrame( pFrame );
}
-#if GTK_CHECK_VERSION(3,0,0)
-void GtkSalDisplay::RefreshMenusUnity()
-{
-#ifdef ENABLE_GMENU_INTEGRATION
- for(auto pSalFrame : m_aFrames) {
- auto pGtkSalFrame( static_cast<GtkSalFrame*>(pSalFrame));
- GtkSalMenu* pSalMenu = static_cast<GtkSalMenu*>(pGtkSalFrame->GetMenu());
- if(pSalMenu) {
- pSalMenu->Activate();
- pSalMenu->UpdateFull();
- }
- }
-#else
- (void) this;
-#endif
-}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index b6295fa..5c16c39 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -372,54 +372,9 @@ void GtkSalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsig
pItem->mpSubMenu = pGtkSubMenu;
}
-static bool bInvalidMenus = false;
-static gboolean RefreshMenusUnity(gpointer)
-{
- SolarMutexGuard g;
-#if GTK_CHECK_VERSION(3,0,0)
- GetGtkSalData()->GetGtkDisplay()->RefreshMenusUnity();
-#else
- SalDisplay* pSalDisplay = vcl_sal::getSalDisplay(GetGenericData());
- std::list< SalFrame* >::const_iterator pSalFrame = pSalDisplay->getFrames().begin();
- std::list< SalFrame* >::const_iterator pEndSalFrame = pSalDisplay->getFrames().end();
- for(; pSalFrame != pEndSalFrame; ++pSalFrame) {
- const GtkSalFrame* pGtkSalFrame = static_cast< const GtkSalFrame* >( *pSalFrame );
- GtkSalFrame* pFrameNonConst = const_cast<GtkSalFrame*>(pGtkSalFrame);
- GtkSalMenu* pSalMenu = static_cast<GtkSalMenu*>(pFrameNonConst->GetMenu());
- if(pSalMenu) {
- pSalMenu->Activate();
- pSalMenu->UpdateFull();
- }
- }
-#endif
- bInvalidMenus = false;
- return FALSE;
-}
-
-static void RefreshMenusUnity(void*, LinkParamNone*)
-{
- if(!bInvalidMenus) {
- g_timeout_add(10, &RefreshMenusUnity, nullptr);
- bInvalidMenus = true;
- }
-}
-
-static Link<LinkParamNone*,void>* getRefreshLinkInstance()
-{
- static Link<LinkParamNone*,void>* pLink = nullptr;
- if(!pLink) {
- pLink = new Link<LinkParamNone*,void>(nullptr, &RefreshMenusUnity);
- }
- return pLink;
-}
-
void GtkSalMenu::SetFrame( const SalFrame* pFrame )
{
SolarMutexGuard aGuard;
- {
- vcl::MenuInvalidator::AddMenuInvalidateListener(*getRefreshLinkInstance());
- }
-
assert(mbMenuBar);
SAL_INFO("vcl.unity", "GtkSalMenu set to frame");
mpFrame = static_cast< const GtkSalFrame* >( pFrame );
@@ -706,6 +661,7 @@ void GtkSalMenu::DispatchCommand( gint itemId, const gchar *aCommand )
void GtkSalMenu::ActivateAllSubmenus(MenuBar* pMenuBar)
{
pMenuBar->HandleMenuActivateEvent(mpVCLMenu);
+ pMenuBar->HandleMenuDeActivateEvent(mpVCLMenu);
for ( size_t nPos = 0; nPos < maItems.size(); nPos++ )
{
GtkSalMenuItem *pSalItem = maItems[ nPos ];
@@ -717,11 +673,25 @@ void GtkSalMenu::ActivateAllSubmenus(MenuBar* pMenuBar)
}
}
-void GtkSalMenu::Activate()
+void GtkSalMenu::Activate( const gchar* aMenuCommand )
{
if ( !mbMenuBar )
return;
- ActivateAllSubmenus(static_cast<MenuBar*>(mpVCLMenu));
+
+ if ( !aMenuCommand ) {
+ ActivateAllSubmenus( static_cast< MenuBar* >( mpVCLMenu ) );
+ return;
+ }
+
+ int nDupsToSkip;
+ aMenuCommand = DetermineDupIndex(aMenuCommand, nDupsToSkip);
+ GtkSalMenu* pSalSubMenu = GetMenuForItemCommand( const_cast<gchar*>(aMenuCommand), nDupsToSkip, TRUE );
+
+ if ( pSalSubMenu != nullptr ) {
+ MenuBar* pMenuBar = static_cast< MenuBar* >( mpVCLMenu );
+ pMenuBar->HandleMenuActivateEvent( pSalSubMenu->mpVCLMenu );
+ pSalSubMenu->Update();
+ }
}
void GtkSalMenu::Deactivate( const gchar* aMenuCommand )
--
2.5.0

@ -1,49 +0,0 @@
From bd8559a4722825b4a1fdb33042b90b63295ef835 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Thu, 17 Dec 2015 16:33:41 +0000
Subject: [PATCH 1/2] these popups should start invisible and take default
popup menu bits
so they can position correctly under wayland
Change-Id: Idf65c0ef27be5aa6027a516207fd34c2e03407ca
---
svx/uiconfig/ui/floatingundoredo.ui | 1 -
svx/uiconfig/ui/paralinespacingcontrol.ui | 2 --
2 files changed, 3 deletions(-)
diff --git a/svx/uiconfig/ui/floatingundoredo.ui b/svx/uiconfig/ui/floatingundoredo.ui
index 66f30a6..2c48f82 100644
--- a/svx/uiconfig/ui/floatingundoredo.ui
+++ b/svx/uiconfig/ui/floatingundoredo.ui
@@ -11,7 +11,6 @@
<property name="destroy_with_parent">True</property>
<property name="type_hint">popup-menu</property>
<property name="skip_pager_hint">True</property>
- <property name="decorated">False</property>
<property name="deletable">False</property>
<child>
<object class="GtkBox" id="box">
diff --git a/svx/uiconfig/ui/paralinespacingcontrol.ui b/svx/uiconfig/ui/paralinespacingcontrol.ui
index 5d7402b..67ca9c1 100644
--- a/svx/uiconfig/ui/paralinespacingcontrol.ui
+++ b/svx/uiconfig/ui/paralinespacingcontrol.ui
@@ -45,7 +45,6 @@
<property name="icon-size">1</property>
</object>
<object class="GtkWindow" id="ParaLineSpacingControl">
- <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
@@ -54,7 +53,6 @@
<property name="destroy_with_parent">True</property>
<property name="type_hint">popup-menu</property>
<property name="skip_pager_hint">True</property>
- <property name="decorated">False</property>
<property name="deletable">False</property>
<child>
<object class="GtkGrid" id="grid2">
--
2.5.0

@ -1,46 +0,0 @@
From 011f42c0c6104228f5c15daae58e432ccf2be69d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Thu, 17 Dec 2015 17:04:52 +0000
Subject: [PATCH 2/2] disable tearability of color window
the new popup controllers take care to destroy the popup
and recreate a non-popup and move the contents into it
so we should re-implement the color popup as one of those
in the meantime, turn it into a non-tearable thing
Change-Id: I6ba26bf19badcbf910b7200b7e1b8b2a64ce4eec
---
svx/source/tbxctrls/tbcontrl.cxx | 3 +--
svx/uiconfig/ui/colorwindow.ui | 1 -
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index ae696ae..28691dc 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2659,8 +2659,7 @@ VclPtr<SfxPopupWindow> SvxColorToolBoxControl::CreatePopupWindow()
break;
}
- pColorWin->StartPopupMode( &GetToolBox(),
- FloatWinPopupFlags::AllowTearOff|FloatWinPopupFlags::NoAppFocusClose );
+ pColorWin->StartPopupMode( &GetToolBox(), FloatWinPopupFlags::NoAppFocusClose );
pColorWin->StartSelection();
SetPopupWindow( pColorWin );
if ( !bSidebarType )
diff --git a/svx/uiconfig/ui/colorwindow.ui b/svx/uiconfig/ui/colorwindow.ui
index 9482562..702bee3 100644
--- a/svx/uiconfig/ui/colorwindow.ui
+++ b/svx/uiconfig/ui/colorwindow.ui
@@ -25,7 +25,6 @@
<property name="destroy_with_parent">True</property>
<property name="type_hint">popup-menu</property>
<property name="skip_pager_hint">True</property>
- <property name="decorated">False</property>
<property name="deletable">False</property>
<child>
<object class="GtkBox" id="box1">
--
2.5.0

@ -1,173 +0,0 @@
From 7e0dcbd97a7ec6e9d39a8b74980421a6b33132ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Mon, 22 Feb 2016 20:57:52 +0000
Subject: [PATCH] gtk3: some changes towards enabling native gtk3 popup menus
these menubar things can be menu things and can then do
away with the casting, no logic changes intended
Change-Id: Ibb1b5354d5e1483327f172d6890e134f1e4b9ee4
(cherry picked from commit c13a0b1f9e76584a4ffaea0ba754c8f9a01793d8)
---
include/vcl/menu.hxx | 8 ++++----
vcl/inc/unx/gtk/gtksalmenu.hxx | 4 ++--
vcl/source/window/menu.cxx | 15 +++++++--------
vcl/unx/gtk/gtksalmenu.cxx | 13 +++++--------
4 files changed, 18 insertions(+), 22 deletions(-)
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index 0d6e16a..1dbd85e 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -406,8 +406,11 @@ public:
void HighlightItem( sal_uInt16 nItemPos );
void DeHighlight() { HighlightItem( 0xFFFF ); } // MENUITEMPOS_INVALID
-};
+ bool HandleMenuCommandEvent(Menu *pMenu, sal_uInt16 nEventId) const;
+ bool HandleMenuActivateEvent(Menu *pMenu) const;
+ bool HandleMenuDeActivateEvent(Menu *pMenu) const;
+};
class VCL_DLLPUBLIC MenuBar : public Menu
{
@@ -458,10 +461,7 @@ public:
void ShowButtons( bool bClose, bool bFloat, bool bHide );
virtual void SelectItem(sal_uInt16 nId) override;
- bool HandleMenuActivateEvent(Menu *pMenu) const;
- bool HandleMenuDeActivateEvent(Menu *pMenu) const;
bool HandleMenuHighlightEvent(Menu *pMenu, sal_uInt16 nEventId) const;
- bool HandleMenuCommandEvent(Menu *pMenu, sal_uInt16 nEventId) const;
bool HandleMenuButtonEvent(Menu *pMenu, sal_uInt16 nEventId);
void SetCloseButtonClickHdl( const Link<void*,void>& rLink ) { maCloseHdl = rLink; }
diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx
index 93259f1..ffda51a 100644
--- a/vcl/inc/unx/gtk/gtksalmenu.hxx
+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx
@@ -42,7 +42,7 @@ class GtkSalMenu : public SalMenu
private:
std::vector< GtkSalMenuItem* > maItems;
- bool mbMenuBar;
+ bool mbMenuBar;
Menu* mpVCLMenu;
GtkSalMenu* mpParentSalMenu;
const GtkSalFrame* mpFrame;
@@ -53,7 +53,7 @@ private:
GtkSalMenu* GetMenuForItemCommand( gchar* aCommand, int& rDupsToSkip, gboolean bGetSubmenu );
void ImplUpdate( gboolean bRecurse );
- void ActivateAllSubmenus(MenuBar* pMenuBar);
+ void ActivateAllSubmenus(Menu* pMenuBar);
public:
GtkSalMenu( bool bMenuBar );
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 4aa7d41..999085e 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2679,14 +2679,13 @@ void MenuBar::SelectItem(sal_uInt16 nId)
}
// handler for native menu selection and command events
-
-bool MenuBar::HandleMenuActivateEvent( Menu *pMenu ) const
+bool Menu::HandleMenuActivateEvent( Menu *pMenu ) const
{
if( pMenu )
{
ImplMenuDelData aDelData( this );
- pMenu->pStartedFrom = const_cast<MenuBar*>(this);
+ pMenu->pStartedFrom = const_cast<Menu*>(this);
pMenu->bInCallback = true;
pMenu->Activate();
@@ -2696,13 +2695,13 @@ bool MenuBar::HandleMenuActivateEvent( Menu *pMenu ) const
return true;
}
-bool MenuBar::HandleMenuDeActivateEvent( Menu *pMenu ) const
+bool Menu::HandleMenuDeActivateEvent( Menu *pMenu ) const
{
if( pMenu )
{
ImplMenuDelData aDelData( this );
- pMenu->pStartedFrom = const_cast<MenuBar*>(this);
+ pMenu->pStartedFrom = const_cast<Menu*>(this);
pMenu->bInCallback = true;
pMenu->Deactivate();
if( !aDelData.isDeleted() )
@@ -2735,14 +2734,14 @@ bool MenuBar::HandleMenuHighlightEvent( Menu *pMenu, sal_uInt16 nHighlightEventI
return false;
}
-bool MenuBar::HandleMenuCommandEvent( Menu *pMenu, sal_uInt16 nCommandEventId ) const
+bool Menu::HandleMenuCommandEvent( Menu *pMenu, sal_uInt16 nCommandEventId ) const
{
if( !pMenu )
- pMenu = const_cast<MenuBar*>(this)->ImplFindMenu(nCommandEventId);
+ pMenu = const_cast<Menu*>(this)->ImplFindMenu(nCommandEventId);
if( pMenu )
{
pMenu->nSelectedId = nCommandEventId;
- pMenu->pStartedFrom = const_cast<MenuBar*>(this);
+ pMenu->pStartedFrom = const_cast<Menu*>(this);
pMenu->ImplSelect();
return true;
}
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 507d529..9b590dd 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -654,11 +654,10 @@ void GtkSalMenu::DispatchCommand( gint itemId, const gchar *aCommand )
GtkSalMenu* pSalSubMenu = GetMenuForItemCommand( const_cast<gchar*>(aCommand), nDupsToSkip, FALSE );
Menu* pSubMenu = ( pSalSubMenu != nullptr ) ? pSalSubMenu->GetMenu() : nullptr;
- MenuBar* pMenuBar = static_cast< MenuBar* >( mpVCLMenu );
- pMenuBar->HandleMenuCommandEvent( pSubMenu, itemId );
+ mpVCLMenu->HandleMenuCommandEvent( pSubMenu, itemId );
}
-void GtkSalMenu::ActivateAllSubmenus(MenuBar* pMenuBar)
+void GtkSalMenu::ActivateAllSubmenus(Menu* pMenuBar)
{
pMenuBar->HandleMenuActivateEvent(mpVCLMenu);
pMenuBar->HandleMenuDeActivateEvent(mpVCLMenu);
@@ -679,17 +678,16 @@ void GtkSalMenu::Activate( const gchar* aMenuCommand )
return;
if ( !aMenuCommand ) {
- ActivateAllSubmenus( static_cast< MenuBar* >( mpVCLMenu ) );
+ ActivateAllSubmenus(mpVCLMenu);
return;
}
int nDupsToSkip;
aMenuCommand = DetermineDupIndex(aMenuCommand, nDupsToSkip);
GtkSalMenu* pSalSubMenu = GetMenuForItemCommand( const_cast<gchar*>(aMenuCommand), nDupsToSkip, TRUE );
if ( pSalSubMenu != nullptr ) {
- MenuBar* pMenuBar = static_cast< MenuBar* >( mpVCLMenu );
- pMenuBar->HandleMenuActivateEvent( pSalSubMenu->mpVCLMenu );
+ mpVCLMenu->HandleMenuActivateEvent( pSalSubMenu->mpVCLMenu );
pSalSubMenu->Update();
}
}
@@ -702,8 +700,7 @@ void GtkSalMenu::Deactivate( const gchar* aMenuCommand )
GtkSalMenu* pSalSubMenu = GetMenuForItemCommand( const_cast<gchar*>(aMenuCommand), nDupsToSkip, TRUE );
if ( pSalSubMenu != nullptr ) {
- MenuBar* pMenuBar = static_cast< MenuBar* >( mpVCLMenu );
- pMenuBar->HandleMenuDeActivateEvent( pSalSubMenu->mpVCLMenu );
+ mpVCLMenu->HandleMenuDeActivateEvent( pSalSubMenu->mpVCLMenu );
}
}
--
2.5.0

@ -1,156 +0,0 @@
From 57c439a15e151fa9f7c298ceb15165749958c53c Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Tue, 8 Mar 2016 06:06:36 +0100
Subject: [PATCH 2/4] reduce copypasta
Change-Id: I5303caf69128a0a6d28fccfcf2ab63ed466e3853
---
RepositoryExternal.mk | 81 +++++++++++++--------------------------------------
1 file changed, 21 insertions(+), 60 deletions(-)
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index c8aab64..58f924d 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -617,7 +617,7 @@ endif # SYSTEM_HUNSPELL
ifneq ($(SYSTEM_BOOST),)
-define gb_LinkTarget__use_boostdatetime
+define gb_LinkTarget__use_boost_lib
$(call gb_LinkTarget_set_include,$(1),\
$$(INCLUDE) \
$(BOOST_CPPFLAGS) \
@@ -627,43 +627,24 @@ $(call gb_LinkTarget_add_ldflags,$(1),\
$(BOOST_LDFLAGS) \
)
-$(call gb_LinkTarget_add_libs,$(1),\
- $(BOOST_DATE_TIME_LIB) \
-)
+$(call gb_LinkTarget_add_libs,$(1),$(2))
endef
-define gb_LinkTarget__use_boost_iostreams
-$(call gb_LinkTarget_set_include,$(1),\
- $$(INCLUDE) \
- $(BOOST_CPPFLAGS) \
-)
+define gb_LinkTarget__use_boostdatetime
+$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_DATE_TIME_LIB))
-$(call gb_LinkTarget_add_ldflags,$(1),\
- $(BOOST_LDFLAGS) \
-)
+endef
-$(call gb_LinkTarget_add_libs,$(1),\
- $(BOOST_IOSTREAMS_LIB) \
-)
+define gb_LinkTarget__use_boost_iostreams
+$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_IOSTREAMS_LIB))
endef
gb_ExternalProject__use_boost_iostreams :=
define gb_LinkTarget__use_boost_system
-$(call gb_LinkTarget_set_include,$(1),\
- $$(INCLUDE) \
- $(BOOST_CPPFLAGS) \
-)
-
-$(call gb_LinkTarget_add_ldflags,$(1),\
- $(BOOST_LDFLAGS) \
-)
-
-$(call gb_LinkTarget_add_libs,$(1),\
- $(BOOST_SYSTEM_LIB) \
-)
+$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_SYSTEM_LIB))
endef
@@ -681,37 +662,29 @@ gb_ExternalProject__use_boost_headers:=
else # !SYSTEM_BOOST
-ifeq ($(OS),WNT)
-define gb_LinkTarget__use_boostthread
+define gb_LinkTarget__use_boost_lib
$(call gb_LinkTarget_add_defs,$(1),\
-DBOOST_ALL_NO_LIB \
)
-$(call gb_LinkTarget_use_static_libraries,$(1),\
- boostthread \
-)
+$(call gb_LinkTarget_use_static_libraries,$(1),$(2))
+
+endef
+
+ifeq ($(OS),WNT)
+define gb_LinkTarget__use_boostthread
+$(call gb_LinkTarget__use_boost_lib,$(1),boostthread)
+
endef
endif
define gb_LinkTarget__use_boostdatetime
-$(call gb_LinkTarget_add_defs,$(1),\
- -DBOOST_ALL_NO_LIB \
-)
-
-$(call gb_LinkTarget_use_static_libraries,$(1),\
- boostdatetime \
-)
+$(call gb_LinkTarget__use_boost_lib,$(1),boostdatetime)
endef
define gb_LinkTarget__use_boost_filesystem
-$(call gb_LinkTarget_add_defs,$(1),\
- -DBOOST_ALL_NO_LIB \
-)
-
-$(call gb_LinkTarget_use_static_libraries,$(1),\
- boost_filesystem \
-)
+$(call gb_LinkTarget__use_boost_lib,$(1),boost_filesystem)
endef
@@ -720,13 +693,7 @@ $(call gb_ExternalProject_use_static_libraries,$(1),boost_filesystem)
endef
define gb_LinkTarget__use_boost_iostreams
-$(call gb_LinkTarget_add_defs,$(1),\
- -DBOOST_ALL_NO_LIB \
-)
-
-$(call gb_LinkTarget_use_static_libraries,$(1),\
- boost_iostreams \
-)
+$(call gb_LinkTarget__use_boost_lib,$(1),boost_iostreams)
endef
@@ -735,13 +702,7 @@ $(call gb_ExternalProject_use_static_libraries,$(1),boost_iostreams)
endef
define gb_LinkTarget__use_boost_system
-$(call gb_LinkTarget_add_defs,$(1),\
- -DBOOST_ALL_NO_LIB \
-)
-
-$(call gb_LinkTarget_use_static_libraries,$(1),\
- boost_system \
-)
+$(call gb_LinkTarget__use_boost_lib,$(1),boost_system)
endef
--
2.5.0

@ -1,164 +0,0 @@
From ed41a33ca22f46b123df4132d376247682af07af Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Tue, 8 Mar 2016 06:23:24 +0100
Subject: [PATCH 3/4] detect Boost.Filesystem
Change-Id: I86c268f49f44bd1e208a9de781a16bf19450c64c
---
config_host.mk.in | 1 +
configure.ac | 1 +
m4/ax_boost_filesystem.m4 | 118 ++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 120 insertions(+)
create mode 100644 m4/ax_boost_filesystem.m4
diff --git a/config_host.mk.in b/config_host.mk.in
index 89081ca..0a2ec0b 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -37,6 +37,7 @@ export BARCODE_EXTENSION_PACK=@BARCODE_EXTENSION_PACK@
export BOOST_CPPFLAGS=@BOOST_CPPFLAGS@
export BOOST_CXXFLAGS=@BOOST_CXXFLAGS@
export BOOST_DATE_TIME_LIB=@BOOST_DATE_TIME_LIB@
+export BOOST_FILESYSTEM_LIB=@BOOST_FILESYSTEM_LIB@
export BOOST_IOSTREAMS_LIB=@BOOST_IOSTREAMS_LIB@
export BOOST_LDFLAGS=@BOOST_LDFLAGS@
export BOOST_SYSTEM_LIB=@BOOST_SYSTEM_LIB@
diff --git a/configure.ac b/configure.ac
index dab1919..7b5cedd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8836,6 +8836,7 @@ if test "$with_system_boost" = "yes"; then
SYSTEM_BOOST=TRUE
AX_BOOST_BASE(1.47)
AX_BOOST_DATE_TIME
+ AX_BOOST_FILESYSTEM
AX_BOOST_IOSTREAMS
mingw_boost_date_time_dll=`echo $BOOST_DATE_TIME_LIB | sed -e 's/^-l//' -e 's/\.dll$//'`
libo_MINGW_TRY_DLL([$mingw_boost_date_time_dll])
diff --git a/m4/ax_boost_filesystem.m4 b/m4/ax_boost_filesystem.m4
new file mode 100644
index 0000000..f162163
--- /dev/null
+++ b/m4/ax_boost_filesystem.m4
@@ -0,0 +1,118 @@
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_boost_filesystem.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_BOOST_FILESYSTEM
+#
+# DESCRIPTION
+#
+# Test for Filesystem library from the Boost C++ libraries. The macro
+# requires a preceding call to AX_BOOST_BASE. Further documentation is
+# available at <http://randspringer.de/boost/index.html>.
+#
+# This macro calls:
+#
+# AC_SUBST(BOOST_FILESYSTEM_LIB)
+#
+# And sets:
+#
+# HAVE_BOOST_FILESYSTEM
+#
+# LICENSE
+#
+# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
+# Copyright (c) 2009 Michael Tindal
+# Copyright (c) 2009 Roman Rybalko <libtorrent@romanr.info>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 26
+
+AC_DEFUN([AX_BOOST_FILESYSTEM],
+[
+ AC_ARG_WITH([boost-filesystem],
+ AS_HELP_STRING([--with-boost-filesystem@<:@=special-lib@:>@],
+ [use the Filesystem library from boost - it is possible to specify a certain library for the linker
+ e.g. --with-boost-filesystem=boost_filesystem-gcc-mt ]),
+ [
+ if test "$withval" = "no"; then
+ want_boost="no"
+ elif test "$withval" = "yes"; then
+ want_boost="yes"
+ ax_boost_user_filesystem_lib=""
+ else
+ want_boost="yes"
+ ax_boost_user_filesystem_lib="$withval"
+ fi
+ ],
+ [want_boost="yes"]
+ )
+
+ if test "x$want_boost" = "xyes"; then
+ AC_REQUIRE([AC_PROG_CC])
+ CPPFLAGS_SAVED="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ export CPPFLAGS
+
+ LDFLAGS_SAVED="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
+ export LDFLAGS
+
+ LIBS_SAVED=$LIBS
+ LIBS="$LIBS $BOOST_SYSTEM_LIB"
+ export LIBS
+
+ AC_CACHE_CHECK(whether the Boost::Filesystem library is available,
+ ax_cv_boost_filesystem,
+ [AC_LANG_PUSH([C++])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/filesystem/path.hpp>]],
+ [[using namespace boost::filesystem;
+ path my_path( "foo/bar/data.txt" );
+ return 0;]])],
+ ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no)
+ AC_LANG_POP([C++])
+ ])
+ if test "x$ax_cv_boost_filesystem" = "xyes"; then
+ AC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available])
+ BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
+ if test "x$ax_boost_user_filesystem_lib" = "x"; then
+ for libextension in `ls -r $BOOSTLIBDIR/libboost_filesystem* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
+ [link_filesystem="no"])
+ done
+ if test "x$link_filesystem" != "xyes"; then
+ for libextension in `ls -r $BOOSTLIBDIR/boost_filesystem* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do
+ ax_lib=${libextension}
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
+ [link_filesystem="no"])
+ done
+ fi
+ else
+ for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; do
+ AC_CHECK_LIB($ax_lib, exit,
+ [BOOST_FILESYSTEM_LIB="-l$ax_lib"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem="yes"; break],
+ [link_filesystem="no"])
+ done
+
+ fi
+ if test "x$ax_lib" = "x"; then
+ AC_MSG_ERROR(Could not find a version of the library!)
+ fi
+ if test "x$link_filesystem" != "xyes"; then
+ AC_MSG_ERROR(Could not link against $ax_lib !)
+ fi
+ fi
+
+ CPPFLAGS="$CPPFLAGS_SAVED"
+ LDFLAGS="$LDFLAGS_SAVED"
+ LIBS="$LIBS_SAVED"
+ fi
+])
--
2.5.0

@ -1,81 +0,0 @@
From 67d1d0061c1cf5bb8aba0de75776435150c8559e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Tue, 23 Feb 2016 14:42:29 +0000
Subject: [PATCH 3/8] gtk3: vcl popups flush any unexecuted Select events on
popdown
so if the gtksalmenu integration wants to drive popups by setting a selection
on the vcl popup, then the same flush is needed after ShowNativePopupMenu
(cherry picked from commit 3cb62eacae001df546c2a8f39ae4d37c33791d0b)
Change-Id: I59be60de5742d1e382cabefcbf0d8cdd5fc30b00
---
include/vcl/menu.hxx | 1 +
vcl/source/window/menu.cxx | 24 +++++++++++++++---------
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index 1dbd85e..f10141b 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -515,6 +515,7 @@ private:
protected:
SAL_DLLPRIVATE sal_uInt16 ImplExecute( vcl::Window* pWindow, const Rectangle& rRect, FloatWinPopupFlags nPopupFlags, Menu* pStaredFrom, bool bPreSelectFirst );
+ SAL_DLLPRIVATE void ImplFlushPendingSelect();
SAL_DLLPRIVATE long ImplCalcHeight( sal_uInt16 nEntries ) const;
SAL_DLLPRIVATE sal_uInt16 ImplCalcVisEntries( long nMaxHeight, sal_uInt16 nStartEntry = 0, sal_uInt16* pLastVisible = nullptr ) const;
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 999085e..b753fac 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2933,6 +2933,19 @@ sal_uInt16 PopupMenu::Execute( vcl::Window* pExecWindow, const Rectangle& rRect,
return ImplExecute( pExecWindow, rRect, nPopupModeFlags, nullptr, false );
}
+void PopupMenu::ImplFlushPendingSelect()
+{
+ // is there still Select?
+ Menu* pSelect = ImplFindSelectMenu();
+ if (pSelect)
+ {
+ // Select should be called prior to leaving execute in a popup menu!
+ Application::RemoveUserEvent( pSelect->nEventId );
+ pSelect->nEventId = nullptr;
+ pSelect->Select();
+ }
+}
+
sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, bool bPreSelectFirst )
{
if ( !pSFrom && ( PopupMenu::IsInExecute() || !GetItemCount() ) )
@@ -3097,6 +3110,7 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, Floa
SalMenu* pMenu = ImplGetSalMenu();
if( pMenu && bRealExecute && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FloatWinPopupFlags::GrabFocus ) )
{
+ ImplFlushPendingSelect();
pWin->StopExecute();
pWin->doShutdown();
pWindow->doLazyDelete();
@@ -3180,15 +3194,7 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, Floa
pWindow->doLazyDelete();
pWindow = nullptr;
- // is there still Select?
- Menu* pSelect = ImplFindSelectMenu();
- if ( pSelect )
- {
- // Select should be called prior to leaving execute in a popup menu!
- Application::RemoveUserEvent( pSelect->nEventId );
- pSelect->nEventId = nullptr;
- pSelect->Select();
- }
+ ImplFlushPendingSelect();
}
return bRealExecute ? nSelectedId : 0;
--
2.7.1

@ -1,56 +0,0 @@
From dab2582f05979cd99a5937cb95a387cfed70bb8d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Wed, 16 Dec 2015 14:18:11 +0000
Subject: [PATCH 3/3] gtk3+wayland: start floating windows hidden
once they are visible we can't move them under wayland, so
start then hidden, move them and then show
these floating windows are very delicate.
Change-Id: Ia233c23f25cec453df79ef70cab6210dbdd280a0
---
sfx2/uiconfig/ui/floatingrecord.ui | 1 -
svx/uiconfig/ui/colorwindow.ui | 1 -
svx/uiconfig/ui/floatingundoredo.ui | 1 -
3 files changed, 3 deletions(-)
diff --git a/sfx2/uiconfig/ui/floatingrecord.ui b/sfx2/uiconfig/ui/floatingrecord.ui
index 653867a..9136b38 100644
--- a/sfx2/uiconfig/ui/floatingrecord.ui
+++ b/sfx2/uiconfig/ui/floatingrecord.ui
@@ -3,7 +3,6 @@
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkWindow" id="FloatingRecord">
- <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="border_width">6</property>
diff --git a/svx/uiconfig/ui/colorwindow.ui b/svx/uiconfig/ui/colorwindow.ui
index 71cda63..9482562 100644
--- a/svx/uiconfig/ui/colorwindow.ui
+++ b/svx/uiconfig/ui/colorwindow.ui
@@ -17,7 +17,6 @@
<property name="icon_size">1</property>
</object>
<object class="GtkWindow" id="palette_popup_window">
- <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
diff --git a/svx/uiconfig/ui/floatingundoredo.ui b/svx/uiconfig/ui/floatingundoredo.ui
index 10491f8..66f30a6 100644
--- a/svx/uiconfig/ui/floatingundoredo.ui
+++ b/svx/uiconfig/ui/floatingundoredo.ui
@@ -3,7 +3,6 @@
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkWindow" id="FloatingUndoRedo:border">
- <property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
--
2.5.0

@ -1,31 +0,0 @@
From b4339fa7eee12f173b2273aed5dc6b8abae528f4 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Tue, 8 Mar 2016 06:08:36 +0100
Subject: [PATCH 4/4] define boost_filestystem external for system boost too
Change-Id: Ie9bfc6a5f3e1862acbd1bb08c6f2bb0b63f2587e
---
RepositoryExternal.mk | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 58f924d..ca7cdf8 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -636,6 +636,13 @@ $(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_DATE_TIME_LIB))
endef
+define gb_LinkTarget__use_boost_filesystem
+$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_FILESYSTEM_LIB))
+
+endef
+
+gb_ExternalProject__use_boost_filesystem :=
+
define gb_LinkTarget__use_boost_iostreams
$(call gb_LinkTarget__use_boost_lib,$(1),$(BOOST_IOSTREAMS_LIB))
--
2.5.0

@ -1,77 +0,0 @@
From 1d40ccd2f55173f954e596ce59bc4307eceae453 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Wed, 24 Feb 2016 10:40:10 +0000
Subject: [PATCH 4/8] gtk3: replace old action if same command is added
i.e. originally we preferred the old action, now
prefer the new action because e.g. wrap items in
writer only contain their "checkable" state on
their update
Change-Id: I6a6ce94126253396cc273834a7e8a4fb0a56921d
(cherry picked from commit 36bddcbaa2d1673c1331c788eae9534aca2c5ec3)
---
vcl/unx/gtk/gtksalmenu.cxx | 45 +++++++++++++++++++++++----------------------
1 file changed, 23 insertions(+), 22 deletions(-)
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 6887ade..a9a0932 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -530,30 +530,31 @@ void GtkSalMenu::NativeSetItemCommand( unsigned nSection,
GVariant *pTarget = nullptr;
- if ( g_action_group_has_action( mpActionGroup, aCommand ) == FALSE ) {
- if ( ( nBits & MenuItemBits::CHECKABLE ) || bIsSubmenu )
- {
- // Item is a checkmark button.
- GVariantType* pStateType = g_variant_type_new( reinterpret_cast<gchar const *>(G_VARIANT_TYPE_BOOLEAN) );
- GVariant* pState = g_variant_new_boolean( bChecked );
+ if (g_action_group_has_action(mpActionGroup, aCommand))
+ g_lo_action_group_remove(pActionGroup, aCommand);
- g_lo_action_group_insert_stateful( pActionGroup, aCommand, nId, bIsSubmenu, nullptr, pStateType, nullptr, pState );
- }
- else if ( nBits & MenuItemBits::RADIOCHECK )
- {
- // Item is a radio button.
- GVariantType* pParameterType = g_variant_type_new( reinterpret_cast<gchar const *>(G_VARIANT_TYPE_STRING) );
- GVariantType* pStateType = g_variant_type_new( reinterpret_cast<gchar const *>(G_VARIANT_TYPE_STRING) );
- GVariant* pState = g_variant_new_string( "" );
- pTarget = g_variant_new_string( aCommand );
+ if ( ( nBits & MenuItemBits::CHECKABLE ) || bIsSubmenu )
+ {
+ // Item is a checkmark button.
+ GVariantType* pStateType = g_variant_type_new( reinterpret_cast<gchar const *>(G_VARIANT_TYPE_BOOLEAN) );
+ GVariant* pState = g_variant_new_boolean( bChecked );
- g_lo_action_group_insert_stateful( pActionGroup, aCommand, nId, FALSE, pParameterType, pStateType, nullptr, pState );
- }
- else
- {
- // Item is not special, so insert a stateless action.
- g_lo_action_group_insert( pActionGroup, aCommand, nId, FALSE );
- }
+ g_lo_action_group_insert_stateful( pActionGroup, aCommand, nId, bIsSubmenu, nullptr, pStateType, nullptr, pState );
+ }
+ else if ( nBits & MenuItemBits::RADIOCHECK )
+ {
+ // Item is a radio button.
+ GVariantType* pParameterType = g_variant_type_new( reinterpret_cast<gchar const *>(G_VARIANT_TYPE_STRING) );
+ GVariantType* pStateType = g_variant_type_new( reinterpret_cast<gchar const *>(G_VARIANT_TYPE_STRING) );
+ GVariant* pState = g_variant_new_string( "" );
+ pTarget = g_variant_new_string( aCommand );
+
+ g_lo_action_group_insert_stateful( pActionGroup, aCommand, nId, FALSE, pParameterType, pStateType, nullptr, pState );
+ }
+ else
+ {
+ // Item is not special, so insert a stateless action.
+ g_lo_action_group_insert( pActionGroup, aCommand, nId, FALSE );
}
GLOMenu* pMenu = G_LO_MENU( mpMenuModel );
--
2.7.1

@ -1,32 +0,0 @@
From 33d05b5ca87d1ddb76fef373a92833d07c00cb15 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Wed, 24 Feb 2016 12:19:49 +0000
Subject: [PATCH 5/8] gtk3: handle items without commands
e.g. the draw/impress context menus. Handle these like
MenuManager::Activate does
Change-Id: I02a0e377a2d3a57ac7ac9239aaa75dbb856489d2
(cherry picked from commit b8ee342576b707dbffe877f5c225b640ee65276d)
---
vcl/unx/gtk/gtksalmenu.cxx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index a9a0932..346e42d 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -52,7 +52,9 @@ static gchar* GetCommandForItem( GtkSalMenuItem* pSalMenuItem, gchar* aCurrentCo
if ( !pMenu )
return nullptr;
- OUString aMenuCommand = pMenu->GetItemCommand( nId );
+ OUString aMenuCommand = pMenu->GetItemCommand(nId);
+ if (aMenuCommand.isEmpty())
+ aMenuCommand = "slot:" + OUString::number(nId);
gchar* aCommandStr = g_strdup( OUStringToOString( aMenuCommand, RTL_TEXTENCODING_UTF8 ).getStr() );
aCommand = g_strdup( aCommandStr );
--
2.7.1

@ -1,64 +0,0 @@
From 7dc5977edb7e34aed68aeb68846dee227f1a32de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Wed, 24 Feb 2016 13:02:40 +0000
Subject: [PATCH 6/8] mark checkable toolbox menu entries as checkable
e.g. the toplevel toolbars put excess entries in
menus. If the entry is not marked as checkable then
a native gtk menu entry will appear to be stateless
when it actually does have a toggle state
Change-Id: I7168b44d59fd64dfe264ed8ca26355252d697251
(cherry picked from commit 13917e0755bb864f22d0cf75a43854acbdb1eaec)
---
vcl/source/window/toolbox2.cxx | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 0c916f6..663b7d6 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1791,6 +1791,20 @@ bool ToolBox::ImplHasClippedItems()
return false;
}
+namespace
+{
+ MenuItemBits ConvertBitsFromToolBoxToMenu(ToolBoxItemBits nToolItemBits)
+ {
+ MenuItemBits nMenuItemBits = MenuItemBits::NONE;
+ if ((nToolItemBits & ToolBoxItemBits::CHECKABLE) ||
+ (nToolItemBits & ToolBoxItemBits::DROPDOWN))
+ {
+ nMenuItemBits |= MenuItemBits::CHECKABLE;
+ }
+ return nMenuItemBits;
+ }
+}
+
void ToolBox::UpdateCustomMenu()
{
// fill clipped items into menu
@@ -1826,7 +1840,8 @@ void ToolBox::UpdateCustomMenu()
if( it->IsClipped() )
{
sal_uInt16 id = it->mnId + TOOLBOX_MENUITEM_START;
- pMenu->InsertItem( id, it->maText, it->maImageOriginal, MenuItemBits::NONE, OString());
+ MenuItemBits nMenuItemBits = ConvertBitsFromToolBoxToMenu(it->mnBits);
+ pMenu->InsertItem( id, it->maText, it->maImageOriginal, nMenuItemBits, OString());
pMenu->SetItemCommand( id, it->maCommandStr );
pMenu->EnableItem( id, it->mbEnabled );
pMenu->CheckItem ( id, it->meState == TRISTATE_TRUE );
@@ -1843,7 +1858,8 @@ void ToolBox::UpdateCustomMenu()
if( it->IsItemHidden() )
{
sal_uInt16 id = it->mnId + TOOLBOX_MENUITEM_START;
- pMenu->InsertItem( id, it->maText, it->maImageOriginal, MenuItemBits::NONE, OString() );
+ MenuItemBits nMenuItemBits = ConvertBitsFromToolBoxToMenu(it->mnBits);
+ pMenu->InsertItem( id, it->maText, it->maImageOriginal, nMenuItemBits, OString() );
pMenu->SetItemCommand( id, it->maCommandStr );
pMenu->EnableItem( id, it->mbEnabled );
pMenu->CheckItem( id, it->meState == TRISTATE_TRUE );
--
2.7.1

@ -1,26 +0,0 @@
From 205dd9979f77c709cf36b92da1836ce5374879ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Wed, 24 Feb 2016 15:24:53 +0000
Subject: [PATCH 7/8] set gtk layout direction to match ours
Change-Id: I27610f28f42368355bef1b3461fc3ccea1b07218
(cherry picked from commit b50071c817657866f8b22873be26d34970005a2d)
---
vcl/unx/gtk/gtkdata.cxx | 1 +
1 file changed, 1 insertion(+)
diff --git a/vcl/unx/gtk/gtkdata.cxx b/vcl/unx/gtk/gtkdata.cxx
index 9ea6dc9..f15cce2 100644
--- a/vcl/unx/gtk/gtkdata.cxx
+++ b/vcl/unx/gtk/gtkdata.cxx
@@ -110,6 +110,7 @@ GtkSalDisplay::GtkSalDisplay( GdkDisplay* pDisplay ) :
#endif
#endif
+ gtk_widget_set_default_direction(AllSettings::GetLayoutRTL() ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
}
GtkSalDisplay::~GtkSalDisplay()
--
2.7.1

@ -1,552 +0,0 @@
From b265bcddde36bea2f5b31ce5df407301cbfe82b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Tue, 23 Feb 2016 15:57:11 +0000
Subject: [PATCH 8/8] gtk3: implement native context menus
This reuses lots of the unity machinery which is similar
to the mac concept of a single toplevel menubar.
So to drive popup menus, part of this is a rework that does away with the idea
that the "menubar" is the controller of the hierarchy, and instead the top
element becomes the controller
Change-Id: I4336391718844bc73cfc47c1043f99f0e3b812d8
(cherry picked from commit a0c700b1493c7b51540d1e77b44d1edd9bf920f0)
---
vcl/inc/unx/gtk/gloactiongroup.h | 3 +
vcl/inc/unx/gtk/gtksalmenu.hxx | 9 +-
vcl/unx/gtk/gloactiongroup.cxx | 43 ++++----
vcl/unx/gtk/gtksalmenu.cxx | 228 +++++++++++++++++++++++++++++----------
4 files changed, 203 insertions(+), 80 deletions(-)
diff --git a/vcl/inc/unx/gtk/gloactiongroup.h b/vcl/inc/unx/gtk/gloactiongroup.h
index 080b679..ec6bd39 100644
--- a/vcl/inc/unx/gtk/gloactiongroup.h
+++ b/vcl/inc/unx/gtk/gloactiongroup.h
@@ -46,6 +46,9 @@ GType g_lo_action_group_get_type (void) G_GNUC_CONST;
GLOActionGroup * g_lo_action_group_new (gpointer frame);
+void g_lo_action_group_set_top_menu (GLOActionGroup *group,
+ gpointer top_menu);
+
void g_lo_action_group_insert (GLOActionGroup *group,
const gchar *action_name,
gint item_id,
diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx
index 1d58b7a..d95d25c 100644
--- a/vcl/inc/unx/gtk/gtksalmenu.hxx
+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx
@@ -43,16 +43,17 @@ private:
std::vector< GtkSalMenuItem* > maItems;
bool mbMenuBar;
+ bool mbMenuVisibility;
Menu* mpVCLMenu;
GtkSalMenu* mpParentSalMenu;
- const GtkSalFrame* mpFrame;
+ GtkSalFrame* mpFrame;
// GMenuModel and GActionGroup attributes
GMenuModel* mpMenuModel;
GActionGroup* mpActionGroup;
GtkSalMenu* GetMenuForItemCommand( gchar* aCommand, int& rDupsToSkip, gboolean bGetSubmenu );
- void ImplUpdate( gboolean bRecurse );
+ void ImplUpdate(bool bRecurse, bool bRemoveDisabledEntries);
void ActivateAllSubmenus(Menu* pMenuBar);
public:
@@ -77,7 +78,7 @@ public:
void SetMenu( Menu* pMenu ) { mpVCLMenu = pMenu; }
Menu* GetMenu() { return mpVCLMenu; }
- void SetMenuModel( GMenuModel* pMenuModel ) { mpMenuModel = pMenuModel; }
+ void SetMenuModel(GMenuModel* pMenuModel);
unsigned GetItemCount() { return maItems.size(); }
GtkSalMenuItem* GetItemAtPos( unsigned nPos ) { return maItems[ nPos ]; }
void SetActionGroup( GActionGroup* pActionGroup ) { mpActionGroup = pActionGroup; }
@@ -102,6 +103,8 @@ public:
bool PrepUpdate();
virtual void Update() override; // Update this menu only.
void UpdateFull(); // Update full menu hierarchy from this menu.
+
+ virtual bool ShowNativePopupMenu(FloatingWindow * pWin, const Rectangle& rRect, FloatWinPopupFlags nFlags) override;
};
class GtkSalMenuItem : public SalMenuItem
diff --git a/vcl/unx/gtk/gloactiongroup.cxx b/vcl/unx/gtk/gloactiongroup.cxx
index e710809..110e0dc 100644
--- a/vcl/unx/gtk/gloactiongroup.cxx
+++ b/vcl/unx/gtk/gloactiongroup.cxx
@@ -100,8 +100,9 @@ g_lo_action_class_init (GLOActionClass *klass)
struct _GLOActionGroupPrivate
{
- GHashTable *table; /* string -> GLOAction */
- GtkSalFrame *frame; /* Frame to which GActionGroup is associated. */
+ GHashTable *table; /* string -> GLOAction */
+ GtkSalFrame *frame; /* Frame to which GActionGroup is associated. */
+ GtkSalMenu *topmenu; /* TopLevel Menu to which GActionGroup is associated. */
};
static void g_lo_action_group_iface_init (GActionGroupInterface *);
@@ -187,13 +188,7 @@ g_lo_action_group_perform_submenu_action (GLOActionGroup *group,
GVariant *state)
{
- GtkSalFrame* pFrame = group->priv->frame;
- SAL_INFO("vcl.unity", "g_lo_action_group_perform_submenu_action on " << group << " for frame " << pFrame);
-
- if (pFrame == nullptr)
- return;
-
- GtkSalMenu* pSalMenu = static_cast<GtkSalMenu*> (pFrame->GetMenu());
+ GtkSalMenu* pSalMenu = group->priv->topmenu;
SAL_INFO("vcl.unity", "g_lo_action_group_perform_submenu_action on " << group << " for menu " << pSalMenu);
if (pSalMenu != nullptr) {
@@ -263,23 +258,18 @@ g_lo_action_group_activate (GActionGroup *group,
GVariant *parameter)
{
GLOActionGroup *lo_group = G_LO_ACTION_GROUP (group);
- GtkSalFrame *pFrame = lo_group->priv->frame;
- SAL_INFO("vcl.unity", "g_lo_action_group_activate on group " << group << " for frame " << pFrame << " with parameter " << parameter);
+ GtkSalMenu* pSalMenu = lo_group->priv->topmenu;
if ( parameter != nullptr )
g_action_group_change_action_state( group, action_name, parameter );
- if ( pFrame != nullptr )
- {
- GtkSalMenu* pSalMenu = static_cast< GtkSalMenu* >( pFrame->GetMenu() );
- SAL_INFO("vcl.unity", "g_lo_action_group_activate for menu " << pSalMenu);
+ SAL_INFO("vcl.unity", "g_lo_action_group_activate for menu " << pSalMenu);
- if ( pSalMenu != nullptr )
- {
- GLOAction* action = G_LO_ACTION (g_hash_table_lookup (lo_group->priv->table, action_name));
- SAL_INFO("vcl.unity", "g_lo_action_group_activate dispatching action " << action << " named " << action_name << " on menu " << pSalMenu);
- pSalMenu->DispatchCommand( action->item_id, action_name );
- }
+ if ( pSalMenu != nullptr )
+ {
+ GLOAction* action = G_LO_ACTION (g_hash_table_lookup (lo_group->priv->table, action_name));
+ SAL_INFO("vcl.unity", "g_lo_action_group_activate dispatching action " << action << " named " << action_name << " on menu " << pSalMenu);
+ pSalMenu->DispatchCommand( action->item_id, action_name );
}
}
@@ -355,6 +345,17 @@ g_lo_action_group_init (GLOActionGroup *group)
group->priv->table = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, g_object_unref);
group->priv->frame = nullptr;
+ group->priv->topmenu = nullptr;
+}
+
+void
+g_lo_action_group_set_top_menu (GLOActionGroup *group,
+ gpointer top_menu)
+{
+ group->priv = G_TYPE_INSTANCE_GET_PRIVATE (group,
+ G_TYPE_LO_ACTION_GROUP,
+ GLOActionGroupPrivate);
+ group->priv->topmenu = static_cast<GtkSalMenu*>(top_menu);
}
static void
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 346e42d..7bc9232 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -16,6 +16,7 @@
#include <unx/gtk/gtkdata.hxx>
#include <unx/gtk/glomenu.h>
#include <unx/gtk/gloactiongroup.h>
+#include <vcl/floatwin.hxx>
#include <vcl/menu.hxx>
#include <unx/gtk/gtkinst.hxx>
@@ -24,6 +25,7 @@
#endif
#include <sal/log.hxx>
+#include <window.h>
// FIXME Copied from framework/inc/framework/menuconfiguration.hxx to
// avoid circular dependency between modules. It should be in a common
@@ -31,8 +33,6 @@
const sal_uInt16 START_ITEMID_WINDOWLIST = 4600;
const sal_uInt16 END_ITEMID_WINDOWLIST = 4699;
-static bool bMenuVisibility = false;
-
/*
* This function generates the proper command name for all actions, including
* duplicated or special ones.
@@ -77,20 +77,17 @@ static gchar* GetCommandForItem( GtkSalMenuItem* pSalMenuItem, gchar* aCurrentCo
bool GtkSalMenu::PrepUpdate()
{
- const GtkSalFrame* pFrame = GetFrame();
- if (pFrame)
- {
- GtkSalFrame* pNonConstFrame = const_cast<GtkSalFrame*>(pFrame);
- GtkSalMenu* pSalMenu = this;
-
- if ( !pNonConstFrame->GetMenu() )
- pNonConstFrame->SetMenu( pSalMenu );
+ bool bMenuVisibility;
- if ( bMenuVisibility && mpMenuModel && mpActionGroup )
- return true;
- }
+ //get top level visibility
+ const GtkSalMenu* pMenu = this;
+ do
+ {
+ bMenuVisibility = pMenu->mbMenuVisibility;
+ pMenu = pMenu->mpParentSalMenu;
+ } while (pMenu);
- return false;
+ return bMenuVisibility && mpMenuModel && mpActionGroup;
}
/*
@@ -114,14 +111,58 @@ void RemoveSpareItemsFromNativeMenu( GLOMenu* pMenu, GList** pOldCommandList, un
}
}
-void RemoveSpareSectionsFromNativeMenu( GLOMenu* pMenu, GList** pOldCommandList, unsigned nLastSection )
+void RemoveDisabledItemsFromNativeMenu(GLOMenu* pMenu, GList** pOldCommandList,
+ sal_Int32 nSection, GActionGroup* pActionGroup)
+{
+ while (nSection >= 0)
+ {
+ sal_Int32 nSectionItems = g_lo_menu_get_n_items_from_section( pMenu, nSection );
+ while (nSectionItems--)
+ {
+ gchar* pCommand = g_lo_menu_get_command_from_item_in_section(pMenu, nSection, nSectionItems);
+ // remove disabled entries
+ bool bRemove = g_action_group_get_action_enabled(pActionGroup, pCommand) == false;
+ if (!bRemove)
+ {
+ //also remove any empty submenus
+ GLOMenu* pSubMenuModel = g_lo_menu_get_submenu_from_item_in_section(pMenu, nSection, nSectionItems);
+ if (pSubMenuModel)
+ {
+ gint nSubMenuSections = g_menu_model_get_n_items(G_MENU_MODEL(pSubMenuModel));
+ bRemove = (nSubMenuSections == 0 ||
+ (nSubMenuSections == 1 && g_lo_menu_get_n_items_from_section(pSubMenuModel, 0) == 0));
+ }
+ }
+
+ if (bRemove)
+ {
+ //but tdf#86850 Always display clipboard functions
+ bRemove = g_strcmp0(pCommand, ".uno:Cut") &&
+ g_strcmp0(pCommand, ".uno:Copy") &&
+ g_strcmp0(pCommand, ".uno:Paste");
+ }
+
+ if (bRemove)
+ {
+ if (pCommand != nullptr && pOldCommandList != nullptr)
+ *pOldCommandList = g_list_append(*pOldCommandList, g_strdup(pCommand));
+ g_lo_menu_remove_from_section(pMenu, nSection, nSectionItems);
+ }
+
+ g_free(pCommand);
+ }
+ --nSection;
+ }
+}
+
+void RemoveSpareSectionsFromNativeMenu( GLOMenu* pMenu, GList** pOldCommandList, sal_Int32 nLastSection )
{
if ( pMenu == nullptr || pOldCommandList == nullptr )
return;
sal_Int32 n = g_menu_model_get_n_items( G_MENU_MODEL( pMenu ) ) - 1;
- for ( ; n > (sal_Int32) nLastSection; n-- )
+ for ( ; n > nLastSection; n--)
{
RemoveSpareItemsFromNativeMenu( pMenu, pOldCommandList, n, 0 );
g_lo_menu_remove( pMenu, n );
@@ -173,7 +214,7 @@ void RemoveUnusedCommands( GLOActionGroup* pActionGroup, GList* pOldCommandList,
}
}
-void GtkSalMenu::ImplUpdate( gboolean bRecurse )
+void GtkSalMenu::ImplUpdate(bool bRecurse, bool bRemoveDisabledEntries)
{
SolarMutexGuard aGuard;
@@ -277,7 +318,7 @@ void GtkSalMenu::ImplUpdate( gboolean bRecurse )
SAL_INFO("vcl.unity", "preparing submenu " << pSubMenuModel << " to menu model " << G_MENU_MODEL(pSubMenuModel) << " and action group " << G_ACTION_GROUP(pActionGroup));
pSubmenu->SetMenuModel( G_MENU_MODEL( pSubMenuModel ) );
pSubmenu->SetActionGroup( G_ACTION_GROUP( pActionGroup ) );
- pSubmenu->ImplUpdate( bRecurse );
+ pSubmenu->ImplUpdate(bRecurse, bRemoveDisabledEntries);
}
}
@@ -287,6 +328,12 @@ void GtkSalMenu::ImplUpdate( gboolean bRecurse )
++validItems;
}
+ if (bRemoveDisabledEntries)
+ {
+ // Delete disabled items in last section.
+ RemoveDisabledItemsFromNativeMenu(pLOMenu, &pOldCommandList, nSection, G_ACTION_GROUP(pActionGroup));
+ }
+
// Delete extra items in last section.
RemoveSpareItemsFromNativeMenu( pLOMenu, &pOldCommandList, nSection, validItems );
@@ -299,12 +346,89 @@ void GtkSalMenu::ImplUpdate( gboolean bRecurse )
void GtkSalMenu::Update()
{
- ImplUpdate( FALSE );
+ //find out if top level is a menubar or not, if not, then its a popup menu
+ //hierarchy and in those we hide (most) disabled entries
+ const GtkSalMenu* pMenu = this;
+ while (pMenu->mpParentSalMenu)
+ pMenu = pMenu->mpParentSalMenu;
+ ImplUpdate(false, !pMenu->mbMenuBar);
}
void GtkSalMenu::UpdateFull()
{
- ImplUpdate( TRUE );
+ //find out if top level is a menubar or not, if not, then its a popup menu
+ //hierarchy and in those we hide (most) disabled entries
+ const GtkSalMenu* pMenu = this;
+ while (pMenu->mpParentSalMenu)
+ pMenu = pMenu->mpParentSalMenu;
+ ImplUpdate(true, !pMenu->mbMenuBar);
+}
+
+bool GtkSalMenu::ShowNativePopupMenu(FloatingWindow* pWin, const Rectangle& /*rRect*/,
+ FloatWinPopupFlags /*nFlags*/)
+{
+#if GTK_CHECK_VERSION(3,0,0)
+ guint nButton;
+ guint32 nTime;
+
+ //typically there is an event, and we can then distinguish if this was
+ //launched from the keyboard (gets auto-mnemoniced) or the mouse (which
+ //doesn't)
+ GdkEvent *pEvent = gtk_get_current_event();
+ if (pEvent)
+ {
+ gdk_event_get_button(pEvent, &nButton);
+ nTime = gdk_event_get_time(pEvent);
+ }
+ else
+ {
+ nButton = 0;
+ nTime = gtk_get_current_event_time();
+ }
+
+ Display(true);
+
+ mpFrame = static_cast<GtkSalFrame*>(pWin->ImplGetWindowImpl()->mpRealParent->ImplGetFrame());
+
+ GLOActionGroup* pActionGroup = g_lo_action_group_new(static_cast<gpointer>(mpFrame));
+ g_lo_action_group_set_top_menu(pActionGroup, static_cast<gpointer>(this));
+
+ mpActionGroup = G_ACTION_GROUP(pActionGroup);
+ mpMenuModel = G_MENU_MODEL(g_lo_menu_new());
+ // Generate the main menu structure, populates mpMenuModel
+ UpdateFull();
+
+ GtkWidget *pWidget = gtk_menu_new_from_model(mpMenuModel);
+ gtk_menu_attach_to_widget(GTK_MENU(pWidget), mpFrame->getMouseEventWidget(), nullptr);
+
+ gtk_widget_insert_action_group(mpFrame->getMouseEventWidget(), "win", mpActionGroup);
+
+ //run in a sub main loop because we need to keep vcl PopupMenu alive to use
+ //it during DispatchCommand, returning now to the outer loop causes the
+ //launching PopupMenu to be destroyed, instead run the subloop here
+ //until the gtk menu is destroyed
+ GMainLoop* pLoop = g_main_loop_new(nullptr, true);
+ g_signal_connect_swapped(G_OBJECT(pWidget), "deactivate", G_CALLBACK(g_main_loop_quit), pLoop);
+ gtk_menu_popup(GTK_MENU(pWidget), nullptr, nullptr, nullptr, nullptr, nButton, nTime);
+ if (g_main_loop_is_running(pLoop))
+ {
+ gdk_threads_leave();
+ g_main_loop_run(pLoop);
+ gdk_threads_enter();
+ }
+ g_main_loop_unref(pLoop);
+
+ gtk_widget_insert_action_group(mpFrame->getMouseEventWidget(), "win", nullptr);
+
+ gtk_widget_destroy(pWidget);
+
+ g_object_unref(mpActionGroup);
+
+ return true;
+#else
+ (void)pWin;
+ return false;
+#endif
}
/*
@@ -313,6 +437,7 @@ void GtkSalMenu::UpdateFull()
GtkSalMenu::GtkSalMenu( bool bMenuBar ) :
mbMenuBar( bMenuBar ),
+ mbMenuVisibility( false ),
mpVCLMenu( nullptr ),
mpParentSalMenu( nullptr ),
mpFrame( nullptr ),
@@ -321,25 +446,28 @@ GtkSalMenu::GtkSalMenu( bool bMenuBar ) :
{
}
+void GtkSalMenu::SetMenuModel(GMenuModel* pMenuModel)
+{
+ if (mpMenuModel)
+ g_object_unref(mpMenuModel);
+ mpMenuModel = pMenuModel;
+ if (mpMenuModel)
+ g_object_ref(mpMenuModel);
+}
+
GtkSalMenu::~GtkSalMenu()
{
SolarMutexGuard aGuard;
- if ( mbMenuBar )
- {
- if ( mpMenuModel )
- {
-// g_lo_menu_remove( G_LO_MENU( mpMenuModel ), 0 );
- g_object_unref( mpMenuModel );
- }
- }
+ if (mpMenuModel)
+ g_object_unref(mpMenuModel);
maItems.clear();
}
bool GtkSalMenu::VisibleMenuBar()
{
- return bMenuVisibility;
+ return mbMenuBar && mbMenuVisibility;
}
void GtkSalMenu::InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos )
@@ -374,22 +502,21 @@ void GtkSalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsig
pItem->mpSubMenu = pGtkSubMenu;
}
-void GtkSalMenu::SetFrame( const SalFrame* pFrame )
+void GtkSalMenu::SetFrame(const SalFrame* pFrame)
{
SolarMutexGuard aGuard;
assert(mbMenuBar);
SAL_INFO("vcl.unity", "GtkSalMenu set to frame");
- mpFrame = static_cast< const GtkSalFrame* >( pFrame );
- GtkSalFrame* pFrameNonConst = const_cast<GtkSalFrame*>(mpFrame);
+ mpFrame = const_cast<GtkSalFrame*>(static_cast<const GtkSalFrame*>(pFrame));
// if we had a menu on the GtkSalMenu we have to free it as we generate a
// full menu anyway and we might need to reuse an existing model and
// actiongroup
- pFrameNonConst->SetMenu( this );
- pFrameNonConst->EnsureAppMenuWatch();
+ mpFrame->SetMenu( this );
+ mpFrame->EnsureAppMenuWatch();
// Clean menu model and action group if needed.
- GtkWidget* pWidget = pFrameNonConst->getWindow();
+ GtkWidget* pWidget = mpFrame->getWindow();
GdkWindow* gdkWindow = gtk_widget_get_window( pWidget );
GLOMenu* pMenuModel = G_LO_MENU( g_object_get_data( G_OBJECT( gdkWindow ), "g-lo-menubar" ) );
@@ -407,11 +534,12 @@ void GtkSalMenu::SetFrame( const SalFrame* pFrame )
if ( pActionGroup )
{
g_lo_action_group_clear( pActionGroup );
+ g_lo_action_group_set_top_menu(pActionGroup, static_cast<gpointer>(this));
mpActionGroup = G_ACTION_GROUP( pActionGroup );
}
// Generate the main menu structure.
- if (bMenuVisibility)
+ if (mbMenuVisibility)
UpdateFull();
g_lo_menu_insert_section( pMenuModel, 0, nullptr, mpMenuModel );
@@ -618,16 +746,11 @@ GtkSalMenu* GtkSalMenu::GetMenuForItemCommand( gchar* aCommand, gboolean bGetSub
void GtkSalMenu::DispatchCommand( gint itemId, const gchar *aCommand )
{
SolarMutexGuard aGuard;
- // Only the menubar is allowed to dispatch commands.
- if ( !mbMenuBar )
- return;
-
int nDupsToSkip;
aCommand = DetermineDupIndex(aCommand, nDupsToSkip);
GtkSalMenu* pSalSubMenu = GetMenuForItemCommand( const_cast<gchar*>(aCommand), nDupsToSkip, FALSE );
Menu* pSubMenu = ( pSalSubMenu != nullptr ) ? pSalSubMenu->GetMenu() : nullptr;
-
- mpVCLMenu->HandleMenuCommandEvent( pSubMenu, itemId );
+ mpVCLMenu->HandleMenuCommandEvent(pSubMenu, itemId);
}
void GtkSalMenu::ActivateAllSubmenus(Menu* pMenuBar)
@@ -645,9 +768,6 @@ void GtkSalMenu::ActivateAllSubmenus(Menu* pMenuBar)
void GtkSalMenu::Activate( const gchar* aMenuCommand )
{
- if ( !mbMenuBar )
- return;
-
if ( !aMenuCommand ) {
ActivateAllSubmenus(mpVCLMenu);
return;
@@ -663,9 +783,6 @@ void GtkSalMenu::Activate( const gchar* aMenuCommand )
void GtkSalMenu::Deactivate( const gchar* aMenuCommand )
{
- if ( !mbMenuBar )
- return;
-
int nDupsToSkip;
aMenuCommand = DetermineDupIndex(aMenuCommand, nDupsToSkip);
GtkSalMenu* pSalSubMenu = GetMenuForItemCommand( const_cast<gchar*>(aMenuCommand), nDupsToSkip, TRUE );
@@ -675,15 +792,14 @@ void GtkSalMenu::Deactivate( const gchar* aMenuCommand )
void GtkSalMenu::Display( bool bVisible )
{
- if ( !mbMenuBar || mpVCLMenu == nullptr )
- return;
+ mbMenuVisibility = bVisible;
- bMenuVisibility = bVisible;
-
- bool bVCLMenuVisible = !bVisible;
-
- MenuBar* pMenuBar = static_cast< MenuBar* >( mpVCLMenu );
- pMenuBar->SetDisplayable( bVCLMenuVisible );
+ if (mbMenuBar)
+ {
+ bool bVCLMenuVisible = !bVisible;
+ MenuBar* pMenuBar = static_cast<MenuBar*>(mpVCLMenu);
+ pMenuBar->SetDisplayable(bVCLMenuVisible);
+ }
}
bool GtkSalMenu::IsItemVisible( unsigned nPos )
--
2.7.1

@ -1,9 +1,9 @@
# download path contains version without the last (fourth) digit # download path contains version without the last (fourth) digit
%define libo_version 5.1.3 %define libo_version 5.2.0
# Should contain .alphaX / .betaX, if this is pre-release (actually # Should contain .alphaX / .betaX, if this is pre-release (actually
# pre-RC) version. The pre-release string is part of tarball file names, # pre-RC) version. The pre-release string is part of tarball file names,
# so we need a way to define it easily at one place. # so we need a way to define it easily at one place.
%define libo_prerelease %{nil} %define libo_prerelease .alpha1
# Should contain any suffix of release tarball name, e.g., -buildfix1. # Should contain any suffix of release tarball name, e.g., -buildfix1.
%define libo_buildfix %{nil} %define libo_buildfix %{nil}
# rhbz#715152 state vendor # rhbz#715152 state vendor
@ -57,7 +57,7 @@
Summary: Free Software Productivity Suite Summary: Free Software Productivity Suite
Name: libreoffice Name: libreoffice
Epoch: 1 Epoch: 1
Version: %{libo_version}.1 Version: %{libo_version}.0
Release: 1%{?libo_prerelease}%{?dist} Release: 1%{?libo_prerelease}%{?dist}
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0 and CC0 License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0 and CC0
URL: http://www.libreoffice.org/ URL: http://www.libreoffice.org/
@ -68,7 +68,7 @@ Source2: %{source_url}/libreoffice-translations-%{version}%{?libo_prerele
Source3: http://dev-www.libreoffice.org/extern/185d60944ea767075d27247c3162b3bc-unowinreg.dll Source3: http://dev-www.libreoffice.org/extern/185d60944ea767075d27247c3162b3bc-unowinreg.dll
Source4: libreoffice-multiliblauncher.sh Source4: libreoffice-multiliblauncher.sh
Source5: %{external_url}/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip Source5: %{external_url}/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip
Source6: %{external_url}/1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz Source6: %{external_url}/ce12af00283eb90d9281956524250d6e-xmlsec1-1.2.20.tar.gz
Source7: %{external_url}/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip Source7: %{external_url}/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip
Source8: %{external_url}/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip Source8: %{external_url}/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip
#Unfortunately later versions of hsqldb changed the file format, so if we use a later version we loose #Unfortunately later versions of hsqldb changed the file format, so if we use a later version we loose
@ -239,36 +239,8 @@ Patch5: 0001-never-run-autogen.sh.patch
Patch6: 0001-add-X-TryExec-entries-to-desktop-files.patch Patch6: 0001-add-X-TryExec-entries-to-desktop-files.patch
# not upstreamed # not upstreamed
Patch7: 0001-disable-PSD-import-test-which-deadlocks-on-ARM.patch Patch7: 0001-disable-PSD-import-test-which-deadlocks-on-ARM.patch
Patch8: 0001-but-only-for-dialog.patch Patch8: 0001-hack-out-optimization-to-build.patch
Patch9: 0003-gtk3-wayland-start-floating-windows-hidden.patch Patch9: 0001-pass-original-CFLAGS.patch
Patch10: 0001-tdf-95450-avoid-double-swap-on-big-endian-arches.patch
Patch11: 0001-these-popups-should-start-invisible-and-take-default.patch
Patch12: 0002-disable-tearability-of-color-window.patch
Patch13: 0001-rhbz-1168757-propagate-selected-slides-to-print-dial.patch
Patch14: 0001-hack-out-optimization-to-build.patch
Patch15: 0001-generate-better-unit-test-assert-message.patch
Patch16: 0001-tdf-97665-Let-s-hope-that-over-activation-isn-t-real.patch
Patch17: 0002-gtk3-some-changes-towards-enabling-native-gtk3-popup.patch
Patch18: 0003-gtk3-vcl-popups-flush-any-unexecuted-Select-events-o.patch
Patch19: 0004-gtk3-replace-old-action-if-same-command-is-added.patch
Patch20: 0005-gtk3-handle-items-without-commands.patch
Patch21: 0006-mark-checkable-toolbox-menu-entries-as-checkable.patch
Patch22: 0007-set-gtk-layout-direction-to-match-ours.patch
Patch23: 0008-gtk3-implement-native-context-menus.patch
Patch24: 0001-Resolves-rhbz-1315385-use-preferred-size-if-widget-s.patch
Patch25: 0001-gtk3-various-bits-means-different-things-again.patch
Patch26: 0001-Resolves-tdf-98638-sometimes-menu-grab-doesn-t-take.patch
Patch27: 0001-Resolves-tdf-98636.patch
Patch28: 0001-tdf-39271-allow-to-export-only-notes-pages.patch
Patch29: 0001-Resolves-tdf-91778-drawing-the-background-over-an-ac.patch
%if ! 0%{?rhel}
Patch400: 0001-Update-liborcus-to-0.11.0.patch
Patch401: 0001-reorder.patch
Patch402: 0002-reduce-copypasta.patch
Patch403: 0003-detect-Boost.Filesystem.patch
Patch404: 0004-define-boost_filestystem-external-for-system-boost-t.patch
%endif
%if 0%{?rhel} %if 0%{?rhel}
# not upstreamed # not upstreamed
@ -1256,6 +1228,10 @@ rm -f %{buildroot}%{baseinstdir}/program/classes/sandbox.jar
#remove dummy .dat files #remove dummy .dat files
rm -f %{buildroot}%{baseinstdir}/program/root?.dat rm -f %{buildroot}%{baseinstdir}/program/root?.dat
# I don't think we need this...
rm -f %{buildroot}%{baseinstdir}/share/classification/example.xml
rmdir %{buildroot}%{baseinstdir}/share/classification
#set standard permissions for rpmlint #set standard permissions for rpmlint
find %{buildroot}%{baseinstdir} -exec chmod +w {} \; find %{buildroot}%{baseinstdir} -exec chmod +w {} \;
find %{buildroot}%{baseinstdir} -type d -exec chmod 0755 {} \; find %{buildroot}%{baseinstdir} -type d -exec chmod 0755 {} \;
@ -1496,12 +1472,10 @@ rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar
%{baseinstdir}/program/gdbtrace %{baseinstdir}/program/gdbtrace
%{baseinstdir}/program/gengal %{baseinstdir}/program/gengal
%{baseinstdir}/program/gengal.bin %{baseinstdir}/program/gengal.bin
%{baseinstdir}/program/gnome-open-url
%{baseinstdir}/program/libi18nsearchlo.so %{baseinstdir}/program/libi18nsearchlo.so
%{baseinstdir}/program/libldapbe2lo.so %{baseinstdir}/program/libldapbe2lo.so
%{baseinstdir}/program/libacclo.so %{baseinstdir}/program/libacclo.so
%{baseinstdir}/program/libavmedia*.so %{baseinstdir}/program/libavmedia*.so
%{baseinstdir}/program/libbasebmplo.so
%{baseinstdir}/program/libbasctllo.so %{baseinstdir}/program/libbasctllo.so
%{baseinstdir}/program/libbiblo.so %{baseinstdir}/program/libbiblo.so
%{baseinstdir}/program/libcached1.so %{baseinstdir}/program/libcached1.so
@ -1675,7 +1649,6 @@ rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar
%{baseinstdir}/program/opengl/textureFragmentShader.glsl %{baseinstdir}/program/opengl/textureFragmentShader.glsl
%{baseinstdir}/program/opengl/textureVertexShader.glsl %{baseinstdir}/program/opengl/textureVertexShader.glsl
%{baseinstdir}/program/opengl/transformedTextureVertexShader.glsl %{baseinstdir}/program/opengl/transformedTextureVertexShader.glsl
%{baseinstdir}/program/open-url
%{baseinstdir}/program/types/offapi.rdb %{baseinstdir}/program/types/offapi.rdb
%{baseinstdir}/program/libpasswordcontainerlo.so %{baseinstdir}/program/libpasswordcontainerlo.so
%{baseinstdir}/program/pagein-common %{baseinstdir}/program/pagein-common
@ -1717,6 +1690,7 @@ rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar
%{baseinstdir}/program/resource/uuien-US.res %{baseinstdir}/program/resource/uuien-US.res
%{baseinstdir}/program/resource/upden-US.res %{baseinstdir}/program/resource/upden-US.res
%{baseinstdir}/program/resource/vclen-US.res %{baseinstdir}/program/resource/vclen-US.res
%{baseinstdir}/program/resource/writerperfecten-US.res
%{baseinstdir}/program/resource/wzien-US.res %{baseinstdir}/program/resource/wzien-US.res
%{baseinstdir}/program/resource/xmlsecen-US.res %{baseinstdir}/program/resource/xmlsecen-US.res
%{baseinstdir}/program/resource/xsltdlgen-US.res %{baseinstdir}/program/resource/xsltdlgen-US.res
@ -2268,7 +2242,6 @@ done
%if 0%{?fedora} %if 0%{?fedora}
%files kde4 %files kde4
%{baseinstdir}/program/kde4-open-url
%{baseinstdir}/program/libkde4be1lo.so %{baseinstdir}/program/libkde4be1lo.so
%{baseinstdir}/program/libvclplug_kde4lo.so %{baseinstdir}/program/libvclplug_kde4lo.so
@ -2276,6 +2249,7 @@ done
%{baseinstdir}/program/libvclplug_gtk3lo.so %{baseinstdir}/program/libvclplug_gtk3lo.so
%files -n libreofficekit %files -n libreofficekit
%{baseinstdir}/share/libreofficekit
%{_libdir}/girepository-1.0/LOKDocView-%{girapiversion}.typelib %{_libdir}/girepository-1.0/LOKDocView-%{girapiversion}.typelib
%{_libdir}/liblibreofficekitgtk.so %{_libdir}/liblibreofficekitgtk.so
@ -2285,6 +2259,9 @@ done
%endif %endif
%changelog %changelog
* Fri Apr 22 2016 David Tardon <dtardon@redhat.com> - 1:5.2.0.0-1.alpha1
- update to 5.2.0 alpha1
* Thu Apr 21 2016 David Tardon <dtardon@redhat.com> - 1:5.1.3.1-1 * Thu Apr 21 2016 David Tardon <dtardon@redhat.com> - 1:5.1.3.1-1
- update to 5.1.3 rc1 - update to 5.1.3 rc1
- Resolves: tdf#91778 drawing the background over an active cursor - Resolves: tdf#91778 drawing the background over an active cursor

@ -3,10 +3,10 @@
17410483b5b5f267aa18b7e00b65e6e0 17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip 17410483b5b5f267aa18b7e00b65e6e0 17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip
185d60944ea767075d27247c3162b3bc 185d60944ea767075d27247c3162b3bc-unowinreg.dll 185d60944ea767075d27247c3162b3bc 185d60944ea767075d27247c3162b3bc-unowinreg.dll
a7983f859eafb2677d7ff386a023bc40 a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip a7983f859eafb2677d7ff386a023bc40 a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip
1f24ab1d39f4a51faf22244c94a6203f 1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz
0168229624cfac409e766913506961a8 0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz 0168229624cfac409e766913506961a8 0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz
12fb8b5b0d5132726e57b9b9fc7e22c4 libreoffice-multiliblauncher.sh 12fb8b5b0d5132726e57b9b9fc7e22c4 libreoffice-multiliblauncher.sh
4b87018f7fff1d054939d19920b751a0 4b87018f7fff1d054939d19920b751a0-collada2gltf-master-cb1d97788a.tar.bz2 4b87018f7fff1d054939d19920b751a0 4b87018f7fff1d054939d19920b751a0-collada2gltf-master-cb1d97788a.tar.bz2
19816183ae38a770d7bdefdb5e6b9e2a libreoffice-5.1.3.1.tar.xz ba58bf0be24ef20e3e77d19e595c5e3d libreoffice-5.2.0.0.alpha1.tar.xz
901d61d6e93cee2140af0869bef196de libreoffice-help-5.1.3.1.tar.xz 4d71c1d2d265a022eb522be9de7ef62e libreoffice-help-5.2.0.0.alpha1.tar.xz
1aac76707472700fcb32bd5cf33c3834 libreoffice-translations-5.1.3.1.tar.xz e5fac1dd61b67cbb0c38c427023a4907 libreoffice-translations-5.2.0.0.alpha1.tar.xz
ce12af00283eb90d9281956524250d6e ce12af00283eb90d9281956524250d6e-xmlsec1-1.2.20.tar.gz

Loading…
Cancel
Save