Kaydet (Commit) 25dd3d27 authored tarafından Caolán McNamara's avatar Caolán McNamara

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
üst e1d1ea2d
...@@ -95,7 +95,6 @@ SwModelessRedlineAcceptDlg::SwModelessRedlineAcceptDlg( ...@@ -95,7 +95,6 @@ SwModelessRedlineAcceptDlg::SwModelessRedlineAcceptDlg(
void SwModelessRedlineAcceptDlg::Activate() void SwModelessRedlineAcceptDlg::Activate()
{ {
SwView *pView = ::GetActiveView(); SwView *pView = ::GetActiveView();
if (!pView) // can happen when switching to another app, when a Listbox in dialog if (!pView) // can happen when switching to another app, when a Listbox in dialog
return; // had the focus previously (actually THs Bug) return; // had the focus previously (actually THs Bug)
...@@ -159,6 +158,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(vcl::Window *pParent, VclBuilderContainer ...@@ -159,6 +158,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(vcl::Window *pParent, VclBuilderContainer
{ {
aTabPagesCTRL.SetHelpId(HID_REDLINE_CTRL); aTabPagesCTRL.SetHelpId(HID_REDLINE_CTRL);
pTPView = aTabPagesCTRL.GetViewPage(); pTPView = aTabPagesCTRL.GetViewPage();
pTable = pTPView->GetTableControl(); pTable = pTPView->GetTableControl();
pTPView->InsertWriterHeader(); pTPView->InsertWriterHeader();
...@@ -167,6 +167,11 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(vcl::Window *pParent, VclBuilderContainer ...@@ -167,6 +167,11 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(vcl::Window *pParent, VclBuilderContainer
pTPView->SetRejectClickHdl(LINK(this, SwRedlineAcceptDlg, RejectHdl)); pTPView->SetRejectClickHdl(LINK(this, SwRedlineAcceptDlg, RejectHdl));
pTPView->SetRejectAllClickHdl(LINK(this, SwRedlineAcceptDlg, RejectAllHdl)); pTPView->SetRejectAllClickHdl(LINK(this, SwRedlineAcceptDlg, RejectAllHdl));
pTPView->SetUndoClickHdl(LINK(this, SwRedlineAcceptDlg, UndoHdl)); 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)); aTabPagesCTRL.GetFilterPage()->SetReadyHdl(LINK(this, SwRedlineAcceptDlg, FilterChangedHdl));
...@@ -367,9 +372,14 @@ void SwRedlineAcceptDlg::Activate() ...@@ -367,9 +372,14 @@ void SwRedlineAcceptDlg::Activate()
return; return;
SwView *pView = ::GetActiveView(); SwView *pView = ::GetActiveView();
if (!pView) // can happen when switching to another app
if (!pView) // can happen when switching to another app, when a Listbox in the dialog {
return; // had the focus previously (actually THs Bug) pTPView->EnableAccept(false);
pTPView->EnableReject(false);
pTPView->EnableAcceptAll(false);
pTPView->EnableRejectAll(false);
return; // had the focus previously
}
SwWait aWait( *pView->GetDocShell(), false ); SwWait aWait( *pView->GetDocShell(), false );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment