vcl/inc/jsdialog/jsdialogbuilder.hxx | 16 +++---- vcl/jsdialog/jsdialogbuilder.cxx | 78 +++++++++++++++++------------------ 2 files changed, 48 insertions(+), 46 deletions(-)
New commits: commit a7fe04ef1fb52fdb1c024a9a1b85a311c8b9332f Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Tue Jan 19 12:09:45 2021 +0100 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Fri Feb 5 08:59:52 2021 +0100 jsdialog: send updates also for source treeview on drag + simplify updates + unify naming Change-Id: Iebdaae3d910ef2cba0c818aa17d407e39f62a5e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109635 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109946 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index 88afa4a45383..d2793ece7e3c 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -88,7 +88,7 @@ public: virtual ~JSDialogSender() = default; - virtual void notifyDialogState(bool bForce = false); + virtual void sendFullUpdate(bool bForce = false); void sendClose(); virtual void sendUpdate(VclPtr<vcl::Window> pWindow); @@ -251,20 +251,20 @@ public: virtual void show() override { BaseInstanceClass::show(); - notifyDialogState(); + sendFullUpdate(); } virtual void hide() override { BaseInstanceClass::hide(); - notifyDialogState(); + sendFullUpdate(); } using BaseInstanceClass::set_sensitive; virtual void set_sensitive(bool sensitive) override { BaseInstanceClass::set_sensitive(sensitive); - sendUpdate(BaseInstanceClass::m_xWidget); + sendUpdate(); } virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> get_drop_target() override @@ -293,16 +293,16 @@ public: m_pSender->sendClose(); } - void sendUpdate(VclPtr<vcl::Window> pWindow) + void sendUpdate() { if (!m_bIsFreezed && m_pSender) - m_pSender->sendUpdate(pWindow); + m_pSender->sendUpdate(BaseInstanceClass::m_xWidget); } - void notifyDialogState(bool bForce = false) + void sendFullUpdate(bool bForce = false) { if ((!m_bIsFreezed || bForce) && m_pSender) - m_pSender->notifyDialogState(bForce); + m_pSender->sendFullUpdate(bForce); } }; diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 58a23332ae14..f12d25e73359 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -146,7 +146,7 @@ void JSDialogNotifyIdle::Invoke() m_aMessageQueue.clear(); } -void JSDialogSender::notifyDialogState(bool bForce) +void JSDialogSender::sendFullUpdate(bool bForce) { if (bForce) mpIdleNotify->forceUpdate(); @@ -736,13 +736,13 @@ JSDialog::JSDialog(JSDialogSender* pSender, ::Dialog* pDialog, SalInstanceBuilde void JSDialog::collapse(weld::Widget* pEdit, weld::Widget* pButton) { SalInstanceDialog::collapse(pEdit, pButton); - notifyDialogState(); + sendFullUpdate(); } void JSDialog::undo_collapse() { SalInstanceDialog::undo_collapse(); - notifyDialogState(); + sendFullUpdate(); } void JSDialog::response(int response) @@ -760,7 +760,7 @@ JSLabel::JSLabel(JSDialogSender* pSender, FixedText* pLabel, SalInstanceBuilder* void JSLabel::set_label(const OUString& rText) { SalInstanceLabel::set_label(rText); - sendUpdate(m_xWidget); + sendUpdate(); }; JSButton::JSButton(JSDialogSender* pSender, ::Button* pButton, SalInstanceBuilder* pBuilder, @@ -778,7 +778,7 @@ JSEntry::JSEntry(JSDialogSender* pSender, ::Edit* pEntry, SalInstanceBuilder* pB void JSEntry::set_text(const OUString& rText) { SalInstanceEntry::set_text(rText); - notifyDialogState(); + sendFullUpdate(); } void JSEntry::set_text_without_notify(const OUString& rText) { SalInstanceEntry::set_text(rText); } @@ -794,19 +794,19 @@ void JSListBox::insert(int pos, const OUString& rStr, const OUString* pId, const OUString* pIconName, VirtualDevice* pImageSurface) { SalInstanceComboBoxWithoutEdit::insert(pos, rStr, pId, pIconName, pImageSurface); - notifyDialogState(); + sendFullUpdate(); } void JSListBox::remove(int pos) { SalInstanceComboBoxWithoutEdit::remove(pos); - notifyDialogState(); + sendFullUpdate(); } void JSListBox::set_active(int pos) { SalInstanceComboBoxWithoutEdit::set_active(pos); - notifyDialogState(); + sendFullUpdate(); } JSComboBox::JSComboBox(JSDialogSender* pSender, ::ComboBox* pComboBox, SalInstanceBuilder* pBuilder, @@ -820,25 +820,25 @@ void JSComboBox::insert(int pos, const OUString& rStr, const OUString* pId, const OUString* pIconName, VirtualDevice* pImageSurface) { SalInstanceComboBoxWithEdit::insert(pos, rStr, pId, pIconName, pImageSurface); - notifyDialogState(); + sendFullUpdate(); } void JSComboBox::remove(int pos) { SalInstanceComboBoxWithEdit::remove(pos); - notifyDialogState(); + sendFullUpdate(); } void JSComboBox::set_entry_text(const OUString& rText) { SalInstanceComboBoxWithEdit::set_entry_text(rText); - notifyDialogState(); + sendFullUpdate(); } void JSComboBox::set_active(int pos) { SalInstanceComboBoxWithEdit::set_active(pos); - notifyDialogState(); + sendFullUpdate(); } JSNotebook::JSNotebook(JSDialogSender* pSender, ::TabControl* pControl, @@ -855,7 +855,7 @@ void JSNotebook::set_current_page(int nPage) bForce = true; SalInstanceNotebook::set_current_page(nPage); - notifyDialogState(bForce); + sendFullUpdate(bForce); } void JSNotebook::set_current_page(const OString& rIdent) @@ -866,19 +866,19 @@ void JSNotebook::set_current_page(const OString& rIdent) bForce = true; SalInstanceNotebook::set_current_page(rIdent); - notifyDialogState(bForce); + sendFullUpdate(bForce); } void JSNotebook::remove_page(const OString& rIdent) { SalInstanceNotebook::remove_page(rIdent); - notifyDialogState(); + sendFullUpdate(); } void JSNotebook::append_page(const OString& rIdent, const OUString& rLabel) { SalInstanceNotebook::append_page(rIdent, rLabel); - notifyDialogState(); + sendFullUpdate(); } JSSpinButton::JSSpinButton(JSDialogSender* pSender, ::FormattedField* pSpin, @@ -890,7 +890,7 @@ JSSpinButton::JSSpinButton(JSDialogSender* pSender, ::FormattedField* pSpin, void JSSpinButton::set_value(int value) { SalInstanceSpinButton::set_value(value); - notifyDialogState(true); // if input is limited we can receive the same JSON + sendFullUpdate(true); // if input is limited we can receive the same JSON } JSMessageDialog::JSMessageDialog(JSDialogSender* pSender, ::MessageDialog* pDialog, @@ -912,13 +912,13 @@ JSMessageDialog::JSMessageDialog(::MessageDialog* pDialog, SalInstanceBuilder* p void JSMessageDialog::set_primary_text(const OUString& rText) { SalInstanceMessageDialog::set_primary_text(rText); - notifyDialogState(); + sendFullUpdate(); } void JSMessageDialog::set_secondary_text(const OUString& rText) { SalInstanceMessageDialog::set_secondary_text(rText); - notifyDialogState(); + sendFullUpdate(); } JSCheckButton::JSCheckButton(JSDialogSender* pSender, ::CheckBox* pCheckBox, @@ -930,7 +930,7 @@ JSCheckButton::JSCheckButton(JSDialogSender* pSender, ::CheckBox* pCheckBox, void JSCheckButton::set_active(bool active) { SalInstanceCheckButton::set_active(active); - notifyDialogState(); + sendFullUpdate(); } JSDrawingArea::JSDrawingArea(JSDialogSender* pSender, VclDrawingArea* pDrawingArea, @@ -945,13 +945,13 @@ JSDrawingArea::JSDrawingArea(JSDialogSender* pSender, VclDrawingArea* pDrawingAr void JSDrawingArea::queue_draw() { SalInstanceDrawingArea::queue_draw(); - notifyDialogState(); + sendFullUpdate(); } void JSDrawingArea::queue_draw_area(int x, int y, int width, int height) { SalInstanceDrawingArea::queue_draw_area(x, y, width, height); - notifyDialogState(); + sendFullUpdate(); } JSToolbar::JSToolbar(JSDialogSender* pSender, ::ToolBox* pToolbox, SalInstanceBuilder* pBuilder, @@ -963,7 +963,7 @@ JSToolbar::JSToolbar(JSDialogSender* pSender, ::ToolBox* pToolbox, SalInstanceBu void JSToolbar::signal_clicked(const OString& rIdent) { SalInstanceToolbar::signal_clicked(rIdent); - notifyDialogState(); + sendFullUpdate(); } JSTextView::JSTextView(JSDialogSender* pSender, ::VclMultiLineEdit* pTextView, @@ -976,7 +976,7 @@ JSTextView::JSTextView(JSDialogSender* pSender, ::VclMultiLineEdit* pTextView, void JSTextView::set_text(const OUString& rText) { SalInstanceTextView::set_text(rText); - notifyDialogState(); + sendFullUpdate(); } JSTreeView::JSTreeView(JSDialogSender* pSender, ::SvTabListBox* pTreeView, @@ -997,7 +997,7 @@ void JSTreeView::set_toggle(int pos, TriState eState, int col) SalInstanceTreeView::set_toggle(pEntry, eState, col); signal_toggled(iter_col(SalInstanceTreeIter(pEntry), col)); - sendUpdate(m_xTreeView); + sendUpdate(); } } @@ -1043,7 +1043,9 @@ void JSTreeView::drag_end() m_xDropTarget->fire_drop(aEvent); - sendUpdate(m_xTreeView); + sendUpdate(); + if (g_DragSource) + g_DragSource->sendUpdate(); } g_DragSource = nullptr; @@ -1057,31 +1059,31 @@ void JSTreeView::insert(const weld::TreeIter* pParent, int pos, const OUString* SalInstanceTreeView::insert(pParent, pos, pStr, pId, pIconName, pImageSurface, pExpanderName, bChildrenOnDemand, pRet); - sendUpdate(m_xTreeView); + sendUpdate(); } void JSTreeView::set_text(int row, const OUString& rText, int col) { SalInstanceTreeView::set_text(row, rText, col); - sendUpdate(m_xTreeView); + sendUpdate(); } void JSTreeView::set_text(const weld::TreeIter& rIter, const OUString& rStr, int col) { SalInstanceTreeView::set_text(rIter, rStr, col); - sendUpdate(m_xTreeView); + sendUpdate(); } void JSTreeView::expand_row(const weld::TreeIter& rIter) { SalInstanceTreeView::expand_row(rIter); - sendUpdate(m_xTreeView); + sendUpdate(); } void JSTreeView::collapse_row(const weld::TreeIter& rIter) { SalInstanceTreeView::collapse_row(rIter); - sendUpdate(m_xTreeView); + sendUpdate(); } JSExpander::JSExpander(JSDialogSender* pSender, ::VclExpander* pExpander, @@ -1093,7 +1095,7 @@ JSExpander::JSExpander(JSDialogSender* pSender, ::VclExpander* pExpander, void JSExpander::set_expanded(bool bExpand) { SalInstanceExpander::set_expanded(bExpand); - notifyDialogState(); + sendFullUpdate(); } JSIconView::JSIconView(JSDialogSender* pSender, ::IconView* pIconView, SalInstanceBuilder* pBuilder, @@ -1106,32 +1108,32 @@ void JSIconView::insert(int pos, const OUString* pStr, const OUString* pId, const OUString* pIconName, weld::TreeIter* pRet) { SalInstanceIconView::insert(pos, pStr, pId, pIconName, pRet); - notifyDialogState(); + sendFullUpdate(); } void JSIconView::insert(int pos, const OUString* pStr, const OUString* pId, const VirtualDevice* pIcon, weld::TreeIter* pRet) { SalInstanceIconView::insert(pos, pStr, pId, pIcon, pRet); - notifyDialogState(); + sendFullUpdate(); } void JSIconView::clear() { SalInstanceIconView::clear(); - notifyDialogState(); + sendFullUpdate(); } void JSIconView::select(int pos) { SalInstanceIconView::select(pos); - notifyDialogState(); + sendFullUpdate(); } void JSIconView::unselect(int pos) { SalInstanceIconView::unselect(pos); - notifyDialogState(); + sendFullUpdate(); } JSRadioButton::JSRadioButton(JSDialogSender* pSender, ::RadioButton* pRadioButton, @@ -1144,7 +1146,7 @@ JSRadioButton::JSRadioButton(JSDialogSender* pSender, ::RadioButton* pRadioButto void JSRadioButton::set_active(bool active) { SalInstanceRadioButton::set_active(active); - notifyDialogState(); + sendFullUpdate(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits