summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2014-07-06 06:09:14 +0200
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-07-06 06:58:05 +0200
commit15a3cd62b0129909480e37d19c922359accdb096 (patch)
treedb2ea89fa1550bb775817e65b624732512f3ca68
parent237426e104d1fe8e9e03296e05576bf411ea7451 (diff)
coverity#1209589: Dereference after null check
Change-Id: I75d26707a7a3c0febef11b7e1c2218b8abfb7832
-rw-r--r--sd/source/ui/docshell/docshel3.cxx39
1 files changed, 21 insertions, 18 deletions
diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx
index 40abf39b2855..a80746e17cf0 100644
--- a/sd/source/ui/docshell/docshel3.cxx
+++ b/sd/source/ui/docshell/docshel3.cxx
@@ -289,27 +289,30 @@ void DrawDocShell::Execute( SfxRequest& rReq )
}
else
{
- // setting the new language...
- if (!aNewLangTxt.isEmpty())
+ if( mpViewShell )
{
- const OUString aDocumentLangPrefix("Default_");
- const OUString aStrNone("LANGUAGE_NONE");
- const OUString aStrResetLangs("RESET_LANGUAGES");
- sal_Int32 nPos = -1;
- if (-1 != (nPos = aNewLangTxt.indexOf( aDocumentLangPrefix , 0 )))
+ // setting the new language...
+ if (!aNewLangTxt.isEmpty())
{
- aNewLangTxt = aNewLangTxt.replaceAt( nPos, aDocumentLangPrefix.getLength(), "" );
+ const OUString aDocumentLangPrefix("Default_");
+ const OUString aStrNone("LANGUAGE_NONE");
+ const OUString aStrResetLangs("RESET_LANGUAGES");
+ sal_Int32 nPos = -1;
+ if (-1 != (nPos = aNewLangTxt.indexOf( aDocumentLangPrefix , 0 )))
+ {
+ aNewLangTxt = aNewLangTxt.replaceAt( nPos, aDocumentLangPrefix.getLength(), "" );
+ }
+ else
+ {
+ break;
+ }
+ if (aNewLangTxt == aStrNone)
+ lcl_setLanguage( mpViewShell->GetDoc(), OUString() );
+ else if (aNewLangTxt == aStrResetLangs)
+ lcl_setLanguage( mpViewShell->GetDoc(), OUString(), true );
+ else
+ lcl_setLanguage( mpViewShell->GetDoc(), aNewLangTxt );
}
- else
- {
- break;
- }
- if (aNewLangTxt == aStrNone)
- lcl_setLanguage( mpViewShell->GetDoc(), OUString() );
- else if (aNewLangTxt == aStrResetLangs)
- lcl_setLanguage( mpViewShell->GetDoc(), OUString(), true );
- else
- lcl_setLanguage( mpViewShell->GetDoc(), aNewLangTxt );
}
}
}