[Libreoffice-commits] core.git: cui/source cui/uiconfig extras/source include/sfx2 include/svtools include/svx include/vcl Repository.mk solenv/sanitizers svtools/source svx/Executable_pixelctl.mk svx/inc svx/Module_svx.mk svx/source svx/workben vcl/source vcl/unx
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Sep 3 16:26:16 UTC 2018
Repository.mk | 3
cui/source/inc/backgrnd.hxx | 4
cui/source/inc/cuitabarea.hxx | 248 +++---
cui/source/tabpages/backgrnd.cxx | 43 -
cui/source/tabpages/tparea.cxx | 130 +--
cui/source/tabpages/tpbitmap.cxx | 430 +++++-----
cui/source/tabpages/tpcolor.cxx | 6
cui/source/tabpages/tpgradnt.cxx | 482 +++++-------
cui/source/tabpages/tphatch.cxx | 353 ++++----
cui/source/tabpages/tppattern.cxx | 289 +++----
cui/uiconfig/ui/areatabpage.ui | 12
cui/uiconfig/ui/bitmaptabpage.ui | 78 +
cui/uiconfig/ui/colorpage.ui | 54 +
cui/uiconfig/ui/gradientpage.ui | 132 ++-
cui/uiconfig/ui/hatchpage.ui | 106 ++
cui/uiconfig/ui/patterntabpage.ui | 108 ++
extras/source/glade/libreoffice-catalog.xml.in | 3
include/sfx2/tabdlg.hxx | 8
include/svtools/valueset.hxx | 6
include/svx/SvxPresetListBox.hxx | 39
include/svx/colorbox.hxx | 3
include/svx/dlgctrl.hxx | 31
include/vcl/customweld.hxx | 6
include/vcl/layout.hxx | 11
include/vcl/weld.hxx | 4
solenv/sanitizers/ui/cui.suppr | 19
svtools/source/control/valueacc.cxx | 19
svtools/source/control/valueimp.hxx | 3
svtools/source/control/valueset.cxx | 75 +
svx/Executable_pixelctl.mk | 40 -
svx/Module_svx.mk | 2
svx/inc/pch/precompiled_svx.hxx | 39
svx/source/accessibility/svxpixelctlaccessiblecontext.cxx | 552 ++------------
svx/source/accessibility/svxrectctaccessiblecontext.cxx | 3
svx/source/dialog/dlgctrl.cxx | 82 --
svx/source/inc/svxpixelctlaccessiblecontext.hxx | 191 +---
svx/source/inc/svxrectctaccessiblecontext.hxx | 19
svx/source/tbxctrls/SvxPresetListBox.cxx | 78 +
svx/workben/pixelctl.cxx | 127 ---
vcl/source/app/customweld.cxx | 6
vcl/source/app/salvtables.cxx | 15
vcl/source/uitest/uiobject.cxx | 9
vcl/unx/gtk3/gtk3gtkinst.cxx | 33
43 files changed, 1908 insertions(+), 1993 deletions(-)
New commits:
commit 79daf40ec696e0855d4a2894f048e44188cfbbb6
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jun 19 15:02:49 2018 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Sep 3 18:25:52 2018 +0200
weld SvxAreaTabPage
which itself has 5 sub tab pages
Change-Id: If71e91248b5771af4845ad6dba997ac4c7841b5d
Reviewed-on: https://gerrit.libreoffice.org/56112
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/Repository.mk b/Repository.mk
index 5f62c277b33d..6787c1c0add5 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -66,8 +66,7 @@ $(eval $(call gb_Helper_register_executables,NONE, \
svdemo \
fftester \
svptest \
- svpclient \
- pixelctl ) \
+ svpclient ) \
$(if $(filter LINUX %BSD SOLARIS,$(OS)), tilebench) \
$(if $(filter LINUX MACOSX SOLARIS WNT %BSD,$(OS)),icontest \
outdevgrind) \
diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx
index b08e9b92d249..078e78f05297 100644
--- a/cui/source/inc/backgrnd.hxx
+++ b/cui/source/inc/backgrnd.hxx
@@ -144,12 +144,12 @@ private:
class SvxBkgTabPage : public SvxAreaTabPage
{
- VclPtr<ListBox> m_pTblLBox;
+ std::unique_ptr<weld::ComboBoxText> m_xTblLBox;
bool bHighlighting : 1;
public:
using SvxAreaTabPage::DeactivatePage;
- SvxBkgTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ SvxBkgTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
virtual ~SvxBkgTabPage() override;
virtual void dispose() override;
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 119c466a9971..de7fd90cc3e7 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -37,6 +37,7 @@
#define NO_BUTTON_SELECTED -1
+class ColorListBox;
class SdrModel;
class SvxBitmapCtl;
class SvxColorListBox;
@@ -46,37 +47,37 @@ class ButtonBox
{
private:
sal_Int32 mnCurrentButton;
- std::vector< VclPtr<PushButton> > maButtonList;
- std::map< VclPtr<PushButton>, sal_Int32 > maButtonToPos;
+ std::vector<weld::ToggleButton*> maButtonList;
+ std::map<weld::ToggleButton*, sal_Int32 > maButtonToPos;
void SelectButtonImpl( sal_Int32 nPos )
{
if(mnCurrentButton != NO_BUTTON_SELECTED)
{
- maButtonList[mnCurrentButton]->SetPressed(false);
+ maButtonList[mnCurrentButton]->set_active(false);
}
mnCurrentButton = nPos;
- maButtonList[mnCurrentButton]->SetPressed(true);
+ maButtonList[mnCurrentButton]->set_active(true);
};
public:
ButtonBox()
{
mnCurrentButton = NO_BUTTON_SELECTED;
};
- void AddButton(VclPtr<PushButton> pButton)
+ void AddButton(weld::ToggleButton* pButton)
{
maButtonList.push_back(pButton);
maButtonToPos.insert( std::make_pair(pButton, maButtonList.size() - 1) );
}
sal_Int32 GetCurrentButtonPos() { return mnCurrentButton; }
- sal_Int32 GetButtonPos( VclPtr<PushButton> pButton )
+ sal_Int32 GetButtonPos(weld::ToggleButton* pButton)
{
- std::map< VclPtr<PushButton>, sal_Int32 >::const_iterator aBtnPos = maButtonToPos.find(pButton);
+ std::map<weld::ToggleButton*, sal_Int32>::const_iterator aBtnPos = maButtonToPos.find(pButton);
if(aBtnPos != maButtonToPos.end())
return aBtnPos->second;
else
return -1;
}
- void SelectButton( VclPtr<PushButton> pButton)
+ void SelectButton(weld::ToggleButton* pButton)
{
sal_Int32 nPos = GetButtonPos(pButton);
if(nPos != -1)
@@ -224,13 +225,6 @@ class SvxAreaTabPage : public SvxTabPage
static const sal_uInt16 pAreaRanges[];
private:
ScopedVclPtr<SfxTabPage> m_pFillTabPage;
- VclPtr<VclBox> m_pFillTab;
- VclPtr<PushButton> m_pBtnNone;
- VclPtr<PushButton> m_pBtnColor;
- VclPtr<PushButton> m_pBtnGradient;
- VclPtr<PushButton> m_pBtnHatch;
- VclPtr<PushButton> m_pBtnBitmap;
- VclPtr<PushButton> m_pBtnPattern;
ButtonBox maBox;
XColorListRef m_pColorList;
@@ -254,7 +248,17 @@ private:
XFillAttrSetItem m_aXFillAttr;
SfxItemSet& m_rXFSet;
- DECL_LINK(SelectFillTypeHdl_Impl, Button*, void);
+protected:
+ std::unique_ptr<weld::Container> m_xFillTab;
+ std::unique_ptr<weld::ToggleButton> m_xBtnNone;
+ std::unique_ptr<weld::ToggleButton> m_xBtnColor;
+ std::unique_ptr<weld::ToggleButton> m_xBtnGradient;
+ std::unique_ptr<weld::ToggleButton> m_xBtnHatch;
+ std::unique_ptr<weld::ToggleButton> m_xBtnBitmap;
+ std::unique_ptr<weld::ToggleButton> m_xBtnPattern;
+
+private:
+ DECL_LINK(SelectFillTypeHdl_Impl, weld::ToggleButton&, void);
template< typename TabPage >
bool FillItemSet_Impl( SfxItemSet* );
@@ -262,10 +266,11 @@ private:
void Reset_Impl( const SfxItemSet* );
template< typename TabPage >
DeactivateRC DeactivatePage_Impl( SfxItemSet* pSet );
+
public:
using TabPage::DeactivatePage;
- SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ SvxAreaTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
virtual ~SvxAreaTabPage() override;
virtual void dispose() override;
@@ -356,25 +361,6 @@ class SvxGradientTabPage : public SfxTabPage
using TabPage::DeactivatePage;
private:
- VclPtr<ListBox> m_pLbGradientType;
- VclPtr<FixedText> m_pFtCenter;
- VclPtr<MetricField> m_pMtrCenterX;
- VclPtr<MetricField> m_pMtrCenterY;
- VclPtr<FixedText> m_pFtAngle;
- VclPtr<MetricField> m_pMtrAngle;
- VclPtr<MetricField> m_pMtrBorder;
- VclPtr<Slider> m_pSliderBorder;
- VclPtr<SvxColorListBox> m_pLbColorFrom;
- VclPtr<MetricField> m_pMtrColorFrom;
- VclPtr<SvxColorListBox> m_pLbColorTo;
- VclPtr<MetricField> m_pMtrColorTo;
- VclPtr<SvxPresetListBox> m_pGradientLB;
- VclPtr<NumericField> m_pMtrIncrement;
- VclPtr<CheckBox> m_pCbIncrement;
- VclPtr<Slider> m_pSliderIncrement;
- VclPtr<SvxXRectPreview> m_pCtlPreview;
- VclPtr<PushButton> m_pBtnAdd;
- VclPtr<PushButton> m_pBtnModify;
const SfxItemSet& m_rOutAttrs;
XColorListRef m_pColorList;
@@ -386,24 +372,47 @@ private:
XFillAttrSetItem m_aXFillAttr;
SfxItemSet& m_rXFSet;
- DECL_LINK( ClickAddHdl_Impl, Button*, void );
- DECL_LINK( ClickModifyHdl_Impl, Button*, void );
- DECL_LINK( ChangeGradientHdl, ValueSet*, void );
+ XRectPreview m_aCtlPreview;
+ std::unique_ptr<weld::ComboBoxText> m_xLbGradientType;
+ std::unique_ptr<weld::Label> m_xFtCenter;
+ std::unique_ptr<weld::MetricSpinButton> m_xMtrCenterX;
+ std::unique_ptr<weld::MetricSpinButton> m_xMtrCenterY;
+ std::unique_ptr<weld::Label> m_xFtAngle;
+ std::unique_ptr<weld::MetricSpinButton> m_xMtrAngle;
+ std::unique_ptr<weld::MetricSpinButton> m_xMtrBorder;
+ std::unique_ptr<weld::Scale> m_xSliderBorder;
+ std::unique_ptr<ColorListBox> m_xLbColorFrom;
+ std::unique_ptr<weld::MetricSpinButton> m_xMtrColorFrom;
+ std::unique_ptr<ColorListBox> m_xLbColorTo;
+ std::unique_ptr<weld::MetricSpinButton> m_xMtrColorTo;
+ std::unique_ptr<PresetListBox> m_xGradientLB;
+ std::unique_ptr<weld::SpinButton> m_xMtrIncrement;
+ std::unique_ptr<weld::CheckButton> m_xCbIncrement;
+ std::unique_ptr<weld::Scale> m_xSliderIncrement;
+ std::unique_ptr<weld::Button> m_xBtnAdd;
+ std::unique_ptr<weld::Button> m_xBtnModify;
+ std::unique_ptr<weld::CustomWeld> m_xCtlPreview;
+ std::unique_ptr<weld::CustomWeld> m_xGradientLBWin;
+
+ DECL_LINK( ClickAddHdl_Impl, weld::Button&, void );
+ DECL_LINK( ClickModifyHdl_Impl, weld::Button&, void );
+ DECL_LINK( ChangeGradientHdl, SvtValueSet*, void );
void ChangeGradientHdl_Impl();
- DECL_LINK( ClickRenameHdl_Impl, SvxPresetListBox*, void );
- DECL_LINK( ClickDeleteHdl_Impl, SvxPresetListBox*, void );
- DECL_LINK( ModifiedEditHdl_Impl, Edit&, void );
- DECL_LINK( ModifiedColorListBoxHdl_Impl, SvxColorListBox&, void );
- DECL_LINK( ModifiedListBoxHdl_Impl, ListBox&, void );
- DECL_LINK( ChangeAutoStepHdl_Impl, CheckBox&, void );
- DECL_LINK( ModifiedSliderHdl_Impl, Slider*, void );
+ DECL_LINK( ClickRenameHdl_Impl, PresetListBox*, void );
+ DECL_LINK( ClickDeleteHdl_Impl, PresetListBox*, void );
+ DECL_LINK( ModifiedEditHdl_Impl, weld::SpinButton&, void );
+ DECL_LINK( ModifiedMetricHdl_Impl, weld::MetricSpinButton&, void );
+ DECL_LINK( ModifiedColorListBoxHdl_Impl, ColorListBox&, void );
+ DECL_LINK( ModifiedListBoxHdl_Impl, weld::ComboBoxText&, void );
+ DECL_LINK( ChangeAutoStepHdl_Impl, weld::ToggleButton&, void );
+ DECL_LINK( ModifiedSliderHdl_Impl, weld::Scale&, void );
void ModifiedHdl_Impl(void const *);
void SetControlState_Impl( css::awt::GradientStyle eXGS );
sal_Int32 SearchGradientList(const OUString& rGradientName);
public:
- SvxGradientTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ SvxGradientTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
virtual ~SvxGradientTabPage() override;
virtual void dispose() override;
@@ -431,18 +440,6 @@ class SvxHatchTabPage : public SvxTabPage
using TabPage::DeactivatePage;
private:
- VclPtr<MetricField> m_pMtrDistance;
- VclPtr<MetricField> m_pMtrAngle;
- VclPtr<Slider> m_pSliderAngle;
- VclPtr<ListBox> m_pLbLineType;
- VclPtr<SvxColorListBox> m_pLbLineColor;
- VclPtr<CheckBox> m_pCbBackgroundColor;
- VclPtr<SvxColorListBox> m_pLbBackgroundColor;
- VclPtr<SvxPresetListBox> m_pHatchLB;
- VclPtr<SvxXRectPreview> m_pCtlPreview;
- VclPtr<PushButton> m_pBtnAdd;
- VclPtr<PushButton> m_pBtnModify;
-
const SfxItemSet& m_rOutAttrs;
XColorListRef m_pColorList;
@@ -456,24 +453,38 @@ private:
MapUnit m_ePoolUnit;
- DECL_LINK( ChangeHatchHdl, ValueSet*, void );
+ XRectPreview m_aCtlPreview;
+ std::unique_ptr<weld::MetricSpinButton> m_xMtrDistance;
+ std::unique_ptr<weld::MetricSpinButton> m_xMtrAngle;
+ std::unique_ptr<weld::Scale> m_xSliderAngle;
+ std::unique_ptr<weld::ComboBoxText> m_xLbLineType;
+ std::unique_ptr<ColorListBox> m_xLbLineColor;
+ std::unique_ptr<weld::CheckButton> m_xCbBackgroundColor;
+ std::unique_ptr<ColorListBox> m_xLbBackgroundColor;
+ std::unique_ptr<PresetListBox> m_xHatchLB;
+ std::unique_ptr<weld::Button> m_xBtnAdd;
+ std::unique_ptr<weld::Button> m_xBtnModify;
+ std::unique_ptr<weld::CustomWeld> m_xHatchLBWin;
+ std::unique_ptr<weld::CustomWeld> m_xCtlPreview;
+
+ DECL_LINK(ChangeHatchHdl, SvtValueSet*, void);
void ChangeHatchHdl_Impl();
- DECL_LINK( ModifiedEditHdl_Impl, Edit&, void );
- DECL_LINK( ModifiedListBoxHdl_Impl, ListBox&, void );
- DECL_LINK( ModifiedColorListBoxHdl_Impl, SvxColorListBox&, void );
- DECL_LINK( ToggleHatchBackgroundColor_Impl, CheckBox&, void );
- DECL_LINK( ModifiedBackgroundHdl_Impl, SvxColorListBox&, void );
- DECL_LINK( ModifiedSliderHdl_Impl, Slider*, void );
+ DECL_LINK( ModifiedEditHdl_Impl, weld::MetricSpinButton&, void );
+ DECL_LINK( ModifiedListBoxHdl_Impl, weld::ComboBoxText&, void );
+ DECL_LINK( ModifiedColorListBoxHdl_Impl, ColorListBox&, void );
+ DECL_LINK( ToggleHatchBackgroundColor_Impl, weld::ToggleButton&, void );
+ DECL_LINK( ModifiedBackgroundHdl_Impl, ColorListBox&, void );
+ DECL_LINK( ModifiedSliderHdl_Impl, weld::Scale&, void );
void ModifiedHdl_Impl(void const *);
- DECL_LINK( ClickAddHdl_Impl, Button*, void );
- DECL_LINK( ClickModifyHdl_Impl, Button*, void );
- DECL_LINK( ClickRenameHdl_Impl, SvxPresetListBox*, void );
- DECL_LINK( ClickDeleteHdl_Impl, SvxPresetListBox*, void );
+ DECL_LINK( ClickAddHdl_Impl, weld::Button&, void );
+ DECL_LINK( ClickModifyHdl_Impl, weld::Button&, void );
+ DECL_LINK( ClickRenameHdl_Impl, PresetListBox*, void );
+ DECL_LINK( ClickDeleteHdl_Impl, PresetListBox*, void );
sal_Int32 SearchHatchList(const OUString& rHatchName);
public:
- SvxHatchTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ SvxHatchTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
virtual ~SvxHatchTabPage() override;
virtual void dispose() override;
@@ -508,23 +519,6 @@ class SvxBitmapTabPage : public SvxTabPage
static const sal_uInt16 pBitmapRanges[];
private:
- VclPtr<SvxPresetListBox> m_pBitmapLB;
- VclPtr<ListBox> m_pBitmapStyleLB;
- VclPtr<VclBox> m_pSizeBox;
- VclPtr<CheckBox> m_pTsbScale;
- VclPtr<MetricField> m_pBitmapWidth;
- VclPtr<MetricField> m_pBitmapHeight;
- VclPtr<VclBox> m_pPositionBox;
- VclPtr<ListBox> m_pPositionLB;
- VclPtr<VclBox> m_pPositionOffBox;
- VclPtr<MetricField> m_pPositionOffX;
- VclPtr<MetricField> m_pPositionOffY;
- VclPtr<VclBox> m_pTileOffBox;
- VclPtr<ListBox> m_pTileOffLB;
- VclPtr<MetricField> m_pTileOffset;
- VclPtr<PushButton> m_pBtnImport;
- VclPtr<SvxXRectPreview> m_pCtlBitmapPreview;
-
const SfxItemSet& m_rOutAttrs;
XBitmapListRef m_pBitmapList;
@@ -542,22 +536,42 @@ private:
Size rBitmapSize;
Size rFilledSize;
Size rZoomedSize;
- DECL_LINK( ModifyBitmapHdl, ValueSet*, void );
- DECL_LINK( ClickScaleHdl, Button*, void );
- DECL_LINK( ModifyBitmapStyleHdl, ListBox&, void );
- DECL_LINK( ModifyBitmapSizeHdl, Edit&, void );
- DECL_LINK( ModifyBitmapPositionHdl, ListBox&, void );
- DECL_LINK( ModifyPositionOffsetHdl, Edit&, void );
- DECL_LINK( ModifyTileOffsetHdl, Edit&, void );
- DECL_LINK( ClickRenameHdl, SvxPresetListBox*, void );
- DECL_LINK( ClickDeleteHdl, SvxPresetListBox*, void );
- DECL_LINK( ClickImportHdl, Button*, void );
+
+ XRectPreview m_aCtlBitmapPreview;
+ std::unique_ptr<PresetListBox> m_xBitmapLB;
+ std::unique_ptr<weld::ComboBoxText> m_xBitmapStyleLB;
+ std::unique_ptr<weld::Container> m_xSizeBox;
+ std::unique_ptr<weld::CheckButton> m_xTsbScale;
+ std::unique_ptr<weld::MetricSpinButton> m_xBitmapWidth;
+ std::unique_ptr<weld::MetricSpinButton> m_xBitmapHeight;
+ std::unique_ptr<weld::Container> m_xPositionBox;
+ std::unique_ptr<weld::ComboBoxText> m_xPositionLB;
+ std::unique_ptr<weld::Container> m_xPositionOffBox;
+ std::unique_ptr<weld::MetricSpinButton> m_xPositionOffX;
+ std::unique_ptr<weld::MetricSpinButton> m_xPositionOffY;
+ std::unique_ptr<weld::Container> m_xTileOffBox;
+ std::unique_ptr<weld::ComboBoxText> m_xTileOffLB;
+ std::unique_ptr<weld::MetricSpinButton> m_xTileOffset;
+ std::unique_ptr<weld::Button> m_xBtnImport;
+ std::unique_ptr<weld::CustomWeld> m_xCtlBitmapPreview;
+ std::unique_ptr<weld::CustomWeld> m_xBitmapLBWin;
+
+ DECL_LINK( ModifyBitmapHdl, SvtValueSet*, void );
+ DECL_LINK( ClickScaleHdl, weld::Button&, void );
+ DECL_LINK( ModifyBitmapStyleHdl, weld::ComboBoxText&, void );
+ DECL_LINK( ModifyBitmapSizeHdl, weld::MetricSpinButton&, void );
+ DECL_LINK( ModifyBitmapPositionHdl, weld::ComboBoxText&, void );
+ DECL_LINK( ModifyPositionOffsetHdl, weld::MetricSpinButton&, void );
+ DECL_LINK( ModifyTileOffsetHdl, weld::MetricSpinButton&, void );
+ DECL_LINK( ClickRenameHdl, PresetListBox*, void );
+ DECL_LINK( ClickDeleteHdl, PresetListBox*, void );
+ DECL_LINK( ClickImportHdl, weld::Button&, void );
void ClickBitmapHdl_Impl();
void CalculateBitmapPresetSize();
sal_Int32 SearchBitmapList(const OUString& rBitmapName);
public:
- SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ SvxBitmapTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
virtual ~SvxBitmapTabPage() override;
virtual void dispose() override;
@@ -584,16 +598,6 @@ class SvxPatternTabPage : public SvxTabPage
using TabPage::DeactivatePage;
private:
- VclPtr<SvxPixelCtl> m_pCtlPixel;
- VclPtr<SvxColorListBox> m_pLbColor;
- VclPtr<SvxColorListBox> m_pLbBackgroundColor;
- VclPtr<SvxPresetListBox> m_pPatternLB;
- VclPtr<SvxXRectPreview> m_pCtlPreview;
- VclPtr<PushButton> m_pBtnAdd;
- VclPtr<PushButton> m_pBtnModify;
-
- std::unique_ptr<SvxBitmapCtl> m_pBitmapCtl;
-
const SfxItemSet& m_rOutAttrs;
XColorListRef m_pColorList;
@@ -605,17 +609,29 @@ private:
XFillAttrSetItem m_aXFillAttr;
SfxItemSet& m_rXFSet;
- DECL_LINK( ClickAddHdl_Impl, Button*, void );
- DECL_LINK( ClickModifyHdl_Impl, Button*, void );
- DECL_LINK( ChangePatternHdl_Impl, ValueSet*, void );
- DECL_LINK( ChangeColorHdl_Impl, SvxColorListBox&, void );
- DECL_LINK( ClickRenameHdl_Impl, SvxPresetListBox*, void );
- DECL_LINK( ClickDeleteHdl_Impl, SvxPresetListBox*, void );
+ SvxPixelCtl m_aCtlPixel;
+ XRectPreview m_aCtlPreview;
+ std::unique_ptr<ColorListBox> m_xLbColor;
+ std::unique_ptr<ColorListBox> m_xLbBackgroundColor;
+ std::unique_ptr<PresetListBox> m_xPatternLB;
+ std::unique_ptr<weld::Button> m_xBtnAdd;
+ std::unique_ptr<weld::Button> m_xBtnModify;
+ std::unique_ptr<weld::CustomWeld> m_xCtlPixel;
+ std::unique_ptr<weld::CustomWeld> m_xCtlPreview;
+ std::unique_ptr<weld::CustomWeld> m_xPatternLBWin;
+ std::unique_ptr<SvxBitmapCtl> m_xBitmapCtl;
+
+ DECL_LINK( ClickAddHdl_Impl, weld::Button&, void );
+ DECL_LINK( ClickModifyHdl_Impl, weld::Button&, void );
+ DECL_LINK( ChangePatternHdl_Impl, SvtValueSet*, void );
+ DECL_LINK( ChangeColorHdl_Impl, ColorListBox&, void );
+ DECL_LINK( ClickRenameHdl_Impl, PresetListBox*, void );
+ DECL_LINK( ClickDeleteHdl_Impl, PresetListBox*, void );
sal_Int32 SearchPatternList(const OUString& rPatternName);
public:
- SvxPatternTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
+ SvxPatternTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs);
virtual ~SvxPatternTabPage() override;
virtual void dispose() override;
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 9d9fa98d1f54..c6c325b38fe3 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -1443,16 +1443,14 @@ void SvxBackgroundTabPage::PageCreated(const SfxAllItemSet& aSet)
}
}
-SvxBkgTabPage::SvxBkgTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ) :
- SvxAreaTabPage( pParent, rInAttrs ),
- m_pTblLBox(nullptr),
- bHighlighting(false)
+SvxBkgTabPage::SvxBkgTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs)
+ : SvxAreaTabPage(pParent, rInAttrs)
+ , bHighlighting(false)
{
- VclPtr<vcl::Window> pBtn;
- get(pBtn, "btngradient"); pBtn->Hide();
- get(pBtn, "btnhatch"); pBtn->Hide();
- get(pBtn, "btnbitmap"); pBtn->Hide();
- get(pBtn, "btnpattern"); pBtn->Hide();
+ m_xBtnGradient->hide();
+ m_xBtnHatch->hide();
+ m_xBtnBitmap->hide();
+ m_xBtnPattern->hide();
SfxObjectShell* pDocSh = SfxObjectShell::Current();
const SfxPoolItem* pItem = nullptr;
@@ -1483,7 +1481,7 @@ SvxBkgTabPage::~SvxBkgTabPage()
void SvxBkgTabPage::dispose()
{
- m_pTblLBox.clear();
+ m_xTblLBox.reset();
SvxAreaTabPage::dispose();
}
@@ -1501,9 +1499,9 @@ DeactivateRC SvxBkgTabPage::DeactivatePage( SfxItemSet* _pSet )
bool SvxBkgTabPage::FillItemSet( SfxItemSet* rCoreSet )
{
sal_uInt16 nSlot = SID_ATTR_BRUSH;
- if ( m_pTblLBox && m_pTblLBox->IsVisible() )
+ if (m_xTblLBox && m_xTblLBox->get_visible())
{
- switch( m_pTblLBox->GetSelectedEntryPos() )
+ switch (m_xTblLBox->get_active())
{
case TBL_DEST_CELL:
nSlot = SID_ATTR_BRUSH;
@@ -1549,10 +1547,9 @@ bool SvxBkgTabPage::FillItemSet( SfxItemSet* rCoreSet )
return true;
}
-VclPtr<SfxTabPage> SvxBkgTabPage::Create( TabPageParent pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxBkgTabPage::Create(TabPageParent pWindow, const SfxItemSet* rAttrs)
{
- return VclPtr<SvxBkgTabPage>::Create( pWindow.pParent, *rAttrs );
+ return VclPtr<SvxBkgTabPage>::Create(pWindow, *rAttrs);
}
void SvxBkgTabPage::PageCreated(const SfxAllItemSet& aSet)
@@ -1563,21 +1560,15 @@ void SvxBkgTabPage::PageCreated(const SfxAllItemSet& aSet)
SvxBackgroundTabFlags nFlags = static_cast<SvxBackgroundTabFlags>(pFlagItem->GetValue());
if ( nFlags & SvxBackgroundTabFlags::SHOW_TBLCTL )
{
- VclPtr<vcl::Window> pBtn;
- get(pBtn, "btnbitmap");
- pBtn->Show();
- get(m_pTblLBox, "tablelb");
- m_pTblLBox->SelectEntryPos(0);
- m_pTblLBox->Show();
+ m_xBtnBitmap->show();
+ m_xTblLBox = m_xBuilder->weld_combo_box_text("tablelb");
+ m_xTblLBox->set_active(0);
+ m_xTblLBox->show();
}
else if (nFlags & SvxBackgroundTabFlags::SHOW_HIGHLIGHTING)
bHighlighting = bool(nFlags & SvxBackgroundTabFlags::SHOW_HIGHLIGHTING);
else if (nFlags & SvxBackgroundTabFlags::SHOW_SELECTOR)
- {
- VclPtr<vcl::Window> pBtn;
- get(pBtn, "btnbitmap");
- pBtn->Show();
- }
+ m_xBtnBitmap->show();
}
SvxAreaTabPage::PageCreated( aSet );
}
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index dbceed157716..655c532a1aab 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -82,72 +82,64 @@ void lclExtendSize(Size& rSize, const Size& rInputSize)
|*
\************************************************************************/
-SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ) :
-
- SvxTabPage( pParent,
- "AreaTabPage",
- "cui/ui/areatabpage.ui",
- rInAttrs ),
- m_pFillTabPage( nullptr ),
- m_pColorList( nullptr ),
- m_pGradientList( nullptr ),
- m_pHatchingList( nullptr ),
- m_pBitmapList( nullptr ),
- m_pPatternList( nullptr ),
-
+SvxAreaTabPage::SvxAreaTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs)
+ : SvxTabPage(pParent, "cui/ui/areatabpage.ui", "AreaTabPage", rInAttrs)
+ , m_pFillTabPage(nullptr)
+ , m_pColorList(nullptr)
+ , m_pGradientList(nullptr)
+ , m_pHatchingList(nullptr)
+ , m_pBitmapList(nullptr)
+ , m_pPatternList(nullptr)
// local fixed not o be changed values for local pointers
- maFixed_ChangeType(ChangeType::NONE),
-
+ , maFixed_ChangeType(ChangeType::NONE)
// init with pointers to fixed ChangeType
- m_pnColorListState(&maFixed_ChangeType),
- m_pnBitmapListState(&maFixed_ChangeType),
- m_pnPatternListState(&maFixed_ChangeType),
- m_pnGradientListState(&maFixed_ChangeType),
- m_pnHatchingListState(&maFixed_ChangeType),
- m_aXFillAttr ( rInAttrs.GetPool() ),
- m_rXFSet ( m_aXFillAttr.GetItemSet() )
+ , m_pnColorListState(&maFixed_ChangeType)
+ , m_pnBitmapListState(&maFixed_ChangeType)
+ , m_pnPatternListState(&maFixed_ChangeType)
+ , m_pnGradientListState(&maFixed_ChangeType)
+ , m_pnHatchingListState(&maFixed_ChangeType)
+ , m_aXFillAttr(rInAttrs.GetPool())
+ , m_rXFSet(m_aXFillAttr.GetItemSet())
+ , m_xFillTab(m_xBuilder->weld_container("fillstylebox"))
+ , m_xBtnNone(m_xBuilder->weld_toggle_button("btnnone"))
+ , m_xBtnColor(m_xBuilder->weld_toggle_button("btncolor"))
+ , m_xBtnGradient(m_xBuilder->weld_toggle_button("btngradient"))
+ , m_xBtnHatch(m_xBuilder->weld_toggle_button("btnhatch"))
+ , m_xBtnBitmap(m_xBuilder->weld_toggle_button("btnbitmap"))
+ , m_xBtnPattern(m_xBuilder->weld_toggle_button("btnpattern"))
{
-
- get(m_pBtnNone, "btnnone");
- get(m_pBtnColor, "btncolor");
- get(m_pBtnGradient, "btngradient");
- get(m_pBtnHatch, "btnhatch");
- get(m_pBtnBitmap, "btnbitmap");
- get(m_pBtnPattern, "btnpattern");
- get(m_pFillTab, "fillstylebox");
- maBox.AddButton( m_pBtnNone );
- maBox.AddButton( m_pBtnColor );
- maBox.AddButton( m_pBtnGradient );
- maBox.AddButton( m_pBtnHatch );
- maBox.AddButton( m_pBtnBitmap );
- maBox.AddButton( m_pBtnPattern );
- Link< Button*, void > aLink = LINK(this, SvxAreaTabPage, SelectFillTypeHdl_Impl);
- m_pBtnNone->SetClickHdl(aLink);
- m_pBtnColor->SetClickHdl(aLink);
- m_pBtnGradient->SetClickHdl(aLink);
- m_pBtnHatch->SetClickHdl(aLink);
- m_pBtnBitmap->SetClickHdl(aLink);
- m_pBtnPattern->SetClickHdl(aLink);
+ maBox.AddButton(m_xBtnNone.get());
+ maBox.AddButton(m_xBtnColor.get());
+ maBox.AddButton(m_xBtnGradient.get());
+ maBox.AddButton(m_xBtnHatch.get());
+ maBox.AddButton(m_xBtnBitmap.get());
+ maBox.AddButton(m_xBtnPattern.get());
+ Link<weld::ToggleButton&, void> aLink = LINK(this, SvxAreaTabPage, SelectFillTypeHdl_Impl);
+ m_xBtnNone->connect_toggled(aLink);
+ m_xBtnColor->connect_toggled(aLink);
+ m_xBtnGradient->connect_toggled(aLink);
+ m_xBtnHatch->connect_toggled(aLink);
+ m_xBtnBitmap->connect_toggled(aLink);
+ m_xBtnPattern->connect_toggled(aLink);
SetExchangeSupport();
- TabPageParent aFillTab(m_pFillTab);
+ TabPageParent aFillTab(m_xFillTab.get());
// Calculate optimal size of all pages..
m_pFillTabPage.disposeAndReset(SvxColorTabPage::Create(aFillTab, &m_rXFSet));
- Size aSize = m_pFillTabPage->GetOptimalSize();
+ Size aSize = m_pFillTabPage->get_container_size();
m_pFillTabPage.disposeAndReset(SvxGradientTabPage::Create(aFillTab, &m_rXFSet));
- lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize());
+ lclExtendSize(aSize, m_pFillTabPage->get_container_size());
m_pFillTabPage.disposeAndReset(SvxBitmapTabPage::Create(aFillTab, &m_rXFSet));
- lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize());
+ lclExtendSize(aSize, m_pFillTabPage->get_container_size());
m_pFillTabPage.disposeAndReset(SvxHatchTabPage::Create(aFillTab, &m_rXFSet));
- lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize());
+ lclExtendSize(aSize, m_pFillTabPage->get_container_size());
m_pFillTabPage.disposeAndReset(SvxPatternTabPage::Create(aFillTab, &m_rXFSet));
- lclExtendSize(aSize, m_pFillTabPage->GetOptimalSize());
+ lclExtendSize(aSize, m_pFillTabPage->get_container_size());
m_pFillTabPage.disposeAndClear();
- m_pFillTab->set_width_request(aSize.Width());
- m_pFillTab->set_height_request(aSize.Height());
+ m_xFillTab->set_size_request(aSize.Width(), aSize.Height());
}
SvxAreaTabPage::~SvxAreaTabPage()
@@ -157,13 +149,6 @@ SvxAreaTabPage::~SvxAreaTabPage()
void SvxAreaTabPage::dispose()
{
- m_pBtnNone.clear();
- m_pBtnColor.clear();
- m_pBtnGradient.clear();
- m_pBtnHatch.clear();
- m_pBtnBitmap.clear();
- m_pBtnPattern.clear();
- m_pFillTab.clear();
m_pFillTabPage.disposeAndClear();
SvxTabPage::dispose();
}
@@ -183,25 +168,25 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
default:
case drawing::FillStyle_NONE:
{
- SelectFillTypeHdl_Impl( m_pBtnNone );
+ SelectFillTypeHdl_Impl(*m_xBtnNone);
break;
}
case drawing::FillStyle_SOLID:
{
m_rXFSet.Put( static_cast<const XFillColorItem&>( rSet.Get( GetWhich( XATTR_FILLCOLOR ) ) ) );
- SelectFillTypeHdl_Impl( m_pBtnColor );
+ SelectFillTypeHdl_Impl(*m_xBtnColor);
break;
}
case drawing::FillStyle_GRADIENT:
{
m_rXFSet.Put( static_cast<const XFillGradientItem&>( rSet.Get( GetWhich( XATTR_FILLGRADIENT ) ) ) );
- SelectFillTypeHdl_Impl( m_pBtnGradient );
+ SelectFillTypeHdl_Impl(*m_xBtnGradient);
break;
}
case drawing::FillStyle_HATCH:
{
m_rXFSet.Put( rSet.Get(XATTR_FILLHATCH) );
- SelectFillTypeHdl_Impl( m_pBtnHatch );
+ SelectFillTypeHdl_Impl(*m_xBtnHatch);
break;
}
case drawing::FillStyle_BITMAP:
@@ -210,9 +195,9 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
// pass full item set here, bitmap fill has many attributes (tiling, size, offset etc.)
m_rXFSet.Put( rSet );
if(!aItem.isPattern())
- SelectFillTypeHdl_Impl( m_pBtnBitmap );
+ SelectFillTypeHdl_Impl(*m_xBtnBitmap);
else
- SelectFillTypeHdl_Impl( m_pBtnPattern );
+ SelectFillTypeHdl_Impl(*m_xBtnPattern);
break;
}
}
@@ -335,15 +320,14 @@ void SvxAreaTabPage::Reset( const SfxItemSet* rAttrs )
}
}
-VclPtr<SfxTabPage> SvxAreaTabPage::Create( TabPageParent pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxAreaTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrs)
{
- return VclPtr<SvxAreaTabPage>::Create( pWindow.pParent, *rAttrs );
+ return VclPtr<SvxAreaTabPage>::Create(pParent, *rAttrs);
}
namespace {
-VclPtr<SfxTabPage> lcl_CreateFillStyleTabPage( sal_uInt16 nId, vcl::Window* pParent, const SfxItemSet& rSet )
+VclPtr<SfxTabPage> lcl_CreateFillStyleTabPage(sal_uInt16 nId, TabPageParent pParent, const SfxItemSet& rSet)
{
CreateTabPage fnCreate = nullptr;
switch(nId)
@@ -361,14 +345,16 @@ VclPtr<SfxTabPage> lcl_CreateFillStyleTabPage( sal_uInt16 nId, vcl::Window* pPar
}
-IMPL_LINK(SvxAreaTabPage, SelectFillTypeHdl_Impl, Button*, pButton, void)
+IMPL_LINK(SvxAreaTabPage, SelectFillTypeHdl_Impl, weld::ToggleButton&, rButton, void)
{
- sal_Int32 nPos = maBox.GetButtonPos( static_cast<PushButton*>(pButton) );
+ sal_Int32 nPos = maBox.GetButtonPos(&rButton);
if(nPos != -1 && nPos != maBox.GetCurrentButtonPos())
{
- maBox.SelectButton(static_cast<PushButton*>(pButton));
+ maBox.SelectButton(&rButton);
FillType eFillType = static_cast<FillType>(maBox.GetCurrentButtonPos());
- m_pFillTabPage.disposeAndReset( lcl_CreateFillStyleTabPage(eFillType, m_pFillTab, m_rXFSet) );
+ m_pFillTabPage.disposeAndReset(lcl_CreateFillStyleTabPage(eFillType, m_xFillTab.get(), m_rXFSet));
+ if (m_pFillTabPage)
+ m_pFillTabPage->SetTabDialog(GetTabDialog());
CreatePage( eFillType , m_pFillTabPage);
}
}
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 982d15ae2669..edd5f5981c6e 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -67,73 +67,66 @@ const sal_uInt16 SvxBitmapTabPage::pBitmapRanges[] =
0
};
-SvxBitmapTabPage::SvxBitmapTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs ) :
-
- SvxTabPage( pParent,
- "BitmapTabPage",
- "cui/ui/bitmaptabpage.ui",
- rInAttrs ),
- m_rOutAttrs (rInAttrs ),
-
- m_pBitmapList( nullptr ),
-
- m_pnBitmapListState( nullptr ),
- m_fObjectWidth(0.0),
- m_fObjectHeight(0.0),
- m_bLogicalSize(false),
- m_aXFillAttr ( rInAttrs.GetPool() ),
- m_rXFSet ( m_aXFillAttr.GetItemSet() ),
- mpView(nullptr)
+SvxBitmapTabPage::SvxBitmapTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs)
+ : SvxTabPage(pParent, "cui/ui/bitmaptabpage.ui", "BitmapTabPage", rInAttrs)
+ , m_rOutAttrs(rInAttrs)
+ , m_pBitmapList(nullptr)
+ , m_pnBitmapListState(nullptr)
+ , m_fObjectWidth(0.0)
+ , m_fObjectHeight(0.0)
+ , m_bLogicalSize(false)
+ , m_aXFillAttr(rInAttrs.GetPool())
+ , m_rXFSet(m_aXFillAttr.GetItemSet())
+ , mpView(nullptr)
+ , m_xBitmapLB(new PresetListBox(m_xBuilder->weld_scrolled_window("bitmapwin")))
+ , m_xBitmapStyleLB(m_xBuilder->weld_combo_box_text("bitmapstyle"))
+ , m_xSizeBox(m_xBuilder->weld_container("sizebox"))
+ , m_xTsbScale(m_xBuilder->weld_check_button("scaletsb"))
+ , m_xBitmapWidth(m_xBuilder->weld_metric_spin_button("width", FUNIT_PERCENT))
+ , m_xBitmapHeight(m_xBuilder->weld_metric_spin_button("height", FUNIT_PERCENT))
+ , m_xPositionBox(m_xBuilder->weld_container("posbox"))
+ , m_xPositionLB(m_xBuilder->weld_combo_box_text("positionlb"))
+ , m_xPositionOffBox(m_xBuilder->weld_container("posoffbox"))
+ , m_xPositionOffX(m_xBuilder->weld_metric_spin_button("posoffx", FUNIT_PERCENT))
+ , m_xPositionOffY(m_xBuilder->weld_metric_spin_button("posoffy", FUNIT_PERCENT))
+ , m_xTileOffBox(m_xBuilder->weld_container("tileoffbox"))
+ , m_xTileOffLB(m_xBuilder->weld_combo_box_text("tileofflb"))
+ , m_xTileOffset(m_xBuilder->weld_metric_spin_button("tileoffmtr", FUNIT_PERCENT))
+ , m_xBtnImport(m_xBuilder->weld_button("BTN_IMPORT"))
+ , m_xCtlBitmapPreview(new weld::CustomWeld(*m_xBuilder, "CTL_BITMAP_PREVIEW", m_aCtlBitmapPreview))
+ , m_xBitmapLBWin(new weld::CustomWeld(*m_xBuilder, "BITMAP", *m_xBitmapLB))
{
- get(m_pBitmapLB,"BITMAP");
- get(m_pBitmapStyleLB, "bitmapstyle");
- get(m_pSizeBox, "sizebox");
- get(m_pBitmapWidth, "width");
- get(m_pBitmapHeight, "height");
- get(m_pTsbScale, "scaletsb");
- get(m_pPositionBox, "posbox");
- get(m_pPositionLB, "positionlb");
- get(m_pPositionOffBox, "posoffbox");
- get(m_pPositionOffX, "posoffx");
- get(m_pPositionOffY, "posoffy");
- get(m_pTileOffBox, "tileoffbox");
- get(m_pTileOffLB, "tileofflb");
- get(m_pTileOffset, "tileoffmtr");
- get(m_pCtlBitmapPreview,"CTL_BITMAP_PREVIEW");
- get(m_pBtnImport, "BTN_IMPORT");
-
// setting the output device
m_rXFSet.Put( XFillStyleItem(drawing::FillStyle_BITMAP) );
m_rXFSet.Put( XFillBitmapItem(OUString(), Graphic()) );
- m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
-
- m_pBitmapLB->SetSelectHdl( LINK(this, SvxBitmapTabPage, ModifyBitmapHdl) );
- m_pBitmapLB->SetRenameHdl( LINK(this, SvxBitmapTabPage, ClickRenameHdl) );
- m_pBitmapLB->SetDeleteHdl( LINK(this, SvxBitmapTabPage, ClickDeleteHdl) );
- m_pBitmapStyleLB->SetSelectHdl( LINK(this, SvxBitmapTabPage, ModifyBitmapStyleHdl) );
- Link<Edit&, void> aLink1( LINK(this, SvxBitmapTabPage, ModifyBitmapSizeHdl) );
- m_pBitmapWidth->SetModifyHdl( aLink1 );
- m_pBitmapHeight->SetModifyHdl( aLink1 );
- m_pTsbScale->SetClickHdl( LINK(this, SvxBitmapTabPage, ClickScaleHdl) );
- m_pPositionLB->SetSelectHdl( LINK( this, SvxBitmapTabPage, ModifyBitmapPositionHdl ) );
- Link<Edit&, void> aLink( LINK( this, SvxBitmapTabPage, ModifyPositionOffsetHdl ) );
- m_pPositionOffX->SetModifyHdl(aLink);
- m_pPositionOffY->SetModifyHdl(aLink);
- m_pTileOffset->SetModifyHdl( LINK( this, SvxBitmapTabPage, ModifyTileOffsetHdl ) );
- m_pBtnImport->SetClickHdl( LINK(this, SvxBitmapTabPage, ClickImportHdl) );
+ m_aCtlBitmapPreview.SetAttributes( m_aXFillAttr.GetItemSet() );
+
+ m_xBitmapLB->SetSelectHdl( LINK(this, SvxBitmapTabPage, ModifyBitmapHdl) );
+ m_xBitmapLB->SetRenameHdl( LINK(this, SvxBitmapTabPage, ClickRenameHdl) );
+ m_xBitmapLB->SetDeleteHdl( LINK(this, SvxBitmapTabPage, ClickDeleteHdl) );
+ m_xBitmapStyleLB->connect_changed( LINK(this, SvxBitmapTabPage, ModifyBitmapStyleHdl) );
+ Link<weld::MetricSpinButton&, void> aLink1( LINK(this, SvxBitmapTabPage, ModifyBitmapSizeHdl) );
+ m_xBitmapWidth->connect_value_changed( aLink1 );
+ m_xBitmapHeight->connect_value_changed( aLink1 );
+ m_xTsbScale->connect_clicked(LINK(this, SvxBitmapTabPage, ClickScaleHdl));
+ m_xPositionLB->connect_changed( LINK( this, SvxBitmapTabPage, ModifyBitmapPositionHdl ) );
+ Link<weld::MetricSpinButton&, void> aLink( LINK( this, SvxBitmapTabPage, ModifyPositionOffsetHdl ) );
+ m_xPositionOffX->connect_value_changed(aLink);
+ m_xPositionOffY->connect_value_changed(aLink);
+ m_xTileOffset->set_value(0, FUNIT_PERCENT);
+ m_xTileOffset->connect_value_changed( LINK( this, SvxBitmapTabPage, ModifyTileOffsetHdl ) );
+ m_xBtnImport->connect_clicked( LINK(this, SvxBitmapTabPage, ClickImportHdl) );
// Calculate size of display boxes
Size aSize = getDrawPreviewOptimalSize(this);
- m_pBitmapLB->set_width_request(aSize.Width());
- m_pBitmapLB->set_height_request(aSize.Height());
- m_pCtlBitmapPreview->set_width_request(aSize.Width());
- m_pCtlBitmapPreview->set_height_request(aSize.Height());
+ m_xBitmapLB->set_size_request(aSize.Width(), aSize.Height());
+ m_xCtlBitmapPreview->set_size_request(aSize.Width(), aSize.Height());
SfxItemPool* pPool = m_rXFSet.GetPool();
mePoolUnit = pPool->GetMetric( XATTR_FILLBMP_SIZEX );
meFieldUnit = GetModuleFieldUnit( rInAttrs );
- SetFieldUnit( *m_pBitmapWidth, meFieldUnit, true );
- SetFieldUnit( *m_pBitmapHeight, meFieldUnit, true );
+ SetFieldUnit( *m_xBitmapWidth, meFieldUnit, true );
+ SetFieldUnit( *m_xBitmapHeight, meFieldUnit, true );
SfxViewShell* pViewShell = SfxViewShell::Current();
if( pViewShell )
@@ -148,32 +141,17 @@ SvxBitmapTabPage::~SvxBitmapTabPage()
void SvxBitmapTabPage::dispose()
{
- m_pBitmapLB.clear();
- m_pBitmapStyleLB.clear();
- m_pSizeBox.clear();
- m_pBitmapWidth.clear();
- m_pBitmapHeight.clear();
- m_pTsbScale.clear();
- m_pPositionBox.clear();
- m_pPositionLB.clear();
- m_pPositionOffBox.clear();
- m_pPositionOffX.clear();
- m_pPositionOffY.clear();
- m_pTileOffBox.clear();
- m_pTileOffLB.clear();
- m_pTileOffset.clear();
- m_pCtlBitmapPreview.clear();
- m_pBtnImport.clear();
+ m_xBitmapLBWin.reset();
+ m_xBitmapLB.reset();
+ m_xCtlBitmapPreview.reset();
SvxTabPage::dispose();
}
-
void SvxBitmapTabPage::Construct()
{
- m_pBitmapLB->FillPresetListBox( *m_pBitmapList );
+ m_xBitmapLB->FillPresetListBox( *m_pBitmapList );
}
-
void SvxBitmapTabPage::ActivatePage( const SfxItemSet& rSet )
{
XFillBitmapItem aItem( rSet.Get(XATTR_FILLBITMAP) );
@@ -181,8 +159,8 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& rSet )
sal_Int32 nPos = SearchBitmapList( aItem.GetName() );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- sal_uInt16 nId = m_pBitmapLB->GetItemId( static_cast<size_t>( nPos ) );
- m_pBitmapLB->SelectItem( nId );
+ sal_uInt16 nId = m_xBitmapLB->GetItemId( static_cast<size_t>( nPos ) );
+ m_xBitmapLB->SelectItem( nId );
}
}
@@ -199,15 +177,15 @@ DeactivateRC SvxBitmapTabPage::DeactivatePage( SfxItemSet* _pSet )
bool SvxBitmapTabPage::FillItemSet( SfxItemSet* rAttrs )
{
rAttrs->Put(XFillStyleItem(drawing::FillStyle_BITMAP));
- size_t nPos = m_pBitmapLB->GetSelectItemPos();
+ size_t nPos = m_xBitmapLB->GetSelectItemPos();
if(VALUESET_ITEM_NOTFOUND != nPos)
{
const XBitmapEntry* pXBitmapEntry = m_pBitmapList->GetBitmap(nPos);
- const OUString aString(m_pBitmapLB->GetItemText( m_pBitmapLB->GetSelectedItemId() ));
+ const OUString aString(m_xBitmapLB->GetItemText( m_xBitmapLB->GetSelectedItemId() ));
rAttrs->Put(XFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject()));
}
- BitmapStyle eStylePos = static_cast<BitmapStyle>(m_pBitmapStyleLB->GetSelectedEntryPos());
+ BitmapStyle eStylePos = static_cast<BitmapStyle>(m_xBitmapStyleLB->get_active());
bool bIsStretched( eStylePos == STRETCHED );
bool bIsTiled( eStylePos == TILED );
@@ -222,17 +200,17 @@ bool SvxBitmapTabPage::FillItemSet( SfxItemSet* rAttrs )
case CUSTOM:
case TILED:
{
- sal_Int64 nWidthPercent = m_pBitmapWidth->GetValue();
- sal_Int64 nHeightPercent = m_pBitmapHeight->GetValue();
- if(m_pTsbScale->IsEnabled() && m_pTsbScale->GetState() == TRISTATE_TRUE)
+ sal_Int64 nWidthPercent = m_xBitmapWidth->get_value(FUNIT_NONE);
+ sal_Int64 nHeightPercent = m_xBitmapHeight->get_value(FUNIT_NONE);
+ if (m_xTsbScale->get_sensitive() && m_xTsbScale->get_state() == TRISTATE_TRUE)
{
aSetBitmapSize.setWidth( -nWidthPercent );
aSetBitmapSize.setHeight( -nHeightPercent );
}
else if (!m_bLogicalSize)
{
- aSetBitmapSize.setWidth( GetCoreValue(*m_pBitmapWidth, mePoolUnit) );
- aSetBitmapSize.setHeight( GetCoreValue(*m_pBitmapHeight, mePoolUnit) );
+ aSetBitmapSize.setWidth( GetCoreValue(*m_xBitmapWidth, mePoolUnit) );
+ aSetBitmapSize.setHeight( GetCoreValue(*m_xBitmapHeight, mePoolUnit) );
}
else
{
@@ -251,16 +229,16 @@ bool SvxBitmapTabPage::FillItemSet( SfxItemSet* rAttrs )
rAttrs->Put( XFillBmpSizeYItem( aSetBitmapSize.Height() ) );
}
- if(m_pPositionLB->IsEnabled())
- rAttrs->Put( XFillBmpPosItem( static_cast<RectPoint>( m_pPositionLB->GetSelectedEntryPos() ) ) );
- if(m_pPositionOffX->IsEnabled())
- rAttrs->Put( XFillBmpPosOffsetXItem( m_pPositionOffX->GetValue() ) );
- if(m_pPositionOffY->IsEnabled())
- rAttrs->Put( XFillBmpPosOffsetYItem( m_pPositionOffY->GetValue() ) );
- if(m_pTileOffBox->IsEnabled())
+ if (m_xPositionLB->get_sensitive())
+ rAttrs->Put( XFillBmpPosItem( static_cast<RectPoint>( m_xPositionLB->get_active() ) ) );
+ if (m_xPositionOffX->get_sensitive())
+ rAttrs->Put( XFillBmpPosOffsetXItem(m_xPositionOffX->get_value(FUNIT_PERCENT)));
+ if (m_xPositionOffY->get_sensitive())
+ rAttrs->Put( XFillBmpPosOffsetYItem(m_xPositionOffY->get_value(FUNIT_PERCENT)));
+ if (m_xTileOffBox->get_sensitive())
{
- TileOffset eValue = static_cast<TileOffset>(m_pTileOffLB->GetSelectedEntryPos());
- sal_uInt16 nOffsetValue = static_cast<sal_uInt16>(m_pTileOffset->GetValue());
+ TileOffset eValue = static_cast<TileOffset>(m_xTileOffLB->get_active());
+ sal_uInt16 nOffsetValue = static_cast<sal_uInt16>(m_xTileOffset->get_value(FUNIT_PERCENT));
sal_uInt16 nRowOff = (eValue == ROW) ? nOffsetValue : 0;
sal_uInt16 nColOff = (eValue == COLUMN) ? nOffsetValue : 0;
rAttrs->Put( XFillBmpTileOffsetXItem(nRowOff) );
@@ -300,11 +278,11 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
if(!aItem.isPattern())
{
m_rXFSet.Put( aItem );
- m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
- m_pCtlBitmapPreview->Invalidate();
+ m_aCtlBitmapPreview.SetAttributes( m_aXFillAttr.GetItemSet() );
+ m_aCtlBitmapPreview.Invalidate();
}
else
- m_pCtlBitmapPreview->Disable();
+ m_xCtlBitmapPreview->set_sensitive(false);
std::unique_ptr<GraphicObject> pGraphicObject;
pGraphicObject.reset( new GraphicObject(aItem.GetGraphicObject()) );
@@ -324,34 +302,32 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
bStretched = rAttrs->Get( XATTR_FILLBMP_STRETCH ).GetValue();
if (bTiled)
- m_pBitmapStyleLB->SelectEntryPos(static_cast<sal_Int32>(TILED));
+ m_xBitmapStyleLB->set_active(static_cast<sal_Int32>(TILED));
else if (bStretched)
- m_pBitmapStyleLB->SelectEntryPos( static_cast<sal_Int32>(STRETCHED) );
+ m_xBitmapStyleLB->set_active(static_cast<sal_Int32>(STRETCHED));
else
- m_pBitmapStyleLB->SelectEntryPos( static_cast<sal_Int32>(CUSTOM) );
+ m_xBitmapStyleLB->set_active(static_cast<sal_Int32>(CUSTOM));
long nWidth = 0;
long nHeight = 0;
if(rAttrs->GetItemState(XATTR_FILLBMP_SIZELOG) != SfxItemState::DONTCARE)
{
- m_pTsbScale->EnableTriState( false );
-
- if( rAttrs->Get( XATTR_FILLBMP_SIZELOG ).GetValue() )
+ if (rAttrs->Get( XATTR_FILLBMP_SIZELOG ).GetValue())
{
- m_pTsbScale->SetState( TRISTATE_FALSE );
+ m_xTsbScale->set_state(TRISTATE_FALSE);
m_bLogicalSize = true;
}
else
{
- m_pTsbScale->SetState( TRISTATE_TRUE );
+ m_xTsbScale->set_state(TRISTATE_TRUE);
m_bLogicalSize = false;
}
- ClickScaleHdl( nullptr );
+ ClickScaleHdl(*m_xTsbScale);
}
else
- m_pTsbScale->SetState( TRISTATE_INDET );
+ m_xTsbScale->set_state(TRISTATE_INDET);
TriState eRelative = TRISTATE_FALSE;
if(rAttrs->GetItemState(XATTR_FILLBMP_SIZEX) != SfxItemState::DONTCARE)
@@ -377,51 +353,51 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
nHeight = std::abs(nHeight);
}
}
- m_pTsbScale->SetState(eRelative);
+ m_xTsbScale->set_state(eRelative);
if(rBitmapSize.Width() > 0 && rBitmapSize.Height() > 0)
{
- if(eRelative == TRISTATE_TRUE)
+ if (eRelative == TRISTATE_TRUE)
{
- m_pBitmapWidth->SetValue(nWidth);
- m_pBitmapHeight->SetValue(nHeight);
+ m_xBitmapWidth->set_value(nWidth, FUNIT_NONE);
+ m_xBitmapHeight->set_value(nHeight, FUNIT_NONE);
}
else
{
- SetMetricValue(*m_pBitmapWidth, nWidth, mePoolUnit);
- SetMetricValue(*m_pBitmapHeight, nHeight, mePoolUnit);
+ SetMetricValue(*m_xBitmapWidth, nWidth, mePoolUnit);
+ SetMetricValue(*m_xBitmapHeight, nHeight, mePoolUnit);
}
}
if( rAttrs->GetItemState( XATTR_FILLBMP_POS ) != SfxItemState::DONTCARE )
{
RectPoint eValue = rAttrs->Get( XATTR_FILLBMP_POS ).GetValue();
- m_pPositionLB->SelectEntryPos( static_cast< sal_Int32 >(eValue) );
+ m_xPositionLB->set_active( static_cast< sal_Int32 >(eValue) );
}
if( rAttrs->GetItemState( XATTR_FILLBMP_POSOFFSETX ) != SfxItemState::DONTCARE )
{
sal_Int32 nValue = rAttrs->Get( XATTR_FILLBMP_POSOFFSETX ).GetValue();
- m_pPositionOffX->SetValue( nValue );
+ m_xPositionOffX->set_value(nValue, FUNIT_PERCENT);
}
else
- m_pPositionOffX->SetText("");
+ m_xPositionOffX->set_text("");
if( rAttrs->GetItemState( XATTR_FILLBMP_POSOFFSETY ) != SfxItemState::DONTCARE )
{
sal_Int32 nValue = rAttrs->Get( XATTR_FILLBMP_POSOFFSETY ).GetValue();
- m_pPositionOffY->SetValue( nValue );
+ m_xPositionOffY->set_value(nValue, FUNIT_PERCENT);
}
else
- m_pPositionOffY->SetText("");
+ m_xPositionOffY->set_text("");
if( rAttrs->GetItemState( XATTR_FILLBMP_TILEOFFSETX ) != SfxItemState::DONTCARE)
{
sal_Int32 nValue = rAttrs->Get( XATTR_FILLBMP_TILEOFFSETX ).GetValue();
if(nValue > 0)
{
- m_pTileOffLB->SelectEntryPos(static_cast<sal_Int32>(ROW));
- m_pTileOffset->SetValue( nValue );
+ m_xTileOffLB->set_active(static_cast<sal_Int32>(ROW));
+ m_xTileOffset->set_value(nValue, FUNIT_PERCENT);
}
}
@@ -430,28 +406,25 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
sal_Int32 nValue = rAttrs->Get( XATTR_FILLBMP_TILEOFFSETY ).GetValue();
if(nValue > 0)
{
- m_pTileOffLB->SelectEntryPos(static_cast<sal_Int32>(COLUMN));
- m_pTileOffset->SetValue( nValue );
+ m_xTileOffLB->set_active(static_cast<sal_Int32>(COLUMN));
+ m_xTileOffset->set_value(nValue, FUNIT_PERCENT);
}
}
ClickBitmapHdl_Impl();
}
-
-VclPtr<SfxTabPage> SvxBitmapTabPage::Create( TabPageParent pWindow,
- const SfxItemSet* rAttrs )
+VclPtr<SfxTabPage> SvxBitmapTabPage::Create(TabPageParent pWindow, const SfxItemSet* rAttrs)
{
- return VclPtr<SvxBitmapTabPage>::Create( pWindow.pParent, *rAttrs );
+ return VclPtr<SvxBitmapTabPage>::Create(pWindow, *rAttrs);
}
-
void SvxBitmapTabPage::ClickBitmapHdl_Impl()
{
- m_pBitmapLB->Enable();
- m_pCtlBitmapPreview->Enable();
+ m_xBitmapLBWin->set_sensitive(true);
+ m_xCtlBitmapPreview->set_sensitive(true);
- ModifyBitmapHdl( m_pBitmapLB );
+ ModifyBitmapHdl(m_xBitmapLB.get());
}
void SvxBitmapTabPage::CalculateBitmapPresetSize()
@@ -478,10 +451,10 @@ void SvxBitmapTabPage::CalculateBitmapPresetSize()
}
}
-IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, ValueSet*, void)
+IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, SvtValueSet*, void)
{
std::unique_ptr<GraphicObject> pGraphicObject;
- size_t nPos = m_pBitmapLB->GetSelectItemPos();
+ size_t nPos = m_xBitmapLB->GetSelectItemPos();
if( nPos != VALUESET_ITEM_NOTFOUND )
{
@@ -503,8 +476,8 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, ValueSet*, void)
if(!pGraphicObject)
{
- sal_uInt16 nId = m_pBitmapLB->GetItemId(0);
- m_pBitmapLB->SelectItem(nId);
+ sal_uInt16 nId = m_xBitmapLB->GetItemId(0);
+ m_xBitmapLB->SelectItem(nId);
if(0 != nId)
{
@@ -522,16 +495,16 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, ValueSet*, void)
rBitmapSize.setWidth( (OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Width()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
rBitmapSize.setHeight( (OutputDevice::LogicToLogic(static_cast<sal_Int32>(aTempBitmapSize.Height()),MapUnit::MapPixel, MapUnit::Map100thMM )) / fUIScale );
CalculateBitmapPresetSize();
- ModifyBitmapStyleHdl( *m_pBitmapStyleLB );
- ModifyBitmapPositionHdl( *m_pPositionLB );
+ ModifyBitmapStyleHdl( *m_xBitmapStyleLB );
+ ModifyBitmapPositionHdl( *m_xPositionLB );
m_rXFSet.ClearItem();
m_rXFSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
m_rXFSet.Put(XFillBitmapItem(OUString(), *pGraphicObject));
- m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
- m_pCtlBitmapPreview->Invalidate();
+ m_aCtlBitmapPreview.SetAttributes( m_aXFillAttr.GetItemSet() );
+ m_aCtlBitmapPreview.Invalidate();
}
else
{
@@ -540,10 +513,10 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, ValueSet*, void)
}
-IMPL_LINK_NOARG(SvxBitmapTabPage, ClickRenameHdl, SvxPresetListBox*, void)
+IMPL_LINK_NOARG(SvxBitmapTabPage, ClickRenameHdl, PresetListBox*, void)
{
- sal_uInt16 nId = m_pBitmapLB->GetSelectedItemId();
- size_t nPos = m_pBitmapLB->GetSelectItemPos();
+ sal_uInt16 nId = m_xBitmapLB->GetSelectedItemId();
+ size_t nPos = m_xBitmapLB->GetSelectItemPos();
if( nPos != VALUESET_ITEM_NOTFOUND )
{
@@ -551,7 +524,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickRenameHdl, SvxPresetListBox*, void)
OUString aName( m_pBitmapList->GetBitmap( nPos )->GetName() );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aName, aDesc));
+ ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc));
bool bLoop = true;
while( bLoop && pDlg->Execute() == RET_OK )
@@ -565,14 +538,14 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickRenameHdl, SvxPresetListBox*, void)
bLoop = false;
m_pBitmapList->GetBitmap(nPos)->SetName(aName);
- m_pBitmapLB->SetItemText(nId, aName);
- m_pBitmapLB->SelectItem( nId );
+ m_xBitmapLB->SetItemText(nId, aName);
+ m_xBitmapLB->SelectItem( nId );
*m_pnBitmapListState |= ChangeType::MODIFIED;
}
else
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
xBox->run();
}
@@ -580,91 +553,86 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickRenameHdl, SvxPresetListBox*, void)
}
}
-IMPL_LINK_NOARG(SvxBitmapTabPage, ClickDeleteHdl, SvxPresetListBox*, void)
+IMPL_LINK_NOARG(SvxBitmapTabPage, ClickDeleteHdl, PresetListBox*, void)
{
- sal_uInt16 nId = m_pBitmapLB->GetSelectedItemId();
- size_t nPos = m_pBitmapLB->GetSelectItemPos();
+ sal_uInt16 nId = m_xBitmapLB->GetSelectedItemId();
+ size_t nPos = m_xBitmapLB->GetSelectItemPos();
if( nPos != VALUESET_ITEM_NOTFOUND )
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletebitmapdialog.ui"));
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/querydeletebitmapdialog.ui"));
std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelBitmapDialog"));
if (xQueryBox->run() == RET_YES)
{
m_pBitmapList->Remove( static_cast<sal_uInt16>(nPos) );
- m_pBitmapLB->RemoveItem( nId );
- nId = m_pBitmapLB->GetItemId(0);
- m_pBitmapLB->SelectItem( nId );
+ m_xBitmapLB->RemoveItem( nId );
+ nId = m_xBitmapLB->GetItemId(0);
+ m_xBitmapLB->SelectItem( nId );
- m_pCtlBitmapPreview->Invalidate();
- ModifyBitmapHdl( m_pBitmapLB );
+ m_aCtlBitmapPreview.Invalidate();
+ ModifyBitmapHdl(m_xBitmapLB.get());
*m_pnBitmapListState |= ChangeType::MODIFIED;
}
}
}
-IMPL_LINK_NOARG( SvxBitmapTabPage, ModifyBitmapSizeHdl, Edit&, void )
+IMPL_LINK_NOARG( SvxBitmapTabPage, ModifyBitmapSizeHdl, weld::MetricSpinButton&, void )
{
m_bLogicalSize = false;
- if( m_pTsbScale->GetState() != TRISTATE_TRUE && static_cast<BitmapStyle>(m_pBitmapStyleLB->GetSelectedEntryPos()) != TILED )
+ if (m_xTsbScale->get_state() != TRISTATE_TRUE && static_cast<BitmapStyle>(m_xBitmapStyleLB->get_active()) != TILED)
{
- sal_Int64 nWidthPercent = m_pBitmapWidth->Denormalize( m_pBitmapWidth->GetValue() );
- sal_Int64 nHeightPercent = m_pBitmapHeight->Denormalize( m_pBitmapHeight->GetValue() );
- if( nWidthPercent == 100 && nHeightPercent == 100 )
- m_pBitmapStyleLB->SelectEntryPos( static_cast<sal_Int32>(CUSTOM) );
+ sal_Int64 nWidthPercent = m_xBitmapWidth->denormalize(m_xBitmapWidth->get_value(FUNIT_NONE));
+ sal_Int64 nHeightPercent = m_xBitmapHeight->denormalize(m_xBitmapHeight->get_value(FUNIT_NONE));
+ if (nWidthPercent == 100 && nHeightPercent == 100)
+ m_xBitmapStyleLB->set_active(static_cast<sal_Int32>(CUSTOM));
}
- ModifyBitmapStyleHdl(*m_pBitmapStyleLB);
+ ModifyBitmapStyleHdl(*m_xBitmapStyleLB);
- m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
- m_pCtlBitmapPreview->Invalidate();
+ m_aCtlBitmapPreview.SetAttributes( m_aXFillAttr.GetItemSet() );
+ m_aCtlBitmapPreview.Invalidate();
}
-IMPL_LINK_NOARG( SvxBitmapTabPage, ClickScaleHdl, Button*, void )
+IMPL_LINK_NOARG( SvxBitmapTabPage, ClickScaleHdl, weld::Button&, void )
{
- if( m_pTsbScale->GetState() == TRISTATE_TRUE )
+ if (m_xTsbScale->get_state() == TRISTATE_TRUE)
{
- m_pBitmapWidth->SetDecimalDigits( 0 );
- m_pBitmapWidth->SetUnit(FUNIT_PERCENT);
- m_pBitmapWidth->SetValue( 100 );
- m_pBitmapWidth->SetMax( 100 );
- m_pBitmapWidth->SetLast( 100 );
-
- m_pBitmapHeight->SetDecimalDigits( 0 );
- m_pBitmapHeight->SetUnit(FUNIT_PERCENT);
- m_pBitmapHeight->SetValue( 100 );
- m_pBitmapHeight->SetMax( 100 );
- m_pBitmapHeight->SetLast( 100 );
+ m_xBitmapWidth->set_digits( 0 );
+ m_xBitmapWidth->set_unit(FUNIT_PERCENT);
+ m_xBitmapWidth->set_value(100, FUNIT_NONE);
+ m_xBitmapWidth->set_range(0, 100, FUNIT_NONE);
+
+ m_xBitmapHeight->set_digits( 0 );
+ m_xBitmapHeight->set_unit(FUNIT_PERCENT);
+ m_xBitmapHeight->set_value(100, FUNIT_NONE);
+ m_xBitmapHeight->set_range(0, 100, FUNIT_NONE);
}
else
{
- m_pBitmapWidth->SetDecimalDigits( 2 );
- m_pBitmapWidth->SetUnit( meFieldUnit );
- m_pBitmapWidth->SetValue( 100 );
- m_pBitmapWidth->SetMax( 999900 );
- m_pBitmapWidth->SetLast( 100000 );
-
- m_pBitmapHeight->SetDecimalDigits( 2 );
- m_pBitmapHeight->SetDecimalDigits( 2 );
- m_pBitmapHeight->SetUnit( meFieldUnit );
- m_pBitmapHeight->SetValue( 100 );
- m_pBitmapHeight->SetMax( 999900 );
- m_pBitmapHeight->SetLast( 100000 );
+ m_xBitmapWidth->set_digits( 2 );
+ m_xBitmapWidth->set_unit(meFieldUnit);
+ m_xBitmapWidth->set_value(100, FUNIT_NONE);
+ m_xBitmapWidth->set_range(0, 999900, FUNIT_NONE);
+
+ m_xBitmapHeight->set_digits( 2 );
+ m_xBitmapHeight->set_unit(meFieldUnit);
+ m_xBitmapHeight->set_value(100, FUNIT_NONE);
+ m_xBitmapHeight->set_range(0, 999900, FUNIT_NONE);
}
- ModifyBitmapStyleHdl( *m_pBitmapStyleLB );
+ ModifyBitmapStyleHdl( *m_xBitmapStyleLB );
}
-IMPL_LINK_NOARG( SvxBitmapTabPage, ModifyBitmapStyleHdl, ListBox&, void )
+IMPL_LINK_NOARG( SvxBitmapTabPage, ModifyBitmapStyleHdl, weld::ComboBoxText&, void )
{
- BitmapStyle eStylePos = static_cast<BitmapStyle>(m_pBitmapStyleLB->GetSelectedEntryPos());
+ BitmapStyle eStylePos = static_cast<BitmapStyle>(m_xBitmapStyleLB->get_active());
bool bIsStretched( eStylePos == STRETCHED );
bool bIsTiled( eStylePos == TILED );
- m_pSizeBox->Enable( !bIsStretched );
- m_pPositionBox->Enable( !bIsStretched );
- m_pPositionOffBox->Enable( bIsTiled );
- m_pTileOffBox->Enable( bIsTiled );
+ m_xSizeBox->set_sensitive( !bIsStretched );
+ m_xPositionBox->set_sensitive( !bIsStretched );
+ m_xPositionOffBox->set_sensitive( bIsTiled );
+ m_xTileOffBox->set_sensitive( bIsTiled );
m_rXFSet.Put( XFillBmpTileItem( bIsTiled ) );
m_rXFSet.Put( XFillBmpStretchItem( bIsStretched ) );
@@ -677,15 +645,15 @@ IMPL_LINK_NOARG( SvxBitmapTabPage, ModifyBitmapStyleHdl, ListBox&, void )
case CUSTOM:
case TILED:
{
- if(m_pTsbScale->IsEnabled() && m_pTsbScale->GetState() == TRISTATE_TRUE)
+ if (m_xTsbScale->get_sensitive() && m_xTsbScale->get_state() == TRISTATE_TRUE)
{
- aSetBitmapSize.setWidth( -m_pBitmapWidth->GetValue() );
- aSetBitmapSize.setHeight( -m_pBitmapWidth->GetValue() );
+ aSetBitmapSize.setWidth(-m_xBitmapWidth->get_value(FUNIT_NONE));
+ aSetBitmapSize.setHeight(-m_xBitmapWidth->get_value(FUNIT_NONE));
}
else
{
- aSetBitmapSize.setWidth( GetCoreValue( *m_pBitmapWidth, mePoolUnit ) );
- aSetBitmapSize.setHeight( GetCoreValue( *m_pBitmapHeight, mePoolUnit ) );
+ aSetBitmapSize.setWidth( GetCoreValue( *m_xBitmapWidth, mePoolUnit ) );
+ aSetBitmapSize.setHeight( GetCoreValue( *m_xBitmapHeight, mePoolUnit ) );
}
}
break;
@@ -697,52 +665,52 @@ IMPL_LINK_NOARG( SvxBitmapTabPage, ModifyBitmapStyleHdl, ListBox&, void )
m_rXFSet.Put( XFillBmpSizeYItem( aSetBitmapSize.Height() ) );
}
- m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
- m_pCtlBitmapPreview->Invalidate();
+ m_aCtlBitmapPreview.SetAttributes( m_aXFillAttr.GetItemSet() );
+ m_aCtlBitmapPreview.Invalidate();
}
-IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapPositionHdl, ListBox&, void)
+IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapPositionHdl, weld::ComboBoxText&, void)
{
- if(m_pPositionLB->IsEnabled())
- m_rXFSet.Put( XFillBmpPosItem( static_cast< RectPoint >( m_pPositionLB->GetSelectedEntryPos() ) ) );
+ if (m_xPositionLB->get_sensitive())
+ m_rXFSet.Put( XFillBmpPosItem( static_cast< RectPoint >( m_xPositionLB->get_active() ) ) );
- m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
- m_pCtlBitmapPreview->Invalidate();
+ m_aCtlBitmapPreview.SetAttributes( m_aXFillAttr.GetItemSet() );
+ m_aCtlBitmapPreview.Invalidate();
}
-IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyPositionOffsetHdl, Edit&, void)
+IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyPositionOffsetHdl, weld::MetricSpinButton&, void)
{
- if(m_pPositionOffX->IsEnabled())
- m_rXFSet.Put( XFillBmpPosOffsetXItem( m_pPositionOffX->GetValue() ) );
+ if (m_xPositionOffX->get_sensitive())
+ m_rXFSet.Put( XFillBmpPosOffsetXItem( m_xPositionOffX->get_value(FUNIT_PERCENT) ) );
- if(m_pPositionOffY->IsEnabled())
- m_rXFSet.Put( XFillBmpPosOffsetYItem( m_pPositionOffY->GetValue() ) );
+ if (m_xPositionOffY->get_sensitive())
+ m_rXFSet.Put( XFillBmpPosOffsetYItem( m_xPositionOffY->get_value(FUNIT_PERCENT) ) );
- m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
- m_pCtlBitmapPreview->Invalidate();
+ m_aCtlBitmapPreview.SetAttributes( m_aXFillAttr.GetItemSet() );
+ m_aCtlBitmapPreview.Invalidate();
}
-IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyTileOffsetHdl, Edit&, void)
+IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyTileOffsetHdl, weld::MetricSpinButton&, void)
{
sal_uInt16 nTileXOff = 0;
sal_uInt16 nTileYOff = 0;
- if(m_pTileOffLB->GetSelectedEntryPos() == static_cast<sal_Int32>(ROW))
- nTileXOff = m_pTileOffset->GetValue();
+ if(m_xTileOffLB->get_active() == static_cast<sal_Int32>(ROW))
+ nTileXOff = m_xTileOffset->get_value(FUNIT_PERCENT);
- if(m_pTileOffLB->GetSelectedEntryPos() == static_cast<sal_Int32>(COLUMN))
- nTileYOff = m_pTileOffset->GetValue();
+ if(m_xTileOffLB->get_active() == static_cast<sal_Int32>(COLUMN))
+ nTileYOff = m_xTileOffset->get_value(FUNIT_PERCENT);
m_rXFSet.Put( XFillBmpTileOffsetXItem(nTileXOff) );
m_rXFSet.Put( XFillBmpTileOffsetYItem(nTileYOff) );
- m_pCtlBitmapPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
- m_pCtlBitmapPreview->Invalidate();
+ m_aCtlBitmapPreview.SetAttributes( m_aXFillAttr.GetItemSet() );
+ m_aCtlBitmapPreview.Invalidate();
}
-IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, Button*, void)
+IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, weld::Button&, void)
{
- SvxOpenGraphicDialog aDlg("Import", GetFrameWeld());
+ SvxOpenGraphicDialog aDlg("Import", GetTabDialog()->GetFrameWeld());
aDlg.EnableLink(false);
long nCount = m_pBitmapList->Count();
@@ -762,7 +730,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, Button*, void)
OUString aName;
INetURLObject aURL( aDlg.GetPath() );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aURL.GetName().getToken(0, '.'), aDesc));
+ ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aURL.GetName().getToken(0, '.'), aDesc));
nError = ErrCode(1);
while( pDlg->Execute() == RET_OK )
@@ -780,7 +748,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, Button*, void)
break;
}
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
if (xBox->run() != RET_OK)
break;
@@ -792,20 +760,20 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, Button*, void)
{
m_pBitmapList->Insert(o3tl::make_unique<XBitmapEntry>(aGraphic, aName), nCount);
- sal_Int32 nId = m_pBitmapLB->GetItemId( nCount - 1 );
- BitmapEx aBitmap = m_pBitmapList->GetBitmapForPreview( nCount, m_pBitmapLB->GetIconSize() );
+ sal_Int32 nId = m_xBitmapLB->GetItemId( nCount - 1 );
+ BitmapEx aBitmap = m_pBitmapList->GetBitmapForPreview( nCount, m_xBitmapLB->GetIconSize() );
- m_pBitmapLB->InsertItem( nId + 1, Image(aBitmap), aName );
- m_pBitmapLB->SelectItem( nId + 1 );
+ m_xBitmapLB->InsertItem( nId + 1, Image(aBitmap), aName );
+ m_xBitmapLB->SelectItem( nId + 1 );
*m_pnBitmapListState |= ChangeType::MODIFIED;
- ModifyBitmapHdl( m_pBitmapLB );
+ ModifyBitmapHdl(m_xBitmapLB.get());
}
}
else
{
// graphic couldn't be loaded
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querynoloadedfiledialog.ui"));
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/querynoloadedfiledialog.ui"));
std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("NoLoadedFileDialog"));
xBox->run();
}
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 401c7f3d27d9..857bd6391276 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -341,7 +341,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, weld::Button&, void)
}
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aName, aDesc));
+ ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc));
sal_uInt16 nError = 1;
while (pDlg->Execute() == RET_OK)
@@ -355,7 +355,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, weld::Button&, void)
break;
}
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
if (xWarnBox->run() != RET_OK)
break;
@@ -395,7 +395,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickWorkOnHdl_Impl, weld::Button&, void)
aColorDlg.SetColor (aCurrentColor);
aColorDlg.SetMode( svtools::ColorPickerMode::Modify );
- if (aColorDlg.Execute(GetFrameWeld()) == RET_OK)
+ if (aColorDlg.Execute(GetTabDialog()->GetFrameWeld()) == RET_OK)
{
Color aPreviewColor = aColorDlg.GetColor();
aCurrentColor = aPreviewColor;
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index 8e3e9d3d579a..9e9c4342561f 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -49,87 +49,76 @@
using namespace com::sun::star;
-SvxGradientTabPage::SvxGradientTabPage
-(
- vcl::Window* pParent,
- const SfxItemSet& rInAttrs
-) :
- SfxTabPage ( pParent, "GradientPage", "cui/ui/gradientpage.ui", &rInAttrs ),
-
- m_rOutAttrs ( rInAttrs ),
- m_pnGradientListState ( nullptr ),
- m_pnColorListState ( nullptr ),
- m_aXFillAttr ( rInAttrs.GetPool() ),
- m_rXFSet ( m_aXFillAttr.GetItemSet() )
+SvxGradientTabPage::SvxGradientTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs)
+ : SfxTabPage(pParent, "cui/ui/gradientpage.ui", "GradientPage", &rInAttrs)
+ , m_rOutAttrs(rInAttrs)
+ , m_pnGradientListState(nullptr)
+ , m_pnColorListState(nullptr)
+ , m_aXFillAttr(rInAttrs.GetPool())
+ , m_rXFSet(m_aXFillAttr.GetItemSet())
+ , m_xLbGradientType(m_xBuilder->weld_combo_box_text("gradienttypelb"))
+ , m_xFtCenter(m_xBuilder->weld_label("centerft"))
+ , m_xMtrCenterX(m_xBuilder->weld_metric_spin_button("centerxmtr", FUNIT_PERCENT))
+ , m_xMtrCenterY(m_xBuilder->weld_metric_spin_button("centerymtr", FUNIT_PERCENT))
+ , m_xFtAngle(m_xBuilder->weld_label("angleft"))
+ , m_xMtrAngle(m_xBuilder->weld_metric_spin_button("anglemtr", FUNIT_DEGREE))
+ , m_xMtrBorder(m_xBuilder->weld_metric_spin_button("bordermtr", FUNIT_PERCENT))
+ , m_xSliderBorder(m_xBuilder->weld_scale("borderslider"))
+ , m_xLbColorFrom(new ColorListBox(m_xBuilder->weld_menu_button("colorfromlb"), GetFrameWeld()))
+ , m_xMtrColorFrom(m_xBuilder->weld_metric_spin_button("colorfrommtr", FUNIT_PERCENT))
+ , m_xLbColorTo(new ColorListBox(m_xBuilder->weld_menu_button("colortolb"), GetFrameWeld()))
+ , m_xMtrColorTo(m_xBuilder->weld_metric_spin_button("colortomtr", FUNIT_PERCENT))
+ , m_xGradientLB(new PresetListBox(m_xBuilder->weld_scrolled_window("gradientpresetlistwin")))
+ , m_xMtrIncrement(m_xBuilder->weld_spin_button("incrementmtr"))
+ , m_xCbIncrement(m_xBuilder->weld_check_button("autoincrement"))
+ , m_xSliderIncrement(m_xBuilder->weld_scale("incrementslider"))
+ , m_xBtnAdd(m_xBuilder->weld_button("add"))
+ , m_xBtnModify(m_xBuilder->weld_button("modify"))
+ , m_xCtlPreview(new weld::CustomWeld(*m_xBuilder, "previewctl", m_aCtlPreview))
+ , m_xGradientLBWin(new weld::CustomWeld(*m_xBuilder, "gradientpresetlist", *m_xGradientLB))
{
- get(m_pCbIncrement, "autoincrement");
- get(m_pMtrIncrement, "incrementmtr");
- get(m_pSliderIncrement,"incrementslider");
- get(m_pLbGradientType, "gradienttypelb");
- get(m_pFtCenter, "centerft");
- get(m_pMtrCenterX, "centerxmtr");
- get(m_pMtrCenterY, "centerymtr");
- get(m_pFtAngle, "angleft");
- get(m_pMtrAngle, "anglemtr");
- get(m_pMtrBorder, "bordermtr");
- get(m_pSliderBorder, "borderslider");
- get(m_pLbColorFrom, "colorfromlb");
- get(m_pMtrColorFrom, "colorfrommtr");
- get(m_pLbColorTo, "colortolb");
- get(m_pMtrColorTo, "colortomtr");
- get(m_pGradientLB, "gradientpresetlist");
- get(m_pCtlPreview, "previewctl");
Size aSize = getDrawPreviewOptimalSize(this);
- m_pGradientLB->set_width_request(aSize.Width());
- m_pGradientLB->set_height_request(aSize.Height());
- m_pCtlPreview->set_width_request(aSize.Width());
- m_pCtlPreview->set_height_request(aSize.Height());
- get(m_pBtnAdd, "add");
- get(m_pBtnModify, "modify");
+ m_xGradientLB->set_size_request(aSize.Width(), aSize.Height());
+ m_xCtlPreview->set_size_request(aSize.Width(), aSize.Height());
// this page needs ExchangeSupport
SetExchangeSupport();
// as long as NOT supported by the item
- m_pSliderIncrement->SetRange(Range(3,256));
- m_pMtrColorTo->SetValue( 100 );
- m_pMtrColorFrom->SetValue( 100 );
- m_pSliderBorder->SetRange(Range(0,100));
+ m_xMtrColorTo->set_value(100, FUNIT_PERCENT);
+ m_xMtrColorFrom->set_value(100, FUNIT_PERCENT);
// setting the output device
m_rXFSet.Put( XFillStyleItem(drawing::FillStyle_GRADIENT) );
m_rXFSet.Put( XFillGradientItem(OUString(), XGradient( COL_BLACK, COL_WHITE )) );
- m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
+ m_aCtlPreview.SetAttributes(m_aXFillAttr.GetItemSet());
// set handler
- m_pGradientLB->SetSelectHdl( LINK( this, SvxGradientTabPage, ChangeGradientHdl ) );
- m_pGradientLB->SetRenameHdl( LINK( this, SvxGradientTabPage, ClickRenameHdl_Impl ) );
- m_pGradientLB->SetDeleteHdl( LINK( this, SvxGradientTabPage, ClickDeleteHdl_Impl ) );
- m_pBtnAdd->SetClickHdl( LINK( this, SvxGradientTabPage, ClickAddHdl_Impl ) );
- m_pBtnModify->SetClickHdl(
- LINK( this, SvxGradientTabPage, ClickModifyHdl_Impl ) );
-
- Link<Edit&,void> aLink = LINK( this, SvxGradientTabPage, ModifiedEditHdl_Impl );
- Link<ListBox&,void> aLink2 = LINK( this, SvxGradientTabPage, ModifiedListBoxHdl_Impl );
- m_pLbGradientType->SetSelectHdl( aLink2 );
- m_pCbIncrement->SetToggleHdl( LINK( this, SvxGradientTabPage, ChangeAutoStepHdl_Impl ) );
- m_pMtrIncrement->SetModifyHdl( aLink );
- m_pSliderIncrement->SetSlideHdl( LINK( this, SvxGradientTabPage, ModifiedSliderHdl_Impl ) );
- m_pMtrCenterX->SetModifyHdl( aLink );
- m_pMtrCenterY->SetModifyHdl( aLink );
- m_pMtrAngle->SetModifyHdl( aLink );
- m_pMtrBorder->SetModifyHdl( aLink );
- m_pSliderBorder->SetSlideHdl( LINK( this, SvxGradientTabPage, ModifiedSliderHdl_Impl ) );
- m_pMtrColorFrom->SetModifyHdl( aLink );
- Link<SvxColorListBox&,void> aLink3 = LINK( this, SvxGradientTabPage, ModifiedColorListBoxHdl_Impl );
- m_pLbColorFrom->SetSelectHdl( aLink3 );
- m_pMtrColorTo->SetModifyHdl( aLink );
- m_pLbColorTo->SetSelectHdl( aLink3 );
+ m_xGradientLB->SetSelectHdl( LINK( this, SvxGradientTabPage, ChangeGradientHdl ) );
+ m_xGradientLB->SetRenameHdl( LINK( this, SvxGradientTabPage, ClickRenameHdl_Impl ) );
+ m_xGradientLB->SetDeleteHdl( LINK( this, SvxGradientTabPage, ClickDeleteHdl_Impl ) );
+ m_xBtnAdd->connect_clicked(LINK(this, SvxGradientTabPage, ClickAddHdl_Impl));
+ m_xBtnModify->connect_clicked(LINK(this, SvxGradientTabPage, ClickModifyHdl_Impl));
+
+ Link<weld::MetricSpinButton&,void> aLink = LINK( this, SvxGradientTabPage, ModifiedMetricHdl_Impl );
+ Link<weld::ComboBoxText&,void> aLink2 = LINK( this, SvxGradientTabPage, ModifiedListBoxHdl_Impl );
+ m_xLbGradientType->connect_changed( aLink2 );
+ m_xCbIncrement->connect_toggled(LINK(this, SvxGradientTabPage, ChangeAutoStepHdl_Impl));
+ m_xMtrIncrement->connect_value_changed(LINK(this, SvxGradientTabPage, ModifiedEditHdl_Impl));
+ m_xSliderIncrement->connect_value_changed(LINK(this, SvxGradientTabPage, ModifiedSliderHdl_Impl));
+ m_xMtrCenterX->connect_value_changed( aLink );
+ m_xMtrCenterY->connect_value_changed( aLink );
+ m_xMtrAngle->connect_value_changed( aLink );
+ m_xMtrBorder->connect_value_changed( aLink );
+ m_xSliderBorder->connect_value_changed(LINK(this, SvxGradientTabPage, ModifiedSliderHdl_Impl));
+ m_xMtrColorFrom->connect_value_changed( aLink );
+ Link<ColorListBox&,void> aLink3 = LINK( this, SvxGradientTabPage, ModifiedColorListBoxHdl_Impl );
+ m_xLbColorFrom->SetSelectHdl( aLink3 );
+ m_xMtrColorTo->connect_value_changed( aLink );
+ m_xLbColorTo->SetSelectHdl( aLink3 );
// #i76307# always paint the preview in LTR, because this is what the document does
- m_pCtlPreview->EnableRTL( false );
-
- setPreviewsToSamePlace(pParent, this);
+ m_aCtlPreview.EnableRTL(false);
}
SvxGradientTabPage::~SvxGradientTabPage()
@@ -139,31 +128,17 @@ SvxGradientTabPage::~SvxGradientTabPage()
void SvxGradientTabPage::dispose()
{
- m_pCbIncrement.clear();
- m_pMtrIncrement.clear();
- m_pSliderIncrement.clear();
- m_pLbGradientType.clear();
- m_pFtCenter.clear();
- m_pMtrCenterX.clear();
- m_pMtrCenterY.clear();
- m_pFtAngle.clear();
- m_pMtrAngle.clear();
- m_pMtrBorder.clear();
- m_pSliderBorder.clear();
- m_pLbColorFrom.clear();
- m_pMtrColorFrom.clear();
- m_pLbColorTo.clear();
- m_pMtrColorTo.clear();
- m_pGradientLB.clear();
- m_pCtlPreview.clear();
- m_pBtnAdd.clear();
- m_pBtnModify.clear();
+ m_xCtlPreview.reset();
+ m_xGradientLBWin.reset();
+ m_xGradientLB.reset();
+ m_xLbColorTo.reset();
+ m_xLbColorFrom.reset();
SfxTabPage::dispose();
}
void SvxGradientTabPage::Construct()
{
- m_pGradientLB->FillPresetListBox( *m_pGradientList );
+ m_xGradientLB->FillPresetListBox( *m_pGradientList );
}
void SvxGradientTabPage::ActivatePage( const SfxItemSet& rSet )
@@ -201,8 +176,8 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet& rSet )
sal_Int32 nPos = SearchGradientList( rSet.Get(XATTR_FILLGRADIENT).GetName() );
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- sal_uInt16 nId = m_pGradientLB->GetItemId( static_cast<size_t>( nPos ) );
- m_pGradientLB->SelectItem( nId );
+ sal_uInt16 nId = m_xGradientLB->GetItemId( static_cast<size_t>( nPos ) );
+ m_xGradientLB->SelectItem( nId );
}
// colors could have been deleted
ChangeGradientHdl_Impl();
@@ -222,31 +197,31 @@ bool SvxGradientTabPage::FillItemSet( SfxItemSet* rSet )
{
std::unique_ptr<XGradient> pXGradient;
OUString aString;
- size_t nPos = m_pGradientLB->IsNoSelection() ? VALUESET_ITEM_NOTFOUND : m_pGradientLB->GetSelectItemPos();
+ size_t nPos = m_xGradientLB->IsNoSelection() ? VALUESET_ITEM_NOTFOUND : m_xGradientLB->GetSelectItemPos();
if( nPos != VALUESET_ITEM_NOTFOUND )
{
pXGradient.reset(new XGradient( m_pGradientList->GetGradient( static_cast<sal_uInt16>(nPos) )->GetGradient() ));
- aString = m_pGradientLB->GetItemText( m_pGradientLB->GetSelectedItemId() );
+ aString = m_xGradientLB->GetItemText( m_xGradientLB->GetSelectedItemId() );
}
else
// gradient was passed (unidentified)
{
aString = "gradient";
- pXGradient.reset(new XGradient( m_pLbColorFrom->GetSelectEntryColor(),
- m_pLbColorTo->GetSelectEntryColor(),
- static_cast<css::awt::GradientStyle>(m_pLbGradientType->GetSelectedEntryPos()),
- static_cast<long>(m_pMtrAngle->GetValue() * 10), // should be changed in resource
- static_cast<sal_uInt16>(m_pMtrCenterX->GetValue()),
- static_cast<sal_uInt16>(m_pMtrCenterY->GetValue()),
- static_cast<sal_uInt16>(m_pMtrBorder->GetValue()),
- static_cast<sal_uInt16>(m_pMtrColorFrom->GetValue()),
- static_cast<sal_uInt16>(m_pMtrColorTo->GetValue()),
- static_cast<sal_uInt16>(m_pMtrIncrement->GetValue()) ));
+ pXGradient.reset(new XGradient( m_xLbColorFrom->GetSelectEntryColor(),
+ m_xLbColorTo->GetSelectEntryColor(),
+ static_cast<css::awt::GradientStyle>(m_xLbGradientType->get_active()),
+ static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10), // should be changed in resource
+ static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrBorder->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrColorFrom->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrColorTo->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrIncrement->get_value()) ));
}
sal_uInt16 nValue = 0;
- if( !m_pCbIncrement->IsChecked() )
- nValue = m_pMtrIncrement->GetValue();
+ if (!m_xCbIncrement->get_active())
+ nValue = m_xMtrIncrement->get_value();
assert( pXGradient && "XGradient could not be created" );
rSet->Put( XFillStyleItem( drawing::FillStyle_GRADIENT ) );
@@ -255,109 +230,111 @@ bool SvxGradientTabPage::FillItemSet( SfxItemSet* rSet )
return true;
}
-
void SvxGradientTabPage::Reset( const SfxItemSet* )
{
- m_pMtrIncrement->SetValue(DEFAULT_GRADIENTSTEP);
- m_pSliderIncrement->SetThumbPos(DEFAULT_GRADIENTSTEP);
+ m_xMtrIncrement->set_value(DEFAULT_GRADIENTSTEP);
+ m_xSliderIncrement->set_value(DEFAULT_GRADIENTSTEP);
ChangeGradientHdl_Impl();
// determine state of the buttons
if( m_pGradientList->Count() )
- m_pBtnModify->Enable();
+ m_xBtnModify->set_sensitive(true);
else
- m_pBtnModify->Disable();
+ m_xBtnModify->set_sensitive(false);
}
-
VclPtr<SfxTabPage> SvxGradientTabPage::Create( TabPageParent pWindow,
const SfxItemSet* rOutAttrs )
{
- return VclPtr<SvxGradientTabPage>::Create( pWindow.pParent, *rOutAttrs );
+ return VclPtr<SvxGradientTabPage>::Create(pWindow, *rOutAttrs);
}
-IMPL_LINK( SvxGradientTabPage, ModifiedListBoxHdl_Impl, ListBox&, rListBox, void )
+IMPL_LINK( SvxGradientTabPage, ModifiedListBoxHdl_Impl, weld::ComboBoxText&, rListBox, void )
{
ModifiedHdl_Impl(&rListBox);
// gradient params changed, it is no longer one of the presets
- m_pGradientLB->SetNoSelection();
+ m_xGradientLB->SetNoSelection();
}
-IMPL_LINK( SvxGradientTabPage, ModifiedColorListBoxHdl_Impl, SvxColorListBox&, rListBox, void )
+IMPL_LINK( SvxGradientTabPage, ModifiedColorListBoxHdl_Impl, ColorListBox&, rListBox, void )
{
ModifiedHdl_Impl(&rListBox);
- m_pGradientLB->SetNoSelection();
+ m_xGradientLB->SetNoSelection();
}
-IMPL_LINK( SvxGradientTabPage, ModifiedEditHdl_Impl, Edit&, rBox, void )
+IMPL_LINK( SvxGradientTabPage, ModifiedEditHdl_Impl, weld::SpinButton&, rBox, void )
{
ModifiedHdl_Impl(&rBox);
- m_pGradientLB->SetNoSelection();
+ m_xGradientLB->SetNoSelection();
}
-IMPL_LINK( SvxGradientTabPage, ModifiedSliderHdl_Impl, Slider*, rSlider, void )
+IMPL_LINK( SvxGradientTabPage, ModifiedMetricHdl_Impl, weld::MetricSpinButton&, rBox, void )
{
- ModifiedHdl_Impl(rSlider);
- m_pGradientLB->SetNoSelection();
+ ModifiedHdl_Impl(&rBox);
+ m_xGradientLB->SetNoSelection();
}
-IMPL_LINK_NOARG( SvxGradientTabPage, ChangeAutoStepHdl_Impl, CheckBox&, void )
+IMPL_LINK( SvxGradientTabPage, ModifiedSliderHdl_Impl, weld::Scale&, rSlider, void )
{
- if(m_pCbIncrement->IsChecked())
+ ModifiedHdl_Impl(&rSlider);
+ m_xGradientLB->SetNoSelection();
+}
+
+IMPL_LINK_NOARG( SvxGradientTabPage, ChangeAutoStepHdl_Impl, weld::ToggleButton&, void )
+{
+ if (m_xCbIncrement->get_active())
{
- m_pSliderIncrement->Disable();
- m_pMtrIncrement->Disable();
+ m_xSliderIncrement->set_sensitive(false);
+ m_xMtrIncrement->set_sensitive(false);
}
else
{
- m_pSliderIncrement->Enable();
- m_pMtrIncrement->Enable();
+ m_xSliderIncrement->set_sensitive(true);
+ m_xMtrIncrement->set_sensitive(true);
}
- ModifiedHdl_Impl(m_pMtrIncrement);
+ ModifiedHdl_Impl(m_xMtrIncrement.get());
}
void SvxGradientTabPage::ModifiedHdl_Impl( void const * pControl )
{
- if( pControl == m_pMtrBorder )
- m_pSliderBorder->SetThumbPos( m_pMtrBorder->GetValue() );
- if( pControl == m_pSliderBorder )
- m_pMtrBorder->SetValue( m_pSliderBorder->GetThumbPos() );
- if( pControl == m_pMtrIncrement )
- m_pSliderIncrement->SetThumbPos( m_pMtrIncrement->GetValue() );
- if(pControl == m_pSliderIncrement)
- m_pMtrIncrement->SetValue( m_pSliderIncrement->GetThumbPos() );
-
- css::awt::GradientStyle eXGS = static_cast<css::awt::GradientStyle>(m_pLbGradientType->GetSelectedEntryPos());
-
- XGradient aXGradient( m_pLbColorFrom->GetSelectEntryColor(),
- m_pLbColorTo->GetSelectEntryColor(),
+ if (pControl == m_xMtrBorder.get())
+ m_xSliderBorder->set_value(m_xMtrBorder->get_value(FUNIT_NONE));
+ if (pControl == m_xSliderBorder.get())
+ m_xMtrBorder->set_value(m_xSliderBorder->get_value(), FUNIT_NONE);
+ if (pControl == m_xMtrIncrement.get())
+ m_xSliderIncrement->set_value(m_xMtrIncrement->get_value());
+ if (pControl == m_xSliderIncrement.get())
+ m_xMtrIncrement->set_value(m_xSliderIncrement->get_value());
+
+ css::awt::GradientStyle eXGS = static_cast<css::awt::GradientStyle>(m_xLbGradientType->get_active());
+
+ XGradient aXGradient( m_xLbColorFrom->GetSelectEntryColor(),
+ m_xLbColorTo->GetSelectEntryColor(),
eXGS,
- static_cast<long>(m_pMtrAngle->GetValue() * 10), // should be changed in resource
- static_cast<sal_uInt16>(m_pMtrCenterX->GetValue()),
- static_cast<sal_uInt16>(m_pMtrCenterY->GetValue()),
- static_cast<sal_uInt16>(m_pMtrBorder->GetValue()),
- static_cast<sal_uInt16>(m_pMtrColorFrom->GetValue()),
- static_cast<sal_uInt16>(m_pMtrColorTo->GetValue()),
- static_cast<sal_uInt16>(m_pMtrIncrement->GetValue()) );
+ static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10), // should be changed in resource
+ static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrBorder->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrColorFrom->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrColorTo->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrIncrement->get_value()) );
// enable/disable controls
- if( pControl == m_pLbGradientType || pControl == this )
+ if (pControl == m_xLbGradientType.get() || pControl == this)
SetControlState_Impl( eXGS );
sal_uInt16 nValue = 0;
- if(!m_pCbIncrement->IsChecked())
- nValue = static_cast<sal_uInt16>(m_pMtrIncrement->GetValue());
+ if (!m_xCbIncrement->get_active())
+ nValue = static_cast<sal_uInt16>(m_xMtrIncrement->get_value());
m_rXFSet.Put( XGradientStepCountItem( nValue ) );
// displaying in XOutDev
m_rXFSet.Put( XFillGradientItem( OUString(), aXGradient ) );
- m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
-
- m_pCtlPreview->Invalidate();
+ m_aCtlPreview.SetAttributes(m_aXFillAttr.GetItemSet());
+ m_aCtlPreview.Invalidate();
}
-
-IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, weld::Button&, void)
{
OUString aNewName( SvxResId( RID_SVXSTR_GRADIENT ) );
OUString aDesc( CuiResId( RID_SVXSTR_DESC_GRADIENT ) );
@@ -374,7 +351,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void)
}
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aName, aDesc));
+ ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc));
sal_uInt16 nError = 1;
while (pDlg->Execute() == RET_OK)
@@ -389,7 +366,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void)
break;
}
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::MessageDialog> xWarnBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
if (xWarnBox->run() != RET_OK)
break;
@@ -398,24 +375,24 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void)
if( !nError )
{
- XGradient aXGradient( m_pLbColorFrom->GetSelectEntryColor(),
- m_pLbColorTo->GetSelectEntryColor(),
- static_cast<css::awt::GradientStyle>(m_pLbGradientType->GetSelectedEntryPos()),
- static_cast<long>(m_pMtrAngle->GetValue() * 10), // should be changed in resource
- static_cast<sal_uInt16>(m_pMtrCenterX->GetValue()),
- static_cast<sal_uInt16>(m_pMtrCenterY->GetValue()),
- static_cast<sal_uInt16>(m_pMtrBorder->GetValue()),
- static_cast<sal_uInt16>(m_pMtrColorFrom->GetValue()),
- static_cast<sal_uInt16>(m_pMtrColorTo->GetValue()),
- static_cast<sal_uInt16>(m_pMtrIncrement->GetValue()) );
+ XGradient aXGradient( m_xLbColorFrom->GetSelectEntryColor(),
+ m_xLbColorTo->GetSelectEntryColor(),
+ static_cast<css::awt::GradientStyle>(m_xLbGradientType->get_active()),
+ static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10), // should be changed in resource
+ static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrBorder->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrColorFrom->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrColorTo->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrIncrement->get_value()) );
m_pGradientList->Insert(o3tl::make_unique<XGradientEntry>(aXGradient, aName), nCount);
- sal_Int32 nId = m_pGradientLB->GetItemId(nCount - 1); //calculate the last ID
- BitmapEx aBitmap = m_pGradientList->GetBitmapForPreview( nCount, m_pGradientLB->GetIconSize() );
- m_pGradientLB->InsertItem( nId + 1, Image(aBitmap), aName );
- m_pGradientLB->SelectItem( nId + 1 );
- m_pGradientLB->Resize();
+ sal_Int32 nId = m_xGradientLB->GetItemId(nCount - 1); //calculate the last ID
+ BitmapEx aBitmap = m_pGradientList->GetBitmapForPreview( nCount, m_xGradientLB->GetIconSize() );
+ m_xGradientLB->InsertItem( nId + 1, Image(aBitmap), aName );
+ m_xGradientLB->SelectItem( nId + 1 );
+ m_xGradientLB->Resize();
*m_pnGradientListState |= ChangeType::MODIFIED;
@@ -423,60 +400,60 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, Button*, void)
}
// determine button state
- if( m_pGradientList->Count() )
- m_pBtnModify->Enable();
+ if (m_pGradientList->Count())
+ m_xBtnModify->set_sensitive(true);
}
-IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl, weld::Button&, void)
{
- sal_uInt16 nId = m_pGradientLB->GetSelectedItemId();
- size_t nPos = m_pGradientLB->GetSelectItemPos();
+ sal_uInt16 nId = m_xGradientLB->GetSelectedItemId();
+ size_t nPos = m_xGradientLB->GetSelectItemPos();
if ( nPos != VALUESET_ITEM_NOTFOUND )
{
OUString aName( m_pGradientList->GetGradient( static_cast<sal_uInt16>(nPos) )->GetName() );
- XGradient aXGradient( m_pLbColorFrom->GetSelectEntryColor(),
- m_pLbColorTo->GetSelectEntryColor(),
- static_cast<css::awt::GradientStyle>(m_pLbGradientType->GetSelectedEntryPos()),
- static_cast<long>(m_pMtrAngle->GetValue() * 10), // should be changed in resource
- static_cast<sal_uInt16>(m_pMtrCenterX->GetValue()),
- static_cast<sal_uInt16>(m_pMtrCenterY->GetValue()),
- static_cast<sal_uInt16>(m_pMtrBorder->GetValue()),
- static_cast<sal_uInt16>(m_pMtrColorFrom->GetValue()),
- static_cast<sal_uInt16>(m_pMtrColorTo->GetValue()),
- static_cast<sal_uInt16>(m_pMtrIncrement->GetValue()) );
+ XGradient aXGradient( m_xLbColorFrom->GetSelectEntryColor(),
+ m_xLbColorTo->GetSelectEntryColor(),
+ static_cast<css::awt::GradientStyle>(m_xLbGradientType->get_active()),
+ static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10), // should be changed in resource
+ static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrBorder->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrColorFrom->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrColorTo->get_value(FUNIT_NONE)),
+ static_cast<sal_uInt16>(m_xMtrIncrement->get_value()) );
m_pGradientList->Replace(o3tl::make_unique<XGradientEntry>(aXGradient, aName), nPos);
- BitmapEx aBitmap = m_pGradientList->GetBitmapForPreview( static_cast<sal_uInt16>(nPos), m_pGradientLB->GetIconSize() );
- m_pGradientLB->RemoveItem( nId );
- m_pGradientLB->InsertItem( nId, Image(aBitmap), aName, static_cast<sal_uInt16>(nPos) );
- m_pGradientLB->SelectItem( nId );
+ BitmapEx aBitmap = m_pGradientList->GetBitmapForPreview( static_cast<sal_uInt16>(nPos), m_xGradientLB->GetIconSize() );
+ m_xGradientLB->RemoveItem( nId );
+ m_xGradientLB->InsertItem( nId, Image(aBitmap), aName, static_cast<sal_uInt16>(nPos) );
+ m_xGradientLB->SelectItem( nId );
*m_pnGradientListState |= ChangeType::MODIFIED;
}
}
-IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*, void)
+IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl, PresetListBox*, void)
{
- sal_uInt16 nId = m_pGradientLB->GetSelectedItemId();
- size_t nPos = m_pGradientLB->GetSelectItemPos();
+ sal_uInt16 nId = m_xGradientLB->GetSelectedItemId();
+ size_t nPos = m_xGradientLB->GetSelectItemPos();
if( nPos != VALUESET_ITEM_NOTFOUND )
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletegradientdialog.ui"));
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/querydeletegradientdialog.ui"));
std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelGradientDialog"));
if (xQueryBox->run() == RET_YES)
{
m_pGradientList->Remove(nPos);
- m_pGradientLB->RemoveItem( nId );
- nId = m_pGradientLB->GetItemId( 0 );
- m_pGradientLB->SelectItem( nId );
- m_pGradientLB->Resize();
+ m_xGradientLB->RemoveItem( nId );
+ nId = m_xGradientLB->GetItemId( 0 );
+ m_xGradientLB->SelectItem( nId );
+ m_xGradientLB->Resize();
- m_pCtlPreview->Invalidate();
+ m_aCtlPreview.Invalidate();
ChangeGradientHdl_Impl();
@@ -485,13 +462,13 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl, SvxPresetListBox*, void
}
// determine button state
if( !m_pGradientList->Count() )
- m_pBtnModify->Disable();
+ m_xBtnModify->set_sensitive(false);
}
-IMPL_LINK_NOARG(SvxGradientTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void)
+IMPL_LINK_NOARG(SvxGradientTabPage, ClickRenameHdl_Impl, PresetListBox*, void)
{
- sal_uInt16 nId = m_pGradientLB->GetSelectedItemId();
- size_t nPos = m_pGradientLB->GetSelectItemPos();
+ sal_uInt16 nId = m_xGradientLB->GetSelectedItemId();
+ size_t nPos = m_xGradientLB->GetSelectItemPos();
if ( nPos != VALUESET_ITEM_NOTFOUND )
{
@@ -499,7 +476,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void
OUString aName( m_pGradientList->GetGradient( nPos )->GetName() );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetFrameWeld(), aName, aDesc));
+ ScopedVclPtr<AbstractSvxNameDialog> pDlg(pFact->CreateSvxNameDialog(GetTabDialog()->GetFrameWeld(), aName, aDesc));
bool bLoop = true;
while( bLoop && pDlg->Execute() == RET_OK )
@@ -513,14 +490,14 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void
bLoop = false;
m_pGradientList->GetGradient(nPos)->SetName(aName);
- m_pGradientLB->SetItemText( nId, aName );
- m_pGradientLB->SelectItem( nId );
+ m_xGradientLB->SetItemText( nId, aName );
+ m_xGradientLB->SelectItem( nId );
*m_pnGradientListState |= ChangeType::MODIFIED;
}
else
{
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetTabDialog()->GetFrameWeld(), "cui/ui/queryduplicatedialog.ui"));
std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("DuplicateNameDialog"));
xBox->run();
}
@@ -528,7 +505,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickRenameHdl_Impl, SvxPresetListBox*, void
}
}
-IMPL_LINK_NOARG(SvxGradientTabPage, ChangeGradientHdl, ValueSet*, void)
+IMPL_LINK_NOARG(SvxGradientTabPage, ChangeGradientHdl, SvtValueSet*, void)
{
ChangeGradientHdl_Impl();
}
@@ -536,7 +513,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ChangeGradientHdl, ValueSet*, void)
void SvxGradientTabPage::ChangeGradientHdl_Impl()
{
std::unique_ptr<XGradient> pGradient;
- size_t nPos = m_pGradientLB->GetSelectItemPos();
+ size_t nPos = m_xGradientLB->GetSelectItemPos();
if( nPos != VALUESET_ITEM_NOTFOUND )
pGradient.reset(new XGradient( m_pGradientList->GetGradient( static_cast<sal_uInt16>( nPos ) )->GetGradient() ));
@@ -553,8 +530,8 @@ void SvxGradientTabPage::ChangeGradientHdl_Impl()
}
if( !pGradient )
{
- sal_uInt16 nPosition = m_pGradientLB->GetItemId(0);
- m_pGradientLB->SelectItem( nPosition );
+ sal_uInt16 nPosition = m_xGradientLB->GetItemId(0);
+ m_xGradientLB->SelectItem( nPosition );
if( nPosition != 0 )
pGradient.reset(new XGradient( m_pGradientList->GetGradient( 0 )->GetGradient() ));
}
@@ -566,35 +543,35 @@ void SvxGradientTabPage::ChangeGradientHdl_Impl()
sal_uInt16 nValue = pGradient->GetSteps();
if( nValue == 0 )
{
- m_pCbIncrement->SetState(TRISTATE_TRUE);
- m_pMtrIncrement->Disable();
- m_pSliderIncrement->Disable();
+ m_xCbIncrement->set_state(TRISTATE_TRUE);
+ m_xMtrIncrement->set_sensitive(false);
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list