summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-08-14 14:41:35 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-08-14 17:27:37 +0200
commit937f800cdb644b22b4c7bd18b35a8940bcede7ce (patch)
treec69f7de9436d4c72718e063ba7607332fa9aa2ab /svx
parent7bb20ab2e84cf4d84d24bfcd8103946e92f2ae06 (diff)
tdf#135550 make XListBox Item status changed event work again
Change-Id: I9a5fe6a097c5d06e3ac3ab6c4c77cbe082d1a17d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100745 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/fmcomp/gridcell.cxx23
-rw-r--r--svx/source/inc/gridcell.hxx6
2 files changed, 17 insertions, 12 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index ee688865530a..4bc0b5179ee9 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -3894,9 +3894,9 @@ FmXListBoxCell::FmXListBoxCell(DbGridColumn* pColumn, std::unique_ptr<DbCellCont
: FmXTextCell(pColumn, std::move(pControl))
, m_aItemListeners(m_aMutex)
, m_aActionListeners(m_aMutex)
- , m_pBox(&static_cast<svt::ListBoxControl&>(m_pCellControl->GetWindow()).get_widget())
+ , m_pBox(&static_cast<svt::ListBoxControl&>(m_pCellControl->GetWindow()))
{
- m_pBox->connect_changed(LINK(this, FmXListBoxCell, ChangedHdl));
+ m_pBox->SetAuxModifyHdl(LINK(this, FmXListBoxCell, ChangedHdl));
}
FmXListBoxCell::~FmXListBoxCell()
@@ -3915,7 +3915,7 @@ void FmXListBoxCell::disposing()
m_aItemListeners.disposeAndClear(aEvt);
m_aActionListeners.disposeAndClear(aEvt);
- m_pBox->connect_changed( Link<weld::ComboBox&,void>() );
+ m_pBox->SetAuxModifyHdl(Link<LinkParamNone*,void>());
m_pBox = nullptr;
FmXTextCell::disposing();
@@ -3923,9 +3923,14 @@ void FmXListBoxCell::disposing()
IMPLEMENT_GET_IMPLEMENTATION_ID( FmXListBoxCell )
-IMPL_LINK_NOARG(FmXListBoxCell, ChangedHdl, weld::ComboBox&, void)
+IMPL_LINK_NOARG(FmXListBoxCell, ChangedHdl, LinkParamNone*, void)
{
- if (!m_pBox || !m_pBox->changed_by_direct_pick())
+ if (!m_pBox)
+ return;
+
+ weld::ComboBox& rBox = m_pBox->get_widget();
+
+ if (!rBox.changed_by_direct_pick())
return;
OnDoubleClick();
@@ -3935,11 +3940,10 @@ IMPL_LINK_NOARG(FmXListBoxCell, ChangedHdl, weld::ComboBox&, void)
aEvent.Highlighted = 0;
// with multiple selection 0xFFFF, otherwise the ID
- aEvent.Selected = (m_pBox->get_active() != -1 )
- ? m_pBox->get_active() : 0xFFFF;
+ aEvent.Selected = (rBox.get_active() != -1 )
+ ? rBox.get_active() : 0xFFFF;
m_aItemListeners.notifyEach( &awt::XItemListener::itemStateChanged, aEvent );
- return;
}
void FmXListBoxCell::OnDoubleClick()
@@ -3948,7 +3952,8 @@ void FmXListBoxCell::OnDoubleClick()
css::awt::ActionEvent aEvent;
aEvent.Source = *this;
- aEvent.ActionCommand = m_pBox->get_active_text();
+ weld::ComboBox& rBox = m_pBox->get_widget();
+ aEvent.ActionCommand = rBox.get_active_text();
while( aIt.hasMoreElements() )
static_cast< css::awt::XActionListener *>(aIt.next())->actionPerformed( aEvent );
diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx
index ee40a8520549..db8883a1e997 100644
--- a/svx/source/inc/gridcell.hxx
+++ b/svx/source/inc/gridcell.hxx
@@ -940,7 +940,7 @@ public:
virtual void SAL_CALL setActionCommand( const OUString& Command ) override;
};
-class FmXListBoxCell final :public FmXTextCell
+class FmXListBoxCell final : public FmXTextCell
{
public:
FmXListBoxCell( DbGridColumn* pColumn, std::unique_ptr<DbCellControl> pControl );
@@ -953,13 +953,13 @@ public:
private:
virtual ~FmXListBoxCell() override;
- DECL_LINK(ChangedHdl, weld::ComboBox&, void);
+ DECL_LINK(ChangedHdl, LinkParamNone*, void);
void OnDoubleClick();
::comphelper::OInterfaceContainerHelper2 m_aItemListeners,
m_aActionListeners;
- weld::ComboBox* m_pBox;
+ VclPtr<::svt::ListBoxControl> m_pBox;
};