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
break;
case HANDLE_VIEWSET_ONLINE_LAYOUT :
{
SwViewOption aOpt(*pView->GetWrtShell().GetViewOptions());
if (pView && !bVal != !aOpt.getBrowseMode())
if ( pView )
{
aOpt.setBrowseMode( bVal );
pView->GetWrtShell().ApplyViewOptions( aOpt );
SwViewOption aOpt(*pView->GetWrtShell().GetViewOptions());
if (!bVal != !aOpt.getBrowseMode())
{
aOpt.setBrowseMode( bVal );
pView->GetWrtShell().ApplyViewOptions( aOpt );
// must be set in mpViewOption as this will overwrite settings in _post!
if(mpViewOption)
mpViewOption->setBrowseMode(bVal);
// must be set in mpViewOption as this will overwrite settings in _post!
if(mpViewOption)
mpViewOption->setBrowseMode(bVal);
pView->GetDocShell()->ToggleLayoutMode(pView);
pView->GetDocShell()->ToggleLayoutMode(pView);
}
}
}
break;
case HANDLE_VIEWSET_HIDE_WHITESPACE:
{
SwViewOption aOpt(*pView->GetWrtShell().GetViewOptions());
if (pView && !bVal != !aOpt.IsHideWhitespaceMode())
if ( pView )
{
aOpt.SetHideWhitespaceMode( bVal );
pView->GetWrtShell().ApplyViewOptions( aOpt );
SwViewOption aOpt(*pView->GetWrtShell().GetViewOptions());
if (!bVal != !aOpt.IsHideWhitespaceMode())
{
aOpt.SetHideWhitespaceMode( bVal );
pView->GetWrtShell().ApplyViewOptions( aOpt );
// must be set in mpViewOption as this will overwrite settings in _post!
if(mpViewOption)
mpViewOption->SetHideWhitespaceMode(bVal);
// must be set in mpViewOption as this will overwrite settings in _post!
if(mpViewOption)
mpViewOption->SetHideWhitespaceMode(bVal);
pView->GetDocShell()->ToggleLayoutMode(pView);
pView->GetDocShell()->ToggleLayoutMode(pView);
}
}
}
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