[Libreoffice-commits] core.git: cui/source include/sfx2 include/svx include/vcl sd/source sfx2/source starmath/inc starmath/source svx/source sw/source vcl/Library_vcl.mk vcl/source
Caolán McNamara
caolanm at redhat.com
Thu May 24 12:24:29 UTC 2018
cui/source/dialogs/colorpicker.cxx | 275 +++++++---------
cui/source/dialogs/cuicharmap.cxx | 241 +++++++-------
cui/source/inc/cuicharmap.hxx | 27 -
cui/source/inc/textattr.hxx | 4
cui/source/tabpages/textattr.cxx | 33 -
include/sfx2/charwin.hxx | 32 -
include/sfx2/new.hxx | 15
include/svx/charmap.hxx | 42 +-
include/svx/dlgctrl.hxx | 41 +-
include/svx/graphctl.hxx | 21 -
include/svx/searchcharmap.hxx | 9
include/vcl/customweld.hxx | 100 +++++
sd/source/ui/dlg/PhotoAlbumDialog.cxx | 8
sd/source/ui/dlg/PhotoAlbumDialog.hxx | 4
sd/source/ui/dlg/vectdlg.cxx | 10
sd/source/ui/inc/vectdlg.hxx | 7
sfx2/source/control/charwin.cxx | 70 +---
sfx2/source/doc/new.cxx | 29 -
sfx2/source/inc/preview.hxx | 13
starmath/inc/dialog.hxx | 76 ++--
starmath/source/dialog.cxx | 129 ++-----
svx/source/accessibility/charmapacc.cxx | 4
svx/source/accessibility/svxrectctaccessiblecontext.cxx | 4
svx/source/dialog/charmap.cxx | 90 ++---
svx/source/dialog/dlgctrl.cxx | 100 ++---
svx/source/dialog/graphctl.cxx | 18 -
svx/source/dialog/searchcharmap.cxx | 29 -
sw/source/ui/envelp/envfmt.cxx | 4
sw/source/ui/envelp/envfmt.hxx | 3
sw/source/ui/envelp/envlop1.cxx | 33 -
sw/source/ui/envelp/labfmt.cxx | 42 +-
sw/source/ui/envelp/labfmt.hxx | 16
sw/source/ui/misc/num.cxx | 14
sw/source/ui/misc/outline.cxx | 17
sw/source/ui/table/autoformatpreview.cxx | 19 -
sw/source/ui/table/instable.cxx | 16
sw/source/ui/table/tautofmt.cxx | 32 -
sw/source/uibase/inc/autoformatpreview.hxx | 15
sw/source/uibase/inc/envlop.hxx | 15
sw/source/uibase/inc/instable.hxx | 25 -
sw/source/uibase/inc/num.hxx | 13
sw/source/uibase/inc/numprevw.hxx | 24 -
sw/source/uibase/inc/outline.hxx | 7
sw/source/uibase/inc/tautofmt.hxx | 27 -
vcl/Library_vcl.mk | 1
vcl/source/app/customweld.cxx | 82 ++++
46 files changed, 981 insertions(+), 855 deletions(-)
New commits:
commit eeaf6dee2d278eaa037d95a756ad0ffab3314bc2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue May 22 10:38:34 2018 +0100
rework custom widget welding to enable inheritence
Change-Id: I0d391b3fe9d2d610ae41e2a03cd2e195a866e103
Reviewed-on: https://gerrit.libreoffice.org/54681
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index 0106a3acdf70..4fba23b2f7ca 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -28,6 +28,7 @@
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/basemutex.hxx>
+#include <vcl/customweld.hxx>
#include <vcl/weld.hxx>
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
@@ -150,24 +151,22 @@ static void RGBtoCMYK( double dR, double dG, double dB, double& fCyan, double& f
}
}
-class ColorPreviewControl
+class ColorPreviewControl : public weld::CustomWidgetController
{
private:
- std::unique_ptr<weld::DrawingArea> m_xDrawingArea;
Color m_aColor;
- Size m_aSize;
- DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
- DECL_LINK(DoResize, const Size& rSize, void);
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override;
public:
- ColorPreviewControl(weld::DrawingArea* pDrawingArea)
- : m_xDrawingArea(pDrawingArea)
+ ColorPreviewControl()
{
- m_xDrawingArea->connect_size_allocate(LINK(this, ColorPreviewControl, DoResize));
- m_xDrawingArea->connect_draw(LINK(this, ColorPreviewControl, DoPaint));
- m_xDrawingArea->set_size_request(m_xDrawingArea->get_approximate_digit_width() * 10,
- m_xDrawingArea->get_text_height() * 2);
+ }
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override
+ {
+ pDrawingArea->set_size_request(pDrawingArea->get_approximate_digit_width() * 10,
+ pDrawingArea->get_text_height() * 2);
+ CustomWidgetController::SetDrawingArea(pDrawingArea);
}
void SetColor(const Color& rCol)
@@ -175,60 +174,49 @@ public:
if (rCol != m_aColor)
{
m_aColor = rCol;
- m_xDrawingArea->queue_draw();
+ Invalidate();
}
}
-
- void show() { m_xDrawingArea->show(); }
};
-IMPL_LINK(ColorPreviewControl, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
+void ColorPreviewControl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
- vcl::RenderContext& rRenderContext = aPayload.first;
rRenderContext.SetFillColor(m_aColor);
rRenderContext.SetLineColor(m_aColor);
- rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), m_aSize));
-}
-
-IMPL_LINK(ColorPreviewControl, DoResize, const Size&, rSize, void)
-{
- if (m_aSize != rSize)
- {
- m_aSize = rSize;
- m_xDrawingArea->queue_draw();
- }
+ rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), GetOutputSizePixel()));
}
enum ColorMode { HUE, SATURATION, BRIGHTNESS, RED, GREEN, BLUE };
const ColorMode DefaultMode = HUE;
-class ColorFieldControl
+class ColorFieldControl : public weld::CustomWidgetController
{
public:
- ColorFieldControl(weld::DrawingArea* pDrawingArea)
- : m_xDrawingArea(pDrawingArea)
- , meMode( DefaultMode )
+ ColorFieldControl()
+ : meMode( DefaultMode )
, mdX( -1.0 )
, mdY( -1.0 )
+ , mbMouseCaptured(false)
+ {
+ }
+
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override
{
- m_xDrawingArea->set_size_request(m_xDrawingArea->get_approximate_digit_width() * 40,
- m_xDrawingArea->get_text_height() * 10);
- m_xDrawingArea->connect_size_allocate(LINK(this, ColorFieldControl, DoResize));
- m_xDrawingArea->connect_draw(LINK(this, ColorFieldControl, DoPaint));
- m_xDrawingArea->connect_mouse_press(LINK(this, ColorFieldControl, DoButtonDown));
- m_xDrawingArea->connect_mouse_release(LINK(this, ColorFieldControl, DoButtonUp));
+ pDrawingArea->set_size_request(pDrawingArea->get_approximate_digit_width() * 40,
+ pDrawingArea->get_text_height() * 10);
+ CustomWidgetController::SetDrawingArea(pDrawingArea);
}
- ~ColorFieldControl()
+ virtual ~ColorFieldControl() override
{
mxBitmap.disposeAndClear();
}
- DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
- DECL_LINK(DoResize, const Size& rSize, void);
- DECL_LINK(DoButtonDown, const MouseEvent& rMEvt, void);
- DECL_LINK(DoMouseMove, const MouseEvent& rMEvt, void);
- DECL_LINK(DoButtonUp, const MouseEvent& rMEvt, void);
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
+ virtual void Resize() override;
+ virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
+ virtual void MouseMove(const MouseEvent& rMEvt) override;
+ virtual void MouseButtonUp(const MouseEvent& rMEvt) override;
void UpdateBitmap();
void ShowPosition( const Point& rPos, bool bUpdate );
@@ -242,12 +230,11 @@ public:
void SetModifyHdl(const Link<ColorFieldControl&,void>& rLink) { maModifyHdl = rLink; }
private:
- std::unique_ptr<weld::DrawingArea> m_xDrawingArea;
- Size m_aSize;
ColorMode meMode;
Color maColor;
double mdX;
double mdY;
+ bool mbMouseCaptured;
Point maPosition;
VclPtr<VirtualDevice> mxBitmap;
Link<ColorFieldControl&,void> maModifyHdl;
@@ -260,7 +247,7 @@ private:
void ColorFieldControl::UpdateBitmap()
{
- const Size aSize(m_aSize);
+ const Size aSize(GetOutputSizePixel());
if (mxBitmap && mxBitmap->GetOutputSizePixel() != aSize)
mxBitmap.disposeAndClear();
@@ -402,7 +389,7 @@ void ColorFieldControl::ShowPosition( const Point& rPos, bool bUpdate )
if (!mxBitmap)
{
UpdateBitmap();
- m_xDrawingArea->queue_draw();
+ Invalidate();
}
if (!mxBitmap)
@@ -425,8 +412,8 @@ void ColorFieldControl::ShowPosition( const Point& rPos, bool bUpdate )
Point aPos = maPosition;
maPosition.setX( nX - 5 );
maPosition.setY( nY - 5 );
- m_xDrawingArea->queue_draw_area(aPos.X(), aPos.Y(), 11, 11);
- m_xDrawingArea->queue_draw_area(maPosition.X(), maPosition.Y(), 11, 11);
+ Invalidate(tools::Rectangle(aPos, Size(11, 11)));
+ Invalidate(tools::Rectangle(maPosition, Size(11, 11)));
if (bUpdate)
{
@@ -437,34 +424,39 @@ void ColorFieldControl::ShowPosition( const Point& rPos, bool bUpdate )
}
}
-IMPL_LINK(ColorFieldControl, DoButtonDown, const MouseEvent&, rMEvt, void)
+void ColorFieldControl::MouseButtonDown(const MouseEvent& rMEvt)
{
- m_xDrawingArea->connect_mouse_move(LINK(this, ColorFieldControl, DoMouseMove));
- m_xDrawingArea->grab_add();
+ grab_add();
+ mbMouseCaptured = true;
ShowPosition(rMEvt.GetPosPixel(), true);
Modify();
}
-IMPL_LINK(ColorFieldControl, DoMouseMove, const MouseEvent&, rMEvt, void)
+void ColorFieldControl::MouseMove(const MouseEvent& rMEvt)
{
- ShowPosition(rMEvt.GetPosPixel(), true);
- Modify();
+ if (mbMouseCaptured)
+ {
+ ShowPosition(rMEvt.GetPosPixel(), true);
+ Modify();
+ }
}
-IMPL_LINK_NOARG(ColorFieldControl, DoButtonUp, const MouseEvent&, void)
+void ColorFieldControl::MouseButtonUp(const MouseEvent&)
{
- m_xDrawingArea->grab_remove();
- m_xDrawingArea->connect_mouse_move(Link<const MouseEvent&, void>());
+ grab_remove();
+ mbMouseCaptured = false;
}
-IMPL_LINK(ColorFieldControl, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
+void ColorFieldControl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
- vcl::RenderContext& rRenderContext = aPayload.first;
if (!mxBitmap)
UpdateBitmap();
if (mxBitmap)
- rRenderContext.DrawOutDev(Point(0, 0), m_aSize, Point(0, 0), m_aSize, *mxBitmap);
+ {
+ Size aSize(GetOutputSizePixel());
+ rRenderContext.DrawOutDev(Point(0, 0), aSize, Point(0, 0), aSize, *mxBitmap);
+ }
// draw circle around current color
if (maColor.IsDark())
@@ -477,15 +469,11 @@ IMPL_LINK(ColorFieldControl, DoPaint, weld::DrawingArea::draw_args, aPayload, vo
rRenderContext.DrawEllipse(::tools::Rectangle(maPosition, Size(11, 11)));
}
-IMPL_LINK(ColorFieldControl, DoResize, const Size&, rSize, void)
+void ColorFieldControl::Resize()
{
- if (m_aSize != rSize)
- {
- m_aSize = rSize;
- UpdateBitmap();
- UpdatePosition();
- m_xDrawingArea->queue_draw();
- }
+ CustomWidgetController::Resize();
+ UpdateBitmap();
+ UpdatePosition();
}
void ColorFieldControl::Modify()
@@ -507,27 +495,29 @@ void ColorFieldControl::SetValues( Color aColor, ColorMode eMode, double x, doub
UpdateBitmap();
UpdatePosition();
if (bUpdateBitmap)
- m_xDrawingArea->queue_draw();
+ Invalidate();
}
}
void ColorFieldControl::UpdatePosition()
{
- Size aSize(m_aSize);
+ Size aSize(GetOutputSizePixel());
ShowPosition(Point(static_cast<long>(mdX * aSize.Width()), static_cast<long>((1.0 - mdY) * aSize.Height())), false);
}
-class ColorSliderControl
+class ColorSliderControl : public weld::CustomWidgetController
{
public:
- ColorSliderControl(weld::DrawingArea* pDrawingArea);
- ~ColorSliderControl();
+ ColorSliderControl();
+ virtual ~ColorSliderControl() override;
- DECL_LINK(DoButtonDown, const MouseEvent& rMEvt, void);
- DECL_LINK(DoMouseMove, const MouseEvent& rMEvt, void);
- DECL_LINK(DoButtonUp, const MouseEvent& rMEvt, void);
- DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
- DECL_LINK(DoResize, const Size& rSize, void);
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
+
+ virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
+ virtual void MouseMove(const MouseEvent& rMEvt) override;
+ virtual void MouseButtonUp(const MouseEvent& rMEvt) override;
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override;
+ virtual void Resize() override;
void UpdateBitmap();
void ChangePosition( long nY );
@@ -540,31 +530,28 @@ public:
sal_Int16 GetLevel() const { return mnLevel; }
- void set_margin_top(int nMargin) { m_xDrawingArea->set_margin_top(nMargin); }
- void set_margin_bottom(int nMargin) { m_xDrawingArea->set_margin_bottom(nMargin); }
-
private:
Link<ColorSliderControl&,void> maModifyHdl;
- std::unique_ptr<weld::DrawingArea> m_xDrawingArea;
- Size m_aSize;
Color maColor;
ColorMode meMode;
VclPtr<VirtualDevice> mxBitmap;
sal_Int16 mnLevel;
double mdValue;
+ bool mbMouseCaptured;
};
-ColorSliderControl::ColorSliderControl(weld::DrawingArea* pDrawingArea)
- : m_xDrawingArea(pDrawingArea)
- , meMode( DefaultMode )
+ColorSliderControl::ColorSliderControl()
+ : meMode( DefaultMode )
, mnLevel( 0 )
, mdValue( -1.0 )
+ , mbMouseCaptured(false)
+{
+}
+
+void ColorSliderControl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
{
- m_xDrawingArea->set_size_request(m_xDrawingArea->get_approximate_digit_width() * 3, -1);
- m_xDrawingArea->connect_size_allocate(LINK(this, ColorSliderControl, DoResize));
- m_xDrawingArea->connect_draw(LINK(this, ColorSliderControl, DoPaint));
- m_xDrawingArea->connect_mouse_press(LINK(this, ColorSliderControl, DoButtonDown));
- m_xDrawingArea->connect_mouse_release(LINK(this, ColorSliderControl, DoButtonUp));
+ pDrawingArea->set_size_request(pDrawingArea->get_approximate_digit_width() * 3, -1);
+ CustomWidgetController::SetDrawingArea(pDrawingArea);
}
ColorSliderControl::~ColorSliderControl()
@@ -574,7 +561,7 @@ ColorSliderControl::~ColorSliderControl()
void ColorSliderControl::UpdateBitmap()
{
- Size aSize(1, m_aSize.Height());
+ Size aSize(1, GetOutputSizePixel().Height());
if (mxBitmap && mxBitmap->GetOutputSizePixel() != aSize)
mxBitmap.disposeAndClear();
@@ -651,7 +638,7 @@ void ColorSliderControl::UpdateBitmap()
void ColorSliderControl::ChangePosition(long nY)
{
- const long nHeight = m_aSize.Height() - 1;
+ const long nHeight = GetOutputSizePixel().Height() - 1;
if (nY < 0)
nY = 0;
@@ -662,32 +649,35 @@ void ColorSliderControl::ChangePosition(long nY)
mdValue = double(nHeight - nY) / double(nHeight);
}
-IMPL_LINK(ColorSliderControl, DoButtonDown, const MouseEvent&, rMEvt, void)
+void ColorSliderControl::MouseButtonDown(const MouseEvent& rMEvt)
{
- m_xDrawingArea->connect_mouse_move(LINK(this, ColorSliderControl, DoMouseMove));
+ grab_add();
+ mbMouseCaptured = true;
ChangePosition(rMEvt.GetPosPixel().Y());
Modify();
}
-IMPL_LINK(ColorSliderControl, DoMouseMove, const MouseEvent&, rMEvt, void)
+void ColorSliderControl::MouseMove(const MouseEvent& rMEvt)
{
- ChangePosition(rMEvt.GetPosPixel().Y());
- Modify();
+ if (mbMouseCaptured)
+ {
+ ChangePosition(rMEvt.GetPosPixel().Y());
+ Modify();
+ }
}
-IMPL_LINK_NOARG(ColorSliderControl, DoButtonUp, const MouseEvent&, void)
+void ColorSliderControl::MouseButtonUp(const MouseEvent&)
{
- m_xDrawingArea->connect_mouse_move(Link<const MouseEvent&, void>());
+ grab_remove();
+ mbMouseCaptured = false;
}
-IMPL_LINK(ColorSliderControl, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
+void ColorSliderControl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
- vcl::RenderContext& rRenderContext = aPayload.first;
-
if (!mxBitmap)
UpdateBitmap();
- const Size aSize(m_aSize);
+ const Size aSize(GetOutputSizePixel());
Point aPos;
int x = aSize.Width();
@@ -698,14 +688,10 @@ IMPL_LINK(ColorSliderControl, DoPaint, weld::DrawingArea::draw_args, aPayload, v
}
}
-IMPL_LINK(ColorSliderControl, DoResize, const Size&, rSize, void)
+void ColorSliderControl::Resize()
{
- if (m_aSize != rSize)
- {
- m_aSize = rSize;
- UpdateBitmap();
- m_xDrawingArea->queue_draw();
- }
+ CustomWidgetController::Resize();
+ UpdateBitmap();
}
void ColorSliderControl::Modify()
@@ -720,21 +706,26 @@ void ColorSliderControl::SetValue(const Color& rColor, ColorMode eMode, double d
{
maColor = rColor;
mdValue = dValue;
- mnLevel = static_cast<sal_Int16>((1.0-dValue) * m_aSize.Height());
+ mnLevel = static_cast<sal_Int16>((1.0-dValue) * GetOutputSizePixel().Height());
meMode = eMode;
if (bUpdateBitmap)
UpdateBitmap();
- m_xDrawingArea->queue_draw();
+ Invalidate();
}
}
class ColorPickerDialog : public weld::GenericDialogController
{
private:
- std::unique_ptr<ColorFieldControl> m_xColorField;
- std::unique_ptr<ColorSliderControl> m_xColorSlider;
- std::unique_ptr<ColorPreviewControl> m_xColorPreview;
- std::unique_ptr<ColorPreviewControl> m_xColorPrevious;
+ ColorFieldControl m_aColorField;
+ ColorSliderControl m_aColorSlider;
+ ColorPreviewControl m_aColorPreview;
+ ColorPreviewControl m_aColorPrevious;
+
+ std::unique_ptr<weld::CustomWeld> m_xColorField;
+ std::unique_ptr<weld::CustomWeld> m_xColorSlider;
+ std::unique_ptr<weld::CustomWeld> m_xColorPreview;
+ std::unique_ptr<weld::CustomWeld> m_xColorPrevious;
std::unique_ptr<weld::Widget> m_xFISliderLeft;
std::unique_ptr<weld::Widget> m_xFISliderRight;
@@ -785,10 +776,10 @@ private:
ColorPickerDialog::ColorPickerDialog(weld::Window* pParent, Color nColor, sal_Int16 nDialogMode)
: GenericDialogController(pParent, "cui/ui/colorpickerdialog.ui", "ColorPicker")
- , m_xColorField(new ColorFieldControl(m_xBuilder->weld_drawing_area("colorField")))
- , m_xColorSlider(new ColorSliderControl(m_xBuilder->weld_drawing_area("colorSlider")))
- , m_xColorPreview(new ColorPreviewControl(m_xBuilder->weld_drawing_area("preview")))
- , m_xColorPrevious(new ColorPreviewControl(m_xBuilder->weld_drawing_area("previous")))
+ , m_xColorField(new weld::CustomWeld(*m_xBuilder, "colorField", m_aColorField))
+ , m_xColorSlider(new weld::CustomWeld(*m_xBuilder, "colorSlider", m_aColorSlider))
+ , m_xColorPreview(new weld::CustomWeld(*m_xBuilder, "preview", m_aColorPreview))
+ , m_xColorPrevious(new weld::CustomWeld(*m_xBuilder, "previous", m_aColorPrevious))
, m_xFISliderLeft(m_xBuilder->weld_widget("leftImage"))
, m_xFISliderRight(m_xBuilder->weld_widget("rightImage"))
, m_xRBRed(m_xBuilder->weld_radio_button("redRadiobutton"))
@@ -810,8 +801,8 @@ ColorPickerDialog::ColorPickerDialog(weld::Window* pParent, Color nColor, sal_In
, m_xMFKey(m_xBuilder->weld_metric_spin_button("keySpinbutton", FUNIT_PERCENT))
, meMode( DefaultMode )
{
- m_xColorField->SetModifyHdl( LINK( this, ColorPickerDialog, ColorFieldControlModifydl ) );
- m_xColorSlider->SetModifyHdl( LINK( this, ColorPickerDialog, ColorSliderControlModifyHdl ) );
+ m_aColorField.SetModifyHdl( LINK( this, ColorPickerDialog, ColorFieldControlModifydl ) );
+ m_aColorSlider.SetModifyHdl( LINK( this, ColorPickerDialog, ColorSliderControlModifyHdl ) );
int nMargin = (m_xFISliderLeft->get_preferred_size().Height() + 1) / 2;
m_xColorSlider->set_margin_top(nMargin);
@@ -847,7 +838,7 @@ ColorPickerDialog::ColorPickerDialog(weld::Window* pParent, Color nColor, sal_In
// modify
if (nDialogMode == 2)
{
- m_xColorPrevious->SetColor(aColor);
+ m_aColorPrevious.SetColor(aColor);
m_xColorPrevious->show();
}
@@ -906,22 +897,22 @@ void ColorPickerDialog::update_color( UpdateFlags n )
switch( meMode )
{
case HUE:
- m_xColorField->SetValues(aColor, meMode, mdSat, mdBri);
+ m_aColorField.SetValues(aColor, meMode, mdSat, mdBri);
break;
case SATURATION:
- m_xColorField->SetValues(aColor, meMode, mdHue / 360.0, mdBri);
+ m_aColorField.SetValues(aColor, meMode, mdHue / 360.0, mdBri);
break;
case BRIGHTNESS:
- m_xColorField->SetValues(aColor, meMode, mdHue / 360.0, mdSat);
+ m_aColorField.SetValues(aColor, meMode, mdHue / 360.0, mdSat);
break;
case RED:
- m_xColorField->SetValues(aColor, meMode, mdBlue, mdGreen);
+ m_aColorField.SetValues(aColor, meMode, mdBlue, mdGreen);
break;
case GREEN:
- m_xColorField->SetValues(aColor, meMode, mdBlue, mdRed);
+ m_aColorField.SetValues(aColor, meMode, mdBlue, mdRed);
break;
case BLUE:
- m_xColorField->SetValues(aColor, meMode, mdRed, mdGreen);
+ m_aColorField.SetValues(aColor, meMode, mdRed, mdGreen);
break;
}
}
@@ -931,39 +922,39 @@ void ColorPickerDialog::update_color( UpdateFlags n )
switch (meMode)
{
case HUE:
- m_xColorSlider->SetValue(aColor, meMode, mdHue / 360.0);
+ m_aColorSlider.SetValue(aColor, meMode, mdHue / 360.0);
break;
case SATURATION:
- m_xColorSlider->SetValue(aColor, meMode, mdSat);
+ m_aColorSlider.SetValue(aColor, meMode, mdSat);
break;
case BRIGHTNESS:
- m_xColorSlider->SetValue(aColor, meMode, mdBri);
+ m_aColorSlider.SetValue(aColor, meMode, mdBri);
break;
case RED:
- m_xColorSlider->SetValue(aColor, meMode, mdRed);
+ m_aColorSlider.SetValue(aColor, meMode, mdRed);
break;
case GREEN:
- m_xColorSlider->SetValue(aColor, meMode, mdGreen);
+ m_aColorSlider.SetValue(aColor, meMode, mdGreen);
break;
case BLUE:
- m_xColorSlider->SetValue(aColor, meMode, mdBlue);
+ m_aColorSlider.SetValue(aColor, meMode, mdBlue);
break;
}
}
if (n & UpdateFlags::Hex) // update hex
{
- m_xFISliderLeft->set_margin_top(m_xColorSlider->GetLevel());
- m_xFISliderRight->set_margin_top(m_xColorSlider->GetLevel());
+ m_xFISliderLeft->set_margin_top(m_aColorSlider.GetLevel());
+ m_xFISliderRight->set_margin_top(m_aColorSlider.GetLevel());
m_xEDHex->SetColor(aColor);
}
- m_xColorPreview->SetColor(aColor);
+ m_aColorPreview.SetColor(aColor);
}
IMPL_LINK_NOARG(ColorPickerDialog, ColorFieldControlModifydl, ColorFieldControl&, void)
{
- double x = m_xColorField->GetX();
- double y = m_xColorField->GetY();
+ double x = m_aColorField.GetX();
+ double y = m_aColorField.GetY();
switch( meMode )
{
@@ -998,7 +989,7 @@ IMPL_LINK_NOARG(ColorPickerDialog, ColorFieldControlModifydl, ColorFieldControl&
IMPL_LINK_NOARG(ColorPickerDialog, ColorSliderControlModifyHdl, ColorSliderControl&, void)
{
- double dValue = m_xColorSlider->GetValue();
+ double dValue = m_aColorSlider.GetValue();
switch (meMode)
{
case HUE:
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index 4727baca0fc2..5af66b617022 100755
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -59,6 +59,39 @@ SvxCharacterMap::SvxCharacterMap(weld::Window* pParent, const SfxItemSet* pSet,
, isSearchMode(true)
, m_bHasInsert(bInsert)
, mxContext(comphelper::getProcessComponentContext())
+ , m_aRecentCharView{SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev)}
+ , m_aFavCharView{SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev),
+ SvxCharView(m_xVirDev)}
+ , m_aShowChar(m_xVirDev)
, m_xOKBtn(bInsert ? m_xBuilder->weld_button("insert") : m_xBuilder->weld_button("ok"))
, m_xFontText(m_xBuilder->weld_label("fontft"))
, m_xFontLB(m_xBuilder->weld_combo_box_text("fontlb"))
@@ -71,53 +104,55 @@ SvxCharacterMap::SvxCharacterMap(weld::Window* pParent, const SfxItemSet* pSet,
, m_xCharName(m_xBuilder->weld_label("charname"))
, m_xRecentGrid(m_xBuilder->weld_widget("viewgrid"))
, m_xFavGrid(m_xBuilder->weld_widget("favgrid"))
- , m_xShowChar(new SvxShowText(*m_xBuilder, "showchar", m_xVirDev))
- , m_xRecentCharView{o3tl::make_unique<SvxCharView>(*m_xBuilder, "viewchar1", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "viewchar2", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "viewchar3", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "viewchar4", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "viewchar5", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "viewchar6", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "viewchar7", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "viewchar8", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "viewchar9", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "viewchar10", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "viewchar11", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "viewchar12", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "viewchar13", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "viewchar14", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "viewchar15", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "viewchar16", m_xVirDev)}
- , m_xFavCharView{o3tl::make_unique<SvxCharView>(*m_xBuilder, "favchar1", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "favchar2", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "favchar3", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "favchar4", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "favchar5", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "favchar6", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "favchar7", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "favchar8", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "favchar9", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "favchar10", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "favchar11", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "favchar12", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "favchar13", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "favchar14", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "favchar15", m_xVirDev),
- o3tl::make_unique<SvxCharView>(*m_xBuilder, "favchar16", m_xVirDev)}
- , m_xShowSet(new SvxShowCharSet(*m_xBuilder, "showcharset", "showscroll", m_xVirDev))
- , m_xSearchSet(new SvxSearchCharSet(*m_xBuilder, "searchcharset", "searchscroll", m_xVirDev))
+ , m_xShowChar(new weld::CustomWeld(*m_xBuilder, "showchar", m_aShowChar))
+ , m_xRecentCharView{o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar1", m_aRecentCharView[0]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar2", m_aRecentCharView[1]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar3", m_aRecentCharView[2]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar4", m_aRecentCharView[3]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar5", m_aRecentCharView[4]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar6", m_aRecentCharView[5]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar7", m_aRecentCharView[6]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar8", m_aRecentCharView[7]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar9", m_aRecentCharView[8]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar10", m_aRecentCharView[9]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar11", m_aRecentCharView[10]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar12", m_aRecentCharView[11]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar13", m_aRecentCharView[12]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar14", m_aRecentCharView[13]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar15", m_aRecentCharView[14]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "viewchar16", m_aRecentCharView[15])}
+ , m_xFavCharView{o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "favchar1", m_aFavCharView[0]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "favchar2", m_aFavCharView[1]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "favchar3", m_aFavCharView[2]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "favchar4", m_aFavCharView[3]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "favchar5", m_aFavCharView[4]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "favchar6", m_aFavCharView[5]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "favchar7", m_aFavCharView[6]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "favchar8", m_aFavCharView[7]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "favchar9", m_aFavCharView[8]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "favchar10", m_aFavCharView[9]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "favchar11", m_aFavCharView[10]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "favchar12", m_aFavCharView[11]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "favchar13", m_aFavCharView[12]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "favchar14", m_aFavCharView[13]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "favchar15", m_aFavCharView[14]),
+ o3tl::make_unique<weld::CustomWeld>(*m_xBuilder, "favchar16", m_aFavCharView[15])}
+ , m_xShowSet(new SvxShowCharSet(m_xBuilder->weld_scrolled_window("showscroll"), m_xVirDev))
+ , m_xShowSetArea(new weld::CustomWeld(*m_xBuilder, "showcharset", *m_xShowSet))
+ , m_xSearchSet(new SvxSearchCharSet(m_xBuilder->weld_scrolled_window("searchscroll"), m_xVirDev))
+ , m_xSearchSetArea(new weld::CustomWeld(*m_xBuilder, "searchcharset", *m_xSearchSet))
{
- m_xShowChar->SetCentered(true);
+ m_aShowChar.SetCentered(true);
m_xFontLB->make_sorted();
//lock the size request of this widget to the width of all possible entries
fillAllSubsets(*m_xSubsetLB);
m_xSubsetLB->set_size_request(m_xSubsetLB->get_preferred_size().Width(), -1);
- m_xCharName->set_size_request(m_xShowChar->get_preferred_size().Width(), m_xCharName->get_text_height() * 4);
+ m_xCharName->set_size_request(m_aShowChar.get_preferred_size().Width(), m_xCharName->get_text_height() * 4);
//lock the size request of this widget to the width of the original .ui string
m_xHexCodeText->set_size_request(m_xHexCodeText->get_preferred_size().Width(), -1);
//so things don't jump around if all the children are hidden
- m_xRecentGrid->set_size_request(-1, m_xRecentCharView[0]->get_preferred_size().Height());
- m_xFavGrid->set_size_request(-1, m_xFavCharView[0]->get_preferred_size().Height());
+ m_xRecentGrid->set_size_request(-1, m_aRecentCharView[0].get_preferred_size().Height());
+ m_xFavGrid->set_size_request(-1, m_aFavCharView[0].get_preferred_size().Height());
init();
@@ -162,9 +197,9 @@ short SvxCharacterMap::execute()
sal_UCS4 cChar = m_xShowSet->GetSelectCharacter();
// using the new UCS4 constructor
OUString aOUStr( &cChar, 1 );
- m_xShowChar->SetText(aOUStr);
+ m_aShowChar.SetText(aOUStr);
- setFavButtonState(aOUStr, m_xShowChar->GetFont().GetFamilyName());
+ setFavButtonState(aOUStr, m_aShowChar.GetFont().GetFamilyName());
m_xOKBtn->set_sensitive(true);
}
@@ -177,13 +212,11 @@ void SvxCharacterMap::SetChar( sal_UCS4 c )
setFavButtonState(OUString(&c, 1), aFont.GetFamilyName());
}
-
sal_UCS4 SvxCharacterMap::GetChar() const
{
- return (m_xShowChar->GetText()).toChar();
+ return (m_aShowChar.GetText()).toChar();
}
-
void SvxCharacterMap::DisableFontSelection()
{
m_xFontText->set_sensitive(false);
@@ -236,17 +269,17 @@ void SvxCharacterMap::updateRecentCharControl()
it != maRecentCharList.end() || it2 != maRecentCharFontList.end();
++it, ++it2, i++)
{
- m_xRecentCharView[i]->SetText(*it);
- vcl::Font rFont = m_xRecentCharView[i]->GetFont();
+ m_aRecentCharView[i].SetText(*it);
+ vcl::Font rFont = m_aRecentCharView[i].GetFont();
rFont.SetFamilyName( *it2 );
- m_xRecentCharView[i]->SetFont(rFont);
- m_xRecentCharView[i]->Show();
+ m_aRecentCharView[i].SetFont(rFont);
+ m_aRecentCharView[i].Show();
}
for(; i < 16 ; i++)
{
- m_xRecentCharView[i]->SetText(OUString());
- m_xRecentCharView[i]->Hide();
+ m_aRecentCharView[i].SetText(OUString());
+ m_aRecentCharView[i].Hide();
}
}
@@ -343,17 +376,17 @@ void SvxCharacterMap::updateFavCharControl()
it != maFavCharList.end() || it2 != maFavCharFontList.end();
++it, ++it2, i++)
{
- m_xFavCharView[i]->SetText(*it);
- vcl::Font rFont = m_xFavCharView[i]->GetFont();
+ m_aFavCharView[i].SetText(*it);
+ vcl::Font rFont = m_aFavCharView[i].GetFont();
rFont.SetFamilyName( *it2 );
- m_xFavCharView[i]->SetFont(rFont);
- m_xFavCharView[i]->Show();
+ m_aFavCharView[i].SetFont(rFont);
+ m_aFavCharView[i].Show();
}
for(; i < 16 ; i++)
{
- m_xFavCharView[i]->SetText(OUString());
- m_xFavCharView[i]->Hide();
+ m_aFavCharView[i].SetText(OUString());
+ m_aFavCharView[i].Hide();
}
m_xShowSet->getFavCharacterList();
m_xSearchSet->getFavCharacterList();
@@ -467,7 +500,7 @@ void SvxCharacterMap::init()
sal_UCS4 cChar = m_xShowSet->GetSelectCharacter();
// using the new UCS4 constructor
OUString aOUStr( &cChar, 1 );
- m_xShowChar->SetText(aOUStr);
+ m_aShowChar.SetText(aOUStr);
setFavButtonState(aOUStr, aDefStr);
m_xOKBtn->set_sensitive(true);
@@ -481,14 +514,14 @@ void SvxCharacterMap::init()
for(int i = 0; i < 16; i++)
{
- m_xRecentCharView[i]->SetHasInsert(m_bHasInsert);
- m_xRecentCharView[i]->setMouseClickHdl(LINK(this,SvxCharacterMap, CharClickHdl));
- m_xRecentCharView[i]->setClearClickHdl(LINK(this,SvxCharacterMap, RecentClearClickHdl));
- m_xRecentCharView[i]->setClearAllClickHdl(LINK(this,SvxCharacterMap, RecentClearAllClickHdl));
- m_xFavCharView[i]->SetHasInsert(m_bHasInsert);
- m_xFavCharView[i]->setMouseClickHdl(LINK(this,SvxCharacterMap, CharClickHdl));
- m_xFavCharView[i]->setClearClickHdl(LINK(this,SvxCharacterMap, FavClearClickHdl));
- m_xFavCharView[i]->setClearAllClickHdl(LINK(this,SvxCharacterMap, FavClearAllClickHdl));
+ m_aRecentCharView[i].SetHasInsert(m_bHasInsert);
+ m_aRecentCharView[i].setMouseClickHdl(LINK(this,SvxCharacterMap, CharClickHdl));
+ m_aRecentCharView[i].setClearClickHdl(LINK(this,SvxCharacterMap, RecentClearClickHdl));
+ m_aRecentCharView[i].setClearAllClickHdl(LINK(this,SvxCharacterMap, RecentClearAllClickHdl));
+ m_aFavCharView[i].SetHasInsert(m_bHasInsert);
+ m_aFavCharView[i].setMouseClickHdl(LINK(this,SvxCharacterMap, CharClickHdl));
+ m_aFavCharView[i].setClearClickHdl(LINK(this,SvxCharacterMap, FavClearClickHdl));
+ m_aFavCharView[i].setClearAllClickHdl(LINK(this,SvxCharacterMap, FavClearAllClickHdl));
}
setCharName(90);
@@ -614,7 +647,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl, weld::ComboBoxText&, void)
// notify children using this font
m_xShowSet->SetFont( aFont );
m_xSearchSet->SetFont( aFont );
- m_xShowChar->SetFont( aFont );
+ m_aShowChar.SetFont( aFont );
if (isSearchMode)
{
SearchUpdateHdl(*m_xSearchText);
@@ -841,12 +874,12 @@ IMPL_LINK_NOARG(SvxCharacterMap, SearchUpdateHdl, weld::Entry&, void)
IMPL_LINK(SvxCharacterMap, CharClickHdl, SvxCharView*, rView, void)
{
- m_xShowChar->SetText( rView->GetText() );
- m_xShowChar->SetFont(rView->GetFont());
- m_xShowChar->queue_draw();
+ m_aShowChar.SetText( rView->GetText() );
+ m_aShowChar.SetFont(rView->GetFont());
+ m_aShowChar.Invalidate();
setFavButtonState(rView->GetText(), rView->GetFont().GetFamilyName());//check state
- rView->grab_focus();
+ rView->GrabFocus();
// Get the hexadecimal code
OUString charValue = rView->GetText();
@@ -861,7 +894,7 @@ IMPL_LINK(SvxCharacterMap, CharClickHdl, SvxCharView*, rView, void)
m_xDecimalCodeText->set_text(aDecimalText);
setCharName(cChar);
- rView->queue_draw();
+ rView->Invalidate();
m_xOKBtn->set_sensitive(true);
}
@@ -895,7 +928,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, SearchCharSelectHdl, SvxShowCharSet*, void)
IMPL_LINK_NOARG(SvxCharacterMap, InsertClickHdl, weld::Button&, void)
{
- insertCharToDoc(m_xShowChar->GetText());
+ insertCharToDoc(m_aShowChar.GetText());
m_xDialog->response(RET_OK);
}
@@ -903,12 +936,12 @@ IMPL_LINK_NOARG(SvxCharacterMap, FavSelectHdl, weld::Button&, void)
{
if (m_xFavouritesBtn->get_label().match(CuiResId(RID_SVXSTR_ADD_FAVORITES)))
{
- updateFavCharacterList(m_xShowChar->GetText(), m_xShowChar->GetFont().GetFamilyName());
- setFavButtonState(m_xShowChar->GetText(), m_xShowChar->GetFont().GetFamilyName());
+ updateFavCharacterList(m_aShowChar.GetText(), m_aShowChar.GetFont().GetFamilyName());
+ setFavButtonState(m_aShowChar.GetText(), m_aShowChar.GetFont().GetFamilyName());
}
else
{
- deleteFavCharacterFromList(m_xShowChar->GetText(), m_xShowChar->GetFont().GetFamilyName());
+ deleteFavCharacterFromList(m_aShowChar.GetText(), m_aShowChar.GetFont().GetFamilyName());
m_xFavouritesBtn->set_label(CuiResId(RID_SVXSTR_ADD_FAVORITES));
m_xFavouritesBtn->set_sensitive(false);
}
@@ -958,9 +991,9 @@ IMPL_LINK_NOARG(SvxCharacterMap, CharHighlightHdl, SvxShowCharSet*, void)
if(m_xShowSet->HasFocus() || m_xHexCodeText->has_focus() || m_xDecimalCodeText->has_focus() )
{
- m_xShowChar->SetText( aText );
- m_xShowChar->SetFont( aFont );
- m_xShowChar->queue_draw();
+ m_aShowChar.SetText( aText );
+ m_aShowChar.SetFont( aFont );
+ m_aShowChar.Invalidate();
setFavButtonState(aText, aFont.GetFamilyName());
}
@@ -1001,9 +1034,9 @@ IMPL_LINK_NOARG(SvxCharacterMap, SearchCharHighlightHdl, SvxShowCharSet*, void)
if(m_xSearchSet->HasFocus())
{
- m_xShowChar->SetText( aText );
- m_xShowChar->SetFont( aFont );
- m_xShowChar->queue_draw();
+ m_aShowChar.SetText( aText );
+ m_aShowChar.SetFont( aFont );
+ m_aShowChar.Invalidate();
setFavButtonState(aText, aFont.GetFamilyName());
}
@@ -1031,7 +1064,7 @@ void SvxCharacterMap::selectCharByCode(Radix radix)
SetChar(cChar);
else {
m_xCharName->set_label(CuiResId(RID_SVXSTR_MISSING_GLYPH));
- m_xShowChar->SetText(" ");
+ m_aShowChar.SetText(" ");
switch(radix)
{
case Radix::decimal:
@@ -1087,29 +1120,28 @@ IMPL_LINK_NOARG(SvxCharacterMap, SearchCharPreSelectHdl, SvxShowCharSet*, void)
}
// class SvxShowText =====================================================
-SvxShowText::SvxShowText(weld::Builder& rBuilder, const OString& rId, const VclPtr<VirtualDevice>& rVirDev)
- : m_xDrawingArea(rBuilder.weld_drawing_area(rId))
- , m_xVirDev(rVirDev)
+SvxShowText::SvxShowText(const VclPtr<VirtualDevice>& rVirDev)
+ : m_xVirDev(rVirDev)
, mnY(0)
, mbCenter(false)
{
- m_xDrawingArea->connect_size_allocate(LINK(this, SvxShowText, DoResize));
- m_xDrawingArea->connect_draw(LINK(this, SvxShowText, DoPaint));
+}
+void SvxShowText::SetDrawingArea(weld::DrawingArea* pDrawingArea)
+{
vcl::Font aFont = m_xVirDev->GetFont();
Size aFontSize(aFont.GetFontSize().Width() * 5, aFont.GetFontSize().Height() * 5);
aFont.SetFontSize(aFontSize);
m_xVirDev->Push(PUSH_ALLFONT);
m_xVirDev->SetFont(aFont);
- m_xDrawingArea->set_size_request(m_xVirDev->approximate_digit_width() + 2 * 12,
- m_xVirDev->LogicToPixel(aFontSize).Height() * 2);
+ pDrawingArea->set_size_request(m_xVirDev->approximate_digit_width() + 2 * 12,
+ m_xVirDev->LogicToPixel(aFontSize).Height() * 2);
+ CustomWidgetController::SetDrawingArea(pDrawingArea);
m_xVirDev->Pop();
}
-IMPL_LINK(SvxShowText, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
+void SvxShowText::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
- vcl::RenderContext& rRenderContext = aPayload.first;
-
rRenderContext.SetFont(m_aFont);
Color aTextCol = rRenderContext.GetTextColor();
@@ -1123,8 +1155,9 @@ IMPL_LINK(SvxShowText, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
const OUString aText = GetText();
- long nAvailWidth = m_aSize.Width();
- long nWinHeight = m_aSize.Height();
+ Size aSize(GetOutputSizePixel());
+ long nAvailWidth = aSize.Width();
+ long nWinHeight = aSize.Height();
bool bGotBoundary = true;
bool bShrankFont = false;
@@ -1156,7 +1189,7 @@ IMPL_LINK(SvxShowText, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
Point aPoint(2, mnY);
// adjust position using ink boundary if possible
if (!bGotBoundary)
- aPoint.setX( (m_aSize.Width() - rRenderContext.GetTextWidth(aText)) / 2 );
+ aPoint.setX( (aSize.Width() - rRenderContext.GetTextWidth(aText)) / 2 );
else
{
// adjust position before it gets out of bounds
@@ -1164,7 +1197,7 @@ IMPL_LINK(SvxShowText, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
// shift back vertically if needed
int nYLDelta = aBoundRect.Top();
- int nYHDelta = m_aSize.Height() - aBoundRect.Bottom();
+ int nYHDelta = aSize.Height() - aBoundRect.Bottom();
if( nYLDelta <= 0 )
aPoint.AdjustY( -(nYLDelta - 1) );
else if( nYHDelta <= 0 )
@@ -1173,13 +1206,13 @@ IMPL_LINK(SvxShowText, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
if (mbCenter)
{
// move glyph to middle of cell
- aPoint.setX( -aBoundRect.Left() + (m_aSize.Width() - aBoundRect.GetWidth()) / 2 );
+ aPoint.setX( -aBoundRect.Left() + (aSize.Width() - aBoundRect.GetWidth()) / 2 );
}
else
{
// shift back horizontally if needed
int nXLDelta = aBoundRect.Left();
- int nXHDelta = m_aSize.Width() - aBoundRect.Right();
+ int nXHDelta = aSize.Width() - aBoundRect.Right();
if( nXLDelta <= 0 )
aPoint.AdjustX( -(nXLDelta - 1) );
else if( nXHDelta <= 0 )
@@ -1187,7 +1220,7 @@ IMPL_LINK(SvxShowText, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
}
}
- rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), m_aSize));
+ rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), aSize));
rRenderContext.DrawText(aPoint, aText);
rRenderContext.SetTextColor(aTextCol);
rRenderContext.SetFillColor(aFillCol);
@@ -1195,10 +1228,9 @@ IMPL_LINK(SvxShowText, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
rRenderContext.SetFont(aOrigFont);
}
-
void SvxShowText::SetFont( const vcl::Font& rFont )
{
- long nWinHeight = m_aSize.Height();
+ long nWinHeight = GetOutputSizePixel().Height();
m_aFont = vcl::Font(rFont);
m_aFont.SetWeight(WEIGHT_NORMAL);
@@ -1211,19 +1243,18 @@ void SvxShowText::SetFont( const vcl::Font& rFont )
mnY = (nWinHeight - m_xVirDev->GetTextHeight()) / 2;
m_xVirDev->Pop();
- m_xDrawingArea->queue_draw();
+ Invalidate();
}
-IMPL_LINK(SvxShowText, DoResize, const Size&, rSize, void)
+void SvxShowText::Resize()
{
- m_aSize = rSize;
SetFont(GetFont()); //force recalculation of size
}
void SvxShowText::SetText(const OUString& rText)
{
m_sText = rText;
- queue_draw();
+ Invalidate();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/inc/cuicharmap.hxx b/cui/source/inc/cuicharmap.hxx
index 86bc53052827..e99a0f81573a 100644
--- a/cui/source/inc/cuicharmap.hxx
+++ b/cui/source/inc/cuicharmap.hxx
@@ -24,6 +24,7 @@
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
+#include <vcl/customweld.hxx>
#include <vcl/weld.hxx>
#include <sfx2/basedlgs.hxx>
#include <svl/itemset.hxx>
@@ -41,21 +42,20 @@ namespace svx
struct SvxShowCharSetItem;
}
-class SvxShowText
+class SvxShowText : public weld::CustomWidgetController
{
private:
- std::unique_ptr<weld::DrawingArea> m_xDrawingArea;
VclPtr<VirtualDevice> m_xVirDev;
- Size m_aSize;
OUString m_sText;
long mnY;
bool mbCenter;
vcl::Font m_aFont;
- DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
- DECL_LINK(DoResize, const Size& rSize, void);
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override;
+ virtual void Resize() override;
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
public:
- SvxShowText(weld::Builder& rBuilder, const OString& rId, const VclPtr<VirtualDevice>& rVirDev);
+ SvxShowText(const VclPtr<VirtualDevice>& rVirDev);
void SetFont(const vcl::Font& rFont);
vcl::Font GetFont() const { return m_aFont; }
@@ -63,8 +63,7 @@ public:
OUString GetText() const { return m_sText; }
void SetCentered(bool bCenter) { mbCenter = bCenter; }
- void queue_draw() { m_xDrawingArea->queue_draw(); }
- Size get_preferred_size() const { return m_xDrawingArea->get_preferred_size(); }
+ Size get_preferred_size() const { return GetDrawingArea()->get_preferred_size(); }
};
/** The main purpose of this dialog is to enable the use of characters
@@ -86,6 +85,10 @@ private:
std::deque<OUString> maFavCharFontList;
uno::Reference< uno::XComponentContext > mxContext;
+ SvxCharView m_aRecentCharView[16];
+ SvxCharView m_aFavCharView[16];
+ SvxShowText m_aShowChar;
+
std::unique_ptr<weld::Button> m_xOKBtn;
std::unique_ptr<weld::Label> m_xFontText;
std::unique_ptr<weld::ComboBoxText> m_xFontLB;
@@ -98,11 +101,13 @@ private:
std::unique_ptr<weld::Label> m_xCharName;
std::unique_ptr<weld::Widget> m_xRecentGrid;
std::unique_ptr<weld::Widget> m_xFavGrid;
- std::unique_ptr<SvxShowText> m_xShowChar;
- std::unique_ptr<SvxCharView> m_xRecentCharView[16];
- std::unique_ptr<SvxCharView> m_xFavCharView[16];
+ std::unique_ptr<weld::CustomWeld> m_xShowChar;
+ std::unique_ptr<weld::CustomWeld> m_xRecentCharView[16];
+ std::unique_ptr<weld::CustomWeld> m_xFavCharView[16];
std::unique_ptr<SvxShowCharSet> m_xShowSet;
+ std::unique_ptr<weld::CustomWeld> m_xShowSetArea;
std::unique_ptr<SvxSearchCharSet> m_xSearchSet;
+ std::unique_ptr<weld::CustomWeld> m_xSearchSetArea;
std::unique_ptr<SfxAllItemSet> m_xOutputSet;
diff --git a/cui/source/inc/textattr.hxx b/cui/source/inc/textattr.hxx
index 88a5f7d7113d..f0929e16109b 100644
--- a/cui/source/inc/textattr.hxx
+++ b/cui/source/inc/textattr.hxx
@@ -50,6 +50,8 @@ private:
bool bWordWrapTextEnabled;
bool bFitToSizeEnabled;
+ RectCtl m_aCtlPosition;
+
std::unique_ptr<weld::Widget> m_xDrawingText;
std::unique_ptr<weld::Widget> m_xCustomShapeText;
std::unique_ptr<weld::CheckButton> m_xTsbAutoGrowWidth;
@@ -64,7 +66,7 @@ private:
std::unique_ptr<weld::MetricSpinButton> m_xMtrFldTop;
std::unique_ptr<weld::MetricSpinButton> m_xMtrFldBottom;
std::unique_ptr<weld::Frame> m_xFlPosition;
- std::unique_ptr<RectCtl> m_xCtlPosition;
+ std::unique_ptr<weld::CustomWeld> m_xCtlPosition;
std::unique_ptr<weld::CheckButton> m_xTsbFullWidth;
DECL_LINK(ClickFullWidthHdl_Impl, weld::Button&, void);
diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx
index 092ef3966ffa..3013bd6038d7 100644
--- a/cui/source/tabpages/textattr.cxx
+++ b/cui/source/tabpages/textattr.cxx
@@ -63,6 +63,7 @@ SvxTextAttrPage::SvxTextAttrPage(TabPageParent pPage, const SfxItemSet& rInAttrs
, bAutoGrowHeightEnabled(false)
, bWordWrapTextEnabled(false)
, bFitToSizeEnabled(false)
+ , m_aCtlPosition(this)
, m_xDrawingText(m_xBuilder->weld_widget("drawingtext"))
, m_xCustomShapeText(m_xBuilder->weld_widget("customshapetext"))
, m_xTsbAutoGrowWidth(m_xBuilder->weld_check_button("TSB_AUTOGROW_WIDTH"))
@@ -77,10 +78,10 @@ SvxTextAttrPage::SvxTextAttrPage(TabPageParent pPage, const SfxItemSet& rInAttrs
, m_xMtrFldTop(m_xBuilder->weld_metric_spin_button("MTR_FLD_TOP", FUNIT_CM))
, m_xMtrFldBottom(m_xBuilder->weld_metric_spin_button("MTR_FLD_BOTTOM", FUNIT_CM))
, m_xFlPosition(m_xBuilder->weld_frame("FL_POSITION"))
- , m_xCtlPosition(new RectCtl(*m_xBuilder, "CTL_POSITION", this))
+ , m_xCtlPosition(new weld::CustomWeld(*m_xBuilder, "CTL_POSITION", m_aCtlPosition))
, m_xTsbFullWidth(m_xBuilder->weld_check_button("TSB_FULL_WIDTH"))
{
- m_xCtlPosition->SetControlSettings(RectPoint::MM, 240, 100);
+ m_aCtlPosition.SetControlSettings(RectPoint::MM, 240, 100);
FieldUnit eFUnit = GetModuleFieldUnit( rInAttrs );
SetFieldUnit( *m_xMtrFldLeft, eFUnit );
@@ -264,15 +265,15 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
m_xTsbFullWidth->set_state(TRISTATE_TRUE);
}
- m_xCtlPosition->SetActualRP( eRP );
+ m_aCtlPosition.SetActualRP( eRP );
}
else
{
// VertAdjust or HorAdjust is not unequivocal
- m_xCtlPosition->Reset();
+ m_aCtlPosition.Reset();
- m_xCtlPosition->SetState(CTL_STATE::NOVERT);
- m_xCtlPosition->DoCompletelyDisable(true);
+ m_aCtlPosition.SetState(CTL_STATE::NOVERT);
+ m_aCtlPosition.DoCompletelyDisable(true);
m_xTsbFullWidth->set_state(TRISTATE_INDET);
m_xFlPosition->set_sensitive( false );
@@ -389,7 +390,7 @@ bool SvxTextAttrPage::FillItemSet( SfxItemSet* rAttrs)
}
// centered
- RectPoint eRP = m_xCtlPosition->GetActualRP();
+ RectPoint eRP = m_aCtlPosition.GetActualRP();
SdrTextVertAdjust eTVA, eOldTVA;
SdrTextHorzAdjust eTHA, eOldTHA;
@@ -417,7 +418,7 @@ bool SvxTextAttrPage::FillItemSet( SfxItemSet* rAttrs)
}
// #103516# Do not change values if adjust controls were disabled.
- bool bIsDisabled(m_xCtlPosition->IsCompletelyDisabled());
+ bool bIsDisabled(m_aCtlPosition.IsCompletelyDisabled());
if(!bIsDisabled)
{
@@ -591,21 +592,21 @@ IMPL_LINK_NOARG(SvxTextAttrPage, ClickFullWidthHdl_Impl, weld::Button&, void)
if (IsTextDirectionLeftToRight())
{
// Move text anchor to horizontal middle axis.
- switch( m_xCtlPosition->GetActualRP() )
+ switch( m_aCtlPosition.GetActualRP() )
{
case RectPoint::LT:
case RectPoint::RT:
- m_xCtlPosition->SetActualRP( RectPoint::MT );
+ m_aCtlPosition.SetActualRP( RectPoint::MT );
break;
case RectPoint::LM:
case RectPoint::RM:
- m_xCtlPosition->SetActualRP( RectPoint::MM );
+ m_aCtlPosition.SetActualRP( RectPoint::MM );
break;
case RectPoint::LB:
case RectPoint::RB:
- m_xCtlPosition->SetActualRP( RectPoint::MB );
+ m_aCtlPosition.SetActualRP( RectPoint::MB );
break;
default: ;//prevent warning
}
@@ -613,21 +614,21 @@ IMPL_LINK_NOARG(SvxTextAttrPage, ClickFullWidthHdl_Impl, weld::Button&, void)
else
{
// Move text anchor to vertical middle axis.
- switch( m_xCtlPosition->GetActualRP() )
+ switch( m_aCtlPosition.GetActualRP() )
{
case RectPoint::LT:
case RectPoint::LB:
- m_xCtlPosition->SetActualRP( RectPoint::LM );
+ m_aCtlPosition.SetActualRP( RectPoint::LM );
break;
case RectPoint::MT:
case RectPoint::MB:
- m_xCtlPosition->SetActualRP( RectPoint::MM );
+ m_aCtlPosition.SetActualRP( RectPoint::MM );
break;
case RectPoint::RT:
case RectPoint::RB:
- m_xCtlPosition->SetActualRP( RectPoint::RM );
+ m_aCtlPosition.SetActualRP( RectPoint::RM );
break;
default: ;//prevent warning
}
diff --git a/include/sfx2/charwin.hxx b/include/sfx2/charwin.hxx
index 992df5206e11..85c40d84b225 100644
--- a/include/sfx2/charwin.hxx
+++ b/include/sfx2/charwin.hxx
@@ -22,14 +22,13 @@
#include <sfx2/tbxctrl.hxx>
#include <sfx2/dllapi.h>
+#include <vcl/customweld.hxx>
#include <vcl/weld.hxx>
-class SFX2_DLLPUBLIC SvxCharView
+class SFX2_DLLPUBLIC SvxCharView : public weld::CustomWidgetController
{
private:
VclPtr<VirtualDevice> mxVirDev;
- std::unique_ptr<weld::DrawingArea> mxDrawingArea;
- Size m_aSize;
long mnY;
Point maPosition;
vcl::Font maFont;
@@ -40,34 +39,29 @@ private:
Link<SvxCharView*, void> maClearClickHdl;
Link<SvxCharView*, void> maClearAllClickHdl;
-
- DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
- DECL_LINK(DoResize, const Size& rSize, void);
- DECL_LINK(DoMouseButtonDown, const MouseEvent&, void);
- DECL_LINK(DoKeyDown, const KeyEvent&, bool);
- DECL_LINK(DoGetFocus, weld::Widget&, void);
- DECL_LINK(DoLoseFocus, weld::Widget&, void);
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
+ virtual void Resize() override;
+ virtual void MouseButtonDown(const MouseEvent&) override;
+ virtual void GetFocus() override;
+ virtual void LoseFocus() override;
+ virtual bool KeyInput(const KeyEvent&) override;
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
public:
- SvxCharView(weld::Builder& rBuilder, const OString& rId, const VclPtr<VirtualDevice>& rVirDev);
+ SvxCharView(const VclPtr<VirtualDevice>& rVirDev);
void SetFont( const vcl::Font& rFont );
vcl::Font GetFont() const { return maFont; }
void SetText( const OUString& rText );
OUString GetText() const { return m_sText; }
- void Show() { mxDrawingArea->show(); }
- void Hide() { mxDrawingArea->hide(); }
void SetHasInsert( bool bInsert );
void InsertCharToDoc();
void createContextMenu();
- void grab_focus() { mxDrawingArea->grab_focus(); }
- void queue_draw() { mxDrawingArea->queue_draw(); }
- Size get_preferred_size() const { return mxDrawingArea->get_preferred_size(); }
-
- void connect_focus_in(const Link<weld::Widget&, void>& rLink) { mxDrawingArea->connect_focus_in(rLink); }
- void connect_focus_out(const Link<weld::Widget&, void>& rLink) { mxDrawingArea->connect_focus_out(rLink); }
+ Size get_preferred_size() const { return GetDrawingArea()->get_preferred_size(); }
+ void connect_focus_in(const Link<weld::Widget&, void>& rLink);
+ void connect_focus_out(const Link<weld::Widget&, void>& rLink);
void setMouseClickHdl(const Link<SvxCharView*,void> &rLink);
void setClearClickHdl(const Link<SvxCharView*,void> &rLink);
diff --git a/include/sfx2/new.hxx b/include/sfx2/new.hxx
index 4eb1fa8d48c3..f5c30c23060f 100644
--- a/include/sfx2/new.hxx
+++ b/include/sfx2/new.hxx
@@ -25,6 +25,7 @@
#include <sfx2/objsh.hxx>
#include <vcl/idle.hxx>
+#include <vcl/customweld.hxx>
#include <vcl/weld.hxx>
#include <sfx2/doctempl.hxx>
#include <o3tl/typed_flags_set.hxx>
@@ -57,6 +58,13 @@ namespace o3tl
class SFX2_DLLPUBLIC SfxNewFileDialog : public weld::GenericDialogController
{
private:
+ Idle m_aPrevIdle;
+ SfxNewFileDialogMode m_nFlags;
+ SfxDocumentTemplates m_aTemplates;
+ SfxObjectShellLock m_xDocShell;
+
+ std::unique_ptr<SfxPreviewWin_Impl> m_xPreviewController;
+
std::unique_ptr<weld::TreeView> m_xRegionLb;
std::unique_ptr<weld::TreeView> m_xTemplateLb;
std::unique_ptr<weld::CheckButton> m_xTextStyleCB;
@@ -66,13 +74,8 @@ private:
std::unique_ptr<weld::CheckButton> m_xMergeStyleCB;
std::unique_ptr<weld::Button> m_xLoadFilePB;
std::unique_ptr<weld::Expander> m_xMoreBt;
- std::unique_ptr<SfxPreviewWin_Impl> m_xPreviewWin;
+ std::unique_ptr<weld::CustomWeld> m_xPreviewWin;
std::unique_ptr<weld::Label> m_xAltTitleFt;
- Idle m_aPrevIdle;
-
- SfxNewFileDialogMode m_nFlags;
- SfxDocumentTemplates m_aTemplates;
- SfxObjectShellLock m_xDocShell;
DECL_LINK( Update, Timer *, void );
diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx
index 3df37695eb75..2446c0607cbb 100644
--- a/include/svx/charmap.hxx
+++ b/include/svx/charmap.hxx
@@ -35,6 +35,7 @@
#include <vcl/outdev.hxx>
#include <vcl/metric.hxx>
#include <vcl/vclptr.hxx>
+#include <vcl/customweld.hxx>
#include <vcl/weld.hxx>
#include <vcl/window.hxx>
#include <vcl/textview.hxx>
@@ -56,19 +57,15 @@ namespace svx
class SvxShowCharSetAcc;
}
-class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxShowCharSet
+class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxShowCharSet : public weld::CustomWidgetController
{
protected:
VclPtr<VirtualDevice> mxVirDev;
- std::unique_ptr<weld::DrawingArea> mxDrawingArea;
- std::unique_ptr<weld::ScrolledWindow> mxScrollArea;
vcl::Font maFont;
- Size maSize;
+ std::unique_ptr<weld::ScrolledWindow> mxScrollArea;
public:
- SvxShowCharSet(weld::Builder& rBuilder, const OString& rDrawingId,
- const OString& rScrollId, const VclPtr<VirtualDevice>& rVirDev);
-
- virtual ~SvxShowCharSet();
+ SvxShowCharSet(weld::ScrolledWindow* pScrollArea, const VclPtr<VirtualDevice>& rVirDev);
+ virtual ~SvxShowCharSet() override;
virtual void RecalculateFont(vcl::RenderContext& rRenderContext);
@@ -106,25 +103,22 @@ public:
void Show() { mxScrollArea->show(); }
void Hide() { mxScrollArea->hide(); }
- bool HasFocus() const { return mxDrawingArea->has_focus(); }
- void GrabFocus() { mxDrawingArea->grab_focus(); }
- bool IsEnabled() const { return mxDrawingArea->get_sensitive(); }
- bool IsVisible() const { return mxDrawingArea->get_visible(); }
- const Size& GetSize() const { return maSize; }
- uno::Reference<css::accessibility::XAccessible> getAccessibleParent() { return mxDrawingArea->get_accessible_parent(); }
+ uno::Reference<css::accessibility::XAccessible> getAccessibleParent() { return GetDrawingArea()->get_accessible_parent(); }
private:
- DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
- DECL_LINK(DoResize, const Size& rSize, void);
- DECL_LINK(DoMouseButtonDown, const MouseEvent& rMEvt, void);
- DECL_LINK(DoMouseMove, const MouseEvent& rMEvt, void);
- DECL_LINK(DoMouseButtonUp, const MouseEvent& rMEvt, void);
- DECL_LINK(DoKeyDown, const KeyEvent& rKEvt, bool);
- DECL_LINK(DoGetFocus, weld::Widget&, void);
- DECL_LINK(DoLoseFocus, weld::Widget&, void);
-
- css::uno::Reference<css::accessibility::XAccessible> CreateAccessible();
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
+ virtual void Resize() override;
+ virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
+ virtual void MouseMove(const MouseEvent& rMEvt) override;
+ virtual void MouseButtonUp(const MouseEvent& rMEvt) override;
+ virtual void GetFocus() override;
+ virtual void LoseFocus() override;
+ virtual bool KeyInput(const KeyEvent&) override;
+
+ virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() override;
+ virtual FactoryFunction GetUITestFactory() const override;
protected:
typedef std::map<sal_Int32, std::shared_ptr<svx::SvxShowCharSetItem> > ItemsMap;
diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx
index 4752c8033066..c14761bd8017 100644
--- a/include/svx/dlgctrl.hxx
+++ b/include/svx/dlgctrl.hxx
@@ -24,6 +24,7 @@
#include <svx/svxdllapi.h>
#include <svx/rectenum.hxx>
#include <vcl/graph.hxx>
+#include <vcl/customweld.hxx>
#include <vcl/weld.hxx>
#include <svx/xtable.hxx>
#include <rtl/ref.hxx>
@@ -146,10 +147,9 @@ public:
bool IsCompletelyDisabled() const { return mbCompleteDisable; }
};
-class SAL_WARN_UNUSED SVX_DLLPUBLIC RectCtl
+class SAL_WARN_UNUSED SVX_DLLPUBLIC RectCtl : public weld::CustomWidgetController
{
private:
- std::unique_ptr<weld::DrawingArea> m_xControl;
VclPtr<SvxTabPage> m_pPage;
SVX_DLLPRIVATE void InitSettings(vcl::RenderContext& rRenderContext);
@@ -157,11 +157,13 @@ private:
SVX_DLLPRIVATE BitmapEx& GetRectBitmap();
SVX_DLLPRIVATE void Resize_Impl();
+ RectCtl(const RectCtl&) = delete;
+ RectCtl& operator=(const RectCtl&) = delete;
+
protected:
rtl::Reference<RectCtlAccessibleContext> pAccContext;
sal_uInt16 nBorderWidth;
sal_uInt16 nRadius;
- Size m_aSize;
Point aPtLT, aPtMT, aPtRT;
Point aPtLM, aPtMM, aPtRM;
Point aPtLB, aPtMB, aPtRB;
@@ -178,19 +180,19 @@ protected:
Point GetApproxLogPtFromPixPt( const Point& rRoughPixelPoint ) const;
public:
- RectCtl(weld::Builder& rBuilder, const OString& rDrawingId, SvxTabPage* pPage,
- RectPoint eRpt = RectPoint::MM, sal_uInt16 nBorder = 200, sal_uInt16 nCircle = 80);
+ RectCtl(SvxTabPage* pPage, RectPoint eRpt = RectPoint::MM, sal_uInt16 nBorder = 200, sal_uInt16 nCircle = 80);
void SetControlSettings(RectPoint eRpt, sal_uInt16 nBorder, sal_uInt16 nCircl);
- ~RectCtl();
+ virtual ~RectCtl() override;
- DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
- DECL_LINK(DoResize, const Size& rSize, void);
- DECL_LINK(DoMouseButtonDown, const MouseEvent&, void);
- DECL_LINK(DoKeyDown, const KeyEvent&, bool);
- DECL_LINK(DoGetFocus, weld::Widget&, void);
- DECL_LINK(DoLoseFocus, weld::Widget&, void);
- DECL_LINK(MarkToResetSettings, weld::Widget&, void);
- DECL_LINK(DoFocusRect, weld::Widget&, tools::Rectangle);
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override;
+ virtual void Resize() override;
+ virtual void MouseButtonDown(const MouseEvent&) override;
+ virtual bool KeyInput(const KeyEvent&) override;
+ virtual void GetFocus() override;
+ virtual void LoseFocus() override;
+ virtual tools::Rectangle GetFocusRect() override;
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
+ virtual void StyleUpdated() override;
void Reset();
RectPoint GetActualRP() const { return eRP;}
@@ -203,19 +205,14 @@ public:
tools::Rectangle CalculateFocusRectangle() const;
tools::Rectangle CalculateFocusRectangle( RectPoint eRectPoint ) const;
- css::uno::Reference<css::accessibility::XAccessible> getAccessibleParent() { return m_xControl->get_accessible_parent(); }
- css::uno::Reference<css::accessibility::XAccessible> CreateAccessible();
- a11yrelationset get_accessible_relation_set() { return m_xControl->get_accessible_relation_set(); }
+ css::uno::Reference<css::accessibility::XAccessible> getAccessibleParent() { return GetDrawingArea()->get_accessible_parent(); }
+ virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() override;
+ a11yrelationset get_accessible_relation_set() { return GetDrawingArea()->get_accessible_relation_set(); }
RectPoint GetApproxRPFromPixPt( const css::awt::Point& rPixelPoint ) const;
bool IsCompletelyDisabled() const { return mbCompleteDisable; }
void DoCompletelyDisable(bool bNew);
-
- bool IsVisible() const { return m_xControl->get_visible(); }
- bool HasFocus() const { return m_xControl->has_focus(); }
- void GrabFocus() { m_xControl->grab_focus(); }
- Size GetSize() const { return m_aSize; }
};
/*************************************************************************
diff --git a/include/svx/graphctl.hxx b/include/svx/graphctl.hxx
index 492e3dd62987..de9b0e7d9060 100644
--- a/include/svx/graphctl.hxx
+++ b/include/svx/graphctl.hxx
@@ -21,6 +21,7 @@
#include <vcl/ctrl.hxx>
#include <vcl/graph.hxx>
+#include <vcl/customweld.hxx>
#include <vcl/weld.hxx>
#include <svx/svxdllapi.h>
@@ -124,31 +125,19 @@ public:
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override;
};
-class SVX_DLLPUBLIC SvxGraphCtrl
+class SVX_DLLPUBLIC SvxGraphCtrl : public weld::CustomWidgetController
{
MapMode aMap100;
Graphic aGraphic;
Size aGraphSize;
- Size maSize;
- std::unique_ptr<weld::DrawingArea> mxDrawingArea;
-
- DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
- DECL_LINK(DoResize, const Size& rSize, void);
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
public:
- SvxGraphCtrl(weld::Builder& rBuilder, const OString& rDrawingId);
- virtual ~SvxGraphCtrl();
-
+ SvxGraphCtrl();
+ virtual ~SvxGraphCtrl() override;
void SetGraphic( const Graphic& rGraphic );
-
- const Size& GetSize() const { return maSize; }
-
- void set_size_request(int nWidth, int nHeight)
- {
- mxDrawingArea->set_size_request(nWidth, nHeight);
- }
};
class GraphCtrlView : public SdrView
diff --git a/include/svx/searchcharmap.hxx b/include/svx/searchcharmap.hxx
index 8f23c4b96d5a..bcc4ac2dc5b9 100644
--- a/include/svx/searchcharmap.hxx
+++ b/include/svx/searchcharmap.hxx
@@ -53,8 +53,7 @@ class ScrollBar;
class SVX_DLLPUBLIC SvxSearchCharSet : public SvxShowCharSet
{
public:
- SvxSearchCharSet(weld::Builder& rBuilder, const OString& rDrawingId,
- const OString& rScrollId, const VclPtr<VirtualDevice> &rDevice);
+ SvxSearchCharSet(weld::ScrolledWindow* pScrolledWindow, const VclPtr<VirtualDevice> &rDevice);
virtual ~SvxSearchCharSet() override;
virtual void RecalculateFont(vcl::RenderContext& rRenderContext) override;
@@ -77,9 +76,9 @@ private:
//to uniquely identify each appended element
std::unordered_map<sal_Int32, sal_UCS4> m_aItemList;
private:
- virtual void DrawChars_Impl(vcl::RenderContext& rRenderContext, int n1, int n2) override;
- DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
- DECL_LINK(DoKeyDown, const KeyEvent&, bool);
+ virtual void DrawChars_Impl(vcl::RenderContext& rRenderContext, int n1, int n2) override;
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
+ virtual bool KeyInput(const KeyEvent& rKEvt) override;
};
#endif
diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx
new file mode 100644
index 000000000000..4eef04e85323
--- /dev/null
+++ b/include/vcl/customweld.hxx
@@ -0,0 +1,100 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_VCL_CUSTOMWELD_HXX
+#define INCLUDED_VCL_CUSTOMWELD_HXX
+
+#include <vcl/weld.hxx>
+
+namespace weld
+{
+class VCL_DLLPUBLIC CustomWidgetController
+{
+private:
+ Size m_aSize;
+ weld::DrawingArea* m_pDrawingArea;
+
+public:
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) = 0;
+ virtual void Resize() {}
+ virtual void MouseButtonDown(const MouseEvent&) {}
+ virtual void MouseMove(const MouseEvent&) {}
+ virtual void MouseButtonUp(const MouseEvent&) {}
+ virtual void GetFocus() {}
+ virtual void LoseFocus() {}
+ virtual void StyleUpdated() { Invalidate(); }
+ virtual bool KeyInput(const KeyEvent&) { return false; }
+ virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible()
+ {
+ return css::uno::Reference<css::accessibility::XAccessible>();
+ }
+ virtual tools::Rectangle GetFocusRect() { return tools::Rectangle(); }
+ virtual FactoryFunction GetUITestFactory() const { return nullptr; }
+ Size GetOutputSizePixel() const { return m_aSize; }
+ void SetOutputSizePixel(const Size& rSize) { m_aSize = rSize; }
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) { m_pDrawingArea = pDrawingArea; }
+ weld::DrawingArea* GetDrawingArea() const { return m_pDrawingArea; }
+ void Invalidate() { m_pDrawingArea->queue_draw(); }
+ void Invalidate(const tools::Rectangle& rRect)
+ {
+ m_pDrawingArea->queue_draw_area(rRect.Left(), rRect.Top(), rRect.GetWidth(),
+ rRect.GetHeight());
+ }
+ void Show() { m_pDrawingArea->show(); }
+ void Hide() { m_pDrawingArea->hide(); }
+ void GrabFocus() { m_pDrawingArea->grab_focus(); }
+ bool HasFocus() const { return m_pDrawingArea->has_focus(); }
+ bool IsVisible() const { return m_pDrawingArea->get_visible(); }
+ bool IsEnabled() const { return m_pDrawingArea->get_sensitive(); }
+ void grab_add() { m_pDrawingArea->grab_add(); }
+ void grab_remove() { m_pDrawingArea->grab_remove(); }
+ void set_size_request(int nWidth, int nHeight)
+ {
+ m_pDrawingArea->set_size_request(nWidth, nHeight);
+ }
+ virtual ~CustomWidgetController();
+};
+
+class VCL_DLLPUBLIC CustomWeld
+{
+private:
+ weld::CustomWidgetController& m_rWidgetController;
+ std::unique_ptr<weld::DrawingArea> m_xDrawingArea;
+
+ DECL_LINK(DoResize, const Size& rSize, void);
+ DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
+ DECL_LINK(DoMouseButtonDown, const MouseEvent&, void);
+ DECL_LINK(DoMouseMove, const MouseEvent&, void);
+ DECL_LINK(DoMouseButtonUp, const MouseEvent&, void);
+ DECL_LINK(DoGetFocus, weld::Widget&, void);
+ DECL_LINK(DoLoseFocus, weld::Widget&, void);
+ DECL_LINK(DoKeyPress, const KeyEvent&, bool);
+ DECL_LINK(DoFocusRect, weld::Widget&, tools::Rectangle);
+ DECL_LINK(DoStyleUpdated, weld::Widget&, void);
+
+public:
+ CustomWeld(weld::Builder& rBuilder, const OString& rDrawingId,
+ CustomWidgetController& rWidgetController);
+ void queue_draw() { m_xDrawingArea->queue_draw(); }
+ void queue_draw_area(int x, int y, int width, int height)
+ {
+ m_xDrawingArea->queue_draw_area(x, y, width, height);
+ }
+ void set_size_request(int nWidth, int nHeight)
+ {
+ m_xDrawingArea->set_size_request(nWidth, nHeight);
+ }
+ void show() { m_xDrawingArea->show(); }
+ void set_margin_top(int nMargin) { m_xDrawingArea->set_margin_top(nMargin); }
+ void set_margin_bottom(int nMargin) { m_xDrawingArea->set_margin_bottom(nMargin); }
+};
+}
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
index 863121b9b201..95b46a89bb69 100644
--- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
@@ -49,7 +49,7 @@ SdPhotoAlbumDialog::SdPhotoAlbumDialog(weld::Window* pWindow, SdDrawDocument* pA
, m_xDownBtn(m_xBuilder->weld_button("down_btn"))
, m_xRemoveBtn(m_xBuilder->weld_button("rem_btn"))
, m_xImagesLst(m_xBuilder->weld_tree_view("images_tree"))
- , m_xImg(new SvxGraphCtrl(*m_xBuilder, "preview_img"))
+ , m_xImg(new weld::CustomWeld(*m_xBuilder, "preview_img", m_aImg))
, m_xInsTypeCombo(m_xBuilder->weld_combo_box_text("opt_combo"))
, m_xASRCheck(m_xBuilder->weld_check_button("asr_check"))
, m_xASRCheckCrop(m_xBuilder->weld_check_button("asr_check_crop"))
@@ -583,7 +583,7 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, DownHdl, weld::Button&, void)
IMPL_LINK_NOARG(SdPhotoAlbumDialog, RemoveHdl, weld::Button&, void)
{
m_xImagesLst->remove(m_xImagesLst->get_selected_index());
- m_xImg->SetGraphic(Graphic());
+ m_aImg.SetGraphic(Graphic());
EnableDisableButtons();
}
@@ -635,11 +635,11 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, SelectHdl, weld::TreeView&, void)
aBmp.Scale( nYRatio, nYRatio );
aBmp.Convert( BmpConversion::N24Bit );
- m_xImg->SetGraphic(Graphic(aBmp));
+ m_aImg.SetGraphic(Graphic(aBmp));
}
else
{
- m_xImg->SetGraphic(Graphic());
+ m_aImg.SetGraphic(Graphic());
}
EnableDisableButtons();
}
diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.hxx b/sd/source/ui/dlg/PhotoAlbumDialog.hxx
index 7ec396eb3fb9..2f458555a00f 100644
--- a/sd/source/ui/dlg/PhotoAlbumDialog.hxx
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.hxx
@@ -48,6 +48,8 @@ private:
SdDrawDocument* m_pDoc;
GraphicFilter* m_pGraphicFilter;
+ SvxGraphCtrl m_aImg;
+
std::unique_ptr<weld::Button> m_xCancelBtn;
std::unique_ptr<weld::Button> m_xCreateBtn;
std::unique_ptr<weld::Button> m_xAddBtn;
@@ -55,7 +57,7 @@ private:
std::unique_ptr<weld::Button> m_xDownBtn;
std::unique_ptr<weld::Button> m_xRemoveBtn;
std::unique_ptr<weld::TreeView> m_xImagesLst;
- std::unique_ptr<SvxGraphCtrl> m_xImg;
+ std::unique_ptr<weld::CustomWeld> m_xImg;
std::unique_ptr<weld::ComboBoxText> m_xInsTypeCombo;
std::unique_ptr<weld::CheckButton> m_xASRCheck;
std::unique_ptr<weld::CheckButton> m_xASRCheckCrop;
diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx
index 145bc94fd3f5..2bbc2810b203 100644
--- a/sd/source/ui/dlg/vectdlg.cxx
+++ b/sd/source/ui/dlg/vectdlg.cxx
@@ -39,8 +39,8 @@ SdVectorizeDlg::SdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, ::sd::
, m_xFtFillHoles(m_xBuilder->weld_label("tilesft"))
, m_xMtFillHoles(m_xBuilder->weld_metric_spin_button("tiles", FUNIT_PIXEL))
, m_xCbFillHoles(m_xBuilder->weld_check_button("fillholes"))
- , m_xBmpWin(new SvxGraphCtrl(*m_xBuilder, "source"))
- , m_xMtfWin(new SvxGraphCtrl(*m_xBuilder, "vectorized"))
+ , m_xBmpWin(new weld::CustomWeld(*m_xBuilder, "source", m_aBmpWin))
+ , m_xMtfWin(new weld::CustomWeld(*m_xBuilder, "vectorized", m_aMtfWin))
, m_xPrgs(m_xBuilder->weld_progress_bar("progressbar"))
, m_xBtnOK(m_xBuilder->weld_button("ok"))
, m_xBtnPreview(m_xBuilder->weld_button("preview"))
@@ -97,11 +97,11 @@ SdVectorizeDlg::~SdVectorizeDlg()
void SdVectorizeDlg::InitPreviewBmp()
{
- const ::tools::Rectangle aRect( GetRect( m_xBmpWin->GetSize(), aBmp.GetSizePixel() ) );
+ const ::tools::Rectangle aRect( GetRect( m_aBmpWin.GetOutputSizePixel(), aBmp.GetSizePixel() ) );
aPreviewBmp = aBmp;
aPreviewBmp.Scale( aRect.GetSize() );
- m_xBmpWin->SetGraphic( aPreviewBmp );
+ m_aBmpWin.SetGraphic( aPreviewBmp );
}
Bitmap SdVectorizeDlg::GetPreparedBitmap( Bitmap const & rBmp, Fraction& rScale )
@@ -247,7 +247,7 @@ IMPL_LINK( SdVectorizeDlg, ProgressHdl, long, nData, void )
IMPL_LINK_NOARG(SdVectorizeDlg, ClickPreviewHdl, weld::Button&, void)
{
Calculate( aBmp, aMtf );
- m_xMtfWin->SetGraphic( aMtf );
+ m_aMtfWin.SetGraphic( aMtf );
m_xBtnPreview->set_sensitive(false);
}
diff --git a/sd/source/ui/inc/vectdlg.hxx b/sd/source/ui/inc/vectdlg.hxx
index 370508f90852..85da96e3b93d 100644
--- a/sd/source/ui/inc/vectdlg.hxx
+++ b/sd/source/ui/inc/vectdlg.hxx
@@ -40,13 +40,16 @@ class SdVectorizeDlg : public weld::GenericDialogController
Bitmap aPreviewBmp;
GDIMetaFile aMtf;
+ SvxGraphCtrl m_aBmpWin;
+ SvxGraphCtrl m_aMtfWin;
+
std::unique_ptr<weld::SpinButton> m_xNmLayers;
std::unique_ptr<weld::MetricSpinButton> m_xMtReduce;
std::unique_ptr<weld::Label> m_xFtFillHoles;
std::unique_ptr<weld::MetricSpinButton> m_xMtFillHoles;
std::unique_ptr<weld::CheckButton> m_xCbFillHoles;
- std::unique_ptr<SvxGraphCtrl> m_xBmpWin;
- std::unique_ptr<SvxGraphCtrl> m_xMtfWin;
+ std::unique_ptr<weld::CustomWeld> m_xBmpWin;
+ std::unique_ptr<weld::CustomWeld> m_xMtfWin;
std::unique_ptr<weld::ProgressBar> m_xPrgs;
std::unique_ptr<weld::Button> m_xBtnOK;
std::unique_ptr<weld::Button> m_xBtnPreview;
diff --git a/sfx2/source/control/charwin.cxx b/sfx2/source/control/charwin.cxx
index a1c0abc6672d..a585361a3296 100644
--- a/sfx2/source/control/charwin.cxx
+++ b/sfx2/source/control/charwin.cxx
@@ -28,42 +28,39 @@
using namespace com::sun::star;
-SvxCharView::SvxCharView(weld::Builder& rBuilder, const OString& rId, const VclPtr<VirtualDevice>& rVirDev)
+SvxCharView::SvxCharView(const VclPtr<VirtualDevice>& rVirDev)
: mxVirDev(rVirDev)
- , mxDrawingArea(rBuilder.weld_drawing_area(rId))
, mnY(0)
, maPosition(0,0)
, maHasInsert(true)
{
- mxDrawingArea->connect_size_allocate(LINK(this, SvxCharView, DoResize));
- mxDrawingArea->connect_draw(LINK(this, SvxCharView, DoPaint));
- mxDrawingArea->connect_mouse_press(LINK(this, SvxCharView, DoMouseButtonDown));
- mxDrawingArea->connect_key_press(LINK(this, SvxCharView, DoKeyDown));
- mxDrawingArea->connect_focus_in(LINK(this, SvxCharView, DoGetFocus));
- mxDrawingArea->connect_focus_out(LINK(this, SvxCharView, DoLoseFocus));
+}
+void SvxCharView::SetDrawingArea(weld::DrawingArea* pDrawingArea)
+{
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
vcl::Font aFont = rStyleSettings.GetLabelFont();
const Size aFontSize = aFont.GetFontSize();
aFont.SetFontSize(Size(aFontSize.Width() * 2.5, aFontSize.Height() * 2.5));
mxVirDev->Push(PUSH_ALLFONT);
mxVirDev->SetFont(aFont);
- mxDrawingArea->set_size_request(mxVirDev->approximate_digit_width() * 2,
- mxVirDev->GetTextHeight());
+ pDrawingArea->set_size_request(mxVirDev->approximate_digit_width() * 2,
+ mxVirDev->GetTextHeight());
mxVirDev->Pop();
+ CustomWidgetController::SetDrawingArea(pDrawingArea);
}
-IMPL_LINK_NOARG(SvxCharView, DoGetFocus, weld::Widget&, void)
+void SvxCharView::GetFocus()
{
- mxDrawingArea->queue_draw();
+ Invalidate();
}
-IMPL_LINK_NOARG(SvxCharView, DoLoseFocus, weld::Widget&, void)
+void SvxCharView::LoseFocus()
{
- mxDrawingArea->queue_draw();
+ Invalidate();
}
-IMPL_LINK(SvxCharView, DoMouseButtonDown, const MouseEvent&, rMEvt, void)
+void SvxCharView::MouseButtonDown(const MouseEvent& rMEvt)
{
if ( rMEvt.IsLeft() )
{
@@ -79,13 +76,13 @@ IMPL_LINK(SvxCharView, DoMouseButtonDown, const MouseEvent&, rMEvt, void)
{
Point aPosition(rMEvt.GetPosPixel());
maPosition = aPosition;
- mxDrawingArea->grab_focus();
- mxDrawingArea->queue_draw();
+ GrabFocus();
+ Invalidate();
createContextMenu();
}
}
-IMPL_LINK(SvxCharView, DoKeyDown, const KeyEvent&, rKEvt, bool)
+bool SvxCharView::KeyInput(const KeyEvent& rKEvt)
{
bool bRet = false;
vcl::KeyCode aCode = rKEvt.GetKeyCode();
@@ -119,10 +116,11 @@ void SvxCharView::InsertCharToDoc()
void SvxCharView::createContextMenu()
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(mxDrawingArea.get(), "sfx/ui/charviewmenu.ui"));
+ weld::DrawingArea* pDrawingArea = GetDrawingArea();
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pDrawingArea, "sfx/ui/charviewmenu.ui"));
std::unique_ptr<weld::Menu> xItemMenu(xBuilder->weld_menu("charviewmenu"));
- ContextMenuSelect(xItemMenu->popup_at_rect(mxDrawingArea.get(), tools::Rectangle(maPosition, Size(1,1))));
- queue_draw();
+ ContextMenuSelect(xItemMenu->popup_at_rect(pDrawingArea, tools::Rectangle(maPosition, Size(1,1))));
+ Invalidate();
}
void SvxCharView::ContextMenuSelect(const OString& rMenuId)
@@ -133,10 +131,8 @@ void SvxCharView::ContextMenuSelect(const OString& rMenuId)
maClearAllClickHdl.Call(this);
}
-IMPL_LINK(SvxCharView, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
+void SvxCharView::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
- vcl::RenderContext& rRenderContext = aPayload.first;
-
rRenderContext.SetFont(maFont);
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
@@ -148,8 +144,9 @@ IMPL_LINK(SvxCharView, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
const OUString aText = GetText();
- long nAvailWidth = m_aSize.Width();
- long nWinHeight = m_aSize.Height();
+ Size aSize(GetOutputSizePixel());
+ long nAvailWidth = aSize.Width();
+ long nWinHeight = aSize.Height();
bool bGotBoundary = true;
bool bShrankFont = false;
@@ -180,7 +177,7 @@ IMPL_LINK(SvxCharView, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
Point aPoint(2, mnY);
if (!bGotBoundary)
- aPoint.setX( (m_aSize.Width() - rRenderContext.GetTextWidth(aText)) / 2 );
+ aPoint.setX( (aSize.Width() - rRenderContext.GetTextWidth(aText)) / 2 );
else
{
// adjust position
@@ -188,20 +185,20 @@ IMPL_LINK(SvxCharView, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
// vertical adjustment
int nYLDelta = aBoundRect.Top();
- int nYHDelta = m_aSize.Height() - aBoundRect.Bottom();
+ int nYHDelta = aSize.Height() - aBoundRect.Bottom();
if( nYLDelta <= 0 )
aPoint.AdjustY( -(nYLDelta - 1) );
else if( nYHDelta <= 0 )
aPoint.AdjustY(nYHDelta - 1 );
// centrally align glyph
- aPoint.setX( -aBoundRect.Left() + (m_aSize.Width() - aBoundRect.GetWidth()) / 2 );
+ aPoint.setX( -aBoundRect.Left() + (aSize.Width() - aBoundRect.GetWidth()) / 2 );
}
- if (mxDrawingArea->has_focus())
+ if (HasFocus())
{
rRenderContext.SetFillColor(aHighlightColor);
- rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), m_aSize));
+ rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), aSize));
rRenderContext.SetTextColor(aHighlightTextColor);
rRenderContext.DrawText(aPoint, aText);
@@ -209,7 +206,7 @@ IMPL_LINK(SvxCharView, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
else
{
rRenderContext.SetFillColor(aFillColor);
- rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), m_aSize));
+ rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), aSize));
rRenderContext.SetTextColor(aWindowTextColor);
rRenderContext.DrawText(aPoint, aText);
@@ -238,7 +235,7 @@ void SvxCharView::setClearAllClickHdl(const Link<SvxCharView*,void> &rLink)
void SvxCharView::SetFont( const vcl::Font& rFont )
{
- long nWinHeight = m_aSize.Height();
+ long nWinHeight = GetOutputSizePixel().Height();
maFont = vcl::Font(rFont);
maFont.SetWeight(WEIGHT_NORMAL);
maFont.SetAlignment(ALIGN_TOP);
@@ -250,19 +247,18 @@ void SvxCharView::SetFont( const vcl::Font& rFont )
mnY = (nWinHeight - mxVirDev->GetTextHeight()) / 2;
mxVirDev->Pop();
- queue_draw();
+ Invalidate();
}
-IMPL_LINK(SvxCharView, DoResize, const Size&, rSize, void)
+void SvxCharView::Resize()
{
- m_aSize = rSize;
SetFont(GetFont()); //force recalculation of size
}
void SvxCharView::SetText( const OUString& rText )
{
m_sText = rText;
- queue_draw();
+ Invalidate();
}
void SvxCharView::SetHasInsert( bool bInsert )
diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx
index 1d860d18275e..af26dab03b42 100644
--- a/sfx2/source/doc/new.cxx
+++ b/sfx2/source/doc/new.cxx
@@ -47,19 +47,11 @@ void SfxPreviewWin_Impl::SetObjectShell(SfxObjectShell const * pObj)
? pObj->GetPreviewMetaFile()
: std::shared_ptr<GDIMetaFile>();
xMetaFile = xFile;
- m_xDrawingArea->queue_draw();
+ Invalidate();
}
-SfxPreviewWin_Impl::SfxPreviewWin_Impl(weld::DrawingArea* pDrawingArea)
- : m_xDrawingArea(pDrawingArea)
+SfxPreviewWin_Impl::SfxPreviewWin_Impl()
{
- m_xDrawingArea->connect_size_allocate(LINK(this, SfxPreviewWin_Impl, DoResize));
- m_xDrawingArea->connect_draw(LINK(this, SfxPreviewWin_Impl, DoPaint));
-}
-
-IMPL_LINK_NOARG(SfxPreviewWin_Impl, DoResize, const Size&, void)
-{
- m_xDrawingArea->queue_draw();
}
void SfxPreviewWin_Impl::ImpPaint(vcl::RenderContext& rRenderContext, GDIMetaFile* pFile)
@@ -104,9 +96,9 @@ void SfxPreviewWin_Impl::ImpPaint(vcl::RenderContext& rRenderContext, GDIMetaFil
}
}
-IMPL_LINK(SfxPreviewWin_Impl, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
+void SfxPreviewWin_Impl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
- ImpPaint(aPayload.first, xMetaFile.get());
+ ImpPaint(rRenderContext, xMetaFile.get());
}
IMPL_LINK_NOARG(SfxNewFileDialog, Update, Timer*, void)
@@ -121,8 +113,8 @@ IMPL_LINK_NOARG(SfxNewFileDialog, Update, Timer*, void)
const sal_uInt16 nEntry = GetSelectedTemplatePos();
if (!nEntry)
{
- m_xPreviewWin->queue_draw();
- m_xPreviewWin->SetObjectShell(nullptr);
+ m_xPreviewController->Invalidate();
+ m_xPreviewController->SetObjectShell(nullptr);
return;
}
@@ -164,12 +156,12 @@ IMPL_LINK_NOARG(SfxNewFileDialog, Update, Timer*, void)
ErrorHandler::HandleError(lErr);
if (!m_xDocShell.Is())
{
- m_xPreviewWin->SetObjectShell(nullptr);
+ m_xPreviewController->SetObjectShell(nullptr);
return;
}
}
- m_xPreviewWin->SetObjectShell(m_xDocShell);
+ m_xPreviewController->SetObjectShell(m_xDocShell);
}
}
@@ -238,6 +230,8 @@ sal_uInt16 SfxNewFileDialog::GetSelectedTemplatePos() const
SfxNewFileDialog::SfxNewFileDialog(weld::Window *pParent, SfxNewFileDialogMode nFlags)
: GenericDialogController(pParent, "sfx/ui/loadtemplatedialog.ui", "LoadTemplateDialog")
+ , m_nFlags(nFlags)
+ , m_xPreviewController(new SfxPreviewWin_Impl)
, m_xRegionLb(m_xBuilder->weld_tree_view("categories"))
, m_xTemplateLb(m_xBuilder->weld_tree_view("templates"))
, m_xTextStyleCB(m_xBuilder->weld_check_button("text"))
@@ -247,9 +241,8 @@ SfxNewFileDialog::SfxNewFileDialog(weld::Window *pParent, SfxNewFileDialogMode n
, m_xMergeStyleCB(m_xBuilder->weld_check_button("overwrite"))
, m_xLoadFilePB(m_xBuilder->weld_button("fromfile"))
, m_xMoreBt(m_xBuilder->weld_expander("expander"))
- , m_xPreviewWin(new SfxPreviewWin_Impl(m_xBuilder->weld_drawing_area("image")))
+ , m_xPreviewWin(new weld::CustomWeld(*m_xBuilder, "image", *m_xPreviewController))
, m_xAltTitleFt(m_xBuilder->weld_label("alttitle"))
- , m_nFlags(nFlags)
{
const int nWidth = m_xRegionLb->get_approximate_digit_width() * 32;
const int nHeight = m_xRegionLb->get_height_rows(8);
diff --git a/sfx2/source/inc/preview.hxx b/sfx2/source/inc/preview.hxx
index 8b39231c31a8..328fc005330d 100644
--- a/sfx2/source/inc/preview.hxx
+++ b/sfx2/source/inc/preview.hxx
@@ -20,23 +20,20 @@
#define INCLUDED_SFX2_SOURCE_INC_PREVIEW_HXX
#include <tools/link.hxx>
+#include <vcl/customweld.hxx>
class SfxObjectShell;
class GDIMetaFile;
-class SfxPreviewWin_Impl
+class SfxPreviewWin_Impl : public weld::CustomWidgetController
{
+private:
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override;
protected:
std::shared_ptr<GDIMetaFile> xMetaFile;
- std::unique_ptr<weld::DrawingArea> m_xDrawingArea;
public:
- SfxPreviewWin_Impl(weld::DrawingArea* pArea);
+ SfxPreviewWin_Impl();
void SetObjectShell( SfxObjectShell const * pObj );
- DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
- DECL_LINK(DoResize, const Size& rSize, void);
- void queue_draw() { m_xDrawingArea->queue_draw(); }
- void show() { m_xDrawingArea->show(); }
- void set_size_request(int nWidth, int nHeight) { m_xDrawingArea->set_size_request(nWidth, nHeight); }
static void ImpPaint(vcl::RenderContext& rRenderContext, GDIMetaFile* pFile);
};
diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx
index e2a66edba2c7..81f043c59fde 100644
--- a/starmath/inc/dialog.hxx
+++ b/starmath/inc/dialog.hxx
@@ -258,9 +258,8 @@ public:
/**************************************************************************/
-class SmShowSymbolSet
+class SmShowSymbolSet : public weld::CustomWidgetController
{
- Size m_aSize;
Size m_aOldSize;
SymbolPtrVec_t aSymbolSet;
Link<SmShowSymbolSet&,void> aSelectHdlLink;
@@ -269,20 +268,27 @@ class SmShowSymbolSet
long nRows, nColumns;
long nXOffset, nYOffset;
sal_uInt16 nSelectSymbol;
- std::unique_ptr<weld::DrawingArea> m_xDrawingArea;
std::unique_ptr<weld::ScrolledWindow> m_xScrolledWindow;
void SetScrollBarRange();
Point OffsetPoint(const Point &rPoint) const;
- DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
- DECL_LINK(DoMouseButtonDown, const MouseEvent& rMEvt, void);
- DECL_LINK(DoKeyDown, const KeyEvent& rKEvt, bool);
- DECL_LINK(DoResize, const Size& rSize, void);
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
+ virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
+ virtual bool KeyInput(const KeyEvent& rKEvt) override;
+
DECL_LINK(ScrollHdl, weld::ScrolledWindow&, void);
public:
- SmShowSymbolSet(weld::DrawingArea* pDrawingArea, weld::ScrolledWindow* pScrolledWindow);
+ SmShowSymbolSet(weld::ScrolledWindow* pScrolledWindow);
+
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override
+ {
+ pDrawingArea->set_size_request(pDrawingArea->get_approximate_digit_width() * 27,
+ pDrawingArea->get_text_height() * 9);
+ CustomWidgetController::SetDrawingArea(pDrawingArea);
+ }
+
void calccols(vcl::RenderContext& rRenderContext);
void SelectSymbol(sal_uInt16 nSymbol);
sal_uInt16 GetSelectSymbol() const { return nSelectSymbol; }
@@ -291,24 +297,28 @@ public:
void SetDblClickHdl(const Link<SmShowSymbolSet&,void>& rLink) { aDblClickHdlLink = rLink; }
};
-class SmShowSymbol
+class SmShowSymbol : public weld::CustomWidgetController
{
private:
- Size m_aSize;
vcl::Font m_aFont;
OUString m_aText;
- std::unique_ptr<weld::DrawingArea> m_xDrawingArea;
Link<SmShowSymbol&,void> aDblClickHdlLink;
- DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
- DECL_LINK(DoMouseButtonDown, const MouseEvent& rMEvt, void);
- DECL_LINK(DoResize, const Size& rSize, void);
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override;
+ virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
void setFontSize(vcl::Font &rFont) const;
public:
- SmShowSymbol(weld::DrawingArea* pDrawingArea);
+ SmShowSymbol();
+
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override
+ {
+ pDrawingArea->set_size_request(pDrawingArea->get_approximate_digit_width() * 27,
+ pDrawingArea->get_text_height() * 9);
+ CustomWidgetController::SetDrawingArea(pDrawingArea);
+ }
void SetText(const OUString& rText) { m_aText = rText; }
const OUString& GetText() const { return m_aText; }
@@ -330,10 +340,13 @@ class SmSymbolDialog : public weld::GenericDialogController
VclPtr<OutputDevice> pFontListDev;
+ SmShowSymbol m_aSymbolDisplay;
+
std::unique_ptr<weld::ComboBoxText> m_xSymbolSets;
std::unique_ptr<SmShowSymbolSet> m_xSymbolSetDisplay;
+ std::unique_ptr<weld::CustomWeld> m_xSymbolSetDisplayArea;
std::unique_ptr<weld::Label> m_xSymbolName;
- std::unique_ptr<SmShowSymbol> m_xSymbolDisplay;
+ std::unique_ptr<weld::CustomWeld> m_xSymbolDisplay;
std::unique_ptr<weld::Button> m_xGetBtn;
std::unique_ptr<weld::Button> m_xEditBtn;
@@ -357,25 +370,25 @@ public:
void SelectSymbol(sal_uInt16 nSymbolPos);
};
-class SmShowChar
+class SmShowChar : public weld::CustomWidgetController
{
private:
- std::unique_ptr<weld::DrawingArea> m_xDrawingArea;
OUString m_aText;
vcl::Font m_aFont;
- Size m_aSize;
- DECL_LINK(DoPaint, weld::DrawingArea::draw_args, void);
- DECL_LINK(DoResize, const Size& rSize, void);
+ virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override;
+ virtual void Resize() override;
public:
- SmShowChar(weld::DrawingArea* pDrawingArea)
- : m_xDrawingArea(pDrawingArea)
+ SmShowChar()
{
- m_xDrawingArea->connect_size_allocate(LINK(this, SmShowChar, DoResize));
- m_xDrawingArea->connect_draw(LINK(this, SmShowChar, DoPaint));
- m_xDrawingArea->set_size_request(m_xDrawingArea->get_approximate_digit_width() * 7,
- m_xDrawingArea->get_text_height() * 3);
+ }
+
+ virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override
+ {
+ pDrawingArea->set_size_request(pDrawingArea->get_approximate_digit_width() * 7,
+ pDrawingArea->get_text_height() * 3);
+ CustomWidgetController::SetDrawingArea(pDrawingArea);
}
void SetSymbol(const SmSym *pSym);
@@ -384,8 +397,6 @@ public:
const OUString& GetText() const { return m_aText; }
void SetFont(const vcl::Font& rFont) { m_aFont = rFont; }
const vcl::Font& GetFont() const { return m_aFont; }
-
- void queue_draw() { m_xDrawingArea->queue_draw(); }
};
class SmSymDefineDialog : public weld::GenericDialogController
@@ -393,6 +404,8 @@ class SmSymDefineDialog : public weld::GenericDialogController
VclPtr<VirtualDevice> m_xVirDev;
SmSymbolManager m_aSymbolMgrCopy;
SmSymbolManager& m_rSymbolMgr;
+ SmShowChar m_aOldSymbolDisplay;
+ SmShowChar m_aSymbolDisplay;
std::unique_ptr<SmSym> m_xOrigSymbol;
std::unique_ptr<SubsetMap> m_xSubsetMap;
std::unique_ptr<FontList> m_xFontList;
@@ -410,9 +423,10 @@ class SmSymDefineDialog : public weld::GenericDialogController
std::unique_ptr<weld::Button> m_xAddBtn;
std::unique_ptr<weld::Button> m_xChangeBtn;
std::unique_ptr<weld::Button> m_xDeleteBtn;
- std::unique_ptr<SmShowChar> m_xOldSymbolDisplay;
- std::unique_ptr<SmShowChar> m_xSymbolDisplay;
+ std::unique_ptr<weld::CustomWeld> m_xOldSymbolDisplay;
+ std::unique_ptr<weld::CustomWeld> m_xSymbolDisplay;
std::unique_ptr<SvxShowCharSet> m_xCharsetDisplay;
+ std::unique_ptr<weld::CustomWeld> m_xCharsetDisplayArea;
DECL_LINK(OldSymbolChangeHdl, weld::ComboBoxText&, void);
DECL_LINK(OldSymbolSetChangeHdl, weld::ComboBoxText&, void);
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 6843cebfaea8..286cb66d6846 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -958,24 +958,17 @@ void SmAlignDialog::WriteTo(SmFormat &rFormat) const
rFormat.RequestApplyChanges();
}
-SmShowSymbolSet::SmShowSymbolSet(weld::DrawingArea* pDrawingArea, weld::ScrolledWindow* pScrolledWindow)
+SmShowSymbolSet::SmShowSymbolSet(weld::ScrolledWindow* pScrolledWindow)
: nLen(0)
, nRows(0)
, nColumns(0)
, nXOffset(0)
, nYOffset(0)
, nSelectSymbol(SYMBOL_NONE)
- , m_xDrawingArea(pDrawingArea)
, m_xScrolledWindow(pScrolledWindow)
{
- m_xDrawingArea->connect_size_allocate(LINK(this, SmShowSymbolSet, DoResize));
- m_xDrawingArea->connect_draw(LINK(this, SmShowSymbolSet, DoPaint));
- m_xDrawingArea->connect_mouse_press(LINK(this, SmShowSymbolSet, DoMouseButtonDown));
- m_xDrawingArea->connect_key_press(LINK(this, SmShowSymbolSet, DoKeyDown));
m_xScrolledWindow->set_user_managed_scrolling();
m_xScrolledWindow->connect_vadjustment_changed(LINK(this, SmShowSymbolSet, ScrollHdl));
- m_xDrawingArea->set_size_request(m_xDrawingArea->get_approximate_digit_width() * 27,
- m_xDrawingArea->get_text_height() * 9);
}
Point SmShowSymbolSet::OffsetPoint(const Point &rPoint) const
@@ -983,14 +976,13 @@ Point SmShowSymbolSet::OffsetPoint(const Point &rPoint) const
return Point(rPoint.X() + nXOffset, rPoint.Y() + nYOffset);
}
-IMPL_LINK(SmShowSymbolSet, DoPaint, weld::DrawingArea::draw_args, aPayload, void)
+void SmShowSymbolSet::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
- vcl::RenderContext& rRenderContext = aPayload.first;
-
- if (m_aSize != m_aOldSize)
+ Size aWinSize(GetOutputSizePixel());
+ if (aWinSize != m_aOldSize)
{
calccols(rRenderContext);
- m_aOldSize = m_aSize;
+ m_aOldSize = aWinSize;
}
Color aBackgroundColor;
@@ -1045,9 +1037,9 @@ IMPL_LINK(SmShowSymbolSet, DoPaint, weld::DrawingArea::draw_args, aPayload, void
rRenderContext.Pop();
}
-IMPL_LINK(SmShowSymbolSet, DoMouseButtonDown, const MouseEvent&, rMEvt, void)
+void SmShowSymbolSet::MouseButtonDown(const MouseEvent& rMEvt)
{
- m_xDrawingArea->grab_focus();
+ GrabFocus();
Size aOutputSize(nColumns * nLen, nRows * nLen);
aOutputSize.AdjustWidth(nXOffset );
@@ -1069,7 +1061,7 @@ IMPL_LINK(SmShowSymbolSet, DoMouseButtonDown, const MouseEvent&, rMEvt, void)
}
}
-IMPL_LINK(SmShowSymbolSet, DoKeyDown, const KeyEvent&, rKEvt, bool)
+bool SmShowSymbolSet::KeyInput(const KeyEvent& rKEvt)
{
sal_uInt16 n = nSelectSymbol;
@@ -1100,7 +1092,7 @@ IMPL_LINK(SmShowSymbolSet, DoKeyDown, const KeyEvent&, rKEvt, bool)
(n >= sal::static_int_cast<sal_uInt16>((m_xScrolledWindow->vadjustment_get_value() + nRows) * nColumns)))
{
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list