Bug 1410288 - Change nsIPrintProgressParams' attributes from wstring to AString. r=bobowen.

It makes the C++ code nicer.

--HG--
extra : rebase_source : 773d52f787eafd7bf9d5b6b0d84f0c96692d3924
This commit is contained in:
Nicholas Nethercote 2017-10-19 11:32:37 +11:00
parent 21e7dce1a2
commit 0e8c1cb1b7
6 changed files with 43 additions and 43 deletions

View File

@ -1,14 +1,14 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
[scriptable, uuid(CA89B55B-6FAF-4051-9645-1C03EF5108F8)]
interface nsIPrintProgressParams: nsISupports {
/* message subject */
attribute wstring docTitle;
attribute wstring docURL;
interface nsIPrintProgressParams: nsISupports
{
attribute AString docTitle;
attribute AString docURL;
};

View File

@ -2683,8 +2683,8 @@ nsPrintEngine::SetDocAndURLIntoProgress(const UniquePtr<nsPrintObject>& aPO,
EllipseLongString(docTitleStr, kTitleLength, false);
EllipseLongString(docURLStr, kTitleLength, true);
aParams->SetDocTitle(docTitleStr.get());
aParams->SetDocURL(docURLStr.get());
aParams->SetDocTitle(docTitleStr);
aParams->SetDocURL(docURLStr);
}
//---------------------------------------------------------------------

View File

@ -96,33 +96,33 @@ PrintProgressDialogChild::OnSecurityChange(nsIWebProgress* aProgress,
// nsIPrintProgressParams
NS_IMETHODIMP PrintProgressDialogChild::GetDocTitle(char16_t* *aDocTitle)
NS_IMETHODIMP
PrintProgressDialogChild::GetDocTitle(nsAString& aDocTitle)
{
NS_ENSURE_ARG(aDocTitle);
*aDocTitle = ToNewUnicode(mDocTitle);
aDocTitle = mDocTitle;
return NS_OK;
}
NS_IMETHODIMP PrintProgressDialogChild::SetDocTitle(const char16_t* aDocTitle)
NS_IMETHODIMP
PrintProgressDialogChild::SetDocTitle(const nsAString& aDocTitle)
{
mDocTitle = aDocTitle;
Unused << SendDocTitleChange(nsString(aDocTitle));
Unused << SendDocTitleChange(PromiseFlatString(aDocTitle));
return NS_OK;
}
NS_IMETHODIMP PrintProgressDialogChild::GetDocURL(char16_t **aDocURL)
NS_IMETHODIMP
PrintProgressDialogChild::GetDocURL(nsAString& aDocURL)
{
NS_ENSURE_ARG(aDocURL);
*aDocURL = ToNewUnicode(mDocURL);
aDocURL = mDocURL;
return NS_OK;
}
NS_IMETHODIMP PrintProgressDialogChild::SetDocURL(const char16_t* aDocURL)
NS_IMETHODIMP
PrintProgressDialogChild::SetDocURL(const nsAString& aDocURL)
{
mDocURL = aDocURL;
Unused << SendDocURLChange(nsString(aDocURL));
Unused << SendDocURLChange(PromiseFlatString(aDocURL));
return NS_OK;
}

View File

@ -63,7 +63,7 @@ mozilla::ipc::IPCResult
PrintProgressDialogParent::RecvDocTitleChange(const nsString& newTitle)
{
if (mPrintProgressParams) {
mPrintProgressParams->SetDocTitle(newTitle.get());
mPrintProgressParams->SetDocTitle(newTitle);
}
return IPC_OK();
}
@ -72,7 +72,7 @@ mozilla::ipc::IPCResult
PrintProgressDialogParent::RecvDocURLChange(const nsString& newURL)
{
if (mPrintProgressParams) {
mPrintProgressParams->SetDocURL(newURL.get());
mPrintProgressParams->SetDocURL(newURL);
}
return IPC_OK();
}

View File

@ -17,29 +17,29 @@ nsPrintProgressParams::~nsPrintProgressParams()
{
}
NS_IMETHODIMP nsPrintProgressParams::GetDocTitle(char16_t * *aDocTitle)
NS_IMETHODIMP
nsPrintProgressParams::GetDocTitle(nsAString& aDocTitle)
{
NS_ENSURE_ARG(aDocTitle);
*aDocTitle = ToNewUnicode(mDocTitle);
aDocTitle = mDocTitle;
return NS_OK;
}
NS_IMETHODIMP nsPrintProgressParams::SetDocTitle(const char16_t * aDocTitle)
NS_IMETHODIMP
nsPrintProgressParams::SetDocTitle(const nsAString& aDocTitle)
{
mDocTitle = aDocTitle;
return NS_OK;
}
NS_IMETHODIMP nsPrintProgressParams::GetDocURL(char16_t * *aDocURL)
NS_IMETHODIMP
nsPrintProgressParams::GetDocURL(nsAString& aDocURL)
{
NS_ENSURE_ARG(aDocURL);
*aDocURL = ToNewUnicode(mDocURL);
aDocURL = mDocURL;
return NS_OK;
}
NS_IMETHODIMP nsPrintProgressParams::SetDocURL(const char16_t * aDocURL)
NS_IMETHODIMP
nsPrintProgressParams::SetDocURL(const nsAString& aDocURL)
{
mDocURL = aDocURL;
return NS_OK;

View File

@ -17,29 +17,29 @@ nsPrintProgressParams::~nsPrintProgressParams()
{
}
NS_IMETHODIMP nsPrintProgressParams::GetDocTitle(char16_t * *aDocTitle)
NS_IMETHODIMP
nsPrintProgressParams::GetDocTitle(nsAString& aDocTitle)
{
NS_ENSURE_ARG(aDocTitle);
*aDocTitle = ToNewUnicode(mDocTitle);
aDocTitle = mDocTitle;
return NS_OK;
}
NS_IMETHODIMP nsPrintProgressParams::SetDocTitle(const char16_t * aDocTitle)
NS_IMETHODIMP
nsPrintProgressParams::SetDocTitle(const nsAString& aDocTitle)
{
mDocTitle = aDocTitle;
return NS_OK;
}
NS_IMETHODIMP nsPrintProgressParams::GetDocURL(char16_t * *aDocURL)
NS_IMETHODIMP
nsPrintProgressParams::GetDocURL(nsAString& aDocURL)
{
NS_ENSURE_ARG(aDocURL);
*aDocURL = ToNewUnicode(mDocURL);
aDocURL = mDocURL;
return NS_OK;
}
NS_IMETHODIMP nsPrintProgressParams::SetDocURL(const char16_t * aDocURL)
NS_IMETHODIMP
nsPrintProgressParams::SetDocURL(const nsAString& aDocURL)
{
mDocURL = aDocURL;
return NS_OK;