Kaydet (Commit) 3dfdf8c1 authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Miklos Vajna

coverity#1323757 Dereference before null check

Change-Id: I5353b78b6961d28fb3f42e5f2073e9a83ac1037c
(cherry picked from commit 13fdf04f)
üst f3f09557
...@@ -706,33 +706,39 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c ...@@ -706,33 +706,39 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c
break; break;
case HANDLE_VIEWSET_ONLINE_LAYOUT : case HANDLE_VIEWSET_ONLINE_LAYOUT :
{ {
SwViewOption aOpt(*pView->GetWrtShell().GetViewOptions()); if ( pView )
if (pView && !bVal != !aOpt.getBrowseMode())
{ {
aOpt.setBrowseMode( bVal ); SwViewOption aOpt(*pView->GetWrtShell().GetViewOptions());
pView->GetWrtShell().ApplyViewOptions( aOpt ); if (!bVal != !aOpt.getBrowseMode())
{
aOpt.setBrowseMode( bVal );
pView->GetWrtShell().ApplyViewOptions( aOpt );
// must be set in mpViewOption as this will overwrite settings in _post! // must be set in mpViewOption as this will overwrite settings in _post!
if(mpViewOption) if(mpViewOption)
mpViewOption->setBrowseMode(bVal); mpViewOption->setBrowseMode(bVal);
pView->GetDocShell()->ToggleLayoutMode(pView); pView->GetDocShell()->ToggleLayoutMode(pView);
}
} }
} }
break; break;
case HANDLE_VIEWSET_HIDE_WHITESPACE: case HANDLE_VIEWSET_HIDE_WHITESPACE:
{ {
SwViewOption aOpt(*pView->GetWrtShell().GetViewOptions()); if ( pView )
if (pView && !bVal != !aOpt.IsHideWhitespaceMode())
{ {
aOpt.SetHideWhitespaceMode( bVal ); SwViewOption aOpt(*pView->GetWrtShell().GetViewOptions());
pView->GetWrtShell().ApplyViewOptions( aOpt ); if (!bVal != !aOpt.IsHideWhitespaceMode())
{
aOpt.SetHideWhitespaceMode( bVal );
pView->GetWrtShell().ApplyViewOptions( aOpt );
// must be set in mpViewOption as this will overwrite settings in _post! // must be set in mpViewOption as this will overwrite settings in _post!
if(mpViewOption) if(mpViewOption)
mpViewOption->SetHideWhitespaceMode(bVal); mpViewOption->SetHideWhitespaceMode(bVal);
pView->GetDocShell()->ToggleLayoutMode(pView); pView->GetDocShell()->ToggleLayoutMode(pView);
}
} }
} }
break; break;
......
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