summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-02-12 21:18:29 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-02-12 21:20:13 +0000
commit25dd3d277e9b90a59e7b2a03202ef0cba7799b68 (patch)
tree8979742938828747764e249771ac7195dae56896
parente1d1ea2d017d4239c4ed301ee6328cb53af5bb55 (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
-rw-r--r--sw/source/uibase/misc/redlndlg.cxx18
1 files changed, 14 insertions, 4 deletions
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index 0f2d72a0dac1..513df0aa49f5 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)
@@ -159,6 +158,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(vcl::Window *pParent, VclBuilderContainer
{
aTabPagesCTRL.SetHelpId(HID_REDLINE_CTRL);
pTPView = aTabPagesCTRL.GetViewPage();
+
pTable = pTPView->GetTableControl();
pTPView->InsertWriterHeader();
@@ -167,6 +167,11 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(vcl::Window *pParent, VclBuilderContainer
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));
@@ -367,9 +372,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 );