@@ -409,7 +409,59 @@ static test_result test_move(char* msg)
409
409
410
410
static test_result test_search (char * msg )
411
411
{
412
- return _test_not_implemented (msg ); // TODO
412
+ static char buf_stylesxml [] = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
413
+ "<styleSheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" mc:Ignorable=\"x14ac\" xmlns:x14ac=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac\">"
414
+ "<fonts count=\"1\" x14ac:knownFonts=\"1\">"
415
+ "<font>"
416
+ "<sz val=\"11\"/>"
417
+ "<color theme=\"1\"/>"
418
+ "<name val=\"Calibri\"/>"
419
+ "<family val=\"2\"/>"
420
+ "<scheme val=\"minor\"/>"
421
+ "</font>"
422
+ "</fonts>"
423
+ "<fills count=\"2\">"
424
+ "<fill><patternFill patternType=\"none\"/></fill>"
425
+ "<fill><patternFill patternType=\"gray125\"/></fill>"
426
+ "</fills>"
427
+ "<borders count=\"1\">"
428
+ "<border><left/><right/><top/><bottom/><diagonal/></border>"
429
+ "</borders>"
430
+ "<cellStyleXfs count=\"1\">"
431
+ "<xf numFmtId=\"0\" fontId=\"0\" fillId=\"0\" borderId=\"0\"/>"
432
+ "</cellStyleXfs>"
433
+ "<cellXfs count=\"1\">"
434
+ "<xf numFmtId=\"0\" fontId=\"0\" fillId=\"0\" borderId=\"0\" xfId=\"0\"/>"
435
+ "</cellXfs>"
436
+ "<cellStyles count=\"1\">"
437
+ "<cellStyle name=\"Normal\" xfId=\"0\" builtinId=\"0\"/>"
438
+ "</cellStyles>"
439
+ "<dxfs count=\"0\"/>"
440
+ "<tableStyles count=\"0\" defaultTableStyle=\"TableStyleMedium2\" defaultPivotStyle=\"PivotStyleMedium9\"/>"
441
+ "<extLst>"
442
+ "<ext uri=\"{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}\" xmlns:x14=\"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main\">"
443
+ "<x14:slicerStyles defaultSlicerStyle=\"SlicerStyleLight1\"/>"
444
+ "</ext>"
445
+ "<ext uri=\"{9260A510-F301-46a8-8635-F512D64BE5F5}\" xmlns:x15=\"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main\">"
446
+ "<x15:timelineStyles defaultTimelineStyle=\"TimeSlicerStyleLight1\"/>"
447
+ "</ext>"
448
+ "</extLst>"
449
+ "</styleSheet>" ;
450
+ XMLDoc styles_xml ;
451
+ XMLDoc_init (& styles_xml );
452
+ XMLDoc_parse_buffer_DOM (buf_stylesxml , "styles.xml" , & styles_xml );
453
+
454
+ // start the search for cellXfs
455
+ XMLSearch search_engine ;
456
+ XMLSearch_init (& search_engine );
457
+ XMLSearch_search_set_tag (& search_engine , "cellXfs" );
458
+ XMLNode * cell_xfs_node = XMLSearch_next (styles_xml .nodes [styles_xml .i_root ], & search_engine );
459
+
460
+ assert_true (cell_xfs_node != NULL , TEST_ERROR , "Node cellXfs not found" , NOP );
461
+
462
+ // TODO: More tests
463
+
464
+ return TEST_OK ;
413
465
}
414
466
415
467
0 commit comments