summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/tbxctrls/fontworkgallery.cxx18
-rw-r--r--svx/source/toolbars/fontworkbar.cxx8
2 files changed, 9 insertions, 17 deletions
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index 65243aad0fc2..700a0c852bc8 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -624,28 +624,20 @@ com_sun_star_comp_svx_FontworkCharacterSpacingControl_get_implementation(
return cppu::acquire(new FontworkCharacterSpacingControl(xContext));
}
-
-FontworkCharacterSpacingDialog::FontworkCharacterSpacingDialog( vcl::Window* pParent, sal_Int32 nScale )
-: ModalDialog( pParent, "FontworkSpacingDialog" , "svx/ui/fontworkspacingdialog.ui" )
+FontworkCharacterSpacingDialog::FontworkCharacterSpacingDialog(weld::Window* pParent, sal_Int32 nScale)
+ : GenericDialogController(pParent, "svx/ui/fontworkspacingdialog.ui", "FontworkSpacingDialog")
+ , m_xMtrScale(m_xBuilder->weld_metric_spin_button("entry", FUNIT_PERCENT))
{
- get(m_pMtrScale, "entry");
- m_pMtrScale->SetValue( nScale );
+ m_xMtrScale->set_value(nScale, FUNIT_PERCENT);
}
FontworkCharacterSpacingDialog::~FontworkCharacterSpacingDialog()
{
- disposeOnce();
-}
-
-void FontworkCharacterSpacingDialog::dispose()
-{
- m_pMtrScale.clear();
- ModalDialog::dispose();
}
sal_Int32 FontworkCharacterSpacingDialog::getScale() const
{
- return static_cast<sal_Int32>(m_pMtrScale->GetValue());
+ return static_cast<sal_Int32>(m_xMtrScale->get_value(FUNIT_PERCENT));
}
}
diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx
index f5283818191b..90b05316fdc0 100644
--- a/svx/source/toolbars/fontworkbar.cxx
+++ b/svx/source/toolbars/fontworkbar.cxx
@@ -471,11 +471,11 @@ void FontworkBar::execute( SdrView* pSdrView, SfxRequest const & rReq, SfxBindin
if( rReq.GetArgs() && ( rReq.GetArgs()->GetItemState( SID_FONTWORK_CHARACTER_SPACING ) == SfxItemState::SET ) )
{
sal_Int32 nCharSpacing = rReq.GetArgs()->GetItem<SfxInt32Item>(SID_FONTWORK_CHARACTER_SPACING)->GetValue();
- ScopedVclPtrInstance< FontworkCharacterSpacingDialog > aDlg( nullptr, nCharSpacing );
- sal_uInt16 nRet = aDlg->Execute();
- if( nRet != 0 )
+ FontworkCharacterSpacingDialog aDlg(rReq.GetFrameWeld(), nCharSpacing);
+ sal_uInt16 nRet = aDlg.run();
+ if (nRet != RET_CANCEL)
{
- SfxInt32Item aItem( SID_FONTWORK_CHARACTER_SPACING, aDlg->getScale() );
+ SfxInt32Item aItem(SID_FONTWORK_CHARACTER_SPACING, aDlg.getScale());
SfxPoolItem* aItems[] = { &aItem, nullptr };
rBindings.Execute( SID_FONTWORK_CHARACTER_SPACING, const_cast<const SfxPoolItem**>(aItems) );
}