diff options
Diffstat (limited to 'testautomation/xml/optional/includes')
21 files changed, 8628 insertions, 0 deletions
diff --git a/testautomation/xml/optional/includes/c_datapilot_pagefields.inc b/testautomation/xml/optional/includes/c_datapilot_pagefields.inc new file mode 100644 index 000000000000..90b522d4f0bc --- /dev/null +++ b/testautomation/xml/optional/includes/c_datapilot_pagefields.inc @@ -0,0 +1,175 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : oliver.craemer@sun.com +'* +'* short description : Check content.xml for attribute 'table:selected-page' +'* +'************************************************************************************************* +'* +' #1 subPageFields +' #1 tDatapilotPagefields +'* +'\************************************************************************************************* +sub subPageFields + printLog Chr(13) + "--------- datapilot pagefields ----------" + + printlog "Testing Page '- all -'" + call tDatapilotPagefields("- all -") + printlog "Testing Page 'Audio'" + call tDatapilotPagefields("Audio") + printlog "Testing Page 'DVD'" + call tDatapilotPagefields("DVD") + printlog "Testing Page 'Video'" + call tDatapilotPagefields("Video") + +end sub + +'************************************************************ +testcase tDatapilotPagefields ( sCurrentPage as STRING ) + dim bTableSelectedPageShouldExist as BOOLEAN + dim iIndex as INTEGER + dim sComfirmAttribute as STRING + dim sWarnAttribute as STRING + select case sCurrentPage + case ("- all -") : bTableSelectedPageShouldExist = "false" + iIndex = 1 + case ("Audio") : bTableSelectedPageShouldExist = "true" + iIndex = 2 + sComfirmAttribute = "OK, value for attribute 'table:selected-page' is 'Audio'" + sWarnAttribute = "Unexpected value for attibute 'table:selected-page' -> Check this out!" + case ("DVD") : bTableSelectedPageShouldExist = "true" + iIndex = 3 + sComfirmAttribute = "OK, value for attribute 'table:selected-page' is 'DVD'" + sWarnAttribute = "Unexpected value for attibute 'table:selected-page' -> Check this out!" + case ("Video") : bTableSelectedPageShouldExist = "true" + iIndex = 4 + sComfirmAttribute = "OK, value for attribute 'table:selected-page' is 'Video'" + sWarnAttribute = "Unexpected value for attibute 'table:selected-page' -> Check this out!" + end select + +dim sInputFile as STRING + sInputFile = ( gTesttoolPath & ConvertPath( "xml\optional\input\calc\ooo10\pagefields_datapilot" & iIndex & ".sxc" )) + +dim sOutputFile as STRING + sOutputFile = ( gOfficePath & ConvertPath( "user\work\datapilotPagefields" ) & iIndex & ".ods" ) + +dim sUnpackedStorageDir as STRING + sUnpackedStorageDir = ( gOfficePath & ConvertPath( "user\work\datapilotPagefields" ) & iIndex ) + if (dir(sUnpackedStorageDir) <> "") then + rmDir (sUnpackedStorageDir) + if (dir(sUnpackedStorageDir) <> "") then + warnlog "Directory has not been deleted. Test ends here." + goto endsub + endif + endif + +dim sContentXML as STRING + sContentXML = ( gOfficePath & ConvertPath( "user\work\datapilotPagefields" ) & iIndex & ConvertPath( "\content.xml" )) + +dim iSaxSeekIndex as INTEGER + iSaxSeekIndex = 1 + +dim bContinueSeek as BOOLEAN + bContinueSeek = TRUE + +dim iAttributeIndex as INTEGER + + printlog "Open test document" + call hFileOpen ( sInputFile ) + printlog "Save in current default application format (ODF)" + if hFileSaveAsWithFilterKill ( sOutputFile , "calc8" ) = FALSE then + warnlog "Saving " & sOutputFile & " failed! -> Exiting test!" + call hCloseDocument + goto endsub + else + printlog "CLose the document." + call hCloseDocument + printlog "Unpack storage of test document." + UnpackStorage( sOutputFile , sUnpackedStorageDir ) + printlog "Read the test documents DOM." + SAXReadFile( sContentXML ) + sleep(2) + printlog "Set the DOM pointer on element 'table:data-pilot-table'" + printlog "|-/" + SAXSeekElement( "/" ) + printlog " |-office:document-content" + SAXSeekElement( "office:document-content" ) + printlog " |-office:body" + SAXSeekElement( "office:body" ) + printlog " |-office:spreadsheet" + SAXSeekElement( "office:spreadsheet" ) + printlog " |-table:data-pilot-tables" + SAXSeekElement( "table:data-pilot-tables" ) + printlog " |-table:data-pilot-table" + SAXSeekElement( "table:data-pilot-table" ) + printlog "Seek in (all) elements 'table:data-pilot-field'" + while SAXHasElement( "table:data-pilot-field" , iSaxSeekIndex ) AND bContinueSeek + printlog " |-table:data-pilot-field" + SAXSeekElement( "table:data-pilot-field" , iSaxSeekIndex ) + printlog ".. for attribute 'table:selected-page'" + for iAttributeIndex = 1 to SAXGetAttributeCount + if SaxGetAttributeName ( iAttributeIndex ) = "table:selected-page" then + printlog "When found, check if it should exist (unexpected for page selection '- all -')" + bContinueSeek = FALSE + if bTableSelectedPageShouldExist then + printlog "Bingo, found attribute 'table:selected-page'" + 'Check correct index of expected node + if iSaxSeekIndex <> 1 then + warnlog "Found 'table:selected-page' on an unexpected Node -> Check this out!" + qaErrorLog "TODO: Check if change of file format was announced!" + qaErrorLog "TODO: Modify test if change of file format was intended!" + endif + 'Check correct attribute index + if iAttributeIndex <> 3 then + warnlog "Found 'table:selected-page' on unexpected attribute position -> Check this out!" + qaErrorLog "TODO: Check if change of file format was announced!" + qaErrorLog "TODO: Modify test if change of file format was intended!" + endif + printlog "Now check for expected value of 'table:selected-page'!" + if SAXGetAttributeValue( "table:selected-page" ) = sCurrentPage then + printlog sComfirmAttribute + else + warnlog sWarnAttribute + endif + else + warnlog "OOPS, attribute 'table:selected-page' shouldn't exist for '- all -' pages." + endif + endif + next iAttributeIndex + iSaxSeekIndex = iSaxSeekIndex + 1 + SAXSeekElement( 0 ) + wend + endif + ' Throw warning if testcase didn't succeed at all! + if bContinueSeek AND bTableSelectedPageShouldExist then + warnlog "OOPS, attribute 'table:selected-page' wasn't found though it should exist -> Check this out!" + endif + 'Release DOM + SAXRelease +endcase + diff --git a/testautomation/xml/optional/includes/c_xml_print_scale.inc b/testautomation/xml/optional/includes/c_xml_print_scale.inc new file mode 100644 index 000000000000..ee3be5bff1ef --- /dev/null +++ b/testautomation/xml/optional/includes/c_xml_print_scale.inc @@ -0,0 +1,403 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : oliver.creamer@sun.com +'* +'* short description : Check content.xml and styles.xml for correct print scaling settings +'* +'************************************************************************************************* +'* +' #1 subPrintScaling +' #1 tPrintScaling +'* +'\************************************************************************************************* +sub subPrintScaling + printLog Chr(13) + "--------- Print scaling attributes ----------" + + call tPrintScaling + +end sub + +'************************************************************ +testcase tPrintScaling + dim iIndex as INTEGER + dim iInnerIndex as INTEGER + + dim sExtension + sExtension = ".ods" + + dim sOutputFile as STRING + sOutputFile = ( gOfficePath & ConvertPath( "user\work\printScaling" ) & sExtension ) + + dim sUnpackedStorageDir as STRING + sUnpackedStorageDir = ( gOfficePath & ConvertPath( "user\work\printScaling" )) + if (dir ( sUnpackedStorageDir ) <> "" ) then + rmDir ( sUnpackedStorageDir ) + if (dir ( sUnpackedStorageDir ) <> "" ) then + warnlog "The diretory has not been deleted. Exiting test!" + goto endsub + endif + endif + + dim sContentXML as STRING + sContentXML = ( sUnpackedStorageDir & ConvertPath( "\content.xml" )) + + dim sStylesXML as STRING + sStylesXML = ( sUnpackedStorageDir & ConvertPath( "\styles.xml" )) + + dim asTableStyleAssocations ( 5 , 3 ) as STRING + + dim sNameSheet1 as STRING + sNameSheet1 = "Ten" + dim sNameSheet2 as STRING + sNameSheet2 = "Moves" + dim sNameSheet3 as STRING + sNameSheet3 = "Ahead" + + dim sNameStyle1 as STRING + sNameStyle1 = "1stStyle" + dim sNameStyle2 as STRING + sNameStyle2 = "2ndStyle" + dim sNameStyle3 as STRING + sNameStyle3 = "3rdStyle" + + dim iTablesInDocument as INTEGER + dim iStylesInAutomaticStyles as INTEGER + dim iMasterPageStylesInStylesXML as INTEGER + dim sCurrentTableName as STRING + dim sExpectedTableName as STRING + dim sCurrentTableStyle as STRING + dim sCurrentAutomaticStyle as STRING + dim sCurrentMasterPageStyle as STRING + + dim sExpectedScaleTo as STRING + dim sExpectedScaleToX as STRING + dim sExpectedScaleToY as STRING + dim sExpectedScaleToPages as STRING + + printlog "Create a new spreadsheet document" + Call hNewDocument + sleep(2) + + for iIndex = 1 to 3 + printlog "Type in the first cell the number 1 and press RETURN" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "1<RETURN>" + sleep(1) + printlog "Format / Sheet / Rename" + FormatSheetRename + Kontext "TabelleUmbenennen" + select case iIndex + case 1 : Tabellenname.SetText sNameSheet1 + printlog " In first round name it 'Ten'" + case 2 : Tabellenname.SetText sNameSheet2 + printlog " In first round name it 'Moves'" + case 3 : Tabellenname.SetText sNameSheet3 + printlog " In first round name it 'Ahead'" + end select + printlog "Press OK on dialog" + TabelleUmbenennen.OK + sleep(1) + printlog "Edit / Sheet / Select" + EditSheetSelect + Kontext "SelectSheets" + printlog "In round 1 and 2 select the next sheet." + printlog "In round three select the first sheet." + if iIndex = 3 then + SheetSelectionBox.Select sNameSheet1 + else + SheetSelectionBox.Select ( iIndex + 1 ) + endif + printlog "Press OK on dialog." + SelectSheets.OK + sleep(1) + next iIndex + printlog "Format / Styles / Catalog" + FormatStylesCatalog + Kontext "Vorlagenkatalog" + Vorlagen.select ( 2 ) + sleep(1) + for iIndex = 1 to 3 + Kontext "Vorlagenkatalog" + printlog "Click new" + Neu.Click + Kontext + printlog "Page format dilog shoud appear)" + printlog "Select Page 'Organizer'" + Kontext + Active.SetPage TabVerwalten + printlog "Close MsgBox when appeared" + if Active.Exists(2) then + if Active.GetRT = 304 then + Printlog Active.GetText + Active.Yes + end if + end if + Kontext "TabVerwalten" + printlog "Assign name for each style" + select case iIndex + case 1 : VorlagenName.setText sNameStyle1 + printlog "First round name: '1stStyle'" + case 2 : VorlagenName.setText sNameStyle2 + printlog "Second round name:'2ndStyle'" + case 3 : VorlagenName.setText sNameStyle3 + printlog "Third round name: '3rdStyle'" + end select + printlog "Select Page 'Sheet'" + Kontext + Active.SetPage TabTabelleCalc + Kontext "TabTabelleCalc" + scalingMode.Select ( iIndex ) + select case iIndex + case 1 : SkalierungProzent.setText "55%" + printlog "1. round: Scale size to 55%" + case 2 : ScalePageWidth.setText "3" + ScalePageHeight.setText "4" + printlog "2. round: Scale output to 3 pages wide and 4 pages high" + case 3 : AnzahlMaxSeiten.setText "6" + printlog "3 round: Scale output to a total of 6 pages" + end select + printlog "Leave page format dilog using OK" + TabTabelleCalc.OK + next iIndex + printlog "Close style catalog using OK" + Kontext "Vorlagenkatalog" + Vorlagenkatalog.OK + sleep(2) + for iIndex = 1 to 3 + printlog "Edit / Sheet / Select" + EditSheetSelect + Kontext "SelectSheets" + printlog "Select 1, 2. or 3 sheet" + SheetSelectionBox.Select ( iIndex ) + printlog "OK" + SelectSheets.OK + sleep(1) + Kontext "Gestalter" + if NOT Gestalter.exists(2) then + printlog "Format / Stylist" + FormatStylist + endif + Kontext "Gestalter" + printlog "Click on 'Page styles'" + Seitenvorlagen.Click + Kontext "Vorlagenliste" + printlog "Type [HOME]-key" + Vorlagenliste.TypeKeys "<HOME>" + sleep (2) + printlog "Select 1, 2, or 3 (depends on the round)" + Vorlagenliste.Select ( iIndex ) + printlog "Type [RETURN]" + Vorlagenliste.TypeKeys "<RETURN>" + next iIndex + Kontext "Gestalter" + if Gestalter.exists(2) then + printlog "Format / Stylist" + FormatStylist + endif + printlog "Save in current default ODF format" + if hFileSaveAsWithFilterKill ( sOutputFile , "calc8" ) = FALSE then + warnlog "Saving " & sOutputFile & " failed! -> Exiting test!" + call hCloseDocument + else + printlog "Close document" + call hCloseDocument + sleep(3) + printlog "Unpack storage (=compressed XML files) to obtain the XML files" + UnpackStorage ( sOutputFile , sUnpackedStorageDir ) + printlog "Read 'content.xml' DOM." + printlog "Read DOM of content.xml" + SAXReadFile ( sContentXML ) + sleep(2) + printlog "Set the DOM pointer on element 'office:spreadsheet'" + printlog "|-/" + SAXSeekElement ( "/" ) + printlog " |-office:document-content" + SAXSeekElement ( "office:document-content" ) + printlog " |-office:body" + SAXSeekElement ( "office:body" ) + printlog " |-office:spreadsheet" + SAXSeekElement ( "office:spreadsheet" ) + iTablesInDocument = SAXGetChildCount + printlog "Check correct number of sheets" + if iTablesInDocument <> 3 then + warnlog "Unexpected number of tables in the document -> Check this out!" + endif + printlog " nodes table:table" + for iIndex = 1 to iTablesInDocument + printlog " |-table:table" + SAXSeekElement ( "table:table" , iIndex ) + printlog "Get 'table:name' and 'table:style-name' for all tables" + sCurrentTableName = SAXGetAttributeValue ( "table:name" ) + sCurrentTableStyle = SAXGetAttributeValue ( "table:style-name" ) + select case iIndex + case 1 : sExpectedTableName = sNameSheet1 + case 2 : sExpectedTableName = sNameSheet2 + case 3 : sExpectedTableName = sNameSheet3 + end select + printlog "Check correct table names" + if sCurrentTableName <> sExpectedTableName then + warnlog "OOPS, this table has got an unexpected name -> Check this out!" + endif + printlog "Memorize associations of table and style names" + asTableStyleAssocations ( iIndex , 0 ) = sCurrentTableName + asTableStyleAssocations ( iIndex , 1 ) = sCurrentTableStyle + SAXSeekElement ( 0 ) + next iIndex + SAXSeekElement ( 0 ) + SAXSeekElement ( 0 ) + printlog "Go back in DOM-tree to 'office:automatic-styles'" + printlog " |-office:automatic-styles" + SAXSeekElement( "office:automatic-styles" ) + iStylesInAutomaticStyles = SAXGetChildCount + if iStylesInAutomaticStyles < 5 then + warnlog "Unexpected number of styles in 'content.xml' -> Check this out!" + endif + for iIndex = 1 to iStylesInAutomaticStyles + printlog "Seek nodes style:style" + printlog " |-office:automatic-styles" + SAXSeekElement( "style:style" , iIndex ) + if SAXGetAttributeValue ( "style:family" ) = "table" then + sCurrentAutomaticStyle = SAXGetAttributeValue ( "style:name" ) + printlog " + Found table style " & sCurrentAutomaticStyle & " at postion " & iIndex + printlog "Memorize associations of table and master pages names using previously determined style names" + for iInnerIndex = 1 to iTablesInDocument + if sCurrentAutomaticStyle = asTableStyleAssocations ( iInnerIndex , 1 ) then + asTableStyleAssocations ( iInnerIndex , 2 ) = SAXGetAttributeValue ( "style:master-page-name" ) + endif + next iInnerIndex + endif + SAXSeekElement ( 0 ) + next iIndex + printlog "Release DOM of 'content.xml'" + SAXRelease + printlog "| <<< DOM released <<<" + printlog "" + + printlog "Read 'styles.xml' DOM." + printlog "Read DOM of styles.xml" + SAXReadFile ( sStylesXML ) + sleep(2) + printlog "Set the DOM pointer on element 'office:master-styles'" + printlog "|-/" + SAXSeekElement ( "/" ) + printlog " |-office:document-styles" + SAXSeekElement ( "office:document-styles" ) + printlog " |-office:master-styles" + SAXSeekElement ( "office:master-styles" ) + iMasterPageStylesInStylesXML = SAXGetChildCount + printlog "Seek nodes style:master-page" + for iIndex = 1 to iMasterPageStylesInStylesXML + printlog " |-style:master-page" + SAXSeekElement( iIndex ) + sCurrentMasterPageStyle = SAXGetAttributeValue ( "style:name" ) + printlog " + Found table style " & sCurrentMasterPageStyle & " at postion " & iIndex + for iInnerIndex = 1 to iTablesInDocument + printlog "Memorize associations of table names and master page styles using master page names found in 'context.xml'" + if sCurrentMasterPageStyle = asTableStyleAssocations ( iInnerIndex , 2 ) then + if SAXGetElementName <> "style:master-page" then + warnlog "Unexpected style type found -> Check this out!" + qaErrorLog SAXGetElementName & " instead of 'style:master-page'" + endif + asTableStyleAssocations ( iInnerIndex , 3 ) = SAXGetAttributeValue ( "style:page-layout-name" ) + printlog "Check correct UI strings for master page styles" + select case SAXGetAttributeValue ( "style:display-name" ) + case sNameStyle1 : sExpectedTableName = sNameSheet1 + case sNameStyle2 : sExpectedTableName = sNameSheet2 + case sNameStyle3 : sExpectedTableName = sNameSheet3 + end select + printlog "Check if UI strings for master page styles are correctly assigned to the three sheets" + if sExpectedTableName <> asTableStyleAssocations ( iInnerIndex , 0 ) then + warnlog "Association of UI Style name and table doesn't meet expectation -> Check this out!" + qaErrorLog "Expected '" & sExpectedTableName & "' but found '" & asTableStyleAssocations ( iInnerIndex , 0 ) & "'" + endif + endif + next iInnerIndex + SAXSeekElement ( 0 ) + next iIndex + SAXSeekElement ( 0 ) + printlog "Go back in DOM-tree to 'office:automatic-styles'" + printlog " |-office:automatic-styles" + SAXSeekElement ( "office:automatic-styles" ) + iStylesInAutomaticStyles = SAXGetChildCount + printlog "Seek nodes style:page-layout" + for iIndex = 1 to iStylesInAutomaticStyles + printlog " |-style:page-layout" + SAXSeekElement ( iIndex ) + sCurrentAutomaticStyle = SAXGetAttributeValue ( "style:name" ) + printlog "Check for each sheet if expected page scaling is correctly assigned" + for iInnerIndex = 1 to iTablesInDocument + if sCurrentAutomaticStyle = asTableStyleAssocations ( iInnerIndex , 3 ) then + if SAXGetElementName <> "style:page-layout" then + warnlog "Unexpected style type found -> Check this out!" + qaErrorLog SAXGetElementName & " instead of 'style:page-layout'" + endif + printlog " |-style:page-layout" + SAXSeekElement ( "style:page-layout-properties" ) + select case asTableStyleAssocations ( iInnerIndex , 0 ) + case sNameSheet1 + sExpectedScaleTo = "55%" + sExpectedScaleToX = "" + sExpectedScaleToY = "" + sExpectedScaleToPages = "" + case sNameSheet2 + sExpectedScaleTo = "" + sExpectedScaleToX = "3" + sExpectedScaleToY = "4" + sExpectedScaleToPages = "" + case sNameSheet3 + sExpectedScaleTo = "" + sExpectedScaleToX = "" + sExpectedScaleToY = "" + sExpectedScaleToPages = "6" + end select + if sExpectedScaleTo <> SAXGetAttributeValue ( "style:scale-to") then + warnlog " Attribute 'style:scale-to' has unexpected value: " & SAXGetAttributeValue ( "style:scale-to") + qaErrorLog "Expected: " & sExpectedScaleTo + endif + if sExpectedScaleToX <> SAXGetAttributeValue ( "style:scale-to-X") then + warnlog "Attribute 'style:scale-to-X' has unexpected value: " & SAXGetAttributeValue ( "style:scale-to-X") + qaErrorLog "Expected: " & sExpectedScaleToX + endif + if sExpectedScaleToY <> SAXGetAttributeValue ( "style:scale-to-Y") then + warnlog "Attribute 'style:scale-to-Y' has unexpected value: " & SAXGetAttributeValue ( "style:scale-to-Y") + qaErrorLog "Expected: " & sExpectedScaleToY + endif + if sExpectedScaleToPages <> SAXGetAttributeValue ( "style:scale-to-pages") then + warnlog "Attribute 'style:scale-to-pages' has unexpected value: " & SAXGetAttributeValue ( "style:scale-to-pages") + qaErrorLog "Expected: " & sExpectedScaleToPages + endif + SAXSeekElement ( 0 ) + endif + next iInnerIndex + SAXSeekElement ( 0 ) + next iIndex + endif + printlog "Release DOM of 'styles.xml'" + SAXRelease +endcase + diff --git a/testautomation/xml/optional/includes/c_xml_scenario.inc b/testautomation/xml/optional/includes/c_xml_scenario.inc new file mode 100644 index 000000000000..7d7384bb9683 --- /dev/null +++ b/testautomation/xml/optional/includes/c_xml_scenario.inc @@ -0,0 +1,433 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : oliver.creamer@sun.com +'* +'* short description : Check content.xml for correct scenario attributes +'* +'************************************************************************************************* +'* +' #1 subScenarioAttributes +' #1 tScenarioAttributes +' #1 subCreateScenario +' #1 subCheckScenarioInContentXML +'* +'\************************************************************************************************* +sub subScenarioAttributes + printLog Chr(13) + "--------- scenario attributes ----------" + + call tScenarioAttributes + +end sub + +'************************************************************ +testcase tScenarioAttributes + dim iIndex as INTEGER + + dim sExtension + sExtension = ".ods" + + dim sNameSheet1 as STRING + sNameSheet1 = "Ten" + dim sNameSheet2 as STRING + sNameSheet2 = "Moves" + dim sNameSheet3 as STRING + sNameSheet3 = "Ahead" + + + dim sOutputFile as STRING + sOutputFile = ( gOfficePath & ConvertPath( "user\work\scenarioAttributes" ) & sExtension ) + + dim sUnpackedStorageDir as STRING + sUnpackedStorageDir = ( gOfficePath & ConvertPath( "user\work\scenarioAttributes" )) + if (dir ( sUnpackedStorageDir ) <> "" ) then + rmDir ( sUnpackedStorageDir ) + if (dir ( sUnpackedStorageDir ) <> "" ) then + warnlog "Diretory has not been deleted. Exiting test." + goto endsub + endif + endif + + dim sContentXML as STRING + sContentXML = ( gOfficePath & ConvertPath( "user\work\scenarioAttributes" ) & ConvertPath( "\content.xml" )) + + printlog "Create a new spreadsheet document" + Call hNewDocument + sleep(2) + for iIndex = 1 to 3 + printlog "Type in the first cell the number 1 and press RETURN" + Kontext "DocumentCalc" + DocumentCalc.TypeKeys "1<RETURN>" + sleep(1) + printlog "Format / Sheet / Rename" + FormatSheetRename + Kontext "TabelleUmbenennen" + select case iIndex + case 1 : Tabellenname.SetText sNameSheet1 + printlog " In first round name it 'Ten'" + case 2 : Tabellenname.SetText sNameSheet2 + printlog " In first round name it 'Moves'" + case 3 : Tabellenname.SetText sNameSheet3 + printlog " In first round name it 'Ahead'" + end select + printlog "Press OK on dialog" + TabelleUmbenennen.OK + sleep(1) + printlog "Edit / Sheet / Select" + EditSheetSelect + Kontext "SelectSheets" + printlog "In round 1 and 2 select the next sheet." + printlog "In round three select the first sheet." + if iIndex = 3 then + SheetSelectionBox.Select sNameSheet1 + else + SheetSelectionBox.Select ( iIndex + 1 ) + endif + printlog "Press OK on dialog." + SelectSheets.OK + sleep(1) + next iIndex + printlog "If not visible: View / Toolbars / Formula bar" + Kontext "RechenleisteCalc" + if not RechenleisteCalc.isvisible then + ViewToolbarsFormulaBar + end if + sleep(1) + Kontext "RechenleisteCalc" + printlog "In the Formular bar edit area type:" + Bereich.TypeKeys "<MOD1 A>" + printlog "[CTRL+A]" + Bereich.TypeKeys "C3" + printlog "C3" + sleep(1) + printlog "[RETURN]" + Bereich.TypeKeys "<RETURN>" + sleep(1) + Kontext "DocumentCalc" + printlog "Type in the spreadsheet document:" + printlog "1[RETURN]2[RETURN]3[RETURN]" + DocumentCalc.typekeys "1<RETURN>2<RETURN>3<RETURN>" + Kontext "RechenleisteCalc" + printlog "In the Formula bar type in the edit area:" + printlog "[CTRL+A]" + Bereich.TypeKeys "<MOD1 A>" + printlog "C3:C5" + Bereich.TypeKeys "C3:C5" + sleep(1) + printlog "[RETURN]" + Bereich.TypeKeys "<RETURN>" + sleep(1) + printlog "Tools / scenarios..." + printlog "Scenario name: Scenario_XML_Test" + printlog "Scenario comment: Created by Peter Junge" + printlog "Color index: 1" + printlog "Display border unchecked" + printlog "Copy back unchecked" + printlog "Copy entire sheet unchecked" + printlog "Prevent changes unchecked" + subCreateScenario ( "Scenario_XML_Test" , "Created by Peter Junge" , 1 , 0 , 0 , 0 , 0 ) + sleep(1) + printlog "Create a another scenario on this selection with the following parameters:" + printlog "Scenario name: AnotherScenario" + printlog "Scenario comment: Random Comment" + printlog "Color index: 13" + printlog "Display border checked" + printlog "Copy back checked" + printlog "Copy entire sheet checked" + printlog "Prevent changes checked" + subCreateScenario ( "AnotherScenario" , "Random Comment" , 13 , 1 , 1 , 1 , 1 ) + sleep(1) + printlog "Edit / Sheet / Select" + EditSheetSelect + Kontext "SelectSheets" + printlog "Select 'Moves'" + SheetSelectionBox.Select "Moves" + printlog "OK" + SelectSheets.OK + sleep(1) + printlog "Type in Formula bar:" + Kontext "RechenleisteCalc" + printlog "[CTRL+A]" + Bereich.TypeKeys "<MOD1 A>" + printlog "d5" + Bereich.TypeKeys "d5" + sleep(1) + printlog "[RETURN]" + Bereich.TypeKeys "<RETURN>" + sleep(1) + printlog "Type in spreadsheet document" + Kontext "DocumentCalc" + printlog "1[RETURN]2[RETURN]3[RETURN]" + DocumentCalc.typekeys "1<RETURN>2<RETURN>3<RETURN>" + Kontext "RechenleisteCalc" + printlog "Type in Formula bar:" + printlog "[CTRL+A]" + Bereich.TypeKeys "<MOD1 A>" + printlog "d5:d7" + Bereich.TypeKeys "d5:d7" + sleep(1) + printlog "[RETURN]" + Bereich.TypeKeys "<RETURN>" + sleep(1) + printlog "Creat another scenario:" + subCreateScenario ( "標準" , "기본값" , 9 , 1 , 1 , 0 , 0 ) + printlog "Scenario name: 標準" + printlog "Scenario comment: 기본값" + printlog "Color index: 9" + printlog "Display border checked" + printlog "Copy back checked" + printlog "Copy entire sheet unchecked" + printlog "Prevent changes unchecked" + sleep(1) + '///<li>Create a another scenario on this selection</li>/// + subCreateScenario ( "1标准9" , "2預設0" , 16 , 0 , 0 , 1 , 1 ) + printlog "Scenario name: 1标准9" + printlog "Scenario comment: 2預設0" + printlog "Color index: 16" + printlog "Display border unchecked" + printlog "Copy back unchecked" + printlog "Copy entire sheet checked" + printlog "Prevent changes checked" + sleep(1) + printlog "Save in current default format" + if hFileSaveAsWithFilterKill ( sOutputFile , "calc8" ) = FALSE then + warnlog "Saving " & sOutputFile & " failed! -> Exiting test!" + call hCloseDocument + else + printlog "Close the document." + call hCloseDocument + sleep(3) + printlog "Unpack storage of test document." + UnpackStorage( sOutputFile , sUnpackedStorageDir ) + printlog "Read the test documents DOM." + SAXReadFile( sContentXML ) + sleep(2) + printlog "Set the DOM pointer on element 'office:spreadsheet'" + printlog "|-/" + SAXSeekElement( "/" ) + printlog " |-office:document-content" + SAXSeekElement( "office:document-content" ) + printlog " |-office:body" + SAXSeekElement( "office:body" ) + printlog " |-office:spreadsheet" + SAXSeekElement( "office:spreadsheet" ) + printlog "For all tables check if they are scenarios" + printlog "For those tables which are scenarios check correct attributes" + for iIndex = 1 to 7 + printlog " |-table:table" + SAXSeekElement( "table:table" , iIndex ) + select case iIndex + case 1 : subCheckScenarioInContentXML ( "Ten" , FALSE ) + case 2 : subCheckScenarioInContentXML ( _ + "Scenario_XML_Test" , TRUE , TRUE , "#000000" , TRUE , "false" , FALSE , "false" , _ + "Scenario_XML_Test.C3:Scenario_XML_Test.C5" , "Created by Peter Junge" ) + case 3 : subCheckScenarioInContentXML ( _ + "AnotherScenario" , TRUE , FALSE , "#ff0000" , FALSE , "false" , TRUE , "true" , _ + "AnotherScenario.C3:AnotherScenario.C5" , "Random Comment" ) + case 4 : subCheckScenarioInContentXML ( "Moves" , FALSE ) + case 5 : subCheckScenarioInContentXML ( _ + "標準" , TRUE , FALSE , "#c0c0c0" , FALSE , "false" , FALSE , "false" , _ + "標準.D5:標準.D7" , "기본값" ) + case 6 : subCheckScenarioInContentXML ( _ + "1标准9" , TRUE , TRUE , "#ffffff" , TRUE , "false" , TRUE , "true" , _ + "1标准9.D5:1标准9.D7" , "2預設0" ) + case 7 : subCheckScenarioInContentXML ( "Ahead" , FALSE ) + end select + SAXSeekElement( 0 ) + next iIndex + printlog "Check if too much sheets exist" + try + SAXSeekElement( "table:table" , 8 ) + warnlog "OOPS, it's expected to have only seven sheet but we got eight or more -> Check this out!" + SAXSeekElement( 0 ) + catch + endcatch + endif + SAXRelease +endcase +' +'--------------------------------------------------------------------------- +' +sub subCreateScenario ( sScenarioName as STRING, _ + sComment as STRING, _ + iColorIndex as INTEGER, _ + bDisplayBorder as BOOLEAN, _ + bCopyBack as BOOLEAN, _ + bCopyEntireSheet as BOOLEAN, _ + bPreventChanges as BOOLEAN ) + + printlog "tools / scenarios..." + ToolsScenarios + Kontext "SzenarioAnlegen" + printlog "Set options as requested through arguments" + SzenarioName.SetText ( sScenarioName ) + Kommentar.SetText ( sComment ) + Rahmenfarbe.Select ( iColorIndex ) + if bDisplayBorder then + RahmenAnzeigen.Check + else + RahmenAnzeigen.UnCheck + endif + if bCopyBack then + Zurueckkopieren.Check + else + Zurueckkopieren.UnCheck + endif + if bCopyEntireSheet then + GanzeTabelle.Check + else + GanzeTabelle.UnCheck + endif + if bPreventChanges then + PreventChanges.Check + else + PreventChanges.UnCheck + endif + printlog "OK" + SzenarioAnlegen.OK + sleep(1) +end sub +' +'--------------------------------------------------------------------------- +' +sub subCheckScenarioInContentXML ( sTableName as STRING , _ + bTableShouldBeScenario as BOOLEAN , _ + optional bCheckDisplayBorder as BOOLEAN , _ + optional sBorderColor as STRING , _ + optional bCheckCopyBack as BOOLEAN , _ + optional sCopyStyles as STRING , _ + optional bCheckProtected as BOOLEAN , _ + optional sIsActive as STRING , _ + optional sScenarioRanges as STRING , _ + optional sComment as STRING) + +'///<u><b>Check attibutes for scenarios in 'content.xml'</b></u>/// +dim bTableIsScenario as BOOLEAN + bTableIsScenario = FALSE +'///<ul> + '///<li>Check correct table name</li>/// + if SAXGetAttributeValue( "table:name" ) = sTableName then + printlog "Table name is as expected" + else + warnlog "Table name is " & SAXGetAttributeValue( "table:name" ) & " instead of " & sTableName + endif + '///<li>Find out if current table is a scenario</li>/// + try + SAXSeekElement( "table:scenario") + bTableIsScenario = TRUE + if bTableShouldBeScenario then + printlog "OK, this table is a scenario!" + else + warnlog "OOPS, this table shouldn't be a scenario -> Check this out!" + endif + catch + if bTableShouldBeScenario then + warnlog "OOPS, this table should be a scenario but it isn't -> Check this out!" + else + printlog "Right, this table isn't a scenario" + endif + endcatch + '///<li>Check scenario attributes</li>/// + if bTableShouldBeScenario AND bTableIsScenario then + if bCheckDisplayBorder then + if SAXGetAttributeValue ( "table:display-border" ) = "false" then + printlog "OK, attribute 'table:display-border' has expected value: 'false'" + else + warnlog "OOPS, attribute 'table:display-border' has unexpected value: " & SAXGetAttributeValue( "table:display-border" ) + endif + else + if SAXGetAttributeValue ( "table:display-border" ) <> "" then + warnlog "OOPS, attribute 'table:display-border' shouldn't exist here" + endif + endif + + if SAXGetAttributeValue( "table:border-color" ) = sBorderColor then + printlog "OK, attribute 'table:border-color' has expected value" + else + warnlog "OOPS, attribute 'table:border-color' has unexpected value: " & SAXGetAttributeValue( "table:border-color" ) + endif + + if bCheckCopyBack then + if SAXGetAttributeValue( "table:copy-back" ) = "false" then + printlog "OK, attribute 'table:copy-back' has expected value: 'false'" + else + warnlog "OOPS, attribute 'table:copy-back' has unexpected value: " & SAXGetAttributeValue( "table:copy-back" ) + endif + else + if SAXGetAttributeValue ( "table:copy-back" ) <> "" then + warnlog "OOPS, attribute 'table:copy-back' shouldn't exist here" + endif + endif + + if SAXGetAttributeValue( "table:copy-styles" ) = sCopyStyles then + printlog "OK, attribute 'table:copy-styles' has expected value" + else + warnlog "OOPS, attribute 'table:copy-styles' has unexpected value: " & SAXGetAttributeValue( "table:copy-styles" ) + endif + + if bCheckProtected then + if SAXGetAttributeValue( "table:protected" ) = "true" then + printlog "OK, attribute 'table:protected' has expected value: 'true'" + else + warnlog "OOPS, attribute 'table:protected' has unexpected value: " & SAXGetAttributeValue( "table:protected" ) + endif + else + if SAXGetAttributeValue ( "table:protected" ) <> "" then + warnlog "OOPS, attribute 'table:protected' shouldn't exist here" + endif + endif + + if SAXGetAttributeValue( "table:is-active" ) = sIsActive then + printlog "OK, attribute 'table:is-active' has expected value" + else + warnlog "OOPS, attribute 'table:is-active' has unexpected value: " & SAXGetAttributeValue( "table:is-active" ) + endif + + if SAXGetAttributeValue( "table:scenario-ranges" ) = sScenarioRanges then + printlog "OK, attribute 'table:scenario-ranges' has expected value" + else + warnlog "OOPS, attribute 'table:scenario-ranges' has unexpected value: " & SAXGetAttributeValue( "table:scenario-ranges" ) + qaErrorLog "Expected: " & sScenarioRanges + endif + + if SAXGetAttributeValue( "table:comment" ) = sComment then + printlog "OK, attribute 'table:comment' has expected value" + else + warnlog "OOPS, attribute 'table:comment' has unexpected value: " & SAXGetAttributeValue( "table:comment" ) + qaErrorLog "Expected: " & sComment + endif + else + printlog "Checking scenario details was skipped!" + endif + + if bTableIsScenario then + SAXSeekElement( 0 ) + endif +'///</ul> +end sub + + diff --git a/testautomation/xml/optional/includes/ch_xml_japanese_candlestick.inc b/testautomation/xml/optional/includes/ch_xml_japanese_candlestick.inc new file mode 100644 index 000000000000..f9a60503b3d4 --- /dev/null +++ b/testautomation/xml/optional/includes/ch_xml_japanese_candlestick.inc @@ -0,0 +1,143 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : oliver.craemer@sun.com +'* +'* short description : testing japanese candle strick feature in chart +'* +'************************************************************************************************* +'* +' #1 tJapaneseCandlestickChart 'Check content.xml for attribute chart:japanese-candle-stick +'* +'\************************************************************************************************* + +testcase tJapaneseCandlestickChart + 'Note: Only variant 2 and 4 using the chart:japanese-candle-stick attribute + dim iTypeNum as INTEGER + dim iSaxSeekIndex as INTEGER + dim sOutputFile as STRING + dim sChartContentXML as STRING + dim sUnpackedStorageDir as STRING + dim sAttrValue as STRING + + for iTypeNum = 1 to 4 + if iTypeNum = 2 or iTypeNum = 4 then + sOutputFile = gOfficePath & ConvertPath("user\work\japaneseCandlestickType" & iTypeNum & ".ods") + sUnpackedStorageDir = gOfficePath & ConvertPath("user\work\japaneseCandlestickType") & iTypeNum + if (dir(sUnpackedStorageDir) <> "") then + RmDir (sUnpackedStorageDir) + endif + sChartContentXML = gOfficePath & ConvertPath("user\work\japaneseCandlestickType" & iTypeNum & "\Object 1\content.xml") + printlog "File / New / Spreadsheet" + Call hNewDocument + Kontext "DocumentCalc" + Kontext "RechenleisteCalc" + if not RechenleisteCalc.isvisible then + ViewToolbarsFormulaBar + end if + sleep(2) + printlog "Type in the 'Name Box' of the 'Formula Bar' [CTRL+A]" + Kontext "RechenleisteCalc" + Bereich.TypeKeys "<MOD1 A>" + printlog "and then 'A1:F10' to select a range" + Bereich.TypeKeys "A1:F10" + sleep(1) + printlog "Type [RETURN]" + Bereich.TypeKeys "<RETURN>" + sleep(2) + Kontext "DocumentCalc" + printlog "In the Calc document write '=rand()[SHIFT MOD1 RETURN]'" + DocumentCalc.typekeys("=rand()<SHIFT MOD1 RETURN>") + printlog "Insert / Chart" + InsertChartCalc + sleep(2) + Kontext "ChartType" + printlog "Select Type 8 'Stock Chart'" + ChooseType.Select(8) + printlog "Select Type 2 or 4" + variant.typeKeys "<HOME>" + variant.typeKeys "<RIGHT>", (iTypeNum - 1) + printlog "Click FINISH button" + Kontext "ChartWizard" + ChartWizard.OK + sleep(2) + Kontext "DocumentCalc" + printlog "Type twice [ESCAPE]" + DocumentCalc.TypeKeys "<ESCAPE>" , 2 + sleep(2) + printlog "Save document in the OpenDocument format (should be default)" + printlog " as gOfficePath/user/work/japaneseCandlestickType[2|4].ods" + if hFileSaveAsWithFilterKill (sOutputFile , "calc8") = FALSE then + warnlog "Saving " & sOutputFile & " failed! -> Exiting test!" + call hCloseDocument + goto endsub + else + printlog "File / Close" + call hCloseDocument + sleep(3) + printlog "Unzip or unjar the gOfficePath/user/work/japaneseCandlestickType[2|4].ods" + printlog "into the directory gOfficePath/user/work/japaneseCandlestickType[2|4]" + UnpackStorage(sOutputFile, sUnpackedStorageDir) + printlog "Read the test documents DOM." + printlog "Use an XML editor like jEdit and open the" + printlog "structure of the XML file gOfficePath/user/work/japaneseCandlestickType[2|4]/Object 1/content.xml" + SAXReadFile(sChartContentXML) + sleep(2) + printlog "Set the DOM pointer on element 'office:automatic-styles'" + SAXSeekElement("/") + printlog "The test case is passed if..." + printlog "office:document-content" + printlog "office:automatic-styles" + printlog "style:style" + printlog "..in one of the 10 style:style elements there should be a" + printlog "style:chart-properties" + printlog "chart:japanese-candle-stick" + printlog "with the value true" + SAXSeekElement("office:document-content") + SAXSeekElement("office:automatic-styles") + for iSaxSeekIndex = 1 to 10 + SAXSeekElement("style:style" , iSaxSeekIndex) + if SAXHasElement("style:chart-properties") then + SAXSeekElement("style:chart-properties") + if SaxGetAttributeName(1) = "chart:japanese-candle-stick" then + printlog "Found attribute 'chart:japanese-candle-stick'" + sAttrValue = SAXGetAttributeValue("chart:japanese-candle-stick") + if lcase(sAttrValue) = "true" then + printlog "Expected value of 'chart:japanese-candle-stick' = true was found" + exit for + endif + endif + SAXSeekElement(0) + endif + SAXSeekElement(0) + next iSaxSeekIndex + SAXRelease + endif + endif + next iTypeNum +endcase + diff --git a/testautomation/xml/optional/includes/docbook_001.inc b/testautomation/xml/optional/includes/docbook_001.inc new file mode 100644 index 000000000000..f79f4fd36c4a --- /dev/null +++ b/testautomation/xml/optional/includes/docbook_001.inc @@ -0,0 +1,121 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : helge.delfs@sun.com +'* +'* short description : Library for DocBook XML Im-/Export Test +'* +'\*********************************************************************** + +sub tDocBookXMLtestdocs + Dim sSourceDocuments(500) as string + Dim i as integer, iNumberOfDocuments as integer + + printlog "Checking under Tools -> XML Filter Settings that the DocBook XSLT Filter has been installed." + printlog "If not install them from ../global/input/xslt_stylesheets/docbook_xhtml.jar" + if fInitialXMLSetting("docbook") = FALSE then + warnlog "The DocBook XSLT filter has not been installed!" + warnlog "Aborting!" + exit sub + end if + 'Calculating how many documents are in that directory (max. 500) + if hDirectoryExists(sSourcePath) then + 'Get the file list and put it in a list (max. 500 per directory!) + call GetAllFileList(sSourcePath, "*.xml" , sSourceDocuments()) + iNumberOfDocuments = ListCount(sSourceDocuments()) + printlog iNumberOfDocuments & " DocBook XML files found in " & sSourcePath & "." + if iNumberOfDocuments > 0 then + for i = 2 to iNumberOfDocuments + 'Call the testcase with each document. + call fLoadDocBookXMLAndSaveIt(sSourceDocuments(i)) + next i + else + warnlog "Path " & sSourcePath & " contains no documents!" + end if + else + warnlog "Path " & sSourcePath & " has not been found!" + end if +end sub + +'------------------------------------------------------------------------- + +testcase fLoadDocBookXMLAndSaveIt(sSourceDocument as string) +Dim sExpFileName as string +Dim sFileName as string + +sFileName = DateiExtract(sSourceDocument) +sExpFileName = sDestinationPath & sFileName + + printlog "Load test document " & sFileName & "." + call hFileOpen (sSourceDocument) + printlog "If the document can not be loaded as XML file (wrong Doctype) it will be loaded as ASCII." + Kontext "AsciiFilterOptionen" + if AsciiFilterOptionen.Exists(2) then + AsciiFilterOptionen.Cancel + QAErrorLog "The DTD may be does not match. Work around is to load it as ASCII file." + Goto Endsub + end if + printlog "If the Filter Selection dialog occours the try to select the 'DocBook' entry." + Kontext "FilterAuswahl" + if FilterAuswahl.Exists(2) then + QAErrorLog "Filter selection dialog occoured!" + Filter.Select "DocBook" + FilterAuswahl.OK + end if + 'If there is no document being loaded only the 'backing window' would be visible + if GetDocumentCount = 0 then + warnlog "Document " & sFileName & " has not been loaded! It won't be exported! verify manually!" + else + printlog "Save the test document as " & sExpFileName + if hFileSaveAsWithFilterKill(sExpFileName, "DocBook File") = TRUE then + printlog "Close the document also if there is a verification dialog." + call hCloseDocument + printlog "Check the well formness of the saved document." + if XMLWellformed (sExpFileName) = FALSE then + warnlog "XML-file " & sExpFileName & " not well formed or does not exist!" + else + printlog "Open the exported document." + call hFileOpen (sExpFileName) + Kontext "FilterAuswahl" + if FilterAuswahl.Exists(2) then + QAErrorLog "Filter selection dialog occoured!" + Filter.Select "DocBook" + FilterAuswahl.OK + end if + if GetDocumentCount = 0 then + warnlog "EXPORTED document " & sExpFileName & " has not been loaded! It won't be exported! verify manually!" + else + printlog "Close the exported document." + call hCloseDocument + end if + end if + else + warnlog "Exporting XML file (" & sExpFileName & ") failed!" + end if + end if +endcase + diff --git a/testautomation/xml/optional/includes/f_xml_save_ms_ole.inc b/testautomation/xml/optional/includes/f_xml_save_ms_ole.inc new file mode 100644 index 000000000000..cdf3ba6718ef --- /dev/null +++ b/testautomation/xml/optional/includes/f_xml_save_ms_ole.inc @@ -0,0 +1,251 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : oliver.craemer@sun.com +'* +'* short description : Conversion of Microsoft OLE objects in dependency of settings in Tools::Options::Load/Save::MS_Office +'* +'************************************************************************ +'* +' #1 ms_ole ' Initial routine +' #1 tXML_OLE_Conversion +' #1 subSetConversionMicrosoftOLE +'* +'\************************************************************************ + +testcase tXML_OLE_Conversion ( sCurrentTestDocument as STRING ) + dim iIndex as INTEGER + dim sInputFile as STRING + sInputFile = convertpath ( gTesttoolpath & "xml/optional/input/framework/ms_ole/" & sCurrentTestDocument ) + dim sSplitCurrentTestDocument() as STRING + sSplitCurrentTestDocument() = split ( sCurrentTestDocument , "." ) + dim sCurrentFileName as STRING + sCurrentFileName = sSplitCurrentTestDocument ( 0 ) + dim sCurrentExtension as STRING + sCurrentExtension = sSplitCurrentTestDocument ( 1 ) + dim sCurrentOLE as STRING + sCurrentOLE = left ( sCurrentTestDocument , 3 ) + dim sExtNames( 5 ) AS String + dim sCurrentExtensionOasis as STRING + select case sCurrentExtension + case ( "doc" ) : sExtNames() = hGetFilternameExtension ( "writer8" ) + case ( "xls" ) : sExtNames() = hGetFilternameExtension ( "calc8" ) + case ( "ppt" ) : sExtNames() = hGetFilternameExtension ( "impress8" ) + end select + sCurrentExtensionOasis = " (." & sExtNames(0) & ")" + dim sCurrentFilter as STRING + select case sCurrentExtension + case ( "doc" ) : sCurrentFilter = "writer8" + case ( "xls" ) : sCurrentFilter = "calc8" + case ( "ppt" ) : sCurrentFilter = "impress8" + end select + dim sConversionSettings as STRING + dim sStorageName as STRING + sStorageName = ( gOfficePath & ConvertPath("user\work\xml_") & sCurrentFileName ) + dim sOutputFile as STRING + dim sUnpackedStorageDir as STRING + dim sContentXML as STRING + dim sContentXMLObject as STRING + dim bContentXMLObjectExists as BOOLEAN + dim sRelativePathToObject as STRING + for iIndex = 1 to 4 + printlog "Set desired conversion options in Tools::Options::Load/Save::MS Office" + select case iIndex + case 1 : sConversionSettings = "RESET" + case 2 : sConversionSettings = "SAVE" + case 3 : sConversionSettings = "LOAD" + case 4 : sConversionSettings = "ALL" + end select + call subSetConversionMicrosoftOLE ( sConversionSettings ) + sleep(2) + sOutputFile = sStorageName & "_" & sConversionSettings & "." & sExtNames(0) + sUnpackedStorageDir = sOutputFile & "_unpacked" + 'Erase storage dirctory if exists + if (dir ( sUnpackedStorageDir ) <> "" ) then + rmDir ( sUnpackedStorageDir ) + if (dir ( sUnpackedStorageDir ) <> "" ) then + warnlog "Removing directory failed. Exiting test." + goto endsub + endif + endif + sContentXML = sUnpackedStorageDir & ConvertPath( "\content.xml" ) + printlog "Open test document (MS format)" + call hFileOpen(sInputFile) + printlog Chr(13) & "Loading: " & sInputFile + sleep(2) + printlog "Save document in OpenDocument format" + if hFileSaveAsWithFilterKill ( sOutputFile , sCurrentFilter ) = FALSE then + warnlog "Saving the testdocument failed!" + endif + sleep(2) + printlog "Close document" + call hCloseDocument + sleep(2) + printlog "Unpack storage to obtain the XML files" + try + UnpackStorage( sOutputFile , sUnpackedStorageDir ) + catch + qaErrorLog "#i52632# - Unpacking XML storage failed -> we quit this iteration" + goto skipThisIteration 'Quit only current Iteration (not testcase) on error + endcatch + printlog "Read DOM of content.xml" + SAXReadFile( sContentXML ) + sleep(2) + printlog "Set the DOM pointer on element 'office:body'" + SAXSeekElement( "/" ) + SAXSeekElement( "office:document-content" ) + SAXSeekElement( "office:body" ) + printlog "Use recursion to find XML element 'draw:object-ole' or'draw:object'" + select case sConversionSettings + case "RESET" , "SAVE" + if hXMLSeekElementInTree ( "draw:object-ole" ) = FALSE then + warnlog "Not finding the node 'draw:object-ole' is unexpected -> Check this out!" + SAXRelease + goto skipThisIteration 'Quit only current Iteration (not testcase) on error + endif + case "LOAD" , "ALL" + if hXMLSeekElementInTree ( "draw:object" ) = FALSE then + warnlog "Not finding the node 'draw:object' is unexpected -> Check this out!" + SAXRelease + goto skipThisIteration 'Quit only current Iteration (not testcase) on error + endif + end select + sRelativePathToObject = SAXGetAttributeValue( "xlink:href" ) + sRelativePathToObject = Right ( sRelativePathToObject , Len ( sRelativePathToObject ) - 1 ) + sContentXMLObject = sUnpackedStorageDir & ConvertPath ( sRelativePathToObject & "\content.xml" ) + printlog "Check existence of objects 'content.xml' in dependency of settings in Tools::Options::Load/Save::MS_Office" + printlog "Lookup if objects 'content.xml' exists - TRUE for OASIS OLE, FALSE for MS OLE" + if (dir ( sContentXMLObject ) <> "" ) then + bContentXMLObjectExists = TRUE + else + bContentXMLObjectExists = FALSE + endif + printlog "Verify result against expectations for existence of objects 'content.xml'" + select case sConversionSettings + case "RESET" , "SAVE" + if bContentXMLObjectExists then + warnlog "+ OOPS, 'content.xml' shouldn't exist in MS OLE directory -> Check this out!" + endif + case "LOAD" , "ALL" + if bContentXMLObjectExists = FALSE then + warnlog "+ OOPS, 'content.xml' must exist in OASIS OLE directory -> Check this out!" + endif + end select + printlog "Release documents DOM" + SAXRelease + if bContentXMLObjectExists then + printlog "Read the OLE object DOM." + SAXReadFile( sContentXMLObject ) + sleep(2) + printlog "Check if expected OLE object was found in 'content.xml'" + SAXSeekElement( "/" ) + select case sCurrentOLE + case "mat" + SAXSeekElement( 1 ) + if SAXGetElementName() <> "math" then + warnlog "A Math object was expected here -> Check this out!" + endif + case else + SAXSeekElement( "office:document-content" ) + SAXSeekElement( "office:body" ) + SAXSeekElement( 1 ) + select case sCurrentOLE + case "exc" + if SAXGetElementName() <> "office:spreadsheet" then + warnlog "+ OOPS, this OLE seems to be no spreadsheet -> Check this out!" + endif + case "ppt" + if SAXGetElementName() <> "office:presentation" then + warnlog "+ OOPS, this OLE seems to be no presentation -> Check this out!" + endif + case "wor" + if SAXGetElementName() <> "office:text" then + warnlog "+ OOPS, this OLE seems to be no text -> Check this out!" + endif + end select + end select + SAXRelease + endif + skipThisIteration: + next iIndex +endcase +' +'----------------------------------------------------------------------------- +' +sub subSetConversionMicrosoftOLE ( OPTIONAL sConversionType as STRING ) +'Routine to adjust the behaviour of Tools::Options::Load/Save::Microsoft Office +'Possible Keys for 'sConversionType' are: +'RESET (or omitted): Uncheck all boxes (default in a freshly installed OOo)) +'ALL: Check all boxes +'LOAD: Check all boxes for loading MS OLE objects (left side), uncheck all boxes for saving +'SAVE: Check all boxes for saving MS OLE objects (right side), uncheck all boxes for loading +'For other values the subroutine will exit + + if IsMissing ( sConversionType ) then + sConversionType = "RESET" + end if + dim iPosInAuswahl as INTEGER + dim iExtraToggle as INTEGER + + 'Determine value of 'iExtraToggle' for known keys + select case sConversionType + case "RESET" : iExtraToggle = 1 + case "ALL" : iExtraToggle = 2 + case "LOAD" : iExtraToggle = 3 + case "SAVE" : iExtraToggle = 4 + case else + warnlog "Unknown keyword for paramter -> Exit the subroutine" + qaErrorLog "Valid keywords are RESET, ALL, LOAD and SAVE!" + exit sub + end select + + printlog "Invoke Tools::Options" + ToolsOptions + printlog "Go to tabpage Load/Save::Microsoft Office" + call hToolsOptions ( "LOADSAVE" , "MICROSOFTOFFICE" ) + printlog "Go to top entry in listbox" + Auswahl.TypeKeys( "<PageUp>" ) + printlog "Toggle (in a tricky way) to a defined state of checkboxes" + for iPosInAuswahl = 1 to 4 + Auswahl.TypeKeys ( "<RIGHT>" , 2 ) + while NOT Auswahl.IsChecked + Auswahl.TypeKeys ( "<Space>" ) + wend + while Auswahl.IsChecked + Auswahl.TypeKeys ( "<Space>" ) + wend + printlog "Toggle to desired state of boxes" + Auswahl.TypeKeys ( "<Space>" , iExtraToggle ) + printlog "Go one entry down in list box" + Auswahl.TypeKeys ( "<Down>" ) + printlog "Loop for all lines" + next iPosInAuswahl + printlog "Quit dialog" + Kontext "OptionenDLG" + OptionenDLG.Ok +end sub + diff --git a/testautomation/xml/optional/includes/sxc7_01.inc b/testautomation/xml/optional/includes/sxc7_01.inc new file mode 100644 index 000000000000..ada6b021ff19 --- /dev/null +++ b/testautomation/xml/optional/includes/sxc7_01.inc @@ -0,0 +1,696 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : oliver.creamer@sun.com +'* +'* short description : XML Calc Include File +'* +'\*********************************************************************************** + Dim Isliste(250) as string + Dim OutputPath as string + +sub sxc7_01 + + printlog "--------------------------- sxc_01.inc ------------------------------" + printlog "------------------------ Alien Attributes ---------------------------" + call tAlienAttributes + printlog "---------------------- File Format Changes --------------------------" + call tfeat906 + printlog "------------------------------ Cells --------------------------------" + call tCellformats1 + + call tCellformats2 + call tCellformats3 + +end sub + +'------------------------------------------------------------------------- +testcase tAlienAttributes + Dim i as integer + Dim a as integer + Dim c as integer + Dim xXMLStyleName as string + Dim xPath as string + Dim AttrNameInDOM as string + Dim AttributeSearch(50) as string + Dim AttributeValue(50) as string + + printlog "+- alien_attributes.sxc" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\ooo10\alien_attributes.sxc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes.sxc") , "StarOffice XML (Calc)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + SAXReadFile(gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes\content.xml")) + printlog "-----------------" + printlog "Hidden Namespaces" + printlog "-----------------" + '/// <u><b>content.xml</u></b> + '/// <u>Hidden attributes in namespaces</u> + '///+ Searching for: xmlns:foo="http://openoffice.org/2000/foo" + '///+ Searching for: xmlns:bla="http://openoffice.org/2000/bla" + '------------------------------------------------------------------------- + AttributeSearch(1) = "xmlns:foo" + AttributeValue(1) = "http://openoffice.org/2000/foo" + + AttributeSearch(2) = "xmlns:bla" + AttributeValue(2) = "http://openoffice.org/2000/bla" + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-content") + for i = 1 to 2 + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + warnlog "Hidden attributes (in namespace): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + next i + printlog " * * *" + '/// <u>hidden attributes</u> + '///+<ol><li><b>in a cell style</b></li> + '///+<li><b>in a paragraph style (twice)</b></li> + '///+<li><b>in a text style (twice)</b></li> + '///+<li><b>in a graphic style</b></li></ol> + '///+ Searching for: bla="holla" + '///+ Searching for: bla1="holla1" + '///+ Searching for: bla2="holla2" + '///+ Searching for: foo:foobla="holla" + '///+ Searching for: foo:foobla1="holla1" + '///+ Searching for: foo:foobla2="holla2" + '///+ Searching for: bla:blabla="holla" + '///+ Searching for: bla:blabla1="holla1" + '///+ Searching for: bla:blabla2="holla2" + AttributeSearch(1) = "bla" + AttributeValue(1) = "holla" + AttributeSearch(2) = "bla1" + AttributeValue(2) = "holla1" + AttributeSearch(3) = "bla2" + AttributeValue(3) = "holla2" + AttributeSearch(4) = "foo:foobla" + AttributeValue(4) = "holla" + AttributeSearch(5) = "foo:foobla1" + AttributeValue(5) = "holla1" + AttributeSearch(6) = "foo:foobla2" + AttributeValue(6) = "holla2" + AttributeSearch(7) = "bla:blabla" + AttributeValue(7) = "holla" + AttributeSearch(8) = "bla:blabla1" + AttributeValue(8) = "holla1" + AttributeSearch(9) = "bla:blabla2" + AttributeValue(9) = "holla2" + '------------------------------------------------------------------------- + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + for c = 1 to 6 + if c = 1 then + printlog "---------------------------------------" + printlog "Hidden attributes in a cell style" + printlog "---------------------------------------" + end if + if c = 2 OR c = 3 then + printlog "---------------------------------------" + printlog "Hidden attributes in a paragraph style (" & c-1 & ")" + printlog "---------------------------------------" + end if + if c = 4 or c = 5 then + printlog "---------------------------------------" + printlog "Hidden attributes in a text style (" & c-3 & ")" + printlog "---------------------------------------" + end if + if c = 6 then + printlog "---------------------------------------" + printlog "Hidden attributes in a graphic style" + printlog "---------------------------------------" + end if + SAXSeekElement("/") + SAXSeekElement("office:document-content") + SAXSeekElement("office:automatic-styles") + 'The hidden attributes are in a known sequence included, + 'so the same routine will be used for different styles! + + 'Note: The first four style:style elements do not have any hidden attributes -> 4+c. + SAXSeekElement("style:style" , 4+c ) + AttrNameInDOM = SAXGetAttributeValue("style:name") + printlog " + Style name: " & AttrNameInDOM + printlog " |" + SAXSeekElement("style:properties") + for i = 1 to 9 + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + 'c = <nr> means <nr>'th+4 style:style in DOM tree + if c = 1 then + warnlog "Hidden attributes (in a cell style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + if c = 2 or c = 3 then +' warnlog "Hidden attributes (in a paragraph style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + warnlog "#i100879# : Hidden attributes (in a paragraph style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + if c = 4 or c = 5 then + warnlog "Hidden attributes (in a text style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + if c = 6 then + warnlog "Hidden attributes (in a graphic style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + end if + next i + next c + SAXSeekElement("/") + printlog " * * *" + '------------------------------------------------------------------------- + SAXRelease() + SAXReadFile(gOfficePath & ConvertPath("user\work\xml\calc\level1\alien_attributes\styles.xml")) + '------------------------------------------------------------------------- + printlog " -------------------" + printlog " s t y l e s . x m l" + printlog " -------------------" + printlog "-----------------" + printlog "Hidden Namespaces" + printlog "-----------------" + '/// <u><b>styles.xml</u></b> + '/// <u>Hidden attributes in namespaces</u> + '///+ Searching for: xmlns:foo="http://openoffice.org/2000/foo" + '///+ Searching for: xmlns:bla="http://openoffice.org/2000/bla" + '------------------------------------------------------------------------- + AttributeSearch(1) = "xmlns:foo" + AttributeValue(1) = "http://openoffice.org/2000/foo" + + AttributeSearch(2) = "xmlns:bla" + AttributeValue(2) = "http://openoffice.org/2000/bla" + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-styles") + for i = 1 to 2 + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + warnlog "Hidden attributes (in namespace): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + next i + printlog " * * *" + SAXSeekElement("/") + '------------------------------------------------------------------------- + '/// <u>hidden attributes</u> + '///+<ol><li><b>in a table cell template style</b></li> + '///+<li><b>in a master page template style</b></li></ol> + '///+ Searching for: bla="holla" + '///+ Searching for: bla1="holla1" + '///+ Searching for: bla2="holla2" + '///+ Searching for: foo:foobla="holla" + '///+ Searching for: foo:foobla1="holla1" + '///+ Searching for: foo:foobla2="holla2" + '///+ Searching for: bla:blabla="holla" + '///+ Searching for: bla:blabla1="holla1" + '///+ Searching for: bla:blabla2="holla2" + AttributeSearch(1) = "bla" + AttributeValue(1) = "holla" + AttributeSearch(2) = "bla1" + AttributeValue(2) = "holla1" + AttributeSearch(3) = "bla2" + AttributeValue(3) = "holla2" + AttributeSearch(4) = "foo:foobla" + AttributeValue(4) = "holla" + AttributeSearch(5) = "foo:foobla1" + AttributeValue(5) = "holla1" + AttributeSearch(6) = "foo:foobla2" + AttributeValue(6) = "holla2" + AttributeSearch(7) = "bla:blabla" + AttributeValue(7) = "holla" + AttributeSearch(8) = "bla:blabla1" + AttributeValue(8) = "holla1" + AttributeSearch(9) = "bla:blabla2" + AttributeValue(9) = "holla2" + '------------------------------------------------------------------------- + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + for c = 1 to 2 + SAXSeekElement("/") + if c = 1 then + printlog "-----------------------------------------------" + printlog "Hidden attributes in a template of a cell style" + printlog "-----------------------------------------------" + SAXSeekElement("office:document-styles") + SAXSeekElement("office:styles") + SAXSeekElement("style:style" , 2) + AttrNameInDOM = SAXGetAttributeValue("style:name") + printlog " + Style name: " & AttrNameInDOM + printlog " |" + end if + if c = 2 then + printlog "------------------------------------------------------" + printlog "Hidden attributes in a template of a master page style" + printlog "------------------------------------------------------" + SAXSeekElement("office:document-styles") + SAXSeekElement("office:automatic-styles") + SAXSeekElement("style:page-master") + AttrNameInDOM = SAXGetAttributeValue("style:name") + printlog " + Style name: " & AttrNameInDOM + printlog " |" + end if + SAXSeekElement("style:properties") + for i = 1 to 9 + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + if c = 1 then + warnlog "Hidden attributes (in a template of a cell style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + if c = 2 then + warnlog "Hidden attributes (in a template of a master page style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + end if + next i + next c + SAXSeekElement("/") + '------------------------------------------------------------------------- + printlog " * * *" + SAXRelease() + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- + +testcase tfeat906 + Dim i as integer + Dim a as integer + Dim c as integer + Dim xXMLStyleName as string + Dim xPath as string + Dim AttrNameInDOM as string + Dim AttributeSearch(50) as string + Dim AttributeValue(50) as string + + printlog "+- feat906.sxc" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\ooo10\feat906.sxc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\feat906.sxc") , "StarOffice XML (Calc)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\feat906.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\feat906") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\feat906\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\feat906\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\feat906\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\feat906.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + SAXReadFile(gOfficePath & ConvertPath("user\work\xml\calc\level1\feat906\content.xml")) + printlog "-------------------------------" + printlog "draw:notify-on-update-of-ranges" + printlog "-------------------------------" + '/// <u><b>content.xml</u></b> + '/// <u>draw:notify-on-update-of-ranges</u> + '/// <i>Feature (Change) 906</i> + '///+ <blockquote>The draw:object got a new attribute. This attribute is only + '///+ on chart objects given. It gives the ranges or tablenames + '///+ of the chart (the ranges or tablenames the chart is + '///+ connected to). If the attribute is not given the object + '///+ will be loaded otherwise the object is only loaded if in + '///+ the ranges or tables is something changed or the object is + '///+ showed. If the value of the attribute is empty it is a OLE + '///+ chart with its own data. + '///+ This increase the performance of loading charts, because + '///+ they are only loaded if they are needed.<br> + '///+ This attribute <u>replaces</u> the <i>draw:notify-on-update-table</i> + '///+ attribute which only was usable by the wordprocessing + '///+ application. The new one is used by the wordprocessing and + '///+ the spreadsheet application. + '///+ The data in this attribute are twice, because the chart has + '///+ this data too, but to get this data from the chart it has + '///+ to be loaded.</blockquote> + '/// Searching for: draw:notify-on-update-of-ranges="Sheet1.A1:Sheet1.A5" + + '------------------------------------------------------------------------- + AttributeSearch(1) = "draw:notify-on-update-of-ranges" + AttributeValue(1) = "Sheet1.A1:Sheet1.A5" + + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-content") + SAXSeekElement("office:body") + SAXSeekElement("table:table") + SAXSeekElement("table:table-row" , 2) + SAXSeekElement("table:table-cell" , 2) + SAXSeekElement("draw:object") + for i = 1 to 1 + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + warnlog "Hidden attributes (in namespace): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + next i + printlog " * * *" + SAXRelease() + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- + +testcase tCellformats1 + Dim i as integer + Dim a as integer + Dim xXMLStyleName as string + Dim xPath as string + Dim AttributeSearch(50) as string + Dim AttributeValue(50) as string + + printlog "+- cellformats1.sdc" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\cellformats1.sdc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats1.sxc") , "StarOffice XML (Calc)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats1.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats1") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats1\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats1\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats1\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats1.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + printlog " ---------------------" + printlog " c o n t e n t . x m l" + printlog " ---------------------" + + '/// <u><b>content.xml</u></b> + SAXReadFile(gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats1\content.xml")) + printlog "-----------" + printlog "T A B L E S" + printlog "-----------" + '/// <u>table style t1</u> + '///+ Searching for: style:master-page-name="Default" /// + '///+ Searching for: style:family="table" /// + '------------------------------------------------------------------------- + AttributeSearch(1) = "style:family" + AttributeValue(1) = "table" + + AttributeSearch(2) = "style:master-page-name" + AttributeValue(2) = "Default" + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + xXMLStyleName = GetItemStyleName ( "office:body", "table:table", "table:table" , 1 , "table:style-name" ) + printlog " +---------------------------------------------------------" + printlog " |" & xXMLStyleName + printlog " +---------------------------------------------------------" + xPath = GetXMLElementPath( "office:automatic-styles" , "style:style" , "style:name" , xXMLStyleName) + for i = 1 to 2 + SAXSeekElement(xPath) + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + warnlog "Table Style: " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + next i + '///+ <i>style properties:</i> + '///+ Searching for: table:display="true" + '------------------------------------------------------------------------- + AttributeSearch(1) = "table:display" + AttributeValue(1) = "true" + '------------------------------------------------------------------------- + SAXSeekElement(xPath) + SAXSeekElement("style:properties") + printlog " +- " & AttributeSearch(1) + if SAXGetAttributeValue(AttributeSearch(1)) <> AttributeValue(1) then + warnlog "style:properties: " & AttributeSearch(1) & " is not " & AttributeValue(1) & "!" + end if + SAXSeekElement("/") + printlog " * * *" + + printlog "---------" + printlog "C E L L S" + printlog "---------" + + '/// <u>cell style ce2</u> + '///+ Searching for: style:family="table-cell" + '///+ Searching for: style:parent-style-name="Default" + '------------------------------------------------------------------------- + AttributeSearch(1) = "style:family" + AttributeValue(1) = "table-cell" + AttributeSearch(2) = "style:parent-style-name" + AttributeValue(2) = "Default" + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-content") + SAXSeekElement("office:body") + SAXSeekElement("table:table") + SAXSeekElement("table:table-row" , 2) + SAXSeekElement("table:table-cell" , 2) + xXMLStyleName = SAXGetAttributeValue("table:style-name") + printlog " +---------------------------------------------------------" + printlog " |" & xXMLStyleName + printlog " +---------------------------------------------------------" + xPath = GetXMLElementPath( "office:automatic-styles" , "style:style" , "style:name" , xXMLStyleName) + for i = 1 to 2 + SAXSeekElement(xPath) + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + warnlog "Table Style: " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + next i + '///+ <i>style properties:</i> + '///+ Searching for: fo:color="#000000" + '///+ Searching for: style:font-name="Arial" + '///+ Searching for: fo:font-size="10pt" + '///+ Searching for: fo:font-style="italic" + '///+ Searching for: style:text-underline="single" + '///+ Searching for: fo:font-weight="bold" + '------------------------------------------------------------------------- + AttributeSearch(1) = "fo:color" + AttributeValue(1) = "#000000" + AttributeSearch(2) = "style:font-name" + AttributeValue(2) = "Arial" + AttributeSearch(3) = "fo:font-size" + AttributeValue(3) = "10pt" + AttributeSearch(4) = "fo:font-style" + AttributeValue(4) = "italic" + AttributeSearch(5) = "style:text-underline" + AttributeValue(5) = "single" + AttributeSearch(6) = "fo:font-weight" + AttributeValue(6) = "bold" + '------------------------------------------------------------------------- + SAXSeekElement(xPath) + SAXSeekElement("style:properties") + + for i = 1 to 6 + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + warnlog "style:properties: " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + next i + SAXSeekElement("/") + printlog " * * *" + + '/// <u>cell 3</u> + '///+ Searching for: style:family="table-cell" + '///+ Searching for: style:parent-style-name="Default" + '------------------------------------------------------------------------- + AttributeSearch(1) = "style:family" + AttributeValue(1) = "table-cell" + AttributeSearch(2) = "style:parent-style-name" + AttributeValue(2) = "Default" + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement(1) + SAXSeekElement("office:body") + SAXSeekElement("table:table") + SAXSeekElement("table:table-row" , 4) + SAXSeekElement("table:table-cell" , 2) + xXMLStyleName = SAXGetAttributeValue("table:style-name") + printlog " +---------------------------------------------------------" + printlog " |" & xXMLStyleName + printlog " +---------------------------------------------------------" + xPath = GetXMLElementPath( "office:automatic-styles" , "style:style" , "style:name" , xXMLStyleName) + for i = 1 to 2 + SAXSeekElement(xPath) + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + warnlog "Table Style: " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + next i + '///+ <i>style properties:</i> + '///+ Searching for: fo:color="#800000" + '///+ Searching for: style:text-outline="true" + '///+ Searching for: style:text-crossing-out="single-line" + '///+ Searching for: fo:font-size="12pt" + '///+ Searching for: fo:language="en" + '///+ Searching for: fo:country="US" + '///+ Searching for: fo:text-shadow="none" + '------------------------------------------------------------------------- + AttributeSearch(1) = "fo:color" + AttributeValue(1) = "#800000" + AttributeSearch(2) = "style:text-outline" + AttributeValue(2) = "true" + AttributeSearch(3) = "fo:font-size" + AttributeValue(3) = "12pt" + AttributeSearch(4) = "style:text-crossing-out" + AttributeValue(4) = "single-line" + AttributeSearch(5) = "fo:text-shadow" + AttributeValue(5) = "none" + AttributeSearch(6) = "fo:country" + AttributeValue(6) = "US" + AttributeSearch(7) = "fo:language" + AttributeValue(7) = "en" + '------------------------------------------------------------------------- + SAXSeekElement(xPath) + SAXSeekElement("style:properties") + + for i = 1 to 7 + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + warnlog "style:properties: " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + next i + SAXSeekElement("/") + printlog " * * *" + + '/// <u>cell 4</u> + '///+ <i>style properties:</i> + '///+ Searching for: style:font-name="Times New Roman" + '///+ Searching for: fo:font-size="28pt" + '------------------------------------------------------------------------- + AttributeSearch(1) = "style:font-name" + AttributeValue(1) = "Comic Sans MS" + AttributeSearch(2) = "fo:font-size" + AttributeValue(2) = "16pt" + '------------------------------------------------------------------------- + SAXSeekElement(1) + SAXSeekElement("office:body") + SAXSeekElement("table:table") + SAXSeekElement("table:table-row", 6) + SAXSeekElement("table:table-cell" , 2) + xXMLStyleName = SAXGetAttributeValue("table:style-name") + printlog " +---------------------------------------------------------" + printlog " |" & xXMLStyleName + printlog " +---------------------------------------------------------" + xPath = GetXMLElementPath( "office:automatic-styles" , "style:style" , "style:name" , xXMLStyleName) + SAXSeekElement(xPath) + SAXSeekElement(1) + for i = 1 to 2 + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + warnlog "style:properties: " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + next i + SAXRelease() + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tCellformats2 + printlog "+- cellformats2.sdc" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\cellformats2.sdc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2.sxc") , "StarOffice XML (Calc)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tCellformats3 + printlog "+- cellformats3.sdc" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\cellformats3.sdc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats3.sxc") , "StarOffice XML (Calc)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats3.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats3") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats3\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats3\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats3\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats3.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase + diff --git a/testautomation/xml/optional/includes/sxc7_02.inc b/testautomation/xml/optional/includes/sxc7_02.inc new file mode 100644 index 000000000000..a28cd1249f05 --- /dev/null +++ b/testautomation/xml/optional/includes/sxc7_02.inc @@ -0,0 +1,254 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : oliver.creamer@sun.com +'* +'* short description : XML Calc Include File +'* +'\*********************************************************************************** + Dim Isliste(250) as string + Dim OutputPath as string + +sub sxc7_02 + + printlog "------------------- sxc_02.inc ---------------------" + printlog "---------------------- Cells -----------------------" + + call tcellformats2b + call tcellformats5 + call tcellformats6 + + printlog "---------------------- C J K -----------------------" + + call tjapan + call tkorean + call tsimple_c + call trad_c + +end sub + +'------------------------------------------------------------------------- +testcase tcellformats2b + printlog "+- cellformats2b" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\cellformats2b.sdc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2b.sxc") , "StarOffice XML (Calc)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2b.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2b") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2b\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2b\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2b\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats2b.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- +testcase tcellformats5 + printlog "+- cellformats5.sdc" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\cellformats5.sdc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats5.sxc") , "StarOffice XML (Calc)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats5.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats5") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats5\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats5\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats5\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats5.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- + +testcase tcellformats6 + printlog "+- cellformats6.sdc" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\cellformats6.sdc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats6.sxc") , "StarOffice XML (Calc)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats6.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats6") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats6\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats6\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats6\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\cellformats6.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- + +testcase tjapan + printlog "+- japan.sxc" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\ooo10\japan.sxc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\japan.sxc") , "StarOffice XML (Calc)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\japan.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\japan") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\japan\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\japan\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\japan\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\japan.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- + +testcase tkorean + printlog "+- korean.sxc" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\ooo10\korean.sxc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\korean.sxc") , "StarOffice XML (Calc)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\korean.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\korean") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\korean\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\korean\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\korean\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\korean.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- + +testcase tsimple_c + printlog "+- simple_c.sxc" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\ooo10\simple_c.sxc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\simple_c.sxc") , "StarOffice XML (Calc)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\simple_c.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\simple_c") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\simple_c\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\simple_c\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\simple_c\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\simple_c.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- + +testcase trad_c + printlog "+- trad_c.sxc" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\ooo10\trad_c.sxc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\trad_c.sxc") , "StarOffice XML (Calc)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\trad_c.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\trad_c") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\trad_c\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\trad_c\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\trad_c\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\trad_c.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase + diff --git a/testautomation/xml/optional/includes/sxc7_03.inc b/testautomation/xml/optional/includes/sxc7_03.inc new file mode 100644 index 000000000000..5a9074c0fcbb --- /dev/null +++ b/testautomation/xml/optional/includes/sxc7_03.inc @@ -0,0 +1,332 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : oliver.creamer@sun.com +'* +'* short description : XML Calc Include File +'* +'\*********************************************************************************** + Dim Isliste(250) as string + Dim OutputPath as string + Dim iSecurityBefore as integer + +sub sxc7_03 + printlog "------------------- sxc_03.inc ---------------------" + + call tchart_export + call tconditional_formatting + iSecurityBefore = "" + iSecurityBefore = hSetMacroSecurity(1) + call tcontrols01 + call hSetMacroSecurity(iSecurityBefore) + call tdatabase_ranges + call tfilter_and_subtotals1 + call tfilter_and_subtotals4 + call tmatrixformula_and_notes + call tpassword3 +end sub + +'------------------------------------------------------------------------- + +testcase tchart_export + printlog "+- chart_export.sdc" + if bDebugVersion = TRUE then + warnlog "#i41970# Assertion in DEBUG version breaks automated testing. This testcase will be ignored." + goto endsub + end if + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\chart_export.sdc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\chart_export.sxc") , "StarOffice XML (Calc)") = TRUE then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\chart_export.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\chart_export") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\chart_export\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\chart_export\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\chart_export\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\chart_export.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + warnlog "It was not possible to save the document as XML!" + end if +endcase + +'------------------------------------------------------------------------- + +testcase tconditional_formatting + printlog "+- conditional_formatting.sdc" + + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\conditional_formatting.sdc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\conditional_formatting.sxc") , "StarOffice XML (Calc)") = TRUE then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\conditional_formatting.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\conditional_formatting") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\conditional_formatting\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\conditional_formatting\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\conditional_formatting\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\conditional_formatting.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + warnlog "It was not possible to save the document as XML!" + end if +endcase + +'------------------------------------------------------------------------- + +testcase tcontrols01 + Dim cWhereCalled as string + + printlog "+- controls01.sdc" + + cWhereCalled = "xml::level1::inc::sxc7_03.inc::tcontrols01: " + + '/// Open Tools/Options -> OpenOffice.org/Security + '/// Click on the macro security button + '/// Set the <b>medium</b> security level + try + if iSecurityBefore = "" then + QAErrorLog cWhereCalled & "Macro security level needs to be set before to 1 (medium)!" + goto endsub + end if + catch + 'if variable iSecurityBefore is not initialized and causes into an error + QAErrorLog cWhereCalled & "Macro security level needs to be set before to 1 (medium)!" + goto endsub + endcatch + + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\controls01.sdc")) + + Kontext "SecurityWarning" + if SecurityWarning.Exists(1) then + SecurityWarning.OK + else + warnlog "#i80769# Macros not being loaded. Exiting test case." + 'warnlog "No Macro Security Warning occoured while loading 'controls01.sdc'." + call hCloseDocument + goto endsub + end if + sleep(2) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\controls01.sxc") , "StarOffice XML (Calc)") = TRUE then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\controls01.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\controls01") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\controls01\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\controls01\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\controls01\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\controls01.sxc")) + '/// Accept the security warning and enable executing the macros. + Kontext "SecurityWarning" + if SecurityWarning.Exists(1) then + SecurityWarning.OK + else + warnlog "Macro will not be loaded due to bug #i80769#" + 'warnlog "No Macro Security Warning occoured while loading 'controls01.sxc'." + end if + sleep(2) + call hCloseDocument + sleep(2) + end if + else + warnlog "It was not possible to save the document as XML!" + end if +endcase + +'------------------------------------------------------------------------- + +testcase tdatabase_ranges + printlog "+- database_ranges.sdc" + + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\database_ranges.sdc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\database_ranges.sxc") , "StarOffice XML (Calc)") = TRUE then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\database_ranges.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\database_ranges") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\database_ranges\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\database_ranges\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\database_ranges\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\database_ranges.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + warnlog "It was not possible to save the document as XML!" + end if +endcase + +'------------------------------------------------------------------------- + +testcase tfilter_and_subtotals1 + printlog "+- filter_and_subtotals1" + + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\filter_and_subtotals1.sdc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals1.sxc") , "StarOffice XML (Calc)") = TRUE then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals1.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals1") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals1\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals1\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals1\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals1.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + warnlog "It was not possible to save the document as XML!" + end if +endcase + +'------------------------------------------------------------------------- + +testcase tfilter_and_subtotals4 + printlog "+- filter_and_subtotals4.sdc" + + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\filter_and_subtotals4.sdc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals4.sxc") , "StarOffice XML (Calc)") = TRUE then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals4.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals4") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals4\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals4\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals4\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\filter_and_subtotals4.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + warnlog "It was not possible to save the document as XML!" + end if +endcase + +'------------------------------------------------------------------------- + +testcase tmatrixformula_and_notes + printlog "+- matrixformula_and_notes.sdc" + + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\matrixformula_and_notes.sdc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\matrixformula_and_notes.sxc") , "StarOffice XML (Calc)") = TRUE then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\matrixformula_and_notes.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\matrixformula_and_notes") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\matrixformula_and_notes\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\matrixformula_and_notes\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\matrixformula_and_notes\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\matrixformula_and_notes.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + warnlog "It was not possible to save the document as XML!" + end if +endcase + +'------------------------------------------------------------------------- + +testcase tpassword3 + printlog "+- password3.sdc" + + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\calc\so_binary\password3.sdc")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\calc\level1\password3.sxc") , "StarOffice XML (Calc)") = TRUE then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\calc\level1\password3.sxc") , gOfficePath & ConvertPath("user\work\xml\calc\level1\password3") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\password3\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\password3\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\calc\level1\password3\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\calc\level1\password3.sxc")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + warnlog "It was not possible to save the document as XML!" + end if +endcase + diff --git a/testautomation/xml/optional/includes/sxd7_01.inc b/testautomation/xml/optional/includes/sxd7_01.inc new file mode 100644 index 000000000000..b3e3fd626a5f --- /dev/null +++ b/testautomation/xml/optional/includes/sxd7_01.inc @@ -0,0 +1,634 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : wolfram.garten@sun.com +'* +'* short description : XML Draw Include File +'* +'\*********************************************************************************** + Dim Isliste(250) as string + Dim OutputPath as string + +sub sxd7_01 + printlog "------------------- sxd_01.inc ---------------------" + printlog "----------------------------------------------------" + call talien_attributes + printlog "---------------------- C J K -----------------------" + call tchinese + call tjapan + call tkorean + call tradchinese + printlog "----------------------------------------------------" + call t18092 + call t18093 + call t18094 + call t18098 + call t18099 + call t18100 + call t18101 + call t18102 + call t18106 + call t18107 + +end sub + +'------------------------------------------------------------------------- + +testcase talien_attributes + Dim i as integer + Dim AttrNameInDOM as string + Dim AttributeSearch(5) as string + Dim AttributeValue(5) as string + printlog "+- Impress: alien.sxd" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\ooo10\alien.sxd")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\alien.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\alien.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\alien\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\alien\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\alien\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\alien\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\alien.sxd") + sleep(2) + call hCloseDocument + sleep(2) + SAXReadFile(gOfficePath & ConvertPath("user\work\xml\draw\level1\alien\content.xml")) + printlog "-----------------" + printlog "Hidden Namespaces" + printlog "-----------------" + '/// <u><b>content.xml</u></b> + '/// <u>Hidden attributes in namespaces</u> + '///+ Searching for: xmlns:alien="http://openoffice.org/2000/alien" + '------------------------------------------------------------------------- + AttributeSearch(1) = "xmlns:alien" + AttributeValue(1) = "http://openoffice.org/2000/alien" + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-content") + printlog " +- " & AttributeSearch(1) + if SAXGetAttributeValue(AttributeSearch(1)) <> AttributeValue(1) then + warnlog "Hidden attributes (in namespace): " & AttributeSearch(1) & " is not " & AttributeValue(1) & "!" + end if + printlog " * * *" + SAXSeekElement("/") + '/// <u>hidden attributes</u> + '///+<ol><li><b>in a drawing-page style</b></li> + '///+<li><b>in a graphics style</b></li> + '///+<li><b>in a paragraph style (twice)</b></li> + '///+<li><b>in a text style</b></li></ol> + '///+ Searching for: alien:key="page" + '///+ Searching for: alien:key="shape" + '///+ Searching for: alien:key="para" + '///+ Searching for: alien:key="shape-text" + '///+ Searching for: alien:key="text" + AttributeSearch(1) = "alien:key" + AttributeValue(1) = "page" + + AttributeSearch(2) = "alien:key" + AttributeValue(2) = "shape" + + AttributeSearch(3) = "alien:key" + AttributeValue(3) = "para" + + AttributeSearch(4) = "alien:key" + AttributeValue(4) = "shape-text" + + AttributeSearch(5) = "alien:key" + AttributeValue(5) = "text" + '------------------------------------------------------------------------- + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + for i = 1 to 5 + if i = 1 then + printlog "-----------------------------------------" + printlog "Hidden attributes in a drawing-page style" + printlog "-----------------------------------------" + end if + if i = 2 then + printlog "-------------------------------------" + printlog "Hidden attributes in a graphics style" + printlog "-------------------------------------" + end if + if i = 3 or i = 4 then + printlog "-------------------------------------------" + printlog "Hidden attributes in a paragraph style (" & i-2 & ")" + printlog "-------------------------------------------" + end if + if i = 5 then + printlog "---------------------------------" + printlog "Hidden attributes in a text style" + printlog "---------------------------------" + end if + 'The hidden attributes are in a known sequence included, + 'so the same routine will be used for different styles! + SAXSeekElement("/") + SAXSeekElement("office:document-content") + SAXSeekElement("office:automatic-styles") + SAXSeekElement("style:style" , i ) + AttrNameInDOM = SAXGetAttributeValue("style:name") + printlog " + Style name (" & i & "): " & AttrNameInDOM + printlog " |" + SAXSeekElement("style:properties") + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + 'i = <nr> means <nr>'th style:style in DOM tree + if i = 1 then + warnlog "Hidden attributes (in a drawing-page style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + if i = 2 then + warnlog "Hidden attributes (in a graphics style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + if i = 3 or i = 4 then + warnlog "Hidden attributes (in a paragraph style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + if i = 5 then + warnlog "Hidden attributes (in a text style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + end if + next i + SAXSeekElement("/") + printlog " * * *" + '------------------------------------------------------------------------- + SAXRelease() + SAXReadFile(gOfficePath & ConvertPath("user\work\xml\draw\level1\alien\styles.xml")) + '------------------------------------------------------------------------- + printlog " -------------------" + printlog " s t y l e s . x m l" + printlog " -------------------" + printlog "-----------------" + printlog "Hidden Namespaces" + printlog "-----------------" + '/// <u><b>styles.xml</u></b> + '/// <u>Hidden attributes in namespaces</u> + '///+ Searching for: xmlns:alien="http://openoffice.org/2000/alien" + '------------------------------------------------------------------------- + AttributeSearch(1) = "xmlns:alien" + AttributeValue(1) = "http://openoffice.org/2000/alien" + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-styles") + printlog " +- " & AttributeSearch(1) + if SAXGetAttributeValue(AttributeSearch(1)) <> AttributeValue(1) then + warnlog "Hidden attributes (in namespace): " & AttributeSearch(1) & " is not " & AttributeValue(1) & "!" + end if + printlog " * * *" + SAXSeekElement("/") + printlog "----------------------------------------" + printlog "Hidden attributes in a master-page style" + printlog "----------------------------------------" + '------------------------------------------------------------------------- + '/// <u>hidden attributes</u> + '///+<ol><li><b>in a master-page style</b></li></ol> + '///+ Searching for: alien:key="master-page" + '------------------------------------------------------------------------- + AttributeSearch(1) = "alien:key" + AttributeValue(1) = "master-page" + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-styles") + SAXSeekElement("office:automatic-styles") + SAXSeekElement("style:style") + SAXSeekElement("style:properties") + printlog " +- " & AttributeSearch(1) + if SAXGetAttributeValue(AttributeSearch(1)) <> AttributeValue(1) then + warnlog "Hidden attributes (in master-page style): " & AttributeSearch(1) & " is not " & AttributeValue(1) & "!" + end if + printlog " * * *" + '------------------------------------------------------------------------- + SAXRelease() + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tchinese + printlog "+- Impress: chin.sxd" + '/// Opening chin.sxd which includes chinese characters. /// + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\ooo10\chin.sxd")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\chin.sxd") , "StarOffice XML (Draw)") then + '/// Saving it. /// + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\chin.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\chin\") ) + '/// Checking well formness of meta.xml, styles.xml and content.xml. /// + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\chin\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\chin\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\chin\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + '/// Opening the exported document again (GPF check). /// + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\chin.sxd") + sleep(2) + '/// Closing document. /// + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tjapan + printlog "+- Impress: japan.sxd" + '/// Opening japan.sxd which includes japanese characters. /// + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\ooo10\japan.sxd")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\japan.sxd") , "StarOffice XML (Draw)") then + '/// Saving it. /// + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\japan.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\japan\") ) + '/// Checking well formness of meta.xml, styles.xml and content.xml. /// + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\japan\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\japan\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\japan\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + '/// Opening the exported document again (GPF check). /// + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\japan.sxd") + sleep(2) + call hCloseDocument + '/// Closing document. /// + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tkorean + printlog "+- Impress: korean.sxd" + '/// Opening korean.sxd which includes korean characters. /// + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\ooo10\korean.sxd")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\korean.sxd") , "StarOffice XML (Draw)") then + '/// Saving it. /// + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\korean.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\korean\") ) + '/// Checking well formness of meta.xml, styles.xml and content.xml. /// + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\korean\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\korean\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\korean\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + '/// Opening the exported document again (GPF check). /// + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\korean.sxd") + sleep(2) + '/// Closing document. /// + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tradchinese + printlog "+- Impress: trad_chin.sxd" + '/// Opening trad_chin.sxd which includes traditional chinese characters. /// + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\ooo10\trad_chin.sxd")) + '/// Saving it. /// + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\trad_chin.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\trad_chin.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\trad_chin\") ) + '/// Checking well formness of meta.xml, styles.xml and content.xml. /// + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\trad_chin\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\trad_chin\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\trad_chin\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + '/// Opening the exported document again (GPF check). /// + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\trad_chin.sxd") + sleep(2) + '/// Closing document. /// + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18092 + printlog "+- Draw: 18092.sda" + + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18092.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18092.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18092.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18092\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18092\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18092\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18092\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18092.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18093 + printlog "+- Draw: 18093.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18093.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18093.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18093.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18093\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18093\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18093\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18093\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18093.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18094 + printlog "+- Draw: 18094.sda" + + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18094.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18094.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18094.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18094\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18094\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18094\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18094\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18094.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18098 + printlog "+- Draw: 18098.sda" + + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18098.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18098.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18098.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18098\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18098\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18098\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18098\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18098.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18099 + printlog "+- Draw: 18099.sda" + + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18099.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18099.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18099.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18099\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18099\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18099\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18099\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18099.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18100 + printlog "+- Draw: 18100.sda" + + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18100.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18100.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18100.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18100\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18100\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18100\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18100\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18100.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18101 + printlog "+- Draw: 18101.sda" + + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18101.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18101.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18101.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18101\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18101\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18101\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18101\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18101.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18102 + printlog "+- Draw: 18102.sda" + + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18102.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18102.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18102.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18102\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18102\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18102\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18102\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18102.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18106 + printlog "+- Draw: 18106.sda" + + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18106.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18106.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18106.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18106\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18106\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18106\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18106\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18106.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18107 + printlog "+- Draw: 18107.sda" + + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18107.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18107.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18107.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18107\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18107\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18107\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18107\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18107.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase + diff --git a/testautomation/xml/optional/includes/sxd7_02.inc b/testautomation/xml/optional/includes/sxd7_02.inc new file mode 100644 index 000000000000..b11787b3689e --- /dev/null +++ b/testautomation/xml/optional/includes/sxd7_02.inc @@ -0,0 +1,313 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : wolfram.garten@sun.com +'* +'* short description : XML Draw Include File +'* +'\*********************************************************************************** + Dim Isliste(250) as string + Dim OutputPath as string + +sub sxd7_02 + + printlog "------------------- sxd_02.inc ---------------------" + + Call ExitRestartTheOffice + call t18108_18115 + call t18116 + call t18117 + call t18118 + call t18119 + call t18120 + call t18121_18122 + call t18123 + call t18124 + call t18125 + +end sub +' +'------------------------------------------------------------------------- +' +testcase t18108_18115 + printlog "+- Draw: 18108-18115.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18108-18115.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18108-18115.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18108-18115.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18108-18115\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18108-18115\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18108-18115\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18108-18115\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18108-18115.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18116 + printlog "+- Draw: 18116.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18116.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18116.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18116.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18116\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18116\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18116\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18116\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18116.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18117 + printlog "+- Draw: 18117.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18117.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18117.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18117.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18117\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18117\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18117\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18117\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18117.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18118 + printlog "+- Draw: 18118.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18118.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18118.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18118.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18118\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18118\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18118\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18118\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18118.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18119 + printlog "+- Draw: 18119.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18119.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18119.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18119.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18119\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18119\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18119\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18119\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18119.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18120 + printlog "+- Draw: 18120.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18120.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18120.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18120.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18120\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18120\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18120\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18120\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18120.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18121_18122 + printlog "+- Draw: 18121-18122.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18121-18122.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18121-18122.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18121-18122.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18121-18122\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18121-18122\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18121-18122\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18121-18122\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18121-18122.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18123 + printlog "+- Draw: 18123.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18123.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18123.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18123.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18123\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18123\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18123\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18123\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18123.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18124 + printlog "+- Draw: 18124.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18124.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18124.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18124.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18124\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18124\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18124\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18124\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18124.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18125 + printlog "+- Draw: 18125.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18125.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18125.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18125.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18125\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18125\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18125\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18125\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18125.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase + diff --git a/testautomation/xml/optional/includes/sxd7_03.inc b/testautomation/xml/optional/includes/sxd7_03.inc new file mode 100644 index 000000000000..547d46eb9c0f --- /dev/null +++ b/testautomation/xml/optional/includes/sxd7_03.inc @@ -0,0 +1,313 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : wolfram.garten@sun.com +'* +'* short description : XML Draw Include File +'* +'\*********************************************************************************** + Dim Isliste(250) as string + Dim OutputPath as string + +sub sxd7_03 + + printlog "------------------- sxd_03.inc ---------------------" + + Call ExitRestartTheOffice + call t18126 + call t18127_18128 + call t18129 + call t18130_18131 + call t18132 + call t18133_18134 + call t18135 + call t18136 + call t18137 + call t18138 + +end sub +' +'------------------------------------------------------------------------- +' +testcase t18126 + printlog "+- Draw: 18126.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18126.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18126.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18126.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18126\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18126\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18126\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18126\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18126.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18127_18128 + printlog "+- Draw: 18127-18128.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18127-18128.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18127-18128.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18127-18128.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18127-18128\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18127-18128\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18127-18128\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18127-18128\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18127-18128.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18129 + printlog "+- Draw: 18129.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18129.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18129.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18129.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18129\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18129\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18129\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18129\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18129.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18130_18131 + printlog "+- Draw: 18130-18131.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18130-18131.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18130-18131.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18130-18131.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18130-18131\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18130-18131\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18130-18131\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18130-18131\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18130-18131.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18132 + printlog "+- Draw: 18132.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18132.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18132.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18132.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18132\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18132\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18132\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18132\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18132.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18133_18134 + printlog "+- Draw: 18133-18134.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18133-18134.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18133-18134.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18133-18134.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18133-18134\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18133-18134\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18133-18134\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18133-18134\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18133-18134.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18135 + printlog "+- Draw: 18135.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18135.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18135.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18135.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18135\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18135\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18135\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18135\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18135.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18136 + printlog "+- Draw: 18136.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18136.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18136.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18136.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18136\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18136\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18136\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18136\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18136.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18137 + printlog "+- Draw: 18137.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18137.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18137.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18137.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18137\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18137\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18137\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18137\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18137.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18138 + printlog "+- Draw: 18138.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18138.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18138.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18138.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18138\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18138\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18138\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18138\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18138.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase + diff --git a/testautomation/xml/optional/includes/sxd7_04.inc b/testautomation/xml/optional/includes/sxd7_04.inc new file mode 100644 index 000000000000..e878b111aeea --- /dev/null +++ b/testautomation/xml/optional/includes/sxd7_04.inc @@ -0,0 +1,315 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : wolfram.garten@sun.com +'* +'* short description : XML Draw Include File +'* +'\*********************************************************************************** + Dim Isliste(250) as string + Dim OutputPath as string + +sub sxd7_04 + + printlog "------------------- sxd_04.inc ---------------------" + + Call ExitRestartTheOffice + call t18139_18145 + call t18244 + call t18245 + call t18246_18250 + call t18464_18467 + call t18520_18524 + call t18526_18531 + call t18537_18544 + call t18629_18632 + call t18633 + +end sub + +'------------------------------------------------------------------------- + +testcase t18139_18145 + printlog "+- Draw: 18139-18145.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18139-18145.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18139-18145.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18139-18145.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18139-18145\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18139-18145\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18139-18145\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18139-18145\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18139-18145.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- + +testcase t18244 + printlog "+- Draw: 18244.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18244.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18244.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18244.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18244\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18244\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18244\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18244\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18244.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- + +testcase t18245 + printlog "+- Draw: 18245.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18245.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18245.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18245.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18245\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18245\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18245\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18245\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18245.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- + +testcase t18246_18250 + printlog "+- Draw: 18246-18250.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18246-18250.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18246-18250.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18246-18250.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18246-18250\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18246-18250\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18246-18250\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18246-18250\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18246-18250.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- + +testcase t18464_18467 + printlog "+- Draw: 18464-18467.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18464-18467.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18464-18467.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18464-18467.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18464-18467\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18464-18467\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18464-18467\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18464-18467\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18464-18467.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- + +testcase t18520_18524 + printlog "+- Draw: 18520-18524.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18520-18524.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18520-18524.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18520-18524.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18520-18524\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18520-18524\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18520-18524\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18520-18524\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18520-18524.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- + +testcase t18526_18531 + printlog "+- Draw: 18526-18531.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18526-18531.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18526-18531.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18526-18531.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18526-18531\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18526-18531\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18526-18531\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18526-18531\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18526-18531.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- + +testcase t18537_18544 + printlog "+- Draw: 18537-18544.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18537-18544.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18537-18544.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18537-18544.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18537-18544\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18537-18544\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18537-18544\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18537-18544\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18537-18544.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- + +testcase t18629_18632 + printlog "+- Draw: 18629-18632.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18629-18632.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18629-18632.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18629-18632.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18629-18632\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18629-18632\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18629-18632\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18629-18632\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18629-18632.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- + +testcase t18633 + printlog "+- Draw: 18633.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18633.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18633.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18633.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18633\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18633\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18633\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18633\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18633.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase + +'------------------------------------------------------------------------- + diff --git a/testautomation/xml/optional/includes/sxd7_05.inc b/testautomation/xml/optional/includes/sxd7_05.inc new file mode 100644 index 000000000000..331b3e2f0199 --- /dev/null +++ b/testautomation/xml/optional/includes/sxd7_05.inc @@ -0,0 +1,259 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : wolfram.garten@sun.com +'* +'* short description : XML Draw Include File +'* +'\*********************************************************************************** + Dim Isliste(250) as string + Dim OutputPath as string + +sub sxd7_05 + + printlog "------------------- sxd_05.inc ---------------------" + + Call ExitRestartTheOffice + call t18634 + call t18635 + call t18636 + call t19542_19544 + call t19545_19547 + call t19548_19553 + call t19554_19557 + call t19558_19560 + +end sub +' +'------------------------------------------------------------------------- +' +testcase t18634 + printlog "+- Draw: 18634.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18634.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18634.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18634.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18634\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18634\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18634\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18634\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18634.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18635 + printlog "+- Draw: 18635.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18635.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18635.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18635.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18635\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18635\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18635\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18635\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18635.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t18636 + printlog "+- Draw: 18636.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\18636.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\18636.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\18636.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\18636\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18636\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18636\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\18636\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\18636.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t19542_19544 + printlog "+- Draw: 19542-19544.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\19542-19544.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\19542-19544.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\19542-19544.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\19542-19544\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\19542-19544\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\19542-19544\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\19542-19544\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\19542-19544.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t19545_19547 + printlog "+- Draw: 19545-19547.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\19545-19547.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\19545-19547.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\19545-19547.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\19545-19547\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\19545-19547\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\19545-19547\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\19545-19547\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\19545-19547.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t19548_19553 + printlog "+- Draw: 19548-19553.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\19548-19553.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\19548-19553.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\19548-19553.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\19548-19553\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\19548-19553\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\19548-19553\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\19548-19553\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\19548-19553.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t19554_19557 + printlog "+- Draw: 19554-19557.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\19554-19557.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\19554-19557.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\19554-19557.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\19554-19557\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\19554-19557\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\19554-19557\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\19554-19557\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\19554-19557.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase t19558_19560 + printlog "+- Draw: 19558-19560.sda" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\19558-19560.sda")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\draw\level1\19558-19560.sxd") , "StarOffice XML (Draw)") then + call hCloseDocument + sleep(2) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\draw\level1\19558-19560.sxd") , gOfficePath & ConvertPath("user\work\xml\draw\level1\19558-19560\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\19558-19560\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\19558-19560\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\draw\level1\19558-19560\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\draw\level1\19558-19560.sxd") + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase + diff --git a/testautomation/xml/optional/includes/sxi7_01.inc b/testautomation/xml/optional/includes/sxi7_01.inc new file mode 100644 index 000000000000..fce06a8519e6 --- /dev/null +++ b/testautomation/xml/optional/includes/sxi7_01.inc @@ -0,0 +1,563 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : wolfram.garten@sun.com +'* +'* short description : XML Impress Include File +'* +'\*********************************************************************************** + Dim Isliste(250) as string + Dim OutputPath as string + +sub sxi7_01 + + printlog "------------------- sxi_01.inc ---------------------" + printlog "----------------------------------------------------" + call talien_attributes + printlog "---------------------- C J K -----------------------" + call tchinese + call tjapan + call tkorean + call tradchinese + printlog "----------------------------------------------------" + call tAutolayout + call tText + call tObjects + call tEffects_text_objects + call tEffects_slides + +end sub +' +'------------------------------------------------------------------------- +' +testcase talien_attributes + Dim i as integer + Dim AttrNameInDOM as string + Dim AttributeSearch(9) as string + Dim AttributeValue(9) as string + printlog "+- Impress: alien.sxi" + '/// Opening alien.sxi. /// + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\ooo10\alien.sxi")) + '/// Saving document. /// + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\impress\level1\alien.sxi") , "StarOffice XML (Impress)") then + '/// Closing document. /// + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\impress\level1\alien.sxi") , gOfficePath & ConvertPath("user\work\xml\impress\level1\alien\") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\alien\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\alien\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\alien\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + '/// Opening exported document (GPF check). /// + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\impress\level1\alien.sxi") + sleep(2) + '/// Closing document. /// + call hCloseDocument + sleep(2) + SAXReadFile(gOfficePath & ConvertPath("user\work\xml\impress\level1\alien\content.xml")) + printlog "-----------------" + printlog "Hidden Namespaces" + printlog "-----------------" + '/// <u><b>content.xml</u></b> + '/// <u>Hidden attributes in namespaces</u> + '///+ Searching for: xmlns:alien="http://openoffice.org/2000/alien" + '------------------------------------------------------------------------- + AttributeSearch(1) = "xmlns:alien" + AttributeValue(1) = "http://openoffice.org/2000/alien" + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-content") + printlog " +- " & AttributeSearch(1) + if SAXGetAttributeValue(AttributeSearch(1)) <> AttributeValue(1) then + warnlog "Hidden attributes (in namespace): " & AttributeSearch(1) & " is not " & AttributeValue(1) & "!" + end if + printlog " * * *" + SAXSeekElement("/") + '/// <u>hidden attributes</u> + '///+<ol><li><b>in a drawing-page style</b></li> + '///+<li><b>in a graphics style</b></li> + '///+<li><b>in a paragraph style (twice)</b></li> + '///+<li><b>in a text style</b></li></ol> + '///+ Searching for: alien:key="page" + '///+ Searching for: alien:key="shape" + '///+ Searching for: alien:key="para" + '///+ Searching for: alien:key="shape-text" + '///+ Searching for: alien:key="text" + AttributeSearch(1) = "alien:key" + AttributeValue(1) = "page" + + AttributeSearch(3) = "alien:key" + AttributeValue(3) = "shape" + + AttributeSearch(6) = "alien:key" + AttributeValue(6) = "para" + + AttributeSearch(7) = "alien:key" + AttributeValue(7) = "shape-text" + + AttributeSearch(9) = "alien:key" + AttributeValue(9) = "text" + '------------------------------------------------------------------------- + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + for i = 1 to 9 + if i = 1 then + printlog "-----------------------------------------" + printlog "Hidden attributes in a drawing-page style" + printlog "-----------------------------------------" + end if + if i = 3 then + printlog "-------------------------------------" + printlog "Hidden attributes in a graphics style" + printlog "-------------------------------------" + end if + if i = 6 or i = 7 then + printlog "-------------------------------------------" + printlog "Hidden attributes in a paragraph style (" & i-5 & ")" + printlog "-------------------------------------------" + end if + if i = 9 then + printlog "---------------------------------" + printlog "Hidden attributes in a text style" + printlog "---------------------------------" + end if + if i = 1 or i = 3 or i = 6 or i = 7 or i = 8 then + 'The hidden attributes are in a known sequence included, + 'so the same routine will be used for different styles! + SAXSeekElement("/") + SAXSeekElement("office:document-content") + SAXSeekElement("office:automatic-styles") + SAXSeekElement("style:style" , i ) + AttrNameInDOM = SAXGetAttributeValue("style:name") + printlog " + Style name (" & i & "): " & AttrNameInDOM + printlog " |" + SAXSeekElement("style:properties") + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + 'i = <nr> means <nr>'th style:style in DOM tree + if i = 1 then + warnlog "Hidden attributes (in a drawing-page style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + if i = 3 then + warnlog "Hidden attributes (in a graphics style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + if i = 5 or i = 6 then + warnlog "Hidden attributes (in a paragraph style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + if i = 8 then + warnlog "Hidden attributes (in a text style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + end if + end if + next i + SAXSeekElement("/") + printlog " * * *" + '------------------------------------------------------------------------- + SAXRelease() + SAXReadFile(gOfficePath & ConvertPath("user\work\xml\impress\level1\alien\styles.xml")) + '------------------------------------------------------------------------- + printlog " -------------------" + printlog " s t y l e s . x m l" + printlog " -------------------" + printlog "-----------------" + printlog "Hidden Namespaces" + printlog "-----------------" + '/// <u><b>styles.xml</u></b> + '/// <u>Hidden attributes in namespaces</u> + '///+ Searching for: xmlns:alien="http://openoffice.org/2000/alien" + '------------------------------------------------------------------------- + AttributeSearch(1) = "xmlns:alien" + AttributeValue(1) = "http://openoffice.org/2000/alien" + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-styles") + printlog " +- " & AttributeSearch(1) + if SAXGetAttributeValue(AttributeSearch(1)) <> AttributeValue(1) then + warnlog "Hidden attributes (in namespace): " & AttributeSearch(1) & " is not " & AttributeValue(1) & "!" + end if + printlog " * * *" + SAXSeekElement("/") + printlog "----------------------------------------" + printlog "Hidden attributes in a master-page style" + printlog "----------------------------------------" + '------------------------------------------------------------------------- + '/// <u>hidden attributes</u> + '///+<ol><li><b>in a master-page style</b></li></ol> + '///+ Searching for: alien:key="master-page" + '------------------------------------------------------------------------- + AttributeSearch(1) = "alien:key" + AttributeValue(1) = "master-page" + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-styles") + SAXSeekElement("office:automatic-styles") + SAXSeekElement("style:style") + SAXSeekElement("style:properties") + printlog " +- " & AttributeSearch(1) + if SAXGetAttributeValue(AttributeSearch(1)) <> AttributeValue(1) then + warnlog "Hidden attributes (in master-page style): " & AttributeSearch(1) & " is not " & AttributeValue(1) & "!" + end if + printlog " * * *" + '------------------------------------------------------------------------- + SAXRelease() + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tchinese + printlog "+- Impress: chin.sxi" + '/// Opening chin.sxi which includes chinese characters. /// + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\ooo10\chin.sxi")) + '/// Saving document. /// + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\impress\level1\chin.sxi") , "StarOffice XML (Impress)") then + '/// Closing document. /// + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\impress\level1\chin.sxi") , gOfficePath & ConvertPath("user\work\xml\impress\level1\chin\") ) + '/// Checking well formness of meta.xml, styles.xml and content.xml. /// + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\chin\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\chin\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\chin\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + '/// Opening the exported document again (GPF check). /// + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\impress\level1\chin.sxi") + sleep(2) + '/// Closing document. /// + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tjapan + printlog "+- Impress: japan.sxi" + '/// Opening japan.sxi which includes japanese characters. /// + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\ooo10\japan.sxi")) + '/// Saving document. /// + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\impress\level1\japan.sxi") , "StarOffice XML (Impress)") then + '/// Closing document. /// + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\impress\level1\japan.sxi") , gOfficePath & ConvertPath("user\work\xml\impress\level1\japan\") ) + '/// Checking well formness of meta.xml, styles.xml and content.xml. /// + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\japan\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\japan\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\japan\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + '/// Opening the exported document again (GPF check). /// + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\impress\level1\japan.sxi") + sleep(2) + '/// Closing document. /// + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tkorean + printlog "+- Impress: korean.sxi" + '/// Opening korean.sxi which includes korean characters. /// + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\ooo10\korean.sxi")) + '/// Saving document. /// + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\impress\level1\korean.sxi") , "StarOffice XML (Impress)") then + '/// Closing document. /// + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\impress\level1\korean.sxi") , gOfficePath & ConvertPath("user\work\xml\impress\level1\korean\") ) + '/// Checking well formness of meta.xml, styles.xml and content.xml. /// + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\korean\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\korean\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\korean\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + '/// Opening the exported document again (GPF check). /// + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\impress\level1\korean.sxi") + sleep(2) + '/// Closing document. /// + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tradchinese + printlog "+- Impress: trad_chin.sxi" + '/// Opening trad_chin.sxi which includes traditional chinese characters. /// + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\ooo10\trad_chin.sxi")) + '/// Saving document. /// + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\impress\level1\trad_chin.sxi") , "StarOffice XML (Impress)") then + '/// Closing document. /// + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\impress\level1\trad_chin.sxi") , gOfficePath & ConvertPath("user\work\xml\impress\level1\trad_chin\") ) + '/// Checking well formness of meta.xml, styles.xml and content.xml. /// + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\trad_chin\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\trad_chin\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\trad_chin\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + '/// Opening the exported document again (GPF check). /// + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\impress\level1\trad_chin.sxi") + sleep(2) + '/// Closing document. /// + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tAutolayout + Dim AttributeSearch(8) as string + Dim AttributeValue(8) as string + printlog "+- Impress: Autolayout.sdd" + '/// Opening Autolayout.sdd. /// + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\Autolayout.sdd")) + '/// Saving document. /// + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\impress\level1\Autolayout.sxi") , "StarOffice XML (Impress)") then + '/// Closing document. /// + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\impress\level1\Autolayout.sxi") , gOfficePath & ConvertPath("user\work\xml\impress\level1\Autolayout\") ) + '/// Checking well formness of meta.xml, styles.xml and content.xml. /// + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\Autolayout\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\Autolayout\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\Autolayout\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + '/// Opening the exported document again (GPF check). /// + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\impress\level1\Autolayout.sxi") + sleep(2) + '/// Closing document. /// + call hCloseDocument + sleep(2) + SAXReadFile(gOfficePath & ConvertPath("user\work\xml\impress\level1\Autolayout\content.xml")) + printlog "-----------------" + printlog "Slide names" + printlog "-----------------" + '/// <u><b>content.xml</u></b> + '/// <u>Slide names</u> + '///+ Searching for: draw:name="Title subtitle" + '------------------------------------------------------------------------- + AttributeSearch(1) = "draw:name" + AttributeValue(1) = "Title subtitle" + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-content") + SAXSeekElement("office:body") + SAXSeekElement(2) + printlog " +- " & AttributeSearch(1) & " = " & AttributeValue(1) + if SAXGetAttributeValue(AttributeSearch(1)) <> AttributeValue(1) then + warnlog "draw:name: " & AttributeSearch(1) & " is not " & AttributeValue(1) & "!" + end if + '------------------------------------------------------------------------- + SAXRelease() + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tText + printlog "+- Impress: Text.sdd" + QAErrorLog "#i38739# tText PERFORMANCE issue." + goto endsub + '/// Opening Text.sdd. /// + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\Text.sdd")) + '/// Saving document. /// + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\impress\level1\Text.sxi") , "StarOffice XML (Impress)") then + '/// Closing document. /// + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\impress\level1\Text.sxi") , gOfficePath & ConvertPath("user\work\xml\impress\level1\Text\") ) + '/// Checking well formness of meta.xml, styles.xml and content.xml. /// + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\Text\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\Text\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\Text\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + '/// Opening the exported document again (GPF check). /// + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\impress\level1\Text.sxi") + sleep(2) + '/// Closing document. /// + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tObjects + printlog "+- Impress: Objects.sdd" + '/// Opening Objects.sdd. /// + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\Objects.sdd")) + '/// Saving document. /// + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\impress\level1\Objects.sxi") , "StarOffice XML (Impress)") then + '/// Closing document. /// + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\impress\level1\Objects.sxi") , gOfficePath & ConvertPath("user\work\xml\impress\level1\Objects\") ) + '/// Checking well formness of meta.xml, styles.xml and content.xml. /// + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\Objects\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\Objects\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\Objects\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + '/// Opening the exported document again (GPF check). /// + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\impress\level1\Objects.sxi") + sleep(2) + '/// Closing document. /// + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tEffects_text_objects + printlog "+- Impress: Effects_text_objects.sdd" + '/// Opening Effects_text_objects.sdd. /// + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\Effects_text_objects.sdd")) + '/// Saving document. /// + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\impress\level1\Effects_text_objects.sxi") , "StarOffice XML (Impress)") then + '/// Closing document. /// + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\impress\level1\Effects_text_objects.sxi") , gOfficePath & ConvertPath("user\work\xml\impress\level1\Effects_text_objects\") ) + '/// Checking well formness of meta.xml, styles.xml and content.xml. /// + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\Effects_text_objects\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\Effects_text_objects\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\Effects_text_objects\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + '/// Opening the exported document again (GPF check). /// + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\impress\level1\Effects_text_objects.sxi") + sleep(2) + '/// Closing document. /// + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tEffects_slides + printlog "+- Impress: Effects_slides.sdd" + '/// Opening Effects_slides.sdd. /// + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\graphics\so_bin\Effects_slides.sdd")) + '/// Saving document. /// + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\impress\level1\Effects_slides.sxi") , "StarOffice XML (Impress)") then + '/// Closing document. /// + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\impress\level1\Effects_slides.sxi") , gOfficePath & ConvertPath("user\work\xml\impress\level1\Effects_slides\") ) + '/// Checking well formness of meta.xml, styles.xml and content.xml. /// + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\Effects_slides\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\Effects_slides\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\impress\level1\Effects_slides\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + '/// Opening the exported document again (GPF check). /// + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\impress\level1\Effects_slides.sxi") + sleep(2) + '/// Closing document. /// + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase + diff --git a/testautomation/xml/optional/includes/sxm7_01.inc b/testautomation/xml/optional/includes/sxm7_01.inc new file mode 100644 index 000000000000..68104eaadc72 --- /dev/null +++ b/testautomation/xml/optional/includes/sxm7_01.inc @@ -0,0 +1,818 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : thorsten.bosbach@sun.com +'* +'* short description : XML Math Include File +'* +'************************************************************************ +'* +' #1 tunary_binary 'Sample document from old office +' #1 trelations 'Sample document from old office +' #1 tset_operations 'Sample document from old office +' #1 tfunctions 'Sample document from old office +' #1 toperators 'Sample document from old office +' #1 tattributes 'Sample document from old office +' #1 tothers 'Sample document from old office +' #1 tbrackets 'Sample document from old office +' #1 tformats 'Sample document from old office +' #1 tall_commands 'Sample document from old office +' #1 tall_commands_star_math_3 'Sample document from old office +' #1 tall_selections 'Sample document from old office +' #1 tannuities 'Sample document from old office +' #1 tcauchy 'Sample document from old office +' #1 tchemicalelement 'Sample document from old office +' #1 tdefinitionstraightline 'Sample document from old office +' #1 teffectiveannualinterestrate 'Sample document from old office +' #1 thamiltonoperator 'Sample document from old office +' #1 tinvestmentreturns 'Sample document from old office +' #1 tlawoferrorpropagation 'Sample document from old office +' #1 tlimes 'Sample document from old office +' #1 tlinearregression 'Sample document from old office +' #1 tmaxwell 'Sample document from old office +' #1 tscalarproduct 'Sample document from old office +' #1 tsinus 'Sample document from old office +' #1 tsquareroot 'Sample document from old office +' #1 tstandarddeviation 'Sample document from old office +' #1 tvectorproduct 'Sample document from old office +'* +'\*********************************************************************** + +testcase tunary_binary + printlog "+- unary-binary.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\1_unary-binary.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\1_unary-binary.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\1_unary-binary.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\1_unary-binary") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\1_unary-binary\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\1_unary-binary\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\1_unary-binary\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\1_unary-binary.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase trelations + printlog "+- 2_relations.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\2_relations.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\2_relations.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\2_relations.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\2_relations") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\2_relations\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\2_relations\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\2_relations\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\2_relations.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tset_operations + printlog "+- 3_set_operations.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\3_set_operations.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\3_set_operations.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\3_set_operations.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\3_set_operations") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\3_set_operations\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\3_set_operations\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\1_unary-binary\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\3_set_operations.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tfunctions + printlog "+- 4_functions.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\4_functions.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\4_functions.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\4_functions.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\4_functions") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\4_functions\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\4_functions\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\4_functions\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\4_functions.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase toperators + printlog "+- 5_operators.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\5_operators.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\5_operators.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\5_operators.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\5_operators") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\5_operators\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\5_operators\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\5_operators\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\5_operators.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tattributes + printlog "+- 6_attributes.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\6_attributes.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\6_attributes.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\6_attributes.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\6_attributes") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\6_attributes\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\6_attributes\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\6_attributes\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\6_attributes.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tothers + printlog "+- 7_others.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\7_others.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\7_others.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\7_others.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\7_others") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\7_others\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\7_others\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\7_others\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\7_others.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tbrackets + printlog "+- 8_brackets.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\8_brackets.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\8_brackets.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\8_brackets.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\8_brackets") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\8_brackets\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\8_brackets\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\8_brackets\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\8_brackets.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tformats + printlog "+- 9_formats.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\9_formats.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\9_formats.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\9_formats.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\9_formats") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\9_formats\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\9_formats\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\9_formats\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\9_formats.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tall_commands + printlog "+- all_commands.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\all_commands.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\all_commands.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\all_commands.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\all_commands") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\all_commands\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\all_commands\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\all_commands\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\all_commands.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tall_commands_star_math_3 + printlog "+- all_commands_star_math_3.0.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\all_commands_star_math_3.0.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\all_commands_star_math_3.0.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\all_commands_star_math_3.0.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\all_commands_star_math_3.0") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\all_commands_star_math_3.0\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\all_commands_star_math_3.0\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\all_commands_star_math_3.0\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\all_commands_star_math_3.0.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tall_selections + printlog "+- all_selections.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\all_selections.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\all_selections.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\all_selections.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\all_selections") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\all_selections\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\all_selections\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\all_selections\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\all_selections.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tannuities + printlog "+- annuities.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\annuities.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\annuities.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\annuities.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\annuities") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\annuities\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\annuities\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\annuities\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\annuities.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tcauchy + printlog "+- cauchy.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\cauchy.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\cauchy.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\cauchy.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\cauchy") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\cauchy\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\cauchy\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\cauchy\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\cauchy.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tchemicalelement + printlog "+- chemicalelement.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\chemicalelement.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\chemicalelement.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\chemicalelement.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\chemicalelement") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\chemicalelement\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\chemicalelement\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\chemicalelement\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\chemicalelement.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tdefinitionstraightline + printlog "+- definitionstraightline.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\definitionstraightline.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\definitionstraightline.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\definitionstraightline.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\definitionstraightline") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\definitionstraightline\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\definitionstraightline\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\definitionstraightline\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\definitionstraightline.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase teffectiveannualinterestrate + printlog "+- effectiveannualinterestrate.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\effectiveannualinterestrate.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\effectiveannualinterestrate.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\effectiveannualinterestrate.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\effectiveannualinterestrate") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\effectiveannualinterestrate\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\effectiveannualinterestrate\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\effectiveannualinterestrate\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\effectiveannualinterestrate.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase thamiltonoperator + printlog "+- hamiltonoperator.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\hamiltonoperator.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\hamiltonoperator.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\hamiltonoperator.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\hamiltonoperator") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\hamiltonoperator\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\hamiltonoperator\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\hamiltonoperator\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\hamiltonoperator.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tinvestmentreturns + printlog "+- investmentreturns.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\investmentreturns.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\investmentreturns.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\investmentreturns.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\investmentreturns") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\investmentreturns\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\investmentreturns\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\investmentreturns\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\investmentreturns.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tlawoferrorpropagation + printlog "+- lawoferrorpropagation.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\lawoferrorpropagation.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\lawoferrorpropagation.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\lawoferrorpropagation.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\lawoferrorpropagation") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\lawoferrorpropagation\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\lawoferrorpropagation\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\lawoferrorpropagation\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\lawoferrorpropagation.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tlimes + printlog "+- limes.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\limes.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\limes.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\limes.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\limes") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\limes\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\limes\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\limes\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\limes.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tlinearregression + printlog "+- linearregression.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\linearregression.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\linearregression.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\linearregression.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\linearregression") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\linearregression\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\linearregression\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\linearregression\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\linearregression.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tmaxwell + printlog "+- maxwell.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\maxwell.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\maxwell.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\maxwell.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\maxwell") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\maxwell\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\maxwell\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\maxwell\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\maxwell.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tscalarproduct + printlog "+- scalarproduct.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\scalarproduct.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\scalarproduct.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\scalarproduct.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\scalarproduct") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\scalarproduct\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\scalarproduct\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\scalarproduct\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\scalarproduct.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tsinus + printlog "+- sinus.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\sinus.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\sinus.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\sinus.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\sinus") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\sinus\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\sinus\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\sinus\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\sinus.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tsquareroot + printlog "+- squareroot.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\squareroot.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\squareroot.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\squareroot.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\squareroot") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\squareroot\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\squareroot\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\squareroot\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\squareroot.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tstandarddeviation + printlog "+- standarddeviation.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\standarddeviation.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\standarddeviation.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\standarddeviation.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\standarddeviation") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\standarddeviation\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\standarddeviation\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\standarddeviation\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\standarddeviation.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tvectorproduct + printlog "+- vectorproduct.smf" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\math\so_binary\vectorproduct.smf")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\math\level1\vectorproduct.sxm") , "StarOffice XML (Math)") then + call hCloseDocument + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\math\level1\vectorproduct.sxm") , gOfficePath & ConvertPath("user\work\xml\math\level1\vectorproduct") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\vectorproduct\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\vectorproduct\settings.xml")) = FALSE then + warnlog "XML-file 'settings.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\math\level1\vectorproduct\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\math\level1\vectorproduct.sxm")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase + diff --git a/testautomation/xml/optional/includes/sxw7_01.inc b/testautomation/xml/optional/includes/sxw7_01.inc new file mode 100644 index 000000000000..3361f86af47c --- /dev/null +++ b/testautomation/xml/optional/includes/sxw7_01.inc @@ -0,0 +1,867 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : helge.delfs@sun.com +'* +'* short description : XML Writer Include File +'* +'\*********************************************************************************** + Dim Isliste(250) as string + Dim OutputPath as string + +sub sxw7_01 + + printlog "-------------------------- SXW7_01.INC ------------------------------" + + printlog "------------------------ Alien Attributes ---------------------------" + call tfiscus + call tfiscus2 + + printlog "---------------------- File Format Changes --------------------------" + call tfeat476 + call tfeat1318 + + printlog "---------------------------------------------------------------------" + call tcharacters + +end sub +' +'------------------------------------------------------------------------- +' +testcase tfiscus + Dim i as integer + Dim a as integer + Dim xXMLStyleName as string + Dim xPath as string + Dim AttributeSearch(50) as string + Dim AttributeValue(50) as string + Dim iStylesToCount as integer + Dim sStyleStyleValueA as string + + printlog "+- fiscus.sxw" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\fiscus.sxw")) + '/// Saving (and if already exiting overwriting) the document. + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus.sxw")) + sleep(2) + call hCloseDocument + sleep(2) + SAXReadFile(gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus\content.xml")) + printlog " ---------------------" + printlog " c o n t e n t . x m l" + printlog " ---------------------" + + printlog "-----------------" + printlog "Hidden Namespaces" + printlog "-----------------" + '/// <u><b>content.xml</u></b> + '/// <u>Hidden Namespaces</u> + '///+ Searching for: xmlns:foo="http://www.foo.com" + '///+ Searching for: xmlns:bar="http://www.bar.com" /// + '------------------------------------------------------------------------- + AttributeSearch(1) = "xmlns:foo" + AttributeValue(1) = "http://www.foo.com" + + AttributeSearch(2) = "xmlns:bar" + AttributeValue(2) = "http://www.bar.com" + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-content") + for i = 1 to 2 + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + warnlog "Hidden attributes (in namespace): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + next i + SAXSeekElement("/") + printlog " * * *" + '/// <u>hidden attributes <b>in a table style</b></u> + '///+ Searching for: attr1="42" + '///+ Searching for: foo:attr2="43" + '///+ Searching for: bar:attr3="44" /// + '/// <u>hidden attributes <b>in a table cell style</b></u> + '///+ Searching for: attr1="42" + '///+ Searching for: foo:attr2="43" + '///+ Searching for: bar:attr3="44" /// + '/// <u>hidden attributes <b>in a paragraph style</b></u> + '///+ Searching for: attr1="42" + '///+ Searching for: foo:attr2="43" + '///+ Searching for: bar:attr3="44" /// + '/// <u>hidden attributes <b>in a text style</b></u> + '///+ Searching for: attr1="42" + '///+ Searching for: foo:attr2="43" + '///+ Searching for: bar:attr3="44" /// + '/// <u>hidden attributes <b>in a frame style</b></u> + '///+ Searching for: attr1="42" + '///+ Searching for: foo:attr2="43" + '///+ Searching for: bar:attr3="44" /// + '------------------------------------------------------------------------- + AttributeSearch(1) = "attr1" + AttributeValue(1) = "42" + + AttributeSearch(2) = "foo:attr2" + AttributeValue(2) = "43" + + AttributeSearch(3) = "bar:attr3" + AttributeValue(3) = "44" + '------------------------------------------------------------------------- + for a = 1 to 8 + if a = 1 then + printlog "----------------------------------" + printlog "Hidden attributes in a table style" + printlog "----------------------------------" + end if + if a = 4 then + printlog "---------------------------------------" + printlog "Hidden attributes in a table cell style" + printlog "---------------------------------------" + end if + if a = 6 then + printlog "--------------------------------------" + printlog "Hidden attributes in a paragraph style" + printlog "--------------------------------------" + end if + if a = 7 then + printlog "---------------------------------" + printlog "Hidden attributes in a text style" + printlog "---------------------------------" + end if + if a = 8 then + printlog "----------------------------------" + printlog "Hidden attributes in a frame style" + printlog "----------------------------------" + end if + if a = 1 or a = 4 or a = 6 or a = 7 or a = 8 then + SAXSeekElement("office:document-content") + SAXSeekElement("office:automatic-styles") + SAXSeekElement("style:style" , a) + SAXSeekElement("style:properties") + printlog "++ Feature(s) to be searched for:" + printlog " |" + for i = 1 to 3 + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + if a = 1 then + warnlog "Hidden attributes (in a table style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + if a = 4 then + warnlog "Hidden attributes (in a table cell style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + if a = 6 then + warnlog "Hidden attributes (in a paragraph style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + if a = 7 then + warnlog "#i74125# - Alien attributes get lost in text style properties." + ' warnlog "Hidden attributes (in a text style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + if a = 8 then + warnlog "Hidden attributes (in a frame style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + end if + next i + printlog " * * *" + end if + SAXSeekElement("/") + next a + SAXRelease() + SAXReadFile(gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus\styles.xml")) + '------------------------------------------------------------------------- + printlog " -------------------" + printlog " s t y l e s . x m l" + printlog " -------------------" + printlog "-----------------" + printlog "Hidden Namespaces" + printlog "-----------------" + '/// <u><b>STYLES.XML</u></b> + '/// <u>Hidden Namespace</u> + '///+ Searching for: xmlns:foo="http://www.foo.com" + '///+ Searching for: xmlns:bar="http://www.bar.com" /// + '------------------------------------------------------------------------- + AttributeSearch(1) = "xmlns:foo" + AttributeValue(1) = "http://www.foo.com" + + AttributeSearch(2) = "xmlns:bar" + AttributeValue(2) = "http://www.bar.com" + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-styles") + for i = 1 to 2 + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + warnlog "Hidden attributes (in namespace): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + next i + SAXSeekElement("/") + '------------------------------------------------------------------------- + printlog " * * *" + printlog "-----------------------------------------------" + printlog "Hidden attributes in TEMPLATE STYLE 'Text body'" + printlog "-----------------------------------------------" + '/// <u>hidden attributes <b>in the template style ´Text body´</b></u> + '///+ Searching for: attr1="42" + '///+ Searching for: foo:attr2="43" + '///+ Searching for: bar:attr3="44" /// + '------------------------------------------------------------------------- + AttributeSearch(1) = "attr1" + AttributeValue(1) = "42" + + AttributeSearch(2) = "foo:attr2" + AttributeValue(2) = "43" + + AttributeSearch(3) = "bar:attr3" + AttributeValue(3) = "44" + + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-styles") + SAXSeekElement("office:styles") + ' There are 7 style:style elements; it is important to get + ' the 'Text body' titled one because it is the onliest which + ' has one additional 'style:properties' element. + ' Executing SAXSeekElement without having an additional + ' element interrupts the test run! + for iStylesToCount = 1 to 7 + SAXSeekElement("style:style", iStylesToCount) + sStyleStyleValueA = SAXGetAttributeValue("style:name") + if sStyleStyleValueA = "Text body" then + exit for + else + SAXSeekElement(0) + end if + next iStylesToCount + ' Go into the style:propries element in 'Text body' named style:style element. + ' There the three hidden attributes should be stored. + SAXSeekElement("style:properties") + for i = 1 to 3 + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + warnlog "Hidden attributes (in a template style): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + next i + '------------------------------------------------------------------------- + printlog " * * *" + SAXRelease() + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tfiscus2 + Dim i as integer + Dim xXMLStyleName as string + Dim AttributeSearch(50) as string + Dim AttributeValue(50) as string + printlog "+- fiscus2.sxw" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\fiscus2.sxw")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus2.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus2.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus2") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus2\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus2\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus2\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus2.sxw")) + sleep(2) + call hCloseDocument + sleep(2) + SAXReadFile(gOfficePath & ConvertPath("user\work\xml\writer\level1\fiscus2\content.xml")) + printlog " ---------------------" + printlog " c o n t e n t . x m l" + printlog " ---------------------" + + printlog "-----------------" + printlog "Hidden Namespaces" + printlog "-----------------" + '/// <u><b>content.xml</u></b> + '/// <u>Hidden Namespaces</u> + '///+ Searching for: xmlns:foo="http://www.foo.com" + '///+ Searching for: xmlns:bar="http://www.bar.com" /// + '------------------------------------------------------------------------- + AttributeSearch(1) = "xmlns:foo" + AttributeValue(1) = "http://www.foo.com" + + AttributeSearch(2) = "xmlns:bar" + AttributeValue(2) = "http://www.bar.com" + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-content") + for i = 1 to 2 + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + warnlog "Hidden attributes (in namespace): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + next i + SAXSeekElement("/") + printlog " * * *" + printlog "--------------------------------------------------------------------------" + printlog "Hidden attributes in text style but a 'span'-item over the whole paragraph" + printlog "--------------------------------------------------------------------------" + '/// <u>hidden attributes <b>in a text style</b></u> + '///+ where a 'span'-item exists in a whole paragraph. + '///+ Searching for: attr1="42" + '///+ Searching for: foo:attr2="43" + '///+ Searching for: bar:attr3="44" /// + '------------------------------------------------------------------------- + AttributeSearch(1) = "attr1" + AttributeValue(1) = "42" + + AttributeSearch(2) = "foo:attr2" + AttributeValue(2) = "43" + + AttributeSearch(3) = "bar:attr3" + AttributeValue(3) = "44" + + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-content") + SAXSeekElement("office:automatic-styles") + SAXSeekElement("style:style" , 9) + SAXSeekElement("style:properties") + for i = 1 to 3 + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + warnlog "Hidden attributes (in a text style with a 'span'-item over the whole paragraph): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + next i + printlog " * * *" + SAXRelease() + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tfeat476 + Dim i as integer + Dim a as integer + Dim xXMLStyleName as string + Dim xPath as string + Dim AttributeSearch(50) as string + Dim AttributeValue(50) as string + printlog "+- feat476.sxw" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\feat476.sxw")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat476.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\feat476.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\feat476") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat476\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat476\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat476\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat476.sxw")) + sleep(2) + call hCloseDocument + sleep(2) + SAXReadFile(gOfficePath & ConvertPath("user\work\xml\writer\level1\feat476\content.xml")) + printlog " ---------------------" + printlog " c o n t e n t . x m l" + printlog " ---------------------" + + printlog "-----------------" + printlog "Vertical Relation" + printlog "-----------------" + '/// <u><b>content.xml</u></b> + '/// <u>Vertical Relation</u> + '///+ <blockquote>The <i>style:vertical-rel</i> attribute has a new value "text". + '///+ It is used by frames (i.e. images, text-boxes, etc.) that + '///+ are bound as characters to specify a vertical alignment + '///+ relative to the text height of the line that contains the + '///+ frame. + '///+ Before this change, the value "char" was used for this + '///+ purpose. This lead to an ambiguity, because the same value + '///+ is used with a different meaning for frames bound at a character.</blockquote> + '/// Searching for: style:vertical-rel="text" + + '------------------------------------------------------------------------- + AttributeSearch(1) = "style:vertical-rel" + AttributeValue(1) = "text" + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-content") + SAXSeekElement("office:automatic-styles") + SAXSeekElement("style:style") + SAXSeekElement("style:properties") + for i = 1 to 1 + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + warnlog "Vertical Relation (XML file format change 476): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + next i + SAXSeekElement("/") + printlog " * * *" + SAXRelease() + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tfeat1318 + Dim i as integer + Dim a as integer + Dim xXMLStyleName as string + Dim xPath as string + Dim AttributeSearch(50) as string + Dim AttributeValue(50) as string + printlog "+- feat1318.sxw" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\feat1318.sxw")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat1318.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\feat1318.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\feat1318") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat1318\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat1318\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat1318\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\feat1318.sxw")) + sleep(2) + call hCloseDocument + sleep(2) + SAXReadFile(gOfficePath & ConvertPath("user\work\xml\writer\level1\feat1318\content.xml")) + printlog " ---------------------" + printlog " c o n t e n t . x m l" + printlog " ---------------------" + + printlog "-----------------" + printlog "Vertical Position" + printlog "-----------------" + '/// <u><b>content.xml</u></b> + '/// <u>Vertical Position</u> + '///+ <blockquote>The <i>style:vertical-pos</i> attribute that can be attached to the + '///+ <i><style:properties></i> element of graphic styles has got the new + '///+ value "below". It can be used for frames that are bound to a + '///+ character only and means that the frame is displayed right + '///+ below the anchor character. + '///+ The meaning of any other value of the <i>style:vertical-pos</i> + '///+ attribute is unchanged. There also was no other way to set + '///+ the vertical position of a frame to "below the anchor + '///+ character".</blockquote> + '/// Searching for: style:vertical-pos="below" + + '------------------------------------------------------------------------- + AttributeSearch(1) = "style:vertical-pos" + AttributeValue(1) = "below" + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + SAXSeekElement("office:document-content") + SAXSeekElement("office:automatic-styles") + SAXSeekElement("style:style") + SAXSeekElement("style:properties") + for i = 1 to 1 + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + warnlog "Vertical Relation (XML file format change 1318): " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + next i + SAXSeekElement("/") + printlog " * * *" + SAXRelease() + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tcharacters + Dim a as integer + Dim b as integer + Dim c as integer + Dim g as integer + Dim i as integer + Dim xXMLStyleName as string + Dim xPath as string + Dim AttributeSearch(50) as string + Dim AttributeValue(50) as string + printlog "+- characters.sdw" + '/// Opening the characters.sdw file from the input directory. + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\characters.sdw")) + '/// Saving the document in OOo XML 1.0 file format. + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\characters.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + '/// Unpack the complete file (ZIP archieve) into a seperate directory. + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\characters.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\characters") ) + '/// Verifying the wellformness of content.xml, styles.xml and meta.xml. + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\characters\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\characters\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\characters\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + '/// Opening the exported document (GPF-check). + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\characters.sxw")) + sleep(2) + '/// Closing the document. + call hCloseDocument + sleep(2) + SAXReadFile(gOfficePath & ConvertPath("user\work\xml\writer\level1\characters\content.xml")) + printlog " ---------------------" + printlog " c o n t e n t . x m l" + printlog " ---------------------" + + printlog "----------" + printlog "Paragraphs" + printlog "----------" + '------------------------------------------------------------------------- + '/// <u><b>CONTENT.XML</u></b> + '/// <u>Paragraph Style P2</u> + SAXSeekElement("office:document-content") + SAXSeekElement("office:body") + SAXSeekElement("text:p" , 15) + xXMLStyleName = SAXGetAttributeValue("text:style-name") + printlog "text:style-name: " & xXMLStyleName + '///+ Searching for: style:text-position="super 90%" + '///+ Searching for: style:text-blinking="true" /// + AttributeSearch(1) = "style:text-position" + AttributeValue(1) = "super 90%" + + AttributeSearch(2) = "style:text-blinking" + AttributeValue(2) = "true" + printlog "++ Feature(s) to be searched for:" + printlog " |" + SAXSeekElement("/") + SAXSeekElement("office:document-content") + SAXSeekElement("office:automatic-styles") + a = SAXGetChildCount + for c = 1 to a + SAXSeekElement(c) + if SAXGetAttributeValue("style:name") = xXMLStyleName then + SAXSeekElement("style:properties") + for i = 1 to 2 + printlog " +- " & AttributeSearch(i) + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + warnlog "Paragraph style: " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + end if + next i + c=a + end if + SAXSeekElement(0) + next c + SAXSeekElement("/") + printlog " * * *" + '------------------------------------------------------------------------- + printlog "----------" + printlog "Textstyles" + printlog "----------" + printlog "++ Feature(s) to be searched for:" + printlog " |" + SAXSeekElement("office:document-content") + SAXSeekElement("office:body") + SAXSeekElement("text:p", 12) + SAXSeekElement("text:span") + xXMLStyleName = SAXGetAttributeValue("text:style-name") + printlog "text:style-name: " & xXMLStyleName + '/// <u>Text Style T8</u> + '///+ Searching for: style:text-outline="true" + '///+ Searching for: style:text-crossing-out="single-line" + '///+ Searching for: fo:font-size="22pt" + '///+ Searching for: fo:text-shadow="1pt 1pt" + '///+ Searching for: style:text-underline="single" + '///+ Searching for: style:text-underline-color="font-color" /// + AttributeSearch(1) = "style:text-outline" + AttributeValue(1) = "true" + + AttributeSearch(2) = "style:text-crossing-out" + AttributeValue(2) = "single-line" + + AttributeSearch(3) = "fo:font-size" + AttributeValue(3) = "22pt" + + AttributeSearch(4) = "fo:text-shadow" + AttributeValue(4) = "1pt 1pt" + + AttributeSearch(5) = "style:text-underline" + AttributeValue(5) = "single" + + AttributeSearch(6) = "style:text-underline-color" + AttributeValue(6) = "font-color" + + SAXSeekElement("/") + SAXSeekElement("office:document-content") + SAXSeekElement("office:automatic-styles") + a = SAXGetChildCount + for c = 1 to a + SAXSeekElement(c) + if SAXGetAttributeValue("style:name") = xXMLStyleName then + SAXSeekElement("style:properties") + for g = 1 to 6 + printlog " +- " & AttributeSearch(g) + if SAXGetAttributeValue(AttributeSearch(g)) <> AttributeValue(g) then + warnlog "Textstyle: " & AttributeSearch(g) & " is not " & AttributeValue(g) & "!" + end if + next g + c=a + end if + SAXSeekElement(0) + next c + printlog " * * *" + SAXSeekElement("/") + '------------------------------------------------------------------------- + printlog "++ Feature(s) to be searched for:" + printlog " |" + for g = 1 to 3 + SAXSeekElement("office:document-content") + SAXSeekElement("office:body") + SAXSeekElement("text:p" , 8) + SAXSeekElement(g) + xXMLStyleName = SAXGetAttributeValue("text:style-name") + printlog "text:style-name: " & xXMLStyleName + '/// <u>Text Style T5</u> + '///+ Searching for: fo:font-style="italic" /// + '/// <u>Text Style T6</u> + '///+ Searching for: fo:font-weight="bold" /// + '/// <u>Text Style T7</u> + '///+ Searching for: style:text-underline="single" + '///+ Searching for: style:text-underline-color="font-color" /// + + AttributeSearch(1) = "fo:font-style" + AttributeValue(1) = "italic" + + AttributeSearch(2) = "fo:font-weight" + AttributeValue(2) = "bold" + + AttributeSearch(3) = "style:text-underline" + AttributeValue(3) = "single" + + AttributeSearch(4) = "style:text-underline-color" + AttributeValue(4) = "font-color" + + SAXSeekElement("/") + SAXSeekElement("office:document-content") + SAXSeekElement("office:automatic-styles") + a = SAXGetChildCount + for c = 1 to a + SAXSeekElement(c) + if SAXGetAttributeValue("style:name") = xXMLStyleName then + SAXSeekElement("style:properties") + if g = 3 then + for i = 1 to 2 + printlog " +- " & AttributeSearch(i+2) + if SAXGetAttributeValue(AttributeSearch(i+2)) <> AttributeValue(i+2) then + warnlog "Textstyle: " & AttributeSearch(i+2) & " is not " & AttributeValue(i+2) & "!" + end if + next i + else + printlog " +- " & AttributeSearch(g) + if SAXGetAttributeValue(AttributeSearch(g)) <> AttributeValue(g) then + warnlog "Textstyle: " & AttributeSearch(g) & " is not " & AttributeValue(g) & "!" + end if + end if + c=a + end if + SAXSeekElement(0) + next c + SAXSeekElement("/") + next g + printlog " * * *" + SAXSeekElement("/") + '------------------------------------------------------------------------- + printlog "++ Feature(s) to be searched for:" + printlog " |" + SAXSeekElement("office:document-content") + SAXSeekElement("office:body") + SAXSeekElement("text:p", 19) + xXMLStyleName = SAXGetAttributeValue("text:style-name") + printlog "paragraph:style-name: " & xXMLStyleName + '/// <u>Paragraph Style P3</u> + '///+ Searching in language 01 for : fo:letter-spacing="0.06cm" + '///+ Searching in other language for: fo:letter-spacing=" + '///+ Searching for: style:letter-kerning="true" + '------------------------------------------------------------------------- + AttributeSearch(1) = "style:letter-kerning" + AttributeValue(1) = "true" + + AttributeSearch(2) = "fo:letter-spacing" + AttributeValue(2) = "0.106cm" + + SAXSeekElement("/") + SAXSeekElement("office:document-content") + SAXSeekElement("office:automatic-styles") + + a = SAXGetChildCount + for c = 1 to a + SAXSeekElement(c) + if SAXGetAttributeValue("style:name") = xXMLStyleName then + SAXSeekElement("style:properties") + if gLanguage = 1 then + b = 2 + else + b = 1 + end if + for g = 1 to b + printlog " +- " & AttributeSearch(g) + if SAXGetAttributeValue(AttributeSearch(g)) <> AttributeValue(g) then + warnlog "Textstyle: " & AttributeSearch(g) & " is not " & AttributeValue(g) & "!" + end if + next g + c=a + end if + SAXSeekElement(0) + next c + '------------------------------------------------------------------------- + printlog " * * *" + SAXSeekElement("/") + '------------------------------------------------------------------------- + printlog "++ Feature(s) to be searched for:" + printlog " |" + for g = 1 to 2 + SAXSeekElement("office:document-content") + SAXSeekElement("office:body") + SAXSeekElement("text:p", 26) + SAXSeekElement(g) + xXMLStyleName = SAXGetAttributeValue("text:style-name") + printlog "text:style-name: " & xXMLStyleName + '/// <u>Text Style T10</u> + '///+ Searching for: style:text-background-color="#00dcff" /// + '/// <u>Text Style T11</u> + '///+ Searching for: style:text-background-color="#ffcc99" /// + '------------------------------------------------------------------------- + AttributeSearch(1) = "style:text-background-color" + AttributeValue(1) = "#00dcff" + + AttributeSearch(2) = "style:text-background-color" + AttributeValue(2) = "#ffcc99" + + SAXSeekElement("/") + SAXSeekElement("office:document-content") + SAXSeekElement("office:automatic-styles") + + a = SAXGetChildCount + for c = 1 to a + SAXSeekElement(c) + if SAXGetAttributeValue("style:name") = xXMLStyleName then + SAXSeekElement("style:properties") + printlog " +- " & AttributeSearch(g) + if SAXGetAttributeValue(AttributeSearch(g)) <> AttributeValue(g) then + warnlog "Textstyle: " & AttributeSearch(g) & " is not " & AttributeValue(g) & "!" + end if + c=a + end if + SAXSeekElement(0) + next c + SAXSeekElement("/") + next g + '------------------------------------------------------------------------- + printlog "---------" + printlog "O t h e r" + printlog "---------" + '/// <u>Other (Link)</u> + '///+ Searching for: <text:a xlink:type="simple" xlink:href="http://www.hyperlink.de/" office:target-frame-name="_blank" xlink:show="new">Hyperlink</text:a> /// + printlog " * * *" + SAXSeekElement("/") + '------------------------------------------------------------------------- + printlog "++ Feature(s) to be searched for:" + printlog " |" + SAXSeekElement("office:document-content") + SAXSeekElement("office:body") + SAXSeekElement("text:p", 29) + SAXSeekElement("text:a") + xXMLStyleName = SAXGetAttributeValue("text:style-name") + printlog "text:style-name: " & xXMLStyleName + + AttributeSearch(1) = "xlink:type" + AttributeValue(1) = "simple" + + AttributeSearch(2) = "xlink:href" + AttributeValue(2) = "http://www.hyperlink.de/" + + AttributeSearch(3) = "office:target-frame-name" + AttributeValue(3) = "_blank" + + AttributeSearch(4) = "xlink:show" + AttributeValue(4) = "new" + + for i = 1 to 4 + if SAXGetAttributeValue(AttributeSearch(i)) <> AttributeValue(i) then + if i = 3 then + warnlog "#i80480# Hyperlink attribute office:target-frame-name gets lost sometimes." + elseif i = 4 then + warnlog "#i80480# Hyperlink attribute xlink:show gets lost sometimes." + else + warnlog "Other: " & AttributeSearch(i) & " is not " & AttributeValue(i) & "!" + endif + end if + next i + end if + SAXRelease() + else + call hCloseDocument + end if +endcase + diff --git a/testautomation/xml/optional/includes/sxw7_01a.inc b/testautomation/xml/optional/includes/sxw7_01a.inc new file mode 100644 index 000000000000..2c3dcdedde1a --- /dev/null +++ b/testautomation/xml/optional/includes/sxw7_01a.inc @@ -0,0 +1,451 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : helge.delfs@sun.com +'* +'* short description : XML Writer Include File +'* +'\*********************************************************************************** + Dim Isliste(250) as string + Dim OutputPath as string + +sub sxw7_01a + + printlog "-------------------------- SXW7_01a.INC ------------------------------" + + printlog "---------------------------------------------------------------------" + call tfields + call tfootnotes + +end sub + +'------------------------------------------------------------------------- + +testcase tfields + Dim a as integer + Dim i as integer + Dim AttributeSearch(60) as string + Dim AttributeValue(60) as string + Dim sXMLNodename(50) as string + Dim sPathToAttributes as string + + printlog "+- fields.sdw" + '/// Opening file fields.sdw from input-directory. + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\fields.sdw")) + '/// Saving the document in OOo XML 1.0 format. + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\fields.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + '/// Unpack the complete content of the file (ZIP-archieve) into a seperate directory. + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\fields.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\fields") ) + '/// Checking the well formness of content.xml, styles.xml and meta.xml. + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fields\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fields\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\fields\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + '/// Opening the exported file (GPF check). + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\fields.sxw")) + sleep(2) + '/// Closing the document. + call hCloseDocument + sleep(2) + SAXReadFile(gOfficePath & ConvertPath("user\work\xml\writer\level1\fields\content.xml")) + printlog " ---------------------" + printlog " c o n t e n t . x m l" + printlog " ---------------------" + printlog "----------" + printlog " fields " + printlog "----------" + '------------------------------------------------------------------------- + '/// <u><b>CONTENT.XML</u></b> + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + '/// Searching for: <text:sender-firstname text:fixed="false"> + '/// Searching for: <text:sender-lastname text:fixed="false"> + sXMLNodename(1) = "text:sender-firstname" + sXMLNodename(2) = "text:sender-lastname" + AttributeSearch(1) = "text:fixed" + AttributeValue(1) = "false" + '/// Searching for: <text:date text:date-value="2000-11-30T16:14:56" + '/// Searching for: <text:time text:time-value="[not null]" + sXMLNodename(3) = "text:date" + AttributeSearch(3) = "text:date-value" + AttributeValue(3) = "2000-11-30T16:14:56" + sXMLNodename(4) = "text:time" + AttributeSearch(4) = "text:time-value" + AttributeValue(4) = "" + '/// Searching for: <text:word-count style:num-format="1">75</text:word-count> + '/// Searching for: <text:character-count style:num-format="1">788</text:character-count> + sXMLNodename(5) = "text:word-count" + 'TODO: JSI: Rotine needed for char XML node + 'CharNode = 75 + sXMLNodename(6) = "text:character-count" + 'TODO: JSI: Rotine needed for char XML node + 'CharNode = 788 + AttributeSearch(5) = "style:num-format" + AttributeValue(5) = "1" + '/// Searching for: <text:reference-mark-start text:name="ref"/>I am a reference<text:reference-mark-end text:name="ref"/> + sXMLNodename(7) = "text:reference-mark-start" + sXMLNodename(8) = "text:reference-mark-end" + AttributeSearch(7) = "text:name" + AttributeValue(7) = "ref" + '/// Searching for: <text:reference-ref text:reference-format="page" text:ref-name="ref">1</text:reference-ref> Chapter: <text:reference-ref text:reference-format="chapter" text:ref-name="ref">1</text:reference-ref> Location: <text:reference-ref text:reference-format="direction" text:ref-name="ref">above</text:reference-ref> + sXMLNodename(9) = "text:reference-ref" + 'TODO: JSI: Rotine needed for char XML node + 'CharNode: 1 [9] + 'CharNode: 1 [10] + 'CharNode: above [11] + AttributeSearch(9) = "text:reference-format" + AttributeValue(9) = "page" + AttributeValue(10) = "chapter" + AttributeValue(11) = "direction" + 'All three have this attribute and -value: + AttributeSearch(12) = "text:ref-name" + AttributeValue(12) = "ref" + '/// Searching for: <text:variable-set text:name="x" text:value-type="float" text:value="1" style:data-style-name="N0">1</text:variable-set> + sXMLNodename(13) = "text:variable-set" + AttributeSearch(13) = "text:name" + AttributeValue(13) = "x" + AttributeSearch(14) = "text:value-type" + AttributeValue(14) = "float" + AttributeSearch(15) = "text:value" + AttributeValue(15) = "1" + AttributeSearch(16) = "style:data-style-name" + AttributeValue(16) = "N0" + 'TODO: JSI: Rotine needed for char XML node + 'CharNode: 1 + '/// Searching for: <text:user-field-get text:name="I_am_a_user_field">Content of the user field</text:user-field-get> + sXMLNodename(17) = "text:user-field-get" + AttributeSearch(17) = "text:name" + AttributeValue(17) = "I_am_a_user_field" + 'TODO: JSI: Rotine needed for char XML node + 'CharNode: Content of the user field + '/// Searching for: <text:conditional-text text:condition="x==1" text:string-value-if-true="x = 1" text:string-value-if-false="x &lt;&gt; 1">x = 1</text:conditional-text> + sXMLNodename(18) = "text:conditional-text" + AttributeSearch(18) = "text:condition" + AttributeValue(18) = "x==1" + AttributeSearch(19) = "text:string-value-if-true" + AttributeValue(19) = "x = 1" + AttributeSearch(20) = "text:string-value-if-false" + AttributeValue(20) = "x <> 1" + 'TODO: JSI: Rotine needed for char XML node + 'CharNode: x = 1 + '/// Searching for: <text:hidden-text text:condition="x==1" text:string-value="x is not equal to 1"/> + sXMLNodename(21) = "text:hidden-text" + AttributeSearch(21) = "text:condition" + AttributeValue(21) = "x==1" + AttributeSearch(22) = "text:string-value" + AttributeValue(22) = "x is not equal to 1" + '/// Searching for: <text:hidden-paragraph text:condition="x==1" text:is-hidden="true"/>I am hidden if x=1</text:p> + sXMLNodename(23) = "text:hidden-paragraph" + AttributeSearch(23) = "text:condition" + AttributeValue(23) = "x==1" + AttributeSearch(24) = "text:is-hidden" + AttributeValue(24) = "true" + 'TODO: JSI: Rotine needed for char XML node + 'CharNode: I am hidden if x=1 + '/// Searching for: <text:creation-date style:data-style-name="N36">15/11/2000</text:creation-date> + sXMLNodename(25) = "text:creation-date" + AttributeSearch(25) = "style:data-style-name" + AttributeValue(25) = "N108" + '/// Searching for: '<text:editing-cycles>0</text:editing-cycles> + 'sXMLNodename(?) = text:editing-cycles + 'TODO: JSI: Rotine needed for char XML node + 'CharNode: 0 + '/// Searching for: <text:modification-date style:data-style-name="N81">6. mars 2003</text:modification-date> + sXMLNodename(26) = "text:modification-date" + AttributeSearch(26) = "style:data-style-name" + AttributeValue(26) = "N76" + 'TODO: JSI: Rotine needed for char XML node + 'CharNode: 6. mars 2003 + '/// Searching for: <text:database-display text:database-name="Bibliography" text:table-name="biblio" text:table-type="table" text:column-name="Author">&lt;Author&gt;</text:database-display> + sXMLNodename(27) = "text:database-display" + AttributeSearch(27) = "text:database-name" + AttributeValue(27) = "Bibliography" + AttributeSearch(28) = "text:table-name" + AttributeValue(28) = "biblio" + AttributeSearch(29) = "text:table-type" + AttributeValue(29) = "table" + AttributeSearch(30) = "text:column-name" + AttributeValue(30) = "Author" + 'TODO: JSI: Rotine needed for char XML node + 'CharNode: <Author> + '/// Searching for: <text:database-next text:database-name="Bibliography" text:table-name="biblio" text:table-type="table" text:condition="TRUE"/> + sXMLNodename(31) = "text:database-next" + AttributeSearch(31) = "text:database-name" + AttributeValue(31) = "Bibliography" + AttributeSearch(32) = "text:table-name" + AttributeValue(32) = "biblio" + AttributeSearch(33) = "text:table-type" + AttributeValue(33) = "table" + AttributeSearch(34) = "text:condition" + AttributeValue(34) = "TRUE" + '/// Searching for: <text:database-display text:database-name="Bibliography" text:table-name="biblio" text:table-type="table" text:column-name="Author">&lt;Author&gt;</text:database-display> + sXMLNodename(35) = "text:database-display" + AttributeSearch(35) = "text:database-name" + AttributeValue(35) = "Bibliography" + AttributeSearch(36) = "text:table-name" + AttributeValue(36) = "biblio" + AttributeSearch(37) = "text:table-type" + AttributeValue(37) = "table" + AttributeSearch(38) = "text:column-name" + AttributeValue(38) = "Author" + 'TODO: JSI: Rotine needed for char XML node + 'CharNode: <Author> + '/// Searching for: <text:database-row-number text:database-name="Bibliography" text:table-name="biblio" text:table-type="table" style:num-format="1" text:value="3">3</text:database-row-number> + sXMLNodename(39) = "text:database-row-number" + AttributeSearch(39) = "text:database-name" + AttributeValue(39) = "Bibliography" + AttributeSearch(40) = "text:table-name" + AttributeValue(40) = "biblio" + AttributeSearch(41) = "text:table-type" + AttributeValue(41) = "table" + AttributeSearch(42) = "style:num-format" + AttributeValue(42) = "1" + AttributeSearch(43) = "text:value" + AttributeValue(43) = "3" + 'TODO: JSI: Rotine needed for char XML node + 'CharNode: 3 + '/// Searching for: <text:database-name text:database-name="Bibliography" text:table-name="biblio" text:table-type="table">Bibliography.biblio</text:database-name> + sXMLNodename(44) = "text:database-name" + AttributeSearch(44) = "text:database-name" + AttributeValue(44) = "Bibliography" + AttributeSearch(45) = "text:table-name" + AttributeValue(45) = "biblio" + AttributeSearch(46) = "text:table-type" + AttributeValue(46) = "table" + 'TODO: JSI: Rotine needed for char XML node + 'CharNode: Bibliography.biblio + for a = 1 to 46 + select case a + case 1 , 2 : + ' Two nodes have the same attributes and -values as the first one + sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(a)) + SAXSeekElement(sPathToAttributes) + printlog " +- [Element: " & sXMLNodename(a) & "] Attribute: " & AttributeSearch(1) + if SAXGetAttributeValue(AttributeSearch(1)) <> AttributeValue(1) then + warnlog "Field: " & AttributeSearch(1) & " is not " & AttributeValue(1) & "!" + end if + SAXSeekElement("/") + case 5 , 6 : + ' Two nodes have the same attributes and -values as the first one + sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(a)) + SAXSeekElement(sPathToAttributes) + printlog " +- [Element: " & sXMLNodename(a) & "] Attribute: " & AttributeSearch(5) + if SAXGetAttributeValue(AttributeSearch(5)) <> AttributeValue(5) then + warnlog "Field: " & AttributeSearch(5) & " is not " & AttributeValue(5) & "!" + end if + SAXSeekElement("/") + case 7 , 8 : ' Two nodes have the same attributes and -values as the first one + sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(a)) + SAXSeekElement(sPathToAttributes) + printlog " +- [Element: " & sXMLNodename(a) & "] Attribute: " & AttributeSearch(7) + if SAXGetAttributeValue(AttributeSearch(7)) <> AttributeValue(7) then + warnlog "Field: " & AttributeSearch(7) & " is not " & AttributeValue(7) & "!" + end if + SAXSeekElement("/") + case 3, 4 : + ' The attribute is language dependent and should NOT be NULL + ' The if-then-else inquiry is another than in the other inquiries! + sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(a)) + SAXSeekElement(sPathToAttributes) + printlog " +- [Element: " & sXMLNodename(a) & "] Attribute: " & AttributeSearch(a) + if SAXGetAttributeValue(AttributeSearch(a)) = AttributeValue(a) then + warnlog "Field: " & AttributeSearch(a) & " is null empty!" + end if + SAXSeekElement("/") + case 9 , 10, 11: + ' Three times the same element name but not the same XML node + sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(9) , a-8) + SAXSeekElement(sPathToAttributes) + printlog " +- [Element: " & sXMLNodename(9) & "] Attribute: " & AttributeSearch(9) & "=" & AttributeValue(a) + if SAXGetAttributeValue(AttributeSearch(9)) <> AttributeValue(a) then + warnlog "Field: " & AttributeSearch(9) & " is not " & AttributeValue(a) & "!" + end if + SAXSeekElement("/") + case 12: + for i = 1 to 3 + sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(9) , i) + SAXSeekElement(sPathToAttributes) + printlog " +- [Element: " & sXMLNodename(9) & " (" & i & ")] Attribute: " & AttributeSearch(12) & "=" & AttributeValue(12) + if SAXGetAttributeValue(AttributeSearch(12)) <> AttributeValue(12) then + warnlog "Field: " & AttributeSearch(12) & " is not " & AttributeValue(12) & "!" + end if + SAXSeekElement("/") + next i + case 21, 22 : + ' One node has two attributes + sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(21)) + SAXSeekElement(sPathToAttributes) + printlog " +- [Element: " & sXMLNodename(21) & "]" & AttributeSearch(a) + if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then + warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!" + end if + SAXSeekElement("/") + case 23, 24 : + ' One node has two attributes + sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(23)) + SAXSeekElement(sPathToAttributes) + printlog " +- [Element: " & sXMLNodename(23) & "]" & AttributeSearch(a) + if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then + warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!" + end if + SAXSeekElement("/") + case 18, 19, 20 : + ' One node has three attributes + sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(18)) + SAXSeekElement(sPathToAttributes) + printlog " +- [Element: " & sXMLNodename(18) & "]" & AttributeSearch(a) + if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then + warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!" + end if + SAXSeekElement("/") + case 44, 45, 46 : + ' One node has three attributes + sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(44)) + SAXSeekElement(sPathToAttributes) + printlog " +- [Element: " & sXMLNodename(44) & "]" & AttributeSearch(a) + if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then + warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!" + end if + SAXSeekElement("/") + case 13, 14, 15, 16 : + ' One node has four attributes + sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(13)) + SAXSeekElement(sPathToAttributes) + printlog " +- [Element: " & sXMLNodename(13) & "]" & AttributeSearch(a) + if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then + warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!" + end if + SAXSeekElement("/") + case 27, 28, 29, 30 : + ' One node has four attributes + sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(27)) + SAXSeekElement(sPathToAttributes) + printlog " +- [Element: " & sXMLNodename(27) & "]" & AttributeSearch(a) + if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then + warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!" + end if + SAXSeekElement("/") + case 31, 32, 33, 34 : + ' One node has four attributes + sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(31)) + SAXSeekElement(sPathToAttributes) + printlog " +- [Element: " & sXMLNodename(31) & "]" & AttributeSearch(a) + if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then + warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!" + end if + SAXSeekElement("/") + case 35, 36, 37, 38 : + ' One node has four attributes + sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(35)) + SAXSeekElement(sPathToAttributes) + printlog " +- [Element: " & sXMLNodename(35) & "]" & AttributeSearch(a) + if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then + warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!" + end if + SAXSeekElement("/") + case 39, 40, 41, 42, 43 : + ' One node has five attributes + sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(39)) + SAXSeekElement(sPathToAttributes) + printlog " +- [Element: " & sXMLNodename(39) & "]" & AttributeSearch(a) + if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then + warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!" + end if + SAXSeekElement("/") + case 25, 26 : + 'skipping (evaluating different style names under different operating systems + SAXSeekElement("/") + case else : + sPathToAttributes = fWhereIsXMLElementInBody("office:document-content" , "office:body" , sXMLNodename(a)) + SAXSeekElement(sPathToAttributes) + printlog " +- [Element: " & sXMLNodename(a) & "]" & AttributeSearch(a) + if SAXGetAttributeValue(AttributeSearch(a)) <> AttributeValue(a) then + warnlog "Field: " & AttributeSearch(a) & " is not " & AttributeValue(a) & "!" + end if + SAXSeekElement("/") + end select + printlog " |" + next a + SAXRelease() + printlog " * * *" + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tfootnotes + Dim a as integer + Dim i as integer + Dim AttributeSearch(60) as string + Dim AttributeValue(60) as string + Dim sXMLNodename(50) as string + Dim sPathToAttributes as string + + printlog "+- footnotes.sdw" + '/// Opening file footnotes.sdw from input-directory. + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\footnotes.sdw")) + '/// Saving the document in OOo XML 1.0 format. + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\footnotes.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + '/// Unpack the complete content of the file (ZIP-archieve) into a seperate directory. + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\footnotes.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\footnotes") ) + '/// Checking the well formness of content.xml, styles.xml and meta.xml. + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\footnotes\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\footnotes\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\footnotes\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + '/// Opening the exported file (GPF check). + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\footnotes.sxw")) + sleep(2) + '/// Closing the document. + call hCloseDocument + end if + else + call hCloseDocument + end if +endcase + + diff --git a/testautomation/xml/optional/includes/sxw7_02.inc b/testautomation/xml/optional/includes/sxw7_02.inc new file mode 100644 index 000000000000..c433b5cdcd36 --- /dev/null +++ b/testautomation/xml/optional/includes/sxw7_02.inc @@ -0,0 +1,688 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : helge.delfs@sun.com +'* +'* short description : XML Writer Include File +'* +'\*********************************************************************************** + Dim Isliste(250) as string + Dim OutputPath as string + +sub sxw7_02 + + printlog "-------------------------- SXW7_02.INC ------------------------------" + call tframes + call hEnablePrettyPrinting(1) + printlog "--------------------------- C J K ------------------------------" + call tschina + call ttchina + call tkorean + call tjapan + +end sub +' +'------------------------------------------------------------------------- +' +testcase tframes + 'NOTE: This test has been created as there were no SAX parser available for using + ' in testtools. It is very (!) time consuming to debug this routines. + ' Feel free to contact me if there is any issue with this script! jsi@openoffice.org + Dim Searchstring(20) as string + Dim StyleBodyA as string + Dim StyleDefinitionA as string + Dim i as integer + Dim a as integer + Dim AdditionalParameter as string + '/// Disabling the 'pretty printing' functionality. + call hEnablePrettyPrinting() + printlog "+- frames.sdw" + '/// Opening frames.sdw from input directory. + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\frames.sdw")) + '/// Saving document as OOo XML 1.0 file. + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + '/// Unpacking the file (ZIP archieve) into a seperate directory. + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\frames.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\frames") ) + '/// Verifying well-formness of content.xml, styles.xml and meta.xml. + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames.sxw")) + sleep(2) + call hCloseDocument + sleep(2) + printlog "-------------------------------------------------------------------------" + Searchstring(1) = "<draw:text-box draw:style-name=" & CHR$(34) + Searchstring(2) = "draw:name=" & CHR$(34) + Searchstring(3) = "text:anchor-type=" & CHR$(34) & "page" & CHR$(34) + Searchstring(4) = "text:anchor-page-number=" & CHR$(34) & "1" & CHR$(34) + Searchstring(5) = "svg:x=" & CHR$(34) + Searchstring(6) = "svg:y=" & CHR$(34) + Searchstring(7) = "svg:width=" & CHR$(34) + Searchstring(8) = "fo:min-height=" & CHR$(34) + Searchstring(9) = "draw:z-index=" & CHR$(34) + printlog "++ Feature(s) to be searched for:" + printlog " |" + '------------------------------------------------------------------------- + printlog " ..searching in 'draw:text-box' number 1" + AdditionalParameter = GetLineInXMLBody(gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box" , 1) + For i = 1 to 9 + printlog " +- " & Searchstring(i) + if InStr (AdditionalParameter , Searchstring(i)) = 0 then + warnlog "Draw Text Box (Frame): " & Searchstring(i) & " not found!" + end if + Next i + printlog "-------------------------------------------------------------------------" + Searchstring(1) = ">Anchor to page<" + printlog " +- " & Searchstring(1) + AdditionalParameter = GetLineInXMLBody(gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "text:p" , 1) + printlog " +- " & Searchstring(1) + if InStr (AdditionalParameter , Searchstring(1)) = 0 then + warnlog "Draw Text Box (Frame) Content: " & Searchstring(1) & " not found!" + end if + printlog "-------------------------------------------------------------------------" + Searchstring(1) = "<draw:text-box" + Searchstring(2) = "draw:style-name=" & CHR$(34) + Searchstring(3) = "draw:name=" & CHR$(34) + Searchstring(4) = "text:anchor-type=" & CHR$(34) & "page" & CHR$(34) + Searchstring(5) = "text:anchor-page-number=" & CHR$(34) & "1" & CHR$(34) + Searchstring(6) = "svg:x=" & CHR$(34) + Searchstring(7) = "svg:y=" & CHR$(34) + Searchstring(8) = "svg:width=" & CHR$(34) + Searchstring(9) = "fo:min-height=" & CHR$(34) + Searchstring(10) = "draw:z-index=" & CHR$(34) + For a = 1 to 5 + printlog " ..searching in 'draw:text-box' number " & a + AdditionalParameter = GetLineInXMLBody(gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box" , a) + For i = 1 to 10 + printlog " +- " & Searchstring(i) + if InStr (AdditionalParameter , Searchstring(i)) = 0 then + warnlog "Draw Text Box (Frame): " & Searchstring(i) & " not found!" + end if + Next i + Next a + printlog "-------------------------------------------------------------------------" + Searchstring(1) = ">No wrap<" + printlog " +- " & Searchstring(1) + AdditionalParameter = GetLineInXMLBody(gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "text:p" , 2) + printlog " +- " & Searchstring(1) + if InStr (AdditionalParameter , Searchstring(1)) = 0 then + warnlog "Draw Text Box (Frame) Content: " & Searchstring(1) & " not found!" + end if + printlog "-------------------------------------------------------------------------" + Searchstring(1) = ">Page wrap<" + printlog " +- " & Searchstring(1) + '------------------------------------------------------------------------- + AdditionalParameter = GetLineInXMLBody(gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "text:p" , 3) + printlog " +- " & Searchstring(1) + if InStr (AdditionalParameter , Searchstring(1)) = 0 then + warnlog "Draw Text Box (Frame) Content: " & Searchstring(1) & " not found!" + end if + printlog "-------------------------------------------------------------------------" + Searchstring(1) = ">Optimal<" + printlog " +- " & Searchstring(1) + AdditionalParameter = GetLineInXMLBody(gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "text:p" , 4) + printlog " +- " & Searchstring(1) + if InStr (AdditionalParameter , Searchstring(1)) = 0 then + warnlog "Draw Text Box (Frame) Content: " & Searchstring(1) & " not found!" + end if + printlog "-------------------------------------------------------------------------" + Searchstring(1) = ">Wrap<" + printlog " +- " & Searchstring(1) + AdditionalParameter = GetLineInXMLBody(gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "text:p" , 5) + printlog " +- " & Searchstring(1) + if InStr (AdditionalParameter , Searchstring(1)) = 0 then + warnlog "Draw Text Box (Frame) Content: " & Searchstring(1) & " not found!" + end if + printlog "-------------------------------------------------------------------------" + Searchstring(1) = ">Background<" + printlog " +- " & Searchstring(1) + AdditionalParameter = GetLineInXMLBody(gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "text:p" , 6) + printlog " +- " & Searchstring(1) + if InStr (AdditionalParameter , Searchstring(1)) = 0 then + warnlog "Draw Text Box (Frame) Content: " & Searchstring(1) & " not found!" + end if + printlog "-------------------------------------------------------------------------" + Searchstring(1) = "<draw:text-box" + Searchstring(2) = "draw:style-name=" & CHR$(34) + Searchstring(3) = "draw:name=" & CHR$(34) + Searchstring(4) = "text:anchor-type=" & CHR$(34) & "paragraph" & CHR$(34) + Searchstring(5) = "svg:x=" & CHR$(34) + Searchstring(6) = "svg:y=" & CHR$(34) + Searchstring(7) = "svg:width=" & CHR$(34) + Searchstring(8) = "fo:min-height=" & CHR$(34) + Searchstring(9) = "draw:z-index=" & CHR$(34) + AdditionalParameter = GetLineInXMLBody(gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box" , 7) + For i = 1 to 9 + printlog " +- " & Searchstring(i) + if InStr (AdditionalParameter , Searchstring(i)) = 0 then + warnlog "Draw Text Box (Frame): " & Searchstring(i) & " not found!" + end if + Next i + printlog "-------------------------------------------------------------------------" + Searchstring(1) = "draw:style-name=" & CHR$(34) + Searchstring(2) = "draw:name=" & CHR$(34) + Searchstring(3) = "text:anchor-type=" & CHR$(34) & "char" & CHR$(34) + Searchstring(4) = "svg:y=" & CHR$(34) + Searchstring(5) = "svg:width=" & CHR$(34) + Searchstring(6) = "fo:min-height=" & CHR$(34) + For a = 1 to 2 + printlog " ..searching in 'draw:text-box' number " & a+7 + AdditionalParameter = GetLineInXMLBody(gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box" , a+7) + if a = 2 then + Searchstring(3) = "text:anchor-type=" & CHR$(34) & "as-char" & CHR$(34) + end if + For i = 1 to 6 + printlog " +- " & Searchstring(i) + if InStr (AdditionalParameter , Searchstring(i)) = 0 then + warnlog "Draw Text Box (Frame): " & Searchstring(i) & " not found!" + end if + Next i + Next a + printlog "-------------------------------------------------------------------------" + Searchstring(1) = "<draw:text-box" + Searchstring(2) = "draw:style-name=" & CHR$(34) + Searchstring(3) = "draw:name=" & CHR$(34) + Searchstring(4) = "text:anchor-type=" & CHR$(34) & "paragraph" & CHR$(34) + Searchstring(5) = "svg:x=" & CHR$(34) + Searchstring(6) = "svg:y=" & CHR$(34) + Searchstring(7) = "svg:width=" & CHR$(34) + Searchstring(8) = "fo:min-height=" & CHR$(34) + AdditionalParameter = GetLineInXMLBody(gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box" , 10) + For i = 1 to 8 + printlog " +- " & Searchstring(i) + if InStr (AdditionalParameter , Searchstring(i)) = 0 then + warnlog "Draw Text Box (Frame): " & Searchstring(i) & " not found!" + end if + Next i + printlog "-------------------------------------------------------------------------" + Searchstring(1) = "<draw:text-box" + Searchstring(2) = "draw:style-name=" & CHR$(34) + Searchstring(3) = "draw:name=" & CHR$(34) + Searchstring(4) = "text:anchor-type=" & CHR$(34) & "paragraph" & CHR$(34) + Searchstring(5) = "svg:x=" & CHR$(34) + Searchstring(6) = "svg:y=" & CHR$(34) + Searchstring(7) = "svg:width=" & CHR$(34) + Searchstring(8) = "fo:min-height=" & CHR$(34) + Searchstring(9) = "draw:z-index=" & CHR$(34) + AdditionalParameter = GetLineInXMLBody(gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box" , 11) + For i = 1 to 9 + printlog " +- " & Searchstring(i) + if InStr (AdditionalParameter , Searchstring(i)) = 0 then + warnlog "Draw Text Box (Frame): " & Searchstring(i) & " not found!" + end if + Next i + printlog "-------------------------------------------------------------------------" + Searchstring(1) = "<draw:text-box" + Searchstring(2) = "draw:style-name=" & CHR$(34) + Searchstring(3) = "draw:name=" & CHR$(34) + Searchstring(4) = "text:anchor-type=" & CHR$(34) & "paragraph" & CHR$(34) + Searchstring(5) = "svg:x=" & CHR$(34) + Searchstring(6) = "svg:y=" & CHR$(34) + Searchstring(7) = "svg:width=" & CHR$(34) + Searchstring(8) = "fo:min-height=" & CHR$(34) + Searchstring(9) = "draw:z-index=" & CHR$(34) + AdditionalParameter = GetLineInXMLBody(gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box" , 12) + For i = 1 to 9 + printlog " +- " & Searchstring(i) + if InStr (AdditionalParameter , Searchstring(i)) = 0 then + warnlog "Draw Text Box (Frame): " & Searchstring(i) & " not found!" + end if + Next i + printlog "-------------------------------------------------------------------------" + Searchstring(1) = "<draw:text-box" + Searchstring(2) = "draw:style-name=" & CHR$(34) + Searchstring(3) = "draw:name=" & CHR$(34) + Searchstring(4) = "text:anchor-type=" & CHR$(34) & "paragraph" & CHR$(34) + Searchstring(5) = "svg:x=" & CHR$(34) + Searchstring(6) = "svg:y=" & CHR$(34) + Searchstring(7) = "svg:width=" & CHR$(34) + Searchstring(8) = "fo:min-height=" & CHR$(34) + Searchstring(9) = "draw:z-index=" & CHR$(34) + AdditionalParameter = GetLineInXMLBody(gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box" , 13) + For i = 1 to 9 + printlog " +- " & Searchstring(i) + if InStr (AdditionalParameter , Searchstring(i)) = 0 then + warnlog "Draw Text Box (Frame): " & Searchstring(i) & " not found!" + end if + Next i + printlog "-------------------------------------------------------------------------" + ' ----------------------- + ' Frame S T Y L E S + ' ----------------------- + '------------------------------------------------------------------------- + Searchstring(1) = "style:family=" & CHR$(34) & "graphics" & CHR$(34) + Searchstring(2) = "style:parent-style-name=" & CHR$(34) + Searchstring(3) = "style:wrap=" & CHR$(34) & "parallel" & CHR$(34) + Searchstring(4) = "style:number-wrapped-paragraphs=" & CHR$(34) & "no-limit" & CHR$(34) + Searchstring(5) = "style:vertical-pos=" & CHR$(34) & "from-top" & CHR$(34) + Searchstring(6) = "style:vertical-rel=" & CHR$(34) & "page" & CHR$(34) + Searchstring(7) = "style:horizontal-pos=" & CHR$(34) & "from-left" & CHR$(34) + Searchstring(8) = "style:horizontal-rel=" & CHR$(34) & "paragraph" & CHR$(34) + StyleBodyA = GetBodiesItemStyleName (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box" , 1) + printlog " fr1 = " & StyleBodyA + printlog " ==========" + StyleDefinitionA = GetXMLValueLineExtra ((gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml")), "office:document-content", "office:automatic-styles;style:style" , "style:name" , StyleBodyA) + For i = 1 to 8 + printlog " +- " & Searchstring(i) + if InStr (StyleDefinitionA , Searchstring(i)) = 0 then + warnlog "Frame Style: " & Searchstring(i) & " not found!" + end if + Next i + Searchstring(1) = "style:family=" & CHR$(34) & "graphics" & CHR$(34) + Searchstring(2) = "style:parent-style-name=" & CHR$(34) + Searchstring(3) = "style:run-through=" & CHR$(34) & "foreground" & CHR$(34) + Searchstring(4) = "style:wrap=" & CHR$(34) & "none" & CHR$(34) + Searchstring(5) = "style:vertical-pos=" & CHR$(34) & "from-top" & CHR$(34) + Searchstring(6) = "style:vertical-rel=" & CHR$(34) & "page" & CHR$(34) + Searchstring(7) = "style:horizontal-pos=" & CHR$(34) & "from-left" & CHR$(34) + Searchstring(8) = "style:horizontal-rel=" & CHR$(34) & "paragraph" & CHR$(34) + StyleBodyA = GetBodiesItemStyleName (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box" , 2) + printlog " fr2 = " & StyleBodyA + printlog " ==========" + StyleDefinitionA = GetXMLValueLineExtra ((gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml")), "office:document-content", "office:automatic-styles;style:style" , "style:name" , StyleBodyA) + For i = 1 to 8 + printlog " +- " & Searchstring(i) + if InStr (StyleDefinitionA , Searchstring(i)) = 0 then + warnlog "Frame Style: " & Searchstring(i) & " not found!" + end if + Next i + Searchstring(1) = "style:family=" & CHR$(34) & "graphics" & CHR$(34) + Searchstring(2) = "style:parent-style-name=" & CHR$(34) + Searchstring(3) = "style:wrap=" & CHR$(34) & "parallel" & CHR$(34) + Searchstring(4) = "style:run-through=" & CHR$(34) & "foreground" & CHR$(34) + Searchstring(5) = "style:number-wrapped-paragraphs=" & CHR$(34) & "no-limit" & CHR$(34) + Searchstring(6) = "style:vertical-pos=" & CHR$(34) & "from-top" & CHR$(34) + Searchstring(7) = "style:vertical-rel=" & CHR$(34) & "page" & CHR$(34) + Searchstring(8) = "style:horizontal-pos=" & CHR$(34) & "from-left" & CHR$(34) + Searchstring(9) = "style:horizontal-rel=" & CHR$(34) & "paragraph" & CHR$(34) + StyleBodyA = GetBodiesItemStyleName (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box" , 3) + printlog " fr3 = " & StyleBodyA + printlog " ==========" + StyleDefinitionA = GetXMLValueLineExtra ((gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml")), "office:document-content", "office:automatic-styles;style:style" , "style:name" , StyleBodyA) + For i = 1 to 9 + printlog " +- " & Searchstring(i) + if InStr (StyleDefinitionA , Searchstring(i)) = 0 then + warnlog "Frame Style: " & Searchstring(i) & " not found!" + end if + Next i + Searchstring(1) = "style:family=" & CHR$(34) & "graphics" & CHR$(34) + Searchstring(2) = "style:parent-style-name=" & CHR$(34) + Searchstring(3) = "style:wrap=" & CHR$(34) & "dynamic" & CHR$(34) + Searchstring(4) = "style:run-through=" & CHR$(34) & "foreground" & CHR$(34) + Searchstring(5) = "style:number-wrapped-paragraphs=" & CHR$(34) & "no-limit" & CHR$(34) + Searchstring(6) = "style:vertical-pos=" & CHR$(34) & "from-top" & CHR$(34) + Searchstring(7) = "style:vertical-rel=" & CHR$(34) & "page" & CHR$(34) + Searchstring(8) = "style:horizontal-pos=" & CHR$(34) & "from-left" & CHR$(34) + Searchstring(9) = "style:horizontal-rel=" & CHR$(34) & "paragraph" & CHR$(34) + StyleBodyA = GetBodiesItemStyleName (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box" , 4) + printlog " fr4 = " & StyleBodyA + printlog " ==========" + StyleDefinitionA = GetXMLValueLineExtra ((gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml")), "office:document-content", "office:automatic-styles;style:style" , "style:name" , StyleBodyA) + For i = 1 to 9 + printlog " +- " & Searchstring(i) + if InStr (StyleDefinitionA , Searchstring(i)) = 0 then + warnlog "Frame Style: " & Searchstring(i) & " not found!" + end if + Next i + Searchstring(1) = "style:family=" & CHR$(34) & "graphics" & CHR$(34) + Searchstring(2) = "style:parent-style-name=" & CHR$(34) + Searchstring(3) = "style:wrap=" & CHR$(34) & "run-through" & CHR$(34) + Searchstring(4) = "style:run-through=" & CHR$(34) & "foreground" & CHR$(34) + Searchstring(5) = "style:vertical-pos=" & CHR$(34) & "from-top" & CHR$(34) + Searchstring(6) = "style:vertical-rel=" & CHR$(34) & "page" & CHR$(34) + Searchstring(7) = "style:horizontal-pos=" & CHR$(34) & "from-left" & CHR$(34) + Searchstring(8) = "style:horizontal-rel=" & CHR$(34) & "page" & CHR$(34) + StyleBodyA = GetBodiesItemStyleName (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box" , 5) + printlog " fr5 = " & StyleBodyA + printlog " ==========" + StyleDefinitionA = GetXMLValueLineExtra ((gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml")), "office:document-content", "office:automatic-styles;style:style" , "style:name" , StyleBodyA) + For i = 1 to 8 + printlog " +- " & Searchstring(i) + if InStr (StyleDefinitionA , Searchstring(i)) = 0 then + warnlog "Frame Style: " & Searchstring(i) & " not found!" + end if + Next i + Searchstring(1) = "style:family=" & CHR$(34) & "graphics" & CHR$(34) + Searchstring(2) = "style:parent-style-name=" & CHR$(34) + Searchstring(3) = "style:wrap=" & CHR$(34) & "run-through" & CHR$(34) + Searchstring(4) = "style:run-through=" & CHR$(34) & "background" & CHR$(34) + Searchstring(5) = "style:vertical-pos=" & CHR$(34) & "from-top" & CHR$(34) + Searchstring(6) = "style:vertical-rel=" & CHR$(34) & "page" & CHR$(34) + Searchstring(7) = "style:horizontal-pos=" & CHR$(34) & "from-left" & CHR$(34) + Searchstring(8) = "style:horizontal-rel=" & CHR$(34) & "paragraph" & CHR$(34) + StyleBodyA = GetBodiesItemStyleName (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box" , 6) + printlog " fr6 = " & StyleBodyA + printlog " ==========" + StyleDefinitionA = GetXMLValueLineExtra ((gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml")), "office:document-content", "office:automatic-styles;style:style" , "style:name" , StyleBodyA) + For i = 1 to 8 + printlog " +- " & Searchstring(i) + if InStr (StyleDefinitionA , Searchstring(i)) = 0 then + warnlog "Frame Style: " & Searchstring(i) & " not found!" + end if + Next i + Searchstring(1) = "style:family=" & CHR$(34) & "graphics" & CHR$(34) + Searchstring(2) = "style:parent-style-name=" & CHR$(34) + Searchstring(3) = "style:wrap=" & CHR$(34) & "parallel" & CHR$(34) + Searchstring(4) = "style:number-wrapped-paragraphs=" & CHR$(34) & "no-limit" & CHR$(34) + Searchstring(5) = "style:vertical-pos=" & CHR$(34) & "from-top" & CHR$(34) + Searchstring(6) = "style:vertical-rel=" & CHR$(34) & "paragraph" & CHR$(34) + Searchstring(7) = "style:horizontal-pos=" & CHR$(34) & "from-left" & CHR$(34) + Searchstring(8) = "style:horizontal-rel=" & CHR$(34) & "paragraph" & CHR$(34) + StyleBodyA = GetBodiesItemStyleName (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box", 7) + printlog " fr7 = " & StyleBodyA + printlog " ==========" + StyleDefinitionA = GetXMLValueLineExtra ((gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml")), "office:document-content", "office:automatic-styles;style:style" , "style:name" , StyleBodyA) + For i = 1 to 8 + printlog " +- " & Searchstring(i) + if InStr (StyleDefinitionA , Searchstring(i)) = 0 then + warnlog "Frame Style: " & Searchstring(i) & " not found!" + end if + Next i + Searchstring(1) = "style:family=" & CHR$(34) & "graphics" & CHR$(34) + Searchstring(2) = "style:parent-style-name=" & CHR$(34) + Searchstring(3) = "style:wrap=" & CHR$(34) & "parallel" & CHR$(34) + Searchstring(4) = "style:number-wrapped-paragraphs=" & CHR$(34) & "no-limit" & CHR$(34) + Searchstring(5) = "style:vertical-pos=" & CHR$(34) & "from-top" & CHR$(34) + Searchstring(6) = "style:horizontal-pos=" & CHR$(34) & "from-left" & CHR$(34) + Searchstring(7) = "style:horizontal-rel=" & CHR$(34) & "paragraph" & CHR$(34) + StyleBodyA = GetBodiesItemStyleName (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box", 8) + printlog " fr8 = " & StyleBodyA + printlog " ==========" + StyleDefinitionA = GetXMLValueLineExtra ((gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml")), "office:document-content", "office:automatic-styles;style:style" , "style:name" , StyleBodyA) + For i = 1 to 7 + printlog " +- " & Searchstring(i) + if InStr (StyleDefinitionA , Searchstring(i)) = 0 then + warnlog "Frame Style: " & Searchstring(i) & " not found!" + end if + Next i + Searchstring(1) = "style:family=" & CHR$(34) & "graphics" & CHR$(34) + Searchstring(2) = "style:parent-style-name=" & CHR$(34) + Searchstring(3) = "style:wrap=" & CHR$(34) & "parallel" & CHR$(34) + Searchstring(4) = "style:number-wrapped-paragraphs=" & CHR$(34) & "no-limit" & CHR$(34) + Searchstring(5) = "style:vertical-pos=" & CHR$(34) & "from-top" & CHR$(34) + Searchstring(6) = "style:horizontal-pos=" & CHR$(34) & "from-left" & CHR$(34) + Searchstring(7) = "style:horizontal-rel=" & CHR$(34) & "paragraph" & CHR$(34) + StyleBodyA = GetBodiesItemStyleName (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box", 9) + printlog " fr9 = " & StyleBodyA + printlog " ==========" + StyleDefinitionA = GetXMLValueLineExtra ((gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml")), "office:document-content", "office:automatic-styles;style:style" , "style:name" , StyleBodyA) + For i = 1 to 7 + printlog " +- " & Searchstring(i) + if InStr (StyleDefinitionA , Searchstring(i)) = 0 then + warnlog "Frame Style: " & Searchstring(i) & " not found!" + end if + Next i + Searchstring(1) = "style:family=" & CHR$(34) & "graphics" & CHR$(34) + Searchstring(2) = "style:parent-style-name=" & CHR$(34) + Searchstring(3) = "style:protect=" & CHR$(34) & "content size position" & CHR$(34) + Searchstring(4) = "style:wrap=" & CHR$(34) & "parallel" & CHR$(34) + Searchstring(5) = "style:number-wrapped-paragraphs=" & CHR$(34) & "no-limit" & CHR$(34) + Searchstring(6) = "style:vertical-pos=" & CHR$(34) & "from-top" & CHR$(34) + Searchstring(7) = "style:vertical-rel=" & CHR$(34) & "paragraph" & CHR$(34) + Searchstring(8) = "style:horizontal-pos=" & CHR$(34) & "from-left" & CHR$(34) + Searchstring(9) = "style:horizontal-rel=" & CHR$(34) & "paragraph" & CHR$(34) + StyleBodyA = GetBodiesItemStyleName (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box", 10) + printlog " fr10 = " & StyleBodyA + printlog " ==========" + StyleDefinitionA = GetXMLValueLineExtra ((gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml")), "office:document-content", "office:automatic-styles;style:style" , "style:name" , StyleBodyA) + For i = 1 to 9 + printlog " +- " & Searchstring(i) + if InStr (StyleDefinitionA , Searchstring(i)) = 0 then + warnlog "Frame Style: " & Searchstring(i) & " not found!" + end if + Next i + Searchstring(1) = "style:family=" & CHR$(34) & "graphics" & CHR$(34) + Searchstring(2) = "style:parent-style-name=" & CHR$(34) + Searchstring(3) = "style:wrap=" & CHR$(34) & "parallel" & CHR$(34) + Searchstring(4) = "style:number-wrapped-paragraphs=" & CHR$(34) & "no-limit" & CHR$(34) + Searchstring(5) = "style:vertical-pos=" & CHR$(34) & "from-top" & CHR$(34) + Searchstring(6) = "style:horizontal-pos=" & CHR$(34) & "from-left" & CHR$(34) + Searchstring(7) = "style:horizontal-rel=" & CHR$(34) & "paragraph" & CHR$(34) + Searchstring(8) = "style:border-line-width-left=" & CHR$(34) + Searchstring(9) = "style:border-line-width-bottom=" & CHR$(34) + Searchstring(10) = "fo:padding-left=" & CHR$(34) + Searchstring(11) = "fo:padding-right=" & CHR$(34) + Searchstring(12) = "fo:padding-top=" & CHR$(34) + Searchstring(13) = "fo:padding-bottom=" & CHR$(34) + Searchstring(14) = "fo:border-left=" & CHR$(34) + Searchstring(15) = "double" + Searchstring(16) = "#0000ff" + Searchstring(17) = "fo:border-bottom=" & CHR$(34) + Searchstring(18) = "style:shadow=" & CHR$(34) & "#ff0000" + StyleBodyA = GetBodiesItemStyleName (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box", 11) + printlog " fr11 = " & StyleBodyA + printlog " ==========" + StyleDefinitionA = GetXMLValueLineExtra ((gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml")), "office:document-content", "office:automatic-styles;style:style" , "style:name" , StyleBodyA) + For i = 1 to 18 + printlog " +- " & Searchstring(i) + if InStr (StyleDefinitionA , Searchstring(i)) = 0 then + warnlog "Frame Style: " & Searchstring(i) & " not found!" + end if + Next i + Searchstring(1) = "style:family=" & CHR$(34) & "graphics" & CHR$(34) + Searchstring(2) = "style:parent-style-name=" & CHR$(34) + Searchstring(3) = "style:wrap=" & CHR$(34) & "parallel" & CHR$(34) + Searchstring(4) = "style:number-wrapped-paragraphs=" & CHR$(34) & "no-limit" & CHR$(34) + Searchstring(5) = "style:vertical-pos=" & CHR$(34) & "from-top" & CHR$(34) + Searchstring(6) = "style:vertical-rel=" & CHR$(34) & "paragraph" & CHR$(34) + Searchstring(7) = "style:horizontal-pos=" & CHR$(34) & "from-left" & CHR$(34) + Searchstring(8) = "style:horizontal-rel=" & CHR$(34) & "paragraph" & CHR$(34) + Searchstring(9) = "fo:background-color=" & CHR$(34) & "#ffff00" & CHR$(34) + StyleBodyA = GetBodiesItemStyleName (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box", 12) + printlog " fr12 = " & StyleBodyA + printlog " ==========" + StyleDefinitionA = GetXMLValueLineExtra ((gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml")), "office:document-content", "office:automatic-styles;style:style" , "style:name" , StyleBodyA) + For i = 1 to 9 + printlog " +- " & Searchstring(i) + if InStr (StyleDefinitionA , Searchstring(i)) = 0 then + warnlog "Frame Style: " & Searchstring(i) & " not found!" + end if + Next i + Searchstring(1) = "style:family=" & CHR$(34) & "graphics" & CHR$(34) + Searchstring(2) = "style:parent-style-name=" & CHR$(34) + Searchstring(3) = "style:wrap=" & CHR$(34) & "parallel" & CHR$(34) + Searchstring(4) = "style:number-wrapped-paragraphs=" & CHR$(34) & "no-limit" & CHR$(34) + Searchstring(5) = "style:vertical-pos=" & CHR$(34) & "from-top" & CHR$(34) + Searchstring(6) = "style:vertical-rel=" & CHR$(34) & "paragraph" & CHR$(34) + Searchstring(7) = "style:horizontal-pos=" & CHR$(34) & "from-left" & CHR$(34) + Searchstring(8) = "style:horizontal-rel=" & CHR$(34) & "paragraph" & CHR$(34) + Searchstring(9) = "fo:background-color=" & CHR$(34) & "transparent" & CHR$(34) + Searchstring(10) = "<style:background-image/>" + Searchstring(11) = "<style:columns fo:column-count=" & CHR$(34) & "2" & CHR$(34) + + Searchstring(13) = "fo:margin-left=" & CHR$(34) + Searchstring(14) = "</style:columns>" + Searchstring(15) = "<style:properties" + Searchstring(16) = "</style:properties>" + StyleBodyA = GetBodiesItemStyleName (gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml") , "draw:text-box", 13) + printlog " fr13 = " & StyleBodyA + printlog " ==========" + StyleDefinitionA = GetXMLValueLineExtra ((gOfficePath & ConvertPath("user\work\xml\writer\level1\frames\content.xml")), "office:document-content", "office:automatic-styles;style:style" , "style:name" , StyleBodyA) + For i = 1 to 16 + if i <> 12 then + printlog " +- " & Searchstring(i) + if InStr (StyleDefinitionA , Searchstring(i)) = 0 then + warnlog "Frame Style: " & Searchstring(i) & " not found!" + end if + end if + Next i + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tschina + Dim i as integer + Dim a as integer + Dim xXMLStyleName as string + Dim xPath as string + Dim AttributeSearch(50) as string + Dim AttributeValue(50) as string + printlog "+- zh_cn_text.sxw" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\zh_cn_text.sxw")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_cn_text.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_cn_text.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_cn_text") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_cn_text\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_cn_text\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_cn_text\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_cn_text.sxw")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase ttchina + Dim i as integer + Dim a as integer + Dim xXMLStyleName as string + Dim xPath as string + Dim AttributeSearch(50) as string + Dim AttributeValue(50) as string + printlog "+- zh_tw_text.sxw" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\zh_tw_text.sxw")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_tw_text.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_tw_text.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_tw_text") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_tw_text\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_tw_text\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_tw_text\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\zh_tw_text.sxw")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tkorean + Dim i as integer + Dim a as integer + Dim xXMLStyleName as string + Dim xPath as string + Dim AttributeSearch(50) as string + Dim AttributeValue(50) as string + printlog "+- ko_text.sxw" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\ko_text.sxw")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\ko_text.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\ko_text.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\ko_text") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\ko_text\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\ko_text\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\ko_text\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\ko_text.sxw")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tjapan + Dim i as integer + Dim a as integer + Dim xXMLStyleName as string + Dim xPath as string + Dim AttributeSearch(50) as string + Dim AttributeValue(50) as string + printlog "+- jp_text.sxw" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\jp_text.sxw")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\jp_text.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\jp_text.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\jp_text") ) + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\jp_text\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\jp_text\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\jp_text\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\jp_text.sxw")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase + diff --git a/testautomation/xml/optional/includes/sxw7_03.inc b/testautomation/xml/optional/includes/sxw7_03.inc new file mode 100644 index 000000000000..cfdb3cf3ce3a --- /dev/null +++ b/testautomation/xml/optional/includes/sxw7_03.inc @@ -0,0 +1,458 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : helge.delfs@sun.com +'* +'* short description : XML Writer Include File +'* +'\*********************************************************************************** + Dim Isliste(250) as string + Dim OutputPath as string + Dim iSecurityBefore as integer + +sub sxw7_03 + + printlog "-------------------------- SXW7_03.INC ------------------------------" + call hEnablePrettyPrinting + call thyperlinks + call hEnablePrettyPrinting(1) + call tindexes_alpha + call tindex_biblio + call tindex_most + call tpages + call tparagraph01 + call tparagraph02 + call tsection_main + printlog "------------------------ Macros and Events --------------------------" + iSecurityBefore = "" + iSecurityBefore = hSetMacroSecurity(1) + call tEventsToObjects + call hSetMacroSecurity(iSecurityBefore) +end sub + +'------------------------------------------------------------------------- + +testcase thyperlinks + Dim Searchstring(9) as string + Dim i as integer + Dim AdditionalParameter as string + printlog "+- hyperlinks.sdw" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\hyperlinks.sdw")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\hyperlinks.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\hyperlinks.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\hyperlinks") ) + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\hyperlinks\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\hyperlinks\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\hyperlinks\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\hyperlinks.sxw")) + sleep(2) + call hCloseDocument + sleep(2) + ' ----------------------- + ' T E X T - S T Y L E S + ' ----------------------- + ' <text:p text:style-name="Standard"><text:a xlink:type="simple" xlink:href="http://Www.sun.com/" office:target-frame-name="_blank" xlink:show="new" text:style-name="Variable" text:visited-style-name="Quotation"><text:span text:style-name="T1">Www.sun.com</text:span></text:a></text:p> + '------------------------------------------------------------------------- + Searchstring(1) = "<text:a" + Searchstring(2) = "xlink:type=" & CHR$(34) & "simple" & CHR$(34) + Searchstring(3) = "xlink:href=" & CHR$(34) & "http://Www.sun.com/" & CHR$(34) + Searchstring(4) = "office:target-frame-name=" & CHR$(34) & "_blank" & CHR$(34) + Searchstring(5) = "xlink:show=" & CHR$(34) & "new" & CHR$(34) + Searchstring(6) = "text:visited-style-name=" & CHR$(34) + Searchstring(7) = ">Www.sun.com<" + Searchstring(8) = "</text:span>" + Searchstring(9) = "</text:a>" + '------------------------------------------------------------------------- + AdditionalParameter = GetLineInXMLBody(gOfficePath & ConvertPath("user\work\xml\writer\level1\hyperlinks\content.xml") , "text:p" , 1) + printlog "Debug: " & AdditionalParameter + For i = 1 to 9 + printlog " +- " & Searchstring(i) + if InStr (AdditionalParameter , Searchstring(i)) = 0 then + warnlog "Hyperlinks in text: " & Searchstring(i) & " not found!" + end if + Next i + ' <text:p text:style-name="P1"><text:a xlink:type="simple" xlink:href="#targ" text:style-name="Variable" text:visited-style-name="Quotation">jump</text:a></text:p> + '------------------------------------------------------------------------- + Searchstring(1) = "<text:a" + Searchstring(2) = "xlink:type=" & CHR$(34) & "simple" & CHR$(34) + Searchstring(3) = "xlink:href=" & CHR$(34) & "#targ" & CHR$(34) + Searchstring(4) = "text:visited-style-name=" & CHR$(34) + Searchstring(5) = ">jump<" + Searchstring(6) = "</text:a>" + '------------------------------------------------------------------------- + AdditionalParameter = GetLineInXMLBody(gOfficePath & ConvertPath("user\work\xml\writer\level1\hyperlinks\content.xml") , "text:p" , 3) + For i = 1 to 6 + printlog " +- " & Searchstring(i) + if InStr (AdditionalParameter , Searchstring(i)) = 0 then + warnlog "Hyperlinks in text: " & Searchstring(i) & " not found!" + end if + Next i + ' <text:p text:style-name="P1"><text:bookmark-start text:name="targ"/>target here<text:bookmark-end text:name="targ"/></text:p> + '------------------------------------------------------------------------- + Searchstring(1) = "<text:bookmark-start" + Searchstring(2) = "text:name=" & CHR$(34) & "targ" & CHR$(34) + Searchstring(3) = ">target here<" + Searchstring(4) = "<text:bookmark-end" + '------------------------------------------------------------------------- + AdditionalParameter = GetLineInXMLBody(gOfficePath & ConvertPath("user\work\xml\writer\level1\hyperlinks\content.xml") , "text:p" , 6) + For i = 1 to 4 + printlog " +- " & Searchstring(i) + if InStr (AdditionalParameter , Searchstring(i)) = 0 then + warnlog "Hyperlinks in text: " & Searchstring(i) & " not found!" + end if + Next i + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tindexes_alpha + printlog "+- indexes_alpha.sdw" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\indexes_alpha.sdw")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\indexes_alpha.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\indexes_alpha.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\indexes_alpha") ) + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\indexes_alpha\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\indexes_alpha\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\indexes_alpha\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\indexes_alpha.sxw")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tindex_biblio + printlog "+- index_biblio.sdw" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\index_biblio.sdw")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\index_biblio.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\index_biblio.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\index_biblio") ) + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\index_biblio\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\index_biblio\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\index_biblio\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\index_biblio.sxw")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tindex_most + printlog "+- index_most.sdw" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\index_most.sdw")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\index_most.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\index_most.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\index_most") ) + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\index_most\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\index_most\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\index_most\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\index_most.sxw")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tpages + printlog "+- pages.sdw" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\pages.sdw")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\pages.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\pages.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\pages") ) + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\pages\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\pages\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\pages\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\pages.sxw")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tparagraph01 + printlog "+- paragraph01.sdw" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\paragraph01.sdw")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\paragraph01.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\paragraph01.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\paragraph01") ) + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\paragraph01\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\paragraph01\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\paragraph01\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\paragraph01.sxw")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tparagraph02 + printlog "+- paragraph02.sdw" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\paragraph02.sdw")) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\paragraph02.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\paragraph02.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\paragraph02") ) + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\paragraph02\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\paragraph02\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\paragraph02\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\paragraph02.sxw")) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tsection_main + QAErrorLog "#i88812#-Update all links message doubled in old .sd* documents." + goto endsub + printlog "+- section_main.sdw" + call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\section_main.sdw") , TRUE) + if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\section_main.sxw") , "StarOffice XML (Writer)") then + '/// Closing the document also if there is a verification dialog. + call hCloseDocument() + sleep(3) + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\section_main.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\section_main") ) + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\section_main\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\section_main\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\section_main\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + else + call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\section_main.sxw") , TRUE) + sleep(2) + call hCloseDocument + sleep(2) + end if + else + call hCloseDocument + end if +endcase +' +'------------------------------------------------------------------------- +' +testcase tEventsToObjects + '/// Goal: All macros embedded to the objects should be exported corrextly to XML fileformat. + Dim i as integer + Dim l as integer + Dim a as integer + Dim xXMLStyleName as string + Dim xPath as string + Dim AttributeSearch(50) as string + Dim AttributeValue(50) as string + Dim cWhereCalled as string + + dim sdw_file as string + sdw_file = gTesttoolPath & "xml\optional\input\writer\events_to_objects.sdw" + sdw_file = convertpath( sdw_file ) + dim sxw_file as string + sxw_file = gOfficePath & "user\work\xml\writer\level1\events_to_objects.sxw" + sxw_file = convertpath( sxw_file ) + + printlog "+- events_to_objects.sdw" + + cWhereCalled = "xml::level1::inc::sxw7_03.inc::tEventsToObjects: " + + '/// Open Tools/Options -> OpenOffice.org/Security + '/// Click on the macro security button + '/// Set the <b>medium</b> security level + + try + if iSecurityBefore = "" then + QAErrorLog cWhereCalled & "Macro security level needs to be set before to 1 (medium)!" + goto endsub + end if + catch + 'if variable iSecurityBefore is not initialized and causes into an error + QAErrorLog cWhereCalled & "Macro security level needs to be set before to 1 (medium)!" + goto endsub + endcatch + + '/// Load (binary) document under <i>...qa/qatesttool/xml/update/input/writer/events_to_objects.sdw</i>. + hFileOpen( sdw_file ) + if ( NOT hAllowMacroExecution() ) then + warnlog "#i80769# Macros not being loaded. Exiting test case." + call hCloseDocument + goto endsub + end if + '/// Save as StarOffice XML fileformat (.sxw). + if ( hFileSaveAsWithFilterKill ( sxw_file , "StarOffice XML (Writer)" ) ) then + '/// Closing the document also if there is a verification dialog. + 'call hCloseDocument() + hCloseDocument() + 'sleep(3) + '/// Close window with the document. + UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\events_to_objects.sxw") , _ + gOfficePath & ConvertPath("user\work\xml\writer\level1\events_to_objects") ) + '/// Uncompressing .sxw files in directory <pre>../user/work/events_to_objects/</pre>. + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\events_to_objects\meta.xml")) = FALSE then + warnlog "XML-file 'meta.xml' not well formed!" + end if + '///+Verify that XML files (<i>styles.xml</i>, <i>meta.xml</i> and <i>content.xml</i>) are <i>well formed</i>. + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\events_to_objects\styles.xml")) = FALSE then + warnlog "XML-file 'styles.xml' not well formed!" + end if + if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\events_to_objects\content.xml")) = FALSE then + warnlog "XML-file 'content.xml' not well formed!" + '/// If <i>well formness</i> is okay, load exported document. + else + hFileOpen( sdw_file ) + hAllowMacroExecution() + + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<SHIFT F4>" , TRUE + '/// Select first graphic with <SHIFT><F4> + '///+ and a messagebox should be displayed. + '///+ Press <RETURN> key. + '///<i>four times</i> + '///+<ol><li>Press <TAB> key to select the next object.</li><li>and a messagebox should be displayed.</li><li>Press <RETURN> key.</li></ol> + for l = 1 to 4 + Kontext "Messagebox" + if Messagebox.Exists(2) then + if Messagebox.GetRT = 304 then + Messagebox.OK + end if + else + if l = 1 then + warnlog "Event on Graphic failed! No Message Box occured!" + end if + if l = 2 then + warnlog "Event on OLE object failed! No Message Box occured!" + end if + if l = 3 then + warnlog "Event on text frame object failed! No Message Box occured!" + end if + if l = 4 then + warnlog "Event on text frame object (frame style applied) failed! No Message Box occured!" + end if + end if + if l <> 4 then + Kontext "DocumentWriter" + DocumentWriter.TypeKeys "<TAB>" + end if + next l + '/// Close document. + call hCloseDocument + sleep(2) + 'TODO: Search for the events in source. + end if + else + call hCloseDocument + end if +endcase + diff --git a/testautomation/xml/optional/includes/w_xml_vertical_alignment.inc b/testautomation/xml/optional/includes/w_xml_vertical_alignment.inc new file mode 100644 index 000000000000..9838694951ad --- /dev/null +++ b/testautomation/xml/optional/includes/w_xml_vertical_alignment.inc @@ -0,0 +1,141 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* owner : helge.delfs@sun.com +'* +'* short description : testing vertical alignment in writer +'* +'************************************************************************************************* +'* +' #1 tVerticalAlignmentWriter 'Testing for vertical alignment in writer +'* +'\************************************************************************************************* + +testcase tVerticalAlignmentWriter + ' Dimensioning variables + dim iSaxSeekIndex as INTEGER 'counter-variable for searching through the styles:styles + dim sSaveAsFile as STRING 'TestDoc is going to be saved with this name + dim sWriterContentXML as STRING 'Location of the content.xml + dim sLoadFileName as STRING 'Variable for name of the Testdoc + dim sUnpackStorageDir as STRING 'Name of the direcotry where the xml file is being unpacked + dim sAttrValue as STRING 'Name of the variable to store the searched value in + Dim xXMLStyleName as STRING 'Draw:Style-name to be searched for + Dim iChildCount as INTEGER 'Counter for SAX Child nodes + + ' Setting paths and variables + sSaveAsFile = gOfficePath & ConvertPath("user\work\VerticalAlignment.odt") + printlog "Save-path is " & sSaveAsFile + sUnpackStorageDir = gOfficePath & ConvertPath("user\work\VerticalAlignment") + printlog "UnpackStorageDir is " & sUnpackStorageDir + printlog "Used Save-As Filter is " & gWriterFilter + sWriterContentXML = gOfficePath & ConvertPath("user\work\VerticalAlignment\content.xml") + printlog "ContentXML File is to be found in " & sWriterContentXML + sLoadFileName = ConvertPath (gTesttoolPath + "xml\optional\input\writer\verttoline1.doc") + printlog "The used TestDoc is " & sLoadFileName + + printlog "Checking if storage Directory is empty" + if Dir(sUnpackStorageDir) <> "" then + printlog "UnpackStorageDir was not empty, deleting." + RmDir (sUnpackStorageDir) + else + printlog "UnpackStorageDir is emtpy." + endif + + printlog "Loading test document gTesttoolPath\xml\optional\input\writer\verttoline1.doc" + if hFileOpen (sLoadFileName) = FALSE then + warnlog "Loading File failed!" + else + printlog "Save document in ODF file format." + if hFileSaveAsWithFilterKill (sSaveAsFile , "writer8") = FALSE then + warnlog "Saving " & sSaveAsFile & " failed! -> Exiting test!" + call hCloseDocument + else + call hCloseDocument + endif + endif + printlog "Unzip or unjar the gOfficePath/user/work/VerticalAlignment.odt into the directory gOfficePath/user/work/VerticalAlignment" + UnpackStorage(sSaveAsFile, sUnpackStorageDir) + printlog "Use a XML editor like jEdit and open the structure of the XML file gOfficePath/user/work/VerticalAlignment/Object 1/content.xml" + printlog "opening XML file and creating DOM." + SAXReadFile(sWriterContentXML) + sleep(2) + printlog "Go to the root node." + SAXSeekElement("/") + printlog "Get the Draw style name to search the attribute in..." + printlog "office:document-content" + printlog "Search for draw:style-name to be used in..." + SAXSeekElement("office:document-content") + printlog "office:body" + SAXSeekElement("office:body") + printlog "office:text" + SAXSeekElement("office:text") + printlog "text:p" + SAXSeekElement("text:p" , 1) + printlog "draw:frame" + SAXSeekElement("draw:frame" , 1) + printlog "draw:style-name" + xXMLStyleName = SAXGetAttributeValue("draw:style-name") + printlog "draw:style-name to search for is " & xXMLStyleName & "." + printlog "Search for: style:vertical-pos="from-top"" + 'Setting parser back to root node + SAXSeekElement("/") + printlog "Seek office:document-content." + SAXSeekElement("office:document-content") + printlog "Seek office:automatic-styles." + SAXSeekElement("office:automatic-styles") + printlog "Search through style:style elements." + printlog "...in one of the 4 style:style elements there should be a..." + iChildCount = SAXGetChildCount + 'printlog "There are " & iChildCount & " Childnodes." + for iSaxSeekIndex = 1 to iChildCount + SAXSeekElement(iSaxSeekIndex) + if SAXGetAttributeValue("style:name") = xXMLStyleName then + SAXSeekElement("style:graphic-properties") + printlog "style:graphic-properties with the value from-top" + printlog "Seeking for style:vertical-pos." + if SaxGetAttributeName(5) = "style:vertical-pos" then + 'printlog "Found attribute 'style:vertical-pos' in childnode " & iSaxSeekIndex & "." + printlog "Get value from style:vertical-pos." + sAttrValue = SAXGetAttributeValue("style:vertical-pos") + 'printlog "Value is " & sAttrValue & "." + 'lcase(sAttrValue) + if sAttrValue = "from-top" then + printlog "Expected value of 'style:vertical-pos' = from-top was found." + exit for + else + warnlog "Expected value of 'style:vertical-pos' = from-top was not found!" + endif + + else + warnlog "Attribut style:vertical-pos not found in element " & iSaxSeekIndex & "." + endif + SAXSeekElement(0) + endif + SAXSeekElement(0) + next iSaxSeekIndex + SAXRelease +endcase |