diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-02-12 21:18:29 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-03-04 03:12:00 -0800 |
commit | 093eae4fef6def6ea1569115dab9d41a8ba9e163 (patch) | |
tree | a1950bafb716a37802e79d05161d0247fadc611a | |
parent | e0130d0bf6a8af45605afe8dd805438d9fda5721 (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
(cherry picked from commit 25dd3d277e9b90a59e7b2a03202ef0cba7799b68)
Conflicts:
sw/source/uibase/misc/redlndlg.cxx
Change-Id: I6ba07f0ecf1c419e45f7e0ac628a82e6bd486668
Reviewed-on: https://gerrit.libreoffice.org/14455
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit a840857c2d2490ee8d1b0289df8d9bf588981c48)
-rw-r--r-- | sw/source/core/uibase/misc/redlndlg.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sw/source/core/uibase/misc/redlndlg.cxx b/sw/source/core/uibase/misc/redlndlg.cxx index 3a062a4ba1f1..9d0e359345ef 100644 --- a/sw/source/core/uibase/misc/redlndlg.cxx +++ b/sw/source/core/uibase/misc/redlndlg.cxx @@ -96,7 +96,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) @@ -159,6 +158,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(Dialog *pParent, bool bAutoFmt) : { aTabPagesCTRL.SetHelpId(HID_REDLINE_CTRL); pTPView = aTabPagesCTRL.GetViewPage(); + pTable = pTPView->GetTableControl(); pTPView->InsertWriterHeader(); @@ -167,6 +167,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)); @@ -357,9 +362,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 ); |