summaryrefslogtreecommitdiffstats
path: root/filter/source/flash
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-06 19:53:54 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-10-06 21:58:26 +0200
commit0e257f8c07de253c0a1d4e63dfdf0383bd658fab (patch)
tree4171476771e2539a2de89c03cb3f2e8e3a1488ca /filter/source/flash
parentweld FontWorkGalleryDialog (diff)
downloadcore-0e257f8c07de253c0a1d4e63dfdf0383bd658fab.tar.gz
core-0e257f8c07de253c0a1d4e63dfdf0383bd658fab.zip
weld ImpSWFDialog
Change-Id: I0650ab2b95eddde0337b1d65e957a58083d993bf Reviewed-on: https://gerrit.libreoffice.org/61477 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'filter/source/flash')
-rw-r--r--filter/source/flash/impswfdialog.cxx87
-rw-r--r--filter/source/flash/impswfdialog.hxx38
-rw-r--r--filter/source/flash/swfdialog.cxx19
3 files changed, 50 insertions, 94 deletions
diff --git a/filter/source/flash/impswfdialog.cxx b/filter/source/flash/impswfdialog.cxx
index ea920709901a..b12febde0cb5 100644
--- a/filter/source/flash/impswfdialog.cxx
+++ b/filter/source/flash/impswfdialog.cxx
@@ -24,83 +24,58 @@ using namespace com::sun::star::uno;
using namespace com::sun::star::beans;
-ImpSWFDialog::ImpSWFDialog( vcl::Window* pParent, Sequence< PropertyValue >& rFilterData ) :
- ModalDialog( pParent, "ImpSWFDialog", "filter/ui/impswfdialog.ui" ),
-
- maConfigItem( "Office.Common/Filter/Flash/Export/", &rFilterData )
+ImpSWFDialog::ImpSWFDialog(weld::Window* pParent, Sequence< PropertyValue >& rFilterData)
+ : GenericDialogController(pParent, "filter/ui/impswfdialog.ui", "ImpSWFDialog")
+ , maConfigItem("Office.Common/Filter/Flash/Export/", &rFilterData)
+ , mxNumFldQuality(m_xBuilder->weld_spin_button("quality"))
+ , mxCheckExportAll(m_xBuilder->weld_check_button("exportall"))
+ , mxCheckExportBackgrounds(m_xBuilder->weld_check_button("exportbackgrounds"))
+ , mxCheckExportBackgroundObjects(m_xBuilder->weld_check_button("exportbackgroundobjects"))
+ , mxCheckExportSlideContents(m_xBuilder->weld_check_button("exportslidecontents"))
+ , mxCheckExportSound(m_xBuilder->weld_check_button("exportsound"))
+ , mxCheckExportOLEAsJPEG(m_xBuilder->weld_check_button("exportoleasjpeg"))
+ , mxCheckExportMultipleFiles(m_xBuilder->weld_check_button("exportmultiplefiles"))
{
- get(mpNumFldQuality,"quality");
- get(mpCheckExportAll,"exportall");
- get(mpCheckExportMultipleFiles,"exportmultiplefiles");
- get(mpCheckExportBackgrounds,"exportbackgrounds");
- get(mpCheckExportBackgroundObjects,"exportbackgroundobjects");
- get(mpCheckExportSlideContents,"exportslidecontents");
- get(mpCheckExportSound,"exportsound");
- get(mpCheckExportOLEAsJPEG,"exportoleasjpeg");
-
const sal_uLong nCompressMode = maConfigItem.ReadInt32( "CompressMode", 75 );
- mpNumFldQuality->SetValue( nCompressMode );
+ mxNumFldQuality->set_value(nCompressMode);
- mpCheckExportAll->Check();
- mpCheckExportSlideContents->Check();
- mpCheckExportSound->Check();
+ mxCheckExportAll->set_active(true);
+ mxCheckExportSlideContents->set_active(true);
+ mxCheckExportSound->set_active(true);
- mpCheckExportAll->SetToggleHdl( LINK( this, ImpSWFDialog, OnToggleCheckbox ) );
+ mxCheckExportAll->connect_toggled(LINK(this, ImpSWFDialog, OnToggleCheckbox));
- mpCheckExportBackgrounds->Disable();
- mpCheckExportBackgroundObjects->Disable();
- mpCheckExportSlideContents->Disable();
+ mxCheckExportBackgrounds->set_sensitive(false);
+ mxCheckExportBackgroundObjects->set_sensitive(false);
+ mxCheckExportSlideContents->set_sensitive(false);
}
-
ImpSWFDialog::~ImpSWFDialog()
{
- disposeOnce();
}
-
-void ImpSWFDialog::dispose()
-{
- mpNumFldQuality.clear();
- mpCheckExportAll.clear();
- mpCheckExportBackgrounds.clear();
- mpCheckExportBackgroundObjects.clear();
- mpCheckExportSlideContents.clear();
- mpCheckExportSound.clear();
- mpCheckExportOLEAsJPEG.clear();
- mpCheckExportMultipleFiles.clear();
- maConfigItem.WriteModifiedConfig();
- ModalDialog::dispose();
-}
-
-
Sequence< PropertyValue > ImpSWFDialog::GetFilterData()
{
- sal_Int32 nCompressMode = static_cast<sal_Int32>(mpNumFldQuality->GetValue());
+ sal_Int32 nCompressMode = static_cast<sal_Int32>(mxNumFldQuality->get_value());
maConfigItem.WriteInt32( "CompressMode" , nCompressMode );
- maConfigItem.WriteBool( "ExportAll", mpCheckExportAll->IsChecked() );
- maConfigItem.WriteBool( "ExportBackgrounds", mpCheckExportBackgrounds->IsChecked() );
- maConfigItem.WriteBool( "ExportBackgroundObjects", mpCheckExportBackgroundObjects->IsChecked() );
- maConfigItem.WriteBool( "ExportSlideContents", mpCheckExportSlideContents->IsChecked() );
- maConfigItem.WriteBool( "ExportSound", mpCheckExportSound->IsChecked() );
- maConfigItem.WriteBool( "ExportOLEAsJPEG", mpCheckExportOLEAsJPEG->IsChecked() );
- maConfigItem.WriteBool( "ExportMultipleFiles", mpCheckExportMultipleFiles->IsChecked() );
+ maConfigItem.WriteBool( "ExportAll", mxCheckExportAll->get_active() );
+ maConfigItem.WriteBool( "ExportBackgrounds", mxCheckExportBackgrounds->get_active() );
+ maConfigItem.WriteBool( "ExportBackgroundObjects", mxCheckExportBackgroundObjects->get_active() );
+ maConfigItem.WriteBool( "ExportSlideContents", mxCheckExportSlideContents->get_active() );
+ maConfigItem.WriteBool( "ExportSound", mxCheckExportSound->get_active() );
+ maConfigItem.WriteBool( "ExportOLEAsJPEG", mxCheckExportOLEAsJPEG->get_active() );
+ maConfigItem.WriteBool( "ExportMultipleFiles", mxCheckExportMultipleFiles->get_active() );
Sequence< PropertyValue > aRet( maConfigItem.GetFilterData() );
return aRet;
}
-
-/// This is called whenever the user toggles one of the checkboxes
-IMPL_LINK( ImpSWFDialog, OnToggleCheckbox, CheckBox&, rBox, void )
+IMPL_LINK_NOARG(ImpSWFDialog, OnToggleCheckbox, weld::ToggleButton&, void)
{
- if (&rBox == mpCheckExportAll)
- {
- mpCheckExportBackgrounds->Enable(!mpCheckExportBackgrounds->IsEnabled());
- mpCheckExportBackgroundObjects->Enable(!mpCheckExportBackgroundObjects->IsEnabled());
- mpCheckExportSlideContents->Enable(!mpCheckExportSlideContents->IsEnabled());
- }
+ mxCheckExportBackgrounds->set_sensitive(!mxCheckExportBackgrounds->get_sensitive());
+ mxCheckExportBackgroundObjects->set_sensitive(!mxCheckExportBackgroundObjects->get_sensitive());
+ mxCheckExportSlideContents->set_sensitive(!mxCheckExportSlideContents->get_sensitive());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/flash/impswfdialog.hxx b/filter/source/flash/impswfdialog.hxx
index 5dfe84de0d13..d299c4924a51 100644
--- a/filter/source/flash/impswfdialog.hxx
+++ b/filter/source/flash/impswfdialog.hxx
@@ -22,39 +22,29 @@
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/beans/PropertyValue.hpp>
-
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-
#include <vcl/FilterConfigItem.hxx>
+#include <vcl/weld.hxx>
-
-namespace vcl { class Window; }
-
-
-class ImpSWFDialog : public ModalDialog
+class ImpSWFDialog : public weld::GenericDialogController
{
private:
- VclPtr<NumericField> mpNumFldQuality;
- VclPtr<CheckBox> mpCheckExportAll;
- VclPtr<CheckBox> mpCheckExportBackgrounds;
- VclPtr<CheckBox> mpCheckExportBackgroundObjects;
- VclPtr<CheckBox> mpCheckExportSlideContents;
- VclPtr<CheckBox> mpCheckExportSound;
- VclPtr<CheckBox> mpCheckExportOLEAsJPEG;
- VclPtr<CheckBox> mpCheckExportMultipleFiles;
-
FilterConfigItem maConfigItem;
- DECL_LINK( OnToggleCheckbox, CheckBox&, void );
+ std::unique_ptr<weld::SpinButton> mxNumFldQuality;
+ std::unique_ptr<weld::CheckButton> mxCheckExportAll;
+ std::unique_ptr<weld::CheckButton> mxCheckExportBackgrounds;
+ std::unique_ptr<weld::CheckButton> mxCheckExportBackgroundObjects;
+ std::unique_ptr<weld::CheckButton> mxCheckExportSlideContents;
+ std::unique_ptr<weld::CheckButton> mxCheckExportSound;
+ std::unique_ptr<weld::CheckButton> mxCheckExportOLEAsJPEG;
+ std::unique_ptr<weld::CheckButton> mxCheckExportMultipleFiles;
+
+ DECL_LINK(OnToggleCheckbox, weld::ToggleButton&, void);
public:
- ImpSWFDialog( vcl::Window* pParent,
- css::uno::Sequence< css::beans::PropertyValue >& rFilterData );
+ ImpSWFDialog(weld::Window* pParent,
+ css::uno::Sequence< css::beans::PropertyValue >& rFilterData );
virtual ~ImpSWFDialog() override;
- virtual void dispose() override;
css::uno::Sequence< css::beans::PropertyValue > GetFilterData();
};
diff --git a/filter/source/flash/swfdialog.cxx b/filter/source/flash/swfdialog.cxx
index 92940f111f00..a04aede0add8 100644
--- a/filter/source/flash/swfdialog.cxx
+++ b/filter/source/flash/swfdialog.cxx
@@ -21,15 +21,13 @@
#include "swfdialog.hxx"
#include "swfuno.hxx"
#include "impswfdialog.hxx"
-#include <vcl/svapp.hxx>
-#include <vcl/dialog.hxx>
#include <svl/solar.hrc>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <com/sun/star/view/XRenderable.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
-#include <toolkit/helper/vclunohelper.hxx>
+#include <vcl/svapp.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -111,16 +109,14 @@ OUString SAL_CALL SWFDialog::getImplementationName()
return SWFDialog_getImplementationName();
}
-
Sequence< OUString > SAL_CALL SWFDialog::getSupportedServiceNames()
{
return SWFDialog_getSupportedServiceNames();
}
-
svt::OGenericUnoDialog::Dialog SWFDialog::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
{
- VclPtr<::Dialog> pRet;
+ std::unique_ptr<weld::DialogController> xRet;
if (mxSrcDoc.is())
{
@@ -144,35 +140,31 @@ svt::OGenericUnoDialog::Dialog SWFDialog::createDialog(const css::uno::Reference
{
}
*/
- pRet.reset(VclPtr<ImpSWFDialog>::Create(VCLUnoHelper::GetWindow(rParent), maFilterData));
+ xRet.reset(new ImpSWFDialog(Application::GetFrameWeld(rParent), maFilterData));
}
- return svt::OGenericUnoDialog::Dialog(pRet);
+ return svt::OGenericUnoDialog::Dialog(std::move(xRet));
}
-
void SWFDialog::executedDialog( sal_Int16 nExecutionResult )
{
if (nExecutionResult && m_aDialog)
- maFilterData = static_cast< ImpSWFDialog* >(m_aDialog.m_xVclDialog.get())->GetFilterData();
+ maFilterData = static_cast<ImpSWFDialog*>(m_aDialog.m_xWeldDialog.get())->GetFilterData();
destroyDialog();
}
-
Reference< XPropertySetInfo > SAL_CALL SWFDialog::getPropertySetInfo()
{
Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
return xInfo;
}
-
::cppu::IPropertyArrayHelper& SWFDialog::getInfoHelper()
{
return *getArrayHelper();
}
-
::cppu::IPropertyArrayHelper* SWFDialog::createArrayHelper() const
{
Sequence< Property > aProps;
@@ -180,7 +172,6 @@ Reference< XPropertySetInfo > SAL_CALL SWFDialog::getPropertySetInfo()
return new ::cppu::OPropertyArrayHelper( aProps );
}
-
Sequence< PropertyValue > SAL_CALL SWFDialog::getPropertyValues()
{
sal_Int32 i, nCount;