merge the formfield patch from ooo-build
[ooovba.git] / testautomation / xml / optional / includes / sxc7_01.inc
blob8008b8c417e8d4c3d07deeb9f7723dee190f8295
1 'encoding UTF-8  Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 '* 
5 '* Copyright 2008 by Sun Microsystems, Inc.
6 '*
7 '* OpenOffice.org - a multi-platform office productivity suite
8 '*
9 '* $RCSfile: sxc7_01.inc,v $
11 '* $Revision: 1.2 $
13 '* last change: $Author: rt $ $Date: 2008-07-11 07:31:25 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org.  If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : oliver.creamer@sun.com
36 '* short description : XML Calc Include File
38 '\***********************************************************************************
39    Dim Isliste(250) as string
40    Dim OutputPath as string
42 sub sxc7_01
44    printlog "--------------------------- sxc_01.inc ------------------------------"
45    printlog "------------------------ Alien Attributes ---------------------------"
46    call tAlienAttributes
47    printlog "---------------------- File Format Changes --------------------------"
48    call tfeat906
49    printlog "------------------------------ Cells --------------------------------"
50    call tCellformats1
52    call tCellformats2
53    call tCellformats3
55 end sub
57 '-------------------------------------------------------------------------
58 testcase tAlienAttributes
59     Dim i as integer
60     Dim a as integer
61     Dim c as integer
62     Dim xXMLStyleName as string
63     Dim xPath as string
64     Dim AttrNameInDOM as string
65     Dim AttributeSearch(50) as string
66     Dim AttributeValue(50) as string
67     
68     printlog "+- alien_attributes.sxc"
69     call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\ooo10\alien_attributes.sxc"))
70     if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes.sxc") , "StarOffice XML (Calc)") then
71         '/// Closing the document also if there is a verification dialog.
72         call hCloseDocument()
73         sleep(3)     
74         UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes") )
75         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes\styles.xml")) = FALSE then
76             warnlog "XML-file 'styles.xml' not well formed!"
77         end if
78         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes\meta.xml")) = FALSE then
79             warnlog "XML-file 'meta.xml' not well formed!"
80         end if
81         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes\content.xml")) = FALSE then
82             warnlog "XML-file 'content.xml' not well formed!"
83         else
84             call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes.sxc"))
85             sleep(2)
86             call hCloseDocument
87             sleep(2)
88             SAXReadFile(gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes\content.xml"))
89             printlog "-----------------"
90             printlog "Hidden Namespaces"
91             printlog "-----------------"
92             '/// <u><b>content.xml</u></b>
93             '/// <u>Hidden attributes in namespaces</u>
94             '///+ Searching for: xmlns:foo=&quot;http://openoffice.org/2000/foo&quot;
95             '///+ Searching for: xmlns:bla=&quot;http://openoffice.org/2000/bla&quot;
96             '-------------------------------------------------------------------------
97             AttributeSearch(1) = "xmlns:foo"
98             AttributeValue(1) = "http://openoffice.org/2000/foo"
100             AttributeSearch(2) = "xmlns:bla"
101             AttributeValue(2) = "http://openoffice.org/2000/bla"
102             printlog "++ Feature(s) to be searched for:"
103             printlog " |"
104             '-------------------------------------------------------------------------
105             SAXSeekElement("office:document-content")
106             for i = 1 to 2
107                 printlog " +- " & AttributeSearch(i)
108                 if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then
109                     warnlog "Hidden attributes (in namespace): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!"
110                 end if
111             next i
112             printlog "    * * *"
113             '/// <u>hidden attributes</u>
114             '///+<ol><li><b>in a cell style</b></li>
115             '///+<li><b>in a paragraph style (twice)</b></li>
116             '///+<li><b>in a text style (twice)</b></li>
117             '///+<li><b>in a graphic style</b></li></ol>
118             '///+ Searching for: bla=&quot;holla&quot;
119             '///+ Searching for: bla1=&quot;holla1&quot;
120             '///+ Searching for: bla2=&quot;holla2&quot;
121             '///+ Searching for: foo:foobla=&quot;holla&quot;
122             '///+ Searching for: foo:foobla1=&quot;holla1&quot;
123             '///+ Searching for: foo:foobla2=&quot;holla2&quot;
124             '///+ Searching for: bla:blabla=&quot;holla&quot;
125             '///+ Searching for: bla:blabla1=&quot;holla1&quot;
126             '///+ Searching for: bla:blabla2=&quot;holla2&quot;
127             AttributeSearch(1) = "bla"
128             AttributeValue(1) = "holla"
129             AttributeSearch(2) = "bla1"
130             AttributeValue(2) = "holla1"
131             AttributeSearch(3) = "bla2"
132             AttributeValue(3) = "holla2"
133             AttributeSearch(4) = "foo:foobla"
134             AttributeValue(4) = "holla"
135             AttributeSearch(5) = "foo:foobla1"
136             AttributeValue(5) = "holla1"
137             AttributeSearch(6) = "foo:foobla2"
138             AttributeValue(6) = "holla2"
139             AttributeSearch(7) = "bla:blabla"
140             AttributeValue(7) = "holla"
141             AttributeSearch(8) = "bla:blabla1"
142             AttributeValue(8) = "holla1"
143             AttributeSearch(9) = "bla:blabla2"
144             AttributeValue(9) = "holla2"
145             '-------------------------------------------------------------------------
146             printlog "++ Feature(s) to be searched for:"
147             printlog " |"
148             '-------------------------------------------------------------------------
149             for c = 1 to 6
150                 if c = 1 then
151                     printlog "---------------------------------------"
152                     printlog "Hidden attributes in a cell style"
153                     printlog "---------------------------------------"
154                 end if
155                 if c = 2 OR c = 3 then
156                     printlog "---------------------------------------"
157                     printlog "Hidden attributes in a paragraph style (" & c-1 & ")"
158                     printlog "---------------------------------------"
159                 end if
160                 if c = 4 or c = 5 then
161                     printlog "---------------------------------------"
162                     printlog "Hidden attributes in a text style (" & c-3 & ")"
163                     printlog "---------------------------------------"
164                 end if
165                 if c = 6 then
166                     printlog "---------------------------------------"
167                     printlog "Hidden attributes in a graphic style"
168                     printlog "---------------------------------------"
169                 end if
170                 SAXSeekElement("/")
171                 SAXSeekElement("office:document-content")
172                 SAXSeekElement("office:automatic-styles")
173                 'The hidden attributes are in a known sequence included,
174                 'so the same routine will be used for different styles!
175       
176                 'Note: The first four style:style elements do not have any hidden attributes -> 4+c.
177                 SAXSeekElement("style:style" , 4+c )
178                 AttrNameInDOM = SAXGetAttributeValue("style:name")
179                 printlog " + Style name: " & AttrNameInDOM
180                 printlog " |"
181                 SAXSeekElement("style:properties")
182                 for i = 1 to 9
183                     printlog " +- " & AttributeSearch(i)
184                     if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then
185                         'c = <nr> means <nr>'th+4 style:style in DOM tree
186                         if c = 1 then 
187                             warnlog "Hidden attributes (in a cell style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!"
188                         end if
189                         if c = 2 or c = 3 then 
190 '                            warnlog "Hidden attributes (in a paragraph style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!"
191                                                         warnlog "#i100879# : Hidden attributes (in a paragraph style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!"
192                         end if
193                         if c = 4 or c = 5 then 
194                             warnlog "Hidden attributes (in a text style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!"
195                         end if
196                         if c = 6 then 
197                             warnlog "Hidden attributes (in a graphic style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!"
198                         end if
199                     end if
200                 next i
201             next c
202             SAXSeekElement("/")
203             printlog "    * * *"
204             '-------------------------------------------------------------------------
205             SAXRelease()
206             SAXReadFile(gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes\styles.xml"))
207             '-------------------------------------------------------------------------
208             printlog "    -------------------"
209             printlog "    s t y l e s . x m l"
210             printlog "    -------------------"
211             printlog "-----------------"
212             printlog "Hidden Namespaces"
213             printlog "-----------------"
214             '/// <u><b>styles.xml</u></b>
215             '/// <u>Hidden attributes in namespaces</u>
216             '///+ Searching for: xmlns:foo=&quot;http://openoffice.org/2000/foo&quot;
217             '///+ Searching for: xmlns:bla=&quot;http://openoffice.org/2000/bla&quot;
218             '-------------------------------------------------------------------------
219             AttributeSearch(1) = "xmlns:foo"
220             AttributeValue(1) = "http://openoffice.org/2000/foo"
222             AttributeSearch(2) = "xmlns:bla"
223             AttributeValue(2) = "http://openoffice.org/2000/bla"
224             printlog "++ Feature(s) to be searched for:"
225             printlog " |"
226             '-------------------------------------------------------------------------
227             SAXSeekElement("office:document-styles")
228             for i = 1 to 2
229                 printlog " +- " & AttributeSearch(i)
230                 if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then
231                     warnlog "Hidden attributes (in namespace): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!"
232                 end if
233             next i
234             printlog "    * * *"
235             SAXSeekElement("/")
236             '-------------------------------------------------------------------------
237             '/// <u>hidden attributes</u>
238             '///+<ol><li><b>in a table cell template style</b></li>
239             '///+<li><b>in a master page template style</b></li></ol>
240             '///+ Searching for: bla=&quot;holla&quot;
241             '///+ Searching for: bla1=&quot;holla1&quot;
242             '///+ Searching for: bla2=&quot;holla2&quot;
243             '///+ Searching for: foo:foobla=&quot;holla&quot;
244             '///+ Searching for: foo:foobla1=&quot;holla1&quot;
245             '///+ Searching for: foo:foobla2=&quot;holla2&quot;
246             '///+ Searching for: bla:blabla=&quot;holla&quot;
247             '///+ Searching for: bla:blabla1=&quot;holla1&quot;
248             '///+ Searching for: bla:blabla2=&quot;holla2&quot;
249             AttributeSearch(1) = "bla"
250             AttributeValue(1) = "holla"
251             AttributeSearch(2) = "bla1"
252             AttributeValue(2) = "holla1"
253             AttributeSearch(3) = "bla2"
254             AttributeValue(3) = "holla2"
255             AttributeSearch(4) = "foo:foobla"
256             AttributeValue(4) = "holla"
257             AttributeSearch(5) = "foo:foobla1"
258             AttributeValue(5) = "holla1"
259             AttributeSearch(6) = "foo:foobla2"
260             AttributeValue(6) = "holla2"
261             AttributeSearch(7) = "bla:blabla"
262             AttributeValue(7) = "holla"
263             AttributeSearch(8) = "bla:blabla1"
264             AttributeValue(8) = "holla1"
265             AttributeSearch(9) = "bla:blabla2"
266             AttributeValue(9) = "holla2"
267             '-------------------------------------------------------------------------
268             printlog "++ Feature(s) to be searched for:"
269             printlog " |"
270             '-------------------------------------------------------------------------
271             for c = 1 to 2
272                 SAXSeekElement("/")
273                 if c = 1 then
274                     printlog "-----------------------------------------------"
275                     printlog "Hidden attributes in a template of a cell style"
276                     printlog "-----------------------------------------------"
277                     SAXSeekElement("office:document-styles")
278                     SAXSeekElement("office:styles")
279                     SAXSeekElement("style:style" , 2)
280                     AttrNameInDOM = SAXGetAttributeValue("style:name")
281                     printlog " + Style name: " & AttrNameInDOM
282                     printlog " |"
283                 end if
284                 if c = 2 then
285                     printlog "------------------------------------------------------"
286                     printlog "Hidden attributes in a template of a master page style"
287                     printlog "------------------------------------------------------"
288                     SAXSeekElement("office:document-styles")
289                     SAXSeekElement("office:automatic-styles")
290                     SAXSeekElement("style:page-master")
291                     AttrNameInDOM = SAXGetAttributeValue("style:name")
292                     printlog " + Style name: " & AttrNameInDOM
293                     printlog " |"
294                 end if
295                 SAXSeekElement("style:properties")
296                 for i = 1 to 9
297                     printlog " +- " & AttributeSearch(i)
298                     if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then
299                         if c = 1 then 
300                             warnlog "Hidden attributes (in a template of a cell style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!"
301                         end if
302                         if c = 2 then 
303                             warnlog "Hidden attributes (in a template of a master page style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!"
304                         end if
305                     end if
306                 next i
307             next c
308             SAXSeekElement("/")
309             '-------------------------------------------------------------------------
310             printlog "    * * *"
311             SAXRelease()
312         end if
313     else
314         call hCloseDocument
315     end if
316 endcase
318 '-------------------------------------------------------------------------
320 testcase tfeat906
321     Dim i as integer
322     Dim a as integer
323     Dim c as integer
324     Dim xXMLStyleName as string
325     Dim xPath as string
326     Dim AttrNameInDOM as string
327     Dim AttributeSearch(50) as string
328     Dim AttributeValue(50) as string
330     printlog "+- feat906.sxc"
331     call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\ooo10\feat906.sxc"))
332     if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\feat906.sxc") , "StarOffice XML (Calc)") then
333         '/// Closing the document also if there is a verification dialog.
334         call hCloseDocument()
335         sleep(3)     
336         UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\feat906.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\feat906") )
337         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\feat906\styles.xml")) = FALSE then
338             warnlog "XML-file 'styles.xml' not well formed!"
339         end if
340         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\feat906\meta.xml")) = FALSE then
341             warnlog "XML-file 'meta.xml' not well formed!"
342         end if
343         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\feat906\content.xml")) = FALSE then
344             warnlog "XML-file 'content.xml' not well formed!"
345         else
346             call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\feat906.sxc"))
347             sleep(2)
348             call hCloseDocument
349             sleep(2)
350             SAXReadFile(gOfficePath & ConvertPath("user\work\xml\calc\level1\feat906\content.xml"))
351             printlog "-------------------------------"
352             printlog "draw:notify-on-update-of-ranges"
353             printlog "-------------------------------"
354             '/// <u><b>content.xml</u></b>
355             '/// <u>draw:notify-on-update-of-ranges</u>
356             '/// <i>Feature (Change) 906</i>
357             '///+  <blockquote>The draw:object got a new attribute. This attribute is only
358             '///+ on chart objects given. It gives the ranges or tablenames
359             '///+ of the chart (the ranges or tablenames the chart is
360             '///+ connected to). If the attribute is not given the object
361             '///+ will be loaded otherwise the object is only loaded if in
362             '///+ the ranges or tables is something changed or the object is
363             '///+ showed. If the value of the attribute is empty it is a OLE
364             '///+ chart with its own data.
365             '///+ This increase the performance of loading charts, because
366             '///+ they are only loaded if they are needed.<br>
367             '///+ This attribute <u>replaces</u> the <i>draw:notify-on-update-table</i>
368             '///+ attribute which only was usable by the wordprocessing
369             '///+ application. The new one is used by the wordprocessing and
370             '///+ the spreadsheet application.
371             '///+ The data in this attribute are twice, because the chart has
372             '///+ this data too, but to get this data from the chart it has
373             '///+ to be loaded.</blockquote>
374             '/// Searching for: draw:notify-on-update-of-ranges=&quot;Sheet1.A1:Sheet1.A5&quot;
375             
376             '-------------------------------------------------------------------------
377             AttributeSearch(1) = "draw:notify-on-update-of-ranges"
378             AttributeValue(1) = "Sheet1.A1:Sheet1.A5"
380             printlog "++ Feature(s) to be searched for:"
381             printlog " |"
382             '-------------------------------------------------------------------------
383             SAXSeekElement("office:document-content")
384             SAXSeekElement("office:body")
385             SAXSeekElement("table:table")
386             SAXSeekElement("table:table-row" , 2)
387             SAXSeekElement("table:table-cell" , 2)
388             SAXSeekElement("draw:object")
389             for i = 1 to 1
390                 printlog " +- " & AttributeSearch(i)
391                 if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then
392                     warnlog "Hidden attributes (in namespace): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!"
393                 end if
394             next i
395             printlog "    * * *"
396             SAXRelease()
397         end if
398     else
399         call hCloseDocument
400     end if
401 endcase
403 '-------------------------------------------------------------------------
405 testcase tCellformats1
406     Dim i as integer
407     Dim a as integer
408     Dim xXMLStyleName as string
409     Dim xPath as string
410     Dim AttributeSearch(50) as string
411     Dim AttributeValue(50) as string
413     printlog "+- cellformats1.sdc"
414     call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\cellformats1.sdc"))
415     if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats1.sxc") , "StarOffice XML (Calc)") then
416         '/// Closing the document also if there is a verification dialog.
417         call hCloseDocument()
418         sleep(3)     
419         UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats1.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats1") )
420         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats1\styles.xml")) = FALSE then
421             warnlog "XML-file 'styles.xml' not well formed!"
422         end if
423         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats1\meta.xml")) = FALSE then
424             warnlog "XML-file 'meta.xml' not well formed!"
425         end if
426         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats1\content.xml")) = FALSE then
427             warnlog "XML-file 'content.xml' not well formed!"
428         else
429             call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats1.sxc"))
430             sleep(2)
431             call hCloseDocument
432             sleep(2)
433             printlog "    ---------------------"
434             printlog "    c o n t e n t . x m l"
435             printlog "    ---------------------"
437             '/// <u><b>content.xml</u></b>
438             SAXReadFile(gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats1\content.xml"))
439             printlog "-----------"
440             printlog "T A B L E S"
441             printlog "-----------"
442             '/// <u>table style t1</u>
443             '///+ Searching for: style:master-page-name=&quot;Default&quot; ///
444             '///+ Searching for: style:family=&quot;table&quot; ///
445             '-------------------------------------------------------------------------
446             AttributeSearch(1) = "style:family"
447             AttributeValue(1) = "table"
449             AttributeSearch(2) = "style:master-page-name"
450             AttributeValue(2) = "Default"
451             printlog "++ Feature(s) to be searched for:"
452             printlog " |"
453             '-------------------------------------------------------------------------
454             xXMLStyleName = GetItemStyleName ( "office:body", "table:table", "table:table" , 1 , "table:style-name" )
455             printlog " +---------------------------------------------------------"
456             printlog " |" & xXMLStyleName
457             printlog " +---------------------------------------------------------"
458             xPath = GetXMLElementPath( "office:automatic-styles" , "style:style" , "style:name" , xXMLStyleName)
459             for i = 1 to 2
460                 SAXSeekElement(xPath)
461                 printlog " +- " & AttributeSearch(i)
462                 if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then
463                     warnlog "Table Style: " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!"
464                 end if
465             next i
466             '///+ &nbsp;<i>style properties:</i>
467             '///+ &nbsp;Searching for: table:display=&quot;true&quot;
468             '-------------------------------------------------------------------------
469             AttributeSearch(1) = "table:display"
470             AttributeValue(1) = "true"
471             '-------------------------------------------------------------------------
472             SAXSeekElement(xPath)
473             SAXSeekElement("style:properties")
474             printlog " +- " & AttributeSearch(1)
475             if SAXGetAttributeValue(AttributeSearch(1)) <> AttributeValue(1) then
476                 warnlog "style:properties: " & AttributeSearch(1) & " is not " & AttributeValue(1) & "!"
477             end if
478             SAXSeekElement("/")
479             printlog "    * * *"
481             printlog "---------"
482             printlog "C E L L S"
483             printlog "---------"
485             '/// <u>cell style ce2</u>
486             '///+ Searching for: style:family=&quot;table-cell&quot;
487             '///+ Searching for: style:parent-style-name=&quot;Default&quot;
488             '-------------------------------------------------------------------------
489             AttributeSearch(1) = "style:family"
490             AttributeValue(1) = "table-cell"
491             AttributeSearch(2) = "style:parent-style-name"
492             AttributeValue(2) = "Default"
493             printlog "++ Feature(s) to be searched for:"
494             printlog " |"
495             '-------------------------------------------------------------------------
496             SAXSeekElement("office:document-content")
497             SAXSeekElement("office:body")
498             SAXSeekElement("table:table")
499             SAXSeekElement("table:table-row" , 2)
500             SAXSeekElement("table:table-cell" , 2)
501             xXMLStyleName = SAXGetAttributeValue("table:style-name")
502             printlog " +---------------------------------------------------------"
503             printlog " |" & xXMLStyleName
504             printlog " +---------------------------------------------------------"
505             xPath = GetXMLElementPath( "office:automatic-styles" , "style:style" , "style:name" , xXMLStyleName)
506             for i = 1 to 2
507                 SAXSeekElement(xPath)
508                 printlog " +- " & AttributeSearch(i)
509                 if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then
510                     warnlog "Table Style: " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!"
511                 end if
512             next i
513             '///+ &nbsp;<i>style properties:</i>
514             '///+ Searching for: fo:color=&quot;#000000&quot;
515             '///+ Searching for: style:font-name=&quot;Arial&quot;
516             '///+ Searching for: fo:font-size=&quot;10pt&quot;
517             '///+ Searching for: fo:font-style=&quot;italic&quot;
518             '///+ Searching for: style:text-underline=&quot;single&quot;
519             '///+ Searching for: fo:font-weight=&quot;bold&quot;
520             '-------------------------------------------------------------------------
521             AttributeSearch(1) = "fo:color"
522             AttributeValue(1) = "#000000"
523             AttributeSearch(2) = "style:font-name"
524             AttributeValue(2) = "Arial"
525             AttributeSearch(3)  = "fo:font-size"
526             AttributeValue(3) = "10pt"
527             AttributeSearch(4)  = "fo:font-style"
528             AttributeValue(4) = "italic"
529             AttributeSearch(5) = "style:text-underline"
530             AttributeValue(5) = "single"
531             AttributeSearch(6) = "fo:font-weight"
532             AttributeValue(6) = "bold"
533             '-------------------------------------------------------------------------
534             SAXSeekElement(xPath)
535             SAXSeekElement("style:properties")
537             for i = 1 to  6
538                 printlog " +- " & AttributeSearch(i)
539                 if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then
540                     warnlog "style:properties: " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!"
541                 end if
542             next i
543             SAXSeekElement("/")
544             printlog "    * * *"
546             '/// <u>cell 3</u>
547             '///+ Searching for: style:family=&quot;table-cell&quot;
548             '///+ Searching for: style:parent-style-name=&quot;Default&quot;
549             '-------------------------------------------------------------------------
550             AttributeSearch(1) = "style:family"
551             AttributeValue(1) = "table-cell"
552             AttributeSearch(2) = "style:parent-style-name"
553             AttributeValue(2) = "Default"
554             printlog "++ Feature(s) to be searched for:"
555             printlog " |"
556             '-------------------------------------------------------------------------
557             SAXSeekElement(1)
558             SAXSeekElement("office:body")
559             SAXSeekElement("table:table")
560             SAXSeekElement("table:table-row" , 4)
561             SAXSeekElement("table:table-cell" , 2)
562             xXMLStyleName = SAXGetAttributeValue("table:style-name")
563             printlog " +---------------------------------------------------------"
564             printlog " |" & xXMLStyleName
565             printlog " +---------------------------------------------------------"
566             xPath = GetXMLElementPath( "office:automatic-styles" , "style:style" , "style:name" , xXMLStyleName)
567             for i = 1 to 2
568                 SAXSeekElement(xPath)
569                 printlog " +- " & AttributeSearch(i)
570                 if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then
571                     warnlog "Table Style: " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!"
572                 end if
573             next i
574             '///+ &nbsp;<i>style properties:</i>
575             '///+ Searching for: fo:color=&quot;#800000&quot;
576             '///+ Searching for: style:text-outline=&quot;true&quot;
577             '///+ Searching for: style:text-crossing-out=&quot;single-line&quot;
578             '///+ Searching for: fo:font-size=&quot;12pt&quot;
579             '///+ Searching for: fo:language=&quot;en&quot;
580             '///+ Searching for: fo:country=&quot;US&quot;
581             '///+ Searching for: fo:text-shadow=&quot;none&quot;
582             '-------------------------------------------------------------------------
583             AttributeSearch(1) = "fo:color"
584             AttributeValue(1) = "#800000"
585             AttributeSearch(2) = "style:text-outline"
586             AttributeValue(2) = "true"
587             AttributeSearch(3)  = "fo:font-size"
588             AttributeValue(3) = "12pt"
589             AttributeSearch(4)  = "style:text-crossing-out"
590             AttributeValue(4) = "single-line"
591             AttributeSearch(5) = "fo:text-shadow"
592             AttributeValue(5) = "none"
593             AttributeSearch(6) = "fo:country"
594             AttributeValue(6) = "US"
595             AttributeSearch(7) = "fo:language"
596             AttributeValue(7) = "en"
597             '-------------------------------------------------------------------------
598             SAXSeekElement(xPath)
599             SAXSeekElement("style:properties")
601             for i = 1 to  7
602                 printlog " +- " & AttributeSearch(i)
603                 if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then
604                     warnlog "style:properties: " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!"
605                 end if
606             next i
607             SAXSeekElement("/")
608             printlog "    * * *"
610             '/// <u>cell 4</u>
611             '///+ &nbsp;<i>style properties:</i>
612             '///+ Searching for: style:font-name=&quot;Times New Roman&quot;
613             '///+ Searching for: fo:font-size=&quot;28pt&quot;
614             '-------------------------------------------------------------------------
615             AttributeSearch(1) = "style:font-name"
616             AttributeValue(1) = "Comic Sans MS"
617             AttributeSearch(2) = "fo:font-size"
618             AttributeValue(2) = "16pt"
619             '-------------------------------------------------------------------------
620             SAXSeekElement(1)
621             SAXSeekElement("office:body")
622             SAXSeekElement("table:table")
623             SAXSeekElement("table:table-row", 6)
624             SAXSeekElement("table:table-cell" , 2)
625             xXMLStyleName = SAXGetAttributeValue("table:style-name")
626             printlog " +---------------------------------------------------------"
627             printlog " |" & xXMLStyleName
628             printlog " +---------------------------------------------------------"
629             xPath = GetXMLElementPath( "office:automatic-styles" , "style:style" , "style:name" , xXMLStyleName)
630             SAXSeekElement(xPath)
631             SAXSeekElement(1)
632             for i = 1 to 2
633                 printlog " +- " & AttributeSearch(i)
634                 if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then
635                     warnlog "style:properties: " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!"
636                 end if
637             next i
638             SAXRelease()
639         end if
640     else
641         call hCloseDocument
642     end if
643 endcase
645 '-------------------------------------------------------------------------
647 testcase tCellformats2
648     printlog "+- cellformats2.sdc"
649     call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\cellformats2.sdc"))
650     if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2.sxc") , "StarOffice XML (Calc)") then
651         '/// Closing the document also if there is a verification dialog.
652         call hCloseDocument()
653         sleep(3)     
654         UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2") )
655         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2\styles.xml")) = FALSE then
656             warnlog "XML-file 'styles.xml' not well formed!"
657         end if
658         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2\meta.xml")) = FALSE then
659             warnlog "XML-file 'meta.xml' not well formed!"
660         end if
661         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2\content.xml")) = FALSE then
662             warnlog "XML-file 'content.xml' not well formed!"
663         else
664             call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2.sxc"))
665             sleep(2)
666             call hCloseDocument
667             sleep(2)
668         end if
669     else
670         call hCloseDocument
671     end if
672 endcase
674 '-------------------------------------------------------------------------
676 testcase tCellformats3
677     printlog "+- cellformats3.sdc"
678     call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\cellformats3.sdc"))
679     if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats3.sxc") , "StarOffice XML (Calc)") then
680         '/// Closing the document also if there is a verification dialog.
681         call hCloseDocument()
682         sleep(3)     
683         UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats3.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats3") )
684         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats3\styles.xml")) = FALSE then
685             warnlog "XML-file 'styles.xml' not well formed!"
686         end if
687         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats3\meta.xml")) = FALSE then
688             warnlog "XML-file 'meta.xml' not well formed!"
689         end if
690         if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats3\content.xml")) = FALSE then
691             warnlog "XML-file 'content.xml' not well formed!"
692         else
693             call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats3.sxc"))
694             sleep(2)
695             call hCloseDocument
696             sleep(2)
697         end if
698     else
699         call hCloseDocument
700     end if
701 endcase