changes to work with new string apis
git-svn-id: svn://10.0.0.236/trunk@66916 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
7d81715f23
commit
3b74a6b1a4
@ -122,7 +122,7 @@ NS_IMETHODIMP nsButton::GetLabel(nsString& aBuffer)
|
||||
|
||||
gtk_label_get(GTK_LABEL(GTK_BIN (mWidget)->child), &text);
|
||||
aBuffer.SetLength(0);
|
||||
aBuffer.Append(text);
|
||||
aBuffer.AppendWithConversion(text);
|
||||
|
||||
return (NS_OK);
|
||||
|
||||
|
||||
@ -185,7 +185,7 @@ NS_METHOD nsCheckButton::GetLabel(nsString& aBuffer)
|
||||
char * text;
|
||||
if (mLabel) {
|
||||
gtk_label_get(GTK_LABEL(mLabel), &text);
|
||||
aBuffer.Append(text);
|
||||
aBuffer.AppendWithConversion(text);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
|
||||
@ -428,7 +428,7 @@ nsClipboard::GetNativeClipboardData(nsITransferable * aTransferable,
|
||||
nsXPIDLCString flavorStr;
|
||||
currentFlavor->ToString ( getter_Copies(flavorStr) );
|
||||
if (DoConvert(flavorStr, selectionAtom)) {
|
||||
foundFlavor = flavorStr;
|
||||
foundFlavor = nsCAutoString(flavorStr);
|
||||
foundData = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
@ -730,7 +730,7 @@ nsClipboard::HasDataMatchingFlavors(nsISupportsArray* aFlavorList,
|
||||
nsCAutoString flavorStr;
|
||||
nsXPIDLCString myStr;
|
||||
flavorWrapper->ToString(getter_Copies(myStr));
|
||||
flavorStr = myStr;
|
||||
flavorStr = nsCAutoString(myStr);
|
||||
|
||||
position = 0;
|
||||
while (position < dataLength) {
|
||||
|
||||
@ -179,7 +179,7 @@ PRBool nsComboBox::RemoveItemAt(PRInt32 aPosition)
|
||||
PRBool nsComboBox::GetItemAt(nsString& anItem, PRInt32 aPosition)
|
||||
{
|
||||
if (aPosition >= 0 && aPosition < mNumItems) {
|
||||
anItem = (gchar *) g_list_nth(mItems, aPosition)->data;
|
||||
anItem.AssignWithConversion((gchar *) g_list_nth(mItems, aPosition)->data);
|
||||
return PR_TRUE;
|
||||
}
|
||||
return PR_FALSE;
|
||||
@ -194,7 +194,7 @@ NS_METHOD nsComboBox::GetSelectedItem(nsString& aItem)
|
||||
{
|
||||
aItem.Truncate();
|
||||
if (mCombo) {
|
||||
aItem = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO(mCombo)->entry));
|
||||
aItem.AssignWithConversion(gtk_entry_get_text (GTK_ENTRY (GTK_COMBO(mCombo)->entry)));
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -424,7 +424,7 @@ NS_IMETHODIMP nsFileWidget::Create(nsIWidget *aParent,
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_ASSERTION(0, "error getting locale charset, using ISO-8859-1");
|
||||
localeCharset.SetString("ISO-8859-1");
|
||||
localeCharset.AssignWithConversion("ISO-8859-1");
|
||||
rv = NS_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -149,7 +149,8 @@ NS_IMETHODIMP nsFontRetrieverService::Advance()
|
||||
//------------------------------
|
||||
static FontInfo * GetFontInfo(nsVoidArray * aFontList, char * aName)
|
||||
{
|
||||
nsAutoString name(aName);
|
||||
nsAutoString name;
|
||||
name.AssignWithConversion(aName);
|
||||
PRInt32 i;
|
||||
PRInt32 cnt = aFontList->Count();
|
||||
for (i=0;i<cnt;i++) {
|
||||
@ -160,7 +161,7 @@ static FontInfo * GetFontInfo(nsVoidArray * aFontList, char * aName)
|
||||
}
|
||||
|
||||
FontInfo * fontInfo = new FontInfo();
|
||||
fontInfo->mName = aName;
|
||||
fontInfo->mName.AssignWithConversion(aName);
|
||||
//printf("Adding [%s]\n", aName);fflush(stdout);
|
||||
fontInfo->mIsScalable = PR_FALSE; // X fonts aren't scalable right??
|
||||
fontInfo->mSizes = nsnull;
|
||||
|
||||
@ -81,10 +81,11 @@ void nsGtkIMEHelper::SetupUnicodeDecoder()
|
||||
NS_WITH_SERVICE(nsIPlatformCharset, platform, NS_PLATFORMCHARSET_PROGID,
|
||||
&result);
|
||||
if (platform && NS_SUCCEEDED(result)) {
|
||||
nsAutoString charset("");
|
||||
nsAutoString charset;
|
||||
charset.AssignWithConversion("");
|
||||
result = platform->GetCharset(kPlatformCharsetSel_Menu, charset);
|
||||
if (NS_FAILED(result) || (charset.Length() == 0)) {
|
||||
charset = "ISO-8859-1"; // default
|
||||
charset.AssignWithConversion("ISO-8859-1"); // default
|
||||
}
|
||||
nsICharsetConverterManager* manager = nsnull;
|
||||
nsresult res = nsServiceManager::
|
||||
|
||||
@ -136,6 +136,6 @@ NS_METHOD nsLabel::GetLabel(nsString& aBuffer)
|
||||
char * text;
|
||||
gtk_label_get(GTK_LABEL(mWidget), &text);
|
||||
aBuffer.SetLength(0);
|
||||
aBuffer.Append(text);
|
||||
aBuffer.AppendWithConversion(text);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ PRBool nsListBox::GetItemAt(nsString& anItem, PRInt32 aPosition)
|
||||
char *text = nsnull;
|
||||
gtk_clist_get_text(GTK_CLIST(mCList),aPosition,0,&text);
|
||||
if (text) {
|
||||
anItem.Append(text);
|
||||
anItem.AppendWithConversion(text);
|
||||
result = PR_TRUE;
|
||||
}
|
||||
}
|
||||
@ -196,7 +196,7 @@ NS_IMETHODIMP nsListBox::GetSelectedItem(nsString& aItem)
|
||||
char *text = nsnull;
|
||||
gtk_clist_get_text(GTK_CLIST(mCList),i,0,&text);
|
||||
if (text) {
|
||||
aItem.Append(text);
|
||||
aItem.AppendWithConversion(text);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -205,7 +205,7 @@ NS_METHOD nsRadioButton::GetLabel(nsString& aBuffer)
|
||||
if (mLabel) {
|
||||
char* text;
|
||||
gtk_label_get(GTK_LABEL(mLabel), &text);
|
||||
aBuffer.Append(text);
|
||||
aBuffer.AppendWithConversion(text);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
|
||||
@ -87,7 +87,7 @@ NS_IMETHODIMP nsTextHelper::GetText(nsString& aTextBuffer, PRUint32 aBufferSize
|
||||
gtk_text_get_length (GTK_TEXT (mTextWidget)));
|
||||
}
|
||||
aTextBuffer.SetLength(0);
|
||||
aTextBuffer.Append(str);
|
||||
aTextBuffer.AppendWithConversion(str);
|
||||
PRUint32 len = (PRUint32)strlen(str);
|
||||
aActualSize = len;
|
||||
|
||||
|
||||
@ -1852,7 +1852,8 @@ NS_IMETHODIMP nsWindow::SetTitle(const nsString& aTitle)
|
||||
NS_WITH_SERVICE(nsIPlatformCharset, platform, NS_PLATFORMCHARSET_PROGID,
|
||||
&result);
|
||||
if (platform && NS_SUCCEEDED(result)) {
|
||||
nsAutoString charset("");
|
||||
nsAutoString charset;
|
||||
charset.AssignWithConversion("");
|
||||
result = platform->GetCharset(kPlatformCharsetSel_WindowManager, charset);
|
||||
if (NS_SUCCEEDED(result) && (charset.Length() > 0)) {
|
||||
NS_WITH_SERVICE(nsICharsetConverterManager, manager,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user