diff --git a/mozilla/cmd/macfe/gui/CHTMLView.cp b/mozilla/cmd/macfe/gui/CHTMLView.cp index dfe42053104..ae6f534cb0c 100644 --- a/mozilla/cmd/macfe/gui/CHTMLView.cp +++ b/mozilla/cmd/macfe/gui/CHTMLView.cp @@ -7177,22 +7177,13 @@ void CHTMLView::RestructureGridView( mContext->Repaginate(); } -#if defined(OJI) -#define BUILTIN_ATTRIBUTE_COUNT(builtin) (builtin)->attributes.n -#define BUILTIN_ATTRIBUTE_NAMES(builtin) (builtin)->attributes.names -#define BUILTIN_ATTRIBUTE_VALUES(builtin) (builtin)->attributes.values -#else -#define BUILTIN_ATTRIBUTE_COUNT(builtin) (builtin)->attribute_cnt -#define BUILTIN_ATTRIBUTE_NAMES(builtin) (builtin)->attribute_list -#define BUILTIN_ATTRIBUTE_VALUES(builtin) (builtin)->value_list -#endif - const char* CHTMLView :: GetBuiltInAttribute ( LO_BuiltinStruct *inBuiltinStruct, const char* inAttribute ) { - for ( uint16 n = 0; n < BUILTIN_ATTRIBUTE_COUNT(inBuiltinStruct); n++ ) { - const char* attName = BUILTIN_ATTRIBUTE_NAMES(inBuiltinStruct)[n]; - const char* attValue = BUILTIN_ATTRIBUTE_VALUES(inBuiltinStruct)[n]; + lo_NVList& attributes = inBuiltinStruct->attributes; + for ( uint16 n = 0; n < attributes.n; n++ ) { + const char* attName = attributes.names[n]; + const char* attValue = attributes.values[n]; if ( attName && (XP_STRCASECMP(attName, inAttribute) == 0) ) return attValue; } @@ -7238,8 +7229,8 @@ CHTMLView :: DisplayBuiltin ( int /*inLocation*/, LO_BuiltinStruct* inBuiltinStr tree->PlaceInSuperImageAt ( inBuiltinStruct->x, inBuiltinStruct->y, false ); // set window target and url - tree->BuildHTPane ( url, BUILTIN_ATTRIBUTE_COUNT(inBuiltinStruct), BUILTIN_ATTRIBUTE_NAMES(inBuiltinStruct), - BUILTIN_ATTRIBUTE_VALUES(inBuiltinStruct) ); + lo_NVList& attributes = inBuiltinStruct->attributes; + tree->BuildHTPane ( url, attributes.n, attributes.names, attributes.values); tree->SetTargetFrame ( target ); tree->Refresh(); diff --git a/mozilla/include/lo_ele.h b/mozilla/include/lo_ele.h index e438a6f0560..b3632101bf8 100644 --- a/mozilla/include/lo_ele.h +++ b/mozilla/include/lo_ele.h @@ -946,15 +946,15 @@ struct LO_CellStruct_struct { Bool isCaption; /* Needed for relayout without reload */ }; -#ifdef OJI struct lo_NVList { uint32 n; /* number of name/value pairs */ char** names; char** values; }; -#define LO_NVList_Init( pList ) (pList)->n=0; (pList)->names=NULL; (pList)->values=NULL -#endif +typedef struct lo_NVList lo_NVList; + +#define LO_NVList_Init( pList ) (pList)->n=0, (pList)->names=NULL, (pList)->values=NULL struct LO_CommonPluginStruct_struct { int16 type; @@ -1005,13 +1005,7 @@ struct LO_BuiltinStruct_struct { void * FE_Data; void *session_data; PA_Block builtin_src; -#if defined(OJI) - struct lo_NVList attributes; -#else - int32 attribute_cnt; - char **attribute_list; - char **value_list; -#endif /* OJI */ + lo_NVList attributes; int32 alignment; int32 border_width; int32 border_vert_space; @@ -1034,14 +1028,8 @@ struct LO_EmbedStruct_struct { struct LO_EmbedStruct_struct *nextEmbed; PA_Block embed_src; -#ifdef OJI - struct lo_NVList attributes; - struct lo_NVList parameters; -#else - int32 attribute_cnt; - char **attribute_list; - char **value_list; -#endif /* OJI */ + lo_NVList attributes; + lo_NVList parameters; }; #define LO_JAVA_SELECTOR_APPLET 0 @@ -1068,14 +1056,8 @@ struct LO_JavaAppStruct_struct { PA_Block attr_archive; PA_Block attr_name; Bool may_script; -#ifdef OJI - struct lo_NVList attributes; - struct lo_NVList parameters; -#else /* OJI */ - int32 param_cnt; - char **param_names; - char **param_values; -#endif /* OJI */ + lo_NVList attributes; + lo_NVList parameters; }; diff --git a/mozilla/lib/layout/laybuiltin.c b/mozilla/lib/layout/laybuiltin.c index 24d4964c4ba..5ae338cdeb5 100644 --- a/mozilla/lib/layout/laybuiltin.c +++ b/mozilla/lib/layout/laybuiltin.c @@ -39,20 +39,6 @@ void lo_FillInBuiltinGeometry(lo_DocState *state, LO_BuiltinStruct *builtin, void lo_UpdateStateAfterBuiltinLayout (lo_DocState *state, LO_BuiltinStruct *builtin, int32 line_inc, int32 baseline_inc); -/** - * Some accessor macros, to manage the OJI changes. - */ - -#if defined(OJI) -#define BUILTIN_ATTRIBUTE_COUNT(builtin) (builtin)->attributes.n -#define BUILTIN_ATTRIBUTE_NAMES(builtin) (builtin)->attributes.names -#define BUILTIN_ATTRIBUTE_VALUES(builtin) (builtin)->attributes.values -#else -#define BUILTIN_ATTRIBUTE_COUNT(builtin) (builtin)->attribute_cnt -#define BUILTIN_ATTRIBUTE_NAMES(builtin) (builtin)->attribute_list -#define BUILTIN_ATTRIBUTE_VALUES(builtin) (builtin)->value_list -#endif - void lo_FormatBuiltin (MWContext *context, lo_DocState *state, PA_Tag *tag) { @@ -89,12 +75,10 @@ lo_FormatBuiltin (MWContext *context, lo_DocState *state, PA_Tag *tag) builtin->next = NULL; builtin->prev = NULL; - BUILTIN_ATTRIBUTE_COUNT(builtin) = 0; - BUILTIN_ATTRIBUTE_NAMES(builtin) = NULL; - BUILTIN_ATTRIBUTE_VALUES(builtin) = NULL; + LO_NVList_Init(&builtin->attributes); - BUILTIN_ATTRIBUTE_COUNT(builtin) = PA_FetchAllNameValues (tag, - &BUILTIN_ATTRIBUTE_NAMES(builtin), &BUILTIN_ATTRIBUTE_VALUES(builtin), CS_FE_ASCII); + builtin->attributes.n = PA_FetchAllNameValues (tag, &builtin->attributes.names, + &builtin->attributes.values, CS_FE_ASCII); lo_FormatBuiltinInternal (context, state, tag, builtin, FALSE, FALSE); } @@ -102,18 +86,17 @@ lo_FormatBuiltin (MWContext *context, lo_DocState *state, PA_Tag *tag) void lo_appendParams (LO_BuiltinStruct *builtin, uint32 param_count, char **param_names, char **param_values) { - int32 newcount = BUILTIN_ATTRIBUTE_COUNT(builtin) + param_count; - int32 n = BUILTIN_ATTRIBUTE_COUNT(builtin); - BUILTIN_ATTRIBUTE_NAMES(builtin) = (char**)XP_REALLOC(BUILTIN_ATTRIBUTE_NAMES(builtin), - newcount * sizeof(char*)); - BUILTIN_ATTRIBUTE_VALUES(builtin) = (char**)XP_REALLOC(BUILTIN_ATTRIBUTE_VALUES(builtin), - newcount * sizeof(char*)); + lo_NVList* attributes = &builtin->attributes; + int32 newcount = attributes->n + param_count; + int32 n = attributes->n; + attributes->names = (char**)XP_REALLOC(attributes->names, newcount * sizeof(char*)); + attributes->values = (char**)XP_REALLOC(attributes->values, newcount * sizeof(char*)); while (n < newcount) { - *(BUILTIN_ATTRIBUTE_NAMES(builtin) + n) = XP_STRDUP(*(param_names + n - BUILTIN_ATTRIBUTE_COUNT(builtin))); - *(BUILTIN_ATTRIBUTE_VALUES(builtin) + n) = XP_STRDUP(*(param_values + n - BUILTIN_ATTRIBUTE_COUNT(builtin))); + *(attributes->names + n) = XP_STRDUP(*(param_names + n - attributes->n)); + *(attributes->values + n) = XP_STRDUP(*(param_values + n - attributes->n)); n++; } - BUILTIN_ATTRIBUTE_COUNT(builtin) = BUILTIN_ATTRIBUTE_COUNT(builtin) + param_count; + attributes->n = newcount; } @@ -130,12 +113,10 @@ lo_FormatBuiltinObject (MWContext *context, lo_DocState* state, printf ("lo_FormatBuiltinObject\n"); #endif - BUILTIN_ATTRIBUTE_COUNT(builtin) = 0; - BUILTIN_ATTRIBUTE_NAMES(builtin) = NULL; - BUILTIN_ATTRIBUTE_VALUES(builtin) = NULL; + LO_NVList_Init(&builtin->attributes); - BUILTIN_ATTRIBUTE_COUNT(builtin) = PA_FetchAllNameValues (tag, - &(BUILTIN_ATTRIBUTE_NAMES(builtin)), &(BUILTIN_ATTRIBUTE_VALUES(builtin)), CS_FE_ASCII); + builtin->attributes.n = PA_FetchAllNameValues (tag, &builtin->attributes.names, + &builtin->attributes.values, CS_FE_ASCII); if (param_count > 0) lo_appendParams(builtin, param_count, param_names, param_values); lo_FormatBuiltinInternal (context, state, tag, builtin, TRUE, streamStarted); @@ -221,7 +202,7 @@ lo_FormatBuiltinInternal (MWContext *context, lo_DocState *state, PA_Tag *tag, builtin->ele_attrmask |= LO_ELE_STREAM_STARTED; /* Convert any js in the values */ - lo_ConvertAllValues (context, BUILTIN_ATTRIBUTE_VALUES(builtin), BUILTIN_ATTRIBUTE_COUNT(builtin), + lo_ConvertAllValues (context, builtin->attributes.values, builtin->attributes.n, tag->newline_count); /* double-counting builtins? XXX */ diff --git a/mozilla/lib/layout/layembed.c b/mozilla/lib/layout/layembed.c index 5e66bd95add..6bdc65bd621 100644 --- a/mozilla/lib/layout/layembed.c +++ b/mozilla/lib/layout/layembed.c @@ -244,20 +244,12 @@ lo_FormatEmbed(MWContext *context, lo_DocState *state, PA_Tag *tag) embed->objTag.height = 0; embed->objTag.next = NULL; embed->objTag.prev = NULL; -#ifdef OJI + LO_NVList_Init( &embed->attributes ); LO_NVList_Init( &embed->parameters ); embed->attributes.n = PA_FetchAllNameValues(tag, &(embed->attributes.names), &(embed->attributes.values), CS_FE_ASCII); -#else - embed->attribute_cnt = 0; - embed->attribute_list = NULL; - embed->value_list = NULL; - - embed->attribute_cnt = PA_FetchAllNameValues(tag, - &(embed->attribute_list), &(embed->value_list), CS_FE_ASCII); -#endif lo_FormatEmbedInternal(context, state, tag, embed, FALSE, FALSE); #ifdef ANTHRAX @@ -276,21 +268,11 @@ lo_FormatEmbedObject(MWContext* context, lo_DocState* state, int32 typeIndex = -1; int32 classidIndex = -1; -#ifdef OJI LO_NVList_Init(&embed->attributes); embed->attributes.n = PA_FetchAllNameValues(tag, &(embed->attributes.names), &(embed->attributes.values), CS_FE_ASCII); -#else - embed->attribute_cnt = 0; - embed->attribute_list = NULL; - embed->value_list = NULL; - - embed->attribute_cnt = PA_FetchAllNameValues(tag, - &(embed->attribute_list), &(embed->value_list), CS_FE_ASCII); -#endif -#ifdef OJI for (count = 0; count < (uint32)embed->attributes.n; count++) { if ( (XP_STRCASECMP(embed->attributes.names[count], PARAM_MAYSCRIPT) == 0) @@ -298,22 +280,25 @@ lo_FormatEmbedObject(MWContext* context, lo_DocState* state, StrAllocCopy(embed->attributes.values[count], "true"); } } -#else + +/* beard: should the following still be used? */ +#if !defined(OJI) /* * Look through the parameters and replace "id" * with "name" and "data" with "src", so that * other code that looks up parameters by name * can believe this is a normal EMBED. */ - for (count = 0; count < (uint32)embed->attribute_cnt; count++) + for (count = 0; count < (uint32)embed->attributes.n; count++) { - if (XP_STRCASECMP(embed->attribute_list[count], PARAM_ID) == 0) - StrAllocCopy(embed->attribute_list[count], PARAM_NAME); - else if (XP_STRCASECMP(embed->attribute_list[count], PARAM_DATA) == 0) - StrAllocCopy(embed->attribute_list[count], "src"); - else if (XP_STRCASECMP(embed->attribute_list[count], PARAM_TYPE) == 0) + char* attrName = embed->attributes.names[count]; + if (XP_STRCASECMP(attrName, PARAM_ID) == 0) + StrAllocCopy(embed->attributes.names[count], PARAM_NAME); + else if (XP_STRCASECMP(attrName, PARAM_DATA) == 0) + StrAllocCopy(embed->attributes.names[count], "src"); + else if (XP_STRCASECMP(attrName, PARAM_TYPE) == 0) typeIndex = count; - else if (XP_STRCASECMP(embed->attribute_list[count], PARAM_CLASSID) == 0) + else if (XP_STRCASECMP(attrName, PARAM_CLASSID) == 0) classidIndex = count; } @@ -326,8 +311,8 @@ lo_FormatEmbedObject(MWContext* context, lo_DocState* state, if (typeIndex >= 0) { /* Change current value of TYPE to application/oleobject */ - if (XP_STRCASECMP(embed->value_list[typeIndex], APPLICATION_OLEOBJECT) != 0) - StrAllocCopy(embed->value_list[typeIndex], APPLICATION_OLEOBJECT); + if (XP_STRCASECMP(embed->attributes.values[typeIndex], APPLICATION_OLEOBJECT) != 0) + StrAllocCopy(embed->attributes.values[typeIndex], APPLICATION_OLEOBJECT); } else { @@ -337,34 +322,31 @@ lo_FormatEmbedObject(MWContext* context, lo_DocState* state, names[0] = XP_STRDUP(PARAM_TYPE); values[0] = XP_STRDUP(APPLICATION_OLEOBJECT); - lo_AppendParamList((uint32*) &(embed->attribute_cnt), - &(embed->attribute_list), - &(embed->value_list), + lo_AppendParamList((uint32*) &(embed->attributes.n), + &(embed->attributes.names), + &(embed->attributes.values), 1, names, values); } /* Lop off the "clsid:" prefix from the CLASSID attribute */ - if (XP_STRNCASECMP(embed->value_list[classidIndex], "clsid:", 6) == 0) + if (XP_STRNCASECMP(embed->attributes.values[classidIndex], "clsid:", 6) == 0) { - char* classID = &(embed->value_list[classidIndex][6]); - XP_MEMMOVE(embed->value_list[classidIndex], classID, + char* classID = &(embed->attributes.values[classidIndex][6]); + XP_MEMMOVE(embed->attributes.values[classidIndex], classID, (XP_STRLEN(classID) + 1) * sizeof(char)); } } -#endif +#endif /* !OJI */ /* * Merge any parameters passed in with the ones in this tag. * Separate the merged tag attributes from the * tag attributes with an extra "PARAM" attribute. */ -#ifdef OJI LO_NVList_Init(&embed->parameters); -#endif if (param_count > 0) { -#ifdef OJI int i; /* Add all tag parameters to the parameters list */ @@ -378,26 +360,6 @@ lo_FormatEmbedObject(MWContext* context, lo_DocState* state, param_values, param_count*sizeof(char*) ); embed->parameters.n = param_count; -#else - char* names[1]; - char* values[1]; - names[0] = XP_STRDUP(PT_PARAM); - values[0] = NULL; - - /* Add "PARAM" to the list */ - lo_AppendParamList((uint32*) &(embed->attribute_cnt), - &(embed->attribute_list), - &(embed->value_list), - 1, names, values); - - /* Add all tag paramters to the list */ - lo_AppendParamList((uint32*) &(embed->attribute_cnt), - &(embed->attribute_list), - &(embed->value_list), - param_count, - param_names, - param_values); -#endif /* OJI */ if (param_names != NULL) XP_FREE(param_names); @@ -444,13 +406,8 @@ lo_FormatEmbedInternal(MWContext *context, lo_DocState *state, PA_Tag *tag, /* * Convert any javascript in the values */ -#ifdef OJI lo_ConvertAllValues(context, embed->attributes.values, embed->attributes.n, tag->newline_count); -#else - lo_ConvertAllValues(context, embed->value_list, embed->attribute_cnt, - tag->newline_count); -#endif /* don't double-count loading plugins due to table relayout */ if (!state->in_relayout) diff --git a/mozilla/lib/layout/layfree.c b/mozilla/lib/layout/layfree.c index 1874c45d57d..137e12ffbb9 100644 --- a/mozilla/lib/layout/layfree.c +++ b/mozilla/lib/layout/layfree.c @@ -36,9 +36,8 @@ extern void NPL_DeleteSessionData(MWContext*, void*); #pragma profile on #endif -#ifdef OJI static void -lo_FreeNVListItems(struct lo_NVList* list) +lo_FreeNVListItems(lo_NVList* list) { if (list->names != NULL) @@ -69,7 +68,6 @@ lo_FreeNVListItems(struct lo_NVList* list) } list->n = 0; } -#endif void lo_FreeFormElementData(LO_FormElementData *element_data) @@ -520,40 +518,9 @@ lo_ScrapeElement(MWContext *context, LO_Element *element, Bool freeTableOrCellSt PA_FREE(element->lo_embed.embed_src); } element->lo_embed.embed_src = NULL; -#ifdef OJI + lo_FreeNVListItems( &element->lo_embed.attributes ); lo_FreeNVListItems( &element->lo_embed.parameters ); -#else - /* Free all the attribute names */ - if (element->lo_embed.attribute_list != NULL) - { - int32 current; - - for (current=0; currentlo_embed.attribute_cnt; current++) - { - PA_FREE(element->lo_embed.attribute_list[current]); - element->lo_embed.attribute_list[current] = NULL; - } - - PA_FREE(element->lo_embed.attribute_list); - element->lo_embed.attribute_list = NULL; - } - - /* Free all the attribute values */ - if (element->lo_embed.value_list != NULL) - { - int32 current; - - for (current=0; currentlo_embed.attribute_cnt; current++) - { - PA_FREE(element->lo_embed.value_list[current]); - element->lo_embed.value_list[current] = NULL; - } - - PA_FREE(element->lo_embed.value_list); - element->lo_embed.value_list = NULL; - } -#endif /* OJI */ /* * If there is session data here after we @@ -597,41 +564,12 @@ lo_ScrapeElement(MWContext *context, LO_Element *element, Bool freeTableOrCellSt element->lo_java.attr_name = NULL; } if (element->lo_java.objTag.base_url != NULL) - { + { PA_FREE(element->lo_java.objTag.base_url); element->lo_java.objTag.base_url = NULL; - } -#ifdef OJI - lo_FreeNVListItems( &element->lo_java.attributes ); - lo_FreeNVListItems( &element->lo_java.parameters ); -#else - if (element->lo_java.param_names != NULL) - { - int32 current; - - for (current=0; currentlo_java.param_cnt; current++) - { - PA_FREE(element->lo_java.param_names[current]); - element->lo_java.param_names[current] = NULL; - } - - PA_FREE(element->lo_java.param_names); - element->lo_java.param_names = NULL; - } - if (element->lo_java.param_values != NULL) - { - int32 current; - - for (current=0; currentlo_java.param_cnt; current++) - { - PA_FREE(element->lo_java.param_values[current]); - element->lo_java.param_values[current] = NULL; - } - - PA_FREE(element->lo_java.param_values); - element->lo_java.param_values = NULL; - } -#endif /* OJI */ + } + lo_FreeNVListItems( &element->lo_java.attributes ); + lo_FreeNVListItems( &element->lo_java.parameters ); /* * If there is session data here after we diff --git a/mozilla/lib/layout/layjava.c b/mozilla/lib/layout/layjava.c index cfd41ec6f23..db4a1a2d266 100644 --- a/mozilla/lib/layout/layjava.c +++ b/mozilla/lib/layout/layjava.c @@ -201,14 +201,8 @@ lo_FormatJavaAppInternal(MWContext *context, lo_DocState *state, PA_Tag *tag, LO java_app->attr_archive = NULL; java_app->attr_name = NULL; -#ifdef OJI LO_NVList_Init( &java_app->attributes ); LO_NVList_Init( &java_app->parameters ); -#else - java_app->param_cnt = 0; - java_app->param_names = NULL; - java_app->param_values = NULL; -#endif java_app->may_script = FALSE; diff --git a/mozilla/lib/layout/layobj.c b/mozilla/lib/layout/layobj.c index 03bdf02cb12..9cfe5f12ae3 100644 --- a/mozilla/lib/layout/layobj.c +++ b/mozilla/lib/layout/layobj.c @@ -712,7 +712,6 @@ void lo_DeleteObjectStack(lo_ObjectStack* top) { /* Delete parameters */ -#ifdef OJI if (top->parameters.n > 0) { uint32 index; @@ -737,32 +736,6 @@ lo_DeleteObjectStack(lo_ObjectStack* top) XP_FREE(top->parameters.values); } } -#else - if (top->param_count > 0) - { - uint32 index; - - if (top->param_values != NULL) - { - for (index = 0; index < top->param_count; index++) - { - if (top->param_names[index] != NULL) - XP_FREE(top->param_names[index]); - } - XP_FREE(top->param_names); - } - - if (top->param_values != NULL) - { - for (index = 0; index < top->param_count; index++) - { - if (top->param_values[index] != NULL) - XP_FREE(top->param_values[index]); - } - XP_FREE(top->param_values); - } - } -#endif /* OJI */ /* Delete tag copy */ if (top->clone_tag != NULL) @@ -913,44 +886,24 @@ lo_ProcessObjectTag(MWContext* context, lo_DocState* state, PA_Tag* tag, XP_Bool top->clone_tag, (LO_EmbedStruct*) object, FALSE, /* Stream not started */ -#ifdef OJI top->parameters.n, top->parameters.names, top->parameters.values); - top->formatted_object = TRUE; - LO_NVList_Init( &top->parameters ); -#else - top->param_count, - top->param_names, - top->param_values); top->formatted_object = TRUE; - top->param_count = 0; - top->param_names = NULL; - top->param_values = NULL; -#endif /* OJI */ + LO_NVList_Init( &top->parameters ); } else if (object->lo_element.type == LO_BUILTIN) { lo_FormatBuiltinObject(context, - state, - top->clone_tag, - (LO_BuiltinStruct*) object, - FALSE, /* Stream not started */ -#ifdef OJI - top->parameters.n, - top->parameters.names, - top->parameters.values); + state, + top->clone_tag, + (LO_BuiltinStruct*) object, + FALSE, /* Stream not started */ + top->parameters.n, + top->parameters.names, + top->parameters.values); top->formatted_object = TRUE; - LO_NVList_Init( &top->parameters ); -#else - top->param_count, - top->param_names, - top->param_values); - top->formatted_object = TRUE; - top->param_count = 0; - top->param_names = NULL; - top->param_values = NULL; -#endif /* OJI */ + LO_NVList_Init( &top->parameters ); } #ifdef JAVA @@ -990,15 +943,9 @@ lo_ProcessParamTag(MWContext* context, lo_DocState* state, PA_Tag* tag, XP_Bool { LO_JavaAppStruct* java_app = state->current_java; lo_ObjectParam(context, state, tag, -#ifdef OJI (uint32*) &(java_app->parameters.n), &(java_app->parameters.names), &(java_app->parameters.values)); -#else - (uint32*) &(java_app->param_cnt), - &(java_app->param_names), - &(java_app->param_values)); -#endif /* OJI */ } else @@ -1006,17 +953,10 @@ lo_ProcessParamTag(MWContext* context, lo_DocState* state, PA_Tag* tag, XP_Bool if (top != NULL && top->read_params == FALSE) { -#ifdef OJI lo_ObjectParam(context, state, tag, &(top->parameters.n), &(top->parameters.names), &(top->parameters.values)); -#else - lo_ObjectParam(context, state, tag, - &(top->param_count), - &(top->param_names), - &(top->param_values)); -#endif /* OJI */ } } } @@ -1093,7 +1033,6 @@ LO_NewObjectStream(FO_Present_Types format_out, void* type, /* Now we know the object type */ top->object->lo_element.lo_plugin.type = LO_EMBED; -#ifdef OJI lo_FormatEmbedObject(top->context, top->state, top->clone_tag, @@ -1102,22 +1041,8 @@ LO_NewObjectStream(FO_Present_Types format_out, void* type, top->parameters.n, top->parameters.names, top->parameters.values); - top->parameters.n = 0; - top->parameters.names = NULL; - top->parameters.values = NULL; -#else - lo_FormatEmbedObject(top->context, - top->state, - top->clone_tag, - (LO_EmbedStruct*) top->object, - TRUE, - top->param_count, - top->param_names, - top->param_values); - top->param_count = 0; - top->param_names = NULL; - top->param_values = NULL; -#endif + + LO_NVList_Init(&top->parameters); top->formatted_object = TRUE; /* Set the FE data that libplug expects */ @@ -1408,7 +1333,6 @@ static void lo_SetJavaArgs(char* tag, LO_JavaAppStruct* current_java) } /* increment and resize array */ -#ifdef OJI ++(current_java->parameters.n); current_java->parameters.names = XP_REALLOC(current_java->parameters.names, current_java->parameters.n*sizeof(char*)); XP_ASSERT(current_java->parameters.names); @@ -1418,17 +1342,6 @@ static void lo_SetJavaArgs(char* tag, LO_JavaAppStruct* current_java) /* point the new array elements to the newly allocated paramName and paramValue */ current_java->parameters.names[current_java->parameters.n-1] = paramName; current_java->parameters.values[current_java->parameters.n-1] = paramValue; -#else - ++(current_java->param_count); - current_java->param_names = XP_REALLOC(current_java->param_names, current_java->param_count*sizeof(char*)); - XP_ASSERT(current_java->param_names); - current_java->param_values = XP_REALLOC(current_java->param_values, current_java->param_count*sizeof(char*)); - XP_ASSERT(current_java->param_values); - - /* point the new array elements to the newly allocated paramName and paramValue */ - current_java->param_names[current_java->param_count-1] = paramName; - current_java->param_values[current_java->param_count-1] = paramValue; -#endif } } #endif diff --git a/mozilla/lib/layout/layout.h b/mozilla/lib/layout/layout.h index ee618db9cd1..51dd7b9950e 100644 --- a/mozilla/lib/layout/layout.h +++ b/mozilla/lib/layout/layout.h @@ -204,13 +204,7 @@ typedef struct lo_LayerStack lo_LayerStack; typedef struct lo_ObjectStack_struct { LO_ObjectStruct *object; struct lo_ObjectStack_struct *next; -#ifdef OJI - struct lo_NVList parameters; -#else - uint32 param_count; - char **param_names; - char **param_values; -#endif + lo_NVList parameters; char* data_url; MWContext* context; struct lo_DocState_struct* state; diff --git a/mozilla/lib/libmocha/lm_embed.c b/mozilla/lib/libmocha/lm_embed.c index bbbb2e58e9b..dcea423bef1 100644 --- a/mozilla/lib/libmocha/lm_embed.c +++ b/mozilla/lib/libmocha/lm_embed.c @@ -316,21 +316,12 @@ LM_ReflectEmbed(MWContext *context, LO_EmbedStruct *lo_embed, /* get the name */ name = 0; -#ifdef OJI for (i = 0; i < lo_embed->attributes.n; i++) { if (!XP_STRCASECMP(lo_embed->attributes.names[i], "name")) { name = strdup(lo_embed->attributes.values[i]); break; } } -#else - for (i = 0; i < lo_embed->attribute_cnt; i++) { - if (!XP_STRCASECMP(lo_embed->attribute_list[i], "name")) { - name = strdup(lo_embed->value_list[i]); - break; - } - } -#endif /* !OJI */ /* Get the document object that will hold this applet */ document = lm_GetDocumentFromLayerId(decoder, layer_id); diff --git a/mozilla/lib/xlate/print.c b/mozilla/lib/xlate/print.c index 63e2e911824..1be4c7f85de 100644 --- a/mozilla/lib/xlate/print.c +++ b/mozilla/lib/xlate/print.c @@ -1984,15 +1984,9 @@ PSFE_GetEmbedSize (MWContext *context, LO_EmbedStruct *embed_struct, } /* Determine if this is a fullpage plugin */ -#ifdef OJI if ((embed_struct->attributes.n > 0) && (!strcmp(embed_struct->attributes.names[0], "src")) && (!strcmp(embed_struct->attributes.values[0], "internal-external-plugin"))) -#else - if ((embed_struct->attribute_cnt > 0) && - (!strcmp(embed_struct->attribute_list[0], "src")) && - (!strcmp(embed_struct->value_list[0], "internal-external-plugin"))) -#endif { embed_struct->objTag.width = context->prInfo->page_width; embed_struct->objTag.height = context->prInfo->page_height; diff --git a/mozilla/modules/plugin/src/npglue.cpp b/mozilla/modules/plugin/src/npglue.cpp index d3c1b36ed79..89df366da60 100644 --- a/mozilla/modules/plugin/src/npglue.cpp +++ b/mozilla/modules/plugin/src/npglue.cpp @@ -2819,15 +2819,10 @@ np_newinstance(np_handle *handle, MWContext *cx, NPEmbeddedApp *app, if (instance->type == NP_EMBED) { /* Embedded plug-ins get their attributes passed in from layout */ -#ifdef OJI int16 argc = (int16) ndata->lo_struct->attributes.n; char** names = ndata->lo_struct->attributes.names; char** values = ndata->lo_struct->attributes.values; -#else - int16 argc = (int16) ndata->lo_struct->attribute_cnt; - char** names = ndata->lo_struct->attribute_list; - char** values = ndata->lo_struct->value_list; -#endif + err = CallNPP_NewProc(handle->f->newp, requestedType, npp, instance->type, argc, names, values, savedData); } @@ -4409,7 +4404,6 @@ np_findTypeAttribute(LO_EmbedStruct* embed_struct) unsigned int i; /* Look for the TYPE attribute */ -#ifdef OJI for (i = 0; i < embed_struct->attributes.n; i++) { if (XP_STRCASECMP(embed_struct->attributes.names[i], "TYPE") == 0) @@ -4418,16 +4412,6 @@ np_findTypeAttribute(LO_EmbedStruct* embed_struct) break; } } -#else - for (i = 0; i < embed_struct->attribute_cnt; i++) - { - if (XP_STRCASECMP(embed_struct->attribute_list[i], "TYPE") == 0) - { - typeAttribute = embed_struct->value_list[i]; - break; - } - } -#endif return typeAttribute; } diff --git a/mozilla/modules/plugin/src/nsplugin.cpp b/mozilla/modules/plugin/src/nsplugin.cpp index 897c2b69e6d..f25416a4edf 100644 --- a/mozilla/modules/plugin/src/nsplugin.cpp +++ b/mozilla/modules/plugin/src/nsplugin.cpp @@ -963,17 +963,9 @@ nsPluginTagInfo::GetAttributes(PRUint16& n, if (instance->type == NP_EMBED) { np_data* ndata = (np_data*)instance->app->np_data; -#ifdef OJI names = (const char*const*)ndata->lo_struct->attributes.names; values = (const char*const*)ndata->lo_struct->attributes.values; n = (PRUint16)ndata->lo_struct->attributes.n; -#else - // XXX I think all the parameters and attributes just get - // munged together under MOZ_JAVA... - names = (const char*const*) ndata->lo_struct->attribute_list; - values = (const char*const*) ndata->lo_struct->value_list; - n = (PRUint16) ndata->lo_struct->attribute_cnt; -#endif return NS_OK; } else { @@ -1060,17 +1052,9 @@ nsPluginTagInfo::GetParameters(PRUint16& n, if (instance->type == NP_EMBED) { np_data* ndata = (np_data*)instance->app->np_data; -#ifdef OJI names = (const char*const*)ndata->lo_struct->parameters.names; values = (const char*const*)ndata->lo_struct->parameters.values; n = (PRUint16)ndata->lo_struct->parameters.n; -#else - // XXX I think all the parameters and attributes just get - // munged together under MOZ_JAVA... - names = (const char*const*) ndata->lo_struct->attribute_list; - values = (const char*const*) ndata->lo_struct->value_list; - n = (PRUint16)ndata->lo_struct->attribute_cnt; -#endif return NS_OK; } else {