mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 04:09:50 +00:00
Bug 1253010 - part 3 - create all nsIDateTimeFormat instances directly; r=smontagu
This commit is contained in:
parent
6971b769d3
commit
777c075f0e
@ -49,7 +49,6 @@
|
||||
#include "rdf.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIDateTimeFormat.h"
|
||||
#include "nsDateTimeFormatCID.h"
|
||||
#include "nsIScriptableDateFormat.h"
|
||||
#include "nsICollation.h"
|
||||
#include "nsCollationCID.h"
|
||||
@ -103,9 +102,9 @@ nsXULContentUtils::Init()
|
||||
#undef XUL_RESOURCE
|
||||
#undef XUL_LITERAL
|
||||
|
||||
rv = CallCreateInstance(NS_DATETIMEFORMAT_CONTRACTID, &gFormat);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
gFormat = nsIDateTimeFormat::Create().take();
|
||||
if (!gFormat) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -26,9 +26,6 @@
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include <algorithm>
|
||||
|
||||
// DateTime Includes
|
||||
#include "nsDateTimeFormatCID.h"
|
||||
|
||||
#define OFFSET_NOT_SET -1
|
||||
|
||||
// Print Options
|
||||
@ -314,7 +311,7 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
|
||||
|
||||
// Create current Date/Time String
|
||||
if (!mDateFormatter) {
|
||||
mDateFormatter = do_CreateInstance(NS_DATETIMEFORMAT_CONTRACTID);
|
||||
mDateFormatter = nsIDateTimeFormat::Create();
|
||||
}
|
||||
if (!mDateFormatter) {
|
||||
return;
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "nsIFileURL.h"
|
||||
#include "nsEscape.h"
|
||||
#include "nsIDirIndex.h"
|
||||
#include "nsDateTimeFormatCID.h"
|
||||
#include "nsURLHelper.h"
|
||||
#include "nsIPlatformCharset.h"
|
||||
#include "nsIPrefService.h"
|
||||
@ -70,9 +69,9 @@ nsIndexedToHTML::Init(nsIStreamListener* aListener) {
|
||||
|
||||
mListener = aListener;
|
||||
|
||||
mDateTime = do_CreateInstance(NS_DATETIMEFORMAT_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
mDateTime = nsIDateTimeFormat::Create();
|
||||
if (!mDateTime)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIStringBundleService> sbs =
|
||||
do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "nsNSSCertificate.h"
|
||||
#include "nsIX509CertValidity.h"
|
||||
#include "nsIDateTimeFormat.h"
|
||||
#include "nsDateTimeFormatCID.h"
|
||||
#include "nsICertOverrideService.h"
|
||||
#include "nsIObjectInputStream.h"
|
||||
#include "nsIObjectOutputStream.h"
|
||||
@ -834,9 +833,10 @@ GetDateBoundary(nsIX509Cert* ix509,
|
||||
trueExpired_falseNotYetValid = false;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDateTimeFormat> dateTimeFormat(do_CreateInstance(NS_DATETIMEFORMAT_CONTRACTID, &rv));
|
||||
if (NS_FAILED(rv))
|
||||
nsCOMPtr<nsIDateTimeFormat> dateTimeFormat = nsIDateTimeFormat::Create();
|
||||
if (!dateTimeFormat) {
|
||||
return;
|
||||
}
|
||||
|
||||
dateTimeFormat->FormatPRTime(nullptr, kDateFormatLong, kTimeFormatNoSeconds,
|
||||
timeToUse, formattedDate);
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "nsNSSCertTrust.h"
|
||||
#include "nsNSSCertValidity.h"
|
||||
#include "nsNSSComponent.h"
|
||||
#include "nsIDateTimeFormat.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "prerror.h"
|
||||
#include "ScopedNSSTypes.h"
|
||||
@ -1637,11 +1638,9 @@ static nsresult
|
||||
ProcessTime(PRTime dispTime, const char16_t* displayName,
|
||||
nsIASN1Sequence* parentSequence)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIDateTimeFormat> dateFormatter =
|
||||
do_CreateInstance(NS_DATETIMEFORMAT_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
nsCOMPtr<nsIDateTimeFormat> dateFormatter = nsIDateTimeFormat::Create();
|
||||
if (!dateFormatter) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsString text;
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include "nsNSSCertValidity.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIDateTimeFormat.h"
|
||||
#include "nsDateTimeFormatCID.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsNSSShutDown.h"
|
||||
@ -56,10 +55,10 @@ nsX509CertValidity::FormatTime(const PRTime& aTimeDate,
|
||||
if (!mTimesInitialized)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIDateTimeFormat> dateFormatter =
|
||||
do_CreateInstance(NS_DATETIMEFORMAT_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsCOMPtr<nsIDateTimeFormat> dateFormatter = nsIDateTimeFormat::Create();
|
||||
if (!dateFormatter) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
PRExplodedTime explodedTime;
|
||||
PR_ExplodeTime(const_cast<PRTime&>(aTimeDate), aParamFn, &explodedTime);
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "nsCRT.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "nsIDateTimeFormat.h"
|
||||
#include "nsDateTimeFormatCID.h"
|
||||
#include "nsQuickSort.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "nsIAutoCompleteResult.h"
|
||||
@ -299,7 +298,7 @@ nsFileView::~nsFileView()
|
||||
nsresult
|
||||
nsFileView::Init()
|
||||
{
|
||||
mDateFormatter = do_CreateInstance(NS_DATETIMEFORMAT_CONTRACTID);
|
||||
mDateFormatter = nsIDateTimeFormat::Create();
|
||||
if (!mDateFormatter)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user