ui/common/context.c

changeset 476
31213068c2ba
parent 474
971dd0f3a117
child 486
a5f3abf8b9d1
equal deleted inserted replaced
475:8e06a446d552 476:31213068c2ba
137 } 137 }
138 } 138 }
139 139
140 void uic_context_detach_document2(UiContext *ctx, void *document) { 140 void uic_context_detach_document2(UiContext *ctx, void *document) {
141 // find the document in the documents list 141 // find the document in the documents list
142 ssize_t docIndex = cxListFind(ctx->documents, document); 142 size_t docIndex = cxListFind(ctx->documents, document);
143 if(docIndex < 0) { 143 if(!cxListIndexValid(ctx->documents, docIndex)) {
144 return; 144 return;
145 } 145 }
146 146
147 cxListRemove(ctx->documents, docIndex); 147 cxListRemove(ctx->documents, docIndex);
148 ctx->document = cxListAt(ctx->documents, 0); 148 ctx->document = cxListAt(ctx->documents, 0);

mercurial