tdf#167034 sd: Populate graphics bullet menu when creating dlg

Since

    commit f075fa01cb
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Tue Aug 22 10:26:32 2023 +0200

        tdf#141101 tdf#101886 a11y: Restore previous focus on col/line popup close

, the menu button toggled handler is no more called before
the menu shows (at least for the VCL implementation).

Populate the menu entries in the SvxBulletAndPositionDlg
ctor instead, to ensure they are present when the menu gets
shown.

Change-Id: I02c65f11bfb532ecfb6e91578d26ea9dfc2e31a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186771
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn
2025-06-20 21:21:31 +02:00
parent 89ce109262
commit 9456449751
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -139,7 +139,6 @@ SvxBulletAndPositionDlg::SvxBulletAndPositionDlg(weld::Window* pWindow, const Sf
m_xBulletPB->connect_clicked(LINK(this, SvxBulletAndPositionDlg, BulletHdl_Impl));
m_xFmtLB->connect_changed(LINK(this, SvxBulletAndPositionDlg, NumberTypeSelectHdl_Impl));
m_xBitmapMB->connect_selected(LINK(this, SvxBulletAndPositionDlg, GraphicHdl_Impl));
m_xBitmapMB->connect_toggled(LINK(this, SvxBulletAndPositionDlg, PopupActivateHdl_Impl));
m_xLevelLB->set_selection_mode(SelectionMode::Multiple);
m_xLevelLB->connect_selection_changed(LINK(this, SvxBulletAndPositionDlg, LevelHdl_Impl));
m_xWidthMF->connect_value_changed(LINK(this, SvxBulletAndPositionDlg, SizeHdl_Impl));
@@ -205,6 +204,8 @@ SvxBulletAndPositionDlg::SvxBulletAndPositionDlg(weld::Window* pWindow, const Sf
Size aSize(m_xGrid->get_preferred_size());
m_xGrid->set_size_request(aSize.Width(), -1);
PopulateGalleryMenu();
// PageCreated
FieldUnit eMetric = pView->GetDoc().GetUIUnit();
SfxAllItemSet aSet(*(rSet.GetPool()));
@@ -885,7 +886,7 @@ IMPL_LINK(SvxBulletAndPositionDlg, GraphicHdl_Impl, const OUString&, rIdent, voi
aInvalidateTimer.Start();
}
IMPL_LINK_NOARG(SvxBulletAndPositionDlg, PopupActivateHdl_Impl, weld::Toggleable&, void)
void SvxBulletAndPositionDlg::PopulateGalleryMenu()
{
if (m_xGalleryMenu)
return;
+1 -1
View File
@@ -110,6 +110,7 @@ class SvxBulletAndPositionDlg : public weld::GenericDialogController
std::unique_ptr<weld::Button> m_xReset;
void InitControls();
void PopulateGalleryMenu();
/** To switch between the numbering type
0 - Number;
1 - Bullet;
@@ -119,7 +120,6 @@ class SvxBulletAndPositionDlg : public weld::GenericDialogController
DECL_LINK(NumberTypeSelectHdl_Impl, weld::ComboBox&, void);
DECL_LINK(LevelHdl_Impl, weld::TreeView&, void);
DECL_LINK(PopupActivateHdl_Impl, weld::Toggleable&, void);
DECL_LINK(GraphicHdl_Impl, const OUString&, void);
DECL_LINK(BulletHdl_Impl, weld::Button&, void);
DECL_LINK(SizeHdl_Impl, weld::MetricSpinButton&, void);