Attachment #218658: patch for bug #334205

View | Details | Raw Unified | Return to bug 334205
Collapse All | Expand All

(-)widget/src/xpwidgets/nsPrimitiveHelpers.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 152-170   nsPrimitiveHelpers :: CreateDataFromPrim Link Here 
152
nsresult
152
nsresult
153
nsPrimitiveHelpers :: ConvertUnicodeToPlatformPlainText ( PRUnichar* inUnicode, PRInt32 inUnicodeLen, 
153
nsPrimitiveHelpers :: ConvertUnicodeToPlatformPlainText ( PRUnichar* inUnicode, PRInt32 inUnicodeLen, 
154
                                                            char** outPlainTextData, PRInt32* outPlainTextLen )
154
                                                            char** outPlainTextData, PRInt32* outPlainTextLen )
155
{
155
{
156
  if ( !outPlainTextData || !outPlainTextLen )
156
  if ( !outPlainTextData || !outPlainTextLen )
157
    return NS_ERROR_INVALID_ARG;
157
    return NS_ERROR_INVALID_ARG;
158
158
159
  // Get the appropriate unicode encoder. We're guaranteed that this won't change
159
  // Get the appropriate unicode encoder. We're guaranteed that this won't change
160
  // through the life of the app so we can cache it.
160
  // through the life of the app so we can cache it.
161
  nsresult rv;
161
  nsresult rv = NS_OK;
162
  nsCOMPtr<nsIUnicodeEncoder> encoder;
162
  nsCOMPtr<nsIUnicodeEncoder> encoder;
163
163
164
  // get the charset
164
  // get the charset
165
  nsCAutoString platformCharset;
165
  nsCAutoString platformCharset;
166
  nsCOMPtr <nsIPlatformCharset> platformCharsetService = do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv);
166
  nsCOMPtr <nsIPlatformCharset> platformCharsetService = do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv);
167
  if (NS_SUCCEEDED(rv))
167
  if (NS_SUCCEEDED(rv))
168
    rv = platformCharsetService->GetCharset(kPlatformCharsetSel_PlainTextInClipboard, platformCharset);
168
    rv = platformCharsetService->GetCharset(kPlatformCharsetSel_PlainTextInClipboard, platformCharset);
169
  if (NS_FAILED(rv))
169
  if (NS_FAILED(rv))
170
    platformCharset.AssignLiteral("ISO-8859-1");
170
    platformCharset.AssignLiteral("ISO-8859-1");

Return to bug 334205