diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-20 17:17:10 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-22 00:27:49 +0100 |
commit | a084d003a927440fb56b11a0b7175360a1af41ab (patch) | |
tree | 830911bfed2ad1f34730156d506bc9fd5c7c392c /dbaccess/source/ui/tabledesign | |
parent | 519293447189f75e842065f7ff211d395d0da4b6 (diff) |
weld OSQLMessageBox
Change-Id: Idbdb07bc342a91695d15ea1a87d1863798ca34b0
Reviewed-on: https://gerrit.libreoffice.org/51676
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess/source/ui/tabledesign')
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableController.cxx | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 56509b1a843a..93b08c02ab21 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -274,7 +274,8 @@ bool OTableController::doSaveDoc(bool _bSaveAs) if (!xTablesSup.is()) { OUString aMessage(DBA_RES(STR_TABLEDESIGN_CONNECTION_MISSING)); - ScopedVclPtrInstance<OSQLWarningBox>(getView(), aMessage )->Execute(); + OSQLWarningBox aWarning(getFrameWeld(), aMessage); + aWarning.run(); return false; } @@ -372,7 +373,7 @@ bool OTableController::doSaveDoc(bool _bSaveAs) assignTable(); } // now check if our datasource has set a tablefilter and if append the new table name to it - ::dbaui::appendToFilter(getConnection(),m_sName,getORB(),getView()); // we are not interessted in the return value + ::dbaui::appendToFilter(getConnection(), m_sName, getORB(), getFrameWeld()); // we are not interessted in the return value Reference< frame::XTitleChangeListener> xEventListener(impl_getTitleHelper_throw(),UNO_QUERY); if ( xEventListener.is() ) { @@ -404,9 +405,8 @@ bool OTableController::doSaveDoc(bool _bSaveAs) { OUString sText( DBA_RES( STR_NAME_ALREADY_EXISTS ) ); sText = sText.replaceFirst( "#" , m_sName); - ScopedVclPtrInstance< OSQLMessageBox > aDlg( getView(), DBA_RES( STR_ERROR_DURING_CREATION ), sText, MessBoxStyle::Ok, OSQLMessageBox::Error ); - - aDlg->Execute(); + OSQLMessageBox aDlg(getFrameWeld(), DBA_RES( STR_ERROR_DURING_CREATION ), sText, MessBoxStyle::Ok, MessageType::Error); + aDlg.run(); bError = true; } catch( const Exception& ) @@ -513,7 +513,8 @@ void OTableController::impl_initialize() } catch(const SQLException&) { - ScopedVclPtrInstance<OSQLWarningBox>(getView(), DBA_RES( STR_NO_TYPE_INFO_AVAILABLE ))->Execute(); + OSQLWarningBox aWarning(getFrameWeld(), DBA_RES( STR_NO_TYPE_INFO_AVAILABLE)); + aWarning.run(); throw; } try @@ -914,7 +915,8 @@ bool OTableController::checkColumns(bool _bNew) { OUString strMessage = DBA_RES(STR_TABLEDESIGN_DUPLICATE_NAME); strMessage = strMessage.replaceFirst("$column$", pFieldDesc->GetName()); - ScopedVclPtrInstance<OSQLWarningBox>(getView(), strMessage)->Execute(); + OSQLWarningBox aWarning(getFrameWeld(), strMessage); + aWarning.run(); return false; } } @@ -924,9 +926,9 @@ bool OTableController::checkColumns(bool _bNew) { OUString sTitle(DBA_RES(STR_TABLEDESIGN_NO_PRIM_KEY_HEAD)); OUString sMsg(DBA_RES(STR_TABLEDESIGN_NO_PRIM_KEY)); - ScopedVclPtrInstance< OSQLMessageBox > aBox(getView(), sTitle,sMsg, MessBoxStyle::YesNoCancel | MessBoxStyle::DefaultYes); + OSQLMessageBox aBox(getFrameWeld(), sTitle,sMsg, MessBoxStyle::YesNoCancel | MessBoxStyle::DefaultYes); - switch ( aBox->Execute() ) + switch (aBox.run()) { case RET_YES: { @@ -1055,8 +1057,8 @@ void OTableController::alterColumns() aMessage = aMessage.replaceFirst( "$column$", pField->GetName() ); SQLExceptionInfo aError( ::cppu::getCaughtException() ); - ScopedVclPtrInstance< OSQLWarningBox > aMsg( getView(), aMessage, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes , &aError ); - bNotOk = aMsg->Execute() == RET_YES; + OSQLWarningBox aMsg(getFrameWeld(), aMessage, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes , &aError); + bNotOk = aMsg.run() == RET_YES; } else throw; @@ -1112,8 +1114,8 @@ void OTableController::alterColumns() { OUString aMessage(DBA_RES(STR_TABLEDESIGN_ALTER_ERROR)); aMessage = aMessage.replaceFirst("$column$",pField->GetName()); - ScopedVclPtrInstance< OSQLWarningBox > aMsg( getView(), aMessage, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, &aError); - if ( aMsg->Execute() != RET_YES ) + OSQLWarningBox aMsg(getFrameWeld(), aMessage, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, &aError); + if (aMsg.run() != RET_YES) { Reference<XPropertySet> xNewColumn(xIdxColumns->getByIndex(nPos),UNO_QUERY_THROW); OUString sName; @@ -1175,8 +1177,8 @@ void OTableController::alterColumns() OUString aMsgT(DBA_RES(STR_TBL_COLUMN_IS_KEYCOLUMN)); aMsgT = aMsgT.replaceFirst("$column$",rColumnName); OUString aTitle(DBA_RES(STR_TBL_COLUMN_IS_KEYCOLUMN_TITLE)); - ScopedVclPtrInstance< OSQLMessageBox > aMsg(getView(),aTitle,aMsgT,MessBoxStyle::YesNo| MessBoxStyle::DefaultYes); - if(aMsg->Execute() == RET_YES) + OSQLMessageBox aMsg(getFrameWeld(), aTitle, aMsgT, MessBoxStyle::YesNo| MessBoxStyle::DefaultYes); + if (aMsg.run() == RET_YES) { xKeyColumns = nullptr; dropPrimaryKey(); |