diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-29 09:19:25 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-29 10:35:14 +0000 |
commit | 5d846ebeb55b1e295fb53f473f0fb2b88712e001 (patch) | |
tree | 46b0125e6e24c9c584f5d5a069528361d6708964 /sfx2 | |
parent | 625f1cd72e834910342790195f19c3930988c34e (diff) |
Install a Cancel callback, don't rely on vcl searching for a parent to close
If there is no cancel callback for a Cancel button, it's monstrous to dig
around the hierarchy looking for a parent to call EndDialog/Close on. Really
messes up attempts to refactor dialogs.
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/tabdlg.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 9c216565ff34..108e46df3efa 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -518,6 +518,7 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText ) { aOKBtn.SetClickHdl( LINK( this, SfxTabDialog, OkHdl ) ); + aCancelBtn.SetClickHdl( LINK( this, SfxTabDialog, CancelHdl ) ); aResetBtn.SetClickHdl( LINK( this, SfxTabDialog, ResetHdl ) ); aResetBtn.SetText( String( SfxResId( STR_RESET ) ) ); aTabCtrl.SetActivatePageHdl( @@ -601,7 +602,6 @@ void SfxTabDialog::StartExecuteModal( const Link& rEndDialogHdl ) void SfxTabDialog::Start( sal_Bool bShow ) { - aCancelBtn.SetClickHdl( LINK( this, SfxTabDialog, CancelHdl ) ); pImpl->bModal = sal_False; Start_Impl(); @@ -956,10 +956,9 @@ short SfxTabDialog::Ok() // ----------------------------------------------------------------------- -IMPL_LINK( SfxTabDialog, CancelHdl, Button*, pButton ) +IMPL_LINK( SfxTabDialog, CancelHdl, Button*, EMPTYARG ) { - (void)pButton; //unused - Close(); + EndDialog( RET_USER_CANCEL ); return 0; } |