diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-02-12 21:18:29 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-13 14:37:39 +0000 |
commit | a8db3a1761097ea1d2ab0d26d0f08f9581fb409b (patch) | |
tree | c755e768b4a1c4f68e21d269e2ceb98551b2d75b | |
parent | 76610b00b67cf9c4600caed0f4d75d04e825f9d2 (diff) |
Resolves: tdf#89227 if no SwView then disable accept/reject change buttons
e.g. if the context is an embedded draw ole then we don't have a SwView
Change-Id: I6ba07f0ecf1c419e45f7e0ac628a82e6bd486668
(cherry picked from commit 25dd3d277e9b90a59e7b2a03202ef0cba7799b68)
Reviewed-on: https://gerrit.libreoffice.org/14454
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | sw/source/uibase/misc/redlndlg.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index fc993a8c32eb..550b692d1d2f 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -95,7 +95,6 @@ SwModelessRedlineAcceptDlg::SwModelessRedlineAcceptDlg( void SwModelessRedlineAcceptDlg::Activate() { SwView *pView = ::GetActiveView(); - if (!pView) // can happen when switching to another app, when a Listbox in dialog return; // had the focus previously (actually THs Bug) @@ -158,6 +157,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(Dialog *pParent, bool bAutoFmt) : { aTabPagesCTRL.SetHelpId(HID_REDLINE_CTRL); pTPView = aTabPagesCTRL.GetViewPage(); + pTable = pTPView->GetTableControl(); pTPView->InsertWriterHeader(); @@ -166,6 +166,11 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(Dialog *pParent, bool bAutoFmt) : pTPView->SetRejectClickHdl(LINK(this, SwRedlineAcceptDlg, RejectHdl)); pTPView->SetRejectAllClickHdl(LINK(this, SwRedlineAcceptDlg, RejectAllHdl)); pTPView->SetUndoClickHdl(LINK(this, SwRedlineAcceptDlg, UndoHdl)); + //tdf#89227 default to disabled, and only enable if possible to accept/reject + pTPView->EnableAccept(false); + pTPView->EnableReject(false); + pTPView->EnableAcceptAll(false); + pTPView->EnableRejectAll(false); aTabPagesCTRL.GetFilterPage()->SetReadyHdl(LINK(this, SwRedlineAcceptDlg, FilterChangedHdl)); @@ -354,9 +359,14 @@ void SwRedlineAcceptDlg::Activate() return; SwView *pView = ::GetActiveView(); - - if (!pView) // can happen when switching to another app, when a Listbox in the dialog - return; // had the focus previously (actually THs Bug) + if (!pView) // can happen when switching to another app + { + pTPView->EnableAccept(false); + pTPView->EnableReject(false); + pTPView->EnableAcceptAll(false); + pTPView->EnableRejectAll(false); + return; // had the focus previously + } SwWait aWait( *pView->GetDocShell(), false ); |