sfx2/uiconfig/ui/templatepanel.ui | 4 +++- vcl/jsdialog/executor.cxx | 5 ++++- vcl/jsdialog/jsdialogbuilder.cxx | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-)
New commits: commit 3685a51fb4093c80ec97ffb63e8b220aaf7c28fc Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Fri Dec 20 21:24:14 2024 +0100 Commit: Pranam Lashkari <lpra...@collabora.com> CommitDate: Tue Dec 31 09:58:42 2024 +0100 jsdialog: be sure we found entry for context menu in treeview Fix regression from commit 0d18454f08476475255469d23107d8a9ee6549c4 jsdialog: reduce unwanted containers after that patch we didn't get the entry because coordinates of the entry based on abs pos in the tree were negative Signed-off-by: Szymon Kłos <szymon.k...@collabora.com> Change-Id: I6a9e2c7acb7f02231caaeac1a861321a3a235fb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178962 Reviewed-by: Pranam Lashkari <lpra...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sfx2/uiconfig/ui/templatepanel.ui b/sfx2/uiconfig/ui/templatepanel.ui index 1ef1ceb33ac8..d35533769b49 100644 --- a/sfx2/uiconfig/ui/templatepanel.ui +++ b/sfx2/uiconfig/ui/templatepanel.ui @@ -23,12 +23,14 @@ </columns> </object> <!-- n-columns=1 n-rows=1 --> - <object class="GtkGrid" id="TemplatePanel"> + <object class="GtkBox" id="TemplatePanel"> <property name="visible">True</property> <property name="can-focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> <property name="orientation">vertical</property> + <property name="border-width">6</property> + <property name="spacing">3</property> <child> <object class="GtkBox"> <property name="visible">True</property> diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index 16ef9a715e33..badd5c834193 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -584,7 +584,10 @@ bool ExecuteAction(const OUString& nWindowId, const OUString& rWidget, StringMap if (pTreeView->get_iter_abs_pos(*itEntry, nEntryAbsPos)) { tools::Rectangle aRect = pTreeView->get_row_area(*itEntry); - CommandEvent aCommand(aRect.Center(), CommandEventId::ContextMenu); + Point aPoint = aRect.Center(); + assert(aPoint.getX() >= 0 && aPoint.getY() >= 0); + + CommandEvent aCommand(aPoint, CommandEventId::ContextMenu); LOKTrigger::trigger_popup_menu(*pTreeView, aCommand); } diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 79788062b532..637c449aa918 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -1985,6 +1985,8 @@ OUString JSMenu::popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rR std::unique_ptr<weld::TreeIter> itEntry(pTree->make_iterator()); if (pTree->get_dest_row_at_pos(rRect.Center(), itEntry.get(), false, false)) sCancelId = pTree->get_text(*itEntry); + else + SAL_WARN("vcl", "No entry detected in JSMenu::popup_at_rect"); } m_pSender->sendMenu(m_pPopupMenu, pParent ? pParent->get_buildable_name() : "", sCancelId);