summaryrefslogtreecommitdiff
path: root/sfx2/source/appl
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/appl')
-rw-r--r--sfx2/source/appl/appopen.cxx4
-rw-r--r--sfx2/source/appl/fileobj.cxx2
-rw-r--r--sfx2/source/appl/fileobj.hxx2
-rw-r--r--sfx2/source/appl/impldde.cxx82
-rw-r--r--sfx2/source/appl/impldde.hxx2
-rw-r--r--sfx2/source/appl/linksrc.cxx2
-rw-r--r--sfx2/source/appl/lnkbase2.cxx6
-rw-r--r--sfx2/source/appl/opengrf.cxx8
-rw-r--r--sfx2/source/appl/shutdownicon.cxx2
9 files changed, 45 insertions, 65 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index e1cf3a6944a3..24bfc02def63 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -648,8 +648,8 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
if ( pBlackListItem )
pBlackListItem->GetStringList( aBlackList );
-
- ErrCode nErr = sfx2::FileOpenDialog_Impl(GetTopWindow(),
+ vcl::Window* pTopWindow = GetTopWindow();
+ ErrCode nErr = sfx2::FileOpenDialog_Impl(pTopWindow ? pTopWindow->GetFrameWeld() : nullptr,
nDialogType,
eDialogFlags, aURLList,
aFilter, pSet, &aPath, nDialog, sStandardDir, aBlackList);
diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx
index ebe5b37de43c..5918ba7a6c09 100644
--- a/sfx2/source/appl/fileobj.cxx
+++ b/sfx2/source/appl/fileobj.cxx
@@ -389,7 +389,7 @@ OUString impl_getFilter( const OUString& _rURL )
return sFilter;
}
-void SvFileObject::Edit(vcl::Window* pParent, sfx2::SvBaseLink* pLink, const Link<const OUString&, void>& rEndEditHdl)
+void SvFileObject::Edit(weld::Window* pParent, sfx2::SvBaseLink* pLink, const Link<const OUString&, void>& rEndEditHdl)
{
aEndEditLink = rEndEditHdl;
OUString sFile, sRange, sTmpFilter;
diff --git a/sfx2/source/appl/fileobj.hxx b/sfx2/source/appl/fileobj.hxx
index 1b735e0c4414..f55e7885713d 100644
--- a/sfx2/source/appl/fileobj.hxx
+++ b/sfx2/source/appl/fileobj.hxx
@@ -68,7 +68,7 @@ public:
bool bSynchron = false ) override;
virtual bool Connect( sfx2::SvBaseLink* ) override;
- virtual void Edit( vcl::Window *, sfx2::SvBaseLink *, const Link<const OUString&, void>& rEndEditHdl ) override;
+ virtual void Edit(weld::Window *, sfx2::SvBaseLink *, const Link<const OUString&, void>& rEndEditHdl) override;
// Ask whether you can access data directly or whether it has to be triggered
virtual bool IsPending() const override;
diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx
index 280cd6da21c1..9280b36381c8 100644
--- a/sfx2/source/appl/impldde.cxx
+++ b/sfx2/source/appl/impldde.cxx
@@ -27,10 +27,7 @@
#include <comphelper/string.hxx>
#include <vcl/svapp.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/button.hxx>
-#include <vcl/dialog.hxx>
+#include <vcl/weld.hxx>
#include <sot/exchange.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustring.hxx>
@@ -52,69 +49,52 @@ using namespace ::com::sun::star::uno;
namespace sfx2
{
-class SvDDELinkEditDialog : public ModalDialog
+class SvDDELinkEditDialog : public weld::GenericDialogController
{
- VclPtr<Edit> m_pEdDdeApp;
- VclPtr<Edit> m_pEdDdeTopic;
- VclPtr<Edit> m_pEdDdeItem;
- VclPtr<OKButton> m_pOKButton;
+ std::unique_ptr<weld::Entry> m_xEdDdeApp;
+ std::unique_ptr<weld::Entry> m_xEdDdeTopic;
+ std::unique_ptr<weld::Entry> m_xEdDdeItem;
+ std::unique_ptr<weld::Button> m_xOKButton;
- DECL_LINK( EditHdl_Impl, Edit&, void );
+ DECL_LINK(EditHdl_Impl, weld::Entry&, void);
public:
- SvDDELinkEditDialog( vcl::Window* pParent, SvBaseLink const * );
- virtual ~SvDDELinkEditDialog() override;
- virtual void dispose() override;
+ SvDDELinkEditDialog(weld::Window* pParent, SvBaseLink const*);
OUString GetCmd() const;
};
-SvDDELinkEditDialog::SvDDELinkEditDialog( vcl::Window* pParent, SvBaseLink const * pLink )
- : ModalDialog( pParent, "LinkEditDialog", "sfx/ui/linkeditdialog.ui" )
+SvDDELinkEditDialog::SvDDELinkEditDialog(weld::Window* pParent, SvBaseLink const * pLink)
+ : GenericDialogController(pParent, "sfx/ui/linkeditdialog.ui", "LinkEditDialog")
+ , m_xEdDdeApp(m_xBuilder->weld_entry("app"))
+ , m_xEdDdeTopic(m_xBuilder->weld_entry("file"))
+ , m_xEdDdeItem(m_xBuilder->weld_entry("category"))
+ , m_xOKButton(m_xBuilder->weld_button("ok"))
{
- get(m_pOKButton, "ok");
- get(m_pEdDdeApp, "app");
- get(m_pEdDdeTopic, "file");
- get(m_pEdDdeItem, "category");
-
OUString sServer, sTopic, sItem;
sfx2::LinkManager::GetDisplayNames( pLink, &sServer, &sTopic, &sItem );
- m_pEdDdeApp->SetText( sServer );
- m_pEdDdeTopic->SetText( sTopic );
- m_pEdDdeItem->SetText( sItem );
-
- m_pEdDdeApp->SetModifyHdl( LINK( this, SvDDELinkEditDialog, EditHdl_Impl));
- m_pEdDdeTopic->SetModifyHdl( LINK( this, SvDDELinkEditDialog, EditHdl_Impl));
- m_pEdDdeItem->SetModifyHdl( LINK( this, SvDDELinkEditDialog, EditHdl_Impl));
+ m_xEdDdeApp->set_text( sServer );
+ m_xEdDdeTopic->set_text( sTopic );
+ m_xEdDdeItem->set_text( sItem );
- m_pOKButton->Enable( !sServer.isEmpty() && !sTopic.isEmpty() && !sItem.isEmpty() );
-}
+ m_xEdDdeApp->connect_changed( LINK( this, SvDDELinkEditDialog, EditHdl_Impl));
+ m_xEdDdeTopic->connect_changed( LINK( this, SvDDELinkEditDialog, EditHdl_Impl));
+ m_xEdDdeItem->connect_changed( LINK( this, SvDDELinkEditDialog, EditHdl_Impl));
-SvDDELinkEditDialog::~SvDDELinkEditDialog()
-{
- disposeOnce();
-}
-
-void SvDDELinkEditDialog::dispose()
-{
- m_pEdDdeApp.clear();
- m_pEdDdeTopic.clear();
- m_pEdDdeItem.clear();
- m_pOKButton.clear();
- ModalDialog::dispose();
+ m_xOKButton->set_sensitive(!sServer.isEmpty() && !sTopic.isEmpty() && !sItem.isEmpty());
}
OUString SvDDELinkEditDialog::GetCmd() const
{
- OUString sCmd( m_pEdDdeApp->GetText() ), sRet;
- ::sfx2::MakeLnkName( sRet, &sCmd, m_pEdDdeTopic->GetText(), m_pEdDdeItem->GetText() );
+ OUString sCmd( m_xEdDdeApp->get_text() ), sRet;
+ ::sfx2::MakeLnkName( sRet, &sCmd, m_xEdDdeTopic->get_text(), m_xEdDdeItem->get_text() );
return sRet;
}
-IMPL_LINK_NOARG( SvDDELinkEditDialog, EditHdl_Impl, Edit&, void)
+IMPL_LINK_NOARG( SvDDELinkEditDialog, EditHdl_Impl, weld::Entry&, void)
{
- m_pOKButton->Enable( !m_pEdDdeApp->GetText().isEmpty() &&
- !m_pEdDdeTopic->GetText().isEmpty() &&
- !m_pEdDdeItem->GetText().isEmpty() );
+ m_xOKButton->set_sensitive(!m_xEdDdeApp->get_text().isEmpty() &&
+ !m_xEdDdeTopic->get_text().isEmpty() &&
+ !m_xEdDdeItem->get_text().isEmpty() );
}
SvDDEObject::SvDDEObject()
@@ -251,12 +231,12 @@ bool SvDDEObject::Connect( SvBaseLink * pSvLink )
return true;
}
-void SvDDEObject::Edit( vcl::Window* pParent, sfx2::SvBaseLink* pBaseLink, const Link<const OUString&, void>& rEndEditHdl )
+void SvDDEObject::Edit(weld::Window* pParent, sfx2::SvBaseLink* pBaseLink, const Link<const OUString&, void>& rEndEditHdl)
{
- ScopedVclPtrInstance< SvDDELinkEditDialog > aDlg(pParent, pBaseLink);
- if ( RET_OK == aDlg->Execute() && rEndEditHdl.IsSet() )
+ SvDDELinkEditDialog aDlg(pParent, pBaseLink);
+ if (RET_OK == aDlg.run() && rEndEditHdl.IsSet())
{
- OUString sCommand = aDlg->GetCmd();
+ OUString sCommand = aDlg.GetCmd();
rEndEditHdl.Call( sCommand );
}
}
diff --git a/sfx2/source/appl/impldde.hxx b/sfx2/source/appl/impldde.hxx
index d161a783fa61..68bb0cd113d2 100644
--- a/sfx2/source/appl/impldde.hxx
+++ b/sfx2/source/appl/impldde.hxx
@@ -58,7 +58,7 @@ public:
bool bSynchron = false ) override;
virtual bool Connect( SvBaseLink * ) override;
- virtual void Edit( vcl::Window* pParent, sfx2::SvBaseLink* pBaseLink, const Link<const OUString&, void>& rEndEditHdl ) override;
+ virtual void Edit(weld::Window* pParent, sfx2::SvBaseLink* pBaseLink, const Link<const OUString&, void>& rEndEditHdl) override;
virtual bool IsPending() const override;
virtual bool IsDataComplete() const override;
diff --git a/sfx2/source/appl/linksrc.cxx b/sfx2/source/appl/linksrc.cxx
index ca97b745a814..6d172d202f79 100644
--- a/sfx2/source/appl/linksrc.cxx
+++ b/sfx2/source/appl/linksrc.cxx
@@ -404,7 +404,7 @@ bool SvLinkSource::GetData( css::uno::Any &, const OUString &, bool )
return false;
}
-void SvLinkSource::Edit( vcl::Window *, SvBaseLink *, const Link<const OUString&, void>& )
+void SvLinkSource::Edit(weld::Window *, SvBaseLink *, const Link<const OUString&, void>&)
{
}
diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx
index 82c6129b11bf..1c5b6154db73 100644
--- a/sfx2/source/appl/lnkbase2.cxx
+++ b/sfx2/source/appl/lnkbase2.cxx
@@ -47,7 +47,7 @@ struct BaseLink_Impl
{
Link<SvBaseLink&,void> m_aEndEditLink;
LinkManager* m_pLinkMgr;
- VclPtr<vcl::Window> m_pParentWin;
+ weld::Window* m_pParentWin;
std::unique_ptr<FileDialogHelper>
m_pFileDlg;
bool m_bIsConnect;
@@ -447,7 +447,7 @@ SvBaseLink::UpdateResult SvBaseLink::DataChanged( const OUString &, const css::u
return SUCCESS;
}
-void SvBaseLink::Edit( vcl::Window* pParent, const Link<SvBaseLink&,void>& rEndEditHdl )
+void SvBaseLink::Edit(weld::Window* pParent, const Link<SvBaseLink&,void>& rEndEditHdl )
{
pImpl->m_pParentWin = pParent;
pImpl->m_aEndEditLink = rEndEditHdl;
@@ -516,7 +516,7 @@ bool SvBaseLink::ExecuteEdit( const OUString& _rNewName )
else
return false;
- std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pImpl->m_pParentWin->GetFrameWeld(),
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pImpl->m_pParentWin,
VclMessageType::Warning, VclButtonsType::Ok, sError));
xBox->run();
}
diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx
index a43d8eb53100..d1775a8a5940 100644
--- a/sfx2/source/appl/opengrf.cxx
+++ b/sfx2/source/appl/opengrf.cxx
@@ -70,7 +70,7 @@ const char* SvxOpenGrfErr2ResId( ErrCode err )
struct SvxOpenGrf_Impl
{
- SvxOpenGrf_Impl(const vcl::Window* pPreferredParent,
+ SvxOpenGrf_Impl(weld::Window* pPreferredParent,
sal_Int16 nDialogType);
sfx2::FileDialogHelper aFileDlg;
@@ -79,7 +79,7 @@ struct SvxOpenGrf_Impl
};
-SvxOpenGrf_Impl::SvxOpenGrf_Impl(const vcl::Window* pPreferredParent,
+SvxOpenGrf_Impl::SvxOpenGrf_Impl(weld::Window* pPreferredParent,
sal_Int16 nDialogType)
: aFileDlg(nDialogType, FileDialogFlags::Graphic, pPreferredParent)
{
@@ -88,13 +88,13 @@ SvxOpenGrf_Impl::SvxOpenGrf_Impl(const vcl::Window* pPreferredParent,
}
-SvxOpenGraphicDialog::SvxOpenGraphicDialog(const OUString& rTitle, const vcl::Window* pPreferredParent)
+SvxOpenGraphicDialog::SvxOpenGraphicDialog(const OUString& rTitle, weld::Window* pPreferredParent)
: mpImpl(new SvxOpenGrf_Impl(pPreferredParent, ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW))
{
mpImpl->aFileDlg.SetTitle(rTitle);
}
-SvxOpenGraphicDialog::SvxOpenGraphicDialog(const OUString& rTitle, const vcl::Window* pPreferredParent,
+SvxOpenGraphicDialog::SvxOpenGraphicDialog(const OUString& rTitle, weld::Window* pPreferredParent,
sal_Int16 nDialogType)
: mpImpl(new SvxOpenGrf_Impl(pPreferredParent, nDialogType))
{
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index 60b279fe2d0a..be129dabac5f 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -329,7 +329,7 @@ void ShutdownIcon::StartFileDialog()
if ( !m_pFileDlg )
m_pFileDlg = new FileDialogHelper(
ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION,
- FileDialogFlags::MultiSelection, OUString(), SfxFilterFlags::NONE, SfxFilterFlags::NONE, static_cast<const vcl::Window*>(nullptr) );
+ FileDialogFlags::MultiSelection, OUString(), SfxFilterFlags::NONE, SfxFilterFlags::NONE, nullptr );
m_pFileDlg->StartExecuteModal( LINK( this, ShutdownIcon, DialogClosedHdl_Impl ) );
}