LO_GetBuiltinByIndex should not be ifdef JAVA or OJI.

git-svn-id: svn://10.0.0.236/trunk@11541 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
brendan%netscape.com 1998-09-30 07:06:56 +00:00
parent a54d63b69f
commit 35c54850af

View File

@ -694,40 +694,6 @@ LO_GetEmbedByIndex(MWContext *context, int32 layer_id, uint index)
return NULL;
}
LO_BuiltinStruct *
LO_GetBuiltinByIndex(MWContext *context, int32 layer_id, uint index)
{
lo_TopState *top_state;
LO_BuiltinStruct *builtin;
int i, count;
lo_DocLists *doc_lists;
top_state = lo_GetTopState(context);
if (top_state == NULL)
return NULL;
doc_lists = lo_GetDocListsById(top_state->doc_state, layer_id);
if (!doc_lists)
return NULL;
/* count 'em */
count = 0;
builtin = doc_lists->builtin_list;
while (builtin) {
builtin = builtin->nextBuiltin;
count++;
}
/* reverse order... */
builtin = doc_lists->builtin_list;
for (i = count-1; i >= 0; i--) {
if ((uint)i == index)
return builtin;
builtin = builtin->nextBuiltin;
}
return NULL;
}
uint
LO_EnumerateEmbeds(MWContext *context, int32 layer_id)
{
@ -771,7 +737,41 @@ LO_EnumerateEmbeds(MWContext *context, int32 layer_id)
return count;
}
#endif /* JAVA */
#endif /* JAVA || OJI */
LO_BuiltinStruct *
LO_GetBuiltinByIndex(MWContext *context, int32 layer_id, uint index)
{
lo_TopState *top_state;
LO_BuiltinStruct *builtin;
int i, count;
lo_DocLists *doc_lists;
top_state = lo_GetTopState(context);
if (top_state == NULL)
return NULL;
doc_lists = lo_GetDocListsById(top_state->doc_state, layer_id);
if (!doc_lists)
return NULL;
/* count 'em */
count = 0;
builtin = doc_lists->builtin_list;
while (builtin) {
builtin = builtin->nextBuiltin;
count++;
}
/* reverse order... */
builtin = doc_lists->builtin_list;
for (i = count-1; i >= 0; i--) {
if ((uint)i == index)
return builtin;
builtin = builtin->nextBuiltin;
}
return NULL;
}
/* XXX lo_DocState should use a colors[LO_NCOLORS] array to shrink code here