From 91e96a948c1103c1ecf15ce754a992f598083fac Mon Sep 17 00:00:00 2001 From: "ftang%netscape.com" Date: Mon, 7 Jun 1999 21:37:45 +0000 Subject: [PATCH] add FillInfo --- intl/uconv/ucvlatin/nsUCvLatinSupport.cpp | 36 ++++++++++++++++++- intl/uconv/ucvlatin/nsUCvLatinSupport.h | 9 ++++- intl/uconv/ucvlatin/nsUnicodeToARMSCII8.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToCP1250.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToCP1251.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToCP1252.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToCP1253.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToCP1254.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToCP1257.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToCP1258.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToCP874.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToISO88591.cpp | 3 +- intl/uconv/ucvlatin/nsUnicodeToISO885914.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToISO885915.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToISO88592.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToISO88593.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToISO88594.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToISO88595.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToISO88596.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToISO88597.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToISO88598.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToISO88599.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToKOI8R.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToKOI8U.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToMUTF7.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToMacCE.cpp | 2 +- .../uconv/ucvlatin/nsUnicodeToMacCroatian.cpp | 2 +- .../uconv/ucvlatin/nsUnicodeToMacCyrillic.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToMacGreek.cpp | 2 +- .../ucvlatin/nsUnicodeToMacIcelandic.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToMacRoman.cpp | 2 +- .../uconv/ucvlatin/nsUnicodeToMacRomanian.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToMacTurkish.cpp | 2 +- .../ucvlatin/nsUnicodeToMacUkrainian.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToTCVN5712.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToUTF7.cpp | 7 +++- intl/uconv/ucvlatin/nsUnicodeToUTF7.h | 1 + intl/uconv/ucvlatin/nsUnicodeToUTF8.cpp | 7 +++- intl/uconv/ucvlatin/nsUnicodeToUTF8.h | 2 ++ intl/uconv/ucvlatin/nsUnicodeToVISCII.cpp | 2 +- intl/uconv/ucvlatin/nsUnicodeToVPS.cpp | 2 +- 41 files changed, 94 insertions(+), 39 deletions(-) diff --git a/intl/uconv/ucvlatin/nsUCvLatinSupport.cpp b/intl/uconv/ucvlatin/nsUCvLatinSupport.cpp index bff1af995a2a..27a6319dd5d0 100644 --- a/intl/uconv/ucvlatin/nsUCvLatinSupport.cpp +++ b/intl/uconv/ucvlatin/nsUCvLatinSupport.cpp @@ -19,6 +19,7 @@ #include "pratom.h" #include "nsIComponentManager.h" +#include "nsICharRepresentable.h" #include "nsUCvLatinSupport.h" #include "nsUCvLatinDll.h" @@ -492,8 +493,13 @@ nsresult nsEncoderSupport::QueryInterface(REFNSIID aIID, NS_ADDREF_THIS(); return NS_OK; } + if (aIID.Equals(nsICharRepresentable::GetIID())) { + *aInstancePtr = (void*) ((nsICharRepresentable*)this); + NS_ADDREF_THIS(); + return NS_OK; + } if (aIID.Equals(kISupportsIID)) { - *aInstancePtr = (void*) ((nsISupports*)this); + *aInstancePtr = (void*) ((nsISupports*)((nsIUnicodeEncoder*)this)); NS_ADDREF_THIS(); return NS_OK; } @@ -630,6 +636,20 @@ nsTableEncoderSupport::~nsTableEncoderSupport() NS_IF_RELEASE(mHelper); } +NS_IMETHODIMP nsTableEncoderSupport::FillInfo(PRUint32 *aInfo) +{ + nsresult res; + + if (mHelper == nsnull) { + res = nsComponentManager::CreateInstance(kUnicodeEncodeHelperCID, NULL, + kIUnicodeEncodeHelperIID, (void**) & mHelper); + + if (NS_FAILED(res)) return NS_ERROR_UENC_NOHELPER; + } + + res = mHelper->FillInfo(aInfo, mMappingTable); + return res; +} //---------------------------------------------------------------------- // Subclassing of nsEncoderSupport class [implementation] @@ -673,6 +693,20 @@ nsMultiTableEncoderSupport::~nsMultiTableEncoderSupport() NS_IF_RELEASE(mHelper); } +NS_IMETHODIMP nsMultiTableEncoderSupport::FillInfo(PRUint32 *aInfo) +{ + nsresult res; + + if (mHelper == nsnull) { + res = nsComponentManager::CreateInstance(kUnicodeEncodeHelperCID, NULL, + kIUnicodeEncodeHelperIID, (void**) & mHelper); + + if (NS_FAILED(res)) return NS_ERROR_UENC_NOHELPER; + } + + res = mHelper->FillInfo(aInfo,mTableCount, mMappingTable); + return res; +} //---------------------------------------------------------------------- // Subclassing of nsEncoderSupport class [implementation] diff --git a/intl/uconv/ucvlatin/nsUCvLatinSupport.h b/intl/uconv/ucvlatin/nsUCvLatinSupport.h index 529b158ef717..a079610a1a98 100644 --- a/intl/uconv/ucvlatin/nsUCvLatinSupport.h +++ b/intl/uconv/ucvlatin/nsUCvLatinSupport.h @@ -24,6 +24,7 @@ #include "nsIUnicodeDecoder.h" #include "nsIUnicodeEncodeHelper.h" #include "nsIUnicodeDecodeHelper.h" +#include "nsICharRepresentable.h" #define ONE_BYTE_TABLE_SIZE 256 @@ -264,7 +265,7 @@ protected: * @created 17/Feb/1999 * @author Catalin Rotaru [CATA] */ -class nsEncoderSupport : public nsIUnicodeEncoder +class nsEncoderSupport : public nsIUnicodeEncoder, public nsICharRepresentable { NS_DECL_ISUPPORTS @@ -330,6 +331,10 @@ public: NS_IMETHOD Reset(); NS_IMETHOD SetOutputErrorBehavior(PRInt32 aBehavior, nsIUnicharEncoder * aEncoder, PRUnichar aChar); + + //-------------------------------------------------------------------- + // Interface nsICharRepresentable [declaration] + NS_IMETHOD FillInfo(PRUint32 *aInfo) = 0; }; //---------------------------------------------------------------------- @@ -355,6 +360,7 @@ public: * Class destructor. */ virtual ~nsTableEncoderSupport(); + NS_IMETHOD FillInfo( PRUint32 *aInfo); protected: @@ -392,6 +398,7 @@ public: * Class destructor. */ virtual ~nsMultiTableEncoderSupport(); + NS_IMETHOD FillInfo( PRUint32 *aInfo); protected: diff --git a/intl/uconv/ucvlatin/nsUnicodeToARMSCII8.cpp b/intl/uconv/ucvlatin/nsUnicodeToARMSCII8.cpp index eecf96599a57..7f449bab0d30 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToARMSCII8.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToARMSCII8.cpp @@ -42,7 +42,7 @@ nsUnicodeToARMSCII8::nsUnicodeToARMSCII8() nsresult nsUnicodeToARMSCII8::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToARMSCII8(); + *aResult = (nsIUnicodeEncoder*)new nsUnicodeToARMSCII8(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToCP1250.cpp b/intl/uconv/ucvlatin/nsUnicodeToCP1250.cpp index e5f29e9785a3..70a297957c1c 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToCP1250.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToCP1250.cpp @@ -42,7 +42,7 @@ nsUnicodeToCP1250::nsUnicodeToCP1250() nsresult nsUnicodeToCP1250::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToCP1250(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToCP1250(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToCP1251.cpp b/intl/uconv/ucvlatin/nsUnicodeToCP1251.cpp index 3ccf37249507..20620ff5276b 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToCP1251.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToCP1251.cpp @@ -42,7 +42,7 @@ nsUnicodeToCP1251::nsUnicodeToCP1251() nsresult nsUnicodeToCP1251::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToCP1251(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToCP1251(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToCP1252.cpp b/intl/uconv/ucvlatin/nsUnicodeToCP1252.cpp index b6831d9a3ad9..c291ae417715 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToCP1252.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToCP1252.cpp @@ -42,7 +42,7 @@ nsUnicodeToCP1252::nsUnicodeToCP1252() nsresult nsUnicodeToCP1252::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToCP1252(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToCP1252(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToCP1253.cpp b/intl/uconv/ucvlatin/nsUnicodeToCP1253.cpp index d04672021fc4..26fbb62c0555 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToCP1253.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToCP1253.cpp @@ -42,7 +42,7 @@ nsUnicodeToCP1253::nsUnicodeToCP1253() nsresult nsUnicodeToCP1253::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToCP1253(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToCP1253(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToCP1254.cpp b/intl/uconv/ucvlatin/nsUnicodeToCP1254.cpp index 8b268be2663e..41df102e1d8b 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToCP1254.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToCP1254.cpp @@ -42,7 +42,7 @@ nsUnicodeToCP1254::nsUnicodeToCP1254() nsresult nsUnicodeToCP1254::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToCP1254(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToCP1254(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToCP1257.cpp b/intl/uconv/ucvlatin/nsUnicodeToCP1257.cpp index 5d045e0e9e27..7ce04d13a8b5 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToCP1257.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToCP1257.cpp @@ -42,7 +42,7 @@ nsUnicodeToCP1257::nsUnicodeToCP1257() nsresult nsUnicodeToCP1257::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToCP1257(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToCP1257(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToCP1258.cpp b/intl/uconv/ucvlatin/nsUnicodeToCP1258.cpp index 1baedac793fa..9371e0eee204 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToCP1258.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToCP1258.cpp @@ -42,7 +42,7 @@ nsUnicodeToCP1258::nsUnicodeToCP1258() nsresult nsUnicodeToCP1258::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToCP1258(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToCP1258(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToCP874.cpp b/intl/uconv/ucvlatin/nsUnicodeToCP874.cpp index f7ab804af3ca..0182947f9119 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToCP874.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToCP874.cpp @@ -42,7 +42,7 @@ nsUnicodeToCP874::nsUnicodeToCP874() nsresult nsUnicodeToCP874::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToCP874(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToCP874(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToISO88591.cpp b/intl/uconv/ucvlatin/nsUnicodeToISO88591.cpp index ac5e0f417480..39e6e345b177 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToISO88591.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToISO88591.cpp @@ -42,7 +42,7 @@ nsUnicodeToISO88591::nsUnicodeToISO88591() nsresult nsUnicodeToISO88591::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToISO88591(); + *aResult = (nsIUnicodeEncoder *) new nsUnicodeToISO88591(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } @@ -56,3 +56,4 @@ NS_IMETHODIMP nsUnicodeToISO88591::GetMaxLength(const PRUnichar * aSrc, *aDestLength = aSrcLength; return NS_OK_UENC_EXACTLENGTH; } + diff --git a/intl/uconv/ucvlatin/nsUnicodeToISO885914.cpp b/intl/uconv/ucvlatin/nsUnicodeToISO885914.cpp index ccd2bc856b17..dcd3f5452949 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToISO885914.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToISO885914.cpp @@ -42,7 +42,7 @@ nsUnicodeToISO885914::nsUnicodeToISO885914() nsresult nsUnicodeToISO885914::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToISO885914(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToISO885914(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToISO885915.cpp b/intl/uconv/ucvlatin/nsUnicodeToISO885915.cpp index 552391f7fabf..a2227ea648e3 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToISO885915.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToISO885915.cpp @@ -42,7 +42,7 @@ nsUnicodeToISO885915::nsUnicodeToISO885915() nsresult nsUnicodeToISO885915::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToISO885915(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToISO885915(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToISO88592.cpp b/intl/uconv/ucvlatin/nsUnicodeToISO88592.cpp index 6848c07f921d..04ad3644a58b 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToISO88592.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToISO88592.cpp @@ -42,7 +42,7 @@ nsUnicodeToISO88592::nsUnicodeToISO88592() nsresult nsUnicodeToISO88592::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToISO88592(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToISO88592(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToISO88593.cpp b/intl/uconv/ucvlatin/nsUnicodeToISO88593.cpp index 55c30a7e7f89..14c1773f3ee2 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToISO88593.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToISO88593.cpp @@ -42,7 +42,7 @@ nsUnicodeToISO88593::nsUnicodeToISO88593() nsresult nsUnicodeToISO88593::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToISO88593(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToISO88593(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToISO88594.cpp b/intl/uconv/ucvlatin/nsUnicodeToISO88594.cpp index 7752065db8c1..b5633fcaaf16 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToISO88594.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToISO88594.cpp @@ -42,7 +42,7 @@ nsUnicodeToISO88594::nsUnicodeToISO88594() nsresult nsUnicodeToISO88594::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToISO88594(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToISO88594(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToISO88595.cpp b/intl/uconv/ucvlatin/nsUnicodeToISO88595.cpp index cda0ffcde343..cfc0ae496511 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToISO88595.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToISO88595.cpp @@ -42,7 +42,7 @@ nsUnicodeToISO88595::nsUnicodeToISO88595() nsresult nsUnicodeToISO88595::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToISO88595(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToISO88595(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToISO88596.cpp b/intl/uconv/ucvlatin/nsUnicodeToISO88596.cpp index 18247e3ffcbd..08ed99778eb6 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToISO88596.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToISO88596.cpp @@ -42,7 +42,7 @@ nsUnicodeToISO88596::nsUnicodeToISO88596() nsresult nsUnicodeToISO88596::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToISO88596(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToISO88596(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToISO88597.cpp b/intl/uconv/ucvlatin/nsUnicodeToISO88597.cpp index c8e143cab39b..53955d1e99f8 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToISO88597.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToISO88597.cpp @@ -42,7 +42,7 @@ nsUnicodeToISO88597::nsUnicodeToISO88597() nsresult nsUnicodeToISO88597::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToISO88597(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToISO88597(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToISO88598.cpp b/intl/uconv/ucvlatin/nsUnicodeToISO88598.cpp index 41db8f57a9bd..96b587486241 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToISO88598.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToISO88598.cpp @@ -42,7 +42,7 @@ nsUnicodeToISO88598::nsUnicodeToISO88598() nsresult nsUnicodeToISO88598::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToISO88598(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToISO88598(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToISO88599.cpp b/intl/uconv/ucvlatin/nsUnicodeToISO88599.cpp index d6f7cf8c7f6e..09d51c4c6e79 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToISO88599.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToISO88599.cpp @@ -42,7 +42,7 @@ nsUnicodeToISO88599::nsUnicodeToISO88599() nsresult nsUnicodeToISO88599::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToISO88599(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToISO88599(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToKOI8R.cpp b/intl/uconv/ucvlatin/nsUnicodeToKOI8R.cpp index f09a0abcc93e..8ad78bca438a 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToKOI8R.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToKOI8R.cpp @@ -42,7 +42,7 @@ nsUnicodeToKOI8R::nsUnicodeToKOI8R() nsresult nsUnicodeToKOI8R::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToKOI8R(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToKOI8R(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToKOI8U.cpp b/intl/uconv/ucvlatin/nsUnicodeToKOI8U.cpp index 1820ba9854f3..ebe98e8dad49 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToKOI8U.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToKOI8U.cpp @@ -42,7 +42,7 @@ nsUnicodeToKOI8U::nsUnicodeToKOI8U() nsresult nsUnicodeToKOI8U::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToKOI8U(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToKOI8U(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToMUTF7.cpp b/intl/uconv/ucvlatin/nsUnicodeToMUTF7.cpp index 0274083845b3..2e7c7f0eca51 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToMUTF7.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToMUTF7.cpp @@ -29,6 +29,6 @@ nsUnicodeToMUTF7::nsUnicodeToMUTF7() nsresult nsUnicodeToMUTF7::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToMUTF7(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToMUTF7(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToMacCE.cpp b/intl/uconv/ucvlatin/nsUnicodeToMacCE.cpp index 48638776ad58..3b369133b2a7 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToMacCE.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToMacCE.cpp @@ -42,7 +42,7 @@ nsUnicodeToMacCE::nsUnicodeToMacCE() nsresult nsUnicodeToMacCE::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToMacCE(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToMacCE(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToMacCroatian.cpp b/intl/uconv/ucvlatin/nsUnicodeToMacCroatian.cpp index 9ebb9d615f2e..69e28dfa86a0 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToMacCroatian.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToMacCroatian.cpp @@ -42,7 +42,7 @@ nsUnicodeToMacCroatian::nsUnicodeToMacCroatian() nsresult nsUnicodeToMacCroatian::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToMacCroatian(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToMacCroatian(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToMacCyrillic.cpp b/intl/uconv/ucvlatin/nsUnicodeToMacCyrillic.cpp index ecdb6b7ade2e..5e19157321b1 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToMacCyrillic.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToMacCyrillic.cpp @@ -42,7 +42,7 @@ nsUnicodeToMacCyrillic::nsUnicodeToMacCyrillic() nsresult nsUnicodeToMacCyrillic::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToMacCyrillic(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToMacCyrillic(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToMacGreek.cpp b/intl/uconv/ucvlatin/nsUnicodeToMacGreek.cpp index 078b59cbc680..64ed9101c4f0 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToMacGreek.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToMacGreek.cpp @@ -42,7 +42,7 @@ nsUnicodeToMacGreek::nsUnicodeToMacGreek() nsresult nsUnicodeToMacGreek::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToMacGreek(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToMacGreek(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToMacIcelandic.cpp b/intl/uconv/ucvlatin/nsUnicodeToMacIcelandic.cpp index 178872b8bab2..17f0193b9746 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToMacIcelandic.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToMacIcelandic.cpp @@ -42,7 +42,7 @@ nsUnicodeToMacIcelandic::nsUnicodeToMacIcelandic() nsresult nsUnicodeToMacIcelandic::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToMacIcelandic(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToMacIcelandic(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToMacRoman.cpp b/intl/uconv/ucvlatin/nsUnicodeToMacRoman.cpp index acc6e34f5844..627f35d09b03 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToMacRoman.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToMacRoman.cpp @@ -42,7 +42,7 @@ nsUnicodeToMacRoman::nsUnicodeToMacRoman() nsresult nsUnicodeToMacRoman::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToMacRoman(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToMacRoman(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToMacRomanian.cpp b/intl/uconv/ucvlatin/nsUnicodeToMacRomanian.cpp index 5b46dcc6b52d..789e47fbd031 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToMacRomanian.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToMacRomanian.cpp @@ -42,7 +42,7 @@ nsUnicodeToMacRomanian::nsUnicodeToMacRomanian() nsresult nsUnicodeToMacRomanian::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToMacRomanian(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToMacRomanian(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToMacTurkish.cpp b/intl/uconv/ucvlatin/nsUnicodeToMacTurkish.cpp index 36e5369095c2..87f6c3973ff0 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToMacTurkish.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToMacTurkish.cpp @@ -42,7 +42,7 @@ nsUnicodeToMacTurkish::nsUnicodeToMacTurkish() nsresult nsUnicodeToMacTurkish::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToMacTurkish(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToMacTurkish(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToMacUkrainian.cpp b/intl/uconv/ucvlatin/nsUnicodeToMacUkrainian.cpp index afb2c108ba3b..5e34bbc7a8a7 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToMacUkrainian.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToMacUkrainian.cpp @@ -42,7 +42,7 @@ nsUnicodeToMacUkrainian::nsUnicodeToMacUkrainian() nsresult nsUnicodeToMacUkrainian::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToMacUkrainian(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToMacUkrainian(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToTCVN5712.cpp b/intl/uconv/ucvlatin/nsUnicodeToTCVN5712.cpp index 4dc913f0d62a..177d0588e5db 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToTCVN5712.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToTCVN5712.cpp @@ -42,7 +42,7 @@ nsUnicodeToTCVN5712::nsUnicodeToTCVN5712() nsresult nsUnicodeToTCVN5712::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToTCVN5712(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToTCVN5712(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToUTF7.cpp b/intl/uconv/ucvlatin/nsUnicodeToUTF7.cpp index 4c217d6caa9c..8abb6130f0a8 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToUTF7.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToUTF7.cpp @@ -36,6 +36,11 @@ nsBasicUTF7Encoder::nsBasicUTF7Encoder(char aLastChar, char aEscChar) Reset(); } +NS_IMETHODIMP nsBasicUTF7Encoder::FillInfo(PRUint32 *aInfo) +{ + memset(aInfo, 0xFF, (0x10000L >> 3)); + return NS_OK; +} nsresult nsBasicUTF7Encoder::ShiftEncoding(PRInt32 aEncoding, char * aDest, PRInt32 * aDestLength) @@ -290,6 +295,6 @@ nsUnicodeToUTF7::nsUnicodeToUTF7() nsresult nsUnicodeToUTF7::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToUTF7(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToUTF7(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToUTF7.h b/intl/uconv/ucvlatin/nsUnicodeToUTF7.h index a43dc6701585..61c6c3bad60f 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToUTF7.h +++ b/intl/uconv/ucvlatin/nsUnicodeToUTF7.h @@ -40,6 +40,7 @@ public: */ nsBasicUTF7Encoder(char aLastChar, char aEscChar); + NS_IMETHOD FillInfo(PRUint32 *aInfo); protected: PRInt32 mEncoding; // current encoding diff --git a/intl/uconv/ucvlatin/nsUnicodeToUTF8.cpp b/intl/uconv/ucvlatin/nsUnicodeToUTF8.cpp index bbdcc30866a5..d9383c7b4c25 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToUTF8.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToUTF8.cpp @@ -44,7 +44,7 @@ nsUnicodeToUTF8::nsUnicodeToUTF8() nsresult nsUnicodeToUTF8::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToUTF8(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToUTF8(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } @@ -58,3 +58,8 @@ NS_IMETHODIMP nsUnicodeToUTF8::GetMaxLength(const PRUnichar * aSrc, *aDestLength = 3*aSrcLength; return NS_OK; } +NS_IMETHODIMP nsUnicodeToUTF8::FillInfo(PRUint32 *aInfo) +{ + memset(aInfo, 0xFF, (0x10000L >> 3)); + return NS_OK; +} diff --git a/intl/uconv/ucvlatin/nsUnicodeToUTF8.h b/intl/uconv/ucvlatin/nsUnicodeToUTF8.h index b8b6a4df0347..09e9b0fa8af3 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToUTF8.h +++ b/intl/uconv/ucvlatin/nsUnicodeToUTF8.h @@ -44,6 +44,8 @@ public: * Static class constructor. */ static nsresult CreateInstance(nsISupports **aResult); + + NS_IMETHOD FillInfo(PRUint32* aInfo); protected: diff --git a/intl/uconv/ucvlatin/nsUnicodeToVISCII.cpp b/intl/uconv/ucvlatin/nsUnicodeToVISCII.cpp index 44a5be99ae68..cb5aad530b74 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToVISCII.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToVISCII.cpp @@ -42,7 +42,7 @@ nsUnicodeToVISCII::nsUnicodeToVISCII() nsresult nsUnicodeToVISCII::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToVISCII(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToVISCII(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; } diff --git a/intl/uconv/ucvlatin/nsUnicodeToVPS.cpp b/intl/uconv/ucvlatin/nsUnicodeToVPS.cpp index 0be7246c9ed0..0ac4d163ba48 100644 --- a/intl/uconv/ucvlatin/nsUnicodeToVPS.cpp +++ b/intl/uconv/ucvlatin/nsUnicodeToVPS.cpp @@ -42,7 +42,7 @@ nsUnicodeToVPS::nsUnicodeToVPS() nsresult nsUnicodeToVPS::CreateInstance(nsISupports ** aResult) { - *aResult = new nsUnicodeToVPS(); + *aResult = (nsIUnicodeEncoder*) new nsUnicodeToVPS(); return (*aResult == NULL)? NS_ERROR_OUT_OF_MEMORY : NS_OK; }