Kaydet (Commit) bd0d2321 authored tarafından Caolán McNamara's avatar Caolán McNamara

prefer weld::Window variants

Change-Id: I4938ea338a71e3c83d4d847317ba49b9c7088561
Reviewed-on: https://gerrit.libreoffice.org/69116
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst ee96edf8
...@@ -2307,7 +2307,7 @@ namespace pcr ...@@ -2307,7 +2307,7 @@ namespace pcr
clearContainer( _rFieldNames ); clearContainer( _rFieldNames );
try try
{ {
WaitCursor aWaitCursor( impl_getDefaultDialogParent_nothrow() ); weld::WaitObject aWaitCursor(impl_getDefaultDialogFrame_nothrow());
// get the form of the control we're inspecting // get the form of the control we're inspecting
Reference< XPropertySet > xFormSet( impl_getRowSet_throw(), UNO_QUERY ); Reference< XPropertySet > xFormSet( impl_getRowSet_throw(), UNO_QUERY );
...@@ -2363,7 +2363,7 @@ namespace pcr ...@@ -2363,7 +2363,7 @@ namespace pcr
{ {
if ( xRowSetProps.is() ) if ( xRowSetProps.is() )
{ {
WaitCursor aWaitCursor( impl_getDefaultDialogParent_nothrow() ); weld::WaitObject aWaitCursor(impl_getDefaultDialogFrame_nothrow());
m_xRowSetConnection = ::dbtools::ensureRowSetConnection( xRowSet, m_xContext ); m_xRowSetConnection = ::dbtools::ensureRowSetConnection( xRowSet, m_xContext );
} }
} }
...@@ -2403,7 +2403,7 @@ namespace pcr ...@@ -2403,7 +2403,7 @@ namespace pcr
{ {
try try
{ {
WaitCursor aWaitCursor( impl_getDefaultDialogParent_nothrow() ); weld::WaitObject aWaitCursor(impl_getDefaultDialogFrame_nothrow());
// Set the UI data // Set the UI data
...@@ -2716,10 +2716,10 @@ namespace pcr ...@@ -2716,10 +2716,10 @@ namespace pcr
bool bIsLink = true;// reflect the legacy behavior bool bIsLink = true;// reflect the legacy behavior
OUString aStrTrans = m_pInfoService->getPropertyTranslation( PROPERTY_ID_IMAGE_URL ); OUString aStrTrans = m_pInfoService->getPropertyTranslation( PROPERTY_ID_IMAGE_URL );
vcl::Window* pWin = impl_getDefaultDialogParent_nothrow(); weld::Window* pWin = impl_getDefaultDialogFrame_nothrow();
::sfx2::FileDialogHelper aFileDlg( ::sfx2::FileDialogHelper aFileDlg(
ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW, ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW,
FileDialogFlags::Graphic, pWin ? pWin->GetFrameWeld() : nullptr); FileDialogFlags::Graphic, pWin);
aFileDlg.SetTitle(aStrTrans); aFileDlg.SetTitle(aStrTrans);
// non-linked images ( e.g. those located in the document // non-linked images ( e.g. those located in the document
...@@ -2783,10 +2783,10 @@ namespace pcr ...@@ -2783,10 +2783,10 @@ namespace pcr
bool FormComponentPropertyHandler::impl_browseForTargetURL_nothrow( Any& _out_rNewValue, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const bool FormComponentPropertyHandler::impl_browseForTargetURL_nothrow( Any& _out_rNewValue, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const
{ {
vcl::Window* pWin = impl_getDefaultDialogParent_nothrow(); weld::Window* pWin = impl_getDefaultDialogFrame_nothrow();
::sfx2::FileDialogHelper aFileDlg( ::sfx2::FileDialogHelper aFileDlg(
ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION,
FileDialogFlags::NONE, pWin ? pWin->GetFrameWeld() : nullptr); FileDialogFlags::NONE, pWin);
OUString sURL; OUString sURL;
OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_TARGET_URL ) >>= sURL ); OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_TARGET_URL ) >>= sURL );
...@@ -2838,10 +2838,10 @@ namespace pcr ...@@ -2838,10 +2838,10 @@ namespace pcr
bool FormComponentPropertyHandler::impl_browseForDatabaseDocument_throw( Any& _out_rNewValue, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const bool FormComponentPropertyHandler::impl_browseForDatabaseDocument_throw( Any& _out_rNewValue, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const
{ {
vcl::Window* pWin = impl_getDefaultDialogParent_nothrow(); weld::Window* pWin = impl_getDefaultDialogFrame_nothrow();
::sfx2::FileDialogHelper aFileDlg( ::sfx2::FileDialogHelper aFileDlg(
ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, FileDialogFlags::NONE, ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION, FileDialogFlags::NONE,
"sdatabase", SfxFilterFlags::NONE, SfxFilterFlags::NONE, pWin ? pWin->GetFrameWeld() : nullptr); "sdatabase", SfxFilterFlags::NONE, SfxFilterFlags::NONE, pWin);
OUString sDataSource; OUString sDataSource;
OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_DATASOURCE ) >>= sDataSource ); OSL_VERIFY( impl_getPropertyValue_throw( PROPERTY_DATASOURCE ) >>= sDataSource );
...@@ -2866,7 +2866,6 @@ namespace pcr ...@@ -2866,7 +2866,6 @@ namespace pcr
return bSuccess; return bSuccess;
} }
bool FormComponentPropertyHandler::impl_dialogColorChooser_throw( sal_Int32 _nColorPropertyId, Any& _out_rNewValue, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const bool FormComponentPropertyHandler::impl_dialogColorChooser_throw( sal_Int32 _nColorPropertyId, Any& _out_rNewValue, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const
{ {
::Color aColor; ::Color aColor;
...@@ -2875,19 +2874,18 @@ namespace pcr ...@@ -2875,19 +2874,18 @@ namespace pcr
aColorDlg.SetColor( aColor ); aColorDlg.SetColor( aColor );
_rClearBeforeDialog.clear(); _rClearBeforeDialog.clear();
vcl::Window* pParent = impl_getDefaultDialogParent_nothrow(); weld::Window* pParent = impl_getDefaultDialogFrame_nothrow();
if (!aColorDlg.Execute(pParent ? pParent->GetFrameWeld() : nullptr)) if (!aColorDlg.Execute(pParent))
return false; return false;
_out_rNewValue <<= aColorDlg.GetColor(); _out_rNewValue <<= aColorDlg.GetColor();
return true; return true;
} }
bool FormComponentPropertyHandler::impl_dialogChooseLabelControl_nothrow( Any& _out_rNewValue, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const bool FormComponentPropertyHandler::impl_dialogChooseLabelControl_nothrow( Any& _out_rNewValue, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const
{ {
vcl::Window* pParent = impl_getDefaultDialogParent_nothrow(); weld::Window* pParent = impl_getDefaultDialogFrame_nothrow();
OSelectLabelDialog dlgSelectLabel(pParent ? pParent->GetFrameWeld() : nullptr, m_xComponent); OSelectLabelDialog dlgSelectLabel(pParent, m_xComponent);
_rClearBeforeDialog.clear(); _rClearBeforeDialog.clear();
bool bSuccess = (RET_OK == dlgSelectLabel.run()); bool bSuccess = (RET_OK == dlgSelectLabel.run());
if ( bSuccess ) if ( bSuccess )
......
...@@ -330,9 +330,14 @@ public: ...@@ -330,9 +330,14 @@ public:
WaitObject(weld::Window* pWindow) WaitObject(weld::Window* pWindow)
: m_pWindow(pWindow) : m_pWindow(pWindow)
{ {
m_pWindow->set_busy_cursor(true); if (m_pWindow)
m_pWindow->set_busy_cursor(true);
}
~WaitObject()
{
if (m_pWindow)
m_pWindow->set_busy_cursor(false);
} }
~WaitObject() { m_pWindow->set_busy_cursor(false); }
}; };
class Button; class Button;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment