From 1b088c6e496b799ca9ddb0d6f7b98bcb5c132ecc Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 30 Mar 2012 23:40:05 +0100 Subject: pointer is always non-null --- uui/source/iahndl-authentication.cxx | 3 +-- uui/source/logindlg.cxx | 10 +++++----- uui/source/logindlg.hxx | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'uui') diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 3844804a3cb1..76eaada570f1 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -95,9 +95,8 @@ executeLoginDialog( nFlags |= LF_NO_USESYSCREDS; boost::scoped_ptr< ResMgr > xManager(ResMgr::CreateResMgr("uui")); - UniString aRealm(rRealm); boost::scoped_ptr< LoginDialog > xDialog( - new LoginDialog( pParent, nFlags, rInfo.GetServer(), &aRealm, xManager.get())); + new LoginDialog( pParent, nFlags, rInfo.GetServer(), rRealm, xManager.get())); if (rInfo.GetErrorText().Len() != 0) xDialog->SetErrorText(rInfo.GetErrorText()); xDialog->SetName(rInfo.GetUserName()); diff --git a/uui/source/logindlg.cxx b/uui/source/logindlg.cxx index 78a29c86078e..8a15dfe7a8ba 100644 --- a/uui/source/logindlg.cxx +++ b/uui/source/logindlg.cxx @@ -250,8 +250,8 @@ LoginDialog::LoginDialog ( Window* pParent, sal_uInt16 nFlags, - const String& rServer, - const String* pRealm, + const rtl::OUString& rServer, + const rtl::OUString& rRealm, ResMgr* pResMgr ) : @@ -280,10 +280,10 @@ LoginDialog::LoginDialog { UniString aRequest; - if ((nFlags & LF_NO_ACCOUNT) != 0 && pRealm && pRealm->Len() != 0) + if ((nFlags & LF_NO_ACCOUNT) != 0 && !rRealm.isEmpty()) { - aRequest = ResId(STR_LOGIN_REALM, *pResMgr); - aRequest.SearchAndReplaceAscii("%2", *pRealm); + aRequest = ResId::toString(ResId(STR_LOGIN_REALM, *pResMgr)); + aRequest.SearchAndReplaceAscii("%2", rRealm); } else aRequest = aRequestInfo.GetText(); diff --git a/uui/source/logindlg.hxx b/uui/source/logindlg.hxx index 7ce8d5c21593..bd533f157a52 100644 --- a/uui/source/logindlg.hxx +++ b/uui/source/logindlg.hxx @@ -82,7 +82,7 @@ class LoginDialog : public ModalDialog public: LoginDialog( Window* pParent, sal_uInt16 nFlags, - const String& rServer, const String* pRealm, + const rtl::OUString& rServer, const rtl::OUString &rRealm, ResMgr * pResMgr ); virtual ~LoginDialog(); -- cgit