From a344c4e0bed8a7e265465ca95a583870d88c1df8 Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Fri, 28 May 1999 00:56:53 +0000 Subject: [PATCH] GetCharPref() is going away for nsIPref scriptability - use CopyCharPref instead git-svn-id: svn://10.0.0.236/trunk@33070 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/local/tests/mailbox/mailboxTest.cpp | 9 +++++---- mozilla/webshell/embed/ActiveX/MozillaBrowser.cpp | 6 ++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mozilla/mailnews/local/tests/mailbox/mailboxTest.cpp b/mozilla/mailnews/local/tests/mailbox/mailboxTest.cpp index ccf79af9e99..b1ee5a99bf3 100644 --- a/mozilla/mailnews/local/tests/mailbox/mailboxTest.cpp +++ b/mozilla/mailnews/local/tests/mailbox/mailboxTest.cpp @@ -79,6 +79,8 @@ #include "nsIServiceManager.h" #include "nsIEventQueueService.h" #include "nsRDFCID.h" +#include "nsMsgBaseCID.h" +#include "nsMsgLocalCID.h" #ifdef XP_PC #define NETLIB_DLL "netlib.dll" @@ -307,19 +309,18 @@ void nsMailboxTestDriver::InitializeTestDriver() // propogating bienvenu's preferences hack..... #define ROOT_PATH_LENGTH 128 - char rootPath[ROOT_PATH_LENGTH]; - int rootLen = ROOT_PATH_LENGTH; + char* rootPath; nsIPref* prefs; nsresult rv; rv = nsServiceManager::GetService(kPrefCID, kIPrefIID, (nsISupports**)&prefs); if (prefs && NS_SUCCEEDED(rv)) { prefs->Startup("prefs50.js"); - rv = prefs->GetCharPref(kMsgRootFolderPref, rootPath, &rootLen); + rv = prefs->GetCharPref(kMsgRootFolderPref, &rootPath); nsServiceManager::ReleaseService(kPrefCID, prefs); } - if (rootLen > 0) // how many bytes did they write into our buffer? + if (NS_SUCCEEDED(rv))) { m_folderSpec = rootPath; } diff --git a/mozilla/webshell/embed/ActiveX/MozillaBrowser.cpp b/mozilla/webshell/embed/ActiveX/MozillaBrowser.cpp index c12688b6866..d1d7fd4810b 100644 --- a/mozilla/webshell/embed/ActiveX/MozillaBrowser.cpp +++ b/mozilla/webshell/embed/ActiveX/MozillaBrowser.cpp @@ -766,11 +766,9 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::GoHome(void) // Find the home page stored in prefs if (m_pIPref) { - char szBuffer[512]; + char *szBuffer; nsresult rv; - int nBufLen = sizeof(szBuffer) / sizeof(szBuffer[0]); - memset(szBuffer, 0, sizeof(szBuffer)); - rv = m_pIPref->GetCharPref(c_szPrefsHomePage, szBuffer, &nBufLen); + rv = m_pIPref->CopyCharPref(c_szPrefsHomePage, &szBuffer); if (rv == NS_OK) { sUrl = A2T(szBuffer);