summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-22 10:38:34 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-24 14:24:06 +0200
commiteeaf6dee2d278eaa037d95a756ad0ffab3314bc2 (patch)
treea997fee717ad079fb59ff0901d418938ab7585f7 /sd/source
parentc10928e703366341ab912c42e8959a087a7fa9ff (diff)
rework custom widget welding to enable inheritence
Change-Id: I0d391b3fe9d2d610ae41e2a03cd2e195a866e103 Reviewed-on: https://gerrit.libreoffice.org/54681 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/dlg/PhotoAlbumDialog.cxx8
-rw-r--r--sd/source/ui/dlg/PhotoAlbumDialog.hxx4
-rw-r--r--sd/source/ui/dlg/vectdlg.cxx10
-rw-r--r--sd/source/ui/inc/vectdlg.hxx7
4 files changed, 17 insertions, 12 deletions
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;