[Libreoffice-commits] core.git: 2 commits - include/sfx2 sw/source vcl/unx
Caolán McNamara
caolanm at redhat.com
Thu Apr 26 07:50:18 UTC 2018
include/sfx2/request.hxx | 4 ++--
sw/source/uibase/uno/unomodule.cxx | 8 ++++++++
vcl/unx/gtk3/gtk3gtkinst.cxx | 20 +++++++++++++++++++-
3 files changed, 29 insertions(+), 3 deletions(-)
New commits:
commit 653e58f9eb3d4ee61d8103993cdff2660c9127a5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Apr 25 12:33:55 2018 +0100
do something less pathetic for over-wide comboboxes
Change-Id: I1632bc84e2ef49b8ce3d3ab6d08ddc76879a2ab5
Reviewed-on: https://gerrit.libreoffice.org/53484
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 0c91ef79a646..e205e46c61d9 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3740,7 +3740,7 @@ private:
if (m_bPopupActive != bIsShown)
{
m_bPopupActive = bIsShown;
- //restore focus to the entry view the popup is gone, which
+ //restore focus to the entry view when the popup is gone, which
//is what the vcl case does, to ease the transition a little
gtk_widget_grab_focus(m_pWidget);
}
@@ -3830,6 +3830,13 @@ public:
, m_nChangedSignalId(g_signal_connect(m_pComboBoxText, "changed", G_CALLBACK(signalChanged), this))
, m_nPopupShownSignalId(g_signal_connect(m_pComboBoxText, "notify::popup-shown", G_CALLBACK(signalPopupShown), this))
{
+ // this bit isn't great, I really want to be able to ellipse the text in the comboboxtext itself and let
+ // the popup menu render them in full, in the interim allow the text to wrap in both cases
+ GList* cells = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(m_pComboBoxText));
+ GtkCellRenderer* cell = static_cast<GtkCellRenderer*>(cells->data);
+ g_object_set(G_OBJECT(cell), "wrap-width", 3, nullptr);
+ g_list_free(cells);
+
if (GtkEntry* pEntry = get_entry())
{
setup_completion(pEntry);
@@ -3858,6 +3865,17 @@ public:
enable_notify_events();
}
+ virtual void set_size_request(int nWidth, int nHeight) override
+ {
+ // tweak the cell render to get a narrower size to stick
+ GList* cells = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(m_pComboBoxText));
+ GtkCellRenderer* cell = static_cast<GtkCellRenderer*>(cells->data);
+ gtk_cell_renderer_set_fixed_size(cell, nWidth, -1);
+ g_list_free(cells);
+
+ gtk_widget_set_size_request(m_pWidget, nWidth, nHeight);
+ }
+
virtual void set_active(int pos) override
{
disable_notify_events();
commit 75d1929dc1e40e1570035066db428e6166ff32db
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Apr 25 14:15:50 2018 +0100
set current frame as default SfxRequest dialog parent
Change-Id: Ib7986ef786af3b5dd7fcad355976ee33705d3112
Reviewed-on: https://gerrit.libreoffice.org/53483
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/sfx2/request.hxx b/include/sfx2/request.hxx
index 60b5dfe4f8e7..27895abc6fe7 100644
--- a/include/sfx2/request.hxx
+++ b/include/sfx2/request.hxx
@@ -72,9 +72,9 @@ public:
sal_uInt16 GetSlot() const { return nSlot; }
void SetSlot(sal_uInt16 nNewSlot) { nSlot = nNewSlot; }
- sal_uInt16 GetModifier() const;
+ sal_uInt16 GetModifier() const;
void SetModifier( sal_uInt16 nModi );
- SAL_DLLPRIVATE void SetInternalArgs_Impl( const SfxAllItemSet& rArgs );
+ void SetInternalArgs_Impl( const SfxAllItemSet& rArgs );
SAL_DLLPRIVATE const SfxItemSet* GetInternalArgs_Impl() const;
const SfxItemSet* GetArgs() const { return pArgs.get(); }
void SetArgs( const SfxAllItemSet& rArgs );
diff --git a/sw/source/uibase/uno/unomodule.cxx b/sw/source/uibase/uno/unomodule.cxx
index dce4a610fcaf..b7e99dcf12b4 100644
--- a/sw/source/uibase/uno/unomodule.cxx
+++ b/sw/source/uibase/uno/unomodule.cxx
@@ -68,6 +68,14 @@ void SAL_CALL SwUnoModule::dispatchWithNotification( const util::URL& aURL, cons
else
{
SfxRequest aReq( pSlot, aArgs, SfxCallMode::SYNCHRON, SW_MOD()->GetPool() );
+ SfxAllItemSet aInternalSet( SfxGetpApp()->GetPool() );
+
+ css::uno::Reference<css::frame::XDesktop2> xDesktop = css::frame::Desktop::create(::comphelper::getProcessComponentContext());
+ css::uno::Reference<css::frame::XFrame> xCurrentFrame = xDesktop->getCurrentFrame();
+ if (xCurrentFrame.is()) // an empty set is no problem ... but an empty frame reference can be a problem !
+ aInternalSet.Put(SfxUnoFrameItem(SID_FILLFRAME, xCurrentFrame));
+
+ aReq.SetInternalArgs_Impl(aInternalSet);
const SfxPoolItem* pResult = SW_MOD()->ExecuteSlot( aReq );
if ( pResult )
aState = frame::DispatchResultState::SUCCESS;
More information about the Libreoffice-commits
mailing list