diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-11-21 21:21:35 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-11-22 21:59:48 +0100 |
commit | 4b7e2b8a64eca337ea06f7d11fc9d2f66a9d555e (patch) | |
tree | bda0e413036b5ef3431a81d734a4b5746dcf032d /sw/source/ui/frmdlg | |
parent | b6aa70dc67983eac812e6f4a67b2b4f08de79fbb (diff) |
weld SwFramePage
Change-Id: I12f868611860867df26bd29474aa19189c2b9a96
Reviewed-on: https://gerrit.libreoffice.org/63818
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/ui/frmdlg')
-rw-r--r-- | sw/source/ui/frmdlg/column.cxx | 24 | ||||
-rw-r--r-- | sw/source/ui/frmdlg/frmpage.cxx | 1033 |
2 files changed, 485 insertions, 572 deletions
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 8afb3632617f..b65724370016 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -558,8 +558,8 @@ void SwColumnPage::Reset(const SfxItemSet *rSet) m_xDistEd1->SetMetric(aMetric); m_xDistEd2->SetMetric(aMetric); //default spacing between cols = 0.5cm - m_xDistEd1->SetPrcntValue(50, FieldUnit::CM); - m_xDistEd2->SetPrcntValue(50, FieldUnit::CM); + m_xDistEd1->set_value(50, FieldUnit::CM); + m_xDistEd2->set_value(50, FieldUnit::CM); m_xColMgr.reset(new SwColMgr(*rSet)); m_nCols = m_xColMgr->GetCount() ; @@ -963,7 +963,7 @@ IMPL_LINK(SwColumnPage, GapModify, weld::MetricSpinButton&, rMetricField, void) if(nActValue > nMaxGap) { nActValue = nMaxGap; - m_xDistEd1->SetPrcntValue(m_xDistEd1->NormalizePercent(nMaxGap), FieldUnit::TWIP); + m_xDistEd1->set_value(m_xDistEd1->NormalizePercent(nMaxGap), FieldUnit::TWIP); } m_xColMgr->SetGutterWidth(static_cast<sal_uInt16>(nActValue)); for(sal_uInt16 i = 0; i < m_nCols; i++) @@ -1122,29 +1122,29 @@ void SwColumnPage::Update(const weld::MetricSpinButton* pInteractiveField) //fdo#87612 if we're interacting with this widget and the value will be the same //then leave it alone (i.e. don't change equivalent values of e.g. .8 -> 0.8) if (nNewValue != nCurrentValue || pInteractiveField != m_xEd1->get()) - m_xEd1->SetPrcntValue(nNewValue, FieldUnit::TWIP); + m_xEd1->set_value(nNewValue, FieldUnit::TWIP); nCurrentValue = m_xDistEd1->NormalizePercent(m_xDistEd1->DenormalizePercent(m_xDistEd1->get_value(FieldUnit::TWIP))); nNewValue = m_xDistEd1->NormalizePercent(m_nColDist[m_nFirstVis]); if (nNewValue != nCurrentValue || pInteractiveField != m_xDistEd1->get()) - m_xDistEd1->SetPrcntValue(nNewValue, FieldUnit::TWIP); + m_xDistEd1->set_value(nNewValue, FieldUnit::TWIP); nCurrentValue = m_xEd2->NormalizePercent(m_xEd2->DenormalizePercent(m_xEd2->get_value(FieldUnit::TWIP))); nNewValue = m_xEd2->NormalizePercent(m_nColWidth[m_nFirstVis+1]); if (nNewValue != nCurrentValue || pInteractiveField != m_xEd2->get()) - m_xEd2->SetPrcntValue(nNewValue, FieldUnit::TWIP); + m_xEd2->set_value(nNewValue, FieldUnit::TWIP); if(m_nCols >= 3) { nCurrentValue = m_xDistEd2->NormalizePercent(m_xDistEd2->DenormalizePercent(m_xDistEd2->get_value(FieldUnit::TWIP))); nNewValue = m_xDistEd2->NormalizePercent(m_nColDist[m_nFirstVis+1]); if (nNewValue != nCurrentValue || pInteractiveField != m_xDistEd2->get()) - m_xDistEd2->SetPrcntValue(nNewValue, FieldUnit::TWIP); + m_xDistEd2->set_value(nNewValue, FieldUnit::TWIP); nCurrentValue = m_xEd3->NormalizePercent(m_xEd3->DenormalizePercent(m_xEd3->get_value(FieldUnit::TWIP))); nNewValue = m_xEd3->NormalizePercent(m_nColWidth[m_nFirstVis+2]); if (nNewValue != nCurrentValue || pInteractiveField != m_xEd3->get()) - m_xEd3->SetPrcntValue(nNewValue, FieldUnit::TWIP); + m_xEd3->set_value(nNewValue, FieldUnit::TWIP); } else { @@ -1280,7 +1280,7 @@ IMPL_LINK(SwColumnPage, SetDefaultsHdl, SvtValueSet *, pVS, void) { m_xCLNrEdt->set_value(nItem); m_xAutoWidthBox->set_active(true); - m_xDistEd1->SetPrcntValue(50, FieldUnit::CM); + m_xDistEd1->set_value(50, FieldUnit::CM); ColModify(nullptr); } else @@ -1288,18 +1288,18 @@ IMPL_LINK(SwColumnPage, SetDefaultsHdl, SvtValueSet *, pVS, void) m_bLockUpdate = true; m_xCLNrEdt->set_value(2); m_xAutoWidthBox->set_active(false); - m_xDistEd1->SetPrcntValue(50, FieldUnit::CM); + m_xDistEd1->set_value(50, FieldUnit::CM); ColModify(nullptr); // now set the width ratio to 2 : 1 or 1 : 2 respectively const long nSmall = static_cast< long >(m_xColMgr->GetActualSize() / 3); if(nItem == 4) { - m_xEd2->SetPrcntValue(m_xEd2->NormalizePercent(nSmall), FieldUnit::TWIP); + m_xEd2->set_value(m_xEd2->NormalizePercent(nSmall), FieldUnit::TWIP); m_pModifiedField = m_xEd2.get(); } else { - m_xEd1->SetPrcntValue(m_xEd1->NormalizePercent(nSmall), FieldUnit::TWIP); + m_xEd1->set_value(m_xEd1->NormalizePercent(nSmall), FieldUnit::TWIP); m_pModifiedField = m_xEd1.get(); } m_bLockUpdate = false; diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index e0658c14ade9..bf1320c2a466 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -595,129 +595,113 @@ static LB lcl_GetLBRelationsForStrID( const FrameMap* _pMap, // standard frame TabPage namespace { - void HandleAutoCB( bool _bChecked, FixedText& _rFT_man, FixedText& _rFT_auto, MetricField& _rPF_Edit) - { - _rFT_man.Show( !_bChecked ); - _rFT_auto.Show( _bChecked ); - OUString accName = _bChecked ? _rFT_auto.GetText() : _rFT_man.GetText(); - _rPF_Edit.SetAccessibleName(accName); - } -} - -SwFramePage::SwFramePage(vcl::Window *pParent, const SfxItemSet &rSet) - : SfxTabPage(pParent, "FrameTypePage", - "modules/swriter/ui/frmtypepage.ui", &rSet) - , - m_bAtHorzPosModified( false ), - m_bAtVertPosModified( false ), - m_bFormat(false), - m_bNew(true), - m_bNoModifyHdl(true), - m_bIsVerticalFrame(false), - m_bIsVerticalL2R(false), - m_bIsInRightToLeft(false), - m_bHtmlMode(false), - m_nHtmlMode(0), - m_nUpperBorder(0), - m_nLowerBorder(0), - m_fWidthHeightRatio(1.0), - mpToCharContentPos( nullptr ), - - m_nOldH(text::HoriOrientation::CENTER), - m_nOldHRel(text::RelOrientation::FRAME), - m_nOldV(text::VertOrientation::TOP), - m_nOldVRel(text::RelOrientation::PRINT_AREA), - m_pVMap( nullptr ), - m_pHMap( nullptr ), - m_bAllowVertPositioning( true ), - m_bIsMathOLE( false ), - m_bIsMathBaselineAlignment( true ) -{ - get(m_pWidthFT, "widthft"); - get(m_pWidthAutoFT, "autowidthft"); - m_aWidthED.set(get<MetricField>("width")); - get(m_pRelWidthCB, "relwidth"); - get(m_pRelWidthRelationLB, "relwidthrelation"); - get(m_pAutoWidthCB, "autowidth"); - - get(m_pHeightFT, "heightft"); - get(m_pHeightAutoFT, "autoheightft"); - m_aHeightED.set(get<MetricField>("height")); - get(m_pRelHeightCB, "relheight"); - get(m_pRelHeightRelationLB, "relheightrelation"); - get(m_pAutoHeightCB, "autoheight"); - - get(m_pFixedRatioCB, "ratio"); - get(m_pRealSizeBT, "origsize"); - - get(m_pAnchorFrame, "anchorframe"); - get(m_pAnchorAtPageRB, "topage"); - get(m_pAnchorAtParaRB, "topara"); - get(m_pAnchorAtCharRB, "tochar"); - get(m_pAnchorAsCharRB, "aschar"); - get(m_pAnchorAtFrameRB, "toframe"); - - get(m_pHorizontalFT, "horiposft"); - get(m_pHorizontalDLB, "horipos"); - get(m_pAtHorzPosFT, "horibyft"); - get(m_pAtHorzPosED, "byhori"); - get(m_pHoriRelationFT, "horitoft"); - get(m_pHoriRelationLB, "horianchor"); - - get(m_pMirrorPagesCB, "mirror"); - - get(m_pVerticalFT, "vertposft"); - get(m_pVerticalDLB, "vertpos"); - get(m_pAtVertPosFT, "vertbyft"); - get(m_pAtVertPosED, "byvert"); - get(m_pVertRelationFT, "verttoft"); - get(m_pVertRelationLB, "vertanchor"); - - get(m_pFollowTextFlowCB, "followtextflow"); - get(m_pExampleWN, "preview"); - - m_pAtHorzPosED->set_width_request(m_pAtHorzPosED->GetOptimalSize().Width()); - m_pAtHorzPosED->set_width_request(m_pAtVertPosED->GetOptimalSize().Width()); + void HandleAutoCB(bool _bChecked, weld::Label& _rFT_man, weld::Label& _rFT_auto, weld::MetricSpinButton& _rPF_Edit) + { + _rFT_man.show( !_bChecked ); + _rFT_auto.show( _bChecked ); + OUString accName = _bChecked ? _rFT_auto.get_label() : _rFT_man.get_label(); + _rPF_Edit.set_accessible_name(accName); + } +} + +SwFramePage::SwFramePage(TabPageParent pParent, const SfxItemSet &rSet) + : SfxTabPage(pParent, "modules/swriter/ui/frmtypepage.ui", "FrameTypePage", &rSet) + , m_bAtHorzPosModified(false) + , m_bAtVertPosModified(false) + , m_bFormat(false) + , m_bNew(true) + , m_bNoModifyHdl(true) + , m_bIsVerticalFrame(false) + , m_bIsVerticalL2R(false) + , m_bIsInRightToLeft(false) + , m_bHtmlMode(false) + , m_nHtmlMode(0) + , m_nUpperBorder(0) + , m_nLowerBorder(0) + , m_fWidthHeightRatio(1.0) + , mpToCharContentPos(nullptr) + , m_nOldH(text::HoriOrientation::CENTER) + , m_nOldHRel(text::RelOrientation::FRAME) + , m_nOldV(text::VertOrientation::TOP) + , m_nOldVRel(text::RelOrientation::PRINT_AREA) + , m_pVMap(nullptr) + , m_pHMap(nullptr) + , m_bAllowVertPositioning( true ) + , m_bIsMathOLE(false) + , m_bIsMathBaselineAlignment(true) + , m_xWidthFT(m_xBuilder->weld_label("widthft")) + , m_xWidthAutoFT(m_xBuilder->weld_label("autowidthft")) + , m_xRelWidthCB(m_xBuilder->weld_check_button("relwidth")) + , m_xRelWidthRelationLB(m_xBuilder->weld_combo_box("relwidthrelation")) + , m_xAutoWidthCB(m_xBuilder->weld_check_button("autowidth")) + , m_xHeightFT(m_xBuilder->weld_label("heightft")) + , m_xHeightAutoFT(m_xBuilder->weld_label("autoheightft")) + , m_xRelHeightCB(m_xBuilder->weld_check_button("relheight")) + , m_xRelHeightRelationLB(m_xBuilder->weld_combo_box("relheightrelation")) + , m_xAutoHeightCB(m_xBuilder->weld_check_button("autoheight")) + , m_xFixedRatioCB(m_xBuilder->weld_check_button("ratio")) + , m_xRealSizeBT(m_xBuilder->weld_button("origsize")) + , m_xAnchorFrame(m_xBuilder->weld_widget("anchorframe")) + , m_xAnchorAtPageRB(m_xBuilder->weld_radio_button("topage")) + , m_xAnchorAtParaRB(m_xBuilder->weld_radio_button("topara")) + , m_xAnchorAtCharRB(m_xBuilder->weld_radio_button("tochar")) + , m_xAnchorAsCharRB(m_xBuilder->weld_radio_button("aschar")) + , m_xAnchorAtFrameRB(m_xBuilder->weld_radio_button("toframe")) + , m_xHorizontalFT(m_xBuilder->weld_label("horiposft")) + , m_xHorizontalDLB(m_xBuilder->weld_combo_box("horipos")) + , m_xAtHorzPosFT(m_xBuilder->weld_label("horibyft")) + , m_xAtHorzPosED(m_xBuilder->weld_metric_spin_button("byhori", FieldUnit::CM)) + , m_xHoriRelationFT(m_xBuilder->weld_label("horitoft")) + , m_xHoriRelationLB(m_xBuilder->weld_combo_box("horianchor")) + , m_xMirrorPagesCB(m_xBuilder->weld_check_button("mirror")) + , m_xVerticalFT(m_xBuilder->weld_label("vertposft")) + , m_xVerticalDLB(m_xBuilder->weld_combo_box("vertpos")) + , m_xAtVertPosFT(m_xBuilder->weld_label("vertbyft")) + , m_xAtVertPosED(m_xBuilder->weld_metric_spin_button("byvert", FieldUnit::CM)) + , m_xVertRelationFT(m_xBuilder->weld_label("verttoft")) + , m_xVertRelationLB(m_xBuilder->weld_combo_box("vertanchor")) + , m_xFollowTextFlowCB(m_xBuilder->weld_check_button("followtextflow")) + , m_xExampleWN(new weld::CustomWeld(*m_xBuilder, "preview", m_aExampleWN)) + , m_xWidthED(new SwPercentField(m_xBuilder->weld_metric_spin_button("width", FieldUnit::CM))) + , m_xHeightED(new SwPercentField(m_xBuilder->weld_metric_spin_button("height", FieldUnit::CM))) +{ + const auto nWidthRequest = m_xAtHorzPosED->get_preferred_size().Width(); + m_xAtHorzPosED->set_size_request(nWidthRequest, -1); + m_xAtVertPosED->set_size_request(nWidthRequest, -1); setOptimalFrameWidth(); setOptimalRelWidth(); SetExchangeSupport(); - Link<Control&,void> aLk3 = LINK(this, SwFramePage, RangeModifyLoseFocusHdl); - m_aWidthED.SetLoseFocusHdl( aLk3 ); - m_aHeightED.SetLoseFocusHdl( aLk3 ); - m_pAtHorzPosED->SetLoseFocusHdl( aLk3 ); - m_pAtVertPosED->SetLoseFocusHdl( aLk3 ); - m_pFollowTextFlowCB->SetClickHdl( LINK(this, SwFramePage, RangeModifyClickHdl) ); - - Link<Edit&,void> aLk = LINK(this, SwFramePage, ModifyHdl); - m_aWidthED.SetModifyHdl( aLk ); - m_aHeightED.SetModifyHdl( aLk ); - m_pAtHorzPosED->SetModifyHdl( aLk ); - m_pAtVertPosED->SetModifyHdl( aLk ); + Link<weld::MetricSpinButton&,void> aLk3 = LINK(this, SwFramePage, ModifyHdl); + m_xWidthED->connect_value_changed( aLk3 ); + m_xHeightED->connect_value_changed( aLk3 ); + m_xAtHorzPosED->connect_value_changed( aLk3 ); + m_xAtVertPosED->connect_value_changed( aLk3 ); + m_xFollowTextFlowCB->connect_toggled(LINK(this, SwFramePage, RangeModifyClickHdl)); - Link<Button*,void> aLk2 = LINK(this, SwFramePage, AnchorTypeHdl); - m_pAnchorAtPageRB->SetClickHdl( aLk2 ); - m_pAnchorAtParaRB->SetClickHdl( aLk2 ); - m_pAnchorAtCharRB->SetClickHdl( aLk2 ); - m_pAnchorAsCharRB->SetClickHdl( aLk2 ); - m_pAnchorAtFrameRB->SetClickHdl( aLk2 ); + Link<weld::ToggleButton&,void> aLk2 = LINK(this, SwFramePage, AnchorTypeHdl); + m_xAnchorAtPageRB->connect_toggled( aLk2 ); + m_xAnchorAtParaRB->connect_toggled( aLk2 ); + m_xAnchorAtCharRB->connect_toggled( aLk2 ); + m_xAnchorAsCharRB->connect_toggled( aLk2 ); + m_xAnchorAtFrameRB->connect_toggled( aLk2 ); - m_pHorizontalDLB->SetSelectHdl(LINK(this, SwFramePage, PosHdl)); - m_pVerticalDLB-> SetSelectHdl(LINK(this, SwFramePage, PosHdl)); + m_xHorizontalDLB->connect_changed(LINK(this, SwFramePage, PosHdl)); + m_xVerticalDLB->connect_changed(LINK(this, SwFramePage, PosHdl)); - m_pHoriRelationLB->SetSelectHdl(LINK(this, SwFramePage, RelHdl)); - m_pVertRelationLB->SetSelectHdl(LINK(this, SwFramePage, RelHdl)); + m_xHoriRelationLB->connect_changed(LINK(this, SwFramePage, RelHdl)); + m_xVertRelationLB->connect_changed(LINK(this, SwFramePage, RelHdl)); - m_pMirrorPagesCB->SetClickHdl(LINK(this, SwFramePage, MirrorHdl)); + m_xMirrorPagesCB->connect_toggled(LINK(this, SwFramePage, MirrorHdl)); aLk2 = LINK(this, SwFramePage, RelSizeClickHdl); - m_pRelWidthCB->SetClickHdl( aLk2 ); - m_pRelHeightCB->SetClickHdl( aLk2 ); + m_xRelWidthCB->connect_toggled(aLk2); + m_xRelHeightCB->connect_toggled(aLk2); - m_pAutoWidthCB->SetClickHdl( LINK( this, SwFramePage, AutoWidthClickHdl ) ); - m_pAutoHeightCB->SetClickHdl( LINK( this, SwFramePage, AutoHeightClickHdl ) ); + m_xAutoWidthCB->connect_toggled(LINK(this, SwFramePage, AutoWidthClickHdl)); + m_xAutoHeightCB->connect_toggled(LINK(this, SwFramePage, AutoHeightClickHdl)); } SwFramePage::~SwFramePage() @@ -725,44 +709,6 @@ SwFramePage::~SwFramePage() disposeOnce(); } -void SwFramePage::dispose() -{ - m_pWidthFT.clear(); - m_pWidthAutoFT.clear(); - m_pRelWidthCB.clear(); - m_pRelWidthRelationLB.clear(); - m_pAutoWidthCB.clear(); - m_pHeightFT.clear(); - m_pHeightAutoFT.clear(); - m_pRelHeightCB.clear(); - m_pRelHeightRelationLB.clear(); - m_pAutoHeightCB.clear(); - m_pFixedRatioCB.clear(); - m_pRealSizeBT.clear(); - m_pAnchorFrame.clear(); - m_pAnchorAtPageRB.clear(); - m_pAnchorAtParaRB.clear(); - m_pAnchorAtCharRB.clear(); - m_pAnchorAsCharRB.clear(); - m_pAnchorAtFrameRB.clear(); - m_pHorizontalFT.clear(); - m_pHorizontalDLB.clear(); - m_pAtHorzPosFT.clear(); - m_pAtHorzPosED.clear(); - m_pHoriRelationFT.clear(); - m_pHoriRelationLB.clear(); - m_pMirrorPagesCB.clear(); - m_pVerticalFT.clear(); - m_pVerticalDLB.clear(); - m_pAtVertPosFT.clear(); - m_pAtVertPosED.clear(); - m_pVertRelationFT.clear(); - m_pVertRelationLB.clear(); - m_pFollowTextFlowCB.clear(); - m_pExampleWN.clear(); - SfxTabPage::dispose(); -} - namespace { struct FrameMaps @@ -813,13 +759,13 @@ void SwFramePage::setOptimalFrameWidth() for (const auto& rFrame : aFrames) { - m_pHorizontalDLB->InsertEntry(SvxSwFramePosString::GetString(rFrame)); + m_xHorizontalDLB->append_text(SvxSwFramePosString::GetString(rFrame)); } - Size aBiggest(m_pHorizontalDLB->GetOptimalSize()); - m_pHorizontalDLB->set_width_request(aBiggest.Width()); - m_pVerticalDLB->set_width_request(aBiggest.Width()); - m_pHorizontalDLB->Clear(); + Size aBiggest(m_xHorizontalDLB->get_preferred_size()); + m_xHorizontalDLB->set_size_request(aBiggest.Width(), -1); + m_xVerticalDLB->set_size_request(aBiggest.Width(), -1); + m_xHorizontalDLB->clear(); } namespace @@ -853,36 +799,36 @@ void SwFramePage::setOptimalRelWidth() for (const auto& rRel : aRels) { - m_pHoriRelationLB->InsertEntry(SvxSwFramePosString::GetString(rRel)); + m_xHoriRelationLB->append_text(SvxSwFramePosString::GetString(rRel)); } - Size aBiggest(m_pHoriRelationLB->GetOptimalSize()); - m_pHoriRelationLB->set_width_request(aBiggest.Width()); - m_pVertRelationLB->set_width_request(aBiggest.Width()); - m_pRelWidthRelationLB->set_width_request(aBiggest.Width()); - m_pRelHeightRelationLB->set_width_request(aBiggest.Width()); - m_pHoriRelationLB->Clear(); + Size aBiggest(m_xHoriRelationLB->get_preferred_size()); + m_xHoriRelationLB->set_size_request(aBiggest.Width(), -1); + m_xVertRelationLB->set_size_request(aBiggest.Width(), -1); + m_xRelWidthRelationLB->set_size_request(aBiggest.Width(), -1); + m_xRelHeightRelationLB->set_size_request(aBiggest.Width(), -1); + m_xHoriRelationLB->clear(); } VclPtr<SfxTabPage> SwFramePage::Create(TabPageParent pParent, const SfxItemSet *rSet) { - return VclPtr<SwFramePage>::Create( pParent.pParent, *rSet ); + return VclPtr<SwFramePage>::Create(pParent, *rSet); } void SwFramePage::EnableGraficMode() { // i#39692 - mustn't be called more than once - if(!m_pRealSizeBT->IsVisible()) + if (!m_xRealSizeBT->get_visible()) { - m_pWidthFT->Show(); - m_pWidthAutoFT->Hide(); - m_pAutoHeightCB->Hide(); + m_xWidthFT->show(); + m_xWidthAutoFT->hide(); + m_xAutoHeightCB->hide(); - m_pHeightFT->Show(); - m_pHeightAutoFT->Hide(); - m_pAutoWidthCB->Hide(); + m_xHeightFT->show(); + m_xHeightAutoFT->hide(); + m_xAutoWidthCB->hide(); - m_pRealSizeBT->Show(); + m_xRealSizeBT->show(); } } @@ -900,10 +846,10 @@ void SwFramePage::Reset( const SfxItemSet *rSet ) m_bHtmlMode = (m_nHtmlMode & HTMLMODE_ON) != 0; FieldUnit aMetric = ::GetDfltMetric(m_bHtmlMode); - m_aWidthED.SetMetric(aMetric); - m_aHeightED.SetMetric(aMetric); - SetMetric( *m_pAtHorzPosED, aMetric ); - SetMetric( *m_pAtVertPosED, aMetric ); + m_xWidthED->SetMetric(aMetric); + m_xHeightED->SetMetric(aMetric); + ::SetFieldUnit(*m_xAtHorzPosED, aMetric); + ::SetFieldUnit(*m_xAtVertPosED, aMetric); const SfxPoolItem* pItem = nullptr; const SwFormatAnchor& rAnchor = rSet->Get(RES_ANCHOR); @@ -918,18 +864,18 @@ void SwFramePage::Reset( const SfxItemSet *rSet ) if (m_bFormat) { // at formats no anchor editing - m_pAnchorFrame->Enable(false); - m_pFixedRatioCB->Enable(false); + m_xAnchorFrame->set_sensitive(false); + m_xFixedRatioCB->set_sensitive(false); } else { if (rAnchor.GetAnchorId() != RndStdIds::FLY_AT_FLY && !pSh->IsFlyInFly()) - m_pAnchorAtFrameRB->Hide(); + m_xAnchorAtFrameRB->hide(); if ( pSh->IsFrameVertical( true, m_bIsInRightToLeft, m_bIsVerticalL2R ) ) { - OUString sHLabel = m_pHorizontalFT->GetText(); - m_pHorizontalFT->SetText(m_pVerticalFT->GetText()); - m_pVerticalFT->SetText(sHLabel); + OUString sHLabel = m_xHorizontalFT->get_label(); + m_xHorizontalFT->set_label(m_xVerticalFT->get_label()); + m_xVerticalFT->set_label(sHLabel); m_bIsVerticalFrame = true; } } @@ -945,12 +891,12 @@ void SwFramePage::Reset( const SfxItemSet *rSet ) if ( !m_bNew ) { - m_pRealSizeBT->SetClickHdl(LINK(this, SwFramePage, RealSizeHdl)); + m_xRealSizeBT->connect_clicked(LINK(this, SwFramePage, RealSizeHdl)); EnableGraficMode(); } - if ( m_sDlgType == "PictureDialog" ) - m_pFixedRatioCB->Check( false ); + if (m_sDlgType == "PictureDialog") + m_xFixedRatioCB->set_active(false); else { if ( m_bNew ) @@ -964,48 +910,46 @@ void SwFramePage::Reset( const SfxItemSet *rSet ) m_aGrfSize = rSet->Get(RES_FRM_SIZE).GetSize(); } - // entering procent value made possible - m_aWidthED.SetBaseValue( m_aWidthED.Normalize(m_aGrfSize.Width()), FieldUnit::TWIP ); - m_aHeightED.SetBaseValue( m_aHeightED.Normalize(m_aGrfSize.Height()), FieldUnit::TWIP ); - //the available space is not yet known so the RefValue has to be calculated from size and relative size values - //this is needed only if relative values are already set + // entering percent value made possible + // the available space is not yet known so the RefValue has to be calculated from size and relative size values + // this is needed only if relative values are already set const SwFormatFrameSize& rFrameSize = rSet->Get(RES_FRM_SIZE); - m_pRelWidthRelationLB->InsertEntry(SvxSwFramePosString::GetString(SwFPos::FRAME)); - m_pRelWidthRelationLB->InsertEntry(SvxSwFramePosString::GetString(SwFPos::REL_PG_FRAME)); + m_xRelWidthRelationLB->append_text(SvxSwFramePosString::GetString(SwFPos::FRAME)); + m_xRelWidthRelationLB->append_text(SvxSwFramePosString::GetString(SwFPos::REL_PG_FRAME)); if (rFrameSize.GetWidthPercent() != SwFormatFrameSize::SYNCED && rFrameSize.GetWidthPercent() != 0) { - //calculate the reference value from the with and relative width values + //calculate the reference value from the width and relative width values sal_Int32 nSpace = rFrameSize.GetWidth() * 100 / rFrameSize.GetWidthPercent(); - m_aWidthED.SetRefValue( nSpace ); + m_xWidthED->SetRefValue( nSpace ); - m_pRelWidthRelationLB->Enable(); + m_xRelWidthRelationLB->set_sensitive(true); } else - m_pRelWidthRelationLB->Disable(); + m_xRelWidthRelationLB->set_sensitive(false); - m_pRelHeightRelationLB->InsertEntry(SvxSwFramePosString::GetString(SwFPos::FRAME)); - m_pRelHeightRelationLB->InsertEntry(SvxSwFramePosString::GetString(SwFPos::REL_PG_FRAME)); + m_xRelHeightRelationLB->append_text(SvxSwFramePosString::GetString(SwFPos::FRAME)); + m_xRelHeightRelationLB->append_text(SvxSwFramePosString::GetString(SwFPos::REL_PG_FRAME)); if (rFrameSize.GetHeightPercent() != SwFormatFrameSize::SYNCED && rFrameSize.GetHeightPercent() != 0) { //calculate the reference value from the with and relative width values sal_Int32 nSpace = rFrameSize.GetHeight() * 100 / rFrameSize.GetHeightPercent(); - m_aHeightED.SetRefValue( nSpace ); + m_xHeightED->SetRefValue( nSpace ); - m_pRelHeightRelationLB->Enable(); + m_xRelHeightRelationLB->set_sensitive(true); } else - m_pRelHeightRelationLB->Disable(); + m_xRelHeightRelationLB->set_sensitive(false); // general initialisation part switch(rAnchor.GetAnchorId()) { - case RndStdIds::FLY_AT_PAGE: m_pAnchorAtPageRB->Check(); break; - case RndStdIds::FLY_AT_PARA: m_pAnchorAtParaRB->Check(); break; - case RndStdIds::FLY_AT_CHAR: m_pAnchorAtCharRB->Check(); break; - case RndStdIds::FLY_AS_CHAR: m_pAnchorAsCharRB->Check(); break; - case RndStdIds::FLY_AT_FLY: m_pAnchorAtFrameRB->Check();break; + case RndStdIds::FLY_AT_PAGE: m_xAnchorAtPageRB->set_active(true); break; + case RndStdIds::FLY_AT_PARA: m_xAnchorAtParaRB->set_active(true); break; + case RndStdIds::FLY_AT_CHAR: m_xAnchorAtCharRB->set_active(true); break; + case RndStdIds::FLY_AS_CHAR: m_xAnchorAsCharRB->set_active(true); break; + case RndStdIds::FLY_AT_FLY: m_xAnchorAtFrameRB->set_active(true);break; default:; //prevent warning } @@ -1017,50 +961,53 @@ void SwFramePage::Reset( const SfxItemSet *rSet ) { const bool bFollowTextFlow = rSet->Get(RES_FOLLOW_TEXT_FLOW).GetValue(); - m_pFollowTextFlowCB->Check( bFollowTextFlow ); + m_xFollowTextFlowCB->set_active(bFollowTextFlow); } if(m_bHtmlMode) { - m_pAutoHeightCB->Enable(false); - m_pAutoWidthCB->Enable(false); - m_pMirrorPagesCB->Show(false); + m_xAutoHeightCB->set_sensitive(false); + m_xAutoWidthCB->set_sensitive(false); + m_xMirrorPagesCB->show(false); if (m_sDlgType == "FrameDialog") - m_pFixedRatioCB->Enable(false); + m_xFixedRatioCB->set_sensitive(false); // i#18732 hide checkbox in HTML mode - m_pFollowTextFlowCB->Show(false); + m_xFollowTextFlowCB->show(false); } else { // enable/disable of check box 'Mirror on..' - m_pMirrorPagesCB->Enable(!m_pAnchorAsCharRB->IsChecked()); + m_xMirrorPagesCB->set_sensitive(!m_xAnchorAsCharRB->get_active()); // enable/disable check box 'Follow text flow'. // enable check box 'Follow text // flow' also for anchor type to-frame. - m_pFollowTextFlowCB->Enable( m_pAnchorAtParaRB->IsChecked() || - m_pAnchorAtCharRB->IsChecked() || - m_pAnchorAtFrameRB->IsChecked() ); + m_xFollowTextFlowCB->set_sensitive(m_xAnchorAtParaRB->get_active() || + m_xAnchorAtCharRB->get_active() || + m_xAnchorAtFrameRB->get_active()); } - Init( *rSet, true ); - m_pAtVertPosED->SaveValue(); - m_pAtHorzPosED->SaveValue(); - m_pFollowTextFlowCB->SaveValue(); + Init(*rSet); + m_xAtVertPosED->save_value(); + m_xAtHorzPosED->save_value(); + m_xFollowTextFlowCB->save_state(); + + m_xWidthED->save_value(); + m_xHeightED->save_value(); m_bNoModifyHdl = false; //lock PercentFields - m_aWidthED.LockAutoCalculation(true); - m_aHeightED.LockAutoCalculation(true); + m_xWidthED->LockAutoCalculation(true); + m_xHeightED->LockAutoCalculation(true); RangeModifyHdl(); // set all maximum values initially - m_aHeightED.LockAutoCalculation(false); - m_aWidthED.LockAutoCalculation(false); + m_xHeightED->LockAutoCalculation(false); + m_xWidthED->LockAutoCalculation(false); - m_pAutoHeightCB->SaveValue(); - m_pAutoWidthCB->SaveValue(); + m_xAutoHeightCB->save_state(); + m_xAutoWidthCB->save_state(); - SwTwips nWidth = static_cast< SwTwips >(m_aWidthED.DenormalizePercent(m_aWidthED.GetValue(FieldUnit::TWIP))); - SwTwips nHeight = static_cast< SwTwips >(m_aHeightED.DenormalizePercent(m_aHeightED.GetValue(FieldUnit::TWIP))); + SwTwips nWidth = static_cast< SwTwips >(m_xWidthED->DenormalizePercent(m_xWidthED->get_value(FieldUnit::TWIP))); + SwTwips nHeight = static_cast< SwTwips >(m_xHeightED->DenormalizePercent(m_xHeightED->get_value(FieldUnit::TWIP))); m_fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0; } @@ -1090,21 +1037,21 @@ bool SwFramePage::FillItemSet(SfxItemSet *rSet) { SwFormatHoriOrient aHoriOrient( rOldSet.Get(RES_HORI_ORIENT) ); - const sal_Int32 nMapPos = GetMapPos(m_pHMap, *m_pHorizontalDLB); - const sal_Int16 eHOri = GetAlignment(m_pHMap, nMapPos, *m_pHoriRelationLB); - const sal_Int16 eRel = GetRelation(*m_pHoriRelationLB); + const sal_Int32 nMapPos = GetMapPos(m_pHMap, *m_xHorizontalDLB); + const sal_Int16 eHOri = GetAlignment(m_pHMap, nMapPos, *m_xHoriRelationLB); + const sal_Int16 eRel = GetRelation(*m_xHoriRelationLB); aHoriOrient.SetHoriOrient( eHOri ); aHoriOrient.SetRelationOrient( eRel ); - aHoriOrient.SetPosToggle(m_pMirrorPagesCB->IsChecked()); + aHoriOrient.SetPosToggle(m_xMirrorPagesCB->get_active()); - bool bMod = m_pAtHorzPosED->IsValueChangedFromSaved(); - bMod |= m_pMirrorPagesCB->IsValueChangedFromSaved(); + bool bMod = m_xAtHorzPosED->get_value_changed_from_saved(); + bMod |= m_xMirrorPagesCB->get_state_changed_from_saved(); if ( eHOri == text::HoriOrientation::NONE && (m_bNew || (m_bAtHorzPosModified || bMod) || m_nOldH != eHOri ) ) { - SwTwips nX = static_cast< SwTwips >(m_pAtHorzPosED->Denormalize(m_pAtHorzPosED->GetValue(FieldUnit::TWIP))); + SwTwips nX = static_cast< SwTwips >(m_xAtHorzPosED->denormalize(m_xAtHorzPosED->get_value(FieldUnit::TWIP))); aHoriOrient.SetPos( nX ); } @@ -1125,21 +1072,21 @@ bool SwFramePage::FillItemSet(SfxItemSet *rSet) // alignment vertical SwFormatVertOrient aVertOrient( rOldSet.Get(RES_VERT_ORIENT) ); - const sal_Int32 nMapPos = GetMapPos(m_pVMap, *m_pVerticalDLB); - const sal_Int16 eVOri = GetAlignment(m_pVMap, nMapPos, *m_pVertRelationLB); - const sal_Int16 eRel = GetRelation(*m_pVertRelationLB); + const sal_Int32 nMapPos = GetMapPos(m_pVMap, *m_xVerticalDLB); + const sal_Int16 eVOri = GetAlignment(m_pVMap, nMapPos, *m_xVertRelationLB); + const sal_Int16 eRel = GetRelation(*m_xVertRelationLB); aVertOrient.SetVertOrient ( eVOri); aVertOrient.SetRelationOrient( eRel ); - bool bMod = m_pAtVertPosED->IsValueChangedFromSaved(); + bool bMod = m_xAtVertPosED->get_value_changed_from_saved(); if ( eVOri == text::VertOrientation::NONE && ( m_bNew || (m_bAtVertPosModified || bMod) || m_nOldV != eVOri) ) { // vertical position // recalculate offset for character bound frames - SwTwips nY = static_cast< SwTwips >(m_pAtVertPosED->Denormalize(m_pAtVertPosED->GetValue(FieldUnit::TWIP))); + SwTwips nY = static_cast< SwTwips >(m_xAtVertPosED->denormalize(m_xAtVertPosED->get_value(FieldUnit::TWIP))); if (eAnchorId == RndStdIds::FLY_AS_CHAR) { nY *= -1; @@ -1170,16 +1117,16 @@ bool SwFramePage::FillItemSet(SfxItemSet *rSet) const SwFormatFrameSize& rOldSize = rOldSet.Get(RES_FRM_SIZE); SwFormatFrameSize aSz( rOldSize ); - sal_Int32 nRelWidthRelation = m_pRelWidthRelationLB->GetSelectedEntryPos(); - if (nRelWidthRelation != LISTBOX_ENTRY_NOTFOUND) + auto nRelWidthRelation = m_xRelWidthRelationLB->get_active(); + if (nRelWidthRelation != -1) { if (nRelWidthRelation == 0) aSz.SetWidthPercentRelation(text::RelOrientation::FRAME); else if (nRelWidthRelation == 1) aSz.SetWidthPercentRelation(text::RelOrientation::PAGE_FRAME); } - sal_Int32 nRelHeightRelation = m_pRelHeightRelationLB->GetSelectedEntryPos(); - if (nRelHeightRelation != LISTBOX_ENTRY_NOTFOUND) + auto nRelHeightRelation = m_xRelHeightRelationLB->get_active(); + if (nRelHeightRelation != -1) { if (nRelHeightRelation == 0) aSz.SetHeightPercentRelation(text::RelOrientation::FRAME); @@ -1187,35 +1134,36 @@ bool SwFramePage::FillItemSet(SfxItemSet *rSet) aSz.SetHeightPercentRelation(text::RelOrientation::PAGE_FRAME); } - bool bValueModified = (m_aWidthED.IsValueModified() || m_aHeightED.IsValueModified()); - bool bCheckChanged = m_pRelWidthCB->IsValueChangedFromSaved() - || m_pRelHeightCB->IsValueChangedFromSaved(); + bool bValueModified = m_xWidthED->get_value_changed_from_saved() || + m_xHeightED->get_value_changed_from_saved(); + bool bCheckChanged = m_xRelWidthCB->get_state_changed_from_saved() || + m_xRelHeightCB->get_state_changed_from_saved(); bool bLegalValue = !(!rOldSize.GetWidth () && !rOldSize.GetHeight() && - m_aWidthED .GetValue() == m_aWidthED .GetMin() && - m_aHeightED.GetValue() == m_aHeightED.GetMin()); + m_xWidthED->get_value() == m_xWidthED->get_min() && + m_xHeightED->get_value() == m_xHeightED->get_min()); if ((m_bNew && !m_bFormat) || ((bValueModified || bCheckChanged) && bLegalValue)) { - sal_Int64 nNewWidth = m_aWidthED.DenormalizePercent(m_aWidthED.GetRealValue(FieldUnit::TWIP)); - sal_Int64 nNewHeight = m_aHeightED.DenormalizePercent(m_aHeightED.GetRealValue(FieldUnit::TWIP)); + sal_Int64 nNewWidth = m_xWidthED->DenormalizePercent(m_xWidthED->GetRealValue(FieldUnit::TWIP)); + sal_Int64 nNewHeight = m_xHeightED->DenormalizePercent(m_xHeightED->GetRealValue(FieldUnit::TWIP)); aSz.SetWidth (static_cast< SwTwips >(nNewWidth)); aSz.SetHeight(static_cast< SwTwips >(nNewHeight)); - if (m_pRelWidthCB->IsChecked()) + if (m_xRelWidthCB->get_active()) { - aSz.SetWidthPercent(static_cast<sal_uInt8>(std::min( static_cast< sal_Int64 >(MAX_PERCENT_WIDTH), m_aWidthED.Convert(m_aWidthED.NormalizePercent(nNewWidth), FieldUnit::TWIP, FieldUnit::CUSTOM)))); + aSz.SetWidthPercent(static_cast<sal_uInt8>(std::min(MAX_PERCENT_WIDTH, m_xWidthED->Convert(m_xWidthED->NormalizePercent(nNewWidth), FieldUnit::TWIP, FieldUnit::PERCENT)))); } else aSz.SetWidthPercent(0); - if (m_pRelHeightCB->IsChecked()) - aSz.SetHeightPercent(static_cast<sal_uInt8>(std::min(static_cast< sal_Int64 >(MAX_PERCENT_HEIGHT), m_aHeightED.Convert(m_aHeightED.NormalizePercent(nNewHeight), FieldUnit::TWIP, FieldUnit::CUSTOM)))); + if (m_xRelHeightCB->get_active()) + aSz.SetHeightPercent(static_cast<sal_uInt8>(std::min(MAX_PERCENT_HEIGHT, m_xHeightED->Convert(m_xHeightED->NormalizePercent(nNewHeight), FieldUnit::TWIP, FieldUnit::PERCENT)))); else aSz.SetHeightPercent(0); - if (m_pFixedRatioCB->IsChecked() && (m_pRelWidthCB->IsChecked() != m_pRelHeightCB->IsChecked())) + if (m_xFixedRatioCB->get_active() && (m_xRelWidthCB->get_active() != m_xRelHeightCB->get_active())) { - if (m_pRelWidthCB->IsChecked()) + if (m_xRelWidthCB->get_active()) aSz.SetHeightPercent(SwFormatFrameSize::SYNCED); else aSz.SetWidthPercent(SwFormatFrameSize::SYNCED); @@ -1223,21 +1171,21 @@ bool SwFramePage::FillItemSet(SfxItemSet *rSet) } if( !IsInGraficMode() ) { - if( m_pAutoHeightCB->IsValueChangedFromSaved() ) + if (m_xAutoHeightCB->get_state_changed_from_saved()) { - SwFrameSize eFrameSize = m_pAutoHeightCB->IsChecked()? ATT_MIN_SIZE : ATT_FIX_SIZE; + SwFrameSize eFrameSize = m_xAutoHeightCB->get_active()? ATT_MIN_SIZE : ATT_FIX_SIZE; if( eFrameSize != aSz.GetHeightSizeType() ) aSz.SetHeightSizeType(eFrameSize); } - if( m_pAutoWidthCB->IsValueChangedFromSaved() ) + if (m_xAutoWidthCB->get_state_changed_from_saved()) { - SwFrameSize eFrameSize = m_pAutoWidthCB->IsChecked()? ATT_MIN_SIZE : ATT_FIX_SIZE; + SwFrameSize eFrameSize = m_xAutoWidthCB->get_active()? ATT_MIN_SIZE : ATT_FIX_SIZE; if( eFrameSize != aSz.GetWidthSizeType() ) aSz.SetWidthSizeType( eFrameSize ); } } - if( !m_bFormat && m_pFixedRatioCB->IsValueChangedFromSaved() ) - bRet |= nullptr != rSet->Put(SfxBoolItem(FN_KEEP_ASPECT_RATIO, m_pFixedRatioCB->IsChecked())); + if (!m_bFormat && m_xFixedRatioCB->get_state_changed_from_saved()) + bRet |= nullptr != rSet->Put(SfxBoolItem(FN_KEEP_ASPECT_RATIO, m_xFixedRatioCB->get_active())); pOldItem = GetOldItem(*rSet, RES_FRM_SIZE); @@ -1251,9 +1199,9 @@ bool SwFramePage::FillItemSet(SfxItemSet *rSet) bRet |= nullptr != rSet->Put( aSz ); } - if(m_pFollowTextFlowCB->IsValueChangedFromSaved()) + if (m_xFollowTextFlowCB->get_state_changed_from_saved()) { - bRet |= nullptr != rSet->Put(SwFormatFollowTextFlow(m_pFollowTextFlowCB->IsChecked())); + bRet |= nullptr != rSet->Put(SwFormatFollowTextFlow(m_xFollowTextFlowCB->get_active())); } return bRet; } @@ -1267,24 +1215,24 @@ void SwFramePage::InitPos(RndStdIds eId, long nX, long nY) { - sal_Int32 nPos = m_pVerticalDLB->GetSelectedEntryPos(); - if ( nPos != LISTBOX_ENTRY_NOTFOUND && m_pVMap ) + auto nPos = m_xVerticalDLB->get_active(); + if (nPos != -1 && m_pVMap) { m_nOldV = m_pVMap[nPos].nAlign; - nPos = m_pVertRelationLB->GetSelectedEntryPos(); - if (nPos != LISTBOX_ENTRY_NOTFOUND) - m_nOldVRel = static_cast<RelationMap *>(m_pVertRelationLB->GetEntryData(nPos))->nRelation; + nPos = m_xVertRelationLB->get_active(); + if (nPos != -1) + m_nOldVRel = reinterpret_cast<RelationMap*>(m_xVertRelationLB->get_id(nPos).toInt64())->nRelation; } - nPos = m_pHorizontalDLB->GetSelectedEntryPos(); - if ( nPos != LISTBOX_ENTRY_NOTFOUND && m_pHMap ) + nPos = m_xHorizontalDLB->get_active(); + if (nPos != -1 && m_pHMap) { m_nOldH = m_pHMap[nPos].nAlign; - nPos = m_pHoriRelationLB->GetSelectedEntryPos(); - if (nPos != LISTBOX_ENTRY_NOTFOUND) - m_nOldHRel = static_cast<RelationMap *>(m_pHoriRelationLB->GetEntryData(nPos))->nRelation; + nPos = m_xHoriRelationLB->get_active(); + if (nPos != -1) + m_nOldHRel = reinterpret_cast<RelationMap*>(m_xHoriRelationLB->get_id(nPos).toInt64())->nRelation; } bool bEnable = true; @@ -1332,8 +1280,8 @@ void SwFramePage::InitPos(RndStdIds eId, m_pHMap = nullptr; bEnable = false; } - m_pHorizontalDLB->Enable( bEnable ); - m_pHorizontalFT->Enable( bEnable ); + m_xHorizontalDLB->set_sensitive( bEnable ); + m_xHorizontalFT->set_sensitive( bEnable ); // select current Pos // horizontal @@ -1342,8 +1290,8 @@ void SwFramePage::InitPos(RndStdIds eId, nH = m_nOldH; nHRel = m_nOldHRel; } - sal_Int32 nMapPos = FillPosLB(m_pHMap, nH, nHRel, *m_pHorizontalDLB); - FillRelLB(m_pHMap, nMapPos, nH, nHRel, *m_pHoriRelationLB, *m_pHoriRelationFT); + sal_Int32 nMapPos = FillPosLB(m_pHMap, nH, nHRel, *m_xHorizontalDLB); + FillRelLB(m_pHMap, nMapPos, nH, nHRel, *m_xHoriRelationLB, *m_xHoriRelationFT); // vertical if ( nV < 0 ) @@ -1351,34 +1299,26 @@ void SwFramePage::InitPos(RndStdIds eId, nV = m_nOldV; nVRel = m_nOldVRel; } - nMapPos = FillPosLB(m_pVMap, nV, nVRel, *m_pVerticalDLB); - FillRelLB(m_pVMap, nMapPos, nV, nVRel, *m_pVertRelationLB, *m_pVertRelationFT); + nMapPos = FillPosLB(m_pVMap, nV, nVRel, *m_xVerticalDLB); + FillRelLB(m_pVMap, nMapPos, nV, nVRel, *m_xVertRelationLB, *m_xVertRelationFT); bEnable = nH == text::HoriOrientation::NONE && eId != RndStdIds::FLY_AS_CHAR; if (!bEnable) - { - m_pAtHorzPosED->SetValue( 0, FieldUnit::TWIP ); - if (nX != LONG_MAX && m_bHtmlMode) - m_pAtHorzPosED->SetModifyFlag(); - } + m_xAtHorzPosED->set_value(0, FieldUnit::TWIP); else { if (nX != LONG_MAX) - m_pAtHorzPosED->SetValue( m_pAtHorzPosED->Normalize(nX), FieldUnit::TWIP ); + m_xAtHorzPosED->set_value(m_xAtHorzPosED->normalize(nX), FieldUnit::TWIP); } - m_pAtHorzPosFT->Enable( bEnable ); - m_pAtHorzPosED->Enable( bEnable ); + m_xAtHorzPosFT->set_sensitive( bEnable ); + m_xAtHorzPosED->set_sensitive( bEnable ); bEnable = nV == text::VertOrientation::NONE; if ( !bEnable ) - { - m_pAtVertPosED->SetValue( 0, FieldUnit::TWIP ); - if(nY != LONG_MAX && m_bHtmlMode) - m_pAtVertPosED->SetModifyFlag(); - } + m_xAtVertPosED->set_value(0, FieldUnit::TWIP); else { - if ( eId == RndStdIds::FLY_AS_CHAR ) + if (eId == RndStdIds::FLY_AS_CHAR) { if ( nY == LONG_MAX ) nY = 0; @@ -1386,22 +1326,22 @@ void SwFramePage::InitPos(RndStdIds eId, nY *= -1; } if ( nY != LONG_MAX ) - m_pAtVertPosED->SetValue( m_pAtVertPosED->Normalize(nY), FieldUnit::TWIP ); + m_xAtVertPosED->set_value(m_xAtVertPosED->normalize(nY), FieldUnit::TWIP); } - m_pAtVertPosFT->Enable( bEnable && m_bAllowVertPositioning ); - m_pAtVertPosED->Enable( bEnable && m_bAllowVertPositioning ); + m_xAtVertPosFT->set_sensitive( bEnable && m_bAllowVertPositioning ); + m_xAtVertPosED->set_sensitive( bEnable && m_bAllowVertPositioning ); UpdateExample(); } sal_Int32 SwFramePage::FillPosLB(const FrameMap* _pMap, const sal_Int16 _nAlign, const sal_Int16 _nRel, - ListBox& _rLB ) + weld::ComboBox& _rLB ) { OUString sSelEntry; - const OUString sOldEntry = _rLB.GetSelectedEntry(); + const OUString sOldEntry = _rLB.get_active_text(); - _rLB.Clear(); + _rLB.clear(); // i#22341 determine all possible listbox relations for // given relation for map <aVCharMap> @@ -1414,17 +1354,17 @@ sal_Int32 SwFramePage::FillPosLB(const FrameMap* _pMap, for (size_t i = 0; _pMap && i < nCount; ++i) { // Why not from the left/from inside or from above? - SvxSwFramePosString::StringId eStrId = m_pMirrorPagesCB->IsChecked() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId; + SvxSwFramePosString::StringId eStrId = m_xMirrorPagesCB->get_active() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId; // --> OD 2009-08-31 #mongolianlayout# eStrId = lcl_ChangeResIdToVerticalOrRTL( eStrId, m_bIsVerticalFrame, m_bIsVerticalL2R, m_bIsInRightToLeft); OUString sEntry(SvxSwFramePosString::GetString(eStrId)); - if (_rLB.GetEntryPos(sEntry) == LISTBOX_ENTRY_NOTFOUND) + if (_rLB.find_text(sEntry) == -1) { // don't insert entries when frames are character bound - _rLB.InsertEntry(sEntry); + _rLB.append_text(sEntry); } // i#22341 - add condition to handle map <aVCharMap> // that is ambiguous in the alignment. @@ -1435,36 +1375,36 @@ sal_Int32 SwFramePage::FillPosLB(const FrameMap* _pMap, } } - _rLB.SelectEntry(sSelEntry); - if (!_rLB.GetSelectedEntryCount()) - _rLB.SelectEntry(sOldEntry); + _rLB.set_active_text(sSelEntry); + if (_rLB.get_active() == -1) + _rLB.set_active_text(sOldEntry); - if (!_rLB.GetSelectedEntryCount()) - _rLB.SelectEntryPos(0); + if (_rLB.get_active() == -1) + _rLB.set_active(0); PosHdl(_rLB); return GetMapPos(_pMap, _rLB); } -void SwFramePage::FillRelLB( const FrameMap* _pMap, +void SwFramePage::FillRelLB(const FrameMap* _pMap, const sal_uInt16 _nLBSelPos, const sal_Int16 _nAlign, const sal_Int16 _nRel, - ListBox& _rLB, - FixedText& _rFT ) + weld::ComboBox& _rLB, + weld::Label& _rFT) { OUString sSelEntry; LB nLBRelations = LB::NONE; size_t nMapCount = ::lcl_GetFrameMapCount(_pMap); - _rLB.Clear(); + _rLB.clear(); if (_nLBSelPos < nMapCount) { if (_pMap == aVAsCharHtmlMap || _pMap == aVAsCharMap) { - const OUString sOldEntry(_rLB.GetSelectedEntry()); + const OUString sOldEntry(_rLB.get_active_text()); SvxSwFramePosString::StringId eStrId = _pMap[_nLBSelPos].eStrId; for (size_t nMapPos = 0; nMapPos < nMapCount; nMapPos++) @@ -1485,8 +1425,7 @@ void SwFramePage::FillRelLB( const FrameMap* _pMap, m_bIsVerticalL2R, m_bIsInRightToLeft); const OUString sEntry = SvxSwFramePosString::GetString(sStrId1); - sal_Int32 nPos = _rLB.InsertEntry(sEntry); - _rLB.SetEntryData(nPos, const_cast<RelationMap*>(&rCharMap)); + _rLB.append(OUString::number(reinterpret_cast<sal_Int64>(&rCharMap)), sEntry); if (_pMap[nMapPos].nAlign == _nAlign) sSelEntry = sEntry; break; @@ -1495,19 +1434,19 @@ void SwFramePage::FillRelLB( const FrameMap* _pMap, } } if (!sSelEntry.isEmpty()) - _rLB.SelectEntry(sSelEntry); + _rLB.set_active_text(sSelEntry); else { - _rLB.SelectEntry(sOldEntry); + _rLB.set_active_text(sOldEntry); - if (!_rLB.GetSelectedEntryCount()) + if (_rLB.get_active() == -1) { - for (sal_Int32 i = 0; i < _rLB.GetEntryCount(); i++) + for (int i = 0; i < _rLB.get_count(); i++) { - RelationMap *pEntry = static_cast<RelationMap *>(_rLB.GetEntryData(i)); + RelationMap *pEntry = reinterpret_cast<RelationMap*>(_rLB.get_id(i).toInt64()); if (pEntry->nLBRelation == LB::RelChar) // default { - _rLB.SelectEntryPos(i); + _rLB.set_active(i); break; } } @@ -1521,10 +1460,10 @@ void SwFramePage::FillRelLB( const FrameMap* _pMap, if ( _pMap == aVCharMap ) { nLBRelations = ::lcl_GetLBRelationsForStrID( _pMap, - ( m_pMirrorPagesCB->IsChecked() + ( m_xMirrorPagesCB->get_active() ? _pMap[_nLBSelPos].eMirrorStrId : _pMap[_nLBSelPos].eStrId), - m_pMirrorPagesCB->IsChecked() ); + m_xMirrorPagesCB->get_active() ); } else { @@ -1539,7 +1478,7 @@ void SwFramePage::FillRelLB( const FrameMap* _pMap, { if (rMap.nLBRelation == static_cast<LB>(nBit)) { - SvxSwFramePosString::StringId eStrId1 = m_pMirrorPagesCB->IsChecked() ? + SvxSwFramePosString::StringId eStrId1 = m_xMirrorPagesCB->get_active() ? rMap.eMirrorStrId : rMap.eStrId; // --> OD 2009-08-31 #mongolianlayout# eStrId1 = @@ -1548,8 +1487,7 @@ void SwFramePage::FillRelLB( const FrameMap* _pMap, m_bIsVerticalL2R, m_bIsInRightToLeft); const OUString sEntry = SvxSwFramePosString::GetString(eStrId1); - sal_Int32 nPos = _rLB.InsertEntry(sEntry); - _rLB.SetEntryData(nPos, const_cast<RelationMap*>(&rMap)); + _rLB.append(OUString::number(reinterpret_cast<sal_Int64>(&rMap)), sEntry); if (sSelEntry.isEmpty() && rMap.nRelation == _nRel) sSelEntry = sEntry; } @@ -1557,7 +1495,7 @@ void SwFramePage::FillRelLB( const FrameMap* _pMap, } } if (!sSelEntry.isEmpty()) - _rLB.SelectEntry(sSelEntry); + _rLB.set_active_text(sSelEntry); else { // Probably anchor switch. So look for similar relation @@ -1590,45 +1528,44 @@ void SwFramePage::FillRelLB( const FrameMap* _pMap, break; default: - if (_rLB.GetEntryCount()) + if (_rLB.get_active() != -1) { - RelationMap *pEntry = static_cast<RelationMap *>(_rLB.GetEntryData(_rLB.GetEntryCount() - 1)); + RelationMap *pEntry = reinterpret_cast<RelationMap*>(_rLB.get_id(_rLB.get_count() - 1).toInt64()); nSimRel = pEntry->nRelation; } break; } - for (sal_Int32 i = 0; i < _rLB.GetEntryCount(); i++) + for (int i = 0; i < _rLB.get_count(); i++) { - RelationMap *pEntry = static_cast<RelationMap *>(_rLB.GetEntryData(i)); + RelationMap *pEntry = reinterpret_cast<RelationMap*>(_rLB.get_id(i).toInt64()); if (pEntry->nRelation == nSimRel) { - _rLB.SelectEntryPos(i); + _rLB.set_active(i); break; } } - if (!_rLB.GetSelectedEntryCount()) - _rLB.SelectEntryPos(0); + if (_rLB.get_active() == -1) + _rLB.set_active(0); } } } - const bool bEnable = _rLB.GetEntryCount() != 0 - && (&_rLB != m_pVertRelationLB || m_bAllowVertPositioning); - _rLB.Enable( bEnable ); - _rFT.Enable( bEnable ); + const bool bEnable = _rLB.get_count() != 0 + && (&_rLB != m_xVertRelationLB.get() || m_bAllowVertPositioning); + _rLB.set_sensitive( bEnable ); + _rFT.set_sensitive( bEnable ); RelHdl(_rLB); } -sal_Int16 SwFramePage::GetRelation(ListBox const &rRelationLB) +sal_Int16 SwFramePage::GetRelation(const weld::ComboBox& rRelationLB) { - const sal_Int32 nPos = rRelationLB.GetSelectedEntryPos(); - - if (nPos != LISTBOX_ENTRY_NOTFOUND) + const auto nPos = rRelationLB.get_active(); + if (nPos != -1) { - RelationMap *pEntry = static_cast<RelationMap *>(rRelationLB.GetEntryData(nPos)); + RelationMap *pEntry = reinterpret_cast<RelationMap *>(rRelationLB.get_id(nPos).toInt64()); return pEntry->nRelation; } @@ -1636,7 +1573,7 @@ sal_Int16 SwFramePage::GetRelation(ListBox const &rRelationLB) } sal_Int16 SwFramePage::GetAlignment(FrameMap const *pMap, sal_Int32 nMapPos, - ListBox const &rRelationLB) + const weld::ComboBox& rRelationLB) { if (!pMap || nMapPos < 0) return 0; @@ -1651,11 +1588,11 @@ sal_Int16 SwFramePage::GetAlignment(FrameMap const *pMap, sal_Int32 nMapPos, if ( pMap != aVAsCharHtmlMap && pMap != aVAsCharMap && pMap != aVCharMap ) return pMap[nMapPos].nAlign; - if (rRelationLB.GetSelectedEntryPos() == LISTBOX_ENTRY_NOTFOUND) + if (rRelationLB.get_active() == -1) return 0; - const RelationMap *const pRelationMap = static_cast<const RelationMap *>( - rRelationLB.GetSelectedEntryData()); + const RelationMap *const pRelationMap = reinterpret_cast<const RelationMap *>( + rRelationLB.get_active_id().toInt64()); const LB nRel = pRelationMap->nLBRelation; const SvxSwFramePosString::StringId eStrId = pMap[nMapPos].eStrId; @@ -1668,17 +1605,17 @@ sal_Int16 SwFramePage::GetAlignment(FrameMap const *pMap, sal_Int32 nMapPos, return 0; } -sal_Int32 SwFramePage::GetMapPos( const FrameMap *pMap, ListBox const &rAlignLB ) +sal_Int32 SwFramePage::GetMapPos(const FrameMap *pMap, const weld::ComboBox& rAlignLB) { sal_Int32 nMapPos = 0; - sal_Int32 nLBSelPos = rAlignLB.GetSelectedEntryPos(); + auto nLBSelPos = rAlignLB.get_active(); - if (nLBSelPos != LISTBOX_ENTRY_NOTFOUND) + if (nLBSelPos != -1) { if (pMap == aVAsCharHtmlMap || pMap == aVAsCharMap) { const size_t nMapCount = ::lcl_GetFrameMapCount(pMap); - const OUString sSelEntry(rAlignLB.GetSelectedEntry()); + const OUString sSelEntry(rAlignLB.get_active_text()); for (size_t i = 0; i < nMapCount; i++) { @@ -1704,19 +1641,19 @@ sal_Int32 SwFramePage::GetMapPos( const FrameMap *pMap, ListBox const &rAlignLB RndStdIds SwFramePage::GetAnchor() { RndStdIds nRet = RndStdIds::FLY_AT_PAGE; - if(m_pAnchorAtParaRB->IsChecked()) + if (m_xAnchorAtParaRB->get_active()) { nRet = RndStdIds::FLY_AT_PARA; } - else if(m_pAnchorAtCharRB->IsChecked()) + else if (m_xAnchorAtCharRB->get_active()) { nRet = RndStdIds::FLY_AT_CHAR; } - else if(m_pAnchorAsCharRB->IsChecked()) + else if (m_xAnchorAsCharRB->get_active()) { nRet = RndStdIds::FLY_AS_CHAR; } - else if(m_pAnchorAtFrameRB->IsChecked()) + else if (m_xAnchorAtFrameRB->get_active()) { nRet = RndStdIds::FLY_AT_FLY; } @@ -1730,12 +1667,12 @@ void SwFramePage::ActivatePage(const SfxItemSet& rSet) Init(rSet); m_bNoModifyHdl = false; //lock PercentFields - m_aWidthED.LockAutoCalculation(true); - m_aHeightED.LockAutoCalculation(true); + m_xWidthED->LockAutoCalculation(true); + m_xHeightED->LockAutoCalculation(true); RangeModifyHdl(); // set all maximum values initially - m_aHeightED.LockAutoCalculation(false); - m_aWidthED.LockAutoCalculation(false); - m_pFollowTextFlowCB->SaveValue(); + m_xHeightED->LockAutoCalculation(false); + m_xWidthED->LockAutoCalculation(false); + m_xFollowTextFlowCB->save_state(); } DeactivateRC SwFramePage::DeactivatePage(SfxItemSet * _pSet) @@ -1760,47 +1697,43 @@ DeactivateRC SwFramePage::DeactivatePage(SfxItemSet * _pSet) } // swap left/right with inside/outside -IMPL_LINK_NOARG(SwFramePage, MirrorHdl, Button*, void) +IMPL_LINK_NOARG(SwFramePage, MirrorHdl, weld::ToggleButton&, void) { RndStdIds eId = GetAnchor(); - InitPos( eId, -1, 0, -1, 0, LONG_MAX, LONG_MAX); + InitPos(eId, -1, 0, -1, 0, LONG_MAX, LONG_MAX); } -IMPL_LINK( SwFramePage, RelSizeClickHdl, Button *, p, void ) +IMPL_LINK( SwFramePage, RelSizeClickHdl, weld::ToggleButton&, rBtn, void ) { - CheckBox* pBtn = static_cast<CheckBox*>(p); - if (pBtn == m_pRelWidthCB) + if (&rBtn == m_xRelWidthCB.get()) { - m_aWidthED.ShowPercent(pBtn->IsChecked()); - m_pRelWidthRelationLB->Enable(pBtn->IsChecked()); - if(pBtn->IsChecked()) - m_aWidthED.get()->SetMax(MAX_PERCENT_WIDTH); + m_xWidthED->ShowPercent(rBtn.get_active()); + m_xRelWidthRelationLB->set_sensitive(rBtn.get_active()); + if (rBtn.get_active()) + m_xWidthED->get()->set_max(MAX_PERCENT_WIDTH, FieldUnit::NONE); } - else // pBtn == m_pRelHeightCB + else // rBtn == m_xRelHeightCB.get() { - m_aHeightED.ShowPercent(pBtn->IsChecked()); - m_pRelHeightRelationLB->Enable(pBtn->IsChecked()); - if(pBtn->IsChecked()) - m_aHeightED.get()->SetMax(MAX_PERCENT_HEIGHT); + m_xHeightED->ShowPercent(rBtn.get_active()); + m_xRelHeightRelationLB->set_sensitive(rBtn.get_active()); + if (rBtn.get_active()) + m_xHeightED->get()->set_max(MAX_PERCENT_HEIGHT, FieldUnit::NONE); } RangeModifyHdl(); // correct the values again - if (pBtn == m_pRelWidthCB) - ModifyHdl(*m_aWidthED.get()); - else // pBtn == m_pRelHeightCB - ModifyHdl(*m_aHeightED.get()); + if (&rBtn == m_xRelWidthCB.get()) + ModifyHdl(*m_xWidthED->get()); + else // rBtn == m_xRelHeightCB.get() + ModifyHdl(*m_xHeightED->get()); } // range check -IMPL_LINK_NOARG(SwFramePage, RangeModifyClickHdl, Button*, void) -{ - RangeModifyHdl(); -} -IMPL_LINK_NOARG(SwFramePage, RangeModifyLoseFocusHdl, Control&, void) +IMPL_LINK_NOARG(SwFramePage, RangeModifyClickHdl, weld::ToggleButton&, void) { RangeModifyHdl(); } + void SwFramePage::RangeModifyHdl() { if (m_bNoModifyHdl) @@ -1813,16 +1746,16 @@ void SwFramePage::RangeModifyHdl() SvxSwFrameValidation aVal; aVal.nAnchorType = GetAnchor(); - aVal.bAutoHeight = m_pAutoHeightCB->IsChecked(); - aVal.bMirror = m_pMirrorPagesCB->IsChecked(); - aVal.bFollowTextFlow = m_pFollowTextFlowCB->IsChecked(); + aVal.bAutoHeight = m_xAutoHeightCB->get_active(); + aVal.bMirror = m_xMirrorPagesCB->get_active(); + aVal.bFollowTextFlow = m_xFollowTextFlowCB->get_active(); if ( m_pHMap ) { // alignment horizontal - const sal_Int32 nMapPos = GetMapPos(m_pHMap, *m_pHorizontalDLB); - aVal.nHoriOrient = GetAlignment(m_pHMap, nMapPos, *m_pHoriRelationLB); - aVal.nHRelOrient = GetRelation(*m_pHoriRelationLB); + const sal_Int32 nMapPos = GetMapPos(m_pHMap, *m_xHorizontalDLB); + aVal.nHoriOrient = GetAlignment(m_pHMap, nMapPos, *m_xHoriRelationLB); + aVal.nHRelOrient = GetRelation(*m_xHoriRelationLB); } else aVal.nHoriOrient = text::HoriOrientation::NONE; @@ -1830,17 +1763,17 @@ void SwFramePage::RangeModifyHdl() if ( m_pVMap ) { // alignment vertical - const sal_Int32 nMapPos = GetMapPos(m_pVMap, *m_pVerticalDLB); - aVal.nVertOrient = GetAlignment(m_pVMap, nMapPos, *m_pVertRelationLB); - aVal.nVRelOrient = GetRelation(*m_pVertRelationLB); + const sal_Int32 nMapPos = GetMapPos(m_pVMap, *m_xVerticalDLB); + aVal.nVertOrient = GetAlignment(m_pVMap, nMapPos, *m_xVertRelationLB); + aVal.nVRelOrient = GetRelation(*m_xVertRelationLB); } else aVal.nVertOrient = text::VertOrientation::NONE; const long nAtHorzPosVal = static_cast< long >( - m_pAtHorzPosED->Denormalize(m_pAtHorzPosED->GetValue(FieldUnit::TWIP)) ); + m_xAtHorzPosED->denormalize(m_xAtHorzPosED->get_value(FieldUnit::TWIP)) ); const long nAtVertPosVal = static_cast< long >( - m_pAtVertPosED->Denormalize(m_pAtVertPosED->GetValue(FieldUnit::TWIP)) ); + m_xAtVertPosED->denormalize(m_xAtVertPosED->get_value(FieldUnit::TWIP)) ); aVal.nHPos = nAtHorzPosVal; aVal.nVPos = nAtVertPosVal; @@ -1848,12 +1781,12 @@ void SwFramePage::RangeModifyHdl() aMgr.ValidateMetrics(aVal, mpToCharContentPos, true); // one time, to get reference values for percental values // set reference values for percental values (100%) ... - m_aWidthED.SetRefValue(aVal.aPercentSize.Width()); - m_aHeightED.SetRefValue(aVal.aPercentSize.Height()); + m_xWidthED->SetRefValue(aVal.aPercentSize.Width()); + m_xHeightED->SetRefValue(aVal.aPercentSize.Height()); // ... and correctly convert width and height with it - SwTwips nWidth = static_cast< SwTwips >(m_aWidthED. DenormalizePercent(m_aWidthED.GetValue(FieldUnit::TWIP))); - SwTwips nHeight = static_cast< SwTwips >(m_aHeightED.DenormalizePercent(m_aHeightED.GetValue(FieldUnit::TWIP))); + SwTwips nWidth = static_cast< SwTwips >(m_xWidthED->DenormalizePercent(m_xWidthED->get_value(FieldUnit::TWIP))); + SwTwips nHeight = static_cast< SwTwips >(m_xHeightED->DenormalizePercent(m_xHeightED->get_value(FieldUnit::TWIP))); aVal.nWidth = nWidth; aVal.nHeight = nHeight; @@ -1880,8 +1813,8 @@ void SwFramePage::RangeModifyHdl() nHeight = aVal.nHeight; // minimum range also for template - m_aHeightED.SetMin(m_aHeightED.NormalizePercent(aVal.nMinHeight), FieldUnit::TWIP); - m_aWidthED. SetMin(m_aWidthED.NormalizePercent(aVal.nMinWidth), FieldUnit::TWIP); + m_xHeightED->set_min(m_xHeightED->NormalizePercent(aVal.nMinHeight), FieldUnit::TWIP); + m_xWidthED->set_min(m_xWidthED->NormalizePercent(aVal.nMinWidth), FieldUnit::TWIP); SwTwips nMaxWidth(aVal.nMaxWidth); SwTwips nMaxHeight(aVal.nMaxHeight); @@ -1889,47 +1822,49 @@ void SwFramePage::RangeModifyHdl() if (aVal.bAutoHeight && (m_sDlgType == "PictureDialog" || m_sDlgType == "ObjectDialog")) { SwTwips nTmp = std::min(nWidth * nMaxHeight / std::max(nHeight, 1L), nMaxHeight); - m_aWidthED.SetMax(m_aWidthED.NormalizePercent(nTmp), FieldUnit::TWIP); + m_xWidthED->set_max(m_xWidthED->NormalizePercent(nTmp), FieldUnit::TWIP); nTmp = std::min(nHeight * nMaxWidth / std::max(nWidth, 1L), nMaxWidth); - m_aHeightED.SetMax(m_aWidthED.NormalizePercent(nTmp), FieldUnit::TWIP); + m_xHeightED->set_max(m_xWidthED->NormalizePercent(nTmp), FieldUnit::TWIP); } else { - SwTwips nTmp = static_cast< SwTwips >(m_aHeightED.NormalizePercent(nMaxHeight)); - m_aHeightED.SetMax(nTmp, FieldUnit::TWIP); + SwTwips nTmp = static_cast< SwTwips >(m_xHeightED->NormalizePercent(nMaxHeight)); + m_xHeightED->set_max(nTmp, FieldUnit::TWIP); - nTmp = static_cast< SwTwips >(m_aWidthED.NormalizePercent(nMaxWidth)); - m_aWidthED.SetMax(nTmp, FieldUnit::TWIP); + nTmp = static_cast< SwTwips >(m_xWidthED->NormalizePercent(nMaxWidth)); + m_xWidthED->set_max(nTmp, FieldUnit::TWIP); } - m_pAtHorzPosED->SetMin(m_pAtHorzPosED->Normalize(aVal.nMinHPos), FieldUnit::TWIP); - m_pAtHorzPosED->SetMax(m_pAtHorzPosED->Normalize(aVal.nMaxHPos), FieldUnit::TWIP); - if ( aVal.nHPos != nAtHorzPosVal ) - m_pAtHorzPosED->SetValue(m_pAtHorzPosED->Normalize(aVal.nHPos), FieldUnit::TWIP); + m_xAtHorzPosED->set_range(m_xAtHorzPosED->normalize(aVal.nMinHPos), + m_xAtHorzPosED->normalize(aVal.nMaxHPos), + FieldUnit::TWIP); + if (aVal.nHPos != nAtHorzPosVal) + m_xAtHorzPosED->set_value(m_xAtHorzPosED->normalize(aVal.nHPos), FieldUnit::TWIP); const SwTwips nUpperOffset = (aVal.nAnchorType == RndStdIds::FLY_AS_CHAR) ? m_nUpperBorder : 0; const SwTwips nLowerOffset = (aVal.nAnchorType == RndStdIds::FLY_AS_CHAR) ? m_nLowerBorder : 0; - m_pAtVertPosED->SetMin(m_pAtVertPosED->Normalize(aVal.nMinVPos + nLowerOffset + nUpperOffset), FieldUnit::TWIP); - m_pAtVertPosED->SetMax(m_pAtVertPosED->Normalize(aVal.nMaxVPos), FieldUnit::TWIP); - if ( aVal.nVPos != nAtVertPosVal ) - m_pAtVertPosED->SetValue(m_pAtVertPosED->Normalize(aVal.nVPos), FieldUnit::TWIP); + m_xAtVertPosED->set_range(m_xAtVertPosED->normalize(aVal.nMinVPos + nLowerOffset + nUpperOffset), + m_xAtVertPosED->normalize(aVal.nMaxVPos), + FieldUnit::TWIP); + if (aVal.nVPos != nAtVertPosVal) + m_xAtVertPosED->set_value(m_xAtVertPosED->normalize(aVal.nVPos), FieldUnit::TWIP); } -IMPL_LINK_NOARG(SwFramePage, AnchorTypeHdl, Button*, void) +IMPL_LINK_NOARG(SwFramePage, AnchorTypeHdl, weld::ToggleButton&, void) { - m_pMirrorPagesCB->Enable(!m_pAnchorAsCharRB->IsChecked()); + m_xMirrorPagesCB->set_sensitive(!m_xAnchorAsCharRB->get_active()); // i#18732 - enable check box 'Follow text flow' for anchor // type to-paragraph' and to-character // i#22305 - enable check box 'Follow text // flow' also for anchor type to-frame. - m_pFollowTextFlowCB->Enable( m_pAnchorAtParaRB->IsChecked() || - m_pAnchorAtCharRB->IsChecked() || - m_pAnchorAtFrameRB->IsChecked() ); + m_xFollowTextFlowCB->set_sensitive(m_xAnchorAtParaRB->get_active() || + m_xAnchorAtCharRB->get_active() || + m_xAnchorAtFrameRB->get_active()); RndStdIds eId = GetAnchor(); @@ -1938,19 +1873,19 @@ IMPL_LINK_NOARG(SwFramePage, AnchorTypeHdl, Button*, void) if(m_bHtmlMode) { - PosHdl(*m_pHorizontalDLB); - PosHdl(*m_pVerticalDLB); + PosHdl(*m_xHorizontalDLB); + PosHdl(*m_xVerticalDLB); } EnableVerticalPositioning( !(m_bIsMathOLE && m_bIsMathBaselineAlignment && RndStdIds::FLY_AS_CHAR == eId) ); } -IMPL_LINK( SwFramePage, PosHdl, ListBox&, rLB, void ) +IMPL_LINK( SwFramePage, PosHdl, weld::ComboBox&, rLB, void ) { - bool bHori = &rLB == m_pHorizontalDLB; - ListBox *pRelLB = bHori ? m_pHoriRelationLB.get() : m_pVertRelationLB.get(); - FixedText *pRelFT = bHori ? m_pHoriRelationFT.get() : m_pVertRelationFT.get(); + bool bHori = &rLB == m_xHorizontalDLB.get(); + weld::ComboBox *pRelLB = bHori ? m_xHoriRelationLB.get() : m_xVertRelationLB.get(); + weld::Label *pRelFT = bHori ? m_xHoriRelationFT.get() : m_xVertRelationFT.get(); FrameMap const *pMap = bHori ? m_pHMap : m_pVMap; const sal_Int32 nMapPos = GetMapPos(pMap, rLB); @@ -1959,29 +1894,27 @@ IMPL_LINK( SwFramePage, PosHdl, ListBox&, rLB, void ) if (bHori) { bool bEnable = text::HoriOrientation::NONE == nAlign; - m_pAtHorzPosED->Enable( bEnable ); - m_pAtHorzPosFT->Enable( bEnable ); + m_xAtHorzPosED->set_sensitive( bEnable ); + m_xAtHorzPosFT->set_sensitive( bEnable ); } else { bool bEnable = text::VertOrientation::NONE == nAlign && m_bAllowVertPositioning; - m_pAtVertPosED->Enable( bEnable ); - m_pAtVertPosFT->Enable( bEnable ); + m_xAtVertPosED->set_sensitive( bEnable ); + m_xAtVertPosFT->set_sensitive( bEnable ); } RangeModifyHdl(); sal_Int16 nRel = 0; - if (rLB.GetSelectedEntryCount()) + if (rLB.get_active() != -1) { - - if (pRelLB->GetSelectedEntryPos() != LISTBOX_ENTRY_NOTFOUND) - nRel = static_cast<RelationMap *>(pRelLB->GetSelectedEntryData())->nRelation; - + if (pRelLB->get_active() != -1) + nRel = reinterpret_cast<RelationMap*>(pRelLB->get_active_id().toInt64())->nRelation; FillRelLB(pMap, nMapPos, nAlign, nRel, *pRelLB, *pRelFT); } else - pRelLB->Clear(); + pRelLB->clear(); UpdateExample(); @@ -1999,58 +1932,58 @@ IMPL_LINK( SwFramePage, PosHdl, ListBox&, rLB, void ) // right is allowed only above - from the left only above // from the left at character -> below if((text::HoriOrientation::LEFT == nAlign || text::HoriOrientation::RIGHT == nAlign) && - 0 == m_pVerticalDLB->GetSelectedEntryPos()) + 0 == m_xVerticalDLB->get_active()) { if(text::RelOrientation::FRAME == nRel) - m_pVerticalDLB->SelectEntryPos(1); + m_xVerticalDLB->set_active(1); else - m_pVerticalDLB->SelectEntryPos(0); + m_xVerticalDLB->set_active(0); bSet = true; } - else if(text::HoriOrientation::LEFT == nAlign && 1 == m_pVerticalDLB->GetSelectedEntryPos()) + else if(text::HoriOrientation::LEFT == nAlign && 1 == m_xVerticalDLB->get_active()) { - m_pVerticalDLB->SelectEntryPos(0); + m_xVerticalDLB->set_active(0); bSet = true; } - else if(text::HoriOrientation::NONE == nAlign && 1 == m_pVerticalDLB->GetSelectedEntryPos()) + else if(text::HoriOrientation::NONE == nAlign && 1 == m_xVerticalDLB->get_active()) { - m_pVerticalDLB->SelectEntryPos(0); + m_xVerticalDLB->set_active(0); bSet = true; } if(bSet) - PosHdl(*m_pVerticalDLB); + PosHdl(*m_xVerticalDLB); } else { if(text::VertOrientation::TOP == nAlign) { - if(1 == m_pHorizontalDLB->GetSelectedEntryPos()) + if (1 == m_xHorizontalDLB->get_active()) { - m_pHorizontalDLB->SelectEntryPos(0); + m_xHorizontalDLB->set_active(0); bSet = true; } - m_pHoriRelationLB->SelectEntryPos(1); + m_xHoriRelationLB->set_active(1); } else if(text::VertOrientation::CHAR_BOTTOM == nAlign) { - if(2 == m_pHorizontalDLB->GetSelectedEntryPos()) + if (2 == m_xHorizontalDLB->get_active()) { - m_pHorizontalDLB->SelectEntryPos(0); + m_xHorizontalDLB->set_active(0); bSet = true; } - m_pHoriRelationLB->SelectEntryPos(0) ; + m_xHoriRelationLB->set_active(0) ; } if(bSet) - PosHdl(*m_pHorizontalDLB); + PosHdl(*m_xHorizontalDLB); } } } // horizontal Pos -IMPL_LINK( SwFramePage, RelHdl, ListBox&, rLB, void ) +IMPL_LINK( SwFramePage, RelHdl, weld::ComboBox&, rLB, void ) { - bool bHori = &rLB == m_pHoriRelationLB; + bool bHori = &rLB == m_xHoriRelationLB.get(); UpdateExample(); @@ -2063,55 +1996,55 @@ IMPL_LINK( SwFramePage, RelHdl, ListBox&, rLB, void ) { if(bHori) { - const sal_Int16 nRel = GetRelation(*m_pHoriRelationLB); - if(text::RelOrientation::PRINT_AREA == nRel && 0 == m_pVerticalDLB->GetSelectedEntryPos()) + const sal_Int16 nRel = GetRelation(*m_xHoriRelationLB); + if(text::RelOrientation::PRINT_AREA == nRel && 0 == m_xVerticalDLB->get_active()) { - m_pVerticalDLB->SelectEntryPos(1); + m_xVerticalDLB->set_active(1); } - else if(text::RelOrientation::CHAR == nRel && 1 == m_pVerticalDLB->GetSelectedEntryPos()) + else if(text::RelOrientation::CHAR == nRel && 1 == m_xVerticalDLB->get_active()) { - m_pVerticalDLB->SelectEntryPos(0); + m_xVerticalDLB->set_active(0); } } } RangeModifyHdl(); } -IMPL_LINK_NOARG(SwFramePage, RealSizeHdl, Button*, void) +IMPL_LINK_NOARG(SwFramePage, RealSizeHdl, weld::Button&, void) { - m_aWidthED.SetUserValue( m_aWidthED. NormalizePercent(m_aGrfSize.Width() ), FieldUnit::TWIP); - m_aHeightED.SetUserValue(m_aHeightED.NormalizePercent(m_aGrfSize.Height()), FieldUnit::TWIP); + m_xWidthED->set_value(m_xWidthED->NormalizePercent(m_aGrfSize.Width()), FieldUnit::TWIP); + m_xHeightED->set_value(m_xHeightED->NormalizePercent(m_aGrfSize.Height()), FieldUnit::TWIP); m_fWidthHeightRatio = m_aGrfSize.Height() ? double(m_aGrfSize.Width()) / double(m_aGrfSize.Height()) : 1.0; UpdateExample(); } -IMPL_LINK_NOARG(SwFramePage, AutoWidthClickHdl, Button*, void) +IMPL_LINK_NOARG(SwFramePage, AutoWidthClickHdl, weld::ToggleButton&, void) { if( !IsInGraficMode() ) - HandleAutoCB( m_pAutoWidthCB->IsChecked(), *m_pWidthFT, *m_pWidthAutoFT, *m_aWidthED.get() ); + HandleAutoCB( m_xAutoWidthCB->get_active(), *m_xWidthFT, *m_xWidthAutoFT, *m_xWidthED->get() ); } -IMPL_LINK_NOARG(SwFramePage, AutoHeightClickHdl, Button*, void) +IMPL_LINK_NOARG(SwFramePage, AutoHeightClickHdl, weld::ToggleButton&, void) { - if( !IsInGraficMode() ) - HandleAutoCB( m_pAutoHeightCB->IsChecked(), *m_pHeightFT, *m_pHeightAutoFT, *m_aWidthED.get() ); + if (!IsInGraficMode()) + HandleAutoCB(m_xAutoHeightCB->get_active(), *m_xHeightFT, *m_xHeightAutoFT, *m_xWidthED->get()); } -IMPL_LINK( SwFramePage, ModifyHdl, Edit&, rEdit, void ) +IMPL_LINK( SwFramePage, ModifyHdl, weld::MetricSpinButton&, rEdit, void ) { - SwTwips nWidth = static_cast< SwTwips >(m_aWidthED.DenormalizePercent(m_aWidthED.GetValue(FieldUnit::TWIP))); - SwTwips nHeight = static_cast< SwTwips >(m_aHeightED.DenormalizePercent(m_aHeightED.GetValue(FieldUnit::TWIP))); - if ( m_pFixedRatioCB->IsChecked() ) + SwTwips nWidth = static_cast< SwTwips >(m_xWidthED->DenormalizePercent(m_xWidthED->get_value(FieldUnit::TWIP))); + SwTwips nHeight = static_cast< SwTwips >(m_xHeightED->DenormalizePercent(m_xHeightED->get_value(FieldUnit::TWIP))); + if (m_xFixedRatioCB->get_active()) { - if (&rEdit == m_aWidthED.get()) + if (&rEdit == m_xWidthED->get()) { nHeight = SwTwips(static_cast<double>(nWidth) / m_fWidthHeightRatio); - m_aHeightED.SetPrcntValue(m_aHeightED.NormalizePercent(nHeight), FieldUnit::TWIP); + m_xHeightED->set_value(m_xHeightED->NormalizePercent(nHeight), FieldUnit::TWIP); } - else if (&rEdit == m_aHeightED.get()) + else if (&rEdit == m_xHeightED->get()) { nWidth = SwTwips(static_cast<double>(nHeight) * m_fWidthHeightRatio); - m_aWidthED.SetPrcntValue(m_aWidthED.NormalizePercent(nWidth), FieldUnit::TWIP); + m_xWidthED->set_value(m_xWidthED->NormalizePercent(nWidth), FieldUnit::TWIP); } } m_fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0; @@ -2120,32 +2053,32 @@ IMPL_LINK( SwFramePage, ModifyHdl, Edit&, rEdit, void ) void SwFramePage::UpdateExample() { - sal_Int32 nPos = m_pHorizontalDLB->GetSelectedEntryPos(); - if ( m_pHMap && nPos != LISTBOX_ENTRY_NOTFOUND ) + auto nPos = m_xHorizontalDLB->get_active(); + if (m_pHMap && nPos != -1) { - const sal_Int32 nMapPos = GetMapPos(m_pHMap, *m_pHorizontalDLB); - m_pExampleWN->SetHAlign(GetAlignment(m_pHMap, nMapPos, *m_pHoriRelationLB)); - m_pExampleWN->SetHoriRel(GetRelation(*m_pHoriRelationLB)); + const sal_Int32 nMapPos = GetMapPos(m_pHMap, *m_xHorizontalDLB); + m_aExampleWN.SetHAlign(GetAlignment(m_pHMap, nMapPos, *m_xHoriRelationLB)); + m_aExampleWN.SetHoriRel(GetRelation(*m_xHoriRelationLB)); } - nPos = m_pVerticalDLB->GetSelectedEntryPos(); - if ( m_pVMap && nPos != LISTBOX_ENTRY_NOTFOUND ) + nPos = m_xVerticalDLB->get_active(); + if (m_pVMap && nPos != -1) { - const sal_Int32 nMapPos = GetMapPos(m_pVMap, *m_pVerticalDLB); - m_pExampleWN->SetVAlign(GetAlignment(m_pVMap, nMapPos, *m_pVertRelationLB)); - m_pExampleWN->SetVertRel(GetRelation(*m_pVertRelationLB)); + const sal_Int32 nMapPos = GetMapPos(m_pVMap, *m_xVerticalDLB); + m_aExampleWN.SetVAlign(GetAlignment(m_pVMap, nMapPos, *m_xVertRelationLB)); + m_aExampleWN.SetVertRel(GetRelation(*m_xVertRelationLB)); } // size - long nXPos = static_cast< long >(m_pAtHorzPosED->Denormalize(m_pAtHorzPosED->GetValue(FieldUnit::TWIP))); - long nYPos = static_cast< long >(m_pAtVertPosED->Denormalize(m_pAtVertPosED->GetValue(FieldUnit::TWIP))); - m_pExampleWN->SetRelPos(Point(nXPos, nYPos)); + auto nXPos = m_xAtHorzPosED->denormalize(m_xAtHorzPosED->get_value(FieldUnit::TWIP)); + auto nYPos = m_xAtVertPosED->denormalize(m_xAtVertPosED->get_value(FieldUnit::TWIP)); + m_aExampleWN.SetRelPos(Point(nXPos, nYPos)); - m_pExampleWN->SetAnchor(GetAnchor()); - m_pExampleWN->Invalidate(); + m_aExampleWN.SetAnchor(GetAnchor()); + m_aExampleWN.Invalidate(); } -void SwFramePage::Init(const SfxItemSet& rSet, bool bReset) +void SwFramePage::Init(const SfxItemSet& rSet) { if(!m_bFormat) { @@ -2154,8 +2087,8 @@ void SwFramePage::Init(const SfxItemSet& rSet, bool bReset) // size const bool bSizeFixed = pSh->IsSelObjProtected( FlyProtectFlags::Fixed ) != FlyProtectFlags::NONE; - m_aWidthED .Enable( !bSizeFixed ); - m_aHeightED.Enable( !bSizeFixed ); + m_xWidthED->set_sensitive( !bSizeFixed ); + m_xHeightED->set_sensitive( !bSizeFixed ); // size controls for math OLE objects if ( m_sDlgType == "ObjectDialog" && ! m_bNew ) @@ -2178,78 +2111,60 @@ void SwFramePage::Init(const SfxItemSet& rSet, bool bReset) if( rFactNm == aGlbNm ) { // disable size controls for math OLE objects - m_pWidthFT->Disable(); - m_aWidthED.Disable(); - m_pRelWidthCB->Disable(); - m_pHeightFT->Disable(); - m_aHeightED.Disable(); - m_pRelHeightCB->Disable(); - m_pFixedRatioCB->Disable(); - m_pRealSizeBT->Disable(); + m_xWidthFT->set_sensitive(false); + m_xWidthED->set_sensitive(false); + m_xRelWidthCB->set_sensitive(false); + m_xHeightFT->set_sensitive(false); + m_xHeightED->set_sensitive(false); + m_xRelHeightCB->set_sensitive(false); + m_xFixedRatioCB->set_sensitive(false); + m_xRealSizeBT->set_sensitive(false); break; } } // TODO/LATER: get correct aspect if(0 != (pSh->GetOLEObject()->getStatus( embed::Aspects::MSOLE_CONTENT ) & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE ) ) - m_pRealSizeBT->Disable(); + m_xRealSizeBT->set_sensitive(false); } } const SwFormatFrameSize& rSize = rSet.Get(RES_FRM_SIZE); - sal_Int64 nWidth = m_aWidthED.NormalizePercent(rSize.GetWidth()); - sal_Int64 nHeight = m_aHeightED.NormalizePercent(rSize.GetHeight()); + sal_Int64 nWidth = m_xWidthED->NormalizePercent(rSize.GetWidth()); + sal_Int64 nHeight = m_xHeightED->NormalizePercent(rSize.GetHeight()); - if (nWidth != m_aWidthED.GetValue(FieldUnit::TWIP)) - { - if(!bReset) - { - // value was changed by circulation-Tabpage and - // has to be set with Modify-Flag - m_aWidthED.SetUserValue(nWidth, FieldUnit::TWIP); - } - else - m_aWidthED.SetPrcntValue(nWidth, FieldUnit::TWIP); - } + if (nWidth != m_xWidthED->get_value(FieldUnit::TWIP)) + m_xWidthED->set_value(nWidth, FieldUnit::TWIP); - if (nHeight != m_aHeightED.GetValue(FieldUnit::TWIP)) - { - if (!bReset) - { - // values was changed by circulation-Tabpage and - // has to be set with Modify-Flag - m_aHeightED.SetUserValue(nHeight, FieldUnit::TWIP); - } - else - m_aHeightED.SetPrcntValue(nHeight, FieldUnit::TWIP); - } + if (nHeight != m_xHeightED->get_value(FieldUnit::TWIP)) + m_xHeightED->set_value(nHeight, FieldUnit::TWIP); if (!IsInGraficMode()) { SwFrameSize eSize = rSize.GetHeightSizeType(); bool bCheck = eSize != ATT_FIX_SIZE; - m_pAutoHeightCB->Check( bCheck ); - HandleAutoCB( bCheck, *m_pHeightFT, *m_pHeightAutoFT, *m_aWidthED.get() ); + m_xAutoHeightCB->set_active(bCheck); + HandleAutoCB( bCheck, *m_xHeightFT, *m_xHeightAutoFT, *m_xWidthED->get() ); if( eSize == ATT_VAR_SIZE ) - m_aHeightED.SetValue( m_aHeightED.GetMin() ); + m_xHeightED->set_value(m_xHeightED->get_min()); eSize = rSize.GetWidthSizeType(); bCheck = eSize != ATT_FIX_SIZE; - m_pAutoWidthCB->Check( bCheck ); - HandleAutoCB( bCheck, *m_pWidthFT, *m_pWidthAutoFT, *m_aWidthED.get() ); + m_xAutoWidthCB->set_active(bCheck); + HandleAutoCB( bCheck, *m_xWidthFT, *m_xWidthAutoFT, *m_xWidthED->get() ); if( eSize == ATT_VAR_SIZE ) - m_aWidthED.SetValue( m_aWidthED.GetMin() ); + m_xWidthED->set_value(m_xWidthED->get_min()); if ( !m_bFormat ) { SwWrtShell* pSh = getFrameDlgParentShell(); const SwFrameFormat* pFormat = pSh->GetFlyFrameFormat(); if( pFormat && pFormat->GetChain().GetNext() ) - m_pAutoHeightCB->Enable( false ); + m_xAutoHeightCB->set_sensitive( false ); } } else - m_pAutoHeightCB->Hide(); + m_xAutoHeightCB->hide(); // organise circulation-gap for character bound frames const SvxULSpaceItem &rUL = rSet.Get(RES_UL_SPACE); @@ -2258,8 +2173,8 @@ void SwFramePage::Init(const SfxItemSet& rSet, bool bReset) if(SfxItemState::SET == rSet.GetItemState(FN_KEEP_ASPECT_RATIO)) { - m_pFixedRatioCB->Check(static_cast<const SfxBoolItem&>(rSet.Get(FN_KEEP_ASPECT_RATIO)).GetValue()); - m_pFixedRatioCB->SaveValue(); + m_xFixedRatioCB->set_active(static_cast<const SfxBoolItem&>(rSet.Get(FN_KEEP_ASPECT_RATIO)).GetValue()); + m_xFixedRatioCB->save_state(); } // columns @@ -2291,8 +2206,8 @@ void SwFramePage::Init(const SfxItemSet& rSet, bool bReset) m_nOldVRel = text::RelOrientation::PAGE_PRINT_AREA; } - m_pMirrorPagesCB->Check(rHori.IsPosToggle()); - m_pMirrorPagesCB->SaveValue(); + m_xMirrorPagesCB->set_active(rHori.IsPosToggle()); + m_xMirrorPagesCB->save_state(); InitPos(eAnchorId, m_nOldH, @@ -2306,65 +2221,63 @@ void SwFramePage::Init(const SfxItemSet& rSet, bool bReset) // transparent for example // circulation for example const SwFormatSurround& rSurround = rSet.Get(RES_SURROUND); - m_pExampleWN->SetWrap( rSurround.GetSurround() ); + m_aExampleWN.SetWrap( rSurround.GetSurround() ); if ( rSurround.GetSurround() == css::text::WrapTextMode_THROUGH ) { const SvxOpaqueItem& rOpaque = rSet.Get(RES_OPAQUE); - m_pExampleWN->SetTransparent(!rOpaque.GetValue()); + m_aExampleWN.SetTransparent(!rOpaque.GetValue()); } // switch to percent if applicable RangeModifyHdl(); // set reference values (for 100%) if (rSize.GetWidthPercent() == SwFormatFrameSize::SYNCED || rSize.GetHeightPercent() == SwFormatFrameSize::SYNCED) - m_pFixedRatioCB->Check(); + m_xFixedRatioCB->set_active(true); if (rSize.GetWidthPercent() && rSize.GetWidthPercent() != SwFormatFrameSize::SYNCED && - !m_pRelWidthCB->IsChecked()) + !m_xRelWidthCB->get_active()) { - m_pRelWidthCB->Check(); - RelSizeClickHdl(m_pRelWidthCB); - m_aWidthED.SetPrcntValue(rSize.GetWidthPercent(), FieldUnit::CUSTOM); + m_xRelWidthCB->set_active(true); + RelSizeClickHdl(*m_xRelWidthCB); + m_xWidthED->set_value(rSize.GetWidthPercent(), FieldUnit::PERCENT); } if (rSize.GetHeightPercent() && rSize.GetHeightPercent() != SwFormatFrameSize::SYNCED && - !m_pRelHeightCB->IsChecked()) + !m_xRelHeightCB->get_active()) { - m_pRelHeightCB->Check(); - RelSizeClickHdl(m_pRelHeightCB); - m_aHeightED.SetPrcntValue(rSize.GetHeightPercent(), FieldUnit::CUSTOM); + m_xRelHeightCB->set_active(true); + RelSizeClickHdl(*m_xRelHeightCB); + m_xHeightED->set_value(rSize.GetHeightPercent(), FieldUnit::PERCENT); } - m_pRelWidthCB->SaveValue(); - m_pRelHeightCB->SaveValue(); + m_xRelWidthCB->save_state(); + m_xRelHeightCB->save_state(); if (rSize.GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME) - m_pRelWidthRelationLB->SelectEntryPos(1); + m_xRelWidthRelationLB->set_active(1); else - m_pRelWidthRelationLB->SelectEntryPos(0); + m_xRelWidthRelationLB->set_active(0); if (rSize.GetHeightPercentRelation() == text::RelOrientation::PAGE_FRAME) - m_pRelHeightRelationLB->SelectEntryPos(1); + m_xRelHeightRelationLB->set_active(1); else - m_pRelHeightRelationLB->SelectEntryPos(0); + m_xRelHeightRelationLB->set_active(0); } void SwFramePage::SetFormatUsed(bool bFormatUsed) { m_bFormat = bFormatUsed; if (m_bFormat) - { - m_pAnchorFrame->Hide(); - } + m_xAnchorFrame->hide(); } void SwFramePage::EnableVerticalPositioning( bool bEnable ) { m_bAllowVertPositioning = bEnable; - m_pVerticalFT->Enable( bEnable ); - m_pVerticalDLB->Enable( bEnable ); - m_pAtVertPosFT->Enable( bEnable ); - m_pAtVertPosED->Enable( bEnable ); - m_pVertRelationFT->Enable( bEnable ); - m_pVertRelationLB->Enable( bEnable ); + m_xVerticalFT->set_sensitive( bEnable ); + m_xVerticalDLB->set_sensitive( bEnable ); + m_xAtVertPosFT->set_sensitive( bEnable ); + m_xAtVertPosED->set_sensitive( bEnable ); + m_xVertRelationFT->set_sensitive( bEnable ); + m_xVertRelationLB->set_sensitive( bEnable ); } SwGrfExtPage::SwGrfExtPage(TabPageParent pParent, const SfxItemSet &rSet) |