Move getStringFromResource() to XFE_RDFUtils.

This commit is contained in:
ramiro%netscape.com 1998-10-12 14:28:42 +00:00
Родитель 5910259f0e
Коммит fc8169360f
5 изменённых файлов: 35 добавлений и 28 удалений

Просмотреть файл

@ -1111,26 +1111,6 @@ XFE_RDFMenuToolbarBase::setItemLabelString(Widget item,HT_Resource entry)
}
}
//////////////////////////////////////////////////////////////////////////
XmString
XFE_RDFMenuToolbarBase::getStringFromResource(HT_Resource entry)
{
XmString xmname;
XP_ASSERT( entry != NULL );
MWContext * context = _frame->getContext();
INTL_CharSetInfo charSetInfo =
LO_GetDocumentCharacterSetInfo(context);
// Create am XmString from the entry
xmname = XFE_RDFUtils::entryToXmString(entry, charSetInfo);
return(xmname);
}
//////////////////////////////////////////////////////////////////////////
void
XFE_RDFMenuToolbarBase::getStyleAndLayout(HT_Resource entry, int32 * toolbar_style, unsigned char * layout)
{

Просмотреть файл

@ -145,7 +145,6 @@ protected:
XP_Bool getOnlyHeaders ();
void setItemLabelString (Widget menu, HT_Resource entry);
XmString getStringFromResource(HT_Resource );
void getStyleAndLayout(HT_Resource , int32 *, unsigned char * );
// Item callbacks

Просмотреть файл

@ -24,6 +24,7 @@
#include "RDFToolbar.h"
#include "Logo.h"
#include "MozillaApp.h"
#include "RDFUtils.h"
#include "prefapi.h"
#include "felocale.h"
@ -655,8 +656,11 @@ XFE_RDFToolbar::tooltipCB(Widget w, XtPointer client_data, XmString * string_ret
*string_return = str;
*need_to_free_string = True;
}
else {
*string_return = obj->getStringFromResource(entry);
else
{
MWContext * context = (obj->getFrame())->getContext();
*string_return = XFE_RDFUtils::getStringFromResource(context,entry);
*need_to_free_string = True;
}
@ -692,12 +696,15 @@ XFE_RDFToolbar::docStringSetCB(Widget w, XtPointer client_data, XmString * strin
*string_return = str;
*need_to_free_string = True;
}
else {
else
{
Boolean isContainer = HT_IsContainer(entry);
MWContext * context = (obj->getFrame())->getContext();
*string_return = XFE_RDFUtils::getStringFromResource(context,entry);
Boolean isContainer = HT_IsContainer(entry);
*string_return = obj->getStringFromResource(entry);
*need_to_free_string = True;
*need_to_free_string = True;
}
}

Просмотреть файл

@ -369,3 +369,20 @@ XFE_RDFUtils::formatItem(HT_Resource entry,int16 charset)
return (xmstring);
}
//////////////////////////////////////////////////////////////////////////
/* static */ XmString
XFE_RDFUtils::getStringFromResource(MWContext * context,
HT_Resource entry)
{
XmString xmname;
XP_ASSERT( context != NULL );
XP_ASSERT( entry != NULL );
INTL_CharSetInfo charSetInfo = LO_GetDocumentCharacterSetInfo(context);
// Create am XmString from the entry
xmname = XFE_RDFUtils::entryToXmString(entry, charSetInfo);
return xmname;
}
//////////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -95,6 +95,10 @@ public:
static XmString entryToXmString (HT_Resource entry,
INTL_CharSetInfo char_set_info);
static XmString getStringFromResource (MWContext * context,
HT_Resource entry);
};
#endif // _xfe_rdf_utils_h_