[Libreoffice-commits] core.git: vcl/inc vcl/jsdialog
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jan 22 10:31:17 UTC 2021
vcl/inc/jsdialog/jsdialogbuilder.hxx | 6 ++--
vcl/jsdialog/jsdialogbuilder.cxx | 45 ++++++++++++++++++-----------------
2 files changed, 27 insertions(+), 24 deletions(-)
New commits:
commit a6f45c525226e858ccca5078a6a41e8b07a78b86
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Jan 15 11:38:50 2021 +0100
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Jan 22 11:30:42 2021 +0100
jsdialog: partial updates for more widgets
+ DrawingArea
+ Combobox
+ Listbox
+ RadioButton
+ Expander
+ IconView
+ Entry
+ TextView
+ SpinField
Change-Id: Ic1fdc8ae37216089d0ba18191ff12895c1f5e84e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109367
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index aa9de490c249..267dc960ecd9 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -88,7 +88,7 @@ public:
virtual void sendFullUpdate(bool bForce = false);
void sendClose();
- virtual void sendUpdate(VclPtr<vcl::Window> pWindow);
+ virtual void sendUpdate(VclPtr<vcl::Window> pWindow, bool bForce = false);
void flush() { mpIdleNotify->Invoke(); }
protected:
@@ -278,10 +278,10 @@ public:
m_pSender->sendClose();
}
- void sendUpdate()
+ void sendUpdate(bool bForce = false)
{
if (!m_bIsFreezed && m_pSender)
- m_pSender->sendUpdate(BaseInstanceClass::m_xWidget);
+ m_pSender->sendUpdate(BaseInstanceClass::m_xWidget, bForce);
}
void sendFullUpdate(bool bForce = false)
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 658ee5ae18d6..9fd33ae26b3a 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -182,8 +182,11 @@ void JSDialogSender::sendClose()
flush();
}
-void JSDialogSender::sendUpdate(VclPtr<vcl::Window> pWindow)
+void JSDialogSender::sendUpdate(VclPtr<vcl::Window> pWindow, bool bForce)
{
+ if (bForce)
+ mpIdleNotify->forceUpdate();
+
mpIdleNotify->sendMessage(jsdialog::MessageType::WidgetUpdate, pWindow);
mpIdleNotify->Start();
}
@@ -772,7 +775,7 @@ JSEntry::JSEntry(JSDialogSender* pSender, ::Edit* pEntry, SalInstanceBuilder* pB
void JSEntry::set_text(const OUString& rText)
{
SalInstanceEntry::set_text(rText);
- sendFullUpdate();
+ sendUpdate();
}
void JSEntry::set_text_without_notify(const OUString& rText) { SalInstanceEntry::set_text(rText); }
@@ -788,19 +791,19 @@ void JSListBox::insert(int pos, const OUString& rStr, const OUString* pId,
const OUString* pIconName, VirtualDevice* pImageSurface)
{
SalInstanceComboBoxWithoutEdit::insert(pos, rStr, pId, pIconName, pImageSurface);
- sendFullUpdate();
+ sendUpdate();
}
void JSListBox::remove(int pos)
{
SalInstanceComboBoxWithoutEdit::remove(pos);
- sendFullUpdate();
+ sendUpdate();
}
void JSListBox::set_active(int pos)
{
SalInstanceComboBoxWithoutEdit::set_active(pos);
- sendFullUpdate();
+ sendUpdate();
}
JSComboBox::JSComboBox(JSDialogSender* pSender, ::ComboBox* pComboBox, SalInstanceBuilder* pBuilder,
@@ -814,25 +817,25 @@ void JSComboBox::insert(int pos, const OUString& rStr, const OUString* pId,
const OUString* pIconName, VirtualDevice* pImageSurface)
{
SalInstanceComboBoxWithEdit::insert(pos, rStr, pId, pIconName, pImageSurface);
- sendFullUpdate();
+ sendUpdate();
}
void JSComboBox::remove(int pos)
{
SalInstanceComboBoxWithEdit::remove(pos);
- sendFullUpdate();
+ sendUpdate();
}
void JSComboBox::set_entry_text(const OUString& rText)
{
SalInstanceComboBoxWithEdit::set_entry_text(rText);
- sendFullUpdate();
+ sendUpdate();
}
void JSComboBox::set_active(int pos)
{
SalInstanceComboBoxWithEdit::set_active(pos);
- sendFullUpdate();
+ sendUpdate();
}
JSNotebook::JSNotebook(JSDialogSender* pSender, ::TabControl* pControl,
@@ -884,7 +887,7 @@ JSSpinButton::JSSpinButton(JSDialogSender* pSender, ::FormattedField* pSpin,
void JSSpinButton::set_value(int value)
{
SalInstanceSpinButton::set_value(value);
- sendFullUpdate(true); // if input is limited we can receive the same JSON
+ sendUpdate(true); // if input is limited we can receive the same JSON
}
JSMessageDialog::JSMessageDialog(JSDialogSender* pSender, ::MessageDialog* pDialog,
@@ -924,7 +927,7 @@ JSCheckButton::JSCheckButton(JSDialogSender* pSender, ::CheckBox* pCheckBox,
void JSCheckButton::set_active(bool active)
{
SalInstanceCheckButton::set_active(active);
- sendFullUpdate();
+ sendUpdate();
}
JSDrawingArea::JSDrawingArea(JSDialogSender* pSender, VclDrawingArea* pDrawingArea,
@@ -938,13 +941,13 @@ JSDrawingArea::JSDrawingArea(JSDialogSender* pSender, VclDrawingArea* pDrawingAr
void JSDrawingArea::queue_draw()
{
SalInstanceDrawingArea::queue_draw();
- sendFullUpdate();
+ sendUpdate();
}
void JSDrawingArea::queue_draw_area(int x, int y, int width, int height)
{
SalInstanceDrawingArea::queue_draw_area(x, y, width, height);
- sendFullUpdate();
+ sendUpdate();
}
JSToolbar::JSToolbar(JSDialogSender* pSender, ::ToolBox* pToolbox, SalInstanceBuilder* pBuilder,
@@ -963,7 +966,7 @@ JSTextView::JSTextView(JSDialogSender* pSender, ::VclMultiLineEdit* pTextView,
void JSTextView::set_text(const OUString& rText)
{
SalInstanceTextView::set_text(rText);
- sendFullUpdate();
+ sendUpdate();
}
JSTreeView::JSTreeView(JSDialogSender* pSender, ::SvTabListBox* pTreeView,
@@ -1081,7 +1084,7 @@ JSExpander::JSExpander(JSDialogSender* pSender, ::VclExpander* pExpander,
void JSExpander::set_expanded(bool bExpand)
{
SalInstanceExpander::set_expanded(bExpand);
- sendFullUpdate();
+ sendUpdate();
}
JSIconView::JSIconView(JSDialogSender* pSender, ::IconView* pIconView, SalInstanceBuilder* pBuilder,
@@ -1094,32 +1097,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);
- sendFullUpdate();
+ sendUpdate();
}
void JSIconView::insert(int pos, const OUString* pStr, const OUString* pId,
const VirtualDevice* pIcon, weld::TreeIter* pRet)
{
SalInstanceIconView::insert(pos, pStr, pId, pIcon, pRet);
- sendFullUpdate();
+ sendUpdate();
}
void JSIconView::clear()
{
SalInstanceIconView::clear();
- sendFullUpdate();
+ sendUpdate();
}
void JSIconView::select(int pos)
{
SalInstanceIconView::select(pos);
- sendFullUpdate();
+ sendUpdate();
}
void JSIconView::unselect(int pos)
{
SalInstanceIconView::unselect(pos);
- sendFullUpdate();
+ sendUpdate();
}
JSRadioButton::JSRadioButton(JSDialogSender* pSender, ::RadioButton* pRadioButton,
@@ -1132,7 +1135,7 @@ JSRadioButton::JSRadioButton(JSDialogSender* pSender, ::RadioButton* pRadioButto
void JSRadioButton::set_active(bool active)
{
SalInstanceRadioButton::set_active(active);
- sendFullUpdate();
+ sendUpdate();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
More information about the Libreoffice-commits
mailing list