summaryrefslogtreecommitdiff
path: root/testautomation/framework/optional/includes
diff options
context:
space:
mode:
Diffstat (limited to 'testautomation/framework/optional/includes')
-rw-r--r--testautomation/framework/optional/includes/CJK_CollationDialogue_1.inc706
-rw-r--r--testautomation/framework/optional/includes/CJK_FeatureSwitchTest_1.inc736
-rw-r--r--testautomation/framework/optional/includes/CJK_RubyDialogueProposal_1.inc389
-rw-r--r--testautomation/framework/optional/includes/NewSortingAlgorithmForJapanese_1.inc227
-rw-r--r--testautomation/framework/optional/includes/basic_delete_modules.inc105
-rw-r--r--testautomation/framework/optional/includes/basic_dialog_i18n_copy_control.inc202
-rw-r--r--testautomation/framework/optional/includes/basic_dialog_i18n_defaults.inc406
-rw-r--r--testautomation/framework/optional/includes/basic_documents.inc190
-rw-r--r--testautomation/framework/optional/includes/basic_eventbinding.inc283
-rw-r--r--testautomation/framework/optional/includes/basic_formcontrols.inc288
-rw-r--r--testautomation/framework/optional/includes/basic_gridcontrol.inc131
-rw-r--r--testautomation/framework/optional/includes/basic_ide.inc335
-rw-r--r--testautomation/framework/optional/includes/basic_issues.inc224
-rw-r--r--testautomation/framework/optional/includes/basic_library_export.inc200
-rw-r--r--testautomation/framework/optional/includes/basic_library_import.inc123
-rw-r--r--testautomation/framework/optional/includes/basic_macros.inc407
-rw-r--r--testautomation/framework/optional/includes/basic_modulehide.inc102
-rw-r--r--testautomation/framework/optional/includes/basic_modulenames.inc347
-rw-r--r--testautomation/framework/optional/includes/basic_modules.inc140
-rw-r--r--testautomation/framework/optional/includes/basic_package_export.inc219
-rw-r--r--testautomation/framework/optional/includes/basic_package_import.inc140
-rw-r--r--testautomation/framework/optional/includes/basic_protected_libraries.inc160
-rw-r--r--testautomation/framework/optional/includes/basic_shared_modules.inc90
-rw-r--r--testautomation/framework/optional/includes/basic_spectemplate.inc123
-rw-r--r--testautomation/framework/optional/includes/basic_usertemplate.inc204
-rw-r--r--testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc138
-rw-r--r--testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc154
-rw-r--r--testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc101
-rw-r--r--testautomation/framework/optional/includes/basic_vba_compat_tools.inc72
-rw-r--r--testautomation/framework/optional/includes/configuration.inc371
-rw-r--r--testautomation/framework/optional/includes/extras_file_open.inc213
-rw-r--r--testautomation/framework/optional/includes/extras_labels.inc107
-rw-r--r--testautomation/framework/optional/includes/extras_modify_objects.inc168
-rw-r--r--testautomation/framework/optional/includes/extras_preview.inc112
-rw-r--r--testautomation/framework/optional/includes/extras_table_autoformat.inc126
-rw-r--r--testautomation/framework/optional/includes/f_usage_tracking.inc285
-rw-r--r--testautomation/framework/optional/includes/filedlg_allowed_names.inc115
-rw-r--r--testautomation/framework/optional/includes/filedlg_autocomplete.inc207
-rw-r--r--testautomation/framework/optional/includes/filedlg_cjk_files.inc82
-rw-r--r--testautomation/framework/optional/includes/filedlg_cjk_folders.inc86
-rw-r--r--testautomation/framework/optional/includes/filedlg_document_properties.inc106
-rw-r--r--testautomation/framework/optional/includes/filedlg_filternames.inc123
-rw-r--r--testautomation/framework/optional/includes/filedlg_folders1.inc106
-rw-r--r--testautomation/framework/optional/includes/filedlg_folders2.inc72
-rw-r--r--testautomation/framework/optional/includes/filedlg_folders3.inc65
-rw-r--r--testautomation/framework/optional/includes/filedlg_folders4.inc128
-rw-r--r--testautomation/framework/optional/includes/filedlg_folders5.inc117
-rw-r--r--testautomation/framework/optional/includes/filedlg_folders6.inc166
-rw-r--r--testautomation/framework/optional/includes/filedlg_folders7.inc127
-rw-r--r--testautomation/framework/optional/includes/filedlg_forbidden_names_windows.inc85
-rw-r--r--testautomation/framework/optional/includes/filedlg_multiselection.inc197
-rw-r--r--testautomation/framework/optional/includes/filedlg_passwords.inc181
-rw-r--r--testautomation/framework/optional/includes/filedlg_rename.inc97
-rw-r--r--testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc76
-rw-r--r--testautomation/framework/optional/includes/filedlg_reserved_names_windows.inc133
-rw-r--r--testautomation/framework/optional/includes/filedlg_tools.inc478
-rw-r--r--testautomation/framework/optional/includes/filedlg_triggers.inc274
-rw-r--r--testautomation/framework/optional/includes/fontworkgallery.inc146
-rw-r--r--testautomation/framework/optional/includes/help_bookmarks.inc197
-rw-r--r--testautomation/framework/optional/includes/help_compare_applications.inc99
-rw-r--r--testautomation/framework/optional/includes/help_compare_content.inc94
-rw-r--r--testautomation/framework/optional/includes/help_compare_topics.inc129
-rw-r--r--testautomation/framework/optional/includes/help_search.inc160
-rw-r--r--testautomation/framework/optional/includes/help_view_topics.inc105
-rw-r--r--testautomation/framework/optional/includes/loadsave_files.inc181
-rw-r--r--testautomation/framework/optional/includes/loadsave_new.inc116
-rw-r--r--testautomation/framework/optional/includes/menuentries.inc172
-rw-r--r--testautomation/framework/optional/includes/ole_1.inc459
-rw-r--r--testautomation/framework/optional/includes/ole_2.inc129
-rw-r--r--testautomation/framework/optional/includes/ole_3.inc360
-rw-r--r--testautomation/framework/optional/includes/ole_tools.inc462
-rw-r--r--testautomation/framework/optional/includes/options_asia.inc641
-rw-r--r--testautomation/framework/optional/includes/options_data.inc192
-rw-r--r--testautomation/framework/optional/includes/options_int1.inc286
-rw-r--r--testautomation/framework/optional/includes/options_lan1.inc894
-rw-r--r--testautomation/framework/optional/includes/options_loadsave_general.inc284
-rw-r--r--testautomation/framework/optional/includes/options_loadsave_html.inc220
-rw-r--r--testautomation/framework/optional/includes/options_loadsave_msoffice.inc127
-rw-r--r--testautomation/framework/optional/includes/options_loadsave_vba.inc129
-rw-r--r--testautomation/framework/optional/includes/options_ls_2.inc307
-rw-r--r--testautomation/framework/optional/includes/options_ooo_accessibility.inc185
-rw-r--r--testautomation/framework/optional/includes/options_ooo_appearance.inc169
-rw-r--r--testautomation/framework/optional/includes/options_ooo_colors.inc206
-rw-r--r--testautomation/framework/optional/includes/options_ooo_fontreplacement.inc118
-rw-r--r--testautomation/framework/optional/includes/options_ooo_general.inc583
-rw-r--r--testautomation/framework/optional/includes/options_ooo_java.inc131
-rw-r--r--testautomation/framework/optional/includes/options_ooo_memory.inc219
-rw-r--r--testautomation/framework/optional/includes/options_ooo_paths.inc349
-rw-r--r--testautomation/framework/optional/includes/options_ooo_print.inc438
-rw-r--r--testautomation/framework/optional/includes/options_ooo_security.inc134
-rw-r--r--testautomation/framework/optional/includes/options_ooo_userdata.inc212
-rw-r--r--testautomation/framework/optional/includes/options_ooo_view.inc243
-rw-r--r--testautomation/framework/optional/includes/scripting_basics.inc73
-rw-r--r--testautomation/framework/optional/includes/scripting_organizers.inc278
-rw-r--r--testautomation/framework/optional/includes/security_broken_signature.inc71
-rw-r--r--testautomation/framework/optional/includes/security_certification_dialogs.inc98
-rw-r--r--testautomation/framework/optional/includes/security_certified_docs.inc147
-rw-r--r--testautomation/framework/optional/includes/security_evilmacro1.inc100
-rw-r--r--testautomation/framework/optional/includes/security_evilmacro2.inc89
-rw-r--r--testautomation/framework/optional/includes/security_evilmacro3.inc95
-rw-r--r--testautomation/framework/optional/includes/security_incorrect_password.inc136
-rw-r--r--testautomation/framework/optional/includes/security_macrosecurity.inc169
-rw-r--r--testautomation/framework/optional/includes/security_recommend_password.inc123
-rw-r--r--testautomation/framework/optional/includes/security_trusted_path.inc86
-rw-r--r--testautomation/framework/optional/includes/standardbar2.inc160
-rw-r--r--testautomation/framework/optional/includes/toolbar_behavior.inc152
-rw-r--r--testautomation/framework/optional/includes/w_grid_layout1.inc576
107 files changed, 22574 insertions, 0 deletions
diff --git a/testautomation/framework/optional/includes/CJK_CollationDialogue_1.inc b/testautomation/framework/optional/includes/CJK_CollationDialogue_1.inc
new file mode 100644
index 000000000000..98faef122a4c
--- /dev/null
+++ b/testautomation/framework/optional/includes/CJK_CollationDialogue_1.inc
@@ -0,0 +1,706 @@
+'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 : CJK Collation Dialogue Design Draft
+'*
+'\***********************************************************************
+
+testcase tLanguageTest_1
+
+ Dim sLanguageIDEnglishUSA ,sLanguageIDSChinese, sLanguageIDTChinese , sLanguageIDJapanese , sLanguageIDKoren as String
+ Dim sKeyTypeEnglishUSA ,sKeyTypeSChinese , sKeyTypeTChinese , sKeyTypeJapanese , sKeyTypeKoren as String
+ Dim i as Integer
+
+ '/// Check if the default setting for &quot;key type&quot; is right for CJK when alphanumeric is chosen in English
+
+ select case iSprache
+ case 01 :' English (USA)
+ sKeyTypeEnglishUSA = "Alphanumeric"
+ sKeyTypeSChinese = "Character set"
+ sKeyTypeTChinese = "Numeric"
+ sKeyTypeJapanese = "Character set"
+ sKeyTypeKoren = "Character set"
+ case 49 :' German
+ sKeyTypeEnglishUSA = "Alphanumerisch"
+ sKeyTypeSChinese = "Numerisch"
+ sKeyTypeTChinese = "Numerisch"
+ sKeyTypeJapanese = "Numerisch"
+ sKeyTypeKoren = "Numerisch"
+ case 55 :' Brazilian
+ sKeyTypeEnglishUSA = "Alfanumérico"
+ sKeyTypeSChinese = "Conjunto de caracteres"
+ sKeyTypeTChinese = "numérico"
+ sKeyTypeJapanese = "Conjunto de caracteres"
+ sKeyTypeKoren = "Conjunto de caracteres"
+ case 81 :' Japanese
+ sKeyTypeEnglishUSA = "英数字"
+ sKeyTypeSChinese = "ピンイン(中国語のローマ字表記法)"
+ sKeyTypeTChinese = "ピンイン(中国語のローマ字表記法)"
+ sKeyTypeJapanese = "数字"
+ sKeyTypeKoren = "数字"
+ ' case 82 : ' Korean
+ ' sKeyTypeEnglishUSA = 1 'alphanumeric
+ ' sKeyTypeSChinese = 1 'Character set
+ ' sKeyTypeTChinese = 3 'Pin yin
+ ' sKeyTypeJapanese = 2 'Character set
+ ' sKeyTypeKoren = 3 'Character set
+ case 86 :' Chinese (simplified)
+ sKeyTypeEnglishUSA = "字母数字式"
+ sKeyTypeSChinese = "字符集"
+ sKeyTypeTChinese = "拼音"
+ sKeyTypeJapanese = "字符集"
+ sKeyTypeKoren = "字典"
+ case 88 :' Chinese (traditional)
+ sKeyTypeEnglishUSA = "字母數字式"
+ sKeyTypeSChinese = "字型"
+ sKeyTypeTChinese = "拼音"
+ sKeyTypeJapanese = "字型"
+ sKeyTypeKoren = "字典"
+ case else :' Fallback
+ PrintLog "The test does not support the language " + iSprache
+ Goto endsub
+ end select
+
+ sLanguageIDEnglishUSA = fGetCountryName(01)
+ sLanguageIDSChinese = fGetCountryName(86)
+ sLanguageIDTChinese = fGetCountryName(88)
+ sLanguageIDJapanese = fGetCountryName(81)
+ sLanguageIDKoren = fGetCountryName(82)
+
+ call hNewDocument
+
+ DocumentWriter.TypeKeys "test"
+ DocumentWriter.TypeKeys "<Shift Home>"
+ Sleep 1
+
+ '/// Open Tools/Sort
+ ToolsSort
+ Kontext "Sortieren"
+
+ '/// Choose language: English and key type: alphanumeric
+ try
+ Sprache.Select (sLanguageIDEnglishUSA)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'"
+ ' try fallback to 'English (USA)'
+ try
+ Sprache.Select ("English (USA)")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'English (USA)'"
+ endcatch
+ endcatch
+ try
+ Schluesseltyp1.Select sKeyTypeEnglishUSA
+ catch
+ qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'"
+ ' try fallback to 'English (USA)'
+ for i = 1 to Schluesseltyp1.getItemCount
+ printlog "" + i + ": '" + Schluesseltyp1.getItemText(i) + "'"
+ next i
+ endcatch
+
+ '/// Check to simplified Chinese
+ try
+ Sprache.Select (sLanguageIDSChinese)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDSChinese + "'"
+ ' try fallback to 'Chinese (simplyfied)'
+ try
+ Sprache.Select ("Chinese (simplyfied)")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'Chinese (simplyfied)'"
+ endcatch
+ endcatch
+ Sleep 2
+
+ try
+ Sprache.Select (sLanguageIDEnglishUSA)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'"
+ ' try fallback to 'English (USA)'
+ try
+ Sprache.Select ("English (USA)")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'English (USA)'"
+ endcatch
+ endcatch
+ try
+ Schluesseltyp1.Select sKeyTypeEnglishUSA
+ catch
+ qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'"
+ endcatch
+
+ '/// Check to traditional Chinese
+ try
+ Sprache.Select (sLanguageIDTChinese)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDTChinese + "'"
+ ' try fallback to 'Chinese (traditional)'
+ try
+ Sprache.Select ("Chinese (traditional)")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'Chinese (traditional)'"
+ for i = 1 to Sprache.getItemCount
+ printlog "("+i+"/"+ Sprache.getItemCount + "): '"+Sprache.getItemText(i)+"'"
+ next i
+ endcatch
+ endcatch
+ Sleep 2
+
+ try
+ Sprache.Select (sLanguageIDEnglishUSA)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'"
+ ' try fallback to 'English (USA)'
+ try
+ Sprache.Select ("English (USA)")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'English (USA)'"
+ endcatch
+ endcatch
+ try
+ Schluesseltyp1.Select sKeyTypeEnglishUSA
+ catch
+ qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'"
+ endcatch
+
+ '/// Check to Japanese
+ try
+ Sprache.Select (sLanguageIDJapanese)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDJapanese + "'"
+ ' try fallback to 'Japanese'
+ try
+ Sprache.Select ("Japanese")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'Japanese'"
+ endcatch
+ endcatch
+ Sleep 2
+ if Schluesseltyp1.GetSelText <> sKeyTypeJapanese then
+ warnlog "The default key type for Japanese should be: '" + sKeyTypeJapanese + "' but is: '" + Schluesseltyp1.GetSelText + "'"
+ end if
+
+ try
+ Sprache.Select (sLanguageIDEnglishUSA)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'"
+ ' try fallback to 'English (USA)'
+ try
+ Sprache.Select ("English (USA)")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'English (USA)'"
+ endcatch
+ endcatch
+ try
+ Schluesseltyp1.Select sKeyTypeEnglishUSA
+ catch
+ qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'"
+ endcatch
+
+ '/// Check to Korean
+ try
+ Sprache.Select (sLanguageIDKoren)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDKoren + "'"
+ ' try fallback to 'Korean (RoK)'
+ try
+ Sprache.Select ("Korean (RoK)")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'Korean (RoK)'"
+ for i = 1 to Sprache.getItemCount
+ printlog "("+i+"/"+ Sprache.getItemCount + "): '"+Sprache.getItemText(i)+"'"
+ next i
+ endcatch
+ endcatch
+ Sleep 2
+ if Schluesseltyp1.GetSelText <> sKeyTypeKoren then
+ warnlog "The default key type for Korean should be " + sKeyTypeKoren + " but get " + Schluesseltyp1.GetSelText
+ end if
+
+ Sortieren.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tLanguageTest_2
+
+ Dim sLanguageIDEnglishUSA ,sLanguageIDSChinese, sLanguageIDTChinese , sLanguageIDJapanese , sLanguageIDKoren as String
+ Dim sKeyTypeEnglishUSA ,sKeyTypeSChinese , sKeyTypeTChinese , sKeyTypeJapanese , sKeyTypeKoren as String
+ Dim i as Integer
+
+ '/// Check if the default setting for &quot;key type&quot; is right for CJK when numeric is chosen in English
+
+ select case iSprache
+ case 01 :' English (USA)
+ sKeyTypeEnglishUSA = "Numeric"
+ sKeyTypeSChinese = "Numeric"
+ sKeyTypeTChinese = "Numeric"
+ sKeyTypeJapanese = "Numeric"
+ sKeyTypeKoren = "Numeric"
+ case 49 :' German
+ sKeyTypeEnglishUSA = "Numerisch"
+ sKeyTypeSChinese = "Numerisch"
+ sKeyTypeTChinese = "Numerisch"
+ sKeyTypeJapanese = "Numerisch"
+ sKeyTypeKoren = "Numerisch"
+ case 55 :' Brazilian
+ sKeyTypeEnglishUSA = "numérico"
+ sKeyTypeSChinese = "numérico"
+ sKeyTypeTChinese = "numérico"
+ sKeyTypeJapanese = "numérico"
+ sKeyTypeKoren = "numérico"
+ case 81 :' Japanese
+ sKeyTypeEnglishUSA = "数字"
+ sKeyTypeSChinese = "数字"
+ sKeyTypeTChinese = "数字"
+ sKeyTypeJapanese = "数字"
+ sKeyTypeKoren = "数字"
+ ' case 82 ' Korean
+ ' sKeyTypeEnglishUSA = 2 'numeric
+ ' sKeyTypeSChinese = 4 'numeric
+ ' sKeyTypeTChinese = 4 'numeric
+ ' sKeyTypeJapanese = 4 'numeric
+ ' sKeyTypeKoren = 4 'numeric
+ case 86 :' Chinese (simplified)
+ sKeyTypeEnglishUSA = "数字"
+ sKeyTypeSChinese = "数字"
+ sKeyTypeTChinese = "数字"
+ sKeyTypeJapanese = "数字"
+ sKeyTypeKoren = "数字"
+ case 88 :' Chinese (traditional)
+ sKeyTypeEnglishUSA = "數字"
+ sKeyTypeSChinese = "數字"
+ sKeyTypeTChinese = "數字"
+ sKeyTypeJapanese = "數字"
+ sKeyTypeKoren = "數字"
+ case else :' Fallback
+ printLog "The test does not support the language " + iSprache
+ Goto endsub
+ end select
+
+ sLanguageIDEnglishUSA = fGetCountryName(01)
+ sLanguageIDSChinese = fGetCountryName(86)
+ sLanguageIDTChinese = fGetCountryName(88)
+ sLanguageIDJapanese = fGetCountryName(81)
+ sLanguageIDKoren = fGetCountryName(82)
+
+ call hNewDocument
+
+ DocumentWriter.TypeKeys "123"
+ DocumentWriter.TypeKeys "<Shift Home>"
+ Sleep 1
+
+ '/// Open Tools/Sort
+ ToolsSort
+ Kontext "Sortieren"
+
+ '/// Choose language: English and key type: Numeric
+ try
+ Sprache.Select (sLanguageIDEnglishUSA)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'"
+ ' try fallback to 'English (USA)'
+ try
+ Sprache.Select ("English (USA)")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'English (USA)'"
+ for i = 1 to Sprache.getItemCount
+ printlog "" + i + ": '" + Sprache.getItemText(i) + "'"
+ next i
+ endcatch
+ endcatch
+ try
+ Schluesseltyp1.Select sKeyTypeEnglishUSA
+ catch
+ qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'"
+ ' try fallback to 'English (USA)'
+ for i = 1 to Schluesseltyp1.getItemCount
+ printlog "" + i + ": '" + Schluesseltyp1.getItemText(i) + "'"
+ next i
+ endcatch
+
+ '/// Check to simplified Chinese
+ try
+ Sprache.Select (sLanguageIDSChinese)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDSChinese + "'"
+ ' try fallback to 'Chinese (simplyfied)'
+ try
+ Sprache.Select ("Chinese (simplyfied)")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'Chinese (simplyfied)'"
+ endcatch
+ endcatch
+ Sleep 2
+ if Schluesseltyp1.GetSelText <> sKeyTypeSChinese then
+ warnlog "The default key type for Simplified Chinese should be: '" + sKeyTypeSChinese + "' but is '" + Schluesseltyp1.GetSelText + "'"
+ end if
+
+ try
+ Sprache.Select (sLanguageIDEnglishUSA)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'"
+ ' try fallback to 'English (USA)'
+ try
+ Sprache.Select ("English (USA)")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'English (USA)'"
+ endcatch
+ endcatch
+ try
+ Schluesseltyp1.Select sKeyTypeEnglishUSA
+ catch
+ qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'"
+ endcatch
+
+ '/// Check to traditional Chinese
+ try
+ Sprache.Select (sLanguageIDTChinese)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDTChinese + "'"
+ ' try fallback to 'Chinese (traditional)'
+ try
+ Sprache.Select ("Chinese (traditional)")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'Chinese (traditional)'"
+ endcatch
+ endcatch
+ Sleep 2
+ if Schluesseltyp1.GetSelText <> sKeyTypeTChinese then
+ warnlog "The default key type for traditional Chinese should be " + sKeyTypeTChinese + " but get " + Schluesseltyp1.GetSelText
+ end if
+
+ try
+ Sprache.Select (sLanguageIDEnglishUSA)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'"
+ ' try fallback to 'English (USA)'
+ try
+ Sprache.Select ("English (USA)")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'English (USA)'"
+ endcatch
+ endcatch
+ try
+ Schluesseltyp1.Select sKeyTypeEnglishUSA
+ catch
+ qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'"
+ endcatch
+
+ '/// Check to Japanese
+ try
+ Sprache.Select (sLanguageIDJapanese)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDJapanese + "'"
+ ' try fallback to 'Japanese'
+ try
+ Sprache.Select ("Japanese")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'Japanese'"
+ endcatch
+ endcatch
+ Sleep 2
+ if Schluesseltyp1.GetSelText <> sKeyTypeJapanese then
+ warnlog "The default key type for Japanese should be: '" + sKeyTypeJapanese + "' but is: '" + Schluesseltyp1.GetSelText + "'"
+ end if
+
+ try
+ Sprache.Select (sLanguageIDEnglishUSA)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDEnglishUSA + "'"
+ ' try fallback to 'English (USA)'
+ try
+ Sprache.Select ("English (USA)")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'English (USA)'"
+ endcatch
+ endcatch
+ try
+ Schluesseltyp1.Select sKeyTypeEnglishUSA
+ catch
+ qaErrorLog "Can't select: '" + sKeyTypeEnglishUSA + "'"
+ endcatch
+
+ '/// Check to Korean
+ try
+ Sprache.Select (sLanguageIDKoren)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDKoren + "'"
+ ' try fallback to 'Korean (RoK)'
+ try
+ Sprache.Select ("Korean (RoK)")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'Korean (RoK)'"
+ endcatch
+ endcatch
+ Sleep 2
+ if Schluesseltyp1.GetSelText <> sKeyTypeKoren then
+ warnlog "The default key type for Korean should be " + sKeyTypeKoren + " but get " + Schluesseltyp1.GetSelText
+ end if
+
+ Sortieren.Cancel
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tStrokeSort
+
+ Dim testFile as String
+ Dim sLanguageIDSChinese as String
+ Dim sKeyTypeSChinese as String
+ Dim aCorrectSequence() as String
+
+ Dim i , j as Integer
+
+ testFile = "sortTest.sxw"
+ aCorrectSequence = Array( "1" , "2" , "3" , "4" ,"5" )
+
+ j = UBound(aCorrectSequence)
+
+ select case iSprache
+ case 01 : ' English (USA)
+ sKeyTypeSChinese = "Stroke"
+ case 49 : ' German
+ sKeyTypeSChinese = "Stroke"
+ case 55 : ' Brazilian
+ sKeyTypeSChinese = "Traço"
+ case 81 : ' Japanese
+ sKeyTypeSChinese = "総画数"
+ case 86 : ' Chinese (simplified)
+ sKeyTypeSChinese = "笔画"
+ case 88 : ' Chinese (simplified)
+ sKeyTypeSChinese = "筆畫"
+ case else : ' Fallback
+ printLog "Now, the test does not support for the language " +iSprache
+ Goto endsub
+ end select
+
+ sLanguageIDSChinese = fGetCountryName(86)
+
+ '/// Check Stroke sort for Simplified Chinese
+
+ Call hNewDocument
+ '/// Open a test file and check <i>No Grid</i> checkbox
+ Call hFileOpen ( gTesttoolPath + "framework\optional\input\CJK\" + testFile )
+ sMakeReadOnlyDocumentEditable
+ EditSelectAll
+
+ '/// Open <i>Tools/Sort</i>
+ ToolsSort
+ Kontext "Sortieren"
+
+ '/// Choose language: Simplified Chinese and key type <i>Stroke</i>
+ try
+ Sprache.Select (sLanguageIDSChinese)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDSChinese + "'"
+ ' try fallback to 'Chinese (simplyfied)'
+ try
+ Sprache.Select ("Chinese (simplyfied)")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'Chinese (simplyfied)'"
+ endcatch
+ endcatch
+ try
+ Schluesseltyp1.Select sKeyTypeSChinese
+ catch
+ qaErrorLog "Can't select: '" + sKeyTypeSChinese + "'"
+ for i = 1 to Schluesseltyp1.getItemCount
+ printlog "" + i + ": '" + Schluesseltyp1.getItemText(i) + "'"
+ next i
+ endcatch
+
+ Sortieren.OK
+
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "<MOD1 Home>"
+
+ For i = 0 to j
+ DocumentWriter.TypeKeys "<End>"
+ DocumentWriter.TypeKeys "<Shift Left>"
+
+ EditCopy
+ if GetClipboardText <> aCorrectSequence(i) then Warnlog "The Stroke sort is wrong , should be " + aCorrectSequence(i) + " ,but get " +GetClipboardText
+
+ DocumentWriter.TypeKeys "<Down>"
+ next i
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tPinyinSort
+
+ Dim testFile as String
+ Dim sLanguageIDSChinese as String
+ Dim sKeyTypeSChinese as String
+ Dim aCorrectSequence() as String
+
+ Dim i , j as Integer
+
+ testFile = "sortTest.sxw"
+ aCorrectSequence = Array( "2" , "3" , "4" , "1" , "5" )
+
+ j = UBound(aCorrectSequence)
+
+ select case iSprache
+ case 01 : ' English (USA)
+ sKeyTypeSChinese = "Pinyin"
+ case 49 : ' German
+ sKeyTypeSChinese = "Pinyin"
+ case 55 : ' Brazilian
+ sKeyTypeSChinese = "Pinyin"
+ case 81 : ' Japanese
+ sKeyTypeSChinese = "ピンイン(中国語のローマ字表記法)"
+ case 86 : ' Chinese (simplified)
+ sKeyTypeSChinese = "拼音"
+ case 88 : ' Chinese (simplified)
+ sKeyTypeSChinese = "拼音"
+ case else : ' Fallback
+ printLog "Now, the test does not support for the language " +iSprache
+ Goto endsub
+ end select
+
+ sLanguageIDSChinese = fGetCountryName(86)
+
+ '/// Check <i>Pinyin</i> sort for Simplified Chinese
+
+ Call hNewDocument
+ '/// Open a test file and check <i>No Grid</i> checkbox
+ Call hFileOpen ( gTesttoolPath + "framework\optional\input\CJK\" + testFile )
+ sMakeReadOnlyDocumentEditable
+ EditSelectAll
+
+ '/// Open <i>Tools/Sort</i>
+ ToolsSort
+ Kontext "Sortieren"
+
+ '/// Choose language: Simplified Chinese and key type <i>Pin yin</i>
+ try
+ Sprache.Select (sLanguageIDSChinese)
+ catch
+ qaErrorLog "Can't select: '" + sLanguageIDSChinese + "'"
+ ' try fallback to 'Chinese (simplyfied)'
+ try
+ Sprache.Select ("Chinese (simplyfied)")
+ catch
+ qaErrorLog "Can't select even tha fallback: 'Chinese (simplyfied)'"
+ endcatch
+ endcatch
+ try
+ Schluesseltyp1.Select sKeyTypeSChinese
+ catch
+ qaErrorLog "Can't select: '" + sKeyTypeSChinese + "'"
+ for i = 1 to Schluesseltyp1.getItemCount
+ printlog "" + i + ": '" + Schluesseltyp1.getItemText(i) + "'"
+ next i
+ endcatch
+
+ Sortieren.OK
+
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "<MOD1 Home>"
+
+ For i = 0 to j
+ DocumentWriter.TypeKeys "<End>"
+ DocumentWriter.TypeKeys "<Shift Left>"
+
+ EditCopy
+ if GetClipboardText <> aCorrectSequence(i) then
+ Warnlog "The Pin yin sort is wrong, should be: '" + aCorrectSequence(i) + "' ,but is: '" +GetClipboardText + "'"
+ endif
+
+ DocumentWriter.TypeKeys "<Down>"
+ next i
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tSortOptionTest_1
+
+ Dim i , j as Integer
+ Dim asList() as String
+
+ select case iSprache
+ case 81 :' Japanese
+ if iSystemSprache <> 81 then goto NOTest
+ asList = Array( "Sun,Mon,Tue,Wed,Thu,Fri,Sat" , "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday" , "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec" , "January,February,March,April,May,June,July,August,September,October,November,December" , "日,月,火,水,木,金,土" , "日曜日,月曜日,火曜日,水曜日,木曜日,金曜日,土曜日" , )
+ case 82 :' Korean
+ if iSystemSprache <> 82 then goto NOTest
+ asList = Array( "일,월,화,수,목,금,토" ,"일요일,월요일,화요일,수요일,목요일,금요일,토요일" ,"1,2,3,4,5,6,7,8,9,10,11,12" , "日,月,火,水,木,金,土" , "日曜日,月曜日,火曜日,水曜日,木曜日,金曜日,土曜日" , )
+ case 86 :' Chinese (simplified)
+ if iSystemSprache <> 86 then goto NOTest
+ asList = Array( "日,一,二,三,四,五,六" , "星期日,星期一,星期二,星期三,星期四,星期五,星期六" , "一,二,三,四,五,六,七,八,九,十,十一,十二" , "一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月" , )
+ case 88 :' Chinese (traditional)
+ if iSystemSprache <> 88 then goto NOTest
+ asList = Array( "日,一,二,三,四,五,六" , "星期日,星期一,星期二,星期三,星期四,星期五,星期六" , "一,二,三,四,五,六,七,八,九,十,十一,十二" , "一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月" , )
+ case else :' Fallback
+ NOTest:
+ printLog "The test does not support for the language " +iSprache + " System language " + iSystemSprache
+ Goto endsub
+ end select
+
+ '/// Check if the entries in custom sort order is right in CJK version
+
+ call hNewDocument
+
+ '/// Open <i>Data/Sort</i> -&gt; tabpage <i>option</i>
+
+ DataSort
+
+ Kontext
+ active.SetPage TabSortierenOptionen
+ Kontext "TabSortierenOptionen"
+
+ BenutzerdefinierteSortierreihenfolge.Check
+
+ For i = 1 to SortierreihenfolgeListe.GetItemCount
+ if SortierreihenfolgeListe.GetItemText(i) <> asList(i-1) then
+ warnlog "Should get " +asList(i) + " but get " +SortierreihenfolgeListe.GetItemText(i)
+ end if
+ next i
+
+ TabSortierenOptionen.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'----------------------------------------------------------------
diff --git a/testautomation/framework/optional/includes/CJK_FeatureSwitchTest_1.inc b/testautomation/framework/optional/includes/CJK_FeatureSwitchTest_1.inc
new file mode 100644
index 000000000000..d144b7cdb88a
--- /dev/null
+++ b/testautomation/framework/optional/includes/CJK_FeatureSwitchTest_1.inc
@@ -0,0 +1,736 @@
+'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 : hercule.li@sun.com
+'*
+'* short description : CJK Feature Switch test
+'*
+'\***********************************************************************
+
+testcase tSwitchLocation
+ '/// Check if the switch "Asian Language support" exist -- tools/options/language settings/language
+ ToolsOptions
+
+ Call hToolsOptions("LANGUAGESETTINGS" , "LANGUAGES")
+
+ try
+ if Aktivieren.IsChecked = TRUE then
+ printLog "CJK language is checked"
+ else
+ printLog "CJK language isn't checked"
+ end if
+ catch
+ warnlog "Something wrong in checkbox 'Asian Language Support'"
+ endcatch
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tWriterUIChangesTest1
+ '/// Check if checkbox "Snap to text grid" is enable or not -- Format/Paragraph tabpage "Alignment"
+ call hNewDocument
+
+ '/// turn on "Asian Language support" , check if checkbox "Snap to text grid" is enable
+ Call CheckAsianLanguageSupport("On")
+
+ Kontext
+ FormatParagraph
+ Active.SetPage TabAusrichtungAbsatz
+ Kontext "TabAusrichtungAbsatz"
+
+ try
+ if TextrasterFangen.IsChecked = TRUE then
+ printLog "snap to text grid is checked"
+ else
+ printLog "snap to text grid isn't checked"
+ end if
+ catch
+ warnlog "Something wrong in checkbox 'snap to text grid'"
+ endcatch
+
+ TabAusrichtungAbsatz.Cancel
+
+ '/// turn off "Asian Language support" , check if checkbox "Snap to text grid" isn't enable
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+
+ Kontext
+ FormatParagraph
+ Active.SetPage TabAusrichtungAbsatz
+ Kontext "TabAusrichtungAbsatz"
+
+ try
+ if TextrasterFangen.IsChecked = TRUE Or TextrasterFangen.IsChecked <> TRUE then
+ warnlog "Something wrong in checkbox 'snap to text grid'"
+ end if
+ catch
+ endcatch
+
+ TabAusrichtungAbsatz.Cancel
+ end if
+
+ TabAusrichtungAbsatz.Cancel
+
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+
+ Kontext
+ FormatParagraph
+ Active.SetPage TabAusrichtungAbsatz
+ Kontext "TabAusrichtungAbsatz"
+
+ try
+ if TextrasterFangen.IsChecked = TRUE Or TextrasterFangen.IsChecked <> TRUE then
+ warnlog "Something wrong in checkbox 'snap to text grid'"
+ end if
+ catch
+ endcatch
+
+ TabAusrichtungAbsatz.Cancel
+ end if
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tWriterUIChangesTest2
+ '/// Check if tabpage "Asian Typography" appear or not -- Format/Paragraph
+ call hNewDocument
+
+ '/// turn on "Asian Language support" , check if tabpage "Asian Typography" appears
+ Call CheckAsianLanguageSupport("On")
+
+ Kontext
+ FormatParagraph
+
+ try
+ Active.SetPage TabAsianTypography
+ Kontext "TabAsianTypography"
+ TabAsianTypography.Cancel
+ catch
+ Active.SetPage TabAusrichtungAbsatz
+ Kontext "TabAusrichtungAbsatz"
+ TabAusrichtungAbsatz.Cancel
+ warnlog "Something wring in tabpage - Asian Typography!"
+ endcatch
+
+ '/// turn off "Asian Language support" , check if tabpage "Asian Typography" disappear
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+
+ Kontext
+ FormatParagraph
+
+ try
+ Active.SetPage TabAsianTypography
+ Kontext "TabAsianTypography"
+ TabAsianTypography.Cancel
+ warnlog "tabpage - Asian Typography should NOT appear!"
+ catch
+ Active.SetPage TabAusrichtungAbsatz
+ Kontext "TabAusrichtungAbsatz"
+ TabAusrichtungAbsatz.Cancel
+ endcatch
+ end if
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tWriterUIChangesTest3
+ '/// Check if list box "Asian text font" appear or not -- Format/Character
+ call hNewDocument
+
+ '/// turn on "Asian Language support" , Check if list box "Asian text font" appear
+ Call CheckAsianLanguageSupport("On")
+
+ Kontext
+ FormatCharacter
+ Kontext
+ active.SetPage TabFont
+ kontext "TabFont"
+ try
+ FontEast.Select 1
+ catch
+ warnlog "Something wrong in list box Asian text font when Asian Language support is on"
+ endcatch
+ TabFont.Cancel
+
+ '/// turn off "Asian Language support" , Check if list box "Asian text font" disappear
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+
+ Kontext
+ FormatCharacter
+ Kontext
+ active.SetPage TabFont
+ kontext "TabFont"
+ try
+ FontEast.Select 1
+ warnlog "Something wrong in list box Asian text font when Asian Language support is off"
+ catch
+ endcatch
+ TabFont.Cancel
+ end if
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tWriterUIChangesTest4
+ '/// Check if list box "Emphasis mark" appear or not -- Format/Character
+ call hNewDocument
+
+ '/// turn on "Asian Language support" , Check if list box "Emphasis mark" appear
+ Call CheckAsianLanguageSupport("On")
+
+ Kontext
+ FormatCharacter
+ Kontext
+ active.SetPage TabFontEffects
+ kontext "TabFontEffects"
+ try
+ Emphasis.Select 1
+ catch
+ warnlog "Something wrong in list box Emphasis mark when Asian Language support is on"
+ endcatch
+ TabFontEffects.Cancel
+
+ '/// turn off "Asian Language support" , Check if list box "Emphasis mark" disappear
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+
+ Kontext
+ FormatCharacter
+ Kontext
+ active.SetPage TabFontEffects
+ kontext "TabFontEffects"
+ try
+ Emphasis.Select 1
+ warnlog "Something wrong in list box Emphasis mark when Asian Language support is off"
+ catch
+ endcatch
+ TabFontEffects.Cancel
+ end if
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tWriterUIChangesTest5
+ '/// Check if tabpage "Searching in Japanese" appear or not -- tools/options/language settings/
+ call hNewDocument
+
+ '/// turn on "Asian Language support" , Check if tabpage "Searching in Japanese" appear
+ Call CheckAsianLanguageSupport("On")
+
+ ToolsOptions
+ if hToolsOptions("LANGUAGESETTINGS","SEARCHINGINJAPANESE") <> TRUE then
+ warnlog "Something wrong in tabpage Searching in Japanese when Asian Language support is on"
+ end if
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.Cancel
+
+ '/// turn on "Asian Language support" , Check if tabpage "Searching in Japanese" disappear
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+ ToolsOptions
+
+ if hToolsOptions("LANGUAGESETTINGS","SEARCHINGINJAPANESE" , TRUE) = FALSE then
+ printLog Chr(13) & "Yes, 'Searching Japanese'-page has been disabled after switching Asian Language Support 'off'."
+ else
+ warnlog "Something wrong in tabpage Searching in Japanese when Asian Language support is off"
+ end if
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.Cancel
+ end if
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tWriterUIChangesTest6
+ '/// Check if tabpage "Asian Layout" appear or not -- tools/options/language settings/
+ call hNewDocument
+
+ '/// turn on "Asian Language support" , Check if tabpage "Asian Layout" appear
+ Call CheckAsianLanguageSupport("On")
+
+ ToolsOptions
+ if hToolsOptions("LANGUAGESETTINGS","ASIANLAYOUT") <> TRUE then
+ warnlog "Something wrong in tabpage Asian Layout when Asian Language support is on"
+ end if
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.Cancel
+
+ '/// turn off "Asian Language support" , Check if tabpage "Asian Layout" disappear
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+ ToolsOptions
+
+ if hToolsOptions("LANGUAGESETTINGS","ASIANLAYOUT", TRUE) = FALSE then
+ printLog Chr(13) & "Yes, 'Asian Layout'-page has been disabled after switching 'Asian Language Support' off."
+ else
+ warnlog "Something wrong in tabpage Asian Layout when Asian Language support is off"
+ end if
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.Cancel
+ end if
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tWriterUIChangesTest7
+ '/// Check if menu format/Ruby is active or not
+ call hNewDocument
+
+ '/// turn on "Asian Language support" , Check if menu format/Ruby is actived
+ Call CheckAsianLanguageSupport("On")
+
+ try
+ formatRuby
+ Kontext "RubyDialog"
+ DialogClose.Click
+ Sleep 2
+ catch
+ warnlog "Something wrong in menu format/Ruby when Asian Language support is on"
+ endcatch
+
+ '/// turn off "Asian Language support" , Check if menu format/Ruby is inactived
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+
+ try
+ formatRuby
+ Kontext "RubyDialog"
+ DialogClose.Click
+ Sleep 2
+ QAErrorlog "#i40913# Something wrong in menu format/Ruby when Asian Language support is off"
+ catch
+ endcatch
+ end if
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tWriterUIChangesTest8
+ '/// Check if the following submenus in format/change case is active or not
+ '/// - Half width
+ '/// - Full width
+ '/// - Hiragana
+ '/// - Katagana
+
+ call hNewDocument
+
+ '/// turn on "Asian Language support" , Check if submenus in format/change case is actived
+ Call CheckAsianLanguageSupport("On")
+
+ try
+ FormatChangeCaseHalfWidth
+ catch
+ warnlog "Something wrong in submenu format/change case -> Half width when Asian Language support is on"
+ endcatch
+
+ try
+ FormatChangeCaseFullWidth
+ catch
+ warnlog "Something wrong in submenu format/change case -> Full width when Asian Language support is on"
+ endcatch
+
+ try
+ FormatChangeCaseHiragana
+ catch
+ warnlog "Something wrong in submenu format/change case -> Hiragana when Asian Language support is on"
+ endcatch
+
+ try
+ FormatChangeCaseKatagana
+ catch
+ warnlog "Something wrong in submenu format/change case -> Katagana when Asian Language support is on"
+ endcatch
+
+ '/// turn off "Asian Language support" , Check if submenus in format/change case is inactived
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+
+ try
+ FormatChangeCaseHalfWidth
+ QAErrorlog "#i43434# Something wrong in submenu format/change case -> Half width when Asian Language support is off"
+ catch
+ endcatch
+
+ try
+ FormatChangeCaseFullWidth
+ QAErrorlog "#i43434# Something wrong in submenu format/change case -> Full width when Asian Language support is off"
+ catch
+ endcatch
+
+ try
+ FormatChangeCaseHiragana
+ QAErrorlog "#i43434# Something wrong in submenu format/change case -> Hiragana when Asian Language support is off"
+ catch
+ endcatch
+
+ try
+ FormatChangeCaseKatagana
+ QAErrorlog "#i43434# Something wrong in submenu format/change case -> Katagana when Asian Language support is off"
+ catch
+ endcatch
+ end if
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tWriterUIChangesTest9
+ call hNewDocument
+
+ '/// turn on "Asian Language support" , Check if list box text direction appear
+ Call CheckAsianLanguageSupport("On")
+
+ FormatPageWriter
+ Kontext
+ Active.SetPage TabSeite
+ Kontext "TabSeite"
+
+ try
+ Textfluss.select 1
+ catch
+ warnlog "Something wrong in list box text direction when Asian Language support is on"
+ endcatch
+ TabSeite.Cancel
+
+ '/// turn off "Asian Language support" , Check if list box text direction disappear
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+
+ FormatPageWriter
+ Kontext
+ Active.SetPage TabSeite
+ Kontext "TabSeite"
+
+ try
+ Textfluss.select 1
+ warnlog "Something wrong in list box text direction when Asian Language support is off"
+ catch
+ endcatch
+ TabSeite.Cancel
+ end if
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tWriterUIChangesTest10
+
+ '/// Check if vertical text box and callout appear or not
+ call hNewDocument
+
+ '/// turn on "Asian Language support" , Check if vertical text box and callout appear
+ Call CheckAsianLanguageSupport("On")
+ sleep(1)
+
+ Call hToolbarSelect("DRAWING", true)
+ try
+ VerticalText.Click
+ catch
+ warnlog "Something wrong in vertical text box when Asian Language support is on"
+ endcatch
+ try
+ VerticalCallout.Click
+ catch
+ warnlog "Something wrong in vertical text callout when Asian Language support is on"
+ endcatch
+
+ '/// turn off "Asian Language support" , Check if vertical text box and callout disappear
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+ Kontext "Drawbar"
+ try
+ VerticalText.Click
+ warnlog "Something wrong in vertical text box when Asian Language support is off"
+ catch
+ endcatch
+ try
+ VerticalCallout.Click
+ warnlog "Something wrong in vertical text callout when Asian Language support is off"
+ catch
+ endcatch
+ end if
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tWriterUIChangesTest11
+ Dim iHopeNumber1 , iHopeNumber2 as Integer
+ dim i as integer
+ dim iCount as integer
+
+ iHopeNumber1 = 38
+ iHopeNumber2 = 19
+
+ '/// Check if the number in listbox numbering is right or not.
+ '/// [if the number of the listbox numbering is changed, this case should be modified according]
+
+ call hNewDocument
+
+ '/// turn on "Asian Language support" , Check if the number in listbox numbering is right
+ Call CheckAsianLanguageSupport("On")
+
+ FormatNumberingBullets
+ Kontext
+ Active.SetPage TabOptionenNumerierung
+ Kontext "TabOptionenNumerierung"
+
+ iCount = Numerierung.GetItemCount
+ if iCount = iHopeNumber1 then
+ Numerierung.Select 15
+ TabOptionenNumerierung.OK
+
+ printLog Chr(13) & "Pls. go to the printer to find if you can get a paper"
+ printLog Chr(13) & "which is printed like '-'.Otherwise , something wrong!"
+ '/// --Pls. go to the printer to find if you can get a paper which is printed like '-'. Otherwise , something is wrong!
+
+ FilePrint
+ Kontext "Active"
+ if Active.Exists( 1 ) then
+ if Active.GetRT = 304 then
+ Active.Ok
+ QAErrorLog "No Default-Printer!"
+ Kontext "Printing"
+ if ( Printing.exists( 1 ) ) then
+ Printing.cancel()
+ endif
+ end if
+ else
+ Kontext "Printing"
+ if ( Printing.exists( 2 ) ) then
+ Printing.cancel()
+ Printing.notExists( 5 )
+ endif
+ endif
+ else
+ for i =1 to iCount
+ printlog "(" & i & "/" & iCount & "): " & Numerierung.getItemText(i)
+ next i
+ 'Referenze:
+ TabOptionenNumerierung.Cancel
+ qaerrorlog "the number of list box numbering is wrong when Asian Language support is on; expected: " + iHopeNumber1 + "; is: " + iCount
+ end if
+
+ 'print warning if no printer is available
+ kontext
+ if active.exists(5) then
+ qaErrorlog "print warning: '" + active.getText + "'"
+ active.ok
+ endif
+
+ 'print warning if no printer is available
+ kontext
+ if active.exists(5) then
+ qaErrorlog "print warning: '" & active.getText & "'"
+ active.ok
+ endif
+
+ '/// turn off "Asian Language support" , Check if the number in listbox numbering is right
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+
+ FormatNumberingBullets
+ Kontext
+ Active.SetPage TabOptionenNumerierung
+ Kontext "TabOptionenNumerierung"
+
+ iCount = Numerierung.GetItemCount
+ if iCount <> iHopeNumber2 then
+ for i =1 to iCount
+ printlog "(" & i & "/" & iCount & "): " & Numerierung.getItemText(i)
+ next i
+ 'Referenze:
+ warnlog "the number of list box numbering is wrong when Asian Language support is off; expected: " & iHopeNumber2 & "; is: " & iCount
+ end if
+ TabOptionenNumerierung.Cancel
+ end if
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tProlongedVowelsTest1
+ '/// Check if the default setting of "Prolonged vowels (ka-/kaa) will be ACTIVATED.
+
+ call hNewDocument
+
+ '/// turn on "Asian Language support" , Check if the default setting of "Prolonged vowels (ka-/kaa) is ACTIVATED.
+ Call CheckAsianLanguageSupport("On")
+
+ ToolsOptions
+ Call hToolsOptions("LANGUAGESETTINGS","SEARCHINGINJAPANESE")
+
+ if ProlongedSoundmarks.IsChecked <> TRUE then
+ warnlog "The default setting of 'Prolonged vowels (ka-/kaa)' isn't ACTIVATED."
+ end if
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tCalcUIChangesTest_10
+
+ '/// Check if vertical text box and callout appear or not
+
+ call hNewDocument
+
+ '/// turn on "Asian Language support" , Check if vertical text box and callout appear
+ Call CheckAsianLanguageSupport("On")
+ sleep(1)
+ Call hToolbarSelect("DRAWING", true)
+ try
+ VerticalText.Click
+ catch
+ warnlog "Something wrong in vertical text box when Asian Language support is on"
+ endcatch
+ try
+ VerticalCallout.Click
+ catch
+ warnlog "Something wrong in vertical text callout when Asian Language support is on"
+ endcatch
+
+ '/// turn off "Asian Language support" , Check if vertical text box and callout disappear
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+ Kontext "Drawbar"
+ try
+ VerticalText.Click
+ warnlog "Something wrong in vertical text box when Asian Language support is off"
+ catch
+ endcatch
+ try
+ VerticalCallout.Click
+ warnlog "Something wrong in vertical text callout when Asian Language support is off"
+ catch
+ endcatch
+ end if
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tImpressUIChangesTest_10
+
+ '/// Check if vertical text box and callout and fit vertical text to frame appear or not
+ call hNewDocument
+
+ '/// turn on "Asian Language support" , Check if vertical text box appear
+ Call CheckAsianLanguageSupport("On")
+ sleep(1)
+ Kontext "Drawbar"
+ sleep(1)
+ try
+ VerticalText.Click
+ catch
+ warnlog "Something wrong in vertical text box when Asian Language support is on"
+ endcatch
+
+ '/// turn off "Asian Language support" , Check if vertical text box disappear
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+ sleep(1)
+ Kontext "Drawbar"
+ try
+ VerticalText.Click
+ warnlog "Something wrong in vertical text box when Asian Language support is off"
+ catch
+ endcatch
+ end if
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tDrawUIChangesTest_10
+
+ '/// Check if vertical text box and callout and fit vertical text to frame appear or not
+ call hNewDocument
+
+ '/// turn on "Asian Language support" , Check if vertical text box appear
+ Call CheckAsianLanguageSupport("On")
+ Kontext "Drawbar"
+ sleep(1)
+ try
+ VerticalText.Click
+ catch
+ warnlog "Something wrong in vertical text box when Asian Language support is on"
+ endcatch
+
+ '/// turn off "Asian Language support" , Check if vertical text box disappear
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+ Kontext "Drawbar"
+ try
+ VerticalText.Click
+ warnlog "Something wrong in vertical text box when Asian Language support is off"
+ catch
+ endcatch
+ end if
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
diff --git a/testautomation/framework/optional/includes/CJK_RubyDialogueProposal_1.inc b/testautomation/framework/optional/includes/CJK_RubyDialogueProposal_1.inc
new file mode 100644
index 000000000000..39c42fe75b8e
--- /dev/null
+++ b/testautomation/framework/optional/includes/CJK_RubyDialogueProposal_1.inc
@@ -0,0 +1,389 @@
+'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 : CJK Ruby Dialogue Proposal Test
+'*
+'\***********************************************************************
+
+testcase tRubyDialog_1
+
+ Dim sBaseText , sRubyText as String
+ Dim sBaseText1 , sRubyText1 as String
+
+ sBaseText = "BaseText"
+ sRubyText = "RubyText"
+
+ sBaseText1 = "BaseText1"
+ sRubyText1 = "RubyText1"
+
+ '/// Check Apply and Close button in Ruby dialogue
+ Call hNewDocument
+
+ '/// Check close button.
+ '/// open ruby dialogue , input base text and ruby text , then press close button
+ '/// 1) check if the ruby dialogue is closed
+ '/// 2) check if the base text and ruby text is recorded
+ FormatRuby
+ Kontext "RubyDialog"
+ Sleep 3
+ BasisText1.SetText sBaseText
+ Sleep 1
+ RubyText1.SetText sRubyText
+ Sleep 1
+
+ DialogClose.Click
+ Sleep 1
+
+ if RubyDialog.Exists then
+ Warnlog "The Ruby dialogue is NOT closed !"
+ end if
+
+ FormatRuby
+ Kontext "RubyDialog"
+ Sleep 3
+ if Len(BasisText1.GetText) <> 0 then Warnlog "The base text should not been inputed"
+ if Len(RubyText1.SetText) <> 0 then Warnlog "The ruby text should not been inputed"
+
+ '/// Check Apply button -- Normally , we think it is RubyDialog.OK
+ '/// open ruby dialogue , input base text and ruby text , then press close button
+ '/// Press Apply button , then press close button
+ '/// check if the base text and ruby text is recorded
+
+ BasisText1.SetText sBaseText1
+ Sleep 1
+ RubyText1.SetText sRubyText1
+ Sleep 1
+
+ RubyDialog.OK
+ Sleep 2
+
+ DialogClose.Click
+ Sleep 1
+
+ EditSelectAll
+ Sleep 1
+
+ FormatRuby
+ Kontext "RubyDialog"
+ Sleep 3
+ if BasisText1.GetText <> sBaseText1 then Warnlog "The base text should be "+sBaseText1 + " but get " + BasisText1.GetText
+ if RubyText1.GetText <> sRubyText1 then Warnlog "The ruby text should be "+sRubyText1 + " but get " + RubyText1.GetText
+
+ DialogClose.Click
+ Sleep 1
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tRubyDialog_2
+
+ Dim sBaseText as String
+
+ sBaseText = "test1 test2 test3 test4 test5 test6 test7 test8 test9"
+ '/// Test scrollbar in Ruby dialog
+
+ Call hNewDocument
+
+ '/// when there is less basetext, the scrollbar should appear
+ FormatRuby
+ Kontext "RubyDialog"
+ if RubyDialog.HasScrollbar <> TRUE then warnlog "The Scrollbar should appear when less basetext!"
+ DialogClose.Click
+ Sleep 1
+
+ '/// when there is more basetext(here is >4), the scrollbar should appear
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys sBaseText
+ DocumentWriter.TypeKeys "<Shift Home>"
+
+ FormatRuby
+ Kontext "RubyDialog"
+ if RubyDialog.HasScrollbar <> TRUE then warnlog "The Scrollbar should appear when more basetext!"
+ DialogClose.Click
+ Sleep 1
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+testcase tRubyDialog_3
+
+ Dim sTestText as String
+ Dim sBaseText1, sBaseText2 as String
+
+ sTestText = "Test1 Test2"
+ sBaseText1 = "Test1"
+ sBaseText2 = "Test2"
+
+ '/// The list in ruby dialogure will be updated as soon as the uses
+ '/// selects new or further words of his text.
+ '/// The update will be done once the user changes his focus
+ '/// back to the Ruby-Dialogue from the text
+
+ Call hNewDocument
+
+ '/// input 2 test words, and mark the second
+ DocumentWriter.TypeKeys sTestText
+ DocumentWriter.TypeKeys "<Shift Left>" , 5
+
+ '/// There should be only the second test word in basetext1 in ruby dialogue
+ FormatRuby
+ Kontext "RubyDialog"
+ Sleep 2
+ if BasisText1.GetText <> sBaseText2 then warnlog "The BaseText1 should be:" +sBaseText2 + " but get "+BasisText1.GetText
+
+ '/// Mark 2 test words
+ Kontext "DocumentWriter"
+ try
+ DocumentWriter.TypeKeys "<Shift Home>"
+ Sleep 2
+ catch
+ warnlog "The ruby dialogue is MODE less dialogue , the document can be edited!"
+ endcatch
+
+ '/// Check if the 2 test words are all in the ruby dialogue when set forcus back to the dialogue
+ Kontext "RubyDialog"
+ Sleep 1
+ 'this step is meaningless, just let the focus back to ruby dialogue
+ Adjust.Select 1
+ Sleep 8
+ if BasisText1.GetText <> sBaseText1 then warnlog "The BaseText1 should be:" +sBaseText1 + " but get "+BasisText1.GetText
+ Sleep 1
+ if BasisText2.GetText <> sBaseText2 then warnlog "The BaseText2 should be:" +sBaseText2 + " but get "+BasisText2.GetText
+
+ DialogClose.Click
+ Sleep 1
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tRubyDialog_4
+
+ Dim sCharacterStyle as String
+ dim i as integer
+
+ '/// Check default setting for Character Style of Ruby Text
+
+ select case iSprache
+ case 01 : sCharacterStyle = "Rubies"
+ case 33 : sCharacterStyle = "Rubys"
+ case 34 : sCharacterStyle = "Rubys"
+ case 39 : sCharacterStyle = "Testo Ruby"
+ case 46 : sCharacterStyle = "Rubytext"
+ case 49 : sCharacterStyle = "Rubys"
+ case 55 : sCharacterStyle = "Rubys"
+ case 81 : sCharacterStyle = "ふりがな"
+ case 82 : sCharacterStyle = "윗주 달기" ' not sure TBO
+ case 86 : sCharacterStyle = "拼音和注音符号"
+ case 88 : sCharacterStyle = "注音符號"
+ case else :' QAErrorLog "Now, the test does not support for the language " +iSprache
+ Goto endsub
+ end select
+
+ Call hNewDocument
+
+ FormatRuby
+ Kontext "RubyDialog"
+ Sleep 3
+ if CharacterStyle.GetSelText <> sCharacterStyle then
+ warnlog "Default setting for Character Style of Ruby Text isn't right, should be "+sCharacterStyle + " but get "+CharacterStyle.GetSelText
+ for i = 1 to CharacterStyle.getItemCount
+ printlog "("+i+"/"+CharacterStyle.getItemCount+"): '"+CharacterStyle.getItemText(i)+"'"
+ next i
+ endif
+ DialogClose.Click
+ Sleep 1
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tRubyDialog_5
+
+ Dim sCharacterStyle as String
+ Dim sStyleName as String
+ Dim i as Integer
+ dim iCount as integer
+ dim bError as boolean
+ dim bWileExit as boolean
+
+ '/// Check stylist
+
+ select case iSprache
+ case 01 : sCharacterStyle = "Rubies"
+ case 33 : sCharacterStyle = "Rubys"
+ case 34 : sCharacterStyle = "Rubys"
+ case 39 : sCharacterStyle = "Testo Ruby"
+ case 46 : sCharacterStyle = "Rubytext"
+ case 49 : sCharacterStyle = "Rubys"
+ case 55 : sCharacterStyle = "Rubys"
+ case 81 : sCharacterStyle = "ふりがな"
+ case 82 : sCharacterStyle = "윗주 달기" ' not sure TBO was "덧말"
+ case 86 : sCharacterStyle = "拼音和注音符号"
+ case 88 : sCharacterStyle = "注音符號"
+ case else :' QAErrorLog "Now, the test does not support for the language " +iSprache
+ Goto endsub
+ end select
+
+ sStyleName = "ZZZ-Test-ZZZ"
+
+ Call hNewDocument
+
+ '/// Open ruby dialogue
+ FormatRuby
+ Kontext "RubyDialog"
+
+ '/// Click stylist button
+ CallStylist.Click
+ Sleep 2
+
+ Kontext "Stylist"
+ if Stylist.NotExists then
+ Warnlog "No Stylist with clicking Stylist button!"
+ end if
+
+ '/// click Character Style
+ Zeichenvorlagen.Click
+
+ ' needed to update the listbox count :-(
+ Vorlagenliste.typeKeys ("<end><up><down>")
+ iCount = Vorlagenliste.getItemCount
+ printlog iCount
+ i=1
+ bWileExit = Vorlagenliste.getItemText (i) <> sCharacterStyle
+ while ((i<iCount+1) AND (bWileExit))
+ printlog "" + (i) + ": " + Vorlagenliste.getItemText (i)
+ bWileExit = Vorlagenliste.getItemText (i) <> sCharacterStyle
+ inc (i)
+ wEnd
+ if (i = iCount+1) then
+ warnlog "Style (Rubies) not found: '" + sCharacterStyle + "' inside of entries: " + iCount
+ bError = true
+ else
+ printlog "Style (Rubies) found: '" + sCharacterStyle + "' @ position: ("+(i)+"/"+icount+")"
+ Vorlagenliste.select (i)
+ bError = false
+ endif
+
+ if (NOT bError) then
+ '/// find entry ruby and add a new entry
+ AusSelektion.OpenMenu
+ Sleep 1
+ printlog "hMenuSelect 1"
+ hMenuSelectNr(1)
+ printlog "hMenuSelect 1 survived"
+ Sleep 1
+
+ Kontext "VorlageErzeugen"
+ Sleep 1
+ Vorlagenname.SetText sStyleName
+ Sleep 1
+ VorlageErzeugen.OK
+ Sleep 2
+
+ '/// check if the new entry is in the Character Style list box in ruby dialogue
+ Kontext "RubyDialog"
+
+ ' needed to update the listbox count :-(
+ CharacterStyle.typeKeys ("<end><up><down>")
+ iCount = CharacterStyle.GetItemCount
+ i=0
+ bWileExit = true
+ while ((i<(iCount+1)) AND (bWileExit))
+ bWileExit = CharacterStyle.getItemText (i+1) <> sStyleName
+ inc (i)
+ printlog "" + (i) + ": " + CharacterStyle.getItemText (i)
+ wEnd
+ printlog CharacterStyle.GetItemCount
+ if ((i = iCount) AND bWileExit) then
+ warnlog "New created entry not found: '" + sStyleName + "' inside of entries: " + iCount
+ bError = true
+ else
+ printlog "New created entry found: '" + sStyleName + "' @ position: ("+(i)+"/"+icount+")"
+ CharacterStyle.select (i)
+ bError = false
+ endif
+
+ if (NOT bError) then
+ Kontext "Stylist"
+ iCount = Vorlagenliste.getItemCount
+ i=0
+ while ((i<iCount) AND (Vorlagenliste.getItemText (i+1) <> sStyleName))
+ inc (i)
+ printlog "" + (i) + ": " + Vorlagenliste.getItemText (i)
+ wEnd
+ if (i = iCount) then
+ warnlog "Style (Rubies) not found for deleting: '" + sStyleName + "' inside of entries: " + iCount
+ bError = true
+ else
+ printlog "Style (Rubies) found, will delete it now: '" + sStyleName + "' @ position: ("+i+"/"+icount+")"
+ Vorlagenliste.select (i+1)
+ bError = false
+ iCount = Vorlagenliste.getItemCount
+ Vorlagenliste.TypeKeys "<Delete>"
+ sleep(1)
+ Kontext "Active"
+ if active.exists(5) then
+ printlog "active about deleting; say yes to: '" + active.getText + "'"
+ Active.Yes
+ else
+ warnlog "No warning, before deleting style."
+ endif
+ sleep 1
+ Kontext "Stylist"
+ i = Vorlagenliste.getItemCount
+ if ( (iCount-1) <> i) then
+ warnlog "Style wasn't deleted; count is still the same: " + i + "/" + iCount
+ else
+ printlog "Style was deleted; Count is OK: " + i + "/" + iCount
+ endif
+ endif
+ endif
+ endif
+
+ Kontext "Stylist"
+ Stylist.Close
+ Sleep 1
+ Kontext "RubyDialog"
+ DialogClose.Click
+ Sleep 1
+
+ Call hCloseDocument
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/NewSortingAlgorithmForJapanese_1.inc b/testautomation/framework/optional/includes/NewSortingAlgorithmForJapanese_1.inc
new file mode 100644
index 000000000000..e20124b78b93
--- /dev/null
+++ b/testautomation/framework/optional/includes/NewSortingAlgorithmForJapanese_1.inc
@@ -0,0 +1,227 @@
+'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 : hercule.li@sun.com
+'*
+'* short description : New Sorting Algorithm For Japanese Test
+'*
+'\***********************************************************************
+
+testcase NewSortingForJapanese_1
+
+ call hNewDocument
+
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+ Sleep 1
+
+ Kontext
+ Sleep 3
+ InsertIndexesEntry
+ Sleep 2
+ Kontext "VerzeichniseintragEinfuegen"
+ Sleep 1
+ Verzeichniseintrag.SetText "test"
+ if EntryPhoneticReading.IsVisible = TRUE then warnlog "The Entry Phonetic Reading editbox should NOT be visible!"
+ VerzeichniseintragEinfuegen.Close
+ end if
+
+ Call CheckAsianLanguageSupport("On")
+
+ Kontext
+ Sleep 3
+ InsertIndexesEntry
+ Sleep 2
+ Kontext "VerzeichniseintragEinfuegen"
+ Sleep 1
+ Verzeichniseintrag.SetText "test"
+ if EntryPhoneticReading.IsVisible <> TRUE then warnlog "The Entry Phonetic Reading editbox should be visible!"
+ VerzeichniseintragEinfuegen.Close
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase NewSortingForJapanese_2
+
+ call hNewDocument
+
+ InsertIndexesEntry
+ Sleep 3
+ Kontext "VerzeichniseintragEinfuegen"
+ Sleep 2
+ if EntryPhoneticReading.IsEnabled = TRUE then warnlog "The Entry Phonetic Reading editbox should NOT be enabled!"
+
+ Verzeichniseintrag.SetText "test"
+
+ if EntryPhoneticReading.IsEnabled <> TRUE then warnlog "The Entry Phonetic Reading editbox should be enabled!"
+ VerzeichniseintragEinfuegen.Close
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase NewSortingForJapanese_3
+
+ Dim iTypeList , iNumberOfKeyType as Integer
+ Dim sJapaneseLocation as String
+ Dim i as integer
+
+ iTypeList = 2
+ iNumberOfKeyType = 4
+ sJapaneseLocation = fGetCountryName(81)
+
+ if Len(sJapaneseLocation) = 0 then Goto endsub
+
+ call hNewDocument
+
+ InsertIndexes
+ Kontext
+ Active.SetPage TabVerzeichnisseVerzeichnis
+ Kontext "TabVerzeichnisseVerzeichnis"
+
+ VerzeichnisTyp.Select iTypeList
+ try
+ SortLanguage.Select (sJapaneseLocation)
+ catch
+ qaErrorLog "Entry not found: '" + sJapaneseLocation + "' trying english entry: 'Japanese'"
+ try
+ SortLanguage.Select ("Japanese")
+ catch
+ warnlog "'Japanese' isn't available either"
+ for i = 1 to SortLanguage.getItemCount
+ printlog "" + i + ": '" + SortLanguage.getItemText(i) + "'"
+ next i
+ endcatch
+ endcatch
+ Sleep 1
+
+ if SortKeyType.GetItemCount <> iNumberOfKeyType then
+ warnlog "The number of key type is wrong, hope :" +iNumberOfKeyType + " but get:" +SortKeyType.GetItemCount
+ end if
+try
+ TabVerzeichnisseVerzeichnis.Cancel
+catch
+warnlog "#135631# crash on canceling Insert Indexes and Tables"
+endcatch
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase NewSortingForJapanese_4
+
+ Dim iNumberOfKeyType as Integer
+ Dim sJapaneseLocation as String
+
+ iNumberOfKeyType = 4
+ sJapaneseLocation = fGetCountryName(81)
+
+ if Len(sJapaneseLocation) = 0 then Goto endsub
+
+ call hNewDocument
+ DocumentWriter.TypeKeys "test"
+ DocumentWriter.TypeKeys "<Shift Home>"
+
+ ToolsSort
+ Kontext "Sortieren"
+
+ try
+ Sprache.Select sJapaneseLocation
+ catch
+ qaErrorLog "Entry not found: '" + sJapaneseLocation + "' trying english entry: 'Japanese'"
+ try
+ Sprache.Select ("Japanese")
+ catch
+ warnlog "'Japanese' isn't available either"
+ for i = 1 to Sprache.getItemCount
+ printlog "" + i + ": '" + Sprache.getItemText(i) + "'"
+ next i
+ endcatch
+ endcatch
+ Sleep 1
+
+ if Schluesseltyp1.GetItemCount <> iNumberOfKeyType then
+ warnlog "The number of key type is wrong, hope :" +iNumberOfKeyType + " but get:" +Schluesseltyp1.GetItemCount
+ end if
+
+ Sortieren.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase NewSortingForJapanese_5
+
+ Dim iNumberOfOption as Integer
+ Dim sJapaneseLocation as String
+
+ iNumberOfOption = 3
+ sJapaneseLocation = fGetCountryName(81)
+
+ if Len(sJapaneseLocation) = 0 then Goto endsub
+
+ call hNewDocument
+
+ DataSort
+ Kontext
+ active.SetPage TabSortierenOptionen
+ Kontext "TabSortierenOptionen"
+
+ try
+ Sprache.Select sJapaneseLocation
+ catch
+ qaErrorLog "Entry not found: '" + sJapaneseLocation + "' trying english entry: 'Japanese'"
+ try
+ Sprache.Select ("Japanese")
+ catch
+ warnlog "'Japanese' isn't available either"
+ for i = 1 to Sprache.getItemCount
+ printlog "" + i + ": '" + Sprache.getItemText(i) + "'"
+ next i
+ endcatch
+ endcatch
+ Sleep 1
+
+ if Optionen.GetItemCount <> iNumberOfOption then
+ warnlog "The number of option is wrong, hope :" +iNumberOfOption + " but get:" +Optionen.GetItemCount
+ end if
+
+ TabSortierenOptionen.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
diff --git a/testautomation/framework/optional/includes/basic_delete_modules.inc b/testautomation/framework/optional/includes/basic_delete_modules.inc
new file mode 100644
index 000000000000..b5c1f12a101d
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_delete_modules.inc
@@ -0,0 +1,105 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Delete modules while BASIC is running
+'*
+'\******************************************************************************
+
+testcase tDeleteModulesAtRunningBasic
+
+ printlog( "Delete BASIC module while BASIC is running" )
+
+ dim brc as boolean
+ const MAX_WAIT = 3000
+
+
+ printlog( "Open a new writer-doc" )
+ gApplication = "WRITER"
+
+ Call hNewDocument()
+
+ printlog( "Create a new module " )
+ brc = hOpenBasicOrganizerFromDoc()
+ if ( not brc ) then
+ warnlog( "Unable to open BASIC organizer for the document" )
+ goto endsub
+ endif
+
+ brc = hCreateModuleForDoc()
+ if ( not brc ) then
+ warnlog( "Unable to create a basic module for the document" )
+ goto endsub
+ endif
+
+ printlog( "Insert a short script (1. page)" )
+ brc = hInsertMacro( 1 )
+ if ( not brc ) then
+ warnlog( "Unable to create a basic module for the document" )
+ goto endsub
+ endif
+
+ kontext "macrobar"
+ printlog( "Click button: Step Procedure" )
+ ProcedureStep.Click()
+ if ( WaitSlot( MAX_WAIT ) <> WSFinished ) then
+ warnlog( "Slot not finished, timeout reached" )
+ endif
+
+ kontext "basicide"
+ printlog( "Check if disabled menu items are shown in context menu and 'delete' is not shown" )
+ Tabbar.OpenContextMenu()
+
+ try
+ if ( hMenuItemGetCount() = 5 ) then
+ warnlog( "#i101972# - Disabled entries are shown in context menu on tab bar" )
+ end if
+
+
+ if ( hMenuItemGetCount() = 3 ) then
+ warnlog( "Delete is active in context menu for a running macro => BUG!" )
+ end if
+
+ catch
+ warnlog( "Unable to retrieve the number of menuitems" )
+ endcatch
+
+ hMenuClose()
+ printlog( "Stop the running script" )
+
+ kontext "macrobar"
+ BasicStop.Click()
+ if ( WaitSlot( MAX_WAIT ) <> WSFinished ) then
+ warnlog( "Slot not finished, timeout reached" )
+ endif
+
+ Call hCloseDocument()
+ Call hCloseDocument()
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/basic_dialog_i18n_copy_control.inc b/testautomation/framework/optional/includes/basic_dialog_i18n_copy_control.inc
new file mode 100644
index 000000000000..1a47c8296588
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_dialog_i18n_copy_control.inc
@@ -0,0 +1,202 @@
+'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 : Joerg.Skottke@Sun.Com
+'*
+'* short description : Copy a control with i18n data
+'*
+'\******************************************************************************
+
+testcase tBasicDialogI18nCopyControl
+
+
+ const COMMAND_BUTTON = 1 ' id of the command button (formcontrols.inc)
+ const DIALOG_NAME = "DialogExport" ' Name of the first module
+ const LANGUAGES_TO_COPY = 5 ' Only copy n languages
+ const TARGET_DIALOG = "Target" ' The name of the dialog the control is pasted to
+
+ dim cLanguageList( LANGUAGES_TO_COPY ) as string ' Note: Index 0 is used
+ dim iCurrentLanguage as integer
+
+ ' These are the strings used to simulate localized text
+ dim cIDStrings( 5 ) as string
+ cIDStrings( 0 ) = "language_a"
+ cIDStrings( 1 ) = "language_b"
+ cIDStrings( 2 ) = "language_c"
+ cIDStrings( 3 ) = "language_d"
+ cIDStrings( 4 ) = "language_e"
+ cIDStrings( 5 ) = "language_f"
+
+ dim cTempString as string
+
+ ' These are the IDE internal coordinates of the control, used to restore
+ ' identical coordinates in the source and target dialogs
+ dim iOriginalCoordinates( 4 ) as integer
+
+ ' Some multi purpose returncode
+ dim brc as boolean
+
+ hCreateDocument()
+
+ printlog( "Test init: Setting up environment" )
+ brc = hInitFormControls( DIALOG_NAME )
+ if ( not brc ) then
+ warnlog( "Failed to initialize BASIC IDE/Dialog editor, aborting" )
+ goto endsub
+ endif
+
+ hDrawControlOnDialog( COMMAND_BUTTON )
+
+ hOpenPropertyBrowser()
+ kontext "TabGeneralControl"
+ printlog( "Get internal coordinates for the control" )
+ iOriginalCoordinates( 1 ) = height.getText()
+ iOriginalCoordinates( 2 ) = width.getText()
+ iOriginalCoordinates( 3 ) = PosX.getText()
+ iOriginalCoordinates( 4 ) = PosY.getText()
+ printlog( "Height: " & iOriginalCoordinates( 1 ) )
+ printlog( "Width.: " & iOriginalCoordinates( 2 ) )
+ printlog( "Pos X.: " & iOriginalCoordinates( 3 ) )
+ printlog( "Pos Y.: " & iOriginalCoordinates( 4 ) )
+ hClosePropertyBrowser()
+
+ qaerrorlog( "#i80456# properties button not enabled when a formcontrol is inserted via keyboard" )
+
+ kontext "ToolsCollectionBar"
+ ManageLanguage.click()
+
+ kontext "ManageUILanguages"
+ if ( ManageUILanguages.exists( 2 ) ) then
+
+ add.click()
+
+ kontext "SetDefaultLanguage"
+ if ( SetDefaultLanguage.exists( 1 ) ) then
+ SetDefaultLanguage.ok()
+ else
+ warnlog( "Set Default Language dialog is missing" )
+ endif
+ else
+ warnlog( "Unable to open Manage UI Languages dialog" )
+ endif
+
+ kontext "ManageUILanguages"
+ if ( ManageUILanguages.exists( 1 ) ) then
+
+ add.click()
+
+ kontext "AddUserInterface"
+ if ( AddUserInterface.exists( 1 ) ) then
+ for iCurrentLanguage = 1 to LANGUAGES_TO_COPY
+ AddNewControl.select( iCurrentLanguage )
+ AddNewControl.check()
+ next iCurrentLanguage
+ AddUserInterface.ok()
+ else
+ warnlog( "Add User Interface Language dialog is missing" )
+ endif
+ else
+ warnlog( "Unable to open Manage UI Languages dialog" )
+ endif
+
+ kontext "ManageUILanguages"
+ for iCurrentLanguage = 0 to LANGUAGES_TO_COPY
+ PresentLanguages.select( iCurrentLanguage + 1 )
+ cLanguageList( iCurrentLanguage ) = PresentLanguages.getSelText()
+ printlog( iCurrentLanguage & ": " & cLanguageList( iCurrentLanguage ) )
+ next iCurrentLanguage
+
+ kontext "ManageUILanguages"
+ ManageUILanguages.close()
+
+ printlog( "Localizing control" )
+ for iCurrentLanguage = 0 to LANGUAGES_TO_COPY
+ kontext "TranslationBar"
+ CurrentLanguage.select( iCurrentLanguage + 1 )
+ kontext "BasicIde"
+ hSelectControl( COMMAND_BUTTON )
+ hOpenPropertyBrowser()
+ printlog( "Setting string: " & cIDStrings( iCurrentLanguage ) )
+ kontext "TabGeneralControl"
+ NameText.typeKeys( cIDStrings( iCurrentLanguage ) & "<RETURN>" )
+ hClosePropertyBrowser()
+ next iCurrentLanguage
+
+ printlog( "Copy control" )
+ EditCopy
+
+ printlog( "New dialog" )
+ Call hNewDialog()
+
+ printlog( "Paste control" )
+ EditPaste
+
+ hOpenPropertyBrowser()
+ kontext "TabGeneralControl"
+ printlog( "Set coordinates to be identical with those from the source control" )
+ PosX.typeKeys ( )
+ PosX.typeKeys ( "<HOME><SHIFT END>" & iOriginalCoordinates( 3 ) & "<RETURN>" )
+ PosY.typeKeys ( "<HOME><SHIFT END>" & iOriginalCoordinates( 4 ) & "<RETURN>" )
+ Height.typeKeys( "<HOME><SHIFT END>" & iOriginalCoordinates( 1 ) & "<RETURN>" )
+ Width.typeKeys ( "<HOME><SHIFT END>" & iOriginalCoordinates( 2 ) & "<RETURN>" )
+ hClosePropertyBrowser
+
+
+ hOpenPropertyBrowser()
+ kontext "TabGeneralControl"
+ printlog( "Get internal coordinates for the control" )
+ iOriginalCoordinates( 1 ) = height.getText()
+ iOriginalCoordinates( 2 ) = width.getText()
+ iOriginalCoordinates( 3 ) = PosX.getText()
+ iOriginalCoordinates( 4 ) = PosY.getText()
+ printlog( "Height: " & iOriginalCoordinates( 1 ) )
+ printlog( "Width.: " & iOriginalCoordinates( 2 ) )
+ printlog( "Pos X.: " & iOriginalCoordinates( 3 ) )
+ printlog( "Pos Y.: " & iOriginalCoordinates( 4 ) )
+ hClosePropertyBrowser()
+
+
+ kontext "TranslationBar"
+ for iCurrentLanguage = 0 to LANGUAGES_TO_COPY
+ CurrentLanguage.select( iCurrentLanguage + 1 )
+ cTempString = CurrentLanguage.getSelText()
+ if ( cTempString = cLanguageList( iCurrentLanguage ) ) then
+ printlog( "Language <" & cTempString & "> was successfully copied" )
+ else
+ warnlog( "Either a language was lost or the sort order changed" )
+ printlog( "Expected: " & cLanguageList( iCurrentLanguage ) )
+ printlog( "Found...: " & cTempString )
+ endif
+ next iCurrentLanguage
+
+
+ kontext "BasicIde"
+ hDestroyDocument()
+ hDestroyDocument()
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/basic_dialog_i18n_defaults.inc b/testautomation/framework/optional/includes/basic_dialog_i18n_defaults.inc
new file mode 100644
index 000000000000..79b4e039fa14
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_dialog_i18n_defaults.inc
@@ -0,0 +1,406 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Test correct handling of the default language
+'*
+'\******************************************************************************
+
+testcase tBasicDialogI18nDefaults
+
+
+ const MODULE_NAME = "defmod"
+ const FILE_NAME = "basic_defaults.odt"
+
+ dim cWorkPath as string
+ cWorkPath = hGetWorkPath() & FILE_NAME
+
+ dim brc as boolean
+ dim cMsg as string
+
+ dim cDefLangSelect as string ' Default language from Select Default Language Dialog
+ dim cDefLangDialog as string ' Default language from Manage UI Languages dialog
+ dim cDefLangToolbar as string ' Default language from Translation Toolbar
+ dim cTmpLangString as string ' Temporary language string for comparision
+ dim cAdditionalLanguage as string
+
+ dim iLangCount as integer
+
+ printlog( "Preparing testenvironment" )
+ printlog( "Workfile is: " & cWorkPath )
+
+ brc = hCreateDocument()
+ if ( not brc ) then
+ warnlog( "Failed to create a new document, aborting" )
+ goto endsub
+ endif
+
+ brc = hFileSaveAsWithFilterKill( cWorkPath , "writer8" )
+
+ brc = hInitFormControls( MODULE_NAME )
+ if ( not brc ) then
+ warnlog( "Ups, bad again..." )
+ endif
+
+ printlog( "Dialog Editor is open, ToolsCollectionBar is visible. Good." )
+
+ printlog( "" )
+ printlog( "Starting test (check control states, add default language)" )
+
+ kontext "TranslationBar"
+ if ( TranslationBar.exists( 1 ) ) then
+ warnlog( "The TranslationBar should not be exist/visible by default" )
+ else
+ printlog( "The TranslationBar is hidden. Good." )
+ endif
+
+ Kontext "ToolsCollectionBar"
+ ManageLanguage.click()
+
+ kontext "ManageUILanguages"
+ if ( not ManageUILanguages.exists( 2 ) ) then
+ warnlog( "ManageUILanguages Dialog is not open, aborting test" )
+ goto TestExit
+ endif
+
+ printlog( "ManageUILanguages Dialog is open" )
+
+ iLangCount = PresentLanguages.getItemCount()
+ if ( iLangCount <> 1 ) then
+ warnlog( "There should only be one single entry in the languages listbox" )
+ printlog( "Currently " & iLangCount & " entries are listed" )
+ endif
+
+ if ( not add.isEnabled() ) then
+ warnlog( "Add button should be enabled" )
+ endif
+
+ if ( delete.isEnabled() ) then
+ warnlog( "Delete button should be disabled" )
+ endif
+
+
+ if ( Default.isEnabled() ) then
+ warnlog( "Default button should be disabled" )
+ endif
+
+
+ printlog( "Select the first/only entry to see whether the button states change" )
+ PresentLanguages.select( 1 )
+ printlog( "Entry is: " & PresentLanguages.getSelText() )
+
+ if ( not add.isEnabled() ) then
+ warnlog( "Add button should be enabled" )
+ endif
+
+ if ( Delete.isEnabled() ) then
+ warnlog( "Delete button should be disabled" )
+ endif
+
+ if ( Default.isEnabled() ) then
+ warnlog( "Default button should be disabled" )
+ endif
+
+ printlog( "Add default language" )
+ kontext "ManageUILanguage"
+ Add.click()
+
+ kontext "SetDefaultLanguage"
+ if ( not SetDefaultLanguage.exists( 2 ) ) then
+ warnlog( "Default language selection dialog did not open" )
+ kontext "ManageUILanguages"
+ ManageUILanguages.close()
+ goto TestExit
+ endif
+
+ kontext "SetDefaultLanguage"
+ cDeflangSelect = DefaultLanguageListbox.getSelText()
+ iLangCount = DefaultLanguageListbox.getItemCount()
+ printlog( "Default language is: " & cDeflangSelect )
+ printlog( "Total languages listed: " & iLangCount )
+ SetDefaultLanguage.ok()
+
+
+ kontext "ManageUILanguages"
+ iLangCount = PresentLanguages.getItemCount()
+ if ( iLangCount <> 1 ) then
+ warnlog( "There should only be one single entry in the languages listbox" )
+ printlog( "Currently " & iLangCount & " entries are listed" )
+ endif
+
+ PresentLanguages.select( 1 )
+ cDefLangDialog = PresentLanguages.getSelText()
+ if ( instr( cDefLangSelect, cDefLangDialog ) <> 0 ) then
+ warnlog( "The default language was not transported to the languages list" )
+ else
+ printlog( "Ok, the string was copied correctly" )
+ endif
+ printlog( "Select.: " & cDefLangSelect )
+ printlog( "Dialog.: " & cDefLangDialog )
+
+
+ if ( not add.isEnabled() ) then
+ warnlog( "Add button should be enabled" )
+ endif
+
+ if ( not Delete.isEnabled() ) then
+ warnlog( "Delete button should be enabled" )
+ Delete.click()
+ kontext "active"
+ if ( active.exists( 1 ) ) then
+ printlog( "Removal warning is displayed. Good." )
+ active.cancel()
+ else
+ warnlog( "Removal warning not displayed" )
+ endif
+ endif
+
+ if ( Default.isEnabled() ) then
+ warnlog( "Default button should be disabled" )
+ endif
+
+ kontext "ManageUILanguages"
+ ManageUILanguages.close()
+
+
+
+ kontext "TranslationBar"
+ printlog( "Testing the TranslationBar ..." )
+ if ( TranslationBar.exists() ) then
+ printlog( "TranslationBar exists." )
+
+ if ( TranslationBar.isVisible() ) then
+ printlog( "TranslationBar is visible." )
+
+ if ( currentLanguage.isEnabled() ) then
+ printlog( "Languages list is enabled." )
+
+ if ( CurrentLanguage.getItemCount() = 1 ) then
+ printlog( "Exactly one item in listed in the listbox, good." )
+
+ ' Note that we need to test for a substring as the [default] marker
+ ' is not copied from the Select Default languages dialog
+ cDefLangToolbar = CurrentLanguage.getSelText()
+ if ( instr( cDefLangToolbar, cDefLangSelect ) <> 0 ) then
+ printlog( "The correct entry is in the languages list. Good." )
+ else
+ warnlog( "The default language should be listed and selected." )
+ endif
+ printlog( "Select.: " & cDefLangSelect )
+ printlog( "Toolbar: " & cDefLangToolbar )
+
+ if ( cDefLangToolbar <> cDefLangDialog ) then
+ warnlog( "The default language did not copy to the toolbar" )
+ else
+ printlog( "The default language was copied ok." )
+ endif
+ printlog( "Dialog.: " & cDefLangDialog )
+ printlog( "Toolbar: " & cDefLangToolbar )
+
+ else
+ warnlog( "There are too many entries in the languages list." )
+ endif
+ else
+ warnlog( "The languages listbox is disabled." )
+ endif
+ else
+ warnlog( "The Translation Bar is not visible." )
+ endif
+ else
+ warnlog( "The Translation Bar does not exist." )
+ endif
+
+
+ printlog( "Click ManageLanguages-button on the TranslationBar" )
+ kontext "TranslationBar"
+ wait( 100 )
+ ManageLanguage.click()
+
+ kontext "ManageUILanguages"
+ if ( not ManageUILanguages.exists( 2 ) ) then
+ warnlog( "Failed to open Manage Languages dialog" )
+ endif
+
+ iLangCount = PresentLanguages.getItemCount()
+ if ( iLangCount <> 1 ) then
+ warnlog( "There should only be one single entry in the languages listbox" )
+ printlog( "Currently " & iLangCount & " entries are listed" )
+ endif
+
+ PresentLanguages.select( 1 )
+ cTmpLangString = Presentlanguages.getSeltext()
+ if ( cTmpLangString <> cDefLangDialog ) then
+ warnlog( "The dialog forgot the default language" )
+ else
+ printlog( "The dialog remembers the default language. Good." )
+ endif
+ printlog( "Expected: " & cDefLangDialog )
+ printlog( "Found...: " & cTmpLangString )
+
+ kontext "ManageUILanguages"
+ Add.click()
+
+ kontext "AddUserInterface"
+ if ( not AddUserInterface.exists( 1 ) ) then
+ warnlog( "Cannot add another language, the dialog is not open" )
+ kontext "ManageUILanguages"
+ ManageUILanguages.close()
+ goto TestExit
+ endif
+
+ AddNewControl.select( 1 )
+ cAdditionalLanguage = AddNewControl.getSelText()
+ printlog( "Adding language: " & cAdditionalLanguage )
+ AddNewControl.check()
+
+ AddUserInterface.ok()
+
+ kontext "ManageUILanguages"
+ if ( not ManageUILanguages.exists( 1 ) ) then
+ warnlog( "Could not return to Manage UI Languages dialog" )
+ goto TestExit
+ endif
+
+ kontext "ManageUILanguages"
+ iLangCount = PresentLanguages.getItemCount()
+ if ( iLangCount <> 2 ) then
+ warnlog( "There should be exactly two languages listed in the listbox" )
+ printlog( "Currently " & iLangCount & " entries are listed" )
+ goto TestExit
+ else
+ printlog( "Two languages listed in Manage UI Languages dialog. Good." )
+ endif
+
+ printlog( "Verify language in Manage UI Language dialog" )
+ PresentLanguages.select( 2 )
+ cTmpLangString = Presentlanguages.getSelText()
+ if ( cTmpLangString = cAdditionalLanguage ) then
+ printlog( "Found correct language at pos 2. Good" )
+ else
+ warnlog( "The language is not listed at the expected position" )
+ endif
+ printlog( "Expected: " & cAdditionalLanguage )
+ printlog( "Found...: " & cTmpLangString )
+
+ printlog( "Select second language and make it default" )
+ PresentLanguages.select( 2 )
+ Default.click()
+ cAdditionalLanguage = PresentLanguages.getSelText()
+
+ printlog( "Close the Manage UI Languages dialog" )
+ kontext "ManageUILanguages"
+ ManageUILanguages.close()
+
+ printlog( "Verify that the new default is on pos 2 in the TranslationBar list" )
+ kontext "TranslationBar"
+ CurrentLanguage.select( 2 )
+ cDefLangToolbar = CurrentLanguage.getSelText()
+ if ( cDefLangToolbar = cAdditionalLanguage ) then
+ printlog( "Found correct language at pos 2. Good." )
+ else
+ warnlog( "The language is not listed at the expected position" )
+ endif
+ printlog( "Expected: " & cAdditionalLanguage )
+ printlog( "Found...: " & cDefLangToolbar )
+
+ printlog( "Verify that the list on the Manage UI Language is still unsorted" )
+ printlog( "The dafault language should be at pos 2" )
+ ManageLanguage.click()
+ kontext "ManageUILanguages"
+ PresentLanguages.select( 2 )
+ cTmpLangString = Presentlanguages.getSelText()
+ if ( cTmpLangString = cAdditionalLanguage ) then
+ printlog( "Found correct language at pos 2. Good" )
+ else
+ warnlog( "The language is not listed at the expected position" )
+ endif
+ printlog( "Expected: " & cAdditionalLanguage )
+ printlog( "Found...: " & cTmpLangString )
+
+ printlog( "Delte the current default language" )
+ Delete.click()
+
+ printlog( "There should be a deletion warning" )
+ kontext "Active"
+ if ( Active.exists( 2 ) ) then
+ cMsg = active.getText()
+ cMsg = hRemoveLineBreaks( cMsg )
+ printlog( "Message: " & cMsg )
+ Active.ok()
+ else
+ warnlog( "Deletion Warning missing" )
+ endif
+
+ printlog( "Verify deletion, the remaining language must be default now" )
+ kontext "ManageUILanguages"
+ iLangCount = PresentLanguages.getItemCount()
+ if ( iLangCount <> 1 ) then
+ warnlog( "Only the default language should be listed" )
+ printlog( "Currently " & iLangCount & " entries are listed" )
+ endif
+
+ PresentLanguages.select( 1 )
+ cTmpLangString = Presentlanguages.getSeltext()
+ if ( cTmpLangString <> cDefLangDialog ) then
+ warnlog( "The dialog forgot the default language" )
+ else
+ printlog( "The dialog sets the default language. Good." )
+ endif
+ printlog( "Expected: " & cDefLangDialog )
+ printlog( "Found...: " & cTmpLangString )
+
+ printlog( "verify button states" )
+
+ if ( not add.isEnabled() ) then
+ warnlog( "Add button should be enabled" )
+ endif
+
+ if ( not Delete.isEnabled() ) then
+ warnlog( "Delete button should be enabled" )
+ endif
+
+ if ( Default.isEnabled() ) then
+ warnlog( "Default button should be disabled" )
+ endif
+
+ TestExit:
+ printlog( "" )
+ printlog( "Test exit, cleanup" )
+
+ kontext "ManageUILanguages"
+ if ( ManageUILanguages.exists() ) then
+ ManageUILanguages.close()
+ endif
+
+ hCloseBasicIde()
+ hCloseDocument()
+ hDeleteFile( cWorkPath )
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/basic_documents.inc b/testautomation/framework/optional/includes/basic_documents.inc
new file mode 100644
index 000000000000..47173efb8ef5
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_documents.inc
@@ -0,0 +1,190 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : BASIC organizers and documents
+'*
+'\******************************************************************************
+
+private const IDOCS = 5
+
+testcase tBasicDocuments
+
+ qaerrorlog( "#i90435# Untitled documents unnumbered in BASIC organizer" )
+ goto endsub
+
+ const CFN = "tBasicDocuments::"
+
+
+ dim brc as boolean
+ dim sFileWriter as string
+ dim sFileCalc as string
+ dim iDocumentCount as integer
+ dim cNodeListA( 10 ) as string
+ dim cNodeListB( 10 ) as string
+ dim iSecLevel as integer
+ dim iHitCount as integer
+
+ ' NOTE: hCreateBasicWorkFiles() creates files of the naming scheme
+ ' basic.odt, ...odc etc. All these files will show up with just "basic"
+ ' in the Macro Organizer
+ const DOC_NAME = "basic"
+
+ printlog( "" )
+ iSecLevel = hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_MEDIUM )
+
+ hInitSingleDoc()
+
+ kontext "DocumentWriter"
+ DocumentWriter.typeKeys( "tBasicDocuments - initial document - discard after test" )
+
+ gApplication = "WRITER"
+ printlog( "" )
+ brc = hCreateBasicWorkFiles()
+ sFileWriter = hGetBasicWorkFile( "current" )
+
+ gApplication = "CALC"
+ printlog( "" )
+ brc = hCreateBasicWorkFiles()
+ sFileCalc = hGetBasicWorkFile( "current" )
+
+ printlog( "" )
+ brc = hFileOpen( sFileWriter )
+ brc = hAllowMacroExecution()
+ if ( not brc ) then
+ warnlog( "Missing Macro execution dialog. Please check the file/security settings" )
+ endif
+ brc = hFileOpen( sFileCalc )
+ brc = hAllowMacroExecution()
+ if ( not brc ) then
+ warnlog( "Missing Macro execution dialog. Please check the file/security settings" )
+ endif
+
+ printlog( "" )
+ brc = hOpenBasicOrganizerFromDoc()
+
+ hGetVisibleNodeNames( MakroAus , cNodeListA() )
+
+ printlog( "" )
+ iHitCount = hCountMatchesInList( cNodeListA() , DOC_NAME )
+ if ( iHitCount <> 2 ) then
+ warnlog( "There should be two documents with the name " & DOC_NAME & "listed." )
+ endif
+
+ verwalten.click()
+
+ printlog( "" )
+ brc = hSelectBasicObjectOrganizerTab( 1 )
+ ListAllDelete( cNodeListB() )
+ hGetVisibleNodeNames( ModulListe , cNodeListB() )
+
+ printlog( "" )
+ iHitCount = hCountMatchesInList( cNodeListA() , DOC_NAME )
+ if ( iHitCount <> 2 ) then
+ warnlog( "There should be two documents with the name " & DOC_NAME & "listed." )
+ endif
+
+ printlog( "" )
+ brc = hSelectBasicObjectOrganizerTab( 2 )
+ ListAllDelete( cNodeListB() )
+ hGetVisibleNodeNames( ModuleList , cNodeListB() )
+ if ( listcount( cNodeListB() ) <> 5 ) then
+ warnlog( CFN & "#i49239# Incorrect object count in treelist" )
+ hListPrint( cNodeListB() , "List of objects found in treelist" )
+ endif
+
+ printlog( "" )
+ iHitCount = hCountMatchesInList( cNodeListB() , DOC_NAME )
+ if ( iHitCount <> 2 ) then
+ warnlog( "There should be two documents with the name " & DOC_NAME & "listed." )
+ endif
+
+ printlog( "" )
+ brc = hSelectBasicObjectOrganizerTab( 3 )
+ brc = hTestLibraryListBox( cNodeListA() )
+
+ printlog( "" )
+ printlog( CFN & "Closing dialogs..." )
+ TabBibliotheken.cancel()
+
+ Kontext "Makro"
+ Makro.cancel()
+
+ brc = hDestroyDocument()
+ brc = hDestroyDocument()
+
+ brc = hDeleteFile( sFileWriter )
+ brc = hDeleteFile( sFileCalc )
+
+ hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT )
+
+ hDestroyDocument()
+
+
+endcase
+
+'*******************************************************************************
+
+function hTestLibraryListBox( cNodeList() ) as boolean
+
+ const CFN = "hTestLibraryListBox::"
+
+
+
+ dim iEntry as integer
+ dim cEntry as string
+ dim brc as boolean
+ dim irc as integer
+
+ brc = true
+
+ if ( bibliothek.getItemCount() <> IDOCS ) then
+ warnlog( CFN & "Incorrect number of items in listbox" )
+ printlog( CFN & "Expected: " & bibliothek.getItemCount() )
+ printlog( CFN & "Found...: " & listcount( cNodeList() ) )
+ brc = false
+ endif
+
+ for iEntry = 3 to IDOCS
+
+ Bibliothek.select( iEntry )
+ cEntry = Bibliothek.getSelText()
+
+ irc = hCompareSubStrings( cNodeList( iEntry ) , cEntry )
+ if ( irc <> 1 ) then
+ warnlog( CFN & "Comparision failed" )
+ printlog( CFN & "Expected: " & cNodeList( iEntry ) & "<>" & cEntry )
+ brc = false
+ else
+ printlog( CFN & "Comparision succeeded:" & cEntry )
+ endif
+
+ next iEntry
+
+
+end function
diff --git a/testautomation/framework/optional/includes/basic_eventbinding.inc b/testautomation/framework/optional/includes/basic_eventbinding.inc
new file mode 100644
index 000000000000..85601c312667
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_eventbinding.inc
@@ -0,0 +1,283 @@
+'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 : Function test of Basic IDE Assign Componenet
+'*
+'\************************************************************************
+
+
+testcase tAssignComponent
+ dim j,b,i,a,x,y as integer
+ dim sTemp as string
+ dim sTemp2 as string
+ dim sDialogName as string
+
+ ' make sure we start from backingwindow
+ b = getDocumentCount
+ for j = 1 to b
+ printlog "closing: " + j
+ hCloseDocument()
+ next j
+ ' make sure we only have one document window
+ hNewDocument()
+ sleep (5)
+
+ ToolsMacrosOrganizeDialogs
+ Kontext "TabDialogs"
+ if TabDialogs.exists(5) then
+ ModuleList.typeKeys("<home>")
+ sTemp = ModuleList.getSelText
+ sTemp2 = ""
+ while (NOT newDialog.isEnabled) AND (sTemp <> sTemp2)
+ ModuleList.typeKeys("<down>")
+ sTemp2 = sTemp
+ sTemp = ModuleList.getSelText
+ wend
+ if sTemp = sTemp2 then
+ warnlog "Couldn't find a way to enable the 'New...' button - aborting"
+ goto endsub
+ endif
+ printlog ModuleList.getSelText
+ newDialog.click
+ kontext "NeuerDialog"
+ if NeuerDialog.exists(5) then
+ ' save dialog name, for deleting it later
+ sDialogName = Dialogname.getText
+ printlog sDialogName
+ NeuerDialog.OK
+ Kontext "TabDialogs"
+ if TabDialogs.exists(5) then
+ printlog ModuleList.getSelText
+ edit.click
+ Kontext "BasicIDE"
+ if DialogWindow.exists(5) then ' you can't use exists on BasicIDE; check for a control
+ DialogWindow.TypeKeys("tab")
+ DialogWindow.TypeKeys("tab",true)
+ try
+ ContextProperties
+ catch
+ qaErrorLog "#i70901# .typeKeys doesn't work in DialogWindow"
+ ' works better, but also not always
+ DialogWindow.mouseDown( 10 , 10 )
+ DialogWindow.mouseMove( 90 , 90 )
+ DialogWindow.mouseUp( 90 , 90 )
+ try
+ ContextProperties
+ catch
+ qaErrorLog "Even Workaround doesn't work! - exiting"
+ goto endsub
+ endcatch
+ endcatch
+ kontext "ControlPropertiesDialog"
+ 'printlog TabEventsControl.exists(5)
+ if NOT ControlPropertiesDialog.exists(5) then
+ qaErrorLog "#i70901# can't use exists on tabpage parent"
+ endif
+ 'printlog TabGeneralControl.exists(5)
+ ' doesn't work...
+' if ControlPropertiesDialog.exists(5) then
+ kontext "TabGeneralControl"
+ if TabGeneralControl.exists(5) then
+ kontext "ControlPropertiesTabControl"
+ ControlPropertiesTabcontrol.setPage (TabEventsControl)
+ Kontext "TabEventsControl"
+ if TabEventsControl.exists(5) then
+ PBKeyTyped.click
+ Kontext "AssignMacro"
+ if AssignMacro.exists(5) then
+ Component.click
+ Kontext "AssingComponent"
+ if AssingComponent.exists(5) then
+ DialogTest(AssingComponent)
+ ComponentMethodName.setText ("vnd.sun.star.script:Library1.Module1.TestDialogComponent?language=Basic&location=document")
+ AssingComponent.OK
+ Kontext "AssignMacro"
+ if AssignMacro.exists(5) then
+ ' doesn't work, because featureset is not implemted on component EditListBox... expected for xmas 2006
+ 'printlog eventListBox.getItemText
+ AssignMacro.OK
+ Kontext "TabEventsControl"
+ printlog evtKeyTyped.getText
+ Kontext "ControlPropertiesDialog"
+ ContextProperties
+ endif
+ else
+ warnlog "couldn't open dialog 'Assign Component'"
+ endif
+ else
+ warnlog "couldn't open dialog 'Assign Macro'"
+ endif
+ else
+ warnlog "couldn't switch to tab page 'Events''"
+ endif
+ else
+ warnlog "couldn't open flyer 'Properties: Dialog'"
+ endif
+ else
+ warnlog "couldn't open Basic IDE Dialog editor"
+ endif
+ else
+ warnlog "couldn't open dialog 'New Dialog'"
+ endif
+ else
+ warnlog "couldn't open dialog 'New Dialog'"
+ endif
+ else
+ warnlog "couldn't open dialog 'OOo Basic Macro Organizer'"
+ endif
+
+ 'delete dialog!
+ ToolsMacrosOrganizeDialogs
+ Kontext "TabDialogs"
+ if TabDialogs.exists(5) then
+ ModuleList.typeKeys("<home>")
+ sTemp = ModuleList.getSelText
+ sTemp2 = ""
+ while (sTemp <> sDialogName) AND (sTemp <> sTemp2)
+ ModuleList.typeKeys("<down>")
+ sTemp2 = sTemp
+ sTemp = ModuleList.getSelText
+ wend
+ if sTemp = sTemp2 then
+ warnlog "Couldn't find the created dialog - aborting"
+ goto endsub
+ endif
+ printlog ModuleList.getSelText
+ delete.click
+ kontext
+ if active.exists(5) then
+ printlog active.getText
+ active.yes
+ else
+ warnlog "couldn't delete dialog '"+sDialogName+"'"
+ endif
+ Kontext "TabDialogs"
+ TabDialogs.cancel
+ else
+ warnlog "couldn't open dialog 'OOo Basic Macro Organizer'"
+ endif
+
+'Sub Main
+' oSimpleComponent = CreateUnoService( "my_module.MyService1" )
+' oActiveFrame = StarDesktop.getActiveFrame()
+' oSimpleComponent.createDialog("vnd.sun.star.script:Standard.Dialog1?location=application", oActiveFrame )
+'End Sub
+ hCloseDocument()
+ hCloseDocument()
+endcase
+
+testcase tAssignComponentFunction
+ dim x,i,a as integer
+ dim sTemp as string
+ dim sPath as string
+ sPath = gTesttoolPath & "framework\optional\input/eventbinding/"
+ dim sExtension as string
+ sExtension = "DialogComponent.oxt"
+
+ sExtensionCLI("list","")
+ 'sExtensionCLI("add","DialogComponent.oxt",convertPath(gTestToolPath + "framework\optional\input/eventbinding/") )
+ hExtensionAddGUI( sPath & sExtension, "" )
+ hFileOpen(convertPath(gTestToolPath + "framework\optional\input/eventbinding/DialogComponent.odt"))
+ kontext "SecurityWarning"
+ if SecurityWarning.exists(5) then
+ SecurityWarning.ok
+ endif
+ ToolsMacrosRunMacro
+ Kontext "ScriptSelector"
+ if ScriptSelector.exists(10) then
+ x = LibraryTreeList.getItemCount
+ 'There have to show up 3 libraries, else the document isn't loaded
+ if x <> 3 then
+ printlog "Try again..."
+ ScriptSelector.cancel
+ sleep 10
+ ToolsMacrosRunMacro
+ Kontext "ScriptSelector"
+ x = LibraryTreeList.getItemCount
+ endif
+ 'Look for library 'DialogComponent' and 'DIALOGCOMPONENT'
+ for i = 1 to x
+ sTemp = LibraryTreeList.getItemText(i)
+ 'printlog "("+i+"/"+x+"): '" + sTemp + "'"
+ if (instr(stemp,"DialogComponent.odt") OR instr(stemp,"DIALOGCOMPONENT.ODT")) then
+ a = i
+ printlog "Found library ("+i+"/"+x+"): '" + sTemp + "'"
+ endif
+ next i
+ if 0 <> a then
+ 'Select the library and unfold it
+ LibraryTreeList.select(a)
+ LibraryTreeList.typeKeys("+")
+ 'Go to 'Standard' and unfold
+ LibraryTreeList.typeKeys("<down>")
+ LibraryTreeList.typeKeys("+")
+ 'Go to 'Global'
+ LibraryTreeList.typeKeys("<down>")
+
+ 'Select macro name 'TestDialogComponent'
+ x = ScriptList.getItemCount
+ for i = 1 to x
+ sTemp = ScriptList.getItemText(i)
+ 'printlog "("+i+"/"+x+"): '" + sTemp + "'"
+ if "TestDialogComponent" = sTemp then
+ a = i
+ printlog "Found macro ("+i+"/"+x+"): '" + sTemp + "'"
+ endif
+ next i
+ if (0 <> a) then
+ 'Select the macro
+ ScriptList.select(a)
+ 'Start the macro by pressing the button 'run'
+ qaErrorLog ("#i68892# The test can't go on, because no help ids are useable in BASIC right now.")
+ ScriptSelector.cancel
+ 'ScriptSelector.ok
+ ' sleep... at least 60 seconds
+ call sleep(10)
+ else
+ warnlog "Macro not found: 'TestDialogComponent'"
+ endif
+ else
+ warnlog "Library not found: 'DialogComponent' or 'DIALOGCOMPONENT'"
+ endif
+ else
+ warnlog "'Run macro dialog' didn't came up"
+ endif
+ 'printlog resetapplication
+
+ ' vnd.sun.star.UNO:doit1
+ ' vnd.sun.star.UNO:doit2
+ ' vnd.sun.star.UNO:doit3
+ ' vnd.sun.star.UNO:handleEventWithArguments
+ ' vnd.sun.star.UNO:handleEvent
+ ' vnd.sun.star.UNO:copyText
+
+ sExtensionCLI("remove","DialogComponent.oxt" )
+ 'hExtension RemoveGUI( sExtension )
+ hCloseDocument()
+endcase
diff --git a/testautomation/framework/optional/includes/basic_formcontrols.inc b/testautomation/framework/optional/includes/basic_formcontrols.inc
new file mode 100644
index 000000000000..01af07357d52
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_formcontrols.inc
@@ -0,0 +1,288 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Basic form-controls
+'*
+'\******************************************************************************
+
+testcase tAllControlsOnDialog( cMajor as string )
+
+ printlog( "Insert all available controls into a BASIC dialog and verify that changed settings persist a save/load cycle" )
+
+ qaerrorlog( "#i105685# - Test disabled" )
+ goto endsub
+
+ dim iApplication as Integer ' numeric expression for gApplication
+ dim cApplication as string ' Name of the current application
+
+ dim lsControlNames( 30 ) as string ' list containing the names of the controls
+
+ ' number of controls and the name of the current control
+ dim iCurrentControl as integer
+ dim sCurrentControl as string
+
+ ' the workfile and the filter (Tested for 569, 645, 680)
+ dim sFile as string
+
+ ' errorstatus: if false, something went wrong and the test cancels
+ ' trying to recover somehow
+ dim bOpen as boolean
+ dim brc as boolean
+ dim irc as integer
+
+ const CMODULE = "tacod" ' abbreviation for tAllControlsOnDialog
+
+ printlog( "Perform the test for one application only: WRITER" )
+ for iApplication = 1 to 1
+
+ printlog( "Set document type" )
+ cApplication = hNumericDoctype( iApplication )
+
+ printlog( "Build the filename" )
+ sFile = hGetWorkPath() & "basic" & hGetSuffix( cMajor )
+ sFile = ConvertPath( sFile )
+ printlog( "Using file: " & sFile )
+
+ printlog( "Delete the file, if it exists" )
+ hDeleteFile( sFile )
+
+ printlog( "Open a second document" )
+ printlog( "" )
+ printlog( cApplication )
+ brc = hCreateDocument()
+ if ( not brc ) then
+ warnlog( "Failed to create a new document, aborting" )
+ goto endsub
+ endif
+
+ printlog( "Create a new module for the new document" )
+ printlog( "Create a new dialog in BasicIDE" )
+ printlog( "Open the macro controls float" )
+ bOpen = hInitFormControls( CMODULE )
+ if ( not bOpen ) then
+ printlog( "Aborting due to previous errors" )
+ call hCloseDocument()
+ goto endsub
+ endif
+
+ printlog( "Insert all controls into the dialog" )
+ for iCurrentControl = 1 to ICONTROLCOUNT
+
+ sCurrentControl = hDrawControlOnDialog( iCurrentControl )
+ listappend( lsControlNames() , sCurrentControl )
+ hOpenPropertyBrowser()
+ hPBSetControlName( sCurrentControl )
+ hClosePropertyBrowser()
+
+ next iCurrentControl
+
+
+ Kontext "BASICIDE"
+ printlog( "close the BASIC-IDE" )
+ hCloseBasicIde()
+
+
+ printlog( "" )
+ printlog( "Test case 1: Verify that settings survive a close and reopen of the BASIC IDE" )
+
+ ToolsMacro_uno
+ kontext "Makro"
+ irc = hSelectNodeByName( MakroAus , CMODULE )
+ if ( irc = 0 ) then
+ qaerrorlog( "Searching node by name failed. Using fallback" )
+ hSelectTheLastnode( MakroAus )
+ else
+ printlog( "The node was found. Good." )
+ endif
+
+ brc = hIsMacroEditButtonEnabled()
+ if ( not brc ) then
+ warnlog( "Edit-Button is not enabled, the test cannot continue" )
+ kontext "Makro"
+ Makro.cancel()
+ brc = hDestroyDocument()
+ goto endsub
+ endif
+
+ printlog( "Click 'Edit' to edit the module" )
+ printlog( "Edit the module" )
+ Bearbeiten.Click()
+ if ( WaitSlot <> WSFinished ) then
+ warnlog( "Slot not finished after 1 second" )
+ endif
+
+ kontext "BasicIDE"
+ printlog( "Find the dialog we created before" )
+ ' try to find our dialog again by stepping through the tabbar
+ bOpen = hFindFirstDialog()
+ if ( not bOpen ) then
+ warnlog( "Could access dialog, aborting test" )
+ hCloseBasicIde()
+ brc = hDestroyDocument()
+ goto endsub
+ endif
+
+ printlog( "Open the macro controls float" )
+ ' if the dialog is open, open the macro controls toolbar as well,
+ ' we need access to the "properties" button
+ bOpen = hShowMacroControls()
+ if ( not bOpen ) then
+ warnlog( "Could not open macro controls, aborting" )
+ hCloseBasicIde()
+ brc = hDestroyDocument()
+ goto endsub
+ endif
+
+ printlog( "Select every control, open its properties and verify its name, close properties" )
+ for iCurrentControl = 1 to ICONTROLCOUNT
+
+ if ( instr( gtSysName, "Solaris" ) > 0 ) then
+ qaerrorlog( "Skipping frame control on Solaris" )
+ else
+ hSelectControl( iCurrentControl )
+ hOpenPropertyBrowser()
+ sCurrentControl = lsControlNames( iCurrentControl )
+ hPBGetControlName( sCurrentControl )
+ hClosePropertyBrowser()
+ endif
+
+ next iCurrentControl
+
+ ' we need to delete the list-content otherwise we run into index-problems
+ ListAllDelete( lsControlNames() )
+
+ printlog( "Cleanup: Close the BASIC-IDE" )
+ printlog( "Close the BASIC IDE" )
+ hCloseBasicIde()
+
+ if ( getDocumentCount <> 1 ) then
+ warnlog( "Number of open documents is incorrect, expected one only" )
+ endif
+
+ printlog "Save the document"
+ printlog( "save the document" )
+ Call hFileSaveAsKill( sFile )
+
+ printlog "Close it"
+ printlog( "close the document" )
+ brc = hDestroyDocument()
+
+ printlog( "" )
+ printlog( "Test case 2: Verify that all items keep their names after close and reload of the document" )
+
+ printlog( "Open the file again" )
+ printlog( "Open the document" )
+ hFileOpen( sFile )
+
+ printlog "Open tools/macro and select the last module for the current document"
+ printlog( "open the basic-IDE of this document, open controls, activate 'Select-mode' and open the properties" )
+ ToolsMacro_uno
+ kontext "Makro"
+ irc = hSelectNodeByName( MakroAus , CMODULE )
+ if ( irc = 0 ) then
+ qaerrorlog( "Searching node by name failed. Using fallback" )
+ hSelectTheLastnode( MakroAus )
+ else
+ printlog( "The node was found. Good." )
+ endif
+
+ brc = hIsMacroEditButtonEnabled()
+ if ( not brc ) then
+ warnlog( "Edit-Button is not enabled, the test cannot continue" )
+ kontext "Makro"
+ Makro.cancel()
+ brc = hDestroyDocument()
+ goto endsub
+ endif
+
+ printlog( "Click 'Edit' to edit the module" )
+ printlog( "Edit the module" )
+ Bearbeiten.Click()
+ if ( WaitSlot <> WSFinished ) then
+ warnlog( "Slot not finished after 1 second" )
+ endif
+
+ kontext "BasicIDE"
+ printlog( "Find the dialog we created before" )
+ ' try to find our dialog again by stepping through the tabbar
+ bOpen = hFindFirstDialog()
+ if ( not bOpen ) then
+ warnlog( "Could access dialog, aborting test" )
+ hCloseBasicIde()
+ brc = hDestroyDocument()
+ goto endsub
+ endif
+
+ printlog( "Open the macro controls float" )
+ ' if the dialog is open, open the macro controls toolbar as well,
+ ' we need access to the "properties" button
+ bOpen = hShowMacroControls()
+ if ( not bOpen ) then
+ warnlog( "Could not open macro controls, aborting" )
+ hCloseBasicIde()
+ brc = hDestroyDocument()
+ goto endsub
+ endif
+
+ printlog( "Select every control, open its properties and verify its name, close properties" )
+ for iCurrentControl = 1 to ICONTROLCOUNT
+
+ if ( instr( gtSysName, "Solaris" ) > 0 ) then
+ qaerrorlog( "Skipping frame control on Solaris" )
+ else
+ hSelectControl( iCurrentControl )
+ hOpenPropertyBrowser()
+ sCurrentControl = lsControlNames( iCurrentControl )
+ hPBGetControlName( sCurrentControl )
+ hClosePropertyBrowser()
+ endif
+
+ next iCurrentControl
+
+ ' we need to delete the list-content otherwise we run into index-problems
+ ListAllDelete( lsControlNames() )
+
+ printlog( "Cleanup: Close the BASIC-IDE" )
+ printlog( "Close the BASIC IDE" )
+ hCloseBasicIde()
+
+ printlog( "Cleanup: Close the document" )
+ printlog( "Close the document" )
+ brc = hDestroyDocument()
+
+ printlog( "Cleanup: Delete the file we created" )
+ hDeleteFile( sFile )
+
+ printlog( "Repeat this for every application" )
+
+ next iApplication
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/basic_gridcontrol.inc b/testautomation/framework/optional/includes/basic_gridcontrol.inc
new file mode 100644
index 000000000000..dc96ef30e16c
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_gridcontrol.inc
@@ -0,0 +1,131 @@
+'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 : gridcontrol
+'*
+'\******************************************************************************
+
+testcase tGridcontrolLoad
+ dim sLocation as string
+ dim i,x,a as integer
+ dim sTemp as string
+ dim lFiles(200) as string
+ dim bTemp as boolean
+ dim iError, iOK as integer
+
+ sLocation = "framework/optional/include/basic_gridcontrol.inc::"
+
+ hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW )
+
+ printlog "Open the test document"
+ call hFileOpen(convertPath(gTestToolPath + "framework/optional/input/gridcontrol.odt"))
+ printlog "Security dialog might come up"
+ kontext "SecurityWarning"
+ if SecurityWarning.exists(5) then
+ printlog "Allow to run macros"
+ SecurityWarning.ok
+ endif
+ call sleep 1
+
+ printlog "Start the macro, that performs the test"
+ printlog "Tools->Macros->Run Macro..."
+ ToolsMacrosRunMacro
+ Kontext "ScriptSelector"
+ if ScriptSelector.exists(10) then
+ x = LibraryTreeList.getItemCount
+ printlog "Look for library 'gridcontrol'"
+ for i = 1 to x
+ sTemp = LibraryTreeList.getItemText(i)
+ 'printlog "("+i+"/"+x+"): '" + sTemp + "'"
+ if (instr(sTemp,"gridcontrol")>0 OR instr(sTemp,"GRIDCONTROL")) then
+ a = i
+ printlog "Found library ("+i+"/"+x+"): '" + sTemp + "'"
+ endif
+ next i
+ if 0 <> a then
+ printlog "Select the library and unfold it"
+ LibraryTreeList.select(a)
+ LibraryTreeList.typeKeys("+")
+ printlog "Go to 'Standard' and unfold"
+ LibraryTreeList.typeKeys("<down>")
+ LibraryTreeList.typeKeys("+")
+ printlog "Go to 'Module1'"
+ LibraryTreeList.typeKeys("<down>")
+
+ printlog "Select macro name 'VclTestTool'"
+ x = ScriptList.getItemCount
+ for i = 1 to x
+ sTemp = ScriptList.getItemText(i)
+ 'printlog "("+i+"/"+x+"): '" + sTemp + "'"
+ if "VclTestTool" = sTemp then
+ a = i
+ printlog "Found macro ("+i+"/"+x+"): '" + sTemp + "'"
+ endif
+ next i
+ if (0 <> a) then
+ printlog "Select the macro"
+ ScriptList.select(a)
+ printlog "Start the macro by pressing the button 'run'"
+ ScriptSelector.ok
+ printlog "sleep... at least 60 seconds"
+ call sleep(60)
+ printlog "If macro fails for whatever reason, a message comes up"
+ Kontext
+ if active.exists() then
+ warnlog "" + active.getText
+ active.ok
+ try
+ EditCopy
+ warnlog getclipboard()
+ catch
+ endcatch
+ printlog "close basic ide"
+ call hCloseDocument()
+ printlog "close document"
+ call hCloseDocument()
+ goto endsub
+ endif
+
+ else
+ warnlog sLocation + "Macro not found: 'Main'"
+ endif
+ else
+ warnlog sLocation + "Library not found: 'gridcontrol'"
+ endif
+ else
+ warnlog sLocation + "'Run macro dialog' didn't came up"
+ endif
+
+ printlog "clean up"
+ printlog "Close the document, else an error about the navigator will be thrown"
+ if getDocumentcount > 0 then
+ call hCloseDocument()
+ endif
+endcase
+
diff --git a/testautomation/framework/optional/includes/basic_ide.inc b/testautomation/framework/optional/includes/basic_ide.inc
new file mode 100644
index 000000000000..799260201257
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_ide.inc
@@ -0,0 +1,335 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Macro Dialogs opened from Basic-IDE
+'*
+'\******************************************************************************
+
+testcase tBasic_IDE_Toolbar_Module
+
+ qaerrorlog( "Replace this test asap, the approach is unusable" )
+
+ dim brc as boolean
+ dim cSourceFile as string
+ cSourceFile = gTesttoolpath & "framework\optional\input\resetregistration.txt"
+ cSourceFile = convertpath( cSourceFile )
+
+
+
+
+ printlog "open a new writer-doc"
+ gApplication = "WRITER"
+ hCreateDocument()
+
+ brc = hOpenBasicOrganizerFromDoc()
+ brc = hCreateModuleForDoc()
+
+
+ kontext "macrobar"
+ printlog "- compile"
+ hClickToolbarButton( Compile )
+
+ printlog "- Run Basic"
+ hClickToolbarButton( BasicRun )
+
+ printlog "- Step Procedure"
+ hClickToolbarButton( ProcedureStep )
+
+ printlog "- Stop Basic"
+ hClickToolbarButton( BasicStop )
+
+ printlog "- Single Step"
+ hClickToolbarButton( SingleStep )
+
+ printlog "- Step Back"
+ hClickToolbarButton( StepBack )
+
+ printlog "- Breakpoint => activate"
+ hClickToolbarButton( Breakpoint )
+
+
+ printlog "- Breakpoint => deactivate"
+ hClickToolbarButton( Breakpoint )
+
+ printlog "- Add Watch => deactivate"
+ hClickToolbarButton( AddWatch )
+
+ printlog "- Find Paranthese"
+
+ kontext "macrobar"
+ hClickToolbarButton( FindParanthese )
+
+ try
+ Controls.TearOff()
+ warnlog "Controls are active in a module window => bug!"
+ catch
+ printlog( "Controls are not active->OK" )
+ endcatch
+ if ( WaitSlot <> WSFinished ) then
+ warnlog( "Slot not finished within 1 second" )
+ endif
+
+ printlog( "- Insert Source Text (" & cSourceFile & ")" )
+
+
+ InsertSourceText.Click()
+ kontext "oeffnendlg"
+ if ( OeffnenDlg.exists( 1 ) ) then
+ Dateiname.SetText( cSourceFile )
+ Oeffnen.click()
+ else
+ warnlog( "File Open dialog did not open" )
+ endif
+
+ ' possible 'could not read from file' error-message -> this is a bug
+ kontext "Active"
+ if ( Active.exists( 1 ) ) then
+ warnlog( "Unexpected active: " & active.gettext() )
+ active.ok()
+ endif
+
+ kontext "macrobar"
+ printlog "- Save Source Test "
+
+ hClickToolbarButton( SaveSourceTest )
+
+ kontext "speicherndlg"
+ if ( SpeichernDlg.exists( 1 ) ) then
+ Dateiname.SetText ConvertPath (gOfficepath + "user\work\global_test.bas")
+ Speichern.click()
+ else
+ warnlog( "File Save dialog is missing" )
+ endif
+
+ kontext "active"
+ if ( Active.Exists( 1 ) ) then
+ printlog( "Closing Messagebox with <Yes>")
+ Active.Yes()
+ endif
+
+ hDestroyDocument() ' for Basic-IDE
+ hDestroyDocument() ' the new writer-doc
+
+endcase
+
+'*******************************************************************************
+
+testcase tBasic_IDE_Toolbar_Dialogs
+
+ qaerrorlog( "Replace this test asap, the approach is unusable" )
+
+ dim bIsOpen as boolean
+ dim brc as boolean
+
+ dim sBasfile1 as string
+ sBasFile1 = gTesttoolpath & "framework\optional\input\resetregistration.txt"
+ sBasFile1 = convertpath( sBasFile1 )
+
+ dim sBasFile2 as string
+ sBasFile2 = convertpath( gOfficepath & "user\work\global_test.bas" )
+
+
+ printlog "open a new writer-doc"
+ gApplication = "WRITER"
+ hCreateDocument()
+
+ printlog "create a new module "
+ brc = hOpenBasicOrganizerFromDoc()
+ brc = hCreateModuleForDoc()
+
+ kontext "basicide"
+ Tabbar.OpenContextMenu
+ hMenuSelectNr ( 1 )
+ hMenuSelectNr ( 2 )
+ if ( DialogWindow.Exists ( 2 ) ) then
+ printlog( "Dialog Editor window is open. Good." )
+ else
+ warnlog "No dialog window is shown!"
+ end if
+
+ try
+ kontext "MacroBar"
+ Compile.Click()
+ warnlog( """Compile"" is enabled" )
+ catch
+ printlog( """Compile"" is disabled" )
+ endcatch
+
+ try
+ kontext "MacroBar"
+ BasicRun.Click()
+ warnlog( """Run Basic"" is enabled" )
+ catch
+ printlog( """Run Basic"" is disabled" )
+ endcatch
+
+ printlog "- Step Procedure (disabled)"
+ try
+ kontext "MacroBar"
+ ProcedureStep.Click()
+ warnlog( """Step Procedure"" is enabled" )
+ catch
+ printlog( """Step Procedure"" is disabled" )
+ endcatch
+
+ try
+ kontext "MacroBar"
+ BasicStop.Click()
+ warnlog( """Stop Basic"" is enabled" )
+ catch
+ printlog( """Stop Basic"" is disabled" )
+ endcatch
+
+ try
+ kontext "MacroBar"
+ SingleStep.Click()
+ warnlog( """Single Step"" is enabled" )
+ catch
+ printlog( """Single Step"" is enabled" )
+ endcatch
+
+ try
+ kontext "MacroBar"
+ StepBack.Click()
+ warnlog( """Single Step Back"" is enabled" )
+ catch
+ printlog( """Single Step Back"" is enabled" )
+ endcatch
+
+ try
+ kontext "MacroBar"
+ Breakpoint.Click()
+ warnlog( """Breakpoint"" is enabled" )
+ catch
+ printlog( """Breakpoint"" is disabled" )
+ endcatch
+
+
+ try
+ kontext "MacroBar"
+ AddWatch.Click()
+ warnlog( """Add Watch"" is enabled" )
+ catch
+ printlog( """Add Watch"" is disabled" )
+ endcatch
+
+
+ try
+ kontext "MacroBar"
+ FindParanthese.Click()
+ warnlog( """Find Paranthese"" is enabled" )
+ catch
+ printlog( """Find Paranthese"" is disabled" )
+ endcatch
+
+
+ try
+ kontext "macrobar"
+ InsertSourceText.Click()
+ warnlog( """Insert Source Text"" is enabled" )
+
+ kontext "oeffnendlg"
+ if ( OeffnenDlg.exists( 2 ) ) then
+ Dateiname.SetText( sBasFile1 )
+ Oeffnen.Click()
+ else
+ warnlog( "File Open dialog missing" )
+ endif
+ catch
+ printlog( """Insert Source Text"" is disabled" )
+ endcatch
+
+
+ printlog "- Save Source Test (disabled)"
+
+ try
+ kontext "macrobar"
+ SaveSourceTest.Click()
+ warnlog( """Save Source Text"" is enabled" )
+
+ kontext "speicherndlg"
+ if ( SpeichernDlg.exists( 2 ) ) then
+ Dateiname.SetText( sBasFile2 )
+ Speichern.Click()
+ else
+ warnlog( "File Save dialog is missing" )
+ endif
+
+ kontext "active"
+ if ( Active.Exists( 1 ) ) then
+ Active.Yes()
+ endif
+ catch
+ printlog( """Save Source Text"" is disabled" )
+ endcatch
+
+
+ bIsOpen = hShowMacroControls()
+ if ( bIsOpen ) then
+ ToolsCollectionBar.Close()
+ end if
+
+ Call hDestroyDocument() ' for Basic-IDE
+ Call hDestroyDocument() ' the new writer-doc
+
+endcase
+
+'******************************************************************************'
+
+function hClickToolbarButton( oButton as object ) as boolean
+
+ const CFN = "hClickToolbarButton(): "
+
+ dim iTry as integer
+ dim brc as boolean : brc = false
+
+ printlog( CFN & "Clicking button on toolbar: " & oButton.name() )
+ for iTry = 1 to 5
+
+ try
+ oButton.click()
+ brc = true
+ exit for
+ catch
+ printlog( CFN & "Retrying..." )
+ endcatch
+
+ if ( iTry = 5 ) then
+ exit for
+ endif
+
+ wait( 500 )
+
+ next iTry
+
+ if ( WaitSlot( 2000 ) <> WSFinished ) then
+ warnlog( CFN & "Slot not finished within 1 second" )
+ endif
+
+end function
diff --git a/testautomation/framework/optional/includes/basic_issues.inc b/testautomation/framework/optional/includes/basic_issues.inc
new file mode 100644
index 000000000000..d07326226ed8
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_issues.inc
@@ -0,0 +1,224 @@
+'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 : Joerg.Skottke@Sun.Com
+'*
+'* short description : Regression tests for especially annoying BASIC issues
+'*
+'\******************************************************************************
+
+function hIDERunMacro()
+
+ kontext "MacroBar"
+ if ( MacroBar.exists() ) then
+ BasicRun.click()
+ else
+ warnlog( "MacroBar not accessible" )
+ endif
+
+end function
+
+'*******************************************************************************
+
+function hTestActive( cString as string , iMethod as integer , bExact as boolean ) as integer
+
+ ' Return values:
+ ' -1 = Exact match expected, fuzzy match found
+ ' -2 = No match
+ ' -3 = content of messagebox not relevant
+ ' -4 = Messagebox not displayed / Macro not executed
+ ' 1 - 4 = Number of buttons on the dialog
+
+ const CFN = "hTestActive()::"
+
+ dim cMsg as string ' The string printed in the message box
+ dim rc as integer ' Returncode for error handling and returnvalue
+ dim buttons as integer ' Number of buttons on the message box
+
+ kontext "Active"
+ if ( Active.exists( 2 ) ) then
+
+ cMsg = Active.getText()
+
+ if ( cString <> "" ) then
+ if ( instr( active.getText(), cString ) <> 0 ) then
+ if ( active.getText() = cString ) then
+ 'printlog( CFN & "Correct message found (exact match): " & cMsg )
+ rc = 0
+ else
+ if ( bExact ) then
+ warnlog( CFN & "Message is no exact match: " & cMsg )
+ rc = -1
+ else
+ 'printlog( CFN & "Correct message found (fuzzy match): " & cMsg )
+ rc = 0
+ endif
+ endif
+ else
+ warnlog( CFN & "Messagebox has wrong content: " & cMsg )
+ rc = -4
+ endif
+ else
+ 'printlog( CFN & "Messagebox: " & cMsg )
+ rc = -3
+ endif
+
+ buttons = Active.getButtonCount()
+ 'printlog( CFN & "Number of buttons: " & buttons )
+ select case( iMethod )
+ case 1 : Active.OK()
+ case 2 : Active.Cancel()
+ case 3 : Acitve.Yes()
+ case 4 : Active.No()
+ end select
+ else
+ warnlog( CFN & "Messagebox is missing" )
+ endif
+
+ if ( rc = 0 ) then hTestActive() = buttons
+
+end function
+
+'*******************************************************************************
+
+testcase t_macros()
+
+ gApplication = "WRITER"
+ call hNewDocument()
+ hInitBasicIDE( "TestIssues" )
+
+ printlog( "" )
+ printlog( " ---------- i41695 ------------ " )
+ hInsertMacroFromFile( "i41695" )
+ hIDERunMacro()
+ hTestActive( "i41695-1", 1 , TRUE )
+ hTestActive( "i41695-2", 1 , TRUE )
+
+ printlog( "" )
+ printlog( " ---------- i83978 ------------ " )
+ hInsertMacroFromFile( "i83978" )
+ hIDERunMacro()
+ hTestActive( "com.sun.star.container.NoSuchElementException", 1 , FALSE )
+
+ printlog( "" )
+ printlog( " ---------- i82830 ------------ " )
+ hInsertMacroFromFile( "i82830" )
+ hIDERunMacro()
+ hTestActive( "12D687" , 1 , TRUE )
+ hTestActive( "4553207", 1 , TRUE )
+
+ if ( gISOLang = "en-US" ) then
+ printlog( "" )
+ printlog( " ---------- i81674 ------------ " )
+ hInsertMacroFromFile( "i81674" )
+ hIDERunMacro()
+ hTestActive( "250" , 1 , FALSE )
+ hTestActive( "Yes" , 1 , TRUE )
+ hTestActive( "True", 1 , TRUE )
+ hTestActive( "On" , 1 , TRUE )
+ endif
+
+ printlog( "" )
+ printlog( " ---------- i80532 ------------ " )
+ hInsertMacroFromFile( "i80532" )
+ hIDERunMacro()
+ hTestActive( "-10", 1 , FALSE )
+ hTestActive( "1" , 1 , FALSE )
+ hTestActive( "-10", 1 , FALSE )
+
+ printlog( "" )
+ printlog( " ---------- i84040 ------------ " )
+ hInsertMacroFromFile( "i84040" )
+ hIDERunMacro()
+ hTestActive( "False", 1 , TRUE )
+ hTestActive( "False", 1 , TRUE )
+
+ printlog( "" )
+ printlog( " ---------- i86265 ------------ " )
+ hInsertMacroFromFile( "i86265" )
+ hIDERunMacro()
+ hTestActive( "i86265-1", 1 , TRUE )
+ hTestActive( "i86265-2", 1 , TRUE )
+
+ printlog( "" )
+ printlog( " ---------- i92329 ------------ " )
+ hInsertMacroFromFile( "i92329" )
+ hIDERunMacro()
+ hTestActive( "Return an Array" , 1 )
+
+ printlog( "" )
+ printlog( " ---------- i97038 ------------ " )
+ hInsertMacroFromFile( "i97038" )
+ hIDERunMacro()
+ hTestActive( "1900" , 1 , FALSE )
+ hTestActive( "2" , 1 , FALSE )
+'---------
+ printlog( "" )
+ printlog( " ---------- i103691 ------------ " )
+ hInsertMacroFromFile( "i103691" )
+ hIDERunMacro()
+ hTestActive( "Equal" , 1 , FALSE )
+
+ printlog( "" )
+ printlog( " ---------- i103697 ------------ " )
+ hInsertMacroFromFile( "i103697" )
+ hIDERunMacro()
+ hTestActive( "i103697" , 1 , FALSE )
+
+ printlog( "" )
+ printlog( " ---------- i103990 ------------ " )
+ hInsertMacroFromFile( "i103990" )
+ hIDERunMacro()
+ hTestActive( "42" , 1 , FALSE )
+ hTestActive( "43" , 1 , FALSE )
+ hTestActive( "Pi" , 1 , FALSE )
+
+'-------
+ printlog( "" )
+ printlog( " ---------- MessageBoxes ------------ " )
+ hInsertMacroFromFile( "MessageBoxes" )
+ hIDERunMacro()
+ if ( hTestActive( "0x" , 1 , TRUE ) > 1 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "1x" , 1 , TRUE ) > 2 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "2x" , 2 , TRUE ) > 3 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "3x" , 2 , TRUE ) > 3 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "4x" , 4 , TRUE ) > 2 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "5x" , 2 , TRUE ) > 2 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "16" , 2 , TRUE ) > 3 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "32" , 2 , TRUE ) > 3 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "48" , 2 , TRUE ) > 3 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "64" , 1 , TRUE ) > 1 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "128", 2 , TRUE ) > 3 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "256", 2 , TRUE ) > 3 ) then warnlog( "Wrong resource type" )
+ if ( hTestActive( "512", 2 , TRUE ) > 3 ) then warnlog( "Wrong resource type" )
+
+ printlog( "" )
+ hCloseBasicIDE()
+ hCloseDocument()
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/basic_library_export.inc b/testautomation/framework/optional/includes/basic_library_export.inc
new file mode 100644
index 000000000000..18bb4af4441c
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_library_export.inc
@@ -0,0 +1,200 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Export BASIC library (flat)
+'*
+'\******************************************************************************
+
+testcase tBasicLibraryExport
+
+ printlog( "Export a basic script as library (flat format)" )
+
+ ' Assumption: All actions take place in the user/work directory
+ ' macro taken from framework/tools/input/macros.txt::tBasicLibraryExport
+
+ ' For constants (UPPERCASE) see .BAS-file
+
+ dim cDocumentName as string
+ dim cLibraryName as string
+ dim iNodeCount as integer
+
+ dim cFile as string : cFile = hGetWorkPath() & LIBRARY_NAME
+
+ dim cMsg as string
+
+ dim iCurrentLib as integer
+
+ printlog( "Delete potential leftovers from prior test run" )
+ if ( dir( cFile ) <> "" ) then
+ QAErrorLog( "Files from prior test run exist: " & cFile )
+ hDeleteFile( hGetWorkPath() & LIBRARY_NAME & gPathSigne & "dialog.xlb" )
+ hDeleteFile( hGetWorkPath() & LIBRARY_NAME & gPathSigne & "Module1.xba" )
+ hDeleteFile( hGetWorkPath() & LIBRARY_NAME & gPathSigne & "script.xlb" )
+ rmdir( hGetWorkPath() & LIBRARY_NAME ) : printlog( "Remove directory" )
+ endif
+
+ printlog( "Open a new text document" )
+ hInitSingleDoc()
+ hChangeDoc()
+
+ printlog( "Open another text document" )
+ gApplication = "WRITER"
+ hCreateDocument()
+
+ printlog( "Open the BASIC organizer (Tools/Macros/BASIC)" )
+ ToolsMacro_uno
+
+ kontext "Makro"
+ printlog( "Select the document" )
+ iNodeCount = hGetNodeCount( MakroAus )
+ cDocumentName = hSelectNode( MakroAus, iNodeCount )
+
+ printlog( "Click <Manage...>" )
+ Verwalten.click()
+
+ printlog( "Open the Libraries tabpage" )
+ hSelectBasicObjectOrganizerTab( 3 )
+
+ kontext "TabBibliotheken"
+ printlog( "Select document Untitled2" )
+ Bibliothek.select( DOCUMENT_POSITION )
+
+ ' verify that the correct document is selected
+ if ( Bibliothek.getSelText() <> cDocumentName ) then
+ warnlog( "Incorrect document selected on libraries tab, aborting" )
+ goto endsub
+ endif
+
+ printlog( "Click <New>" )
+ Neu.click()
+
+ kontext "NeueBibliothek"
+ printlog( "Name the library: " & LIBRARY_NAME )
+ BibliotheksName.setText( LIBRARY_NAME )
+ NeueBibliothek.ok()
+
+ kontext "TabBibliotheken"
+ printlog( "Verify that the new library is selected in the libraries list" )
+ cLibraryName = BibliotheksListe.getSelText()
+
+ printlog( "Click <Edit>" )
+ Bearbeiten.click()
+
+ printlog( "Insert a macro" )
+ hInsertMacroFromFile( LIBRARY_NAME )
+
+ printlog( "Close the BASIC IDE" )
+ hCloseBasicIDE()
+
+ printlog( "Open the BASIC macro organizer" )
+ ToolsMacro_uno
+
+ kontext "Makro"
+ printlog( "Select the work document" )
+ iNodeCount = hGetNodeCount( MakroAus )
+ hSelectNode( MakroAus, iNodeCount )
+
+ printlog( "Click <Manage...>" )
+ Verwalten.click()
+
+ printlog( "Go to the libraries-tab" )
+ hSelectBasicObjectOrganizerTab( 3 )
+
+ kontext "TabBibliotheken"
+ printlog( "Select the document at pos. " & DOCUMENT_POSITION )
+ Bibliothek.select( DOCUMENT_POSITION )
+
+ printlog( "Verify that the correct document is selected" )
+ if ( Bibliothek.getSelText() <> cDocumentName ) then
+ warnlog( "Incorrect document selected on libraries tab, aborting" )
+ goto endsub
+ endif
+
+ printlog( "Select the new library" )
+ kontext "TabBibliotheken"
+ for iCurrentLib = 1 to Bibliotheksliste.getItemCount()
+ Bibliotheksliste.select( iCurrentLib )
+ if ( Bibliotheksliste.getSelText = LIBRARY_NAME ) then
+ exit for
+ endif
+ next iCurrentLib
+
+ printlog( "Click export" )
+ Export.click()
+
+ kontext "ExportBasicLibraryDlg"
+ if ( ExportBasicLibraryDlg.exists( 2 ) ) then
+
+ printlog( "Export as library" )
+ ExportAsLibrary.check()
+ ExportBasicLibraryDlg.ok()
+
+ kontext "Active"
+ printlog( "Check for non existing directory warning" )
+ ' Note: Querying for an Active will also find the Libraries tabpage.
+ ' So we need to check which active we've got. RT = 373 is the tabcontrol.
+ if ( Active.exists( 1 ) ) then
+ if ( Active.getRT() <> 373 ) then
+ warnlog( "Unexpected messagebox: " & Active.getText() )
+ active.ok()
+ else
+ printlog( "Back on tab-control, good." )
+ endif
+ else
+ printlog( "No warning for non-existing directory, good." )
+ endif
+
+ Kontext "OeffnenDlg"
+ if ( Oeffnendlg.exists( 1 ) ) then
+ Oeffnen.click()
+ else
+ warnlog( "File Open dialog not displayed" )
+ endif
+
+ else
+ warnlog( "The ""Export Library"" dialog was not displayed" )
+ endif
+
+ kontext "TabBibliotheken"
+ printlog( "Close the macro/libraries organizer" )
+ if ( TabBibliotheken.exists( 1 ) ) then
+ TabBibliotheken.cancel()
+
+ kontext "Makro"
+ printlog( "Cancel macro organizer" )
+ Makro.cancel()
+
+ hFileCloseAll()
+ else
+ warnlog( "Dialog <TabBibliotheken> could not be accessed" )
+ call exitRestartTheOffice()
+ endif
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/basic_library_import.inc b/testautomation/framework/optional/includes/basic_library_import.inc
new file mode 100644
index 000000000000..ec4cc8fa3b53
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_library_import.inc
@@ -0,0 +1,123 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Import BASIC library (flat)
+'*
+'\******************************************************************************
+
+testcase tBasicLibraryImport
+
+ printlog( "Import a BASIC library" )
+
+ dim cMsg as string
+ dim iCurrentLib as integer
+
+ ToolsMacro_uno
+
+ kontext "Makro"
+ MakroAus.Select( 1 )
+
+ Verwalten.click()
+
+ hSelectBasicObjectOrganizerTab( 3 )
+
+ printlog( "Select My macros" )
+ kontext "TabBibliotheken"
+ Bibliothek.select( 1 )
+
+ printlog( "Click to add a library" )
+ Hinzufuegen.click()
+
+ printlog( "Enter the name of the library: " & LIBRARY_NAME )
+ kontext "OeffnenDlg"
+ DateiName.setText( LIBRARY_NAME )
+
+ printlog( "Step into the directory" )
+ OeffnenDlg.typeKeys( "<RETURN>" )
+
+ printlog( "Enter &quot;dialog.xlb&quot;" )
+ DateiName.setText( "dialog.xlb" )
+
+ printlog( "Open dialog.xlb" )
+ Oeffnen.click()
+
+ kontext "active"
+ if ( active.exists( 1 ) ) then
+ if ( active.getRT() <> 373 ) then
+ cMSG = Active.getText()
+ cMsg = hRemoveLineBreaks( cMsg )
+ warnlog( "Autocompletion failed: " & cMsg )
+ Active.ok()
+ Kontext "OeffnenDlg"
+ DateiName.setText( "dialog.xlb" )
+ Oeffnen.click()
+ endif
+ endif
+
+ printlog( "Confirm to append the library" )
+ Kontext "AppendLibraries"
+ AppendLibraries.ok()
+
+ printlog( "Select the new library" )
+ kontext "TabBibliotheken"
+ for iCurrentLib = 1 to Bibliotheksliste.getItemCount()
+ Bibliotheksliste.select( iCurrentLib )
+ if ( Bibliotheksliste.getSelText = LIBRARY_NAME ) then
+ exit for
+ endif
+ next iCurrentLib
+
+ printlog( "Delete the library, confirm with YES" )
+ Kontext "TabBibliotheken"
+ Loeschen.click()
+
+ Kontext "Active"
+ if ( Active.exists( 1 ) ) then
+ active.yes()
+ else
+ warnlog( "Deletion warning for libraries is missing" )
+ endif
+
+ printlog( "Close macro/library organizer" )
+ kontext "TabBibliotheken"
+ TabBibliotheken.cancel()
+
+ printlog( "Close macro organizer" )
+ kontext "Makro"
+ Makro.cancel()
+
+ hDestroyDocument()
+
+ hDeleteFile( hGetWorkPath() & LIBRARY_NAME & gPathSigne & "dialog.xlb" )
+ hDeleteFile( hGetWorkPath() & LIBRARY_NAME & gPathSigne & "Module1.xba" )
+ hDeleteFile( hGetWorkPath() & LIBRARY_NAME & gPathSigne & "script.xlb" )
+ rmdir( hGetWorkPath() & LIBRARY_NAME ) : printlog( "Remove directory" )
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/basic_macros.inc b/testautomation/framework/optional/includes/basic_macros.inc
new file mode 100644
index 000000000000..0d5e2a451d60
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_macros.inc
@@ -0,0 +1,407 @@
+'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 : joerg.skottke@sun.com
+' **
+' ** short description : check macro-dialogs / BASIC-IDE ( 1. part )
+' **
+'\******************************************************************************
+
+
+testcase tMakro_In_All_Apps
+
+
+ dim brc as boolean
+ dim cApp as string
+ dim iApp as Integer
+ dim bBug as Boolean
+ dim cMsg as string
+ bBug = FALSE
+
+ const CMACRO = "AppMakro"
+
+
+ for iApp = 1 to 7
+
+ cApp = hNumericDoctype( iApp )
+ printlog( cApp )
+
+ printlog( "Open a new document" )
+ brc = hCreateDocument()
+
+ brc = hInitBasicIde( CMACRO )
+ if ( not brc ) then
+ warnlog( "Could not open the BASIC Macro Organizer, aborting" )
+ call hDestroyDocument()
+ goto endsub
+ endif
+
+ printlog "Close the BASIC-IDE"
+ brc = hCloseBasicIde()
+
+ printlog( "Close the navigator (Master-doc)" )
+ brc = hCloseNavigator()
+
+ printlog( "Close the document" )
+ FileClose
+
+ printlog( "Close the messagebox (document changed)" )
+ kontext "messagebox"
+ if ( MessageBox.Exists( 1 ) ) then
+ cMsg = MessageBox.getText()
+ cMsg = hRemoveLineBreaks( cMsg )
+ printlog( "MessageBox: " & cMsg )
+ MessageBox.No()
+ else
+ warnlog( "No warning for changed document" )
+ end if
+
+ next iApp
+
+endcase
+
+'*******************************************************************************
+
+testcase tMakro_Dialog
+
+ if ( gBuild < 9305 ) then
+ warnlog( "#i87457# - Application macros assigned to userlayer" )
+ goto endsub
+ endif
+
+
+ dim brc as boolean
+ dim cMsg as string
+
+ dim iPos as integer
+ dim iLibraryItemCount as integer
+
+ dim iCurrentLibrary as Integer
+ dim XLBFILE as String
+ XLBFILE = gTesttoolPath & "framework\optional\input\AppLibrary1\script.xlb"
+ const CFN = "tMakro_Dialog::"
+ const CMACRO = "MacroDlg"
+
+
+ gApplication = "WRITER"
+ printlog( "Open a new document" )
+ brc = hCreateDocument()
+
+ printlog( "Create a new library, a new module, open Basic-Ide" )
+ brc = hInitBasicIde( CMACRO )
+ if ( not brc ) then
+ warnlog( CFN & "Could not open BASIC-IDE, aborting" )
+ goto endsub
+ endif
+
+ printlog( "Close the Basic-Ide" )
+ kontext "BasicIDE"
+ hCloseBasicIde()
+
+ printlog( "Open the Basic Macro Organizer" )
+ brc = hOpenBasicOrganizerFromDoc()
+
+ printlog( "Select the last Module for the current document" )
+ iPos = hSelectTheLastNode( MakroAus )
+
+ printlog( "Click Organize..." )
+ Verwalten.Click()
+
+ printlog( "Select Modules-tab" )
+ brc = hSelectBasicObjectOrganizerTab( 1 )
+
+
+ printlog( "Press 'new module'" )
+ kontext "tabmodule"
+ NeuesModul.Click()
+
+ kontext "neuesmodul"
+ printlog( "Cancel the dialog" )
+ NeuesModul.Cancel()
+
+ brc = hSelectBasicObjectOrganizerTab( 2 )
+
+ kontext "tabdialogs"
+ printlog( "Press 'new dialog'" )
+ NewDialog.Click()
+
+ printlog( "Cancel the dialog" )
+ kontext "neuerdialog"
+ NeuerDialog.Cancel()
+
+ kontext
+ printlog( "Select the libraries Tab" )
+ brc = hSelectBasicObjectOrganizerTab( 3 )
+
+
+ printlog( "Press 'New' on the libraries tab" )
+ kontext "tabbibliotheken"
+ Neu.Click()
+
+ kontext "neuebibliothek"
+ printlog( "Close the dialog with 'OK'" )
+ Call DialogTest( NeueBibliothek )
+ NeueBibliothek.OK()
+
+ printlog( "Delete 'Library1'" )
+ kontext "tabbibliotheken"
+ Loeschen.Click()
+
+ printlog( "Close the warning" )
+ kontext "active"
+ if ( Active.Exists() ) then
+ cMsg = active.getText()
+ cMsg = hRemoveLineBreaks( cMsg )
+ printlog( "MessageBox: " & cMsg )
+ Active.Yes()
+ else
+ warnlog( "Deletion warning is missing" )
+ endif
+
+ printlog( "Check the number of libraries in list" )
+ kontext "tabbibliotheken"
+ iLibraryItemCount = Bibliotheksliste.getItemCount()
+ if ( iLibraryItemCount <> 1 ) then
+ if ( iLibraryItemCount = 11 ) then
+ warnlog( "#i87457# Macros moved from 'OpenOffice.org Macros' to 'My Macros'" )
+ else
+ warnlog( "Incorrect item count. Should be 1, is: " & iLibraryItemCount )
+ endif
+ endif
+
+ printlog( "Append a xlb-file" )
+ kontext "tabbibliotheken"
+ Hinzufuegen.Click()
+
+ printlog( "Select 'AppLibrary1/script.xlb' from the files list"
+ kontext "oeffnendlg"
+ Dateiname.SetText( ConvertPath ( XLBFILE ) )
+ Oeffnen.Click()
+
+ ' If the .xlb file cannot be found the test cannot continue. Warn and cleanup.
+ kontext "Active"
+ if ( Active.exists( 1 ) ) then
+
+ try
+ Active.getButtonCount()
+
+ warnlog( "Script does not exist warning displayed. Aborting test" )
+ printlog( Active.getText() )
+ active.ok()
+
+ kontext "OeffnenDlg"
+ if ( OeffnenDlg.exists( 1 ) ) then
+ printlog( "Closing File Open dialog" )
+ OeffnenDlg.cancel()
+ endif
+
+ kontext "tabbibliotheken"
+ if ( TabBibliotheken.exists( 1 ) ) then
+ printlog( "Closing Libaries tab" )
+ TabBibliotheken.close()
+ endif
+
+ kontext "Makro"
+ if ( Makro.exists( 1 ) ) then
+ printlog( "Closing Macro organizer" )
+ Makro.close()
+ endif
+
+ printlog( "Exiting test" )
+ goto endsub
+ catch
+ printlog( "Script found and loaded. Good." )
+ endcatch
+
+ endif
+
+ printlog( "Ensure 'Insert as Reference' is unchecked" )
+ kontext "appendlibraries"
+ InsertAsReference.UnCheck()
+
+ printlog( "Check 'Replace existing library'" )
+ ReplaceExistingLibraries.Check()
+
+ printlog( "Press 'OK' to append the library" )
+ kontext "appendlibraries"
+ try
+ AppendLibraries.OK()
+ catch
+ warnlog( "#i85254# Appending libraries leads to crash" )
+ endcatch
+
+ printlog( "Check the number of libraries in list (should be two)" )
+ kontext "tabbibliotheken"
+ iLibraryItemCount = Bibliotheksliste.getItemCount()
+ if ( iLibraryItemCount <> 2 ) then
+ qaerrorlog( "#i87457# Two entries in list expected, found " & iLibraryItemCount )
+ endif
+
+ printlog( "Select the first item" )
+ Bibliotheksliste.TypeKeys( "<HOME>" )
+ for iCurrentLibrary = 1 to iLibraryItemCount
+ if ( Bibliotheksliste.getSelText() = "AppLibrary1" ) then
+ printlog( "Found AppLibrary1" )
+ exit for
+ endif
+ printlog( "This was not AppLibrary1, trying again" )
+ Bibliotheksliste.Typekeys( "<DOWN>" )
+ next iCurrentLibrary
+
+ printlog( "Set a password for AppLibrary1" )
+ kontext "tabbibliotheken"
+ if ( Passwort.IsEnabled() ) then
+ Passwort.Click()
+ kontext "passwddlg"
+ PasswdDLG.Cancel()
+ else
+ warnlog( "Password is disabled for 'AppLibrary1'" )
+ endif
+
+ printlog( "Delete 'AppLibrary1'" )
+ kontext "tabbibliotheken"
+ Loeschen.Click()
+
+ printlog( "Close the warning with YES" )
+ kontext "active"
+ if ( Active.Exists() ) then
+ cMsg = active.getText()
+ cMsg = hRemoveLineBreaks( cMsg )
+ printlog( "MessageBox: " & cMsg )
+ Active.Yes()
+ else
+ warnlog( "Expected confirmation dialog for delete" )
+ endif
+
+ kontext "tabbibliotheken"
+ printlog( "Press 'edit' on 'Libraries'-tab" )
+ Bearbeiten.Click()
+
+ kontext "BasicIDE"
+ if ( BasicIDE.Exists( 5 ) ) then
+
+ hInsertMacro( 3 )
+
+ printlog( "Close the basic-document" )
+ brc = hCloseBasicIde()
+
+ kontext "active"
+ if ( Active.Exists ( 2 ) ) then
+ cMsg = active.getText()
+ cMsg = hRemoveLineBreaks( cMsg )
+ warnlog( "Unexpected MessageBox: " & cMsg )
+ Active.NO()
+ endif
+
+ else
+ warnlog("#i38978# The Macro-Document is not open, aborting test")
+ call hDestroyDocument()
+ goto endsub
+ endif
+
+ printlog( "Open the BASIC Macro Organizer" )
+ brc = hOpenBasicOrganizerFromDoc()
+
+ printlog( "Select the last macro from the list" )
+ kontext "makro"
+ iPos = hSelectTheLastNode( MakroAus )
+
+ try
+ printlog( "Assign the macro, Tools/customize dialog should open" )
+ Zuordnen.Click ()
+ catch
+ warnlog( "#i106853# Assign-Button is disabled or macro is missing" )
+ endcatch
+
+ printlog( "Activate all tapages and cancel the Tools/Customize dialog" )
+
+ brc = hToolsCustomizeSelectTab( "menu" )
+ brc = hToolsCustomizeSelectTab( "keyboard"
+ if ( not brc ) then
+ qaerrorlog( "#i61765# Keyboard tab missing when called via Tools/Macros->Assign" )
+ endif
+ brc = hToolsCustomizeSelectTab( "events" )
+ brc = hToolsCustomizeSelectTab( "toolbars" )
+
+ printlog( "Cancel Tools/Customize dialog -> Macro Organizer should be open" )
+ brc = hToolsCustomizeClose( 2 )
+
+
+ printlog "Click to run macro"
+ kontext "makro"
+ try
+ Ausfuehren.Click()
+ catch
+ warnlog( "Unable to run macro" )
+ kontext "Makro"
+ Makro.close()
+ endcatch
+
+ kontext "active"
+ if ( active.exists() ) then
+ cMsg = active.getText()
+ cMsg = hRemoveLineBreaks( cMsg )
+ if ( cMsg = "TTMacro3" ) then
+ printlog( "The correct macro has been executed" )
+ else
+ warnlog( "Unknown Messagebox: " & cMsg )
+ endif
+ Active.OK()
+ endif
+
+ printlog( "Open macro organizer from the current document" )
+ brc = hOpenBasicOrganizerFromDoc()
+
+ printlog( "Select the last item in the treelist" )
+ brc = hSelectTheLastNode( MakroAus )
+
+ printlog( "Delete the new module" )
+ Loeschen.Click()
+
+ printlog( "Close the deletion warning" )
+ kontext "active"
+ if ( active.exists() ) then
+ cMsg = active.getText()
+ cMsg = hRemoveLineBreaks( cMsg )
+ printlog( "MessageBox: " & cMsg )
+ Active.Yes()
+ else
+ warnlog( "No confirmation dialog for delete" )
+ endif
+
+ printlog( "Close the macro organizer" )
+ kontext "makro"
+ Makro.Close()
+
+ printlog( "Close the document" )
+ Call hDestroyDocument()
+
+
+endcase
+
+
+
diff --git a/testautomation/framework/optional/includes/basic_modulehide.inc b/testautomation/framework/optional/includes/basic_modulehide.inc
new file mode 100644
index 000000000000..130915ffec46
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_modulehide.inc
@@ -0,0 +1,102 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Verify that hiding modules works
+'*
+'\******************************************************************************
+
+testcase tBasicIdeModuleHide
+
+
+ const CFN = "tBasicIdeModuleHide::"
+
+ dim rc as integer
+ dim brc as boolean
+ dim cDefaultTabName as string
+
+ gApplication = "WRITER"
+ call hNewDocument()
+
+ brc = hOpenBasicOrganizerFromDoc()
+ brc = hCreateModuleForDoc()
+
+ brc = hInsertMacro( 1 )
+ if ( brc ) then
+ printlog( CFN & "Macro has been written successfully" )
+ else
+ warnlog( CFN & "Failed to insert macro" )
+ endif
+
+ rc = hHideModule()
+ if ( rc > 0 ) then
+ warnlog( "Some unexpected error occurred while trying to hide the module" )
+ endif
+
+ try
+ ' hTestMacro is expected to fail, so we jump to the catch statement
+ rc = hTestMacro( 1 )
+ if ( rc = 0 ) then
+ warnlog( "For some reason the original module is still visible" )
+ else
+ warnlog( "There should not be any editingwindow visible" )
+ endif
+ catch
+ printlog( " * unable to locate editwindow -> no module visible." )
+ endcatch
+
+ if ( hOpenBasicObjectOrganizer( 1 ) ) then
+
+ modulliste.typekeys( "<END><RIGHT><DOWN><RIGHT><DOWN>" )
+ try
+ bearbeiten.click()
+ catch
+ warnlog( "#i35097# Crash when editing last module" )
+ endcatch
+
+
+ rc = hTestMacro( 1 )
+ if ( rc = 1 ) then
+ printlog( " * the correct macro-module is open. Good." )
+ else
+ warnlog( "The open macro-module is not the one that was expected" )
+ endif
+
+ hCloseBasicIDE()
+
+ call hCloseDocument()
+
+ else
+
+ warnlog( "restarting the office to recover from errors" )
+ call exitRestartTheOffice()
+
+ endif
+
+
+endcase
diff --git a/testautomation/framework/optional/includes/basic_modulenames.inc b/testautomation/framework/optional/includes/basic_modulenames.inc
new file mode 100644
index 000000000000..28c260642482
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_modulenames.inc
@@ -0,0 +1,347 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Test modulenames on the tabbar
+'*
+'\******************************************************************************
+
+testcase tBasicIdeModuleNames
+
+
+ dim rc as integer
+ dim brc as boolean
+ dim i as integer
+ dim iCurrentName as integer
+ const CMODULE = "TModuleNames"
+ dim cTabName as string
+
+ gApplication = "WRITER"
+ hCreateDocument()
+
+ ' ------ prerequisites ---------
+
+ brc = hInitBasicIde( CMODULE )
+
+
+ brc = hInsertMacro( 1 )
+ if ( rc <> 0 ) then
+ warnlog( "Failed to insert macro" )
+ endif
+
+ cTabName = hGetTabNameFromOrganizer()
+
+ Randomize
+ iCurrentName = Int( 24 * RND ) + 1 ' Range from 1 to 24
+
+ cTabName = hCreateInvalidModuleName( iCurrentName )
+ rc = hRenameTab( cTabName )
+ if ( rc = 1 ) then
+ hHandleInvalidNameWarning( cTabname )
+ else
+ warnlog( "Warning missing" )
+ endif
+
+ cTabname = CMODULE
+ rc = hRenameTab( cTabname )
+ if ( rc <> 0 ) then
+ brc = hHandleInvalidNameWarning( cTabname )
+ if ( brc ) then
+ warnlog( "Failed to set valid name" )
+ endif
+ endif
+
+
+ cTabname = hCreateInvalidModuleName( 0 )
+ rc = hRenameTab( cTabName )
+ if ( rc <> 0 ) then
+ brc = hHandleInvalidNameWarning( cTabname )
+ if ( brc ) then
+ warnlog( "Failed to set valid name" )
+ endif
+ endif
+
+
+ rc = hTestMacro( 1 )
+ if ( rc <> 1 ) then
+ warnlog( "The open macro-module is not the one that was expected" )
+ endif
+
+ hCloseBasicIDE()
+
+ hDestroyDocument()
+
+endcase
+
+'*******************************************************************************
+
+testcase tInvalidModuleNames
+
+
+ dim brc as boolean
+ dim cMsg as string
+ dim iCurrentName as Integer
+
+ dim sSeparator as String
+ dim cModuleName as string
+
+ hBasicModuleCreateNew()
+
+
+ Randomize
+ iCurrentName = Int( 24 * RND ) + 1 ' Range from 1 to 24
+
+ cModuleName = hCreateInvalidModuleName( iCurrentName )
+ printlog( "" )
+ printlog( "Trying module name: " & cModuleName )
+
+ brc = hNameBasicModule( cModuleName )
+
+ if ( brc ) then
+ warnlog( "Basic-Ide should not open for invalid module names" )
+
+ ' try to recover and continue for other names
+ brc = hCloseBasicIde()
+ brc = hDestroyDocument
+ brc = hBasicModuleCreateNew()
+
+ ' if we cannot recover, exit the test
+ if ( not brc ) then
+ goto endsub
+ endif
+ endif
+
+
+ printlog( "Close the naming dialog (cancel)" )
+ kontext "neuesmodul"
+ if ( NeuesModul.Exists() ) then
+ NeuesModul.Cancel()
+ endif
+
+ printlog( "Clsoe macro dialog (if it exists)" )
+ kontext "makro"
+ if ( Makro.Exists() ) then
+ Makro.Close()
+ endif
+
+ printlog( "Close the document" )
+ brc = hDestroyDocument()
+
+endcase
+
+'*******************************************************************************
+
+testcase tValidModuleNames
+
+
+ dim brc as boolean
+ dim cMsg as string
+ dim iCurrentName as Integer
+
+ dim sKeyword as String
+
+ hBasicModuleCreateNew()
+
+ Randomize
+ iCurrentName = Int( 8 * RND ) + 1 ' Range from 1 to 8
+
+ select case iCurrentName
+ case 1 : sKeyword = "option"
+ case 2 : sKeyword = "sub"
+ case 3 : sKeyword = "function"
+ case 4 : sKeyword = "end"
+ case 5 : sKeyword = "exit"
+ case 6 : sKeyword = "_underscore1"
+ case 7 : sKeyword = "underscore_2"
+ case 8 : sKeyWord = "ThisIsQuiteALongNameForAModuleDontYouThink"
+ end select
+
+ printlog( "" )
+ printlog( "Trying module name: " & sKeyword )
+
+ brc = hNameBasicModule( sKeyword )
+
+ if ( brc ) then
+
+ ' try to recover and continue for other names
+ brc = hCloseBasicIde()
+ brc = hDestroyDocument
+ brc = hBasicModuleCreateNew()
+
+ ' if we cannot recover, exit the test
+ if ( not brc ) then
+ goto endsub
+ endif
+ endif
+
+ printlog( "Close the naming dialog (cancel)" )
+ kontext "neuesmodul"
+ if ( NeuesModul.Exists() ) then
+ NeuesModul.Cancel()
+ endif
+
+ printlog( "Clsoe macro dialog (if it exists)" )
+ kontext "makro"
+ if ( Makro.Exists() ) then
+ Makro.Close()
+ endif
+
+ printlog( "Close the document" )
+ brc = hDestroyDocument()
+
+endcase
+
+'*******************************************************************************
+
+function hBasicModuleCreateNew() as boolean
+
+
+ dim brc as boolean
+ brc = false
+
+ dim iPos as integer
+
+ const CFN = "hBasicModuleCreateNew::"
+
+ gApplication = "WRITER"
+ brc = hCreateDocument()
+
+ brc = hOpenBasicOrganizerFromDoc()
+ if ( not brc ) then
+ warnlog( CFN & "Could not open the BASIC Macro Organizer, aborting" )
+ hDestroyDocument()
+ endif
+
+ if ( brc ) then
+ iPos = hSelectTheLastNode( MakroAus )
+ if ( not Neu.isEnabled() ) then
+ warnlog( CFN & "New button is disabled for the current module, aborting" )
+ kontext "Makro"
+ Makro.cancel()
+ brc = hDestroyDocument()
+ endif
+ endif
+
+ if ( brc ) then
+
+ printlog( "Click 'New'" )
+ Neu.Click()
+
+ kontext "NeuesModul"
+ if ( Neuesmodul.exists() ) then
+ brc = true
+ printlog( CFN & "Naming dialog is open"
+ endif
+ endif
+
+ hBasicModuleCreateNew() = brc
+
+end function
+
+'*******************************************************************************
+
+function hHandleInvalidNameWarning( cTabName as string ) as boolean
+
+
+ dim brc as boolean : brc = false
+ dim iTry as integer
+
+ const CFN = "hHandleInvalidNameWarning::"
+
+ kontext "Active"
+ for iTry = 1 to 5
+
+ if ( active.exists( 1 ) ) then
+
+ if ( brc ) then
+ warnlog( CFN & "Too many invalid name warnings" )
+ endif
+
+ printlog( CFN & "Message: " & active.getText() )
+
+ active.ok()
+ brc = true
+
+ else
+
+ if ( not brc ) then
+ warnlog( CFN & "Invalid name warning missing" )
+ endif
+
+ endif
+
+ next iTry
+
+ kontext "basicide"
+ tabbar.typekeys( "<ESCAPE>" , true )
+ hHandleInvalidNameWarning() = brc
+
+end function
+
+'*******************************************************************************
+
+function hCreateInvalidModuleName( iName as integer ) as string
+
+
+ dim sSeparator as string
+
+ ' Note: We cannot test for "<" and ">" because these are the characters
+ ' that identify keystrokes for the .typeKeys() method.
+
+ select case iName
+ case 0 : sSeparator = "_"
+ case 1 : sSeparator = "-"
+ case 2 : sSeparator = "."
+ case 3 : sSeparator = ","
+ case 4 : sSeparator = "+"
+ case 5 : sSeparator = ":"
+ case 6 : sSeparator = "!"
+ case 7 : sSeparator = "$"
+ case 8 : sSeparator = "("
+ case 9 : sSeparator = ")"
+ case 10 : sSeparator = "="
+ case 11 : sSeparator = "?"
+ case 12 : sSeparator = "*"
+ case 13 : sSeparator = " "
+ case 14 : sSeparator = "&"
+ case 15 : sSeparator = "\"
+ case 16 : sSeparator = "/"
+ case 17 : sSeparator = "§"
+ case 18 : sSeparator = """"
+ case 19 : sSeparator = "'"
+ case 20 : sSeparator = "@"
+ case 21 : sSeparator = "["
+ case 22 : sSeparator = "]"
+ case 23 : sSeparator = "%"
+ case 24 : sSeparator = CHR$( 387 )
+ case else : sSeparator = ""
+ end select
+
+ hCreateInvalidModuleName() = "ttModule" & sSeparator & "X"
+
+end function
diff --git a/testautomation/framework/optional/includes/basic_modules.inc b/testautomation/framework/optional/includes/basic_modules.inc
new file mode 100644
index 000000000000..203ebf7bc219
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_modules.inc
@@ -0,0 +1,140 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Edit several modules and dialogs in basic ide
+'*
+'\******************************************************************************
+
+
+testcase tMore_Modules_Dialogs
+
+
+ dim brc as boolean
+
+ dim iCurrentTab as integer
+
+ dim cFile as string
+ cFile = gOfficePath & "user\work\basic.odt"
+
+ const FILTER = "writer8"
+
+ 'const iTABCOUNT is the number of dialogs and modules.
+ 'If iTABCOUNT = 10 then 20 tabs (+ the first one!) = 21 should be created.
+
+ const iTABCOUNT as Integer = 10
+ const CMODULE = "TTMODULE"
+
+ hDeleteFile( cFile )
+
+ printlog "open a new writer-doc"
+ gApplication = "WRITER"
+ hCreateDocument()
+
+ brc = hInitBasicIDE( CMODULE )
+
+ printlog "insert 10 modules"
+
+ for iCurrentTab = 1 to iTABCOUNT
+ printlog " - insert new module : " & iCurrentTab
+
+ kontext "basicide"
+ Tabbar.OpenContextMenu
+ hMenuSelectNr(1)
+ hMenuSelectNr(1)
+ brc = hDeleteMacro()
+ if ( brc ) then
+ EditWindow.TypeKeys "'# " & ( iCurrentTab + 1 ) & ". module in this document"
+ endif
+ next iCurrentTab
+
+ printlog "insert 10 dialogs"
+
+ for iCurrentTab = 1 to iTABCOUNT
+ printlog " - insert new dialog : " & iCurrentTab
+ Tabbar.OpenContextMenu
+ hMenuSelectNr(1)
+ hMenuSelectNr (2)
+
+ if DialogWindow.Exists (2) <> TRUE then
+ warnlog "No dialog window is shown!"
+ end if
+
+ next iCurrentTab
+
+ printlog Chr(13) + "- close the BasicIDE"
+ hCloseBasicIDE()
+
+ printlog Chr(13) + "- save the document"
+ Call hFileSaveAsWithFilterKill( cFile , FILTER )
+
+ printlog Chr(13) + "- close the document"
+ hDestroyDocument()
+
+ printlog Chr(13) + "- open the saved document"
+ hFileOpen( cFile )
+
+ ToolsMacro_uno
+ kontext "Makro"
+ hSelectNodeByName( MakroAus , CMODULE )
+
+ Bearbeiten.Click()
+
+ printlog "delete all modules and dialogs"
+
+ for iCurrentTab = 1 to ( 2 * iTABCOUNT + 1 )
+
+ try
+ printlog "delete - " & iCurrentTab & "/" & ( 2 * iTABCOUNT + 1 )
+ UseBindings
+
+ kontext "basicide"
+ Tabbar.OpenContextMenu
+
+ hMenuSelectNr( 2 )
+
+ kontext "active"
+
+ if Active.Exists then
+ Active.Yes
+ else
+ warnlog "No warning after deleting a dialog!"
+ end if
+
+ catch
+ QAErrorLog "Deleting - " & iCurrentTab & "/" & ((2 * iTABCOUNT)+1) & " failed."
+ endcatch
+
+ next iCurrentTab
+
+ hDestroyDocument()
+ hDestroyDocument()
+
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/basic_package_export.inc b/testautomation/framework/optional/includes/basic_package_export.inc
new file mode 100644
index 000000000000..a8a2ae00459d
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_package_export.inc
@@ -0,0 +1,219 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Export BASIC libraries as package
+'*
+'\******************************************************************************
+
+testcase tBasicPackageExport
+
+ ' Assumption: All actions take place in the user/work directory
+ printlog( "Export BASIC libraries as package/extension" )
+
+ const PACKAGE_NAME = "tBasicExport.oxt"
+ const LIBRARY_NAME = "tBasicExport"
+ const DOCUMENT_POSITION = 4
+ const PACKAGE_SIZE = 1325
+
+ dim cDocumentName as string
+ dim cLibraryName as string
+
+ dim iNodeCount as integer
+ dim iCurrentLib as integer
+
+ dim cFile as string : cFile = hGetWorkPath() & PACKAGE_NAME
+ dim cPackageFileName as string
+
+
+ printlog( "Delete potential leftovers from prior test run" )
+ hDeleteFile( cFile )
+ hExtensionRemoveGUI( PACKAGE_NAME )
+
+ printlog( "Open one single writer document, modify it" )
+ hInitSingleDoc()
+ hChangeDoc()
+
+ printlog( "Open another document, we want to have two to see that they both " & _
+ "appear in the BASIC organizer" )
+ gApplication = "WRITER"
+ hCreateDocument()
+
+ printlog( "Open BASIC organizer" )
+ ToolsMacro_uno
+
+ printlog( "Select the second document" )
+ kontext "Makro"
+ if ( Makro.exists( 1 ) ) then
+ iNodeCount = hGetNodeCount( MakroAus )
+ cDocumentName = hSelectNode( MakroAus, iNodeCount )
+
+ printlog( "Click <Manage...>" )
+ Verwalten.click()
+
+ printlog( "Go to the libraries tabpage" )
+ hSelectBasicObjectOrganizerTab( 3 )
+
+ kontext "TabBibliotheken"
+ printlog( "Select the document at pos. " & DOCUMENT_POSITION )
+ Bibliothek.select( DOCUMENT_POSITION )
+
+ printlog( "Verify that the correct document has been selected" )
+ if ( Bibliothek.getSelText() <> cDocumentName ) then
+ warnlog( "Incorrect document selected on libraries tab, aborting test" )
+ goto endsub
+ endif
+
+ printlog( "Click <New...>" )
+ Neu.click()
+
+ kontext "NeueBibliothek"
+ if ( NeueBibliothek.exists( 1 ) ) then
+ printlog( "Name the new library: " & LIBRARY_NAME )
+ BibliotheksName.setText( LIBRARY_NAME )
+ NeueBibliothek.ok()
+ else
+ warnlog( "Dialog <NeueBibliothek> did not open" )
+ goto endsub
+ endif
+
+ kontext "TabBibliotheken"
+ cLibraryName = BibliotheksListe.getSelText()
+ if ( cLibraryName <> LIBRARY_NAME ) then
+ warnlog( "The new library is not selected in the libraries list" )
+ else
+ printlog( "The correct library is selected in the libraries list" )
+ endif
+
+ printlog( "Click <Edit...>" )
+ Bearbeiten.click()
+
+ printlog( "Insert a test macro (something simple, e.g. a messagebox" )
+ hInsertMacroFromFile( LIBRARY_NAME )
+
+ printlog( "Close the BASIC IDE" )
+ hCloseBasicIDE()
+ else
+ warnlog( "Dialog <Makro> did not open, aborting test" )
+ goto endsub
+ endif
+
+ printlog( "Open the BASIC organizer" )
+ ToolsMacro_uno
+
+ printlog( "Select the work document" )
+ kontext "Makro"
+ if ( Makro.exists( 1 ) ) then
+ iNodeCount = hGetNodeCount( MakroAus )
+ hSelectNode( MakroAus, iNodeCount )
+
+ printlog( "Manage..." )
+ Verwalten.click()
+
+ printlog( "Libraries tab" )
+ hSelectBasicObjectOrganizerTab( 3 )
+
+ kontext "TabBibliotheken"
+ if ( TabBibliotheken.exists( 1 ) and TabBibliotheken.isVisible() ) then
+ Bibliothek.select( DOCUMENT_POSITION )
+
+ printlog( "Select the new library" )
+ kontext "TabBibliotheken"
+ for iCurrentLib = 1 to Bibliotheksliste.getItemCount()
+ Bibliotheksliste.select( iCurrentLib )
+ if ( Bibliotheksliste.getSelText() = LIBRARY_NAME ) then
+ exit for
+ endif
+ next iCurrentLib
+
+ kontext "TabBibliotheken"
+ printlog( "Export the package, close the document afterwards" )
+ Export.click()
+
+ kontext "ExportBasicLibraryDlg"
+ if ( ExportBasicLibraryDlg.exists( 3 ) ) then
+ printlog( "Select to export as extension" )
+ ExportAsPackage.check()
+ ExportBasicLibraryDlg.ok()
+
+ kontext "SpeichernDlg"
+ if ( SpeichernDlg.exists( 3 ) ) then
+ printlog( "Save the file, suffix will be added automatically." )
+ DateiName.setText( hGetWorkPath() & LIBRARY_NAME )
+ Speichern.click()
+ Speichern.notExists( 1 )
+ else
+ warnlog( "Dialog <File Save> did not open" )
+ endif
+ else
+ warnlog( "Dialog <Export Basic Library> did not open" )
+ endif
+
+ kontext "TabBibliotheken"
+ printlog( "Close libraires tabpage" )
+ TabBibliotheken.cancel()
+ TabBibliotheken.notExists( 1 )
+ else
+ warnlog( "Dialog <TabBibliotheken> is not available" )
+ endif
+
+ kontext "Makro"
+ printlog( "Close BASIC organizer" )
+ Makro.cancel()
+ Makro.notExists( 1 )
+ else
+ warnlog( "Dialog <Makro> did not open" )
+ endif
+
+ printlog( "Close all files" )
+ hFileCloseAll()
+
+ printlog( "Verify automatic filename extension (dialog should append .oxt)" )
+ printlog( "Checking for file: " & cFile )
+ if ( FileExists( cFile ) ) then
+ printlog( "The test-package was saved with .oxt extension, good." )
+ cPackageFileName = cFile
+ else
+ if ( FileExists( hGetWorkPath() & LIBRARY_NAME ) ) then
+ warnlog( "The test-package was saved without .oxt filename extension" )
+ cPackageFileName = hGetWorkPath() & LIBRARY_NAME
+ else
+ warnlog( "The test extension was not saved to the users workdirectory" )
+ goto endsub
+ endif
+ endif
+
+ printlog( "Verify file size" )
+ if ( FileLen( cPackageFileName ) <> PACKAGE_SIZE ) then
+ warnlog( "#i105719# - The exported test-package has an incorrect file size." )
+ else
+ printlog( "File has correct size." )
+ endif
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/basic_package_import.inc b/testautomation/framework/optional/includes/basic_package_import.inc
new file mode 100644
index 000000000000..4ef74de4f112
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_package_import.inc
@@ -0,0 +1,140 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Import BASIC library via Package Manager GUI as UNO Package
+'*
+'\******************************************************************************
+
+testcase tBasicPackageImport
+
+ ' Assumption: All actions take place in the user/work directory
+ ' macro taken from global/input/macros.txt::tBasicLibraryExport
+
+ printlog( "Import BASIC library via Package Manager GUI as UNO Package" )
+
+ dim package_name as string : package_name = "tBasicExport.oxt"
+
+ const LIBRARY_NAME = "tBasicExport"
+
+ dim cDocumentName as string
+ dim cLibraryName as string
+
+ dim iNodeCount as integer
+ dim iCurrentLib as integer
+ dim iStatus as integer
+
+ dim cFile as string
+ cFile = hGetWorkPath() & package_name
+
+ if ( Not FileExists( cFile ) or ( FileLen( cFile ) = 0 ) ) then
+ warnlog( "#i105719# - Test extension is missing or has zero size. This is most likely" & _
+ " a follow-up error from the prior test case. Test stopped." )
+ goto endsub
+ endif
+
+ gApplication = "WRITER"
+
+ iStatus = hExtensionAddGUI( cFile, "InstallForUser,NoLicense,NoUpdate" )
+
+ ' Evaluate the returncode. Anything different from 0 causes the test to end.
+ if ( iStatus <= 0 ) then
+ warnlog( "Error adding extension. Aborting." )
+ goto endsub
+ endif
+
+ hMacroOrganizerRunMacro( LIBRARY_NAME )
+
+ kontext "active"
+ if ( active.exists( 5 ) ) then
+ active.ok()
+ else
+ warnlog( "The macro was not executed" )
+ endif
+
+ ToolsMacro_uno
+
+ kontext "Makro"
+ MakroAus.select( 1 )
+
+ Verwalten.click()
+
+ hSelectBasicObjectOrganizerTab( 3 )
+
+ kontext "TabBibliotheken"
+ Bibliothek.select( 1 )
+
+ printlog( "Select the new library" )
+ kontext "TabBibliotheken"
+ for iCurrentLib = 1 to Bibliotheksliste.getItemCount()
+ Bibliotheksliste.select( iCurrentLib )
+ if ( Bibliotheksliste.getSelText() = LIBRARY_NAME ) then
+ exit for
+ endif
+ next iCurrentLib
+ cLibraryName = BibliotheksListe.getSelText()
+
+ try
+ Hinzufuegen.click()
+ catch
+ warnlog( "#i64007 - Office crashes on clicking import button" )
+ endcatch
+
+ kontext "OeffnenDlg"
+ OeffnenDlg.cancel()
+
+ printlog( "Cleanup: Delete Library, close dialogs and remove package" )
+
+ ' Note: It is assumed that the library is selected
+ kontext "TabBibliotheken"
+ cLibraryName = BibliotheksListe.getSelText()
+ if ( cLibraryName <> LIBRARY_NAME ) then
+ warnlog( "Incorrect library is selected" & cLibraryName )
+ else
+ Loeschen.click()
+
+ kontext "active"
+ if ( active.exists( 1 ) ) then
+ active.yes()
+ else
+ warnlog( "No warning for library deletion" )
+ endif
+ endif
+
+
+ kontext "TabBibliotheken"
+ TabBibliotheken.cancel()
+
+ kontext "Makro"
+ Makro.cancel()
+
+ hExtensionRemoveGUI( package_name )
+
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/basic_protected_libraries.inc b/testautomation/framework/optional/includes/basic_protected_libraries.inc
new file mode 100644
index 000000000000..132549c16d8d
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_protected_libraries.inc
@@ -0,0 +1,160 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Test protected libraries
+'*
+'\******************************************************************************
+
+testcase tProtectedLibraries
+
+
+ const CLIB = "aaTestLib"
+ const CPASSWORD = "SomePassword"
+ const IMACRO = 3
+
+ dim irc as integer
+ dim cPBAFile as string
+ cPBAFile = gOfficePath & "user\basic\" & CLIB & "\Module1.pba"
+ cPBAFile = convertpath( cPBAFile )
+
+ dim iPBAFile as long
+ dim iCurrentLib as integer
+ dim cMsg as string
+
+ hOpenBasicOrganizerFromDoc()
+
+ printlog( "Select My Macros" )
+ kontext "Makro"
+ hSelectNode( MakroAus , 1 )
+
+ printlog( "Organize..." )
+ Verwalten.click()
+
+ hSelectBasicObjectOrganizerTab( 3 )
+
+ printlog( "New..." )
+ kontext "TabBibliotheken"
+ Neu.click()
+
+ printlog( "Name the Library" )
+ kontext "NeueBibliothek"
+ BibliotheksName.setText( CLIB )
+ NeueBibliothek.ok()
+
+ printlog( "Select the new library" )
+ kontext "TabBibliotheken"
+ for iCurrentLib = 1 to Bibliotheksliste.getItemCount()
+ Bibliotheksliste.select( iCurrentLib )
+ if ( Bibliotheksliste.getSelText = CLIB ) then
+ exit for
+ endif
+ next iCurrentLib
+
+ printlog( "Set Password" )
+ kontext "TabBibliotheken"
+ Passwort.click()
+
+ kontext "PasswdDLG"
+ NewPassword.setText( CPASSWORD )
+ Confirm.setText( CPASSWORD )
+ PasswdDLG.ok()
+
+ printlog( "Edit the library" )
+ kontext "TabBibliotheken"
+ Bearbeiten.click()
+
+ Kontext "BasicIDE"
+ hInsertMacro( IMACRO )
+
+ hCloseBasicIde()
+
+ printlog( "Restart the application" )
+ call ExitRestartTheOffice()
+
+ hOpenBasicOrganizerFromDoc()
+
+ printlog( "Select the protected library" )
+ Kontext "Makro"
+ hSelectNode( MakroAus , 1 )
+ hExpandNode( MakroAus , 0 )
+ hSelectNode( MakroAus , 2 )
+ hExpandNode( MakroAus , 0 )
+
+ printlog( "Enter correct Password" )
+ kontext "PasswordDLG"
+ Password.setText( CPASSWORD )
+ PasswordDLG.ok()
+
+ ' Handle possible errormessage (Happens if password is correct but not accepted)
+ Kontext "Active"
+ if ( Active.exists() ) then
+ cMsg = Active.getText()
+ cMsg = hRemoveLineBreaks( cMsg )
+ printlog( "Unexpected messagebox: " & cMsg )
+ warnlog( "#i65955# - CWS Warnings01: Protected libraries do not accept valid password" )
+ Active.ok()
+ Kontext "Makro"
+ Makro.cancel()
+ hDeleteLibrary( 1 , CLIB )
+ goto endsub
+ endif
+
+ Kontext "Makro"
+ hSelectNode( MakroAus , 3 )
+
+ printlog( "Edit Library" )
+ Bearbeiten.click()
+ ' warnlog( "#144701 Crash on edit of password protected module" )
+
+ printlog( "Check that the Macro is the correct one" )
+ Kontext "BasicIDE"
+ if ( BasicIDE.exists( 3 ) ) then
+
+ irc = htestMacro( IMACRO )
+ if ( irc <> IMACRO ) then
+ warnlog( "#i54305 - Changes to protected macros lost on office restart" )
+
+ iPBAFile = hGetFileSizeAsLong( cPBAFile )
+ if ( iPBAFile = 0 ) then
+ warnlog( "#i50568 - .pba-file has 0-byte size" )
+ else
+ printlog( "Module1.pba has " & iPBAFile & " Bytes" )
+ endif
+ endif
+
+
+ printlog( "Cleanup" )
+ hCloseBasicIde()
+ else
+ warnlog( "BasicIDE did not open within 3 seconds" )
+ endif
+ hDeleteLibrary( 1 , CLIB )
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/basic_shared_modules.inc b/testautomation/framework/optional/includes/basic_shared_modules.inc
new file mode 100644
index 000000000000..ea677e31f23a
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_shared_modules.inc
@@ -0,0 +1,90 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Access modules below OpenOffice.org macros
+'*
+'\******************************************************************************
+
+testcase tBasicSharedModules
+
+
+ dim iObjectPosition as integer
+ dim iLibraryCount as integer
+
+ const EXPECTED_LIBRARY_COUNT = 12
+
+ hInitSingleDoc()
+
+ ToolsMacro_uno
+
+ Kontext "Makro"
+ iObjectPosition = hSelectNodeByName( MakroAus , "Depot" )
+ if ( iObjectPosition = 0 ) then
+ warnlog( "Could not find the specified node" )
+ goto endsub
+ endif
+
+ hSelectTheLastNode( MakroAus )
+ printlog( "Current node (Last node): " & MakroAus.getSelText() )
+
+ hSelectNode( MakroAus, iObjectPosition+1 )
+ printlog( "Current node (Depot/..): " & MakroAus.getSelText()
+
+ Kontext "Makro"
+ Bearbeiten.click()
+
+ Kontext "MacroBar"
+ if ( MacroBar.exists( 2 ) ) then
+ printlog( "Macro Bar is open." )
+ else
+ warnlog( "MacroBar is not open but we should be on the Basic IDE" )
+ endif
+
+ Kontext "MacroBar"
+ Library.typeKeys( "<HOME>" )
+ printlog( "Top entry = " & Library.getSelText() )
+
+ iLibraryCount = Library.getItemCount()
+ printlog( "There are " & iLibraryCount & " items in the list" )
+
+ if ( iLibraryCount <> EXPECTED_LIBRARY_COUNT ) then
+ warnlog( "The number of items in the library-list is incorrect (should be 12): " & iLibraryCount )
+ endif
+
+ Kontext "MacroBar"
+ Library.select( iLibraryCount )
+ printlog( "Last entry = " & Library.getSelText() )
+
+ hCloseBasicIDE()
+
+ hDestroyDocument()
+
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/basic_spectemplate.inc b/testautomation/framework/optional/includes/basic_spectemplate.inc
new file mode 100644
index 000000000000..92a792cd5797
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_spectemplate.inc
@@ -0,0 +1,123 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Load the spec template via http and enable macros
+'*
+'\******************************************************************************
+
+testcase tBasicSpecTemplate
+
+ qaerrorlog( "#i89554# Macro dialog not displayed / document not loaded" )
+ goto endsub
+
+
+ const cFile = "http://specs.openoffice.org/collaterals/template/2.0/OpenOffice-org-Specification-Template.ott"
+ dim brc as boolean
+ dim cProxy as string
+ dim cPort as string
+
+ dim cWorkFile as string
+
+ cWorkFile = hGetWorkPath() & "SpecTemplate" & hGetSuffix( "current" )
+
+
+ hGetPrivateHttpServer( cProxy, cPort )
+
+ printlog( "Init: Set proxy (requires private environment to be set)" )
+ hSetProxies( cProxy, cPort, "", "", "" )
+ if ( WaitSlot() <> WSFinished ) then
+ warnlog( "Slot not finished after 1000 msec." )
+ else
+ printlog( "Slot free in less than 1000 msec." )
+ endif
+
+ printlog( "FileOpen" )
+ hFileOpen( cFile )
+
+ kontext "Active"
+ if ( Active.exists( 2 ) ) then
+ warnlog( "Unexpected errormessage: " & active.getText()
+ active.ok()
+
+ kontext "OeffnenDlg"
+ if ( OeffnenDlg.exists( 1 ) ) then
+ printlog( "Recovering - closing File Open dialog" )
+ OeffnenDlg.cancel()
+ endif
+
+ goto endsub
+ endif
+
+ printlog( "Accept to execute macros" )
+ brc = hAllowMacroExecution()
+ if ( not brc ) then
+ warnlog( "Missing Macro execution dialog. Please check the file/security settings" )
+ endif
+
+ kontext "Active"
+ if ( Active.exists( 5 ) ) then
+ warnlog( "Fatal: Unexpected active: " & Active.getText() )
+ active.ok
+
+ kontext "OeffnenDlg"
+ if ( OeffnenDlg.exists( 2 ) ) then
+ OeffnenDlg.close()
+ goto endsub
+ endif
+ endif
+
+ printlog( "Change the document")
+ kontext "DocumentWriter"
+ DocumentWriter.typeKeys( "<MOD1 END>" )
+ DocumentWriter.typeKeys( "Changing the document" )
+
+ printlog( "Disable Help Entry from Spec-Template Menu")
+ hUseMenu()
+ hMenuSelectNr( 10 )
+ hMenuSelectNr( 2 )
+
+
+ hFileSaveAsKill( cWorkFile )
+
+ hDestroyDocument()
+
+ hFileOpen( cWorkFile )
+
+ hAllowMacroExecution()
+
+ printlog( "Cleanup: Close the document" )
+ hDestroyDocument()
+
+ printlog( "Cleanup: Delete proxy settings" )
+ hSetProxies( "", "", "", "", "" )
+
+ hDeleteFile( cWorkFile )
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/basic_usertemplate.inc b/testautomation/framework/optional/includes/basic_usertemplate.inc
new file mode 100644
index 000000000000..de3b605ed510
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_usertemplate.inc
@@ -0,0 +1,204 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : My Macros/standard execution with user defined template
+'*
+'\******************************************************************************
+
+testcase tMacroUsertemplate
+
+
+ ' requires: Default template path, default security level (medium)
+
+ ' Details:
+ ' This test checks for some really weird behavior. A macro is created
+ ' for the standard lib in My Macros - this means the macro is stored with
+ ' the application, not the document.
+ ' When creating a document based on a user-created template the macro
+ ' will not execute, instead a com.sun.star... errormessage is displayed
+
+ dim brc as boolean ' returncode
+ dim irc as integer ' returncode
+
+ dim cMacroName as string ' Temp variable to store the name of current macro
+
+ const DOC_IDENTIFIER = "A test document for tMacroUserTemplate"
+
+ dim sPathOut as string ' output path for workfile
+ const FILEOUT = "tMacroUserTemplate"
+ const FILTER = "writer8_template"
+
+ dim iCurrentNode as integer
+
+ sPathOut = convertpath( gOfficePath & "user\template\" )
+ hDeleteFile( sPathOut & FILEOUT & ".ott" )
+
+ hInitSingleDoc()
+ kontext "DocumentWriter"
+ DocumentWriter.typeKeys( DOC_IDENTIFIER )
+
+ brc = hCreateDocument()
+
+ brc = hOpenBasicOrganizerFromDoc()
+
+ iCurrentNode = hSelectNodeByName( MakroAus, "Module1" )
+ if ( iCurrentNode = 0 ) then
+ warnlog( "#i73521# - The expected node could not be found. Aborting test" )
+ kontext "Makro"
+ Makro.close()
+ hDestroyDocument()
+ goto endsub
+ endif
+
+ ' verify that we replace the correct macro. if not: Abort
+ if ( MakroListe.getItemCount() > 0 ) then
+ cMacroName = MakroListe.getSelText()
+ if ( lcase( cMacroName ) <> "main" ) then
+ warnlog( "Test abort: Incorrect macro is selected: " & cMacroName )
+ printlog( "This should have been the <Main> Macro" )
+ kontext "Makro"
+ Makro.cancel()
+ hDestroyDocument()
+ goto endsub
+ endif
+ else
+ warnlog( "There is no macro listed for the current module, the test cannot continue" )
+ kontext "Makro"
+ Makro.close()
+ hDestroyDocument()
+ goto endsub
+ endif
+
+ Bearbeiten.click()
+
+ hInsertMacro( 3 )
+
+ hCloseBasicIde()
+
+ hDestroyDocument()
+
+ hCreateDocument
+
+ ToolsMacrosRunMacro
+
+ cMacroName = hExecScript_tMacroUserTemplate() ' local function, see below
+ if ( lcase( cMacroName ) <> "main" ) then
+ warnlog( "Test abort: Incorrect macro is selected: " & cMacroName )
+ printlog( "This should have been the <Main> Macro" )
+ ScriptSelector.cancel()
+ brc = hDestroyDocument()
+ goto endsub
+ endif
+
+ ' run
+ ScriptSelector.ok()
+
+ kontext "Active"
+ if ( active.exists( 3 ) ) then
+ printlog( "Messagebox: " & active.getText() )
+ active.ok()
+ else
+ warnlog( "The Macro has not been executed" )
+ endif
+
+ brc = hDestroyDocument()
+
+ brc = hCreateDocument()
+
+ printlog( "" )
+ printlog( "Save as template" )
+ hFileSaveAsWithFilterKill( sPathOut & FILEOUT, FILTER )
+
+ hDestroyDocument()
+
+ printlog( "" )
+ printlog( "File New from Template" )
+ FileNewFromTemplate
+
+ irc = hFindTemplate( FILEOUT )
+
+ hSelectDocumentObject( irc, 1 )
+
+ printlog( "" )
+ printlog( "Run Macro..." )
+ ToolsMacrosRunMacro
+
+ cMacroName = hExecScript_tMacroUserTemplate() ' local function, see below
+ if ( lcase( cMacroName ) <> "main" ) then
+ warnlog( "Test abort: Incorrect macro is selected: " & cMacroName )
+ printlog( "This should have been the <Main> Macro" )
+ ScriptSelector.cancel()
+ hDestroyDocument()
+ goto endsub
+ endif
+
+ ' run
+ printlog( "Run" )
+ ScriptSelector.ok()
+
+ kontext "Active"
+ if ( active.exists( 3 ) ) then
+
+ if ( instr( active.getText() , "com.sun" ) <> 0 ) then
+ warnlog( "#i58527# - unable to run macro with user-template loaded" )
+ endif
+
+ if ( active.getText() = "TTMacro3" ) then
+ printlog( "The macro was executed" )
+ else
+ printlog( "Unknown dialog: " & hRemoveLineBreaks( active.getText() ) )
+ endif
+
+ active.ok()
+ else
+ warnlog( "Macro not executed / no warning" )
+ endif
+
+ hDestroyDocument()
+ hDestroyDocument()
+
+ hDeleteFile( sPathOut & FILEOUT & ".ott" )
+
+
+endcase
+
+'*******************************************************************************
+
+function hExecScript_tMacroUserTemplate() as string
+
+ Kontext "ScriptSelector"
+ hSelectTopNode( LibraryTreeList )
+ hExpandNode( LibraryTreeList , 1 )
+ hSelectNode( LibraryTreeList , 2 )
+ hExpandNode( LibraryTreeList , 2 )
+ hSelectNode( LibraryTreeList , 3 )
+
+ hExecScript_tMacroUserTemplate() = ScriptList.getSelText()
+
+end function
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc
new file mode 100644
index 000000000000..fea6742d5917
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_vba-compat_import_disabled.inc
@@ -0,0 +1,138 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Test VBA compatibility switches
+'*
+'\******************************************************************************
+
+testcase tBasicVBACompatImportDisabled()
+
+ printlog( "Test VBA compatibility switch / executable Microsoft(R) Excel(R) Macros" )
+ printlog( "Test case 2: Import macros but do not set the executable mode" )
+
+
+ ' This test case is based on the use cases provided in issue #i88690
+ ' Spec: http://specs.openoffice.org/appwide/options_settings/Option_Dialog.odt
+
+ dim cTestFile as string
+ cTestFile = gTesttoolPath & "framework/optional/input/vba-compat/vba-test.xls"
+
+ dim cNodeCount as integer
+
+ dim caNodeData( 7 ) as string
+ caNodeData( 1 ) = "Standard"
+ caNodeData( 2 ) = "DieseArbeitsmappe"
+ caNodeData( 3 ) = "Modul1"
+ caNodeData( 4 ) = "Modul2"
+ caNodeData( 5 ) = "Tabelle1"
+ caNodeData( 6 ) = "Tabelle2"
+ caNodeData( 7 ) = "Tabelle3"
+
+ dim iCurrentModule as integer
+ dim cCurrentModule as string
+ dim bFound as boolean
+
+ ' Depending on the mode of macro import we have differtent basic libraries listed
+ const NODE_COUNT = 78
+
+ const DOCUMENT_POSITION_OFFSET = -7
+
+ const IMPORT_EXCEL_MACROS = TRUE
+ const EXEC_EXCEL_MACROS = FALSE
+
+ printlog( "Set macro security to low" )
+ hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW )
+
+ printlog( "Open Tools/Options" )
+
+ hSetExcelBasicImportMode( IMPORT_EXCEL_MACROS, EXEC_EXCEL_MACROS )
+
+ printlog( "Load the test file" )
+ hFileOpen( cTestFile )
+
+ printlog( "Open the Basic organizer" )
+ hOpenBasicOrganizerFromDoc()
+
+ printlog( "Expand all nodes" )
+ cNodeCount = hExpandAllNodes( MakroAus )
+
+ printlog( "Verify that we have the correct node count for the current mode" )
+ if ( cNodeCount <> NODE_COUNT ) then
+ warnlog( "The number of nodes is incorrect: " & cNodeCount )
+ endif
+
+ printlog( "Verify position of the document node" )
+ MakroAus.select( cNodeCount + DOCUMENT_POSITION_OFFSET )
+ if ( MakroAus.getSelText() <> "vba-test.xls" ) then
+ qaerrorlog( "The document node is not at the expected position" )
+ endif
+
+ for iCurrentModule = 2 to 7
+
+ printlog( "Look for: " & caNodeData( iCurrentModule ) )
+
+ bFound = false
+
+ MakroAus.select( cNodeCount + DOCUMENT_POSITION_OFFSET + iCurrentModule )
+ cCurrentModule = MakroAus.getSelText()
+
+ for iCurrentModule = 2 to 7
+
+ if ( cCurrentModule = caNodeData( iCurrentModule ) ) then
+ bFound = TRUE
+ if ( MakroListe.getSelText() <> caNodeData( iCurrentModule ) ) then
+ warnlog( "Module has incorrect script: " & cCurrentModule )
+ bFound = false
+ endif
+ exit for
+ endif
+
+ next iCurrentModule
+
+ if ( not bFound ) then
+ warnlog( "The node was not found: " & cCurrentModule )
+ else
+ printlog( "Module found, script found, good" )
+ endif
+
+ next iCurrentModule
+
+ printlog( "Close Macro Organizer" )
+ Kontext "Makro"
+ Makro.close()
+ WaitSlot()
+
+ hCloseDocument()
+ hSetExcelImportModeDefault()
+ hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT )
+
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc
new file mode 100644
index 000000000000..f5e9c0c4f515
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_vba-compat_import_enabled.inc
@@ -0,0 +1,154 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Test VBA compatibility switches
+'*
+'\******************************************************************************
+
+testcase tBasicVBACompatImportEnabled()
+
+ printlog( "Test VBA compatibility switch / executable Microsoft(R) Excel(R) Macros" )
+ printlog( "Test case 3: Import macros and set them executable" )
+
+
+ ' This test case is based on the use cases provided in issue #i88690
+ ' Spec: http://specs.openoffice.org/appwide/options_settings/Option_Dialog.odt
+
+ dim cFile as string : cFile = "vba-test.xls"
+
+ dim cTestFile as string
+ cTestFile = gTesttoolPath & "framework/optional/input/vba-compat/" & cFile
+
+ dim cNodeCount as integer
+
+ ' note that index 0 and 1 are ommitted intentionally
+ dim caNodeData( 3 ) as string
+ caNodeData( 2 ) = "Modul1"
+ caNodeData( 3 ) = "Modul2"
+
+ dim caScripts( 3 ) as string
+ caScripts( 2 ) = "ConcatFct Ende"
+ caScripts( 3 ) = "WriteIt"
+
+ dim iCurrentModule as integer
+ dim iCurrentScript as integer
+ dim cCurrentModule as string
+ dim cTempString as string
+ dim bFound as boolean
+
+ ' Depending on the mode of macro import we have differtent basic libraries listed
+ const NODE_COUNT = 74
+
+ const DOCUMENT_POSITION_OFFSET = -3
+
+ const IMPORT_EXCEL_MACROS = TRUE
+ const EXEC_EXCEL_MACROS = TRUE
+
+ printlog( "Set macro security to low" )
+ hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW )
+
+ printlog( "Open Tools/Options" )
+
+ hSetExcelBasicImportMode( IMPORT_EXCEL_MACROS, EXEC_EXCEL_MACROS )
+
+ printlog( "Load the test file" )
+ hFileOpen( cTestFile )
+
+ printlog( "Open the Basic organizer" )
+ hOpenBasicOrganizerFromDoc()
+
+ printlog( "Expand all nodes" )
+ cNodeCount = hExpandAllNodes( MakroAus )
+
+ printlog( "Verify that we have the correct node count for the current mode." )
+ if ( cNodeCount <> NODE_COUNT ) then
+ warnlog( "The number of nodes is incorrect: " & cNodeCount )
+ printlog( "Expected were...................: " & NODE_COUNT )
+ endif
+
+ printlog( "Verify position of the document node." )
+ MakroAus.select( cNodeCount + DOCUMENT_POSITION_OFFSET )
+ cTempString = MakroAus.getSelText()
+ if ( cTempString <> cFile ) then
+ qaerrorlog( "The filename does not match. File may be read-only." )
+ if ( instr( cTempString, cFile ) > 1 ) then
+ printlog( "Filename is contained in the UI string." )
+ select case ( getAttr( cTestFile ) )
+ case 0 : warnlog( "The file appears to be read-only but it is " & _
+ "not write-protected on filesystem level." )
+ case 1 : printlog( "The file is read-only on filesystem level. Ok." )
+ case else
+ warnlog( "getAttr() returned unexpected value. 1 or 2 are allowed" )
+ printlog( "RC from getAttr() is: " & getAttr( cTestFile ) )
+ end select
+ else
+ qaerrorlog( "The document node is not at the expected position." )
+ qaerrorlog( "Object at this position is: " & MakroAus.getSelText() )
+ endif
+ endif
+
+ for iCurrentModule = 2 to 3
+
+ printlog( "Look for: " & caNodeData( iCurrentModule ) )
+
+ bFound = FALSE
+
+ MakroAus.select( cNodeCount + DOCUMENT_POSITION_OFFSET + iCurrentModule )
+ cCurrentModule = MakroAus.getSelText()
+
+ if ( cCurrentModule = caNodeData( iCurrentModule ) ) then
+ bFound = TRUE
+ for iCurrentScript = 1 to MakroListe.getItemCount()
+ MakroListe.select( iCurrentScript )
+ if ( instr( caScripts( iCurrentModule ), MakroListe.getSelText() ) = 0 ) then
+ warnlog( "Script for the current module not found" )
+ bFound = FALSE
+ else
+ printlog( "Script found at pos" & iCurrentScript )
+ endif
+ next iCurrentScript
+ endif
+
+ if ( not bFound ) then
+ warnlog( "The node was not found: " & cCurrentModule )
+ endif
+
+ next iCurrentModule
+
+ printlog( "Close Macro Organizer" )
+ Kontext "Makro"
+ Makro.close()
+ WaitSlot()
+
+ hCloseDocument()
+ hSetExcelImportModeDefault()
+ hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT )
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc b/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc
new file mode 100644
index 000000000000..f61064e28e0d
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_vba-compat_import_nothing.inc
@@ -0,0 +1,101 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Test VBA compatibility switches
+'*
+'\******************************************************************************
+
+testcase tBasicVBACompatImportNothing()
+
+ printlog( "Test VBA compatibility switch / executable Microsoft(R) Excel(R) Macros" )
+ printlog( "Test case 1: Do not import macros at all" )
+
+ ' This test case is based on the use cases provided in issue #i88690
+ ' Spec: http://specs.openoffice.org/appwide/options_settings/Option_Dialog.odt
+
+ dim cTestFile as string
+ cTestFile = gTesttoolPath & "framework/optional/input/vba-compat/vba-test.xls"
+
+ dim cNodeCount as integer
+
+ ' Depending on the mode of macro import we have differtent basic libraries listed
+ const NODE_COUNT = 72 ' Do not import Microsoft(R) Excel(R) macros at all
+ const MACRO_LIST = 0 ' The document library should have no scripts listed
+ const DOCUMENT_POSITION_OFFSET = -1
+
+ const IMPORT_EXCEL_MACROS = FALSE
+ const EXEC_EXCEL_MACROS = FALSE
+
+ printlog( "Set macro security to low" )
+ hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW )
+
+ printlog( "Open Tools/Options" )
+
+ hSetExcelBasicImportMode( IMPORT_EXCEL_MACROS, EXEC_EXCEL_MACROS )
+
+ printlog( "Load the test file" )
+ hFileOpen( cTestFile )
+
+ printlog( "Open the Basic organizer" )
+ hOpenBasicOrganizerFromDoc()
+
+ printlog( "Expand all nodes" )
+ cNodeCount = hExpandAllNodes( MakroAus )
+
+ printlog( "Verify that we have the correct node count for the current mode" )
+ if ( cNodeCount <> NODE_COUNT ) then
+ warnlog( "The number of nodes is incorrect: " & cNodeCount )
+ endif
+
+ printlog( "Verify position of the document node" )
+ MakroAus.select( cNodeCount + DOCUMENT_POSITION_OFFSET )
+ if ( MakroAus.getSelText() <> "vba-test.xls" ) then
+ qaerrorlog( "The document node is not at the expected position" )
+ endif
+
+ printlog( "Select the last node, this should be the standard Library for the document" )
+ MakroAus.select( cNodeCount )
+
+ printlog( "Verify that the Standard library for the document has no scripts" )
+ if ( MakroListe.getItemCount <> MACRO_LIST ) then
+ warnlog( "There should be no macros listed for the current library"
+ endif
+
+ printlog( "Close Macro Organizer" )
+ Kontext "Makro"
+ Makro.close()
+ WaitSlot()
+
+ hCloseDocument()
+ hSetExcelImportModeDefault()
+ hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT )
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/basic_vba_compat_tools.inc b/testautomation/framework/optional/includes/basic_vba_compat_tools.inc
new file mode 100644
index 000000000000..77437770891a
--- /dev/null
+++ b/testautomation/framework/optional/includes/basic_vba_compat_tools.inc
@@ -0,0 +1,72 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Small helpers for Excel BASIC import modes
+'*
+'\******************************************************************************
+
+function hSetExcelBasicImportMode( bImport as boolean, bEnable as boolean )
+
+ printlog( "Changing Excel VBA import modes" )
+
+ ToolsOptions
+ hToolsOptions( "LoadSave", "VBAProperties" )
+
+ if ( bImport ) then
+ ExcelBasicLaden.check()
+ if ( bEnable ) then
+ ExecutableCode.check()
+ else
+ ExecutableCode.uncheck()
+ endif
+ else
+ ExcelBasicLaden.uncheck()
+ endif
+
+ Kontext "OptionenDlg"
+ OptionenDlg.ok()
+
+end function
+
+'*******************************************************************************
+
+function hSetExcelImportModeDefault()
+
+ printlog( "Setting Excel VBA import modes to default" )
+
+ ToolsOptions
+ hToolsOptions( "LoadSave", "VBAProperties" )
+
+ ExcelBasicLaden.check()
+ ExecutableCode.uncheck()
+
+ Kontext "OptionenDlg"
+ OptionenDlg.ok()
+
+end function
diff --git a/testautomation/framework/optional/includes/configuration.inc b/testautomation/framework/optional/includes/configuration.inc
new file mode 100644
index 000000000000..68c0aaf79082
--- /dev/null
+++ b/testautomation/framework/optional/includes/configuration.inc
@@ -0,0 +1,371 @@
+'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 : Function Test for known global Issues
+'*
+'\*****************************************************************
+
+sub sToolsCustomizeKeyboardFunction
+ dim aApplication() as string
+ dim i,a,b as integer
+ dim lList(1000) as string
+ dim sTemp as string
+
+ ' go through all applications:
+ aApplication()=array("WRITER","MASTERDOCUMENT","HTML","CALC","IMPRESS","DRAW","MATH","DATABASE")
+ a=uBound(aApplication())
+ sTemp = gApplication
+ for i = 0 to a
+
+ if ( i = 7 and gtSysName = "Solaris x86" ) then
+ qaerrorlog( "#i62423# Solaris: Crash when opening new database" )
+ else
+ gApplication = aApplication(i)
+ tToolsCustomizeKeyboardFunction(lList())
+ endif
+ next i
+ gApplication = sTemp
+
+ listsort(lList())
+ a = ListCount(lList())
+ printlog "Count1: " + a
+ if (a>0) then
+ b = 0
+ sTemp=""
+ for i=1 to a
+ if (lList(i) <> sTemp) then
+ printlog ""+i+": '" + lList(i) + "'"
+ sTemp=lList(i)
+ inc(b)
+ endif
+ next i
+ printlog "Number of unique Errors: " + b
+ endif
+end sub
+
+testcase tToolsCustomizeKeyboardFunction(lList())
+ dim sKeys(300,2) as string
+ dim i,a,b,c,d as integer
+ dim sTemp, sTemp2 as string
+ dim iBugCount(10) as integer
+ dim bErrorFound as boolean
+ dim i43969 as string ' ALL
+ dim i60617 as string ' ALL
+ dim i64346 as string ' ALL
+ dim i80850 as string ' ALL
+ dim i84982 as string ' ALL
+ dim i84983 as string
+ dim i87950 as string
+ dim i87951 as string
+ dim i87952 as string
+ dim i92080 as string
+ dim i96322 as string
+ dim i100037 as string
+
+ i60617 = ".uno:ContinueNumbering"
+ i43969 = ".uno:MacroOrganizer"
+ i64346 = ".uno:SendMailDocAs"
+ i80850 = ".uno:ToggleFormula.uno:AssignMacro"
+ i84982 = ".uno:FontDialogForParagraph"
+ i84983 = ".uno:DBNewReportWithPreSelection"
+ i87950 = ".uno:DBMigrateScripts"
+ i87951 = ".uno:DeleteAllNotes.uno:DeleteAuthor.uno:DeleteNote.uno:HideAllNotes.uno:HideAuthor.uno:HideNote"
+ i87952 = ".uno:InsertApplet"
+ i92080 = ".uno:SaveGraphic"
+ i96322 = ".uno:ActivateStyleApply"
+ i100037 = ".uno:AcceptTracedChange, .uno:DeleteComment, .uno:RejectTracedChange, .uno:ReplyNote, .uno:TaskPaneInsertPage, .uno:ValidityReference"
+
+ Call hNewDocument
+ sleep 2
+ ToolsCustomize
+ sleep 3
+ Kontext
+ Messagebox.SetPage TabTastatur ' 2 ------------------
+ Kontext "TabTastatur"
+ for c = 1 to 2
+ select case c
+ case 1:
+ StarOffice.Check
+ Printlog ("-------------------- Keylist for StarOpenOfficeSuite.org --------------------")
+ case 2:
+ Application.Check
+ Printlog ("-------------------- Keylist for "+gApplication+" ------------------------")
+ end select
+ i = Bereich.getItemCount
+ for a = 1 to i
+ Bereich.select(a,true)
+ sTemp = Bereich.getSelText
+ for b=1 to Funktion.getItemCount
+ sTemp2 = Funktion.getItemText(b)
+ d = inStr(sTemp2,":")
+ if (d>0) then
+ ' translators use ':'-> check if ' ' follows or CHR$ < 128
+ ' asc() returns 16 bit values in an integer -> sign is affected :-( -> use abs(asc())
+ if (((mid(sTemp2,d+1,1)<>" ")AND(abs(asc(mid(sTemp2,d+1,1)))<128)) AND (abs(asc(mid(sTemp2,d-1,1)))<128))then
+ listAppend(lList(),sTemp2)
+ bErrorFound = false
+ if (inStr(i60617,sTemp2)>0) then
+ WarnLog "#i60617# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
+ bErrorFound = true
+ endif
+ if (inStr(sTemp2,i64346)>0) then
+ WarnLog "#i64346# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
+ bErrorFound = true
+ endif
+ if (inStr(i43969,sTemp2)>0) then
+ WarnLog "#i41265# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
+ bErrorFound = true
+ endif
+ if (inStr(i80850,sTemp2)>0) then
+ WarnLog "#i80850# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
+ bErrorFound = true
+ endif
+ if (inStr(i84982,sTemp2)>0) then
+ WarnLog "#i84982# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
+ bErrorFound = true
+ endif
+ if (inStr(i84983,sTemp2)>0) then
+ WarnLog "#i84983# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
+ bErrorFound = true
+ endif
+ if (inStr(i87950,sTemp2)>0) then
+ WarnLog "#i87950# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
+ bErrorFound = true
+ endif
+ if (inStr(i87951,sTemp2)>0) then
+ WarnLog "#i87951# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
+ bErrorFound = true
+ endif
+ if (inStr(i87952,sTemp2)>0) then
+ warnLog "#i87952# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
+ bErrorFound = true
+ endif
+ if (inStr(i92080,sTemp2)>0) then
+ WarnLog "#i92080# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
+ bErrorFound = true
+ endif
+ if (inStr(i96322,sTemp2)>0) then
+ WarnLog "#i96322# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
+ bErrorFound = true
+ endif
+
+ if (inStr(i100037,sTemp2)>0) then
+ WarnLog "#i100037# ("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
+ bErrorFound = true
+ endif
+ if ( not bErrorFound ) then
+ warnlog "("+c+"/"+a+"/"+b+"): Provide real Name for Function: '"+sTemp+"'::'"+sTemp2+"'"
+ endif
+ inc(iBugCount(3))
+ endif
+ else
+ ' printlog "("+c+"/"+a+"/"+b+"): '"+sTemp+"'::'"+sTemp2+"'"
+ endif
+ next b
+ next a
+ next c
+ ' if (iBugCount(3) > 0) then WarnLog ""+iBugCount(3)+": Missing Name for funktion; is .uno:..."
+ TabTastatur.cancel
+ Call hCloseDocument
+endcase
+
+testcase tToolsOptionsAPIConfiguration
+ Dim iJump as Integer
+ Dim sComXML as String
+ Dim sHelpTip as String
+ Dim sHelpExtendedTip as String
+ Dim bHelpTip as Boolean
+ Dim bHelpExtendedTip as Boolean
+ Dim Silent as Boolean
+ Dim sTempPath as string
+ Dim sTempList(10) as string
+ Dim sLocalString as string
+
+ 'Used for GetXMLValueGlobal (DEPRECATED function!) to get no output in resultfile.
+ Silent = TRUE
+
+ try
+ ToolsOptions
+ call hToolsOptions ("Languagesettings", "Languages")
+ if (gAsianSup <> Aktivieren.IsChecked) then
+ warnlog "gAsianSup differs from UI"
+ endif
+ if (gCTLSup <> ComplexScriptEnabled.IsChecked) then
+ warnlog "gCTLSup differs from UI"
+ endif
+
+ call hToolsOptions ("STAROFFICE", "ACCESSIBILITY")
+ try
+ if (gPlatGroup <> "unx") then
+ if (gAccessibility <> SupportAssistiveTechnologyTools.IsChecked) then
+ warnlog "gAccessibility differs from UI"
+ endif
+ endif
+ catch
+ if (NOT gAccessibility) then
+ warnlog "gAccessibility differs from UI - catch"
+ endif
+ endcatch
+
+ call hToolsOptions ("StarOffice", "General")
+ if StarOfficeDialogeBenutzen.Exists then
+ if (NOT StarOfficeDialogeBenutzen.isChecked) then
+ warnlog "StarOfficeDialogeBenutzen is not checked"
+ endif
+ end if
+
+ call hToolsOptions ("StarOffice", "General")
+ if (Tips.isChecked) then
+ warnlog "Help Tip is checked"
+ endif
+
+
+ call hToolsOptions ("StarOffice", "Paths")
+ select case iSprache
+ case 01 : iJump = 6 ' English (USA)
+ case 03 : iJump = 7 ' Portuguese
+ case 07 : iJump = 0 ' Russian
+ case 30 : iJump = 0 ' Greek
+ case 31 : iJump = 0 ' Netherlands
+ case 33 : iJump = 0 ' French
+ case 34 : iJump = 0 ' Spanish
+ case 35 : iJump = 0 ' Finnish
+ case 36 : iJump = 0 ' Hungaria
+ case 37 : iJump = 0 ' Catalan
+ case 39 : iJump = 0 ' Italian
+ case 42 : iJump = 0 ' Czech
+ case 43 : iJump = 0 ' Slowak
+ case 44 : iJump = 0 ' English (GB)
+ case 45 : iJump = 0 ' Danish
+ case 46 : iJump = 0 ' Swedish
+ case 47 : iJump = 0 ' Norwegian
+ case 48 : iJump = 0 ' Polish
+ case 49 : iJump = 1 ' German
+ case 51 : iJump = 0 ' Slowak
+ case 55 : iJump = 0 ' Portuguese (Brazil)
+ case 66 : iJump = 0 ' Thai
+ case 81 : iJump = 0 ' Japanese ' disabled, because locale dependant!
+ case 82 : iJump = 0 ' Korean ' disabled, because locale dependant!
+ case 86 : iJump = 0 ' Chinese (simplified) ' disabled, because locale dependant!
+ case 88 : iJump = 0 ' Chinese (traditional) ' disabled, because locale dependant!
+ case 90 : iJump = 0 ' Turkish
+ case 91 : iJump = 0 ' Hindi
+ case 96 : iJump = 0 ' Arab
+ case 97 : iJump = 0 ' Hebrew
+ case else : qaErrorlog "The work-dir can't changed to the internal office-work-dir! Please insert the language in this list!"
+ iJump = 0
+ end select
+
+ if iJump <> 0 then
+ 'DEBUG: printlog "** master.inc::mMakeGeneralOptions::iJump(" & iSprache & ") = " & iJump
+ sLocalString = Typ.getItemText(iJump,3) ' works in gh13
+ if sLocalString = "" then
+ sLocalString = Typ.getItemText(iJump,2) ' fallback for before gh13
+ endif
+ if (sLocalString <> ConvertPath (gOfficePath + "user\work")) then
+ warnlog ("Work Directory differs from API setting? : is: '" + sLocalString + "' should: '" + ConvertPath (gOfficePath + "user\work") + "'")
+ endif
+ else
+ 'TODO: figure out which Entry it could be
+ for i = 1 to Typ.getItemCount
+ if (Typ.getItemText(i,2) = ConvertPath (gOfficePath + "user\work")) then
+ qaErrorLog ("found WorkDirectory at position: " + i)
+ iJump = i
+ endif
+ next i
+ if (iJump = 0) then
+ warnlog ("No workdirectory candidate found.")
+ endif
+ end if
+
+ select case iSprache
+ case 01 : iJump = 8 ' English (USA)
+ case 03 : iJump = 3 ' Portuguese
+ case 07 : iJump = 0 ' Russian
+ case 30 : iJump = 0 ' Greek
+ case 31 : iJump = 0 ' Netherlands
+ case 33 : iJump = 0 ' French
+ case 34 : iJump = 1 ' Spanish
+ case 35 : iJump = 0 ' Finnish
+ case 36 : iJump = 0 ' Hungaria
+ case 37 : iJump = 0 ' Catalan
+ case 39 : iJump = 0 ' Italian
+ case 42 : iJump = 0 ' Czech
+ case 43 : iJump = 0 ' Slowak
+ case 44 : iJump = 0 ' English (GB)
+ case 45 : iJump = 0 ' Danish
+ case 46 : iJump = 0 ' Swedish
+ case 47 : iJump = 0 ' Norwegian
+ case 48 : iJump = 0 ' Polish
+ case 49 : iJump = 8 ' German
+ case 51 : iJump = 0 ' Slowak
+ case 55 : iJump = 1 ' Portuguese (Brazil)
+ case 66 : iJump = 0 ' Thai
+ case 81 : iJump = 0 ' Japanese ' disabled, because locale dependant!
+ case 82 : iJump = 0 ' Korean ' disabled, because locale dependant!
+ case 86 : iJump = 0 ' Chinese (simplified) ' disabled, because locale dependant!
+ case 88 : iJump = 0 ' Chinese (traditional) ' disabled, because locale dependant!
+ case 90 : iJump = 0 ' Turkish
+ case 91 : iJump = 0 ' Hindi
+ case 96 : iJump = 0 ' Arab
+ case 97 : iJump = 0 ' Hebrew
+ case else : qaErrorLog "The temp-dir can't changed to the internal office-temp-dir! Please insert the language in this list!"
+ iJump = 0
+ end select
+ if iJump <> 0 then
+ 'DEBUG: printlog "** master.inc::mMakeGeneralOptions::iJump(" & iSprache & ") = " & iJump
+ sLocalString = Typ.getItemText(iJump,3) ' works in gh13
+ if sLocalString = "" then
+ sLocalString = Typ.getItemText(iJump,2) ' fallback for before gh13
+ endif
+ if (sLocalString <> ConvertPath (gOfficePath + "user\temp")) then
+ warnlog ("Temp Directory differs from API setting? : is: '" + sLocalString + "' should: '" + ConvertPath (gOfficePath + "user\temp") + "'")
+ endif
+ else
+ 'TODO: figure out which Entry it could be
+ for i = 1 to Typ.getItemCount
+ if (Typ.getItemText(i,2) = ConvertPath (gOfficePath + "user\temp")) then
+ qaErrorLog ("found TempDirectory at position: " + i)
+ iJump = i
+ endif
+ next i
+ if (iJump = 0) then
+ warnlog ("No tempdirectory candidate found.")
+ endif
+ end if
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ sleep(4)
+ catch
+ warnlog "Error during walking through optionsdialog"
+ endcatch
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/extras_file_open.inc b/testautomation/framework/optional/includes/extras_file_open.inc
new file mode 100644
index 000000000000..680afdd77197
--- /dev/null
+++ b/testautomation/framework/optional/includes/extras_file_open.inc
@@ -0,0 +1,213 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Perform standard operations on all samples/templates etc.
+'*
+'\***********************************************************************
+
+private const MAX_FILE_COUNT = 3000 ' the max number of templates or samples
+
+' NOTE: Usually we have only about a 100 templates but in multi-language
+' installations there are more than 2100. You should not run these
+' tests on multi language installations. Really.
+
+testcase tOpenObjectsWithFileDialog( cCategory as string )
+
+ printlog( "Open templates and samples using the file open dialog" )
+
+ const CFN = "tOpenObjectsWithFileDialog::"
+
+
+ dim lsFile ( MAX_FILE_COUNT ) as String ' list of all files below samples or templates
+ dim sRootPath as String ' rootpath, depends on cCategory
+ dim sRootPathFallback as string
+
+ dim sFilter as string
+
+ dim sFileIn as String ' file to open
+ dim sFileOut as string ' file to save, reload, delete
+ dim sPathOut as string
+ sPathOut = hGetWorkPath()
+ dim sExtension as String ' filter: determines whether to test the file
+
+ dim iCurrentTemplate as Integer ' increment: current template from lsFile()
+ dim iTemplateCount as integer
+
+ dim bSkipFile as boolean ' turns true if file is to be skipped
+ dim brc as boolean ' some multi purpose boolan returncode
+ dim cOfficePath as string
+
+ ' the path where the samples/templates are located, verify function params
+ ' note that for some time the suffixes for the different filetypes are changed,
+ ' so we have separate names for samples and templates.
+
+ if ( FileExists( gOfficeBasisPath ) ) then
+ cOfficePath = gOfficeBasisPath
+ else
+ cOfficePath = mid( gOfficeBasisPath, len( gNetzOfficePath ) + 1 )
+ if ( FileExists( cOfficePath ) ) then
+ printlog( "Using: " & cOfficePath )
+ else
+ warnlog( "Test script error: Invalid Office path: " & cOfficePath )
+ goto endsub
+ endif
+ endif
+
+ printlog( "Build path to templates/samples directory" )
+ select case cCategory
+ case "SAMPLES" : sRootPath = cOfficePath & "share\samples\" & gISOLang
+ sRootPathFallback = "/opt/openoffice.org/basis3.0/share/samples/" & gISOLang
+ sFIlter = "*.od*"
+ case "TEMPLATES" : sRootPath = cOfficePath & "share\template\" & gISOLang
+ sRootPathFallback = "/opt/openoffice.org/basis3.0/share/template/" & gISOLang
+ sFilter = "*.ot*"
+ case default
+ warnlog( CFN & "Invalid category passed to function" )
+ goto endsub
+ end select
+
+ sRootPath = convertpath( sRootPath )
+
+ if ( NOT FileExists( sRootPath ) ) then
+ qaerrorlog( "Root Path does not exist: " & sRootPath )
+ sRootPath = sRootPathFallback
+ if ( NOT FileExists( sRootPathFallback ) ) then
+ warnlog( "No usable office root path found. Aborting test" )
+ goto endsub
+ printlog( "Using hard coded fallback" )
+ endif
+ endif
+
+ printlog( "Using path..: " & sRootPath )
+ printlog( "Using filter: " & sFilter )
+
+ printlog( "Retrieve filelist from directory" )
+ GetAllFileList ( sRootPath, sFilter, lsFile() )
+ hListDelete( lsFile(), 1 )
+
+ printlog( "Remove posible .lock-files from list" )
+ iTemplateCount = listCount( lsFile() )
+ iCurrentTemplate = 1
+ while( iCurrentTemplate <= iTemplateCount )
+ if ( instr( lsFile( iCurrentTemplate ), "~lock." ) > 0 ) then
+ hListDelete( lsFile(), iCurrentTemplate )
+ iTemplateCount = iTemplateCount - 1
+ else
+ iCurrentTemplate = iCurrentTemplate + 1
+ endif
+ wend
+
+ printlog( "Remove Wizard related files from list" )
+ iTemplateCount = listCount( lsFile() )
+ iCurrentTemplate = 1
+ while( iCurrentTemplate <= iTemplateCount )
+ if ( instr( lsFile( iCurrentTemplate ), "wizard" ) > 0 ) then
+ hListDelete( lsFile(), iCurrentTemplate )
+ iTemplateCount = iTemplateCount - 1
+ else
+ iCurrentTemplate = iCurrentTemplate + 1
+ endif
+ wend
+
+ printlog( "Files to be loaded:" )
+ hListPrint ( lsFile() , "" , "" )
+ if ( listcount( lsfile() ) = 1 ) then
+ if ( gProductName = "OpenOffice.org" ) then
+ printlog( gProductName & " comes with no samples, skipping" )
+ goto endsub
+ else
+ warnlog( "Filelist seems to be incomplete. GetAllFileList() failed!" )
+ goto endsub
+ endif
+ else
+ printlog( "List of samples/templates appears to be valid" )
+ endif
+
+ iTemplateCount = listCount( lsFile() )
+ for iCurrentTemplate = 1 to iTemplateCount
+
+ printlog( "" )
+ printlog( "Loading file " & iCurrentTemplate & " of " & iTemplateCount )
+
+ ' sFileIn holds the file we currently work with
+ sFileIn = lsFile( iCurrentTemplate )
+
+ printlog( "Load: " & sFileIn )
+ hFileOpen( sFileIn )
+
+ printlog( "Handle known dialogs" )
+ hHandleActivesOnLoad( 0 , 2 )
+
+ printlog( "Check for Filter Selection dialog" )
+ Kontext "FilterAuswahl"
+ if ( FilterAuswahl.exists( 1 ) ) then
+ warnlog( "Loading failed, ASCII filter dialog present" )
+ FilterAuswahl.cancel()
+ hFileCloseAll()
+ else
+
+ printlog( "Close navigator, if open" )
+ hCloseNavigator()
+
+ sFileOut = cCategory & "_" & iCurrentTemplate
+ sFileOut = convertpath( sPathOut & sFileOut )
+
+ printlog( "Saving file to: " & sFileOut )
+ hFileSaveAsKill( sFileOut )
+
+ ' note: this is delayed, because the dialogs take time to pop up
+ ' even while the dialog is visible, we can work with the doc.
+ printlog( "Handle known dialogs" )
+ hHandleInitialDialogs()
+
+ printlog( "Close document" )
+ hDestroyDocument()
+
+ printlog( "Load document again" )
+ hFileOpen( sFileOut )
+
+ printlog( "Handle known dialogs" )
+ hHandleActivesOnLoad( 0 , 2 )
+
+ printlog( "Close navigator, if open" )
+ hCloseNavigator()
+
+ printlog( "Close document" )
+ hDestroyDocument()
+
+ endif
+
+ printlog( "Delete file" )
+ hDeleteFile( sFileOut )
+
+ next iCurrentTemplate
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/extras_labels.inc b/testautomation/framework/optional/includes/extras_labels.inc
new file mode 100644
index 000000000000..11badbd0ba07
--- /dev/null
+++ b/testautomation/framework/optional/includes/extras_labels.inc
@@ -0,0 +1,107 @@
+'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 : joerg.skottke@sun.co
+'*
+'* short description : test names of labels
+'*
+'\******************************************************************************
+
+testcase tLabelTypes()
+
+ if ( gIsoLang <> "en-US" ) then
+ printlog( "No testing for non-en_US languages" )
+ goto endsub
+ endif
+
+
+ dim iBrandCount as integer
+ dim iCurrentBrand as integer
+ dim cBrandName as string
+
+ dim iTypeCount as integer
+ dim iCurrentType as integer
+ dim cTypeName as string
+
+ dim cBrandType as string
+
+ dim al_UI_Labels( 1600 ) as string
+ al_UI_Labels( 0 ) = "0"
+
+ dim irc as integer
+
+ dim sFile as string
+ sFile = "Labels_" & gISOLang & ".txt"
+
+ dim sFileIn as string
+ sFileIn = gTesttoolPath & "framework\optional\input\extras_formats\" & sFile
+ sFileIn = convertpath( sFileIn )
+
+ dim sFileOut as string
+ sFileOut = hGetWorkPath() & sFile
+
+
+ hCreateLabels()
+
+ kontext
+ Active.SetPage TabEtiketten
+
+ kontext "TabEtiketten"
+
+ iBrandCount = Marke.getItemCount()
+
+ for iCurrentBrand = 1 to iBrandCount
+
+ Marke.select( iCurrentBrand )
+
+ cBrandName = Marke.getSelText()
+
+ iTypeCount = Typ.getItemCount()
+
+ for iCurrentType = 1 to iTypeCount
+
+ Typ.select( iCurrentType )
+
+ cTypeName = Typ.getSelText()
+
+ cBrandType = cBrandName & ":" & cTypeName
+ ListAppend( al_UI_Labels() , cBrandType )
+
+ next iCurrentType
+
+ next iCurrentBrand
+
+ TabEtiketten.Cancel()
+
+ irc = hManageComparisionList( sFileIn, sFileOut, al_UI_Labels() )
+ if ( irc <> 0 ) then
+ warnlog( "The list of labels (Brand/Types) has changed, please review." )
+ else
+ printlog( "The lists of labels are unchanged. Good." )
+ endif
+
+endcase
diff --git a/testautomation/framework/optional/includes/extras_modify_objects.inc b/testautomation/framework/optional/includes/extras_modify_objects.inc
new file mode 100644
index 000000000000..b8cf23170942
--- /dev/null
+++ b/testautomation/framework/optional/includes/extras_modify_objects.inc
@@ -0,0 +1,168 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Perform standard operations on all samples/templates etc.
+'*
+'\***********************************************************************
+
+private const MAX_FILE_COUNT = 3000 ' the max number of templates or samples
+
+' NOTE: Usually we have only about a 100 templates but in multi-language
+' installations there are more than 2100. You should not run these
+' tests on multi language installations. Really.
+
+testcase tModifyObjects( iMode as integer, cCategory as string, sVer as string )
+
+ const CFN = "tModifyObjects::"
+ const RESTART = 15
+ const TEMPLATE_COUNT = 236 ' For en-US/StarOffice, numbers may differ for Languages/Brands
+ const SAMPLE_COUNT = 60 ' For en-US/StarOffice, numbers may differ for Languages/Brands
+
+
+ dim iObjectFolder as integer
+ dim iObjectFolders as integer
+
+ dim iObject as integer ' Iterator
+ dim iObjectCount( 20 ) as integer
+ dim iObjectSum as integer : iObjectSum = 0
+ dim iObjectCountExpected as integer
+
+ dim sFile as string
+ dim sPath as string
+ sPath = hGetWorkPath()
+
+ dim iReset as integer : iReset = 0
+
+ printlog( "" )
+
+ select case( lcase( cCategory ))
+ case "templates" : iObjectCountExpected = TEMPLATE_COUNT
+ case "samples" : iObjectCountExpected = SAMPLE_COUNT
+ end select
+
+ printlog( "Open Templates and Samples dialog" )
+ FileNewFromTemplate
+ WaitSlot( 2000 )
+ hSelectCategory( cCategory )
+ iObjectFolders = FileList.getItemCount()
+
+ printlog( "Count the items in the templates and samples dialog" )
+ for iObject = 1 to iObjectFolders
+ hSelectFileFolder( iObject , true )
+ iObjectCount( iObject ) = FileList.getItemCount()
+ iObjectSum = iObjectSum + iObjectCount( iObject )
+ UpOneLevel.click()
+ next iObject
+
+ printlog( "Verify object count (en_US only)" )
+ if ( gProductName = "StarOffice" and gISOLang = "en-US" ) then
+ if ( iObjectSum <> iObjectCountExpected ) then
+ warnlog( "Number of objects has changed. OLD: " & iObjectCountExpected &_
+ " NEW: " & iObjectSum )
+ else
+ printlog( "Object count is ok for en-US / StarOffice" )
+ endif
+ else
+ printlog( "Template count testing skipped for non-en_US/StarOffice" )
+ endif
+
+ Kontext "TemplateAndDocuments"
+ printlog( "Switch from preview to document info" )
+ docinfo.click()
+ TemplateAndDocuments.cancel()
+
+ printlog( "" )
+ printlog( "Starting to load/save/close/reload/close all Objects" )
+ printlog( "" )
+
+ for iObjectFolder = 1 to iObjectFolders
+
+ for iObject = 1 to iObjectCount( iObjectFolder )
+
+ gApplication = "WRITER"
+
+ printlog( "" )
+ printlog( "Folder index = " & iObjectFolder & ", Object index = " & iObject )
+
+ hFileCloseAll()
+
+ if ( iReset = 10 ) then
+ call exitRestartTheOffice()
+ iReset = 0
+ endif
+
+ printlog( "Select the item we want to load" )
+ FileNewFromTemplate
+ WaitSlot( 2000 )
+ hSelectCategory( cCategory )
+ hSelectFileFolder( iObjectFolder , false )
+ hSelectDocumentObject( iObject , iMode )
+
+ ' treat it like a folder. If it is, skip it. Otherwise perform the test
+ kontext "TemplateAndDocuments"
+ if ( TemplateAndDocuments.exists() ) then
+ if ( not edit.isEnabled() ) then
+ printlog( CFN & "Object is folder or #edit# is disabled, skipping" )
+ UpOneLevel.click()
+ TemplateAndDocuments.cancel()
+ endif
+ else
+ printlog( "Loading file..." )
+ printlog( "Check for Filter Options dialog" )
+ if ( hFileWait( false ) = -6 ) then
+ warnlog( "Load failure: ASCII filter dialog displayed, recovering" )
+ kontext "FilterAuswahl"
+ FilterAuswahl.cancel()
+ hDestroyDocument()
+ else
+ printlog( "Build filename; save, reload and delete" )
+ sFile = sPath & cCategory & iObjectFolder & "_" & iObject
+ hCloseNavigator()
+ hFileSaveAsKill( sFile )
+ hDestroyDocument()
+ hFileOpen( sFile )
+ hHandleActivesOnLoad( 1 , 2 )
+ hCloseNavigator()
+ hDestroyDocument()
+ hDeleteFile( sFile )
+ printlog( "Test cycle done, going for next object." )
+ endif
+ endif
+
+ iReset = iReset + 1
+
+ next iObject
+
+ next iObjectFolder
+
+ hDestroyDocument()
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/extras_preview.inc b/testautomation/framework/optional/includes/extras_preview.inc
new file mode 100644
index 000000000000..8e1129bd5bf4
--- /dev/null
+++ b/testautomation/framework/optional/includes/extras_preview.inc
@@ -0,0 +1,112 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Perform standard operations on all samples/templates etc.
+'*
+'\***********************************************************************
+
+private const MAX_FILE_COUNT = 3000 ' the max number of templates or samples
+
+' NOTE: Usually we have only about a 100 templates but in multi-language
+' installations there are more than 2100. You should not run these
+' tests on multi language installations. Really.
+
+testcase tShowAllObjectsAsPreview( cCategory as string )
+
+
+ dim iObjectFolder as Integer ' the current folder in loops
+ dim iObjectFolders as integer ' the number of template/sample-folders
+
+ dim iObject as Integer ' the current template/sample within loops
+ dim iObjectCount( 20 ) as integer ' number of templates/samples in the folders
+
+
+ printlog( "" )
+
+
+ FileNewFromTemplate
+ if ( TemplateAndDocuments.exists( 1 ) ) then
+
+
+ hSelectCategory( cCategory )
+
+ iObjectFolders = FileList.getItemCount()
+
+ for iObject = 1 to iObjectFolders
+
+ '//<li>grab a folder below cCategory and open it</li>
+ hSelectFileFolder( iObject , true )
+
+ '<li>get the number of items</li>
+ iObjectCount( iObject ) = FileList.getItemCount()
+
+ '<li>step up one level to the root of cCategory</li>
+ UpOneLevel.click()
+
+ next iObject
+
+ preview.click()
+
+ printlog( "" )
+ printlog( "Displaying documents in preview pane" )
+ printlog( "" )
+
+ for iObjectFolder = 1 to iObjectFolders
+
+ kontext "TemplateAndDocuments"
+
+ hSelectCategory( cCategory )
+
+ hSelectFileFolder( iObjectFolder , false )
+
+ for iObject = 1 to iObjectCount( iObjectFolder )
+
+ printlog( "Object-Folder: " & iObjectFolder & " Entry: " & iObject )
+
+ hSelectDocumentObject( iObject , 0 )
+
+ 'Problem: Cannot verify the content of preview window.
+ WaitSlot( 5000 )
+
+
+ next iObject
+
+
+ next iObjectFolder
+
+ Kontext "TemplateAndDocuments"
+ TemplateAndDocuments.cancel()
+
+ else
+ warnlog( "Failed to open Templates And Documents dialog" )
+ endif
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/extras_table_autoformat.inc b/testautomation/framework/optional/includes/extras_table_autoformat.inc
new file mode 100644
index 000000000000..2de2c491c528
--- /dev/null
+++ b/testautomation/framework/optional/includes/extras_table_autoformat.inc
@@ -0,0 +1,126 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Test the autoformat-feature for tables
+'*
+'\******************************************************************************
+
+testcase tAutoformatTable( iApp as integer )
+
+ if ( gIsoLang <> "en-US" ) then
+ printlog( "No testing for non-en_US languages" )
+ goto endsub
+ endif
+
+
+ dim al_UI_formats( 1000 ) as string
+ al_UI_formats( 0 ) = "0"
+
+ dim iFormatCount as integer
+ dim iCurrentFormat as integer
+ dim cCurrentFormat as string
+
+ dim irc as integer
+
+ dim sFileOut as string
+ dim sFile as string
+ dim sFileIn as string
+ sFileIn = gTesttoolPath & "framework\optional\input\extras_formats\"
+
+ dim oControl as object
+
+ ' Build the filenames
+ select case iApp
+ case 1 : sFile = "Tables_writer_" & gISOLang & ".txt"
+ case 2 : sFile = "Tables_calc_" & gISOLang & ".txt"
+ end select
+
+ sFileIn = convertpath( sFileIn & sFile )
+ sFileOut = hGetWorkPath() & sFile
+
+ hCreateDocument()
+
+ select case iApp
+ case 1 : kontext "DocumentWriter"
+ hTabelleEinfuegen()
+ case 2 : kontext "DocumentCalc"
+ DocumentCalc.TypeKeys( "<Shift Right>", 5 )
+ DocumentCalc.TypeKeys( "<Shift Down>", 3 )
+ end select
+
+ FormatAutoformat
+
+ select case iApp
+ case 1 : kontext "AutoformatTabelle"
+ if ( AutoformatTabelle.exists( 2 ) ) then
+ oControl = FormatBox
+ else
+ warnlog( "Unable to access Table Autoformat dialog (Writer)" )
+ goto endsub
+ endif
+
+ case 2 : kontext "AutoformatCalc"
+ if ( AutoformatCalc.exists( 2 ) ) then
+ oControl = FormatListe
+ else
+ warnlog( "Unable to access Table Autoformat dialog (Calc)" )
+ goto endsub
+ endif
+ end select
+
+ iFormatCount = oControl.getItemCount()
+
+ for iCurrentFormat = 1 to iFormatCount
+
+ oControl.select( iCurrentFormat )
+
+ cCurrentFormat = oControl.getSelText()
+ ListAppend( al_UI_formats() , cCurrentFormat )
+
+ next iCurrentFormat
+
+ select case iApp
+ case 1 : AutoformatTabelle.ok()
+ case 2 : AutoformatCalc.ok()
+ end select
+
+ hDestroyDocument()
+
+ irc = hManageComparisionList( sFileIn, sFileOut, al_UI_formats() )
+ if ( irc <> 0 ) then
+ warnlog( "The list of table autoformats has changed, please review." )
+ else
+ printlog( "The list of table autoformats is unchanged. Good." )
+ endif
+
+endcase
+
+
+
+
diff --git a/testautomation/framework/optional/includes/f_usage_tracking.inc b/testautomation/framework/optional/includes/f_usage_tracking.inc
new file mode 100644
index 000000000000..5abdade49ccf
--- /dev/null
+++ b/testautomation/framework/optional/includes/f_usage_tracking.inc
@@ -0,0 +1,285 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Usage tracking
+'*
+'\******************************************************************************
+
+' Concept
+' The usage tracking functionality is disabled during test init.
+' Configuration is done in Tools/Options. There a tabpage must exist that
+' offers the functionality to enable/disable tracking and to show what has
+' logged.
+
+private const LOGFILE = "user\temp\Feedback\Current.csv"
+
+'*******************************************************************************
+
+testcase tUsageTracking1
+
+ printlog( "Test case 1: Presence of the Usage Tracking featureset (API)" )
+
+ if ( not gOOoImprovementIsEnabled ) then
+ warnlog( "Could not access API for usage tracking program" )
+ endif
+
+endcase
+
+'*******************************************************************************
+
+testcase tUsageTracking2
+
+ ' There must not be a log file to start with.
+
+ printlog( "Test case 2: There must be no logfile present yet" )
+
+ dim cLogFile as string
+ cLogFile = gOfficePath & LOGFILE
+ cLogFile = convertpath( cLogFile )
+
+ if ( dir( cLogFile ) = "" ) then
+ printlog( "No log file. Good" )
+ else
+ warnlog( "Logfile not esxpected: " & cLogFile )
+ hDeleteFile( cLogFile )
+ endif
+
+endcase
+
+'*******************************************************************************
+
+testcase tUsageTracking3
+
+ ' When the usage tracking mechanism is off we want the ui to reflect that.
+
+ printlog( "Test case 3: Presence of configuration tabpage and button states for disabled functionality" )
+
+ ToolsOptions
+ hToolsOptions( "StarOffice" , "IMPROVEMENT" )
+
+ kontext "TabOOoImprovement"
+ if ( TabOOoImprovement.exists( 1 ) ) then
+
+ if ( not ParticipateNo.isChecked() ) then
+ qaerrorlog( "#i98736# - UI should reflect current status for usage tracking: No" )
+ endif
+
+ if ( ShowData.isEnabled() ) then
+ qaerrorlog( "#i97340# - Show data button should not be enabled if nothing is logged" )
+
+ ShowData.click()
+
+ kontext "Active"
+ if ( Active.exists( 2 ) ) then
+ qaerrorlog( "Messagebox not required as control should not be enabled (see #i97340#)" )
+ Active.ok()
+
+ kontext "TextImport"
+ if ( TextImport.exists( 5 ) ) then
+ warnlog( "There should be nothing to load if usage tracking is disabled" )
+
+ TextImport.ok()
+
+ kontext "CALC"
+ if ( DocumentCalc.exists( 3 ) ) then
+ hCloseDocument()
+ else
+ warnlog( "If a log exists it should open in a new Calc document" )
+ endif
+ endif
+ endif
+ endif
+ else
+ warnlog( "OOo Improvement Tabpage (Tools/Options) is missing" )
+ endif
+
+ kontext "OptionenDlg"
+ OptionenDlg.cancel()
+
+endcase
+
+'*******************************************************************************
+
+testcase tUsageTracking4
+
+ ' When enabling usage tracking we want the mechanism to work at once
+
+ printlog( "Test case 4: Enable usage tracking, track something and display the log" )
+
+ dim iDocumentType as integer
+
+ dim cLogFile as string
+ cLogFile = gOfficePath & LOGFILE
+ cLogFile = convertpath( cLogFile )
+
+ dim lFileSize as long
+
+ const FILE_SIZE = 2000
+
+ hDeleteFile( cLogFile )
+
+ ToolsOptions
+
+ hToolsOptions( "StarOffice" , "IMPROVEMENT" )
+
+ kontext "TabOOoImprovement"
+ if ( TabOOoImprovement.exists( 1 ) ) then
+
+ ParticipateYes.check()
+
+ if ( hForceUsageTrackingOn() ) then
+
+ kontext "OptionenDlg"
+ OptionenDlg.ok()
+
+ ' Open different document types and modify them so something is logged
+ for iDocumentType = 1 to 4
+
+ hNumericDocType( iDocumentType )
+ hNewDocument()
+ hChangeDoc()
+ hCloseDocument()
+
+ next iDocumentType
+
+ ToolsOptions
+
+ hToolsOptions( "StarOffice" , "IMPROVEMENT" )
+
+ kontext "TabOOoImprovement"
+ if ( TabOOoImprovement.exists( 1 ) ) then
+
+ lFileSize = hGetFileSizeAsLong( cLogFile )
+ printlog( "Filesize is: " & lFileSize & " byte" )
+ if ( lFileSize <> FILE_SIZE ) then
+ warnlog( "The logfile does not have the expected size" )
+ printlog( "Expected: " & FILE_SIZE )
+ printlog( "Found...: " & lFileSize )
+ endif
+
+ ShowData.click()
+
+ kontext "TextImport"
+ if ( TextImport.exists( 3 ) ) then
+
+ TextImport.ok()
+
+ kontext "CALC"
+ if ( DocumentCalc.exists( 3 ) ) then
+ printlog( "Calc document is open" )
+ if ( getDocumentCount <> 1 ) then
+ warnlog( "Other, unexpected documents are open" )
+ else
+ hCloseDocument()
+ endif
+ else
+ warnlog( "Logfile should open in a new spreadsheet document, document missing" )
+ endif
+
+ else
+
+ warnlog( "Text Import (CSV) settings dialog did not open" )
+
+ kontext "Active"
+ if ( Active.exists() ) then
+ warnlog( "Unexpected messagebox" )
+ printlog( Active.getText() )
+ Active.ok()
+ endif
+ endif
+
+ kontext "TabOOoImprovement"
+ ParticipateNo.click()
+
+ kontext "Active"
+ if ( Active.exists( 3 ) ) then
+ Active.Yes()
+ else
+ qaerrorlog( "#i98739# - No delete option available when stopping usage tracking" )
+ endif
+
+ endif
+ else
+ qaerrorlog( "#i98741# - Failed to force Usage Tracking on via API" )
+ endif
+
+ kontext "OptionenDlg"
+ OptionenDlg.ok()
+
+ endif
+
+ hDeleteFile( cLogFile )
+
+endcase
+
+'*******************************************************************************
+
+function hForceUsageTrackingOn()
+
+ ' the usage tracking extension was disabled by force, in this function
+ ' we force it back on as the switch in the UI is ignored
+
+ Dim oUnoOfficeConnection as object
+ Dim oUnoConfigurationAccess as object
+ Dim aPropertyValue(1) As new com.sun.star.beans.PropertyValue ' Array of pairs: Property with Value
+ Dim xViewRoot
+
+ Dim oOOoImprovementController as object ' Check presence of the OOo Improvement Program
+
+ try
+ oUnoConfigurationAccess=oUnoOfficeConnection.createInstance("com.sun.star.configuration.ConfigurationProvider")
+ if (isNull(oUnoConfigurationAccess)) then
+ warnlog (sFileFunction+"Couldn't create Configuration access")
+ exit function
+ endif
+
+ aPropertyValue(0).Name="nodepath"
+ aPropertyValue(1).Name="lazywrite"
+ aPropertyValue(1).Value=False
+
+ oOOoImprovementController = oUnoOfficeConnection.createInstance( "com.sun.star.oooimprovement.CoreController" )
+ if ( isNull( oOOoImprovementController ) ) then
+ hForceUsageTrackingOn() = FALSE
+ else
+ aPropertyValue(0).Value="/org.openoffice.Office.Logging/OOoImprovement"
+ xViewRoot=oUnoConfigurationAccess.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess",aPropertyValue())
+ xViewRoot.replaceByName("EnablingAllowed", true )
+ xViewRoot.commitChanges()
+ if xViewRoot.hasPendingChanges() then
+ qaErrorLog("Configuration not flushed: OOoImprovementProgram/InvitationAccepted: FALSE")
+ end if
+ xViewRoot.dispose()
+ hForceUsageTrackingOn() = TRUE
+ endif
+
+ catch
+ printlog( "Could not enable Usage Tracking via API" )
+ endcatch
+
+end function
diff --git a/testautomation/framework/optional/includes/filedlg_allowed_names.inc b/testautomation/framework/optional/includes/filedlg_allowed_names.inc
new file mode 100644
index 000000000000..ce386758c255
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_allowed_names.inc
@@ -0,0 +1,115 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : check the internal file dialog ( extended tests )
+'*
+'\******************************************************************************
+
+testcase tSaveLoadDelFiles()
+
+
+ ' This test checks filenames that resemble Devices and files that contain
+ ' the allowed ASCII chars between 32 and 255. The latter is tested by five
+ ' random characters
+ ' The test should work for all applications and on all languages/locales.
+
+ dim cStrangeName as string
+ dim iCounter ' iterator
+ dim iRandom ' random number. should end up to be a value between 32 and 255
+ dim brc as boolean
+
+ dim iCurrentDocType as integer ' increment
+
+ for iCurrentDocType = 1 to 1
+
+ printlog( "" )
+ printlog( "Current Documenttype: " & hNumericDocType( iCurrentDocType ) )
+ printlog( "Check if filenames that resemble devicenames are treated ok" )
+ printlog( "" )
+
+ printlog( "Open a new document" )
+
+ brc = hSaveLoadDelSuccess( "COM0" , true )
+ brc = hSaveLoadDelSuccess( "COM10" , true )
+ brc = hSaveLoadDelSuccess( "LPT0" , true )
+ brc = hSaveLoadDelSuccess( "LPT10" , true )
+
+ ' This test randomizes through a number of characters, a full test of all
+ ' possible ascii characters would simply take too long.
+ printlog( "" )
+ printlog( "Names with allowed ASCII-chars" )
+ printlog( "" )
+
+ call randomize()
+
+ for iCounter = 1 to 3
+
+ iRandom = int( 32 + ( 223 * rnd ) )
+ printlog( "" )
+ printlog( " * Using decimal char: " & iRandom )
+ printlog( "" )
+
+
+ ' Exclude some special characters that cannot work
+ select case iRandom
+
+ case 32 : printlog( " - skipping ASCII-Char: " & iRandom )
+ case 34 : printlog( " - skipping ASCII-Char: " & iRandom )
+ case 35 : printlog( " - skipping ASCII-Char: " & iRandom )
+ case 42 : printlog( " - skipping ASCII-Char: " & iRandom )
+ case 46 : printlog( " - skipping ASCII-Char: " & iRandom )
+ case 47 : printlog( " - skipping ASCII-Char: " & iRandom )
+ case 58 : printlog( " - skipping ASCII-Char: " & iRandom )
+ case 60 : printlog( " - skipping ASCII-Char: " & iRandom )
+ case 62 : printlog( " - skipping ASCII-Char: " & iRandom )
+ case 63 : printlog( " - skipping ASCII-Char: " & iRandom )
+ case 92 : printlog( " - skipping ASCII-Char: " & iRandom )
+ case 124 : printlog( " - skipping ASCII-Char: " & iRandom )
+ case 126 : printlog( " - skipping ASCII-Char: " & iRandom )
+
+ case else
+
+ cStrangeName = hNameGen_append( iRandom )
+ brc = hSaveLoadDelSuccess( cStrangeName , TRUE )
+
+ cStrangeName = hNameGen_lead( iRandom )
+ brc = hSaveLoadDelSuccess( cStrangeName , TRUE )
+
+ end select
+
+ next iCounter
+
+ brc = hDestroyDocument()
+
+ next iCurrentDocType
+
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/filedlg_autocomplete.inc b/testautomation/framework/optional/includes/filedlg_autocomplete.inc
new file mode 100644
index 000000000000..a289e0c6116e
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_autocomplete.inc
@@ -0,0 +1,207 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Autocompletion feature
+'*
+'\******************************************************************************
+
+testcase tAutocomplete
+
+ printlog( "Autocompletion in the OpenOffice.org file picker" )
+
+ ' IMPORTANT NOTE: Autocompletion is asynchronous. This means that no rule
+ ' exists when exactly it is going to strike. If you are
+ ' using a networked environment you have to make sure that
+ ' all network ressources deliver a decent performance as
+ ' this seriously influences the speed of the autocompletion.
+
+ ' Assemble a work directory path
+ const WORKDIR = "autocomplete"
+ dim cBasePath as string : cBasePath = hGetWorkPath()
+ dim cWorkDir as string : cWorkDir = cBasePath & WORKDIR
+
+ ' These are the files we create in the users homedirectory
+ dim aWorkFile( 3 ) as string
+ aWorkFile( 1 ) = "autocomplete_a.odt"
+ aWorkFile( 2 ) = "autocomplete_b.odt"
+ aWorkFile( 3 ) = "autocomplete_bb.odt"
+
+ ' These are the full paths to the files
+ dim aFullPath( 3 ) as string
+
+ ' These are the wildcarded filter strings
+ dim aWildCard( 3 )
+ aWildCard( 1 ) = "autocomplete_?.odt"
+ aWildCard( 2 ) = "autocomplete_b?.odt"
+ aWildCard( 3 ) = "autocomplete_*.odt"
+
+ dim cCurrentPath as string
+ dim cAutocomplete as string
+
+ dim iCurrentDocument as integer
+
+ dim cLeft as string
+ dim iLeft as integer
+ iLeft = 4
+
+ dim cEFString as string
+
+ dim slot
+
+ printlog( "Close all open documents" )
+ hFileCloseAll()
+
+ printlog( "Assemble 3 filenames for workfiles" )
+ aFullPath( 1 ) = cWorkDir & gPathSigne & aWorkFile( 1 )
+ aFullPath( 2 ) = cWorkDir & gPathSigne & aWorkFile( 2 )
+ aFullPath( 3 ) = cWorkDir & gPathSigne & aWorkFile( 3 )
+
+ printlog( "Delete the 3 workfiles if they exist" )
+ hDeleteFile( aFullPath( 1 ) )
+ hDeleteFile( aFullPath( 2 ) )
+ hDeleteFile( aFullPath( 3 ) )
+
+ printlog( "Try to remove conflicting work directories" )
+ if ( dir( cBasePath & WORKDIR ) <> "" ) then
+ rmdir( cWorkDir )
+ endif
+
+ printlog( "Create workdirectory: " & cWorkDir )
+ mkdir( cWorkDir )
+ if ( NOT FileExists( cWorkDir ) ) then
+ warnlog( "Failed to create work directory, aborting" )
+ goto endsub
+ endif
+
+ gApplication = "WRITER"
+ printlog( "Create the workfiles - 3 writer files with minimum content" )
+ for iCurrentDocument = 1 to 3
+ call hCreateDocument()
+ kontext "DocumentWriter"
+ DocumentWriter.typeKeys( aWorkFile( iCurrentDocument ) )
+ hFileSaveAs( aFullPath( iCurrentDocument ) )
+ hUseAsyncSlot( "FileClose" )
+ next iCurrentDocument
+
+ printlog( "Open the File Open dialog" )
+ hUseAsyncSlot( "FileOpen" )
+
+ kontext "OeffnenDlg"
+ printlog( "Click the <Standard> button to get to the default work directory" )
+ Standard.click()
+
+ cLeft = left( WORKDIR, iLeft )
+ cEFString = convertpath( WORKDIR & "/" )
+ printlog( "Type """ & cLeft & """ into the filename entryfield" )
+ DateiName.typeKeys( cLeft )
+
+ printlog( "Press the <END> key and wait for two seconds" )
+ DateiName.typeKeys( "<END>" )
+ sleep( 1 ) ' Required, do not remove
+
+ cAutocomplete = DateiName.getSelText()
+ if ( cEFString = cAutocomplete ) then
+ printlog( "Autocompletion succeeded for workdirectory" )
+ else
+ warnlog( "Autocompletion failed" )
+ printlog( "Expected: " & cEFString )
+ printlog( "Found...: " & cAutocomplete )
+ endif
+
+ printlog( "Press <RETURN> on the file open dialog -> Open"
+ kontext "OeffnenDlg"
+ OeffnenDlg.typeKeys( "<RETURN>" )
+
+ printlog( "Type "" auto "" into the entryfield" )
+ cLeft = left( aWorkFile( 1 ), 4 )
+ DateiName.typeKeys( cLeft )
+ sleep( 1 )
+
+ cAutocomplete = DateiName.getSelText()
+ if ( aWorkFile( 1 ) = cAutocomplete ) then
+ printlog( "Autocompletion succeeded for first file" )
+ else
+ warnlog( "Autocompletion failed" )
+ printlog( "Expected: " & cEFString )
+ printlog( "Found...: " & cAutocomplete )
+ endif
+
+ printlog( "Press down key in entry field" )
+ DateiName.typeKeys( "<DOWN>" )
+ sleep( 1 )
+
+ cAutocomplete = DateiName.getSelText()
+ if ( aWorkFile( 2 ) = cAutocomplete ) then
+ printlog( "Autocompletion succeeded for second file" )
+ else
+ warnlog( "Autocompletion failed" )
+ printlog( "Expected: " & cEFString )
+ printlog( "Found...: " & cAutocomplete )
+ endif
+
+ printlog( "Enter autocomplete_?.odt -> 2 matches expected" )
+ Dateiname.setText( aWildCard( 1 ) )
+ Oeffnen.click()
+ if ( DateiAuswahl.getItemCount() <> 2 ) then
+ warnlog( "Incorrect number of files displayed, 2 expected" )
+ else
+ printlog( "Correct number of files listed in files-list" )
+ endif
+
+ printlog( "Enter autocomplete_b?.odt -> 1 match expected" )
+ Dateiname.setText( aWildCard( 2 ) )
+ Oeffnen.click()
+ if ( DateiAuswahl.getItemCount() <> 1 ) then
+ warnlog( "Incorrect number of files displayed, 1 expected" )
+ else
+ printlog( "Correct number of files listed in files-list" )
+ endif
+
+ printlog( "Enter autocomplete_*.odt -> 3 matches expected" )
+ Dateiname.setText( aWildCard( 3 ) )
+ Oeffnen.click()
+ if ( DateiAuswahl.getItemCount() <> 3 ) then
+ warnlog( "Incorrect number of files displayed, 3 expected" )
+ else
+ printlog( "Correct number of files listed in files-list" )
+ endif
+
+
+ printlog( "Close File Open dialog" )
+ kontext "OeffnenDlg"
+ OeffnenDlg.cancel()
+
+ printlog( "Delete workfiles and -directory" )
+ hDeleteFile( aFullPath( 1 ) )
+ hDeleteFile( aFullPath( 2 ) )
+ hDeleteFile( aFullPath( 3 ) )
+ rmdir( cBasePath & WORKDIR )
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/filedlg_cjk_files.inc b/testautomation/framework/optional/includes/filedlg_cjk_files.inc
new file mode 100644
index 000000000000..19f508193a8d
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_cjk_files.inc
@@ -0,0 +1,82 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : check the internal file dialog ( extended tests )
+'*
+'\******************************************************************************
+
+testcase tSaveLoadDelFilesCJK()
+
+ printlog( "Save, load and delete files from the hight UTF-8 characters list" )
+
+ if ( not hTestLocale() ) then
+ qaerrorlog( "Could not verify UTF-8 locale. Make sure an UTF-8 locale is used!" )
+ endif
+
+ dim cStrangeName as string
+ dim iCounter as integer ' iterator
+ dim iRandom as long ' random number
+ dim brc as boolean
+
+ printlog( "Invoke randomizer" )
+ call randomize()
+
+ printlog( "Generate filenames, run tests" )
+ for iCounter = 1 to 2
+
+ iRandom = int( 19968 + ( 20911 * rnd ) )
+ printlog( "" )
+ printlog( " * Using decimal char: " & iRandom )
+
+ cStrangeName = hNameGen_append( iRandom )
+ hSaveLoadDelSuccess( cStrangeName )
+
+ cStrangeName = hNameGen_lead( iRandom )
+ hSaveLoadDelSuccess( cStrangeName )
+
+ kontext "active"
+ if( active.exists() ) then
+ qaerrorlog( "#i33964# Document does not exist when the last document is deleted from filepicker" )
+ printlog( active.gettext() )
+ active.ok()
+ endif
+
+ printlog( "Delete the file" )
+ hDeleteFile( hGetWorkPath() & cStrangeName )
+
+ printlog( "Close navigator, if it exists" )
+ hCloseNavigator()
+
+ next iCounter
+
+ printlog( "Close the document" )
+ hDestroyDocument()
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/filedlg_cjk_folders.inc b/testautomation/framework/optional/includes/filedlg_cjk_folders.inc
new file mode 100644
index 000000000000..cc6555b715a1
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_cjk_folders.inc
@@ -0,0 +1,86 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : check the internal file dialog ( extended tests )
+'*
+'\******************************************************************************
+
+testcase tCJKFolders()
+
+
+ if ( not hTestLocale() ) then
+ warnlog( "Test requires UTF-8 locale" )
+ goto endsub
+ endif
+
+
+
+ dim cStrangeFolder as string
+ dim cStrangeFile as string
+ dim iCounter as integer ' iterator
+ dim iRandom as long ' random number.(needs long for cjk chars)
+ dim brc as boolean
+
+ printlog( CHR$(13) )
+ printlog( "Check if CJK-files/folders are handled ok" )
+ printlog( CHR$(13) )
+
+ printlog( "Open a new document" )
+ brc = hCreateDocument()
+
+ printlog( CHR$(13) + "Names with CJK-chars" )
+ printlog( "" )
+
+ call randomize()
+
+ for iCounter = 1 to 3
+
+ iRandom = int( 19968 + ( 20911 * rnd ) )
+ printlog( " * Using decimal char: " & iRandom )
+
+ cStrangeFolder = hNameGen_append( iRandom )
+ brc = hCreateDirctoryExpectSuccess( cStrangeFolder )
+
+ cStrangeFile = hNameGen_append( iRandom )
+ cStrangeFile = convertpath( cStrangeFolder & "\" & cStrangeFile )
+ brc = hSaveLoadDelSuccess( cStrangeFile , TRUE )
+
+ cStrangeFile = hNameGen_lead( iRandom , true )
+ cStrangeFile = convertpath( cStrangeFolder & "\" & cStrangeFile )
+ brc = hSaveLoadDelSuccess( cStrangeName , true )
+
+ brc = hDeleteFileExpectSuccess( cStrangeFolder )
+
+ next iCounter
+
+ printlog( "Close the document" )
+ brc = hDestroyDocument()
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/filedlg_document_properties.inc b/testautomation/framework/optional/includes/filedlg_document_properties.inc
new file mode 100644
index 000000000000..089a1d131338
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_document_properties.inc
@@ -0,0 +1,106 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Access document properties
+'*
+'\******************************************************************************
+
+testcase tFiledlgDocumentProperties()
+
+
+ dim cFileName as string
+ cFileName = "DigitalSignature" & hGetSuffix( "current" )
+
+ dim cFilePath as string
+ cFilePath = gTesttoolPath & "framework\optional\input\security"
+ cFilePath = convertpath( cFilePath )
+
+ dim cFileURL as string : cFileURL = cFilePath & gPathSigne & cFileName
+
+ dim iFileSize as long
+ dim cFileSize as string
+ dim iFileSizeInfo as long
+ dim cSignatureCreator as string
+
+ dim cTestExpression as string
+
+ dim cSelectAll as string
+ dim cCopy as string
+
+ dim brc as boolean
+
+ printlog( "Using filename: " & cFileName )
+ printlog( "Using filepath: " & cFilePath )
+
+ if ( FileExists( cFileURL ) ) then
+ iFileSize = FileLen( cFileURL )
+ printlog( "Testfile size is: " & iFileSize & " Bytes" )
+ else
+ warnlog( "The workfile does not exist. aborting test" )
+ goto endsub
+ endif
+
+ hFileOpen( cFileURL )
+
+ FileProperties
+
+ brc = hDocumentInfoSelectTab( "General" )
+ if ( not brc ) then
+ warnlog( "Unable to switch to the requested tabpage, trying to recover" )
+ kontext "TabDokument"
+ TabDokument.cancel()
+ hDestroyDocument()
+ endif
+
+ cTestExpression = hGetStringFromStaticTextField( FileLocationInfo )
+ if ( cTestExpression = cFilePath ) then
+ printlog( "Path is correct" )
+ else
+ warnlog( "The path string is incorrect: " & cTestExpression )
+ endif
+
+ kontext "TabDokument"
+ cFileSize = hGetStringFromStaticTextField( FileSizeInfo )
+ iFileSizeInfo = hConvertStringToLong( cFileSize )
+ if ( iFileSize <> iFileSizeInfo ) then
+ warnlog( "Filesize does not match, please check" )
+ printlog( "Found...: " & iFileSizeInfo )
+ printlog( "Expected: " & iFileSize )
+ else
+ printlog( "Filesize is correct" )
+ endif
+
+ kontext "TabDokument"
+ TabDokument.cancel()
+
+ hDestroyDocument()
+
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/filedlg_filternames.inc b/testautomation/framework/optional/includes/filedlg_filternames.inc
new file mode 100644
index 000000000000..6c41ef444b61
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_filternames.inc
@@ -0,0 +1,123 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Verify that all filters are listed in the filter listbox
+'*
+'\******************************************************************************
+
+testcase tVerifyFilterNames
+
+ printlog( "Verify filternames listed in the file open dialog" )
+
+ if ( gIsoLang <> "en-US" ) then
+ qaerrorlog( "No testing for non-US languages" )
+ goto endsub
+ endif
+
+ const MAX_FILTERCOUNT = 300
+ dim asFilterNames( MAX_FILTERCOUNT ) as string
+ dim iFilterCount as integer
+ dim iCurrentItem as integer
+
+ dim cFile as string
+ dim iErr as integer
+
+
+ ' For Windows and Solaris Sparc there exists additional commercial filters
+ ' that are available for StarOffice only.
+ cFile = gProductName & "_Filternames_"
+ if ( not gOOo ) then
+ select case gtSysName
+ case "Windows" : cFile = cFile & "add_" & gIsoLang & ".txt"
+ case "Solaris SPARC" : cFile = cFile & "add_" & gIsoLang & ".txt"
+ case "WinXP" : cFile = cFile & "add_" & gIsoLang & ".txt"
+ case "Mac OS X" : cFile = cFile & "add_" & gIsoLang & ".txt"
+ case "Linux" : cFile = cFile & gIsoLang & ".txt"
+ case "Solaris x86" : cFile = cFile & gIsoLang & ".txt"
+ end select
+ else
+ cFile = cFile & gIsoLang & ".txt"
+ endif
+
+ dim cFileIn as string
+ cFileIn = gTesttoolPath & "framework\optional\input\filternames\" & cFile
+ cFileIn = convertpath( cFileIn )
+
+ dim cFileOut as string
+ cFileOut = hGetWorkPath() & cFile
+
+ printlog( "Create a new document" )
+ hCreateDocument()
+
+ printlog( "Open the File Open dialog" )
+ FileOpen
+ Kontext "OeffnenDlg"
+
+ printlog( "Read the filterlist (en_US only), compare against a reference" )
+ if ( OeffnenDlg.exists( 1 ) ) then
+
+ iFilterCount = DateiTyp.getItemCount()
+ if ( iFilterCount > MAX_FILTERCOUNT ) then
+ warnlog( "Too many filters in filterlist for this test to handle" )
+ goto endsub
+ endif
+
+ printlog( "Reading in " & iFilterCount & " filternames" )
+
+ asFilterNames( 0 ) = iFilterCount
+
+ for iCurrentItem = 1 to iFilterCount
+
+ kontext "OeffnenDlg"
+ try
+ asFilterNames( iCurrentItem ) = DateiTyp.getItemText( iCurrentItem )
+ catch
+ printlog( "Problem encountered at pos: " & iCurrentItem )
+ endcatch
+
+ next iCurrentItem
+
+ OeffnenDlg.cancel()
+
+ iErr = hManageComparisionList( cFileIn, cFileOut, asFilterNames() )
+
+ else
+ warnlog( "File Open dialog not present." )
+ endif
+
+ printlog( "Close the document" )
+ hDestroyDocument()
+
+ if ( iErr <> 0 ) then
+ warnlog( "Filterlist differs from reference, please review" )
+ endif
+
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/filedlg_folders1.inc b/testautomation/framework/optional/includes/filedlg_folders1.inc
new file mode 100644
index 000000000000..52d905876df3
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_folders1.inc
@@ -0,0 +1,106 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : check the internal file dialog ( 1. part )
+'*
+'\******************************************************************************
+
+testcase tFolder1
+
+ Dim VerList(50) as String
+ dim FULLPATH as string
+ FULLPATH = gOfficePath + "user\work\"
+
+ printlog " - cleanup the output-dir, kill all directories."
+
+ GetDirList ( ConvertPath ( FULLPATH ), "*" , VerList() )
+ KillDirList ( VerList() )
+
+ FileOpen
+
+ 'This is a hack to prevent trouble when opening 'FileOpen' and the path
+ 'is not accessible.
+ Kontext "Active"
+ if Active.Exists( 1 ) then
+ Warnlog "The preset path is invalid, a messagebox has been shown."
+ Active.OK()
+ endif
+
+ Kontext "OeffnenDlg"
+ Dateiname.SetText( ConvertPath ( FULLPATH ) )
+ Oeffnen.Click()
+
+
+ printlog " - foldername with only one character"
+ CreateValidDirectory( "z" )
+
+
+ printlog " - foldername only with numbers"
+ CreateValidDirectory( "1234" )
+
+
+ printlog " - foldername with 8 characters"
+ CreateValidDirectory( "xaxaxaxa" )
+
+
+ printlog " - foldername with 8.3 characters"
+ CreateValidDirectory( "yxyxyxyx.aaa" )
+
+
+ printlog " - foldername with more than 8.3 characters"
+ CreateValidDirectory( "yxyxyxyxyxyx.aaabbb" )
+
+
+ printlog " - foldername with special charaters ( umlauts )"
+ CreateValidDirectory( "hälölüle" )
+
+
+ printlog " - foldername with one whitespace in the middle"
+ CreateValidDirectory( "aa bb" )
+
+
+ printlog " - foldername with leading spaces"
+ CreateValidDirectoryCrop( " lead" , "lead" )
+
+
+ printlog " - foldername with trailing spaces"
+ CreateValidDirectoryCrop( "trail " , "trail" )
+
+
+ printlog " - foldername with more spaces"
+ CreateValidDirectory( "here is a dir with spaces" )
+
+
+ printlog " - foldername with forbidden signes ( ?+! ) - only on windows they are forbidden"
+ CreateInvalidDirectory( "??++!!" )
+
+ Kontext "OeffnenDlg"
+ OeffnenDlg.Cancel()
+
+endcase
diff --git a/testautomation/framework/optional/includes/filedlg_folders2.inc b/testautomation/framework/optional/includes/filedlg_folders2.inc
new file mode 100644
index 000000000000..4e1a8684ba03
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_folders2.inc
@@ -0,0 +1,72 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : check the internal file dialog ( 1. part )
+'*
+'\******************************************************************************
+
+testcase tFolder2
+
+
+ dim FULLPATH as string
+ FULLPATH = gOfficePath + "user\work\"
+
+ Dim VerList(50) as String
+
+
+ GetDirList ( ConvertPath ( FULLPATH ), "*" , VerList() )
+ KillDirList ( VerList() )
+
+ FileOpen
+
+ Kontext "OeffnenDlg"
+ Dateiname.SetText( ConvertPath ( FULLPATH ))
+ Oeffnen.Click()
+
+ printlog( CHR$(13) + " - Create a folder named 'aaa' twice" )
+ CheckDirectoryName( "aaa" )
+
+ printlog( CHR$(13) + " - Create a folder named '123' twice" )
+ CheckDirectoryName( "123" )
+
+ printlog( CHR$(13) + " - Create a folder named 'yayayaya' twice" )
+ CheckDirectoryName( "yayayaya" )
+
+ printlog( CHR$(13) + " - Create a folder named 'ycycycyc.aaa' twice" )
+ CheckDirectoryName( "ycycycyc.aaa" )
+
+ Kontext "NeuerOrdner"
+ if NeuerOrdner.Exists() then
+ NeuerOrdner.Cancel()
+ endif
+
+ Kontext "OeffnenDlg"
+ OeffnenDlg.Cancel()
+
+endcase
diff --git a/testautomation/framework/optional/includes/filedlg_folders3.inc b/testautomation/framework/optional/includes/filedlg_folders3.inc
new file mode 100644
index 000000000000..9219c3a76be6
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_folders3.inc
@@ -0,0 +1,65 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : check the internal file dialog ( 1. part )
+'*
+'\******************************************************************************
+
+testcase tFolder3
+
+
+ dim FULLPATH as string
+ FULLPATH = gOfficePath + "user\work\"
+
+ dim FOLDERNAME_U as string
+ FOLDERNAME_U = "AAABBB"
+
+ dim FOLDERNAME_M as string
+ FOLDERNAME_M = "AAaabbBB"
+
+
+ FileOpen
+
+ printlog( " - change to working directory" )
+ Kontext "OeffnenDlg"
+ Dateiname.SetText( ConvertPath ( FULLPATH ))
+ Oeffnen.Click()
+
+ printlog( " - foldername with upper case characters only" )
+ call CreateValidDirectory( FOLDERNAME_U )
+
+ printlog( " - foldername with mixed case characters" )
+ call CreateValidDirectory( FOLDERNAME_M )
+
+ kontext "OeffnenDlg"
+ OeffnenDlg.Cancel()
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/filedlg_folders4.inc b/testautomation/framework/optional/includes/filedlg_folders4.inc
new file mode 100644
index 000000000000..0e90c3b70d9d
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_folders4.inc
@@ -0,0 +1,128 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : check the internal file dialog ( 1. part )
+'*
+'\*****************************************************************************
+
+testcase tUpOneLevel1
+
+
+ dim iClick as integer
+
+ ' We always want to start in a fixed directory structure so the first few dirnames are
+ ' known an can be used for verification
+ dim cStartDir as string
+ cStartDir = gTesttoolPath & "framework\optional\input\filetest\level1\level2\level3"
+ cStartDir = convertpath( cStartDir )
+ printlog( "Start-Directory is: " & cStartDir )
+
+
+ ' Find out how deep into the filesystem hierarchy we are so we know when we are at the
+ ' filesystem root. We add one because Windows has one more level where the drive icons
+ ' are shown
+ dim iDirLevels as integer
+ iDirLevels = hGetDirTreeLevel( cStartDir )
+
+ if ( instr( lcase( gtSYSName ) , "win" ) = 1 ) then
+ iDirLevels = iDirLevels + 1
+ printlog( "Current threshold (Windows) is: " & iDirLevels)
+ elseif ( gtSysName = "ecomstation" ) then
+ iDirLevels = iDirLevels + 1
+ printlog( "Current threshold (eComStation) is: " & iDirLevels)
+ else
+ printlog( "Current threshold (Unix/Linux) is: " & iDirLevels)
+ endif
+
+ dim sCurrentDir as string
+ dim sExpectedDir as string
+
+
+ FileOpen
+
+ Kontext "OeffnenDlg"
+ Dateiname.SetText( cStartDir )
+ Oeffnen.Click()
+
+ printlog "Click the Level-Up button until we are in the filesystem root"
+ for iClick = 1 to iDirLevels
+
+ if ( UebergeordneterOrdner.exists() ) then
+
+ if ( UebergeordneterOrdner.isEnabled() ) then
+
+ UebergeordneterOrdner.Click()
+ else
+ warnlog( "Level-Up button is disabled" )
+ endif
+ else
+ warnlog( "Level-Up button does not exist" )
+ endif
+
+ sCurrentDir = hGetFirstNameFromFileList()
+
+ select case iClick
+ case 1 : sExpectedDir = "level3"
+ case 2 : sExpectedDir = "level2"
+ case 3 : sExpectedDir = "level1"
+ case 4 : sExpectedDir = "alldocs"
+ case 5 : sExpectedDir = "includes"
+ case 6 : sExpectedDir = "optional"
+ end select
+
+ if ( iClick < 7 ) then
+ if ( sCurrentDir = sExpectedDir ) then
+ printlog( "Current directory name is: " & sCurrentDir & " [ok]" )
+ else
+ warnlog( "Error finding directory name:" )
+ printlog( "Current directory name is: " & sCurrentDir & " which is NOT ok" )
+ printlog( "Expected directory name..: " & sExpectedDir )
+ endif
+ endif
+ next iClick
+
+ kontext "OeffnenDlg"
+
+ if ( UebergeordneterOrdner.exists() ) then
+
+ if ( not UebergeordneterOrdner.isEnabled() ) then
+ printlog( "Level-Up button is disabled, good" )
+ else
+ warnlog( "The Level-up button should not be enabled for filesystem root" )
+ endif
+ else
+ warnlog( "Level-Up button does not exist" )
+ endif
+
+ OeffnenDlg.Cancel()
+
+endcase
+
+
+
diff --git a/testautomation/framework/optional/includes/filedlg_folders5.inc b/testautomation/framework/optional/includes/filedlg_folders5.inc
new file mode 100644
index 000000000000..03ea63a34a35
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_folders5.inc
@@ -0,0 +1,117 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : check the internal file dialog ( 1. part )
+'*
+'\*****************************************************************************
+
+testcase tUpOneLevel2
+
+
+ dim iParentDir as integer
+
+ ' We always want to start in a fixed directory structure so the first few dirnames are
+ ' known an can be used for verification
+ dim cStartDir as string
+ cStartDir = gTesttoolPath & "framework\optional\input\filetest\level1\level2\level3"
+ cStartDir = convertpath( cStartDir )
+ printlog( "Start-Directory is: " & cStartDir )
+
+
+ ' Find out how deep into the filesystem hierarchy we are so we know when we are at the
+ ' filesystem root. We add one because Windows has one more level where the drive icons
+ ' are shown
+ dim iDirLevels as integer
+ iDirLevels = hGetDirTreeLevel( cStartDir )
+
+ if ( instr( lcase( gtSYSName ) , "win" ) = 1 ) then
+ iDirLevels = iDirLevels + 1
+ printlog( "Current threshold (Windows) is: " & iDirLevels)
+ elseif ( gtSysName = "ecomstation" ) then
+ iDirLevels = iDirLevels + 1
+ printlog( "Current threshold (eComStation) is: " & iDirLevels)
+ else
+ printlog( "Current threshold (Unix/Linux) is: " & iDirLevels)
+ endif
+
+ dim sCurrentDir as string
+ dim sExpectedDir as string
+
+
+ FileOpen
+
+ Kontext "OeffnenDlg"
+ Dateiname.SetText( cStartDir )
+ Oeffnen.Click()
+
+ printlog "Enter '..' until we are in the filesystem root"
+ for iParentDir = 1 to iDirLevels
+
+ Dateiname.setText( ".." )
+
+ Oeffnen.click()
+
+ sCurrentDir = hGetFirstNameFromFileList()
+
+ select case iParentDir
+ case 1 : sExpectedDir = "level3"
+ case 2 : sExpectedDir = "level2"
+ case 3 : sExpectedDir = "level1"
+ case 4 : sExpectedDir = "alldocs"
+ case 5 : sExpectedDir = "includes"
+ case 6 : sExpectedDir = "optional"
+ end select
+
+ if ( iParentDir < 7 ) then
+ if ( sCurrentDir = sExpectedDir ) then
+ printlog( "Current directory name is: " & sCurrentDir & " [ok]" )
+ else
+ warnlog( "Error finding directory name:" )
+ printlog( "Current directory name is: " & sCurrentDir & " which is NOT ok" )
+ printlog( "Expected directory name..: " & sExpectedDir )
+ endif
+ endif
+ next iParentDir
+
+ kontext "OeffnenDlg"
+
+ if ( UebergeordneterOrdner.exists() ) then
+
+ if ( not UebergeordneterOrdner.isEnabled() ) then
+ printlog( "Level-Up button is disabled, good" )
+ else
+ warnlog( "The Level-up button should not be enabled for filesystem root" )
+ endif
+ else
+ warnlog( "Level-Up button does not exist" )
+ endif
+
+ OeffnenDlg.Cancel()
+
+endcase
diff --git a/testautomation/framework/optional/includes/filedlg_folders6.inc b/testautomation/framework/optional/includes/filedlg_folders6.inc
new file mode 100644
index 000000000000..dae5106793f9
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_folders6.inc
@@ -0,0 +1,166 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : check the internal file dialog
+'*
+'\*****************************************************************************
+
+testcase tUpOneLevel3
+
+
+ ' We always want to start in a fixed directory structure so the first few dirnames are
+ ' known an can be used for verification
+ dim cStartDir as string
+ cStartDir = gTesttoolPath & "framework\optional\input\filetest\level1\level2\level3"
+ cStartDir = convertpath( cStartDir )
+ printlog( "Start-Directory is: " & cStartDir )
+
+ ' Find out how many items the array for pathnames must hold (do not use gTesttoolPath here)
+ dim iDirLevels as integer
+ iDirLevels = hGetDirTreeLevel( cStartDir ) + 2
+
+ ' Get the list of directories within the path
+ dim cPathArray( iDirLevels ) as string
+ iDirLevels = DirNameList( cStartDir , cPathArray() )
+
+ ' Create an array for the two pathseparators - Windows and Unix/Linux
+ dim cPathSeparator( 2 ) as string
+ cPathSeparator( 1 ) = "\"
+ cPathSeparator( 2 ) = "/"
+
+ ' Some increment variables
+ dim iPathSeparator as integer
+ dim iPathRepeat as integer
+
+ ' Variables needed to verify that we are a filesystem root
+ dim iFileOpenItemCount as integer
+ dim cCurrentPath as string
+ dim iObjectPosition as integer
+
+ ' Needed for bug (see below)
+ const REPEAT_COUNT = 4
+
+ FileOpen
+
+ kontext "OeffnenDlg"
+ DateiName.setText( cStartDir )
+ Oeffnen.click()
+
+ for iPathSeparator = 1 to 2
+
+ printlog( "" )
+ printlog( "Trying: " & cPathSeparator( iPathSeparator ) )
+
+ printlog( "Note: This is repeated four times due to ancient bug" )
+ for iPathRepeat = 1 to REPEAT_COUNT
+
+ Dateiname.setText( cPathSeparator( iPathSeparator ) )
+
+ Oeffnen.click()
+
+ select case iPathSeparator
+ case 1: ' backslash
+
+ ' This is Unix, Linux
+ if ( gPlatGroup = "unx" ) then
+
+ kontext "Active"
+ if ( active.exists() ) then
+ active.ok()
+ printlog( "Messagebox for Unix and \ present." )
+ else
+ warnlog( "Error missing for invalid pathspec." )
+ endif
+
+ ' in the ../level3-directory we look for the file filetest.txt
+ kontext "OeffnenDlg"
+ cCurrentPath = hGetFirstNameFromFileList()
+ if ( cCurrentPath <> "filetest.txt" ) then
+ warnlog( "Path should not have changed." )
+ else
+ printlog( "Still in same directory, ok." )
+ endif
+
+ else ' Windows, eComStation
+
+ kontext "OeffnenDlg"
+ cCurrentPath = hGetFirstNameFromFileList()
+ if ( cCurrentPath <> "a:\" ) then
+ if ( iPathRepeat = 1 ) then
+ qaerrorlog( "Did not reach virtual root or no drive a:\ present" )
+ else
+ warnlog( "Did not reach virtual root or no drive a:\ present" )
+ endif
+ else
+ printlog( "Switched to virtual root: a:\ - drive. ok" )
+ endif
+
+ endif
+
+ case 2: ' slash
+
+ ' Unix/Linux
+ if ( gPlatGroup = "unx" ) then
+
+ ' Note: cPathArray( 1 ) = / so we need second element
+ ' Additionally we have a trailing slash that must be killed
+ cCurrentPath = left( cPathArray( 2 ) , len( cPathArray( 2 ) ) - 1 )
+ kontext "OeffnenDlg"
+ iObjectPosition = hFindFileObjectViaFileOpen( cCurrentPath )
+ if ( iObjectPosition <> 0 ) then
+ printlog( "Root for gTesttoolPath could be found. Good" )
+ else
+ warnlog( "Top directory of gTesttoolPath could not be found" )
+ printlog( "This probably means we are not at the root dir" )
+ endif
+
+ else ' Windows, eComStation
+
+ kontext "OeffnenDlg"
+ cCurrentPath = hGetFirstNameFromFileList()
+ if ( cCurrentPath <> "a:\" ) then
+ warnlog( "Did not reach virtual root or no drive a:\ present" )
+ else
+ printlog( "Switched to virtual root: a:\ - drive. ok" )
+ endif
+
+ endif
+
+ end select
+
+ next iPathRepeat
+
+ next iPathSeparator
+
+ kontext "OeffnenDlg"
+ OeffnenDlg.cancel()
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/filedlg_folders7.inc b/testautomation/framework/optional/includes/filedlg_folders7.inc
new file mode 100644
index 000000000000..1a971d1bdada
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_folders7.inc
@@ -0,0 +1,127 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : check the internal file dialog ( 1. part )
+'*
+'\*****************************************************************************
+
+testcase tUpOneLevel4
+
+
+ dim iCurrentItem as Integer ' increment variable
+ dim iCurrentItemCount as Integer ' actual number of entries in dropdown menu
+
+
+ ' The directory that we want to start in so we know how many steps we have
+ ' to the filesystem root (cStartDir is always good for at least 8 steps)
+ dim cStartDir as string
+ cStartDir = gTesttoolPath & "framework\optional\input\filetest\level1\level2\level3"
+ cStartDir = convertpath( cStartDir )
+
+ ' This is the threshold of the directory defined above. Usually we will have
+ ' 9 as the expected number of directories but depending on the mountpoint
+ ' of the testtool workdirectory the number may vary.
+ dim iExpectedItemCount as Integer
+ iExpectedItemCount = hGetDirTreeLevel( cStartDir )
+
+ ' Windows has one more level (Drives)
+ if ( gPlatGroup = "w95" ) then
+ iExpectedItemCount = iExpectedItemCount + 1
+ endif
+
+ printlog( "Test context menu of the Level Up button on the FileOpen dialog" )
+ printlog( "Current threshold: " & iExpectedItemCount )
+
+ FileOpen
+
+ Kontext "OeffnenDlg"
+ Dateiname.SetText( cStartDir )
+ Oeffnen.Click()
+
+ UebergeordneterOrdner.Open()
+
+ iCurrentItemCount = hMenuItemGetCount()
+ Printlog( "Current itemcount: " & iCurrentItemCount )
+
+ if ( iCurrentItemCount < iExpectedItemCount ) then
+ warnlog( "Items missing in the menu." )
+ printlog( "On Windows the node 'My Computer' might be missing" )
+ printlog( "On UNIX filesystem root might be missing" )
+ endif
+
+ if ( iCurrentItemCount = iExpectedItemCount ) then
+ printlog( "The number of entries in the context menu is correct" )
+ endif
+
+ if ( iCurrentItemCount > iExpectedItemCount ) then
+ warnlog( "Found more menu-items than expected: " & iCurrentItemCount)
+ endif
+
+ for iCurrentItem = 1 to iCurrentItemCount - 1
+
+ iExpectedItemCount = iCurrentItemCount - iCurrentItem
+
+ hMenuSelectNr ( 1 )
+
+ kontext "OeffnenDlg"
+ UebergeordneterOrdner.Open()
+
+ if ( hMenuItemGetCount < iExpectedItemCount ) then
+ printlog( "The number of entries is correct" )
+ endif
+
+ if ( hMenuItemGetCount > iExpectedItemCount ) then
+ printlog( "The number of entries is correct" )
+ endif
+
+ next iCurrentItem
+
+ hMenuSelectNr ( 1 )
+
+ if ( iCurrentItemCount = 8 ) then
+
+ kontext "OeffnenDlg"
+ UebergeordneterOrdner.Click()
+
+ endif
+
+ kontext "OeffnenDlg"
+ if ( UebergeordneterOrdner.isEnabled() ) then
+ warnlog( "Level-Up is enabled, it should be disabled at filesystem root" )
+
+ else
+ printlog( "Good, button is disabled" )
+ endif
+
+ kontext "OeffnenDlg"
+ OeffnenDlg.Cancel()
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/filedlg_forbidden_names_windows.inc b/testautomation/framework/optional/includes/filedlg_forbidden_names_windows.inc
new file mode 100644
index 000000000000..96cff87d3d04
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_forbidden_names_windows.inc
@@ -0,0 +1,85 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : check the internal file dialog ( extended tests )
+'*
+'\******************************************************************************
+
+testcase tSLDForbiddenNamesWin()
+
+ if ( lcase( gPlatGroup ) <> "w95" ) then
+ printlog( "No testing for Unix(like)" )
+ goto endsub
+ endif
+
+
+ ' This test tries to save files that contain characters that are not allowed
+ ' in filenames on Windows. This covers the entire ASCII range from 0 to 31.
+ ' Currently the ASCII chars 0, 9, 10, and 13 are excluded because we - for some
+ ' reason - do not intercept them.
+
+
+ dim cStrangeName as string
+ dim iCounter as integer
+ dim brc as boolean
+ dim iDocumentType as integer
+
+
+ for iDocumentType = 1 to 6 step 3
+
+ printlog( "" )
+ printlog( "Check if reserved filenames on Windows are handled ok" )
+ printlog( "" )
+
+ printlog( " - names with forbidden ASCII-chars" )
+ for iCounter = 1 to 31
+
+ select case iCounter
+
+ case 9 : printlog( " - skipping ASCII 009 (horizontal tab)" )
+ case 10 : printlog( " - skipping ASCII 010 (linefeed)" )
+ case 13 : printlog( " - skipping ASCII 013 (carriage return)" )
+ case else
+ printlog( CHR$(13) & "Using char at decimal position: " & iCounter )
+ cStrangeName = hNameGen_append( iCounter )
+ brc = hSaveFileExpectFailure( cStrangeName , 0 )
+ if ( not brc ) then
+ warnlog( "failed" )
+ else
+ printlog( "Test succeeded" )
+ endif
+
+ end select
+
+ next iCounter
+
+ next iDocumentType
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/filedlg_multiselection.inc b/testautomation/framework/optional/includes/filedlg_multiselection.inc
new file mode 100644
index 000000000000..ed6fc3670db8
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_multiselection.inc
@@ -0,0 +1,197 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Select a huge number of documents and load
+'*
+'\******************************************************************************
+
+testcase tFiledlgMultiselection1()
+
+ printlog( "Stress test: Load a great number of documents simultaneously" )
+
+ GLOBAL_USE_NEW_SLEEP = true
+
+ ' This is a test requested by framework development to be used in multi-
+ ' user environments like Terminal Servers. It is used to quickly create
+ ' a certain load. Furthermore issues (mostly unconfirmed) have been reported
+ ' that loading files using multiselection might lead to a crash.
+
+ dim cWorkPath as string : cWorkPath = hGetWorkPath() & "multiselection"
+ dim cMsg as string
+
+ dim iCurrentFile as integer
+ dim iOpenDocuments as integer
+ dim lTime as long
+ dim lWait as long
+ dim lTimeSum as long
+ dim iCurrentTime as long
+
+
+ dim iDocType as integer
+ dim iDocument as integer
+ dim cFilter( 4 ) as string
+ cFilter( 1 ) = "writer8"
+ cFilter( 2 ) = "calc8"
+ cFilter( 3 ) = "impress8"
+ cFilter( 4 ) = "draw8"
+
+ dim cFile as string
+
+ dim brc as boolean
+
+ const TESTFILE_COUNT = 60 ' the number of documents in cWorkPath
+ const TESTFILE_TIMEOUT = 480000
+
+ ' Minimum cleanup
+ while( getDocumentCount > 0 )
+ hCloseDocument()
+ wend
+
+ ' create the workdirectory
+ mkdir( cWorkPath )
+
+ ' dynamically create a bulk of files to be written to the work directory
+ lTimeSum = 0
+
+ for iDocType = 1 to 4
+ hNumericDocType( iDocType )
+ hNewDocument()
+ hChangeDoc()
+ lWait = 0
+ for iDocument = 1 to 15
+ cFile = cWorkPath & "\" & "test_" & cFilter( iDocType ) & iDocument
+ lTime = getSystemTicks
+ hFileSaveAsWithFilterKill( cFile, cFilter( iDocType ) )
+ lWait = lWait + getSystemTicks - lTime
+ next iDocument
+ hCloseDocument()
+ printlog( "Total time for saving 15 documents: " & lWait & " ms" )
+ lTimeSum = lTimeSum + lWait
+ next iDocType
+
+ if ( getDocumentCount > 0 ) then
+ warnlog( "Not all files were saved and closed" )
+ goto endsub
+ endif
+
+ printlog( "Time for saving 60 documents: " & lTimeSum & " ms" )
+ printlog( "Average time per document...: " & lTimeSum / TESTFILE_COUNT & " ms" )
+
+ printlog( "FileOpen" )
+ FileOpen
+
+ printlog( "Go to the workdirectory: " & cWorkPath )
+ kontext "OeffnenDlg"
+ if ( OeffnenDlg.exists( 1 ) ) then
+
+ DateiName.typeKeys( cWorkPath )
+ Oeffnen.click()
+
+ kontext "Active"
+ if ( active.exists( 2 ) ) then
+ cMsg = active.getText()
+ cMsg = hRemoveLineBreaks( cMsg )
+ warnlog( "Unexpected messagebox: " & cMsg )
+ active.ok()
+ kontext "OeffnenDlg"
+ if ( OeffnenDlg.exists() ) then
+ OeffnenDlg.cancel()
+ else
+ warnlog( "File Open dialog is not visible" )
+ endif
+ goto endsub
+ endif
+
+ printlog( "Select all documents and load them simultaneously" )
+ kontext "OeffnenDlg"
+ if ( OeffnenDlg.exists() ) then
+
+ DateiAuswahl.typeKeys( "<HOME>" )
+ DateiAuswahl.typeKeys( "<SHIFT END>" )
+ Oeffnen.Click()
+
+ lTime = GetSystemTicks
+ iOpenDocuments = 0
+ while ( iOpenDocuments < TESTFILE_COUNT )
+ iOpenDocuments = getDocumentCount()
+ iCurrentTime = getSystemTicks - lTime
+
+ ' exit the hard way
+ if ( iCurrentTime > TESTFILE_TIMEOUT ) then
+ warnlog( "Loading files max wait time exceed (" & _
+ TESTFILE_TIMEOUT/1000 & "), aborting" )
+ goto endsub
+ endif
+ wend
+
+ if ( iCurrentTime > 120000 ) then
+ 'Closed issue: qaerrorlog( "#i105289# Slow loading of files, should be less than 120 seconds on all platforms" )
+ printlog( "Slow file loading (exceeds 120 seconds)" )
+ endif
+ lWait = getSystemTicks - lTime ' time diff
+
+ printlog( "All documents loaded in " & lWait & " ms" )
+ sleep()
+
+ printlog( "Starting to close all documents" )
+ for iCurrentFile = 1 to TESTFILE_COUNT
+ FileClose
+ sleep()
+ next iCurrentFile
+ printlog( "Finished closing documents" )
+
+ if ( getDocumentCount > 0 ) then
+ warnlog( "Not all documents were closed." )
+ iOpenDocuments = getDocumentCount
+ for iCurrentFile = 1 to iOpenDocuments - 1
+ hCloseDocument()
+ next iCurrentFile
+ else
+ printlog( "All documents have been closed. Test succeeded." )
+ endif
+
+ printlog( "Deleting work files..." )
+ for iDocType = 1 to 4
+ hNumericDocType( iDocType )
+ for iDocument = 1 to 15
+ cFile = cWorkPath & "\" & "test_" & cFilter( iDocType ) & iDocument
+ hDeleteFile( cFile )
+ next iDocument
+ next iDocType
+
+ printlog( "Removing temporary work directory" )
+ rmdir( cWorkPath )
+ else
+ warnlog( "File Open dialog is not visible" )
+ endif
+ else
+ warnlog( "File Open dialog did not open." )
+ endif
+
+endcase
diff --git a/testautomation/framework/optional/includes/filedlg_passwords.inc b/testautomation/framework/optional/includes/filedlg_passwords.inc
new file mode 100644
index 000000000000..c8dd68effe83
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_passwords.inc
@@ -0,0 +1,181 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : save and load passworded files
+'*
+'\******************************************************************************
+
+testcase tFiledlgPasswords()
+
+ dim workfile as string
+ dim workpath as string
+ workpath = hGetWorkPath()
+
+ dim filetype as string
+ dim filetypeID as string
+ dim cMsg as string
+
+ dim iCurrentDocumentType as integer
+ dim iCurrentFileFormat as integer
+
+
+ for iCurrentDocumentType = 1 to 6
+
+ printlog( "Document Type: " & hNumericDocType( iCurrentDocumentType ) )
+
+ for iCurrentFileFormat = 1 to 2
+
+ select case iCurrentFileFormat
+ case 1 : filetypeID = "645"
+ case 2 : filetypeID = "current"
+ end select
+
+ hCreateDocument()
+
+ hCloseNavigator()
+
+ call hChangeDoc()
+
+ printlog( "Open file-save dialog" )
+ if ( gApplication = "IMPRESS" ) then
+ printlog( " IMPRESS is slower than other apps, delaying for 2 sec." )
+ sleep( 2 )
+ endif
+
+ FileSave
+
+ Kontext "SpeichernDlg"
+ if ( SpeichernDlg.exists( 2 ) ) then
+
+ filetype = hGetFilter( filetypeID )
+ hSelectUIFilter( filetype )
+
+ workfile = "password" & hGetSuffix( filetypeID )
+ DateiName.setText( workpath & workfile )
+
+ printlog( "Using fileformat: " & filetype )
+ printlog( "Using filename..: " & workfile )
+
+ printlog( "Check password" )
+ if ( passwort.isEnabled() ) then
+ Passwort.check()
+ else
+ warnlog( "#i36663# Password checkbox is disabled" )
+ endif
+
+ printlog( "Save the file" )
+ Speichern.click()
+
+ kontext "active"
+ if ( active.exists( 2 ) ) then
+ printlog( "Handle overwrite warning (if any)" )
+ active.yes()
+ endif
+
+
+ Kontext "PasswordFileSave"
+ printlog( "Enter the name of the file as password and confirm" )
+ if ( passwordFileSave.exists() ) then
+ Password.settext( workfile )
+ PasswordConfirm.settext( workfile )
+ PasswordFileSave.ok()
+ else
+ warnlog( "No password dialog is displayed" )
+ endif
+
+ kontext "AlienWarning"
+ if ( AlienWarning.exists( 2 ) ) then
+ if ( FileTypeID <> "current" ) then
+ printlog( "Handle alienwarning (expected)" )
+ AlienWarning.ok()
+ else
+ warnlog( "Handle alienwarning (unexpected)" )
+ AlienWarning.ok()
+ endif
+ endif
+
+ hDestroyDocument()
+
+ printlog( "Open the file via file-open" )
+ FileOpen
+
+ Kontext "OeffnenDlg"
+ if ( OeffnenDlg.exists( 2 ) ) then
+ Dateiname.settext( workfile )
+
+ Oeffnen.click()
+
+ Kontext "PasswordFileOpen"
+ printlog( "Enter the filename as password" )
+ if ( PasswordFileOpen.exists( 4 ) ) then
+ PasswortName.settext( workfile )
+ PasswordFileOpen.ok()
+ else
+ kontext "Active"
+ if ( Active.exists( 2 ) ) then
+ cMsg = active.getText()
+ cMsg = hRemoveLineBreaks( cMsg )
+ printlog( cMsg )
+ warnlog( "#i65889# - CWS Warnings01: Cannot read password protected files" )
+ active.ok()
+ goto endsub
+ else
+ warnlog( "No password dialog is displayed" )
+ endif
+ endif
+
+ printlog( "Verify that the document is loaded" )
+ hFileWait( FALSE )
+
+ Kontext "Navigator"
+ if ( Navigator.exists( 1 ) ) then
+ qaerrorlog( "Navigator should not be visible - setting not saved?" )
+ endif
+ else
+ warnlog( "Second file open failed" )
+ endif
+ else
+ warnlog( "File Open dislog did not come up" )
+ endif
+
+ hCloseNavigator()
+
+ hDestroyDocument()
+
+ hDeleteFile( workpath & workfile )
+
+ hCloseNavigator()
+
+ next iCurrentFileFormat
+
+ next iCurrentDocumentType
+
+
+
+endcase
diff --git a/testautomation/framework/optional/includes/filedlg_rename.inc b/testautomation/framework/optional/includes/filedlg_rename.inc
new file mode 100644
index 000000000000..513a652b8f36
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_rename.inc
@@ -0,0 +1,97 @@
+'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 : Joerg.Skottke@Sun.Com
+'*
+'* short description : Remane files dialog
+'*
+'\******************************************************************************
+
+testcase tFileRename
+
+ dim cPath as string
+ cPath = convertpath( gOfficePath & "user/work/" )
+
+ dim cFile as string
+ cFile = "tFileRename.odt"
+
+ dim iCurrentFile as integer
+ dim cCurrentFile as string
+ dim iFileCount as integer
+ dim bFileFound as boolean : bFileFound = false
+
+ ' Issue #i88446
+ Printlog( "Rename file dialog" )
+
+ gApplication = "WRITER"
+ hNewDocument()
+ DocumentWriter.typeKeys( "framework/optional/filedlg_dialogtest.bas::tFileRename" )
+
+ hFileSaveAsKill( cPath & cFile )
+ FileClose
+ FileOpen
+ kontext "OeffnenDlg"
+ if ( OeffnenDlg.exists( 2 ) ) then
+
+ DateiName.setText( cPath )
+ Oeffnen.click()
+ iFileCount = DateiAuswahl.getItemCount()
+ printlog( iFileCount & " files listed" )
+ DateiAuswahl.typeKeys( "<HOME>" )
+
+ for iCurrentFile = 1 to iFileCount
+
+ wait( 100 )
+ DateiAuswahl.typeKeys( "<SPACE>" )
+ wait( 100 )
+
+ cCurrentFile = DateiAuswahl.getSelText()
+ printlog( " * " & cCurrentFile )
+
+ if ( cCurrentFile = cFile ) then
+ printlog( "File found" )
+ DateiAuswahl.openContextMenu()
+ hMenuSelectNr( 2 )
+ DateiAuswahl.typeKeys( "<ESCAPE>" )
+ kontext "OeffnenDlg"
+ OeffnenDlg.cancel()
+ exit for
+ endif
+
+ wait( 100 )
+ DateiAuswahl.typeKeys( "<DOWN>" )
+ wait( 100 )
+
+ next iCurrentFile
+ endif
+
+ if ( FileExists( cPath & cFile ) ) then kill( cPath & cFile )
+
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc b/testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc
new file mode 100644
index 000000000000..885dc6a92f2d
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_reserved_names_unix.inc
@@ -0,0 +1,76 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : check the internal file dialog ( extended tests )
+'*
+'\******************************************************************************
+
+testcase tSaveReservedNamesUNIX()
+
+ printlog( "Names that are reserved on WINDOWS but are OK on UNIX" )
+
+ if ( gPlatGroup = "w95" ) then
+ printlog( "Test not relevant for Windows/DOS family of OSes" )
+ goto endsub
+ endif
+
+ dim cStrangeName as string
+ dim irc as integer
+ dim iCurrentDocType as integer
+
+ for iCurrentDocType = 1 to 2
+
+ printlog( "" )
+ printlog( "Document Type is: " & hNumericDocType( iCurrentDocType ) )
+
+ irc = hSaveLoadDelSuccess( "NUL" , true )
+ if ( irc <> 0 ) then warnlog( "failed" )
+
+ irc = hSaveLoadDelSuccess( "CLOCK$" , true )
+ if ( irc <> 0 ) then warnlog( "failed" )
+
+ irc = hSaveLoadDelSuccess( "CON" , true )
+ if ( irc <> 0 ) then warnlog( "failed" )
+
+ irc = hSaveLoadDelSuccess( "PRN" , true )
+ if ( irc <> 0 ) then warnlog( "failed" )
+
+ irc = hSaveLoadDelSuccess( "AUX" , true )
+ if ( irc <> 0 ) then warnlog( "failed" )
+
+ irc = hSaveLoadDelSuccess( "LPT1" , true )
+ if ( irc <> 0 ) then warnlog( "failed" )
+
+ irc = hSaveLoadDelSuccess( "COM1" , true )
+ if ( irc <> 0 ) then warnlog( "failed" )
+
+ next iCurrentDocType
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/filedlg_reserved_names_windows.inc b/testautomation/framework/optional/includes/filedlg_reserved_names_windows.inc
new file mode 100644
index 000000000000..4fba22fb9c8f
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_reserved_names_windows.inc
@@ -0,0 +1,133 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : check the internal file dialog ( extended tests )
+'*
+'\******************************************************************************
+
+testcase tSaveReservedNamesWin()
+
+ if ( gPlatGroup <> "w95" ) then
+ printlog( "Test not relevant for Windows" )
+ goto endsub
+ endif
+
+
+ ' This sub creates invalid filenames on Windows and tries to save files
+ ' with those names. This should fail.
+ ' The names are created dependent on the gApplication (documenttype)
+ ' which must have been specified in advance. To generate the names the
+ ' function hNameGenASCII_append( int, boolean ) is used which generates
+ ' the file-suffix based on the current 'gApplication'
+ ' Since saving is expected to fail in every case, there is no reload-test
+ ' for these filenames
+
+ dim cStrangeName as string
+ dim iCounter as integer
+ dim brc as boolean
+
+ const MAX_NUMBER = 1
+
+ dim iCurrentDocType as integer
+
+ for iCurrentDocType = 1 to 2
+
+ printlog( "" )
+ printlog( "Document Type is: " & hNumericDocType( iCurrentDocType ) )
+
+
+ printlog( CHR$(13) )
+ printlog( "Check if reserved filenames on Windows are handled ok" )
+ printlog( CHR$(13) )
+
+
+ ' serial ports with extension (COM1.xxx-COM9.xxx are not allowed)
+ printlog( CHR$(13) + "Serial ports with extensions" )
+ for iCounter = 1 to MAX_NUMBER
+ cStrangeName = "COM" & CHR$( iCounter + 48 )
+ cStrangeName = cStrangeName & hGetSuffix( "current" )
+ brc = hSaveFileExpectFailure( cStrangeName , 0 )
+ if ( not brc ) then warnlog( "failed" )
+ next iCounter
+
+
+ ' parallel ports with extension (LPT1.xxx-LPT9.xxx are not allowed)
+ printlog( CHR$(13) + "Parallel ports with extension" )
+ for iCounter = 1 to MAX_NUMBER
+ cStrangeName = "LPT" & CHR$( iCounter + 48 )
+ cStrangeName = cStrangeName & hGetSuffix( "current" )
+ brc = hSaveFileExpectFailure( cStrangeName , 0 )
+ if ( not brc ) then warnlog( "failed" )
+ next iCounter
+
+
+ printlog( "" )
+ printlog( "Reserved characters" )
+
+ ' descr: hNameGenASCII_append takes an ASCII-char as int and a boolean
+ ' value for "append file suffix" if true
+ ' descr: SaveFileExpectFailure takes a filename and a numeric value for
+ ' the type of errorhandling (0 = invalid char, 1 = path separator)
+
+ cStrangeName = hNameGen_append( 60 ) ' char "<"
+ brc = hSaveFileExpectFailure( cStrangeName , 0 )
+ if ( not brc ) then warnlog( "failed" )
+
+ cStrangeName = hNameGen_append( 62 ) ' char ">"
+ brc = hSaveFileExpectFailure( cStrangeName , 0 )
+ if ( not brc ) then warnlog( "failed" )
+
+ cStrangeName = hNameGen_append( 34 ) ' char '"'
+ brc = hSaveFileExpectFailure( cStrangeName , 0 )
+ if ( not brc ) then warnlog( "failed" )
+
+ cStrangeName = hNameGen_append( 124 ) ' char "|"
+ brc = hSaveFileExpectFailure( cStrangeName , 0 )
+ if ( not brc ) then warnlog( "failed" )
+
+ 'misinterpreted characters (seen as UNC name or device by Windows)
+ cStrangeName = hNameGen_append( 92 ) ' char "\"
+ brc = hSaveFileExpectFailure( cStrangeName , 1 )
+ if ( not brc ) then warnlog( "failed" )
+
+ cStrangeName = hNameGen_append( 47 ) ' char "/"
+ brc = hSaveFileExpectFailure( cStrangeName , 1 )
+ if ( not brc ) then warnlog( "failed" )
+
+ cStrangeName = hNameGen_append( 58 ) ' char ":"
+ brc = hSaveFileExpectFailure( cStrangeName , 0 )
+ if ( not brc ) then warnlog( "failed" )
+
+ printlog( "Close the document" )
+ brc = hDestroyDocument()
+
+ next iCurrentDocType
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/filedlg_tools.inc b/testautomation/framework/optional/includes/filedlg_tools.inc
new file mode 100644
index 000000000000..b4781813c89e
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_tools.inc
@@ -0,0 +1,478 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : check the internal file dialog ( 1. part )
+'*
+'\***************************************************************************
+
+sub CheckDirectoryName( dirname as string )
+
+ ' Try to create a folder twice and make sure a warning comes up that the
+ ' folder already exists
+
+ dim i as integer
+ dim FULLPATH as string
+ FULLPATH = gOfficePath + "user\work\" + dirname + "\"
+
+ printlog( " - Create the folder and verify it's existence" )
+
+ try
+
+ for i=1 to 2
+
+ printlog( " - creating folder for the " + i + ". time" )
+
+ Kontext "OeffnenDlg"
+ printlog( " - press 'new folder' button" )
+ NeuerOrdner.Click()
+
+ Kontext "NeuerOrdner"
+ if ( NeuerOrdner.exists( 2 ) ) then
+ printlog( " - name the folder" )
+ OrdnerName.SetText( dirname )
+ printlog( " - press OK")
+ NeuerOrdner.OK()
+ else
+ warnlog( "New Folder dialog not displayed" )
+ endif
+
+ ' Take care of the File Exists Dialog
+ printlog( " - check for 'File Exists'-Dialog" )
+ Kontext "Active"
+ If Active.Exists() then
+ Active.OK()
+
+ 'if the file exists during first run of the test: just go on
+ if i = 1 then
+ warnlog( "File exists. Did you clean the output-dir?" )
+ end if
+
+ 'if the active exists, we will return to the 'new folder' dialog
+ 'it must be closed as well
+ Kontext "NeuerOrdner"
+ NeuerOrdner.Cancel()
+ else
+ 'this should only be displayed on second run
+ if i = 2 then
+ warnlog( "No message that the folder '" + dirname + "' exists!" )
+ end if
+ end if
+
+ next i
+
+ printlog( " - verify the existence of the new directory" )
+ if App.Dir ( ConvertPath ( FULLPATH ), 16 ) = "" then
+ Warnlog( "The directory'" + dirname + "' wasn't created!" )
+ else
+ printlog( " - delete it")
+ App.RmDir ( ConvertPath ( FULLPATH ) )
+ end if
+
+
+ catch
+
+ warnlog( "Could not create the directory. Bugid: #108256# or #106510# ?" )
+
+ endcatch
+
+end sub
+
+'*******************************************************************************
+
+sub CreateInvalidDirectory( dirname as string )
+
+ 'Try to create a directory with a name that is invalid by using characters
+ 'that are not allowed for a filesystems. An errormessage is expected.
+
+ dim i as integer
+ dim FULLPATH as string
+ FULLPATH = gOfficePath + "user\work\" + dirname + "\" 'experimental
+
+ printlog( " - Trying to create directory <" + FULLPATH + ">" )
+
+ try
+
+ Kontext "OeffnenDlg"
+ if ( OeffnenDlg.exists( 2 ) ) then
+
+ NeuerOrdner.Click()
+
+ Kontext "NeuerOrdner"
+ if ( NeuerOrdner.exists( 2 ) ) then
+
+ OrdnerName.SetText( dirname )
+ NeuerOrdner.OK()
+ else
+ warnlog( "New Folder dialog did not open" )
+ endif
+
+
+ if gPlatgroup() = "unx" then
+
+ 'unx allows weird filenames
+ if App.Dir ( ConvertPath ( FULLPATH ), 16 ) = "" then
+ Warnlog " the '" + dirname + "'-dir wasn't created!"
+ else
+ App.RmDir ( ConvertPath ( FULLPATH ) )
+ end if
+
+ else
+
+ 'windows
+ Kontext "Active"
+ if Active.Exists( 2 ) then
+
+ printlog( " - handle the 'Active' dialog" )
+ Active.OK()
+
+ Kontext "Active"
+ if Active.Exists( 2 ) then
+ warnlog( "Double errormessage displayed, one expected." )
+ Active.OK()
+ end if
+
+ Kontext "NeuerOrdner"
+ NeuerOrdner.Cancel()
+
+ else
+
+ warnlog( "No warning that the folder can't be created!" )
+
+ end if
+
+ if App.Dir( ConvertPath ( FULLPATH ), 16 ) <> "" then
+ Warnlog "The directory '"+ dirname + "' contains invalid chars"
+ App.RmDir( ConvertPath ( FULLPATH ) )
+ end if
+
+ end if
+
+ endif
+
+ catch
+
+ warnlog( "Could not create the directory. Bugid: #108256# or #106510# ?" )
+
+ endcatch
+
+end sub
+
+'*******************************************************************************
+
+sub CreateValidDirectory( dirname as string )
+
+ 'Create a directory that has a valid name at a valid location
+ 'The directory should not exist.
+ 'It will be created in the user's directory
+
+ dim FULLPATH as string
+ FULLPATH = gOfficePath() + "user\work\" + dirname + "\" 'experimental
+
+
+ printlog( " - Trying to create directory: <" + FULLPATH + ">" )
+
+ try
+
+ printlog( " - Open the file-open dialog" )
+ Kontext "OeffnenDlg"
+ NeuerOrdner.Click()
+
+ printlog( " - name the folder" )
+ Kontext "NeuerOrdner"
+ OrdnerName.SetText( dirname )
+ NeuerOrdner.OK()
+
+ printlog( " - check if the directory has been created" )
+ if App.Dir ( ConvertPath ( FULLPATH ) , 16 ) = "" then
+ warnlog( "The '" + dirname + "' has not been created!" )
+ else
+ App.RmDir( ConvertPath ( FULLPATH ) )
+ printlog( " - existing file was successfully deleted" )
+ end if
+
+ catch
+
+ warnlog( "Could not create the directory. Bugid: #108256# or #106510# ?" )
+
+ endcatch
+
+end sub
+
+'*******************************************************************************
+
+sub CreateValidDirectoryCrop( dirname as string , cropname as string)
+
+ 'Create a directory that has a name with leading or trailing spaces.
+ 'Those names are valid but must be cropped.
+ 'The directory should not exist.
+ 'It will be created in the user's directory.
+
+ dim FULLPATH as string
+ FULLPATH = gOfficePath + "user\work\" + dirname + "\" 'experimental
+ dim CROPPATH as string
+ CROPPATH = gOfficePath + "user\work\" + cropname + "\" 'experimental
+
+ printlog( " - Trying to create directory: <" + FULLPATH + ">" )
+
+ try
+
+ printlog( " - open the file-open dialog" )
+ Kontext "OeffnenDlg"
+ NeuerOrdner.Click()
+
+ printlog( " - name the folder" )
+ Kontext "NeuerOrdner"
+ OrdnerName.SetText( dirname )
+ NeuerOrdner.OK()
+
+
+ printlog( " - check if the directory has been created" )
+ if App.Dir( ConvertPath ( CROPPATH ), 16 ) = "" then
+
+ warnlog( "The leading or trailing spaces have not been deleted!" )
+
+ else
+
+
+ App.RmDir( ConvertPath ( CROPPATH ) )
+ printlog( " - existing directory was successfully deleted." )
+
+ end if
+
+ catch
+
+ warnlog( "Could not create the directory. Bugid: #108256# or #106510# ?" )
+
+ endcatch
+
+end sub
+
+'*******************************************************************************
+
+function LoadDocumentReadOnly ( sDatei as String, TypeOfDocument as Integer, ReadOnlyFlag as Boolean ) as Boolean
+
+ LoadDocumentReadOnly = TRUE
+
+ FileOpen
+
+ Kontext "OeffnenDlg"
+ Dateiname.SetText sDatei
+
+ if ReadOnlyFlag = TRUE then
+ NurLesen.Check()
+ endif
+
+ Oeffnen.Click
+ hFileWait( FALSE )
+
+ Kontext "Active"
+ if Active.Exists( 2 ) then
+ LoadDocumentReadOnly = FALSE
+ Warnlog Active.GetText
+ Active.OK
+
+ if Active.Exists( 1 ) then
+ Warnlog "A second messagebox is active!"
+ Active.OK
+ end if
+
+ Kontext "Filterauswahl"
+ If FilterAuswahl.Exists( 2 ) then
+ Warnlog "Filterbox is also active!"
+ FilterAuswahl.Cancel
+ end if
+ end if
+
+ 'printlog( " - check for (unexpected) filter-dialog" )
+ Kontext "Filterauswahl"
+
+ If ( FilterAuswahl.Exists( 2 ) ) then
+ Warnlog( "Filterbox is active, this is not expected" )
+ FilterAuswahl.Cancel()
+
+ qaerrorlog( "TODO: There is no way that this function can handle " & _
+ "the filterdialog correctly, rewrite it!" )
+ warnlog( "The test will most likely fail!" )
+
+ LoadDocumentReadOnly() = false
+ exit function
+
+ endif
+
+
+
+ kontext "OeffnenDlg"
+
+ if ( OeffnenDlg.exists( 2 ) ) then
+ warnlog( "File-Open dialog is open, this is not expected at this point" )
+ printlog( "Exiting routine to recover" )
+
+ OeffnenDlg.cancel()
+
+ LoadDocumentReadOnly() = false
+ exit function
+
+ endif
+
+ try
+
+ select case TypeOfDocument
+
+ case 1 : InsertSection ' Writer
+ Kontext
+ Active.Setpage TabBereiche
+ Kontext "TabBereiche"
+ TabBereiche.Cancel
+ case 2 : FormatCells ' Calc
+ Kontext
+ Active.SetPage TabZahlen
+ Kontext "TabZahlen"
+ TabZahlen.Cancel
+ case 3 : SlideShowPresentationSettings ' Impress
+ Kontext "Bildschirmpraesentation"
+ Bildschirmpraesentation.Cancel
+ case 4 : InsertLayer ' Draw
+ Kontext "EbeneEinfuegenDlg"
+ EbeneEinfuegenDlg.Cancel
+ case 5 : FormatLegend ' Chart
+ Kontext "TabUmrandungChart" :
+ TabUmrandungChart.Cancel
+ case 6 : FormatFonts ' Math
+ Kontext "Schriftarten"
+ Schriftarten.Cancel
+ end select
+
+ if LoadDocumentReadOnly = TRUE then
+ Warnlog "The document wasn't loaded read only"
+ endif
+
+ catch
+
+ endcatch
+
+end function
+
+'*******************************************************************************
+
+sub hSetUNIXAttributes()
+
+ ' NOTE: Requested by TBO
+ ' This sub tries to set the file-attributes on the qatesttool-snapshot on
+ ' mahler.germany.
+ ' Since all BASIC commands are platform independent, it cannot be checked
+ ' exactly.
+ ' If you are not the owner of the testtool snapshot, this is *not* going to
+ ' work.
+
+
+ dim cFullPath as string
+ dim cParameter as string
+ dim cCommand as string
+ dim rc as integer
+
+ if ( gPLatGroup = "unx" ) then
+
+ cCommand = "chmod" ' Fallback, if no following definition matches
+ if ( gPlatform = "sol" ) then
+ cCommand = "/usr/bin/chmod"
+ endif
+ if ( gPlatform = "x86" ) then
+ cCommand = "/usr/bin/chmod"
+ endif
+ if ( gPlatform = "lin" ) then
+ cCommand = "/bin/chmod"
+ endif
+
+ cFullPath = convertpath( gTesttoolPath + "framework/filedlg/input/noentry" )
+ printlog( "Trying to set attributes for " + cFullPath )
+ cParameter = "-R 000 " + cFullPath
+ rc = shell( cCommand , 0 , cParameter , false )
+
+ ' the readentry-directory must be readonly, the files as well
+ cFullPath = convertpath( gTesttoolPath + "framework/filedlg/input/readentry" )
+ printlog( "Trying to set attributes for " + cFullPath )
+ cParameter = "-R 444 " + cFullPath
+ rc = shell( cCommand , 0 , cParameter , false )
+ 'need to remove the "S" attribute
+ cParameter = "-R -s " + cFullPath
+ rc = shell( cCommand , 0 , cParameter , false )
+
+ ' the readonly-directory: Only the directory is read-only, the files are rw
+ cFullPath = convertpath( gTesttoolPath + "framework/filedlg/input/readonly/*.*" )
+ printlog( "Trying to set attributes for " + cFullPath )
+ cParameter = "444 " + cFullPath
+ rc = shell( cCommand , 0 , cParameter , false )
+
+ else
+
+ printlog( "No file-attribute setting for non-UNIX platforms" )
+
+ endif
+
+end sub
+
+
+'*******************************************************************************
+
+function hGetFirstNameFromFileList() as string
+
+
+
+
+
+
+ const CFN = "hGetFirstNameFromFileList()::"
+ dim brc as boolean 'a multi purpose boolean returnvalue
+ dim cFileName as string
+
+
+ Kontext "OeffnenDlg"
+ Dateiauswahl.typeKeys( "<HOME>" )
+ Dateiauswahl.typeKeys( "<SPACE>" )
+
+ cFileName =lcase( Dateiauswahl.GetSelText() )
+ printlog( CFN & "File: " & cFileName )
+
+ if ( cFileName = "" ) then
+ warnlog( CFN & "Filename is empty, probably a timing issue" )
+ endif
+
+ if ( cFileName = "cvs" ) then
+ printlog( CFN & "Skipping CVS directory" )
+ Dateiauswahl.TypeKeys( "<Down>" )
+
+ cFileName = lcase ( Dateiauswahl.GetSelText() )
+ printlog( CFN & "File: " & cFileName )
+ endif
+
+ hGetFirstNameFromFileList() = cFileName
+
+
+end function
+
diff --git a/testautomation/framework/optional/includes/filedlg_triggers.inc b/testautomation/framework/optional/includes/filedlg_triggers.inc
new file mode 100644
index 000000000000..47913a327091
--- /dev/null
+++ b/testautomation/framework/optional/includes/filedlg_triggers.inc
@@ -0,0 +1,274 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Alternative ways to open file-dialogs / slot availablilty
+'*
+'\******************************************************************************
+
+testcase tDialogTriggers
+
+
+
+ dim cAcceleratorFileOpen as string
+ dim cAcceleratorFileSave as string
+ dim cAcceleratorFileSaveAs as string
+
+ do while ( getDocumentCount > 0 )
+ call hCloseDocument()
+ loop
+
+ cAcceleratorFileOpen = hGetAccel( "FileOpen" )
+ cAcceleratorFileSave = hGetAccel( "FileSave" )
+ cAcceleratorFileSaveAs = hGetAccel( "FileSaveAs" )
+
+
+ printlog( "Test case 1: FileOpen should be possible from backing window (accelerator)" )
+
+ kontext "DocumentBackground"
+ if ( DocumentBackground.exists( 1 ) ) then
+
+ DocumentBackground.typeKeys( cAcceleratorFileOpen )
+
+ kontext "OeffnenDlg"
+ if ( OeffnenDlg.exists( 1 ) ) then
+ printlog( "File Open dialog is open. Good." )
+ OeffnenDlg.cancel()
+ else
+ warnlog( "File Open dialog did not open." )
+ endif
+ else
+ warnlog( "Backing window not found" )
+ endif
+
+
+
+ printlog( "Test case 2: File Save should not work from backing window (accelerator)" )
+
+ kontext "DocumentBackground"
+ if ( DocumentBackground.exists( 1 ) ) then
+
+ DocumentBackground.typeKeys( cAcceleratorFileSave )
+
+ kontext "SpeichernDlg"
+ if ( SpeichernDlg.exists( 1 ) ) then
+ warnlog( "File Save dialog should not open." )
+ SpeichernDlg.cancel()
+ else
+ printlog( "File Open dialog is not open. Good." )
+ endif
+ else
+ warnlog( "Backing window not found" )
+ endif
+
+
+
+ printlog( "Test case 3: File Save As should not work from backing window (accelerator)" )
+
+ kontext "DocumentBackground"
+ if ( DocumentBackground.exists( 1 ) ) then
+
+ DocumentBackground.typeKeys( cAcceleratorFileSaveAs )
+
+ kontext "SpeichernDlg"
+ if ( SpeichernDlg.exists( 1 ) ) then
+ warnlog( "File Save dialog should not open." )
+ SpeichernDlg.cancel()
+ else
+ printlog( "File Open dialog is not open. Good." )
+ endif
+ else
+ warnlog( "Backing window not found" )
+ endif
+
+
+ printlog( "Test case 4: FileOpen should be possible from backing window (slot)" )
+
+ kontext "DocumentBackground"
+ if ( DocumentBackground.exists( 1 ) ) then
+
+ FileOpen
+
+ kontext "OeffnenDlg"
+ if ( OeffnenDlg.exists( 1 ) ) then
+ printlog( "File Open dialog is open. Good." )
+ OeffnenDlg.cancel()
+ else
+ warnlog( "File Open dialog did not open." )
+ endif
+ else
+ warnlog( "Backing window not found" )
+ endif
+
+
+
+ printlog( "Test case 5: File Save should not work from backing window (slot)" )
+
+ kontext "DocumentBackground"
+ if ( DocumentBackground.exists( 1 ) ) then
+
+ try
+ FileSave
+
+ kontext "SpeichernDlg"
+ if ( SpeichernDlg.exists( 1 ) ) then
+ warnlog( "File Save dialog should not open." )
+ SpeichernDlg.cancel()
+ else
+ printlog( "File Open dialog is not open. Good." )
+ endif
+ catch
+ printlog( "Slot blocked, good" )
+ endcatch
+
+ else
+ warnlog( "Backing window not found" )
+ endif
+
+
+
+ printlog( "Test case 6: File Save As should not work from backing window (slot)" )
+
+ kontext "DocumentBackground"
+ if ( DocumentBackground.exists( 1 ) ) then
+
+ try
+ FileSaveAs
+
+ kontext "SpeichernDlg"
+ if ( SpeichernDlg.exists( 1 ) ) then
+ warnlog( "File Save dialog should not open." )
+ SpeichernDlg.cancel()
+ else
+ printlog( "File Open dialog is not open. Good." )
+ endif
+ catch
+ printlog( "Slot blocked, good" )
+ endcatch
+
+ else
+ warnlog( "Backing window not found" )
+ endif
+
+
+
+
+
+ gApplication = "WRITER"
+
+ call hNewDocument()
+
+ printlog( "Test case 7: File Save should not work from unmodified documents (accelerator)" )
+
+ kontext "DocumentWriter"
+ if ( DocumentWriter.exists( 1 ) ) then
+
+ DocumentWriter.typeKeys( cAcceleratorFileSave )
+
+ kontext "SpeichernDlg"
+ if ( SpeichernDlg.exists( 1 ) ) then
+ warnlog( "File Save dialog should not open." )
+ SpeichernDlg.cancel()
+ else
+ printlog( "File Open dialog is not open. Good." )
+ endif
+ else
+ warnlog( "Writer document not not found" )
+ endif
+
+
+
+ printlog( "Test case 8: File Save As should work from unmodified documents (accelerator)" )
+
+ kontext "DocumentWriter"
+ if ( DocumentWriter.exists( 1 ) ) then
+
+ DocumentWriter.typeKeys( cAcceleratorFileSaveAs )
+
+ kontext "SpeichernDlg"
+ if ( SpeichernDlg.exists( 1 ) ) then
+ printlog( "File Save dialog is open. Good." )
+ SpeichernDlg.cancel()
+ else
+ warnlog( "File Open dialog is not open." )
+ endif
+ else
+ warnlog( "Writer document not not found" )
+ endif
+
+
+ printlog( "Test case 9: File Save should not work from unmodified documents (slot)" )
+
+ kontext "DocumentWriter"
+ if ( DocumentWriter.exists( 1 ) ) then
+
+ try
+ FileSave
+
+ kontext "SpeichernDlg"
+ if ( SpeichernDlg.exists( 1 ) ) then
+ warnlog( "File Save dialog should not open." )
+ SpeichernDlg.cancel()
+ else
+ printlog( "File Save dialog is not open. Good." )
+ endif
+ catch
+ printlog( "Slot blocked, good" )
+ endcatch
+ else
+ warnlog( "Writer document not not found" )
+ endif
+
+
+
+ printlog( "Test case 10: File Save As should work from unmodified documents (slot)" )
+
+ kontext "DocumentWriter"
+ if ( DocumentWriter.exists( 1 ) ) then
+
+ try
+ FileSaveAs
+
+ kontext "SpeichernDlg"
+ if ( SpeichernDlg.exists( 1 ) ) then
+ printlog( "File Save dialog is open. Good." )
+ SpeichernDlg.cancel()
+ else
+ warnlog( "File Save dialog should open." )
+ endif
+ catch
+ warnlog( "Slot blocked" )
+ endcatch
+ else
+ warnlog( "Writer document not not found" )
+ endif
+
+ call hCloseDocument()
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/fontworkgallery.inc b/testautomation/framework/optional/includes/fontworkgallery.inc
new file mode 100644
index 000000000000..08fea775ba4e
--- /dev/null
+++ b/testautomation/framework/optional/includes/fontworkgallery.inc
@@ -0,0 +1,146 @@
+'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 : Resource test of font work gallery
+'*
+'\************************************************************************
+
+sub sFontworkGalleryUpdate
+ dim sApplication
+ dim i,a as integer
+
+ sApplication = array("WRITER","MASTERDOCUMENT","CALC","IMPRESS","DRAW")
+
+ ' for every application
+ a = uBound(sApplication())
+ for i = 0 to a
+ gApplication = sApplication(i)
+ printlog "********** " + gApplication
+ tFontworkGalleryUpdate
+ next i
+end sub
+
+testcase tFontworkGalleryUpdate
+ dim j,b as integer
+
+'i67024 - tbo sj Help-IDs missing on the windows items for FontworkAlignment and FontworkCharacterSpacing
+'i66989 - tbo sj Fontwork Gallery control has no Help-ID
+ b = getDocumentCount
+ for j = 1 to b
+ printlog "closing: " + j
+ hCloseDocument()
+ next j
+ hNewDocument()
+ sleep (5)
+ Kontext "Drawbar"
+ if NOT Drawbar.exists then
+ hToolbarSelect("DRAWING",true)
+ printlog "opened drawing toolbar"
+ endif
+ if Drawbar.exists then
+ FontworkGallery.click
+
+ Kontext "FontworkGallery"
+ dialogtest(FontworkGallery)
+ FontworkGallery.typeKeys("<right>", true)
+ FontworkGallery.mousedown(50,50)
+ FontworkGallery.mouseup(50,50)
+ FontworkGallery.OK
+
+ sleep 5
+ Kontext "FontworkObjectbar"
+ if FontworkObjectbar.exists then
+ FontworkGallery.click
+ Kontext "FontworkGallery"
+ dialogtest(FontworkGallery)
+ FontworkGallery.cancel
+
+ Kontext "FontworkObjectbar"
+ FontworkShape.click
+ Kontext "FontworkShape"
+ PlainText.click
+
+ Kontext "FontworkObjectbar"
+ FontworkSameLetterHeights.click
+ sleep 3
+
+ Kontext "FontworkObjectbar"
+ FontworkAlignment.click
+ Kontext "FontworkAlignment"
+ if FontworkAlignment.exists(5) then
+ dialogtest(FontworkAlignment)
+ FontworkAlignment.close
+ else
+ printlog "beginning workaround lockup"
+ hUseMenu()
+ hMenuClose()
+ sleep 3
+ Kontext "FontworkObjectbar"
+ FontworkAlignment.click
+ Kontext "FontworkAlignment"
+ if FontworkAlignment.exists(5) then
+ dialogtest(FontworkAlignment)
+ FontworkAlignment.close
+ else
+ warnlog "FontworkAlignment dialog not visible"
+ endif
+ endif
+
+ Kontext "FontworkObjectbar"
+ FontworkCharacterSpacing.click
+ Kontext "FontworkCharacterSpacing"
+ if FontworkCharacterSpacing.exists(5) then
+ 'dialogtest(FontworkCharacterSpacing)
+ FontworkCharacterSpacing.typeKeys ("<down><down><down><down><down><return>")
+ Kontext "FontworkCharacterSpacingCustom"
+ if FontworkCharacterSpacingCustom.exists(5) then
+ dialogtest(FontworkCharacterSpacingCustom)
+ printlog value.getText
+ FontworkCharacterSpacingCustom.close
+ else
+ printlog "dialog FontworkCharacterSpacingCustom didn't came up"
+ endif
+ Kontext "FontworkCharacterSpacing"
+ if FontworkCharacterSpacing.exists(5) then
+ FontworkCharacterSpacing.close
+ else
+ printlog "dialog FontworkCharacterSpacing was closed in another way"
+ endif
+ else
+ warnlog "fontWork characterspacing drop down menu is not visible"
+ endif
+ else
+ warnlog "fontWork toolbar is not visible"
+ endif
+ else
+ warnlog "Draw toolbar is not visible"
+ endif
+ hCloseDocument()
+endcase
+
diff --git a/testautomation/framework/optional/includes/help_bookmarks.inc b/testautomation/framework/optional/includes/help_bookmarks.inc
new file mode 100644
index 000000000000..bfa2384c8eca
--- /dev/null
+++ b/testautomation/framework/optional/includes/help_bookmarks.inc
@@ -0,0 +1,197 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Bookmarks in the help browser
+'*
+'\******************************************************************************
+
+testcase tHelpBookmarks
+
+ printlog( "Bookmarks in Help Browser")
+ dim brc as boolean
+ dim cStringFind as string
+ dim cStringBookmark as string
+ dim iItemCount as integer
+ const MYBOOKMARK = "myBookMark"
+
+ printlog( "Open Help Browser")
+ brc = hOpenHelp()
+ if ( not brc ) then
+ warnlog( "Help not open, aborting test")
+ goto endsub
+ endif
+
+ printlog( "Switch to Search Tab (Find)")
+ brc = hSelectHelpTab( "find")
+
+ printlog( "Enter <Java> as search term")
+ SearchFind.setText( "java")
+
+ printlog( "Search whole words and headers only")
+ FindInHeadingsOnly.check()
+ FindFullWords.check()
+ FindButton.click()
+
+ printlog( "Select first match and display the item")
+ Result.select( 1 )
+ cStringFind = Result.getSelText()
+ DisplayFind.click()
+
+ printlog( "Switch to the bookmarks tab")
+ hSelectHelpTab( "bookmarks")
+
+ printlog( "Click the <Add Bookmark> button")
+ SetBookmarks.click()
+
+ Kontext "AddBookmark"
+ printlog( "Name the bookmark after checking its default name")
+ cStringBookmark = BookmarkName.getText()
+ if ( cStringFind = cStringBookmark ) then
+ printlog( "Bookmark has correct default name: " & cStringFind )
+ else
+ warnlog( "Incorrect default name for new bookmark")
+ endif
+
+ printlog( "Accept default name, close dialog with ok")
+ AddBookmark.ok()
+
+ printlog( "Verify that the bookmark has been added to the list")
+ hSelectHelpTab( "bookmarks")
+
+ Kontext "BookmarksPage"
+ printlog( "Verify that the bookmark has been added")
+ iItemCount = Bookmarks.getItemCount()
+ if ( iItemCount = 1 ) then
+ printlog( "The correct number of bookmarks is listed (1)")
+ else
+ warnlog( "Incorrect number of bookmarks listed")
+ endif
+
+ printlog( "Abort the test if there is no bookmark listed at all")
+ if ( iItemCount = 0 ) then
+ warnlog( "Bookmark has not been created, aborting test")
+ call hCloseHelp()
+ goto endsub
+ endif
+
+ Kontext "BookmarksPage"
+ printlog( "Verify that the bookmark name makes it to the bookmarks list")
+ Bookmarks.select( 1 )
+ cStringBookmark = Bookmarks.getSelText()
+ if ( cStringBookmark = cStringFind ) then
+ printlog( "Name in the bookmarks-list: " & cStringFind )
+ else
+ warnlog( "Incorrect name in bookmarks list: " & cStringBookmark )
+ endif
+
+ printlog( "Close the help")
+ hCloseHelp()
+
+ printlog( "Reopen Help")
+ hOpenHelp()
+
+ printlog( "Verify that the bookmark is still present")
+ hSelectHelpTab( "bookmarks")
+
+ printlog( "Open the context menu and rename the bookmark")
+ Kontext "BookmarksPage"
+ Bookmarks.select( 1 )
+ brc = hUseBookmarksContextMenu( "rename")
+
+ printlog( "Change the name of the bookmark, accept with ok")
+ Kontext "AddBookmark"
+ if ( brc and AddBookmark.exists() ) then
+ BookmarkName.setText( MYBOOKMARK )
+ AddBookmark.ok()
+ else
+ warnlog( "The AddBookmarks dialog is not open")
+ endif
+
+ printlog( "Verify that the changed name is listed in the listbox")
+ hSelectHelpTab( "bookmarks")
+
+ kontext "BookmarksPage"
+ Bookmarks.select( 1 )
+ cStringBookmark = Bookmarks.getSelText()
+ if ( cStringBookmark = MYBOOKMARK ) then
+ printlog( "The Bookmark has been renamed: " & cStringBookmark )
+ else
+ warnlog( "Incorrect name displayed in bookmarks list")
+ endif
+
+ printlog( "Close the Help, Close the Office")
+ hCloseHelp()
+
+ printlog( "Restart the office, open help, switch to Bookmarks tab")
+ call ExitRestartTheOffice()
+ hOpenHelp()
+ hSelectHelpTab( "bookmarks")
+
+ printlog( "Verify that the renamed bookmark still exists")
+ Kontext "BookmarksPage"
+ Bookmarks.select( 1 )
+ cStringBookmark = Bookmarks.getSelText()
+ if ( cStringBookmark = MYBOOKMARK ) then
+ printlog( "The bookmark has the correct name")
+ else
+ warnlog( "Incorrect name displayed in bookmarks list")
+ endif
+
+ printlog( "Delete the Bookmark (using context menu)")
+ hUseBookmarksContextMenu( "delete")
+
+ printlog( "verify that the bookmark has been deleted (none left)")
+ kontext "Bookmarks"
+ if ( bookmarks.getItemCount = 0 ) then
+ printlog( "Bookmark has been deleted")
+ else
+ warnlog( "There are bookmarks left over, please check")
+ endif
+
+ printlog( "Close the help")
+ hClosehelp()
+
+ printlog( "Open help, switch to bookmarks tab")
+ hOpenhelp()
+ hSelectHelpTab( "bookmarks")
+
+ printlog( "Verify that the bookmark has been deleted")
+ kontext "BookmarksPage"
+ iItemCount = Bookmarks.getItemCount()
+ if ( iItemCount = 0 ) then
+ printlog( "The bookmark has been deleted")
+ else
+ warnlog( "Bookmarks have been left over, there should be none")
+ endif
+
+ printlog( "Close help")
+ hCloseHelp()
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/help_compare_applications.inc b/testautomation/framework/optional/includes/help_compare_applications.inc
new file mode 100644
index 000000000000..240535bed85b
--- /dev/null
+++ b/testautomation/framework/optional/includes/help_compare_applications.inc
@@ -0,0 +1,99 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description :
+'*
+'\******************************************************************************
+
+testcase tCompareHelpApps()
+
+ if ( gIsoLang <> "en-US" ) then
+ printlog( "No testing for languages other than en_US" )
+ goto endsub
+ endif
+
+
+ ' file related variables
+ dim sFileOut as string
+ dim sFilein as string
+ dim sFileName as string
+
+ ' the array that holds the names of the applications
+ dim aTopicsFromUI( 10 ) as string ' max index = 7 expected
+
+ ' some incremant variables and temporary stuff
+ dim iTopicsFromUI as integer
+ dim iCurrentItem as integer
+ dim sCurrentItem as string
+ dim irc as integer
+ dim brc as boolean
+
+ ' define input and output paths, presetting variables
+ sFileName = gProductName & "_help_applications_" & gIsoLang & ".txt"
+ sFileOut = hGetWorkFile( sFilename )
+ sFileIn = gTesttoolPath & "framework\optional\input\help_browser\"
+ sFileIn = sFileIn & sFileName
+ sFileIn = convertpath( sFileIn )
+
+ aTopicsFromUI( 0 ) = "0"
+
+ brc = hOpenHelp()
+ if ( not brc ) then
+ warnlog( "Help not open, aborting test" )
+ goto endsub
+ endif
+
+
+ hSelectHelpTab( "index" )
+
+ iTopicsFromUI = HelpAbout.getItemCount()
+
+ for iCurrentItem = 1 to iTopicsFromUI
+
+ HelpAbout.select( iCurrentItem )
+ sCurrentItem = HelpAbout.getSelText()
+ hListAppend( sCurrentItem, aTopicsFromUI() )
+
+ next iCurrentItem
+
+ call hCloseHelp()
+
+ ' Compare the list against a reference or create a new list, if the
+ ' reference does not exist
+ printlog( "" )
+ printlog( "Beginning comparision" )
+
+ irc = hManageComparisionList( sFileIn, sFileOut, aTopicsFromUI() )
+ if ( irc <> 0 ) then
+ warnlog( "Something went wrong, please review the log" )
+ endif
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/help_compare_content.inc b/testautomation/framework/optional/includes/help_compare_content.inc
new file mode 100644
index 000000000000..15874b0bd758
--- /dev/null
+++ b/testautomation/framework/optional/includes/help_compare_content.inc
@@ -0,0 +1,94 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description :
+'*
+'\******************************************************************************
+
+testcase tCompareHelpContent()
+
+ if ( gIsoLang <> "en-US" ) then
+ printlog( "No testing for languages other than en_US" )
+ goto endsub
+ endif
+
+
+ ' file related variables
+ dim sFileOut as string
+ dim sFilein as string
+ dim sFileName as string
+
+ ' the array that holds the names of the applications
+ dim aTopicsFromUI( 1200 ) as string
+
+ ' some incremant variables and temporary stuff
+ dim iTopicsFromUI as integer
+ dim iCurrentItem as integer
+ dim sCurrentItem as string
+ dim irc as integer
+ dim brc as boolean
+
+ ' define input and output paths, presetting variables
+ sFileName = gProductName & "_help_content_" & gIsoLang & ".txt"
+ sFileOut = hGetWorkFile( sFilename )
+ sFileIn = gTesttoolPath & "framework\optional\input\help_browser\"
+ sFileIn = convertpath( sFileIn & sFileName )
+
+ aTopicsFromUI( 0 ) = "0"
+
+ ' get the names from the listbox
+ brc = hOpenHelp()
+ if ( not brc ) then
+ warnlog( "Help not open, aborting test" )
+ goto endsub
+ endif
+
+ hSelectHelpTab( "content" )
+
+ ' find out, how many items we have in the list
+ iTopicsFromUI = hExpandAllNodes( SearchContent )
+ printlog( "Reading " & iTopicsFromUI & " items from Content Treelist" )
+
+ ' get all topics from the contents-treelist
+ hGetVisibleNodeNames( SearchContent , aTopicsFromUI() )
+
+ call hCloseHelp()
+
+ ' Compare the list against a reference or create a new list, if the
+ ' reference does not exist
+ printlog( "" )
+ printlog( "Beginning comparision" )
+ irc = hManageComparisionList( sFileIn, sFileOut, aTopicsFromUI() )
+ if ( irc <> 0 ) then
+ warnlog( "Something went wrong, please review the log." )
+ endif
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/help_compare_topics.inc b/testautomation/framework/optional/includes/help_compare_topics.inc
new file mode 100644
index 000000000000..75dd76625b88
--- /dev/null
+++ b/testautomation/framework/optional/includes/help_compare_topics.inc
@@ -0,0 +1,129 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description :
+'*
+'\******************************************************************************
+
+testcase tCompareHelpTopics()
+
+ if ( gIsoLang <> "en-US" ) then
+ printlog( "No testing for languages other than en_US" )
+ goto endsub
+ endif
+
+
+
+ ' NOTE: As some of the entries might exists twice or multiple times it is quite
+ ' possible that the results are inaccurate. The new implementation of
+ ' gCompare2Lists() (hListCompare() as used here) should be able to
+ ' handle this. If problems occur, this shuld be the first place to
+ ' look.
+
+ const MAX_ENTRIES = 30000
+
+ ' variables related to filenames
+ dim sFileOut as string
+ dim sFileIn as string
+ dim sfileName as string
+
+ ' The list that will hold all the entries
+ dim aTopicsFromUI( MAX_ENTRIES ) as string
+
+ ' some increment operators and temporary variables
+ dim iCurrentItem as integer
+ dim sCurrentItem as string
+ dim iCurrentApp as integer
+ dim iAboutItems as integer
+ dim cAboutItem as string
+ dim irc as integer
+ dim brc as boolean
+ dim bNextItem as boolean
+
+ ' define input and output paths, presetting variables
+ sFileName = gProductName & "_help_topics_" & gIsoLang & ".txt"
+ sFileOut = hGetWorkFile( sFilename )
+ sFileIn = gTesttoolPath & "framework\optional\input\help_browser\"
+ sFileIn = convertpath( sFileIn & sFileName )
+
+ aTopicsFromUI( 0 ) = "0"
+
+ brc = hOpenHelp()
+ if ( not brc ) then
+ warnlog( "Help not open, aborting test" )
+ goto endsub
+ endif
+
+ hSelectHelpTab( "index" )
+
+ ' NOTE: This testcase will not warn about missing About-Items, this is done
+ ' by the update-test. But you will get an enormous list of missing
+ ' Items.
+ iAboutItems = HelpAbout.getItemCount()
+
+ for iCurrentApp = 1 to iAboutItems
+
+ HelpAbout.select( icurrentApp )
+ sleep( 5 )
+ cAboutItem = HelpAbout.getSeltext()
+
+ iCurrentItem = 1
+ bNextItem = true
+
+ while( bNextItem )
+
+ try
+ SearchIndex.select( iCurrentItem )
+ sCurrentItem = cAboutItem & " : " & SearchIndex.getSelText()
+ hListAppend( sCurrentItem, aTopicsFromUI() )
+ iCurrentItem = iCurrentItem + 1
+ catch
+ printlog( cAboutItem & ": Read " & iCurrentItem & " items" )
+ bNextItem = false
+ endcatch
+
+ wend
+
+ next iCurrentApp
+
+ call hCloseHelp()
+
+ ' hManageComparisionList takes care of a lot of things like checking
+ ' for reference file and comparing or creating a new ref-file
+ printlog( "" )
+ printlog( "Beginning comparision. This will take a while ..." )
+
+ irc = hManageComparisionList( sFileIn, sFileOut, aTopicsFromUI() )
+ if ( irc <> 0 ) then
+ warnlog( "The list has changed, please review" )
+ endif
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/help_search.inc b/testautomation/framework/optional/includes/help_search.inc
new file mode 100644
index 000000000000..2e37fe58562e
--- /dev/null
+++ b/testautomation/framework/optional/includes/help_search.inc
@@ -0,0 +1,160 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Search for a string, apply restrictions, verify
+'*
+'\******************************************************************************
+
+testcase tHelpSearch
+
+ if ( gIsoLang <> "en-US" ) then
+ printlog( "No testing for languages other than en_US" )
+ goto endsub
+ endif
+
+ dim brc as boolean
+ dim irc as integer
+
+ dim sFileIn as string
+ dim sFileOut as string
+ dim aUIList( 100 ) as string
+
+ dim cBasePath as string
+ cBasePath = gTesttoolPath & "framework\optional\input\help_browser\"
+ dim cDataFile as string
+
+ brc = hOpenHelp()
+ if ( not brc ) then
+ warnlog( "Help not open, aborting test" )
+ goto endsub
+ endif
+
+
+ brc = hSelectHelpTab( "find" )
+ if ( not brc ) then
+ warnlog( "Could not access requested TabPage, aborting test" )
+ call hClosehelp()
+ goto endsub
+ endif
+
+ '----------- Search without filter -----------------------------------------
+ printlog( "" )
+ printlog( "Search for <java> without any filter" )
+
+ SearchFind.setText( "java" )
+ FindFullWords.unCheck()
+ FindInHeadingsOnly.unCheck()
+
+ FindButton.click()
+
+ ListAllDelete( aUIList() )
+ hGetListItems( Result, aUIList() )
+
+ cDataFile = gProductName & "_search_without_filter_" & gIsoLang & ".txt"
+ sFileOut = hGetWorkFile( cDataFile )
+ sFileIn = convertpath( cBasePath & cDataFile )
+
+ irc = hManageComparisionList( sFileIn, sFileOut, aUIList() )
+ if ( irc <> 0 ) then
+ warnlog( "Lists are not identical, please review the log" )
+ endif
+
+ ' ------------ Search whole words only -------------------------------------
+ printlog( "" )
+ printlog( "Search for <java>, whole words only" )
+
+ SearchFind.setText( "java" )
+ FindFullWords.Check()
+ FindInHeadingsOnly.unCheck()
+
+ FindButton.click()
+
+ ListAllDelete( aUIList() )
+ hGetListItems( Result, aUIList() )
+
+ cDataFile = gProductName & "_search_whole_words_only_" & gIsoLang & ".txt"
+ sFileOut = hGetWorkFile( cDataFile )
+ sFileIn = convertpath( cBasePath & cDataFile )
+
+ irc = hManageComparisionList( sFileIn, sFileOut, aUIList() )
+ if ( irc <> 0 ) then
+ warnlog( "Lists are not identical, please review the log" )
+ endif
+
+ ' ------------ Search headings only ----------------------------------------
+ printlog( "" )
+ printlog( "Search for <java>, headings only" )
+
+ SearchFind.setText( "java" )
+ FindFullWords.unCheck()
+ FindInHeadingsOnly.Check()
+
+ FindButton.click()
+
+ ListAllDelete( aUIList() )
+ hGetListItems( Result, aUIList() )
+
+ cDataFile = gProductName & "_search_headings_only_" & gIsoLang & ".txt"
+ sFileOut = hGetWorkFile( cDataFile )
+ sFileIn = convertpath( cBasePath & cDataFile )
+
+ irc = hManageComparisionList( sFileIn, sFileOut, aUIList() )
+ if ( irc <> 0 ) then
+ warnlog( "Lists are not identical, please review the log" )
+ endif
+
+ ' ------------ Search headings and whole words -----------------------------
+ printlog( "" )
+ printlog( "Search for <java>, limit results to whole words and headings" )
+
+ SearchFind.setText( "java" )
+ FindFullWords.Check()
+ FindInHeadingsOnly.Check()
+
+ FindButton.click()
+
+ ListAllDelete( aUIList() )
+ hGetListItems( Result, aUIList() )
+
+ cDataFile = gProductName & "_search_headings_and_whole_words_" & gIsoLang & ".txt"
+ sFileOut = hGetWorkFile( cDataFile )
+ sFileIn = convertpath( cBasePath & cDataFile )
+
+ irc = hManageComparisionList( sFileIn, sFileOut, aUIList() )
+ if ( irc <> 0 ) then
+ warnlog( "Lists are not identical, please review the log" )
+ endif
+
+
+ hCloseHelp()
+
+endcase
+
+
+
diff --git a/testautomation/framework/optional/includes/help_view_topics.inc b/testautomation/framework/optional/includes/help_view_topics.inc
new file mode 100644
index 000000000000..6a729fe27679
--- /dev/null
+++ b/testautomation/framework/optional/includes/help_view_topics.inc
@@ -0,0 +1,105 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Display each help topic
+'*
+'\******************************************************************************
+
+testcase tHelpRessourceTest( iCurrentAboutItem as integer )
+
+ printlog( "Resource test for help topics - display all topics" )
+
+ dim iTopicCount as integer
+ dim iCurrentTopic as integer
+ dim cCurrentTopic as string
+ dim cPreviousTopic as string
+ dim cCurrentAboutItem as string
+ dim brc as boolean
+
+ brc = hOpenHelp()
+ if ( not brc ) then
+ warnlog( "Help not open, aborting test" )
+ goto endsub
+ endif
+
+ brc = hSelectHelpTab( "index" )
+ if ( not brc ) then
+ warnlog( "There was a problem switching to the index tabpage" )
+ endif
+
+ Kontext "IndexPage"
+ HelpAbout.select( iCurrentAboutItem )
+ sleep( 3 )
+
+ cCurrentAboutItem = HelpAbout.getSelText()
+ printlog( " " )
+ printlog( " * Current Application: " & cCurrentAboutItem )
+
+ iTopicCount = SearchIndex.getItemcount()
+ printlog( "For this application " & iTopicCount & " pages will be loaded." )
+ printlog( " " )
+
+ cPreviousTopic = "<not yet set>"
+ for iCurrentTopic = 1 to iTopicCount
+
+ try
+ SearchIndex.Select( iCurrentTopic )
+ cCurrentTopic = SearchIndex.getSelText()
+ catch
+ warnlog( "Failed to select entry at " & iCurrentTopic )
+ printlog( "Previous entry: " & cPreviousTopic )
+ exit for
+ endcatch
+
+ try
+ DisplayIndex.click()
+ WaitSlot( 5000 )
+ catch
+ warnlog( "#i105476# - Failed to display index item (fatal):" )
+ printlog( " - Index...........: " & iCurrentTopic )
+ printlog( " - Topic (current).: " & cCurrentTopic )
+ printlog( " - Topic (previous): " & cPreviousTopic )
+ call ExitRestartTheOffice()
+ goto endsub
+ endcatch
+
+ cPreviousTopic = cCurrentTopic
+
+ next iCurrentTopic
+
+ brc = hCloseHelp()
+ if ( not brc ) then
+ warnlog( "There was a problem closing the help viewer" )
+ endif
+
+ call ExitRestartTheOffice()
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/loadsave_files.inc b/testautomation/framework/optional/includes/loadsave_files.inc
new file mode 100644
index 000000000000..c7fd948b5df3
--- /dev/null
+++ b/testautomation/framework/optional/includes/loadsave_files.inc
@@ -0,0 +1,181 @@
+'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 : File / New-Saving-Loading-Saving-Loading
+'*
+'\***********************************************************************
+
+sub l1_lasp
+
+ PrintLog Chr(13)+"****** File / New-Saving-Loading-Saving-Loading ******"
+ gApplication = "WRITER"
+ Call tFileLoadSave
+ gApplication = "CALC"
+ Call tFileLoadSave
+ gApplication = "IMPRESS"
+ Call tFileLoadSave
+ gApplication = "DRAW"
+ Call tFileLoadSave
+ gApplication = "MATH"
+ Call tFileLoadSave
+ gApplication = "HTML"
+ Call tFileLoadSave
+ gApplication = "MASTERDOCUMENT"
+ Call tFileLoadSave
+
+end sub
+
+' --------------------------------------------------------------------------------
+
+testcase tFileLoadSave
+
+ Dim Datei1$
+ Dim Datei2$
+ Dim DokName1$
+ Dim DokName2$
+ Dim DefaultPfad$
+ Dim AppsFilter$
+ Dim sApp$
+ Dim DefFilter$
+ Dim vExtension(10) as string
+
+ DefFilter$ = hGetFilter( "current" )
+
+ if gApplication = "HTML" then
+ 'hGetFilternameExtension is able to read more than one extension entry
+ vExtension() = hGetFilternameExtension("writer_web_HTML")
+ DokName1$ = "ls_test1" & "." & vExtension(0)
+ Dokname2$ = "ls_test2" & "." & vExtension(0)
+ else
+ DokName1$ = "ls_test1" & hGetSuffix( "current" )
+ DokName2$ = "ls_test2" & hGetSuffix( "current" )
+ end if
+
+ PrintLog Chr(13)+"** " + gApplication
+
+ Call hNewDocument
+
+ if gApplication = "WRITER" OR gApplication = "HTML" OR gApplication = "MASTERDOCUMENT" then
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys gApplication + " => Load - Save - Load - Save<Return>"
+ DocumentWriter.TypeKeys "- first saving / loading<Return>"
+ end if
+
+ if gApplication = "CALC" then
+ Kontext "DocumentCalc"
+ DocumentCalc.TypeKeys "Testdokument => Load - Save - Load - Save<Return>"
+ DocumentCalc.TypeKeys "- first saving / loading<Return>"
+ end if
+
+ if gApplication = "MATH" then
+ SchreibenInMathDok "a over 2 = 3 over d"
+ Sleep (2)
+ end if
+
+ if gApplication = "DRAW" OR gApplication = "IMPRESS" then
+ hRechteckErstellen ( 30, 30, 60, 60 )
+ end if
+
+ DefaultPfad$ = ConvertPath ( gOfficePath + "user\work\" )
+ Datei1$ = ConvertPath ( DefaultPfad$+DokName1 )
+ Datei2$ = ConvertPath ( DefaultPfad$+DokName2 )
+
+ if app.Dir (Datei1$) <> "" then app.kill Datei1$
+ if app.Dir (Datei2$) <> "" then app.kill Datei2$
+ Sleep 2
+
+ PrintLog "- first saving"
+ hFileSaveAsKill ( Datei1$ )
+
+ PrintLog "- change and save"
+ if gApplication = "WRITER" OR gApplication = "HTML" OR gApplication = "MASTERDOCUMENT" then
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "- file/save<Return>"
+ end if
+
+ if gApplication = "CALC" then
+ Kontext "DocumentCalc"
+ DocumentCalc.TypeKeys "- file/save<Return>"
+ end if
+
+ if gApplication = "MATH" then
+ SchreibenInMathDok "file save : 4 over 5 = 3 over d"
+ Sleep (2)
+ end if
+
+ if gApplication = "DRAW" OR gApplication = "IMPRESS" then
+ hRechteckErstellen ( 10, 10, 20, 20 )
+ end if
+
+ hFileSave()
+
+ PrintLog "- close"
+ Call hCloseDocument()
+
+ PrintLog "- first loading"
+ hFileOpen ( Datei1$ )
+ sleep( 2 )
+
+ if gApplication = "WRITER" OR gApplication = "HTML" OR gApplication = "MASTERDOCUMENT" then
+ Kontext "DocumentWriter"
+ gMouseClick ( 50, 50 )
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "<Down>", 4
+ DocumentWriter.TypeKeys "<Return>- second saving / loading"
+ end if
+
+ if gApplication = "CALC" then
+ Kontext "DocumentCalc"
+ gMouseClick ( 50, 50 )
+ DocumentCalc.TypeKeys "<Down>", 4
+ DocumentCalc.TypeKeys "<Return>- second saving / loading"
+ end if
+
+ if gApplication = "MATH" then
+ SchreibenInMathDok "file save : 4 over 5 = 3 over d"
+ Sleep (2)
+ end if
+
+ if gApplication = "DRAW" OR gApplication = "IMPRESS" then
+ hRechteckErstellen ( 65, 65, 75, 75 )
+ end if
+
+ PrintLog "- second saving"
+ hFileSaveAsKill ( Datei2$ )
+ Call hCloseDocument
+
+ PrintLog "- second loading"
+ hFileOpen ( Datei2$ )
+ Kontext "Navigator"
+ sleep (1)
+ if Navigator.Exists(5) then Navigator.Close
+ Call hCloseDocument
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/loadsave_new.inc b/testautomation/framework/optional/includes/loadsave_new.inc
new file mode 100644
index 000000000000..924646423031
--- /dev/null
+++ b/testautomation/framework/optional/includes/loadsave_new.inc
@@ -0,0 +1,116 @@
+'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 : tborsten.bosbach@sun.com
+'*
+'* short description : global functionality - load/save documents
+'*
+'\***************************************************************************
+
+testcase NewCloseDok
+ PrintLog " open and close all documenttypes"
+ Call hNewCloseDocument ("WRITER")
+ Call hNewCloseDocument ("CALC")
+ Call hNewCloseDocument ("IMPRESS")
+ Call hNewCloseDocument ("DRAW")
+ Call hNewCloseDocument ("MATH")
+ Call hNewCloseDocument ("HTML")
+ Call hNewCloseDocument ("MASTERDOCUMENT")
+endcase
+
+testcase NewDok
+ Dim i%
+ PrintLog " open all applications and close all one by one"
+ Call NewDocument ("WRITER")
+ Call NewDocument ("CALC")
+ Call NewDocument ("IMPRESS")
+ Call NewDocument ("DRAW")
+ Call NewDocument ("MATH")
+ Call NewDocument ("HTML")
+ Call NewDocument ("MASTERDOCUMENT")
+
+ PrintLog " Close all documents ( file/close )"
+ for i%=1 to 7
+ Kontext "Navigator"
+ if Navigator.Exists then Navigator.Close
+ Sleep (1)
+ FileClose
+ kontext "Active"
+ if Active.Exists(10) then
+ try
+ printlog "" + i% + " " +active.gettext
+ Active.No
+ catch
+ try
+ Active.Click ( 202 )
+ catch
+ warnlog "Error on hitting 'No' button"
+ sleep 5
+ endcatch
+ endcatch
+ end if
+ next i%
+endcase
+
+sub hNewCloseDocument ( sApplikation as String )
+ PrintLog "- " + sApplikation
+ gApplication = sApplikation
+
+ try
+ hNewDocument
+ if gApplication = "DRAW" OR gApplication = "IMPRESS" then
+ hTextrahmenErstellen ( "Dummy text", 20, 20, 50, 50 )
+ else
+ hTypeKeys "Dummy text<Return>"
+ end if
+ Sleep 2
+ Kontext "Navigator"
+ if Navigator.Exists then Navigator.Close
+ hCloseDocument
+ catch
+ Warnlog gApplication + ": a error is occurred."
+ Exceptlog
+ endcatch
+end sub
+
+sub NewDocument ( sApplikation as String )
+ PrintLog "- " + sApplikation
+ gApplication = sApplikation
+ try
+ hNewDocument
+ if gApplication = "DRAW" OR gApplication = "IMPRESS" then
+ hTextrahmenerstellen ( "Dummy text",20,20,50,50 )
+ else
+ Call hTypeKeys "Dummy text<Return>"
+ end if
+ Sleep 2
+ catch
+ Warnlog gApplication + ": a error is occurred."
+ Exceptlog
+ endcatch
+end sub
+
diff --git a/testautomation/framework/optional/includes/menuentries.inc b/testautomation/framework/optional/includes/menuentries.inc
new file mode 100644
index 000000000000..5c00a7cf34f1
--- /dev/null
+++ b/testautomation/framework/optional/includes/menuentries.inc
@@ -0,0 +1,172 @@
+'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 : Read menubar and first level drop down lists and compare to reference
+'*
+'\*****************************************************************
+
+sub t_getMenuText
+ dim k,c as integer
+ dim sApplication() as string
+
+ sApplication = array("WRITER","MASTERDOCUMENT","HTML","CALC","IMPRESS","DRAW","MATH","BASIC","DATABASE")
+
+ ' for every application
+ c = uBound(sApplication())
+ for k = 0 to c
+ gApplication = sApplication(k)
+ printlog "********** " + gApplication
+ call s_getMenuText
+ next k
+ gApplication = "WRITER"
+end sub
+
+testcase s_getMenuText
+ dim i,j,l,m,a,b,d,e as integer
+ dim sReference(400) as string
+ dim sCurrent(400) as string
+ dim sFileName as string
+ dim sTemp as string
+ dim bError as boolean
+ dim iTopLevelCount as integer
+ dim iOffset as integer
+
+ for i=0 to uBound(sReference())
+ sReference(i) = 0
+ sCurrent(i) = 0
+ next i
+ bError = FALSE
+ hNewDocument
+ hUseMenu
+ ' for every item in main menu bar
+ a = MenuGetItemCount
+ iTopLevelCount = a
+ MenuSelect (0)
+ for i = 1 to a
+ hUseMenu
+ stemp = MenuGetItemText(MenuGetItemID(i))
+ 'printlog sTemp
+ listAppend(sCurrent(),"********** "+sTemp)
+ MenuSelect(MenuGetItemID(i))
+ b = MenuGetItemCount
+ for j = 1 to b
+ sTemp = MenuGetItemText(MenuGetItemID(j))
+ 'printlog " " + sTemp
+ listAppend(sCurrent(),sTemp)
+ next j
+ MenuSelect (0)
+ next i
+ hCloseDocument
+ sFileName = convertPath(gTestToolPath+"framework\optional\input/menu/"+lCase(gISOLang+"_"+gApplication+".txt"))
+ printlog( "Using reference file: " & sFileName )
+ ' gProductName should not make a big difference.
+ if fileExists(sFileName) then
+ ' load to compare
+ listRead(sReference(), sFileName, "utf8")
+ d = listCount(sCurrent())
+ m = d
+ e = listCount(sReference())
+ if (d <> e) then
+ warnlog "The count of Menuentries differs from reference "+gApplication+". should: '" + e + "'; delta is: '" + (d - e) + "'"
+ bError = TRUE
+ ' always take the shorter list count
+ if cBool(d - e) then
+ d = e
+ endif
+ e = m - e
+ else
+ printlog "Count of Menuentries is ok"
+ e = 0
+ endif
+ ' compare all entries
+ iOffset = 0
+ m = 0
+ for l=1 to d
+ ' count main menu bar items
+ if inStr(sReference(l), "********** ") > 0 then
+ m = m + 1
+ ' bug in inc m :-(
+ printlog mid(sReference(l),12)
+ endif
+ ' complain non existing accelerator
+ if (sReference(l) <> "") AND (inStr(sReference(l),"~") < 1) then
+ qaErrorLog "No accelerator (~) in item: '" + sReference(l) + "'"
+ endif
+ ' compare the menu entries
+ if (sReference(l) <> sCurrent(l+iOffset))then
+ ' try to syncronize different count of entries
+ if (e <> 0) then
+ iOffset = iOffset + sgn(e)
+ 'qaerrorlog "io: " + ioffset
+ e = e - sgn(e)
+ 'qaerrorlog "e: " + e
+ endif
+ '
+ if (m = (iTopLevelCount-1)) then
+ ' tolerate the window menu
+ printlog "String differs: " + chr(13) + "current : '"+sCurrent(l) + "'" + chr(13) + "reference: '" + sReference(l) + "'"
+ else
+ bError = TRUE
+ warnlog "String differs: " + chr(13) + "current : '"+sCurrent(l) + "'" + chr(13) + "reference: '" + sReference(l) + "'"
+ endif
+ endif
+ next l
+ ' for l=d-5 to d+5
+ ' printlog "------"
+ ' printlog sreference(l)
+ ' printlog scurrent(l)
+ ' next l
+ ' if there is still is a difference in count
+ if (e <> 0) then
+ if sgn(e) then
+ warnlog "Not all reference entries are there, e.g.: '" + sReference(l+1) + "'"
+ else
+ warnlog "There are too much entries, e.g.: '" + sCurrent(l+1) + "'"
+ endif
+ endif
+ if bError then
+ sFileName = convertPath(gOfficePath+"user/work/menu/"+lCase(gISOLang+"_"+gApplication+".txt"))
+ listWrite(sCurrent(), sFileName, "utf8")
+ printlog "Written strings from this build to: " + chr(13) + sFileName
+ else
+ ' OK
+ endif
+ else
+ ' write to checkin
+ warnlog "No reference found; please copy:"+lCase(gISOLang+"_"+gApplication+".txt")
+ sFileName = convertPath(gOfficePath+"user/work/menu/"+lCase(gISOLang+"_"+gApplication+".txt"))
+ listWrite(sCurrent(), sFileName, "utf8")
+ printlog sFileName + chr(13) + "to"
+ sFileName = convertPath(gTestToolPath+"framework/level1/input/menu/"+lCase(gISOLang+"_"+gApplication+".txt"))
+ printlog sFilename
+ 'listWrite(sCurrent(), sFileName, "utf8")
+ endif
+ 'speichern: (vendor?) sprache gISOLang applikation
+endcase
+
diff --git a/testautomation/framework/optional/includes/ole_1.inc b/testautomation/framework/optional/includes/ole_1.inc
new file mode 100644
index 000000000000..3e5d7af304a1
--- /dev/null
+++ b/testautomation/framework/optional/includes/ole_1.inc
@@ -0,0 +1,459 @@
+'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 : global-level-1-test -> insert all OLE-Objects out of OLE-dialog into all doc-types
+'*
+'\******************************************************************************
+
+testcase tOLEWriter
+
+ Dim i% : Dim k%
+ Dim sText$
+
+ gApplication = "WRITER"
+
+ Call hNewDocument
+
+ PrintLog "- Writer : Chart without table"
+ InsertObjectChart
+ sleep(4)
+ Kontext "DocumentChart"
+ if DocumentChart.Exists(5) then
+ FormatChartType
+ Kontext "ChartType"
+ if ChartType.Exists(5) then
+ ChartType.Cancel
+ else
+ warnlog "Chart Type dialog did bot occour."
+ end if
+ Kontext "DocumentChart"
+ DocumentChart.TypeKeys "<ESCAPE>"
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "<DELETE>"
+ sleep(1)
+ else
+ warnlog "Chart has not been inserted."
+ end if
+ sleep(4)
+ PrintLog "- Writer : Chart out of a table only with numbers"
+ InsertTableWriter
+
+ Kontext "TabelleEinfuegenWriter"
+ Spalten.SetText "3"
+ Zeilen.SetText "10"
+ TabelleEinfuegenWriter.OK
+
+ Kontext "DocumentWriter"
+ for i%=1 to 10
+ for k%=1 to 3
+ sText$ = (i%+k%)*k%
+ DocumentWriter.TypeKeys sText$
+ DocumentWriter.TypeKeys "<Right>"
+ next k%
+ DocumentWriter.TypeKeys "<Down>"
+ DocumentWriter.TypeKeys "<Left>", 3
+ next i%
+
+ InsertObjectChart
+ hStepThroughChartWizard()
+
+ Kontext "DocumentChart"
+ DocumentChart.typeKeys "<ESCAPE>"
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "<Delete>"
+ Sleep 1
+ DocumentWriter.TypeKeys "<Down>", 20
+ DocumentWriter.TypeKeys "<Return>", 2
+ Sleep 1
+
+
+ PrintLog "- Writer : Chart out of a table only with chars"
+ InsertTableWriter
+
+ Kontext "TabelleEinfuegenWriter"
+ Spalten.SetText "3"
+ Zeilen.SetText "10"
+ TabelleEinfuegenWriter.OK
+
+ Kontext "DocumentWriter"
+ for i%=1 to 10
+ for k%=1 to 3
+ sText$ = (i%+k%)*k%
+ DocumentWriter.TypeKeys "Hallo" + sText$
+ DocumentWriter.TypeKeys "<Right>"
+ next k%
+ DocumentWriter.TypeKeys "<Down>"
+ DocumentWriter.TypeKeys "<Left>", 3
+ next i%
+
+ InsertObjectChart
+
+ hStepThroughChartWizard()
+
+ Kontext "DocumentChart"
+ DocumentChart.typeKeys "<ESCAPE>"
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "<Delete>"
+ Sleep 1
+ DocumentWriter.TypeKeys "<Down>", 20
+ DocumentWriter.TypeKeys "<Return>", 2
+ Sleep 1
+
+ PrintLog "- Writer : Math"
+
+ InsertObjectFormulaWriter
+ gMouseClick ( 1, 1)
+
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "<Delete>"
+ Sleep 1
+
+ PrintLog "- Writer : floating frame"
+
+ 'warnlog( "#148094# - Crash when deselecting floating frame in Writer" )
+
+ InsertFloatingFrame
+
+ Kontext "TabEigenschaften"
+ FrameName.SetText "Hallo"
+ Inhalt.SetText ConvertPath ( gTesttoolPath+"global\input\graf_inp\borabora.jpg" )
+
+ TabEigenschaften.OK
+ Sleep 2
+
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "<Delete>"
+ Sleep 1
+
+ hCloseDocument
+
+endcase
+
+'*******************************************************************************
+
+testcase tOLECalc
+
+
+
+ dim i as Integer
+ dim k as Integer
+
+ const ICWAIT as Integer = 2
+ dim brc as boolean
+ dim iCurrentPos as integer
+ dim iColumn as integer
+ dim iRow as integer
+
+ const CHART_OBJECT_DEFAULT_POSITION_X = 30
+ const CHART_OBJECT_DEFAULT_POSITION_Y = 30
+ const OUTSIDE_CHART_OBJECT_X = 1
+ const OUTSIDE_CHART_OBJECT_Y = 1
+ const CURSOR_MOVEMENT_RETRIES = 20
+ const SELECT_CELLS_X = 7
+ const SELECT_CELLS_Y = 7
+
+ gApplication = "CALC"
+
+ brc = hCreateDocument()
+ if ( not brc ) then
+ warnlog( "Failed to create new " & gApplication & " document" )
+ endif
+
+ PrintLog "- Calc : Chart without data"
+ InsertChartCalc
+
+ hStepThroughChartWizard()
+
+ kontext "DocumentChart"
+ DocumentChart.typeKeys( "<ESCAPE>" )
+
+ Kontext "DocumentCalc"
+ gMouseClick ( OUTSIDE_CHART_OBJECT_X , OUTSIDE_CHART_OBJECT_Y )
+ sleep( ICWAIT )
+
+ ' If the OLE object is in selection mode the Drawing Object Bar should be
+ ' visible. As we do not know exactly where on the spreadsheet the object
+ ' appears we move from the upper left to the lower right corner of the
+ ' document until we hit an OLE object and the Drawing Object Bar is enabled.
+ ' Then <DEL> is sent to the document hopefully deleting the object.
+
+ for iCurrentPos = 1 to 9
+
+ kontext "DocumentCalc"
+ gMouseClick( 10 * iCurrentPos , 10 * iCurrentPos )
+
+ Kontext "DrawingObjectBar"
+ if ( DrawingObjectBar.exists( 1 ) ) then
+
+ kontext "DocumentCalc"
+ DocumentCalc.TypeKeys( "<Delete>" )
+ printlog( "Found drawing object, executed <DEL> on the object" )
+ exit for
+
+ else
+
+ qaerrorlog( "Drawing object not hit, trying again" )
+
+ endif
+
+ next iCurrentPos
+ '</ul>
+
+
+
+ PrintLog "- Calc : Chart with data"
+
+ kontext "DocumentCalc"
+ DocumentCalc.TypeKeys( "<MOD1 HOME>" )
+ for iColumn = 1 to SELECT_CELLS_Y
+ for iRow = 1 to SELECT_CELLS_X
+ hTypeKeys ( iColumn * iRow )
+ hTypeKeys ( "<Return>" )
+ next iRow
+ DocumentCalc.TypeKeys( "<Up><Left>", CURSOR_MOVEMENT_RETRIES )
+ DocumentCalc.TypeKeys( "<Right>", iColumn )
+ next iColumn
+
+ DocumentCalc.TypeKeys( "<Up><Left>", CURSOR_MOVEMENT_RETRIES )
+ call ZellenMarkieren ( SELECT_CELLS_X , SELECT_CELLS_Y )
+
+ InsertChartCalc
+
+ hStepThroughChartWizard()
+
+ Kontext "DocumentCalc"
+ DocumentCalc.typeKeys("<escape>")
+ sleep( ICWAIT )
+
+ PrintLog "- Calc : Chart for a table only with text"
+
+ Kontext "DocumentCalc"
+ DocumentCalc.TypeKeys( "<MOD1 HOME>" )
+ for iColumn = 1 to SELECT_CELLS_Y
+ for iRow = 1 to SELECT_CELLS_X
+ hTypeKeys ( "Hallo<Return>" )
+ next iRow
+ DocumentCalc.TypeKeys "<Up><Left>", CURSOR_MOVEMENT_RETRIES
+ DocumentCalc.TypeKeys "<Right>", iColumn
+ next iColumn
+
+ DocumentCalc.TypeKeys "<Up><Left>", CURSOR_MOVEMENT_RETRIES
+ call ZellenMarkieren ( SELECT_CELLS_X , SELECT_CELLS_Y )
+
+ InsertChartCalc
+
+ hStepThroughChartWizard()
+
+ Kontext "DocumentCalc"
+ gMouseCLick ( OUTSIDE_CHART_OBJECT_X , OUTSIDE_CHART_OBJECT_Y )
+ sleep( ICWAIT )
+
+ PrintLog( "- Calc : Math" )
+
+ InsertObjectFormulaCalc
+ sleep( ICWAIT )
+
+ gMouseClick ( 50, 99 )
+ sleep( ICWAIT )
+
+ PrintLog( "- Calc : floating frame" )
+
+ InsertFloatingFrame
+
+ Kontext "TabEigenschaften"
+ FrameName.SetText( "Hallo" )
+ Inhalt.SetText( ConvertPath ( gTesttoolPath+"global\input\graf_inp\borabora.jpg" ) )
+
+ TabEigenschaften.OK()
+ sleep( ICWAIT )
+
+ gMouseCLick ( OUTSIDE_CHART_OBJECT_X , OUTSIDE_CHART_OBJECT_Y )
+ sleep( ICWAIT )
+
+ brc = hDestroyDocument()
+
+endcase
+
+'*******************************************************************************
+
+testcase tOLEDraw
+
+ Dim i% : Dim k%
+ Dim iMenuCount(1) as integer
+
+ gApplication = "DRAW"
+
+ Call hNewDocument
+
+ PrintLog "- Draw : Math"
+ InsertObjectFormulaDraw
+ sleep 2
+
+ gMouseClick ( 1 , 1 )
+ sleep 1
+
+ DocumentDraw.TypeKeys "<Delete>"
+
+ PrintLog "- Draw : Chart"
+
+ hUseMenu()
+ iMenuCount(0) = menuGetItemCount
+ MenuSelect(0)
+
+ try
+ InsertObjectChart
+ Sleep ( 2 )
+
+ Kontext "DocumentChart"
+ DocumentChart.useMenu
+ iMenuCount(1) = menuGetItemCount
+ MenuSelect(0)
+ if iMenuCount(0) = iMenuCount(1) then
+ warnlog "Menu bar didn't change after inserting OLE object; It should be different from: " +iMenuCount(0)
+ else
+ printlog "Menu bar did change; from: " + iMenuCount(0) + "; to: " + iMenuCount(1)
+ endif
+
+ gMouseClick ( 1 , 1 )
+ Sleep ( 1 )
+
+ DocumentDraw.TypeKeys "<Delete>"
+ catch
+ Call hReopenDoc
+ endcatch
+
+ PrintLog "- Draw : Calc"
+
+ InsertSpreadsheetDraw
+ sleep 2
+
+ gMouseClick ( 1 , 1 )
+ sleep 1
+
+ DocumentDraw.TypeKeys "<Delete>"
+
+ PrintLog "- Draw : floating frame"
+
+ try
+ InsertFloatingFrame
+
+ Kontext "TabEigenschaften"
+
+ FrameName.SetText "Hallo"
+ Inhalt.SetText ConvertPath ( gTesttoolPath+"global\input\graf_inp\borabora.jpg" )
+
+ TabEigenschaften.OK
+ Sleep 2
+
+ gMouseClick ( 1 , 1 )
+ Sleep 1
+
+ DocumentDraw.TypeKeys "<Delete>"
+ catch
+ Call hReopenDoc
+ endcatch
+
+ hCloseDocument
+
+endcase
+
+'*******************************************************************************
+
+testcase tOLEImpress
+
+ Dim i% : Dim k%
+
+ gApplication = "IMPRESS"
+
+ Call hNewDocument
+
+ PrintLog "- Impress : Math"
+
+ InsertObjectFormulaDraw
+ sleep 2
+
+ gMouseClick ( 1 , 1 )
+ sleep 1
+
+ DocumentImpress.TypeKeys "<Delete>"
+
+ '*** Chart
+ PrintLog "- Impress : Chart"
+
+ try
+ InsertObjectChart
+ sleep 2
+
+ gMouseClick ( 1 , 1 )
+ sleep 1
+
+ DocumentImpress.TypeKeys "<Delete>"
+ catch
+ Call hReopenDoc
+ endcatch
+
+ '*** Calc
+ PrintLog "- Impress : Calc"
+
+ InsertSpreadsheetDraw
+ sleep 2
+
+ gMouseClick ( 1 , 1 )
+ sleep 1
+
+ DocumentImpress.TypeKeys "<Delete>"
+
+ '*** floating frame
+ PrintLog "- Impress : floating frame"
+
+ try
+ InsertFloatingFrame
+
+ Kontext "TabEigenschaften"
+ FrameName.SetText "Hallo"
+
+ Inhalt.SetText ConvertPath ( gTesttoolPath+"global\input\graf_inp\borabora.jpg" )
+
+ TabEigenschaften.OK
+ Sleep 2
+
+ gMouseClick ( 1 , 1 )
+ Sleep 1
+ catch
+ hReopenDoc
+ endcatch
+
+ DocumentImpress.TypeKeys "<Delete>"
+
+ hCloseDocument
+
+endcase
+
+
+
diff --git a/testautomation/framework/optional/includes/ole_2.inc b/testautomation/framework/optional/includes/ole_2.inc
new file mode 100644
index 000000000000..f2c679e84b6d
--- /dev/null
+++ b/testautomation/framework/optional/includes/ole_2.inc
@@ -0,0 +1,129 @@
+'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 : global-level-1-test -> insert all OLE-Objects out of OLE-dialog into all doc-types
+'*
+'\******************************************************************************
+
+testcase tCheckTheOLEObjectDialog
+
+ qaerrorlog( "#i80670# The OLE retrieval routine is broken beyond repair, redesign required" )
+ goto endsub
+
+ Dim lListe (10) as String : Dim lListSoll (10) as String
+ Dim i, j as Integer
+ Dim iCount, sCount as Integer
+
+ call ClosePresentationfloat()
+ GetOLEDefaultNames()
+
+ for i=1 to 5
+
+ select case i
+ case 1 : gApplication = "WRITER"
+ case 2 : gApplication = "CALC"
+ case 3 : gApplication = "IMPRESS"
+ case 4 : gApplication = "DRAW"
+ case 5 : gApplication = "MASTERDOCUMENT"
+ end select
+
+ lListe ( 0 ) = 0 : lListSoll ( 0 ) = 0
+ printlog "check OLE-Object-Dialog for " + gApplication
+
+ Call hNewDocument
+
+ InsertObjectOLEObject
+
+ Kontext "OLEObjektEinfuegen"
+ if ( not OLEObjektEinfuegen.exists() ) then
+ warnlog( "cannot access the OLE object dialog" )
+ goto endsub
+ endif
+
+ NeuErstellen.Check
+ WaitSlot()
+
+ for j=1 to ObjektTyp.GetItemCount
+ ObjektTyp.Select j
+ ListAppend ( lListe(), ObjektTyp.GetSelText )
+ next j
+
+ ListSort ( lListe() )
+ iCount = ListCount ( lListe() )
+
+ select case gApplication
+ case "WRITER" : ListAppend ( lListSoll (), gOLECalc )
+ ListAppend ( lListSoll (), gOLEImpress )
+ ListAppend ( lListSoll (), gOLEDraw )
+ ListAppend ( lListSoll (), gOLEChart )
+ ListAppend ( lListSoll (), gOLEMath )
+ case "CALC" : ListAppend ( lListSoll (), gOLEWriter )
+ ListAppend ( lListSoll (), gOLEImpress )
+ ListAppend ( lListSoll (), gOLEDraw )
+ ListAppend ( lListSoll (), gOLEChart )
+ ListAppend ( lListSoll (), gOLEMath )
+ case "DRAW" : ListAppend ( lListSoll (), gOLECalc )
+ ListAppend ( lListSoll (), gOLEImpress )
+ ListAppend ( lListSoll (), gOLEWriter )
+ ListAppend ( lListSoll (), gOLEChart )
+ ListAppend ( lListSoll (), gOLEMath )
+ case "IMPRESS" : ListAppend ( lListSoll (), gOLECalc )
+ ListAppend ( lListSoll (), gOLEDraw )
+ ListAppend ( lListSoll (), gOLEWriter )
+ ListAppend ( lListSoll (), gOLEChart )
+ ListAppend ( lListSoll (), gOLEMath )
+ case "MASTERDOCUMENT" : ListAppend ( lListSoll (), gOLECalc )
+ ListAppend ( lListSoll (), gOLEImpress )
+ ListAppend ( lListSoll (), gOLEDraw )
+ ListAppend ( lListSoll (), gOLEChart )
+ ListAppend ( lListSoll (), gOLEMath )
+ end select
+
+ if ( gPlatgroup = "w95" ) then
+ ListAppend ( lListSoll (), gOLEOthers )
+ endif
+
+ ListSort ( lListSoll () )
+ sCount = ListCount ( lListSoll () )
+
+ if iCount <> sCount then
+ Warnlog "Expected: " + sCount + " Found: " + iCount
+ else
+ for j=1 to sCount
+ if lListe (j) <> lListSoll (j) then
+ Warnlog "Expected: '" + lListSoll (j) + "' Found: '" + lListe (j) +"'"
+ endif
+ next j
+ end if
+
+ OLEObjektEinfuegen.Cancel
+ hCloseDocument()
+ next i
+endcase
+
diff --git a/testautomation/framework/optional/includes/ole_3.inc b/testautomation/framework/optional/includes/ole_3.inc
new file mode 100644
index 000000000000..22cab57056f6
--- /dev/null
+++ b/testautomation/framework/optional/includes/ole_3.inc
@@ -0,0 +1,360 @@
+'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 :
+'*
+'\******************************************************************************
+
+testcase tDraw_As_OLE_Object()
+
+ call ClosePresentationfloat()
+ call hInsertOLEObject( true, gOLEDraw, "DRAW" )
+ 'call hInsertOLEObject( false, gOLEDraw, "DRAW" )
+
+endcase
+
+testcase tCalc_as_OLE_Object()
+
+ call ClosePresentationfloat()
+ call hInsertOLEObject( true, gOLECalc, "CALC" )
+ 'call hInsertOLEObject( false, gOLECalc, "CALC" )
+
+endcase
+
+testcase tImpress_As_OLE_Object()
+
+ call ClosePresentationfloat()
+ call hInsertOLEObject( true, gOLEImpress, "IMPRESS" )
+ 'call hInsertOLEObject( false, gOLEImpress, "IMPRESS" )
+
+endcase
+
+testcase tWriter_As_OLE_Object()
+
+ call ClosePresentationfloat()
+ call hInsertOLEObject( true, gOLEWriter, "WRITER" )
+ 'call hInsertOLEObject( false, gOLEWriter, "WRITER" )
+
+endcase
+
+testcase tMath_As_OLE_Object()
+
+ call ClosePresentationfloat()
+ call hInsertOLEObject( true, gOLEMath, "MATH" )
+ 'call hInsertOLEObject( false, gOLEMath, "MATH" )
+
+endcase
+
+testcase tChart_As_OLE_Object()
+
+ call ClosePresentationfloat()
+ call hInsertOLEObject( true, gOLEChart, "CHART" )
+ 'call hInsertOLEObject( false, gOLEChart, "CHART" )
+
+endcase
+
+'*******************************************************************************
+
+sub hInsertOLEObject( bRemoveFocus as boolean, cOLEObject as string, cOleType as string )
+
+ dim sFile as String
+ dim bOleAvailable as boolean
+
+
+
+
+
+ printlog( "" )
+ printlog( "Beginning testcase with options: " )
+ printlog( "* Remove focus...: " & bRemoveFocus )
+ printlog( "* OLE object name: " & cOLEObject )
+ printlog( "* OLE object type: " & cOLEType )
+ printlog( "* Document type..: " & gApplication )
+ printlog( "" )
+
+ ' We cannot insert an OLE object of same type as the current document
+ ' So writer/writer, calc/calc, masterdoc/writer is skipped ...
+ if ( gApplication = cOleType ) then
+ printlog( "Skipping " & cOleType & " as OLE object" )
+ goto testend
+ endif
+
+ if ( gApplication = "MASTERDOCUMENT" and cOleType = "WRITER" ) then
+ printlog( "Skipping " & cOleType & " as OLE object" )
+ goto testend
+ endif
+
+ hCreateDocument()
+
+ printlog( "Menu: insert / object / OLE object" )
+ InsertObjectOLEObject
+
+ Kontext "OLEObjektEinfuegen"
+ if ( OLEObjektEinfuegen.exists( 1 ) ) then
+
+ printlog( "Select 'create new'" )
+ NeuErstellen.Check()
+
+ printlog( "Select objecttype: " & cOLEObject )
+ ObjektTyp.Select( cOLEObject )
+
+ printlog( "Click OK" )
+ OLEObjektEinfuegen.OK()
+ WaitSlot( 3000 )
+ else
+ warnlog( "Insert OLE object dialog is missing, test ends" )
+ hDestroyDocument()
+ goto testend
+ endif
+
+ if ( bRemoveFocus ) then
+ printlog( "Remove focus from OLE object" )
+ call OLERemoveFocus()
+ else
+ printlog( "Focus is not to be removed from OLE object" )
+
+ ' The following can - in some cases - reproduce a nasty crash-bug when
+ ' saving files with selected/activated OLE object
+ select case gApplication
+ case "DRAW" : gMouseClick( 99 , 99 )
+ case "IMPRESS" : gMouseClick( 99 , 99 )
+ end select
+ endif
+
+ sFile = ConvertPath ( gOfficePath + "user\work\ole_" & cOleType )
+ printlog( "Save the file; File to be written (w/o extension): " & sFile )
+ if fileexists(sFile) then
+ kill(sFile)
+ qaerrorlog("killed file from former test run")
+ endif
+
+ hFileSaveAsKill( sFile )
+
+ printlog( "Close the document" )
+ hDestroyDocument()
+
+ printlog( "Reopen the file: " & sFile )
+ hFileOpen( sFile )
+
+ bOleAvailable = isOleAvailable()
+ if ( bOleAvailable ) then
+
+ call DisableNavigator()
+
+ call OLESetFocus()
+
+ call SendEscape()
+ else
+ qaErrorLog( "#i44725# OLE Object not saved in Master Document" )
+ endif
+
+ printlog( "Cleanup: Close the document" )
+ hDestroyDocument()
+
+ printlog( "Cleanup: Delete the workfile" )
+ hDeleteFile( sFile )
+
+ ' We end up here when the test has been skipped or aborted
+ testend:
+
+end sub
+
+'*******************************************************************************
+
+function isOleAvailable() as boolean
+
+ dim i as integer
+ dim a as integer
+
+ const CFN = "isOleAvailable::"
+
+ printlog( CFN & "Testing whether OLE object is present in Navigator" )
+' qaerrorlog( CFN & "Replace me i'm old, poorly written and undocumented" )
+
+ isOleAvailable = FALSE
+ ' check if OLE-Objects are in the document with the navigator
+ kontext "NavigatorGlobaldoc"
+ if NavigatorGlobaldoc.exists( 1 ) then
+ printlog CFN & "Navigator globaldoc is available"
+ if NOT AuswahlListe.exists then
+ Umschalten.click
+ endif
+ a = AuswahlListe.getItemCount
+ ' somehow not all items might be displayed
+ if NOT (a>2) then
+ inhaltsansicht.click
+ i = AuswahlListe.getItemCount
+ if NOT(i>a) then
+ inhaltsansicht.click
+ else
+ a = i
+ endif
+ endif
+ AuswahlListe.typeKeys("<home>")
+ 'fold everything
+ for i = 1 to a
+ AuswahlListe.typeKeys("-<down>")
+ next i
+ ' unfold everything, until there is something to unfold
+ ' then we found the object we looked for: OLE
+ AuswahlListe.typeKeys("<home>")
+ i = 0
+ a = AuswahlListe.getItemCount
+ ' don't run indefinite
+ while ((AuswahlListe.getItemCount = a) AND (i < a))
+ AuswahlListe.typeKeys("+<down>")
+ inc(i)
+ wend
+ try
+ printlog CFN & AuswahlListe.getSelText
+ catch
+ qaerrorlog CFN & "no item in navigator is selected"
+ endcatch
+ ' activate object
+ AuswahlListe.typeKeys("<return>")
+ i = AuswahlListe.getItemCount
+ printlog CFN & i
+ if (i > a) then
+ isOleAvailable = TRUE
+ else
+ isOleAvailable = FALSE
+ endif
+ else
+ Kontext "NavigatorWriter"
+ if NOT NavigatorWriter.exists( 1 ) then
+ ViewNavigator
+ endif
+ Kontext "NavigatorWriter"
+ if NavigatorWriter.exists( 2 ) then ' was 5 secs
+ printlog CFN & "Navigator writer was available"
+ if NOT AuswahlListe.exists then
+ Umschalten.click
+ Sleep( 5 )
+ endif
+ a = AuswahlListe.getItemCount
+ ' somehow not all items might be displayed
+ if a=0 then
+ Sleep( 5 )
+ a = AuswahlListe.getItemCount
+ endif
+ if NOT (a>2) then
+ inhaltsansicht.click
+ Sleep( 3 )
+ i = AuswahlListe.getItemCount
+ if NOT(i>a) then
+ qaerrorlog "failed"
+ else
+ a = i
+ endif
+ endif
+ AuswahlListe.typeKeys("<home>")
+ 'fold everything
+ for i = 1 to a
+ AuswahlListe.typeKeys("-<down>")
+ next i
+ ' unfold everything, until there is something to unfold
+ ' then we found the object we looked for: OLE
+ AuswahlListe.typeKeys("<home>")
+ i = 0
+ a = AuswahlListe.getItemCount
+ ' don't run indefinite
+ while ((AuswahlListe.getItemCount = a) AND (i < a))
+ AuswahlListe.typeKeys("+<down>")
+ inc(i)
+ wend
+ try
+ printlog CFN & AuswahlListe.getSelText
+ catch
+ qaerrorlog CFN & "no item in navigator is selected"
+ endcatch
+ i = AuswahlListe.getItemCount
+ ' activate object
+ AuswahlListe.typeKeys("<return>")
+ if (i > a) then
+ isOleAvailable = TRUE
+ else
+ isOleAvailable = FALSE
+ endif
+ else
+ kontext "NavigatorDraw"
+ if NavigatorDraw.exists( 2 ) then ' was 5 secs
+ printlog CFN & "Navigator draw is available"
+ else
+ ViewNavigator
+ endif
+ kontext "NavigatorDraw"
+ if NavigatorDraw.exists( 2 ) then ' was 5 secs
+ printlog CFN & "Navigator draw is available."
+ if NOT Liste.exists then
+ Umschalten.click
+ endif
+ Liste.typeKeys("<home>")
+ 'fold everything
+ a = Liste.getItemCount
+ for i = 1 to a
+ Liste.typeKeys("-<down>")
+ next i
+ ' unfold everything, until there is something to unfold
+ ' then we found the object we looked for: OLE
+ Liste.typeKeys("<home>")
+ i = 0
+ a = Liste.getItemCount
+ ' don't run indefinite
+ while ((Liste.getItemCount = a) AND (i < a))
+ Liste.typeKeys("+<down>")
+ inc(i)
+ wend
+ try
+ printlog CFN & Liste.getSelText
+ catch
+ qaerrorlog CFN & "no item in navigator is selected"
+ endcatch
+ i = Liste.getItemCount
+ if (i > a) then
+ isOleAvailable = TRUE
+ else
+ isOleAvailable = FALSE
+ endif
+ else
+ ' no globaldoc
+ ' check if something is selected
+ try
+ EditCopy
+ printlog CFN & "Something was selected; executed Edit->Copy"
+ isOleAvailable = TRUE
+ catch
+ qaErrorLog CFN & "Nothing is selected."
+ isOleAvailable = FALSE
+ endcatch
+ endif
+ endif
+ endif
+
+end function
+
diff --git a/testautomation/framework/optional/includes/ole_tools.inc b/testautomation/framework/optional/includes/ole_tools.inc
new file mode 100644
index 000000000000..0428f758cb3d
--- /dev/null
+++ b/testautomation/framework/optional/includes/ole_tools.inc
@@ -0,0 +1,462 @@
+'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 : global-level-1-test -> insert all OLE-Objects out of OLE-dialog into all doc-types
+'*
+'\******************************************************************************
+
+sub hReopenDoc
+ 'Only for bughandling if closing an OLE object fails
+ Warnlog "Cannot release Chart Object -> #107005#?"
+ hCloseDocument()
+ 'if Active.Exists ( 1 ) then Active.TypeKeys "<RIGHT><ENTER>"
+ hNewDocument()
+end sub
+
+'*******************************************************************************
+
+sub hOleSelektieren ( xStart%, yStart%, xEnde%, yEnde% )
+ WL_TB_ZF_Auswahl
+ select case gApplication
+ case "CALC" :Kontext "DocumentCalc"
+ DocumentCalc.MouseDown xStart%, yStart%
+ DocumentCalc.MouseMove xEnde%, yEnde%
+ DocumentCalc.MouseUp xEnde%, yEnde%
+ wait 200
+ case "DRAW" :Kontext "DocumentDraw"
+ DocumentDraw.MouseDown xStart%, yStart%
+ DocumentDraw.MouseMove xEnde%, yEnde%
+ DocumentDraw.MouseUp xEnde%, yEnde%
+ case "WRITER" :Kontext "DocumentWriter"
+ DocumentWriter.MouseDown xStart%, yStart%
+ DocumentWriter.MouseMove xEnde%, yEnde%
+ DocumentWriter.MouseUp xEnde%, yEnde%
+ case "IMPRESS" :Kontext "DocumentImpress"
+ DocumentImpress.MouseDown xStart%, yStart%
+ DocumentImpress.MouseMove xEnde%, yEnde%
+ DocumentImpress.MouseUp xEnde%, yEnde%
+ case "MATH" :Kontext "DocumentMath"
+ DocumentMath.MouseDown xStart%, yStart%
+ DocumentMath.MouseMove xEnde%, yEnde%
+ DocumentMath.MouseUp xEnde%, yEnde%
+ case "MASTERDOCUMENT":Kontext "DocumentMasterDoc"
+ DocumentMasterDoc.MouseDown xStart%, yStart%
+ DocumentMasterDoc.MouseMove xEnde%, yEnde%
+ DocumentMasterDoc.MouseUp xEnde%, yEnde%
+ end select
+end sub
+
+'*******************************************************************************
+
+sub hSetToStandardView ( DieApp$ )
+ select case DieApp$
+ case "WRITER"
+ gApplication = "WRITER"
+ Call hNewDocument
+ Kontext "DocumentWriter"
+ case "MASTERDOCUMENT"
+ gApplication = "MASTERDOCUMENT"
+ Call hNewDocument
+ Kontext "DocumentMasterDoc"
+ end select
+ ViewZoom
+ Kontext "Massstab"
+ Optimal.Check
+ Massstab.ok()
+ Call hCloseDocument
+end sub
+
+'*******************************************************************************
+
+sub SendEscape(optional iTimes as Integer)
+ dim i as Integer
+ const ICWAIT as Integer = 1
+
+ if IsMissing( iTimes ) then
+ iTimes = 1
+ endif
+ printlog( " - send <ESCAPE> keystroke to document" )
+ select case gApplication
+ case "WRITER"
+ Kontext "DocumentWriter"
+ for i = 1 to iTimes
+ sleep( ICWAIT )
+ DocumentWriter.TypeKeys( "<ESCAPE>" , 1 , TRUE )
+ next i
+ case "CALC"
+ Kontext "DocumentCalc"
+ for i = 1 to iTimes
+ sleep( ICWAIT )
+ DocumentCalc.TypeKeys( "<ESCAPE>" , 1 , TRUE )
+ next i
+ case "MASTERDOCUMENT"
+ Kontext "DocumentMasterDoc"
+ for i = 1 to iTimes
+ sleep( ICWAIT )
+ DocumentMasterDoc.TypeKeys( "<ESCAPE>" , 1 , TRUE )
+ next i
+ case "DRAW"
+ Kontext "DocumentDraw"
+ for i = 1 to iTimes
+ sleep( ICWAIT )
+ DocumentDraw.TypeKeys( "<ESCAPE>" , 1 , TRUE )
+ next i
+ case "IMPRESS"
+ Kontext "DocumentImpress"
+ for i = 1 to iTimes
+ sleep( ICWAIT )
+ DocumentImpress.TypeKeys( "<ESCAPE>" , 1 , TRUE )
+ next i
+ case else
+ warnlog( "Invalid gApplication: " & gApplication )
+ end select
+end sub
+
+'*******************************************************************************
+
+sub DisableNavigator()
+ printlog( " - disable the navigator in globaldoc/writer" )
+ select case gApplication
+ case "MASTERDOCUMENT" : Kontext "NavigatorGlobalDoc"
+ if NavigatorGlobalDoc.Exists() then
+ ViewNavigator
+ endif
+ case "WRITER" : Kontext "NavigatorWriter"
+ if NavigatorWriter.Exists() then
+ ViewNavigator
+ endif
+ end select
+ sleep( 1)
+end sub
+
+'*******************************************************************************
+
+sub UncheckAutoFileExtension()
+ Kontext "SpeichernDlg"
+ if SpeichernDlg.exists(5) then
+ if AutomatischeDateinamenserweiterung.Exists() then
+ printlog("l1_ole_tools::UncheckAutoFileExtension - unchecking automatic file extension" )
+ If AutomatischeDateinamenserweiterung.IsChecked() then
+ AutomatischeDateinamenserweiterung.Uncheck()
+ endif
+ else
+ QAErrorLog ( "OBSOLETE: l1_ole_tools::UncheckAutoFileExtension Checkbox 'Automatic Filename Extension' unavailable" )
+ endif
+ else
+ warnlog( "l1_ole_tools::UncheckAutoFileExtension SaveAs Dialog not open." )
+ endif
+end sub
+
+'*******************************************************************************
+
+function getExtension( optional sExtension as string ) as string
+ qaerrorlog( "getExtension is outdated. Use hGetSuffix( ... ) instead" )
+ printlog("l1_ole_ttols::getExtension:: - define the expected file extension" )
+ select case gApplication
+ case "WRITER"
+ sExtension = ".sxw"
+ case "DRAW"
+ sExtension = ".sxd"
+ case "IMPRESS"
+ sExtension = ".sxi"
+ case "CALC"
+ sExtension = ".sxc"
+ case "MATH"
+ sExtension = ".sxm"
+ case "MASTERDOCUMENT"
+ sExtension = ".sgl"
+ case else
+ warnlog( "Invalid gApplication: " & gApplication )
+ end select
+ getExtension = sExtension
+end function
+
+'*******************************************************************************
+
+sub OLESetFocus()
+ const ICWAIT as Integer = 10
+ PrintLog " - set focus to OLE object (edit mode)"
+ select case gApplication
+ case "WRITER"
+ printlog " Select and deselect " + gApplication
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys("<F6>" , 4 , TRUE )
+ DocumentWriter.TypeKeys("<DOWN>" , 3 , TRUE )
+ DocumentWriter.TypeKeys("<RIGHT>" , 1 , TRUE )
+ DocumentWriter.TypeKeys("<MOD1 RETURN>" , 1 , TRUE )
+ DocumentWriter.TypeKeys("<TAB>" , 1 , TRUE )
+ DocumentWriter.TypeKeys("<RETURN>" , 1 , TRUE )
+ 'DocumentWriter.MouseDoubleClick ( 50, 50 )
+ sleep( ICWAIT )
+ call SendEscape( 3 ) '(to close the float as well)
+ case "IMPRESS"
+ printlog " Select and deselect " + gApplication
+ Kontext "DocumentImpress"
+ DocumentImpress.MouseDoubleClick ( 50, 50 )
+ sleep( ICWAIT )
+ case "CALC"
+ printlog " Select and deselect " + gApplication
+ Kontext "DocumentCalc"
+ DocumentCalc.TypeKeys( "<F6>" , 5 , TRUE )
+ DocumentCalc.TypeKeys( "<DOWN>" , 3 , TRUE )
+ DocumentCalc.TypeKeys( "<MOD1 RETURN>" , 1 , TRUE )
+ DocumentCalc.TypeKeys( "<RETURN>" , 1 , TRUE )
+ 'gMouseClick ( 20, 20 )
+ 'DocumentCalc.MouseDoubleClick ( 20, 20 )
+ sleep( ICWAIT )
+ call SendEscape( 3 ) '(to close the float as well)
+ case "MASTERDOCUMENT"
+ printlog " Select and deselect " + gApplication
+ Kontext "DocumentMasterDoc"
+ DocumentMasterDoc.MouseDown( 50 , 50 , 1 )
+ DocumentMasterDoc.MouseUp( 50 , 50 , 1 )
+ hUseAsyncSlot( "EditObjectEdit" )
+ sleep( ICWAIT )
+ case else
+ warnlog( "Invalid gApplication: " & gApplication )
+
+ end select
+end sub
+
+'*******************************************************************************
+
+sub OLESetFocus2()
+ 'default waitstate
+ const ICWAIT as Integer = 1
+ PrintLog " - set focus to OLE object (edit mode)"
+ select case gApplication
+ case "WRITER"
+ Kontext "DocumentWriter"
+ try
+ FormatObject
+ Kontext ' This is by intention, do not change!
+ active.SetPage TabType
+ Kontext "TabType"
+ TabType.Cancel()
+ hUseAsyncSlot( "EditObjectEdit" )
+ catch
+ warnlog "Can't activate object"
+ endcatch
+ sleep( ICWAIT * 2 )
+ gMouseClick ( 5 , 5 ) 'out of edit mode
+ gMouseClick ( 5 , 5 ) 'remove focus
+ case "DRAW"
+ Kontext "DocumentDraw"
+ if OLEApp = "MATH" then
+ DocumentDraw.MouseDoubleClick ( 45, 46 )
+ else
+ DocumentDraw.MouseDoubleClick ( 50, 45 )
+ end if
+ sleep( ICWAIT * 5 )
+ gMouseClick ( 1 , 1 )
+ case "IMPRESS"
+ Kontext "DocumentImpress"
+ printlog( " - using accessibility shortcuts for objecthandling" )
+ printlog( " (select, activate and release object)" )
+ DocumentImpress.TypeKeys( "<F6>" , 5 , TRUE )
+ DocumentImpress.TypeKeys( "<TAB><RETURN>" )
+ sleep( ICWAIT * 2 )
+ call SendEscape()
+ case "CALC"
+ Kontext "DocumentCalc"
+ printlog( " - using accessibility shortcuts for objecthandling" )
+ printlog( " (select, activate and release object)" )
+ DocumentCalc.TypeKeys( "<F6>" , 5 , TRUE )
+ DocumentCalc.TypeKeys( "<DOWN>" , 3 , TRUE )
+ DocumentCalc.TypeKeys( "<RIGHT>" , 1 , TRUE )
+ DocumentCalc.TypeKeys( "<MOD1 RETURN>" , 1 , TRUE )
+ DocumentCalc.TypeKeys( "<RETURN>" , 1 , TRUE )
+ sleep( ICWAIT * 2 )
+ call sendEscape()
+ case "MASTERDOCUMENT"
+ Kontext "DocumentMasterDoc"
+ try
+ FormatObject
+ sleep( ICWAIT )
+ Kontext ' This is by intention, do not change!
+ Active.SetPage TabType
+ Kontext "TabType"
+ TabType.Cancel
+ hUseAsyncSlot( "EditObjectEdit" )
+ catch
+ qaerrorlog( "The object is not selected after reload." )
+ endcatch
+ Sleep( ICWAIT )
+ Kontext "DocumentMasterDoc"
+ DocumentMasterDoc.MouseDoubleClick ( 1 , 1 )
+ case else
+ warnlog( "Invalid gApplication: " & gApplication )
+
+ end select
+end sub
+
+'*******************************************************************************
+
+sub OLESetFocus3()
+ 'TODO: Get rid of as many mousemovements as possible
+ 'default waitstate
+ const ICWAIT as Integer = 1
+ printlog( " - set focus to OLE object (edit mode)" )
+ select case gApplication
+ case "WRITER"
+ Kontext "DocumentWriter"
+ try
+ FormatObject
+ sleep( ICWAIT )
+ Kontext ' This is by intention, do not change!
+ active.SetPage TabType
+ Kontext "TabType"
+ TabType.Cancel
+ hUseAsyncSlot( "EditObjectEdit" )
+ catch
+ warnlog "Can't activate object"
+ endcatch
+ sleep( ICWAIT * 5 )
+ gMouseClick ( 1, 1 )
+ case "DRAW"
+ Kontext "DocumentDraw"
+ DocumentDraw.TypeKeys ("<Tab>")
+ DocumentDraw.MouseDoubleClick ( 50, 50 )
+ sleep( ICWAIT * 5 )
+ gMouseClick ( 1, 1 )
+ case "IMPRESS"
+ Kontext "DocumentImpress"
+ printlog( " - Using accessibility-shortcuts to manipulate object")
+ DocumentImpress.TypeKeys( "<TAB>" )
+ sleep( ICWAIT )
+ DocumentImpress.TypeKeys( "<SHIFT RETURN>" )
+ call SendEscape( 3 )
+ case "MASTERDOCUMENT"
+ Kontext "DocumentMasterDoc"
+ try
+ FormatObject
+ sleep( ICWAIT )
+ Kontext ' This is by intention, do not change!
+ active.SetPage( TabType )
+ Kontext "TabType"
+ TabType.Cancel()
+ hUseAsyncSlot( "EditObjectEdit" )
+ catch
+ qaerrorlog( "The object is not selected after reload." )
+ endcatch
+ sleep( ICWAIT * 5 )
+ call SendEscape( 2 )
+ case else
+ warnlog( "Invalid gApplication: " & gApplication )
+
+ end select
+end sub
+
+'*******************************************************************************
+
+sub OLERemoveFocus
+ printlog( "Remove focus from OLE object for " & gApplication )
+ select case gApplication
+ case "WRITER" : call SendEscape( 2 )
+ case "MASTERDOCUMENT" : Kontext "DocumentMasterDoc"
+ DocumentMasterDoc.MouseDoubleClick ( 1, 1 )
+ case "IMPRESS" : gMouseClick ( 5, 99 )
+ case "CALC" : Kontext "DocumentCalc"
+ call SendEscape()
+ end select
+end sub
+
+'*******************************************************************************
+
+sub ClosePresentationFloat()
+ gApplication = "IMPRESS"
+ printlog( "Open a new document" )
+ hNewDocument
+ 'use the tiny little hammer to kill the presentation float
+ printlog( "Reset the application (which closes the presentation toolbar)" )
+ resetapplication
+ printlog( "Open a new document" )
+ hNewDocument
+ Kontext "CommonTaskbar"
+ try
+ printlog( "Try to click a button on the presentation toolbar" )
+ Seiteduplizieren.click()
+ warnlog( "The presentation toolbar is open" )
+ catch
+ printlog( "Button is unavailable. Good" )
+ endcatch
+ printlog( "Close the document" )
+ hCloseDocument
+ gApplication = "WRITER" ' reset, just in case...
+end sub
+
+
+'*******************************************************************************
+
+function hStepThroughChartWizard() as boolean
+
+
+
+
+
+
+ const CFN = "hStepThroughChartWizard::"
+ printlog( CFN & "Enter" )
+ dim brc as boolean 'a multi purpose boolean returnvalue
+
+ Kontext "ChartWizard"
+ if ( not chartWizard.exists( 1 ) ) then
+
+ warnlog( CFN & "Chart Wizard not open within reasonable time" )
+ hStepThroughChartWizard() = false
+
+ else
+
+ Kontext "ChartWizard"
+ GoNext.Click()
+
+ Kontext "ChartWizard"
+ GoNext.Click()
+
+ Kontext "ChartWizard"
+ GoNext.Click()
+
+ Kontext "ChartWizard"
+ ChartWizard.ok()
+ Sleep( 3 )
+
+ endif
+
+ kontext "ChartWizard"
+ if ( ChartWizard.exists( 1 ) ) then
+ warnlog( CFN & "Chart Wizard is still open" )
+ endif
+
+
+ printlog( CFN & "Exit" )
+
+ hStepThroughChartWizard() = true
+
+end function
+
diff --git a/testautomation/framework/optional/includes/options_asia.inc b/testautomation/framework/optional/includes/options_asia.inc
new file mode 100644
index 000000000000..730d5a0e666f
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_asia.inc
@@ -0,0 +1,641 @@
+'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 : functionality test for language/settings
+'*
+'\*****************************************************************
+
+testcase func_LanguageSettings_Language
+ Dim bSave as Boolean
+
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "Languages" )
+ bSave = Aktivieren.IsChecked
+ Printlog "asian support = TRUE"
+ if Aktivieren.isEnabled then
+ Aktivieren.unCheck
+ else
+ qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'")
+ printlog Aktivieren.isEnabled
+ endif
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ hTestAsianForWriter ( TRUE )
+ hTestAsianForCalc ( TRUE )
+ hTestAsianForImpress ( TRUE )
+ hTestAsianForDraw ( TRUE )
+
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "Languages" )
+ Printlog Chr(13) + "asian support = FALSE"
+ Aktivieren.Uncheck
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ hTestAsianForWriter ( FALSE )
+ hTestAsianForCalc ( FALSE )
+ hTestAsianForImpress ( FALSE )
+ hTestAsianForDraw ( FALSE )
+
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "Languages" )
+ Printlog Chr(13) + "asian support = TRUE"
+ if Aktivieren.isEnabled then
+ Aktivieren.unCheck
+ else
+ qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'")
+ printlog Aktivieren.isEnabled
+ endif
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ hTestAsianForWriter ( TRUE )
+ hTestAsianForCalc ( TRUE )
+ hTestAsianForImpress ( TRUE )
+ hTestAsianForDraw ( TRUE )
+
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "Languages" )
+ if bSave = TRUE then Aktivieren.Check else Aktivieren.UnCheck
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+endcase
+
+' *********************************************
+' **
+' **
+sub hTestAsianForWriter ( bAsianTrue as Boolean )
+ Dim iTabCounter as Integer
+
+ gApplication = "WRITER"
+ hNewDocument
+ Printlog "- test in writer"
+
+ FormatCharacter
+
+ if bAsianTrue = TRUE then
+ Kontext
+ iTabCounter = active.GetPageCount
+ if iTabCounter <> 6 then Warnlog "There are not 6 pages on the dialog, there are " + iTabCounter + "!"
+ else
+ Kontext
+ iTabCounter = active.GetPageCount
+ if iTabCounter <> 5 then Warnlog "There are not 5 pages on the dialog, there are " + iTabCounter + "!"
+ end if
+
+ printlog " - check tab-dialog for FormatCharacter"
+ Kontext
+ active.SetPage TabFont
+ Kontext "TabFont"
+ if bAsianTrue = TRUE then
+ if FontWest.Exists then
+ if FontWest.IsVisible = FALSE then Warnlog "'Western Font' is not visible!"
+ else
+ Warnlog "'Western Font' does not exists!"
+ end if
+ if StyleWest.Exists then
+ if StyleWest.IsVisible = FALSE then Warnlog "'Western Style' is not visible!"
+ else
+ Warnlog "'Western Style' does not exists!"
+ end if
+ if SizeWest.Exists then
+ if SizeWest.IsVisible = FALSE then Warnlog "'Western Size' is not visible!"
+ else
+ Warnlog "'Western Size' does not exists!"
+ end if
+ if LanguageWest.Exists then
+ if LanguageWest.IsVisible = FALSE then Warnlog "'Western Language' is not visible!"
+ else
+ Warnlog "'Western Language' does not exists=> Bug!"
+ end if
+ if FontEast.Exists then
+ if FontEast.IsVisible = FALSE then Warnlog "'Eastern Font' is not visible!"
+ else
+ Warnlog "'Eastern Font' does not exists!"
+ end if
+ if StyleEast.Exists then
+ if StyleEast.IsVisible = FALSE then Warnlog "'Eastern Style' is not visible!"
+ else
+ Warnlog "'Eastern Style' does not exists!"
+ end if
+ if SizeEast.Exists then
+ if SizeEast.IsVisible = FALSE then Warnlog "'Eastern Size' is not visible!"
+ else
+ Warnlog "'Eastern Size' does not exists!"
+ end if
+ if LanguageEast.Exists then
+ if LanguageEast.IsVisible = FALSE then Warnlog "'Eastern Language' is not visible!"
+ else
+ Warnlog "'Eastern Language' does not exists!"
+ end if
+ else
+ if FontEast.Exists then
+ if FontEast.IsVisible then Warnlog "'Eastern Font' is visible!"
+ end if
+ if StyleEast.Exists then
+ if StyleEast.IsVisible then Warnlog "'Eastern Style' is visible!"
+ end if
+ if SizeEast.Exists then
+ if SizeEast.IsVisible then Warnlog "'Eastern Size' is visible!"
+ end if
+ if LanguageEast.Exists then
+ if LanguageEast.IsVisible then Warnlog "'Eastern Language' is visible!"
+ end if
+ if FontWest.Exists then
+ if FontWest.IsVisible then Warnlog "'Eastern Font' is visible!"
+ end if
+ if StyleWest.Exists then
+ if StyleWest.IsVisible then Warnlog "'Eastern Style' is visible!"
+ end if
+ if SizeWest.Exists then
+ if SizeWest.IsVisible then Warnlog "'Eastern Size' is visible!"
+ end if
+ if LanguageWest.Exists then
+ if LanguageWest.IsVisible then Warnlog "'Eastern Language' is visible!"
+ end if
+ end if
+
+ Kontext
+ active.SetPage TabFontEffects
+ Kontext "TabFontEffects"
+ if bAsianTrue = TRUE then
+ if Emphasis.Exists then
+ if Emphasis.IsVisible = FALSE then
+ Warnlog "'Emphasis mark' is not visible!"
+ else
+ Emphasis.Select 2
+ end if
+ else
+ Warnlog "'Emphasis mark' does not exists!"
+ end if
+ if Position.Exists then
+ if Position.IsVisible = FALSE then Warnlog "'Position' is not visible!"
+ else
+ Warnlog "'Position' does not exists!"
+ end if
+ else
+ if Emphasis.Exists then
+ if Emphasis.IsVisible then Warnlog "'Emphasis mark' is visible!"
+ end if
+ if Position.Exists then
+ if Position.IsVisible then Warnlog "'Position' is visible!"
+ end if
+ end if
+
+ Kontext
+ Active.SetPage TabFontPosition
+
+ if bAsianTrue = TRUE then
+ try
+ Kontext
+ Active.SetPage TabAsianLayout
+ catch
+ Warnlog "The tabpage 'Asian Layout' does not exists!"
+ endcatch
+ else
+ try
+ Kontext
+ Active.SetPage TabAsianLayout
+ Warnlog "The tabpage 'Asian Layout' exists!"
+ catch
+ endcatch
+ end if
+
+ Kontext
+ active.SetPage TabHyperlinkZeichen
+
+ Kontext
+ active.SetPage TabHintergrund
+ kontext "TabHintergrund"
+ TabHintergrund.Close
+
+ printlog " - check ruby-dialog"
+ if bAsianTrue = TRUE then
+ try
+ FormatRuby
+ Kontext "RubyDialog"
+ RubyDialog.Close
+ catch
+ Warnlog "Ruby-Dialog can't be opened!"
+ endcatch
+ else
+ try
+ FormatRuby
+ Kontext "RubyDialog"
+ RubyDialog.Close
+ Warnlog "Ruby-Dialog can be opened!"
+ catch
+ endcatch
+ end if
+
+ printlog " - check menu items for format/change case"
+ if bAsianTrue = TRUE then
+ try
+ FormatChangeCaseHalfWidth
+ Wait 500
+ catch
+ Warnlog "Format/Case/Half width is not active!"
+ endcatch
+
+ try
+ FormatChangeCaseFullWidth
+ Wait 500
+ catch
+ Warnlog "Format/Case/Full width is not active!"
+ endcatch
+
+ try
+ FormatChangeCaseHiragana
+ Wait 500
+ catch
+ Warnlog "Format/Case/Hiragana is not active!"
+ endcatch
+
+ try
+ FormatChangeCaseKatagana
+ Wait 500
+ catch
+ Warnlog "Format/Case/Katagana is not active!"
+ endcatch
+ else
+ try
+ FormatChangeCaseHalfWidth
+ Wait 500
+ Warnlog "Format/Case/Half width is active!"
+ catch
+ endcatch
+
+ try
+ FormatChangeCaseFullWidth
+ Wait 500
+ Warnlog "Format/Case/Full width is active!"
+ catch
+ endcatch
+
+ try
+ FormatChangeCaseHiragana
+ Wait 500
+ Warnlog "Format/Case/Hiragana is active!"
+ catch
+ endcatch
+
+ try
+ FormatChangeCaseKatagana
+ Wait 500
+ Warnlog "Format/Case/Katagana is active!"
+ catch
+ endcatch
+ end if
+
+ printlog " - check find&replace-dialog"
+ EditSearchAndReplace
+ Kontext "SuchenUndErsetzenWriter"
+ if bAsianTrue = TRUE then
+ if HalbNormalbreiteFormen.Exists then
+ if HalbNormalbreiteFormen.IsVisible = FALSE then Warnlog "'Match half-/full-width forms' is not visible!"
+ else
+ Warnlog "'Match half-/full-width forms' does not exists!"
+ end if
+ if AehnlicheSchreibweise.Exists then
+ if AehnlicheSchreibweise.IsVisible = FALSE then
+ Warnlog "'Sounds like (Japanese)' is not visible!"
+ else
+ AehnlicheSchreibweise.Check
+ end if
+ else
+ Warnlog "'Sounds like (Japanese)' does not exists!"
+ end if
+ if AehnlicheSchreibweiseOptionen.Exists then
+ if AehnlicheSchreibweiseOptionen.IsVisible = FALSE then Warnlog "'Options for 'Sounds like' is not visible!"
+ else
+ Warnlog "'Options for 'Sounds like' does not exists!"
+ end if
+ else
+ if HalbNormalbreiteFormen.Exists then
+ if HalbNormalbreiteFormen.IsVisible then Warnlog "'Match half-/full-width forms' is visible!"
+ end if
+ if AehnlicheSchreibweise.Exists then
+ if AehnlicheSchreibweise.IsVisible then Warnlog "'Sounds like (Japanese)' is visible!"
+ end if
+ if AehnlicheSchreibweiseOptionen.Exists then
+ if AehnlicheSchreibweiseOptionen.IsVisible then Warnlog "'Options for 'Sounds like' is visible!"
+ end if
+ end if
+ SuchenUndErsetzenWriter.Close
+
+ Call hCloseDocument
+
+end sub
+
+' *********************************************
+' **
+' **
+sub hTestAsianForCalc ( bAsianTrue as Boolean )
+ Dim iTabCounter as Integer
+
+ Printlog "- test in calc"
+ gApplication = "CALC"
+ hNewDocument
+
+ FormatCells
+
+ if bAsianTrue = TRUE then
+ Kontext
+ iTabCounter = active.GetPageCount
+ if iTabCounter <> 8 then Warnlog "There are not 8 pages on the dialog, there are " + iTabCounter + "!"
+ else
+ Kontext
+ iTabCounter = active.GetPageCount
+ if iTabCounter <> 7 then Warnlog "There are not 7 pages on the dialog, there are " + iTabCounter + "!"
+ end if
+
+ printlog " - check tab-dialog for Format/Cell"
+ Kontext
+ active.SetPage TabZahlen
+
+ Kontext
+ active.SetPage TabFont
+ Kontext "TabFont"
+ if bAsianTrue = TRUE then
+ if FontWest.Exists then
+ if FontWest.IsVisible = FALSE then Warnlog "'Western Font' is not visible!"
+ else
+ Warnlog "'Western Font' does not exists!"
+ end if
+ if StyleWest.Exists then
+ if StyleWest.IsVisible = FALSE then Warnlog "'Western Style' is not visible!"
+ else
+ Warnlog "'Western Style' does not exists!"
+ end if
+ if SizeWest.Exists then
+ if SizeWest.IsVisible = FALSE then Warnlog "'Western Size' is not visible!"
+ else
+ Warnlog "'Western Size' does not exists!"
+ end if
+ if LanguageWest.Exists then
+ if LanguageWest.IsVisible = FALSE then Warnlog "'Western Language' is not visible!"
+ else
+ Warnlog "'Western Language' does not exists=> Bug!"
+ end if
+ if FontEast.Exists then
+ if FontEast.IsVisible = FALSE then Warnlog "'Eastern Font' is not visible!"
+ else
+ Warnlog "'Eastern Font' does not exists!"
+ end if
+ if StyleEast.Exists then
+ if StyleEast.IsVisible = FALSE then Warnlog "'Eastern Style' is not visible!"
+ else
+ Warnlog "'Eastern Style' does not exists!"
+ end if
+ if SizeEast.Exists then
+ if SizeEast.IsVisible = FALSE then Warnlog "'Eastern Size' is not visible!"
+ else
+ Warnlog "'Eastern Size' does not exists!"
+ end if
+ if LanguageEast.Exists then
+ if LanguageEast.IsVisible = FALSE then Warnlog "'Eastern Language' is not visible!"
+ else
+ Warnlog "'Eastern Language' does not exists!"
+ end if
+ else
+ if FontEast.Exists then
+ if FontEast.IsVisible then Warnlog "'Eastern Font' is visible!"
+ end if
+ if StyleEast.Exists then
+ if StyleEast.IsVisible then Warnlog "'Eastern Style' is visible!"
+ end if
+ if SizeEast.Exists then
+ if SizeEast.IsVisible then Warnlog "'Eastern Size' is visible!"
+ end if
+ if LanguageEast.Exists then
+ if LanguageEast.IsVisible then Warnlog "'Eastern Language' is visible!"
+ end if
+ if FontWest.Exists then
+ if FontWest.IsVisible then Warnlog "'Eastern Font' is visible!"
+ end if
+ if StyleWest.Exists then
+ if StyleWest.IsVisible then Warnlog "'Eastern Style' is visible!"
+ end if
+ if SizeWest.Exists then
+ if SizeWest.IsVisible then Warnlog "'Eastern Size' is visible!"
+ end if
+ if LanguageWest.Exists then
+ if LanguageWest.IsVisible then Warnlog "'Eastern Language' is visible!"
+ end if
+ end if
+
+ Kontext
+ active.SetPage TabFontEffects
+ Kontext "TabFontEffects"
+ if bAsianTrue = TRUE then
+ if Emphasis.Exists then
+ if Emphasis.IsVisible = FALSE then
+ Warnlog "'Emphasis mark' is not visible!"
+ else
+ Emphasis.Select 2
+ end if
+ else
+ Warnlog "'Emphasis mark' does not exists!"
+ end if
+ if Position.Exists then
+ if Position.IsVisible = FALSE then Warnlog "'Position' is not visible!"
+ else
+ Warnlog "'Position' does not exists!"
+ end if
+ else
+ if Emphasis.Exists then
+ if Emphasis.IsVisible then Warnlog "'Emphasis mark' is visible!"
+ end if
+ if Position.Exists then
+ if Position.IsVisible then Warnlog "'Position' is visible!"
+ end if
+ end if
+
+ if bAsianTrue = TRUE then
+ try
+ Kontext
+ Active.SetPage TabAsianTypography
+ catch
+ Warnlog "The tabpage 'Asian Typography' does not exists!"
+ endcatch
+ else
+ try
+ Kontext
+ Active.SetPage TabAsianTypography
+ Warnlog "The tabpage 'Asian Typography' exists!"
+ catch
+ endcatch
+ end if
+
+ Kontext
+ active.SetPage TabAusrichtung
+
+ Kontext
+ active.SetPage TabUmrandung
+
+ Kontext
+ active.SetPage TabHintergrund
+
+ Kontext
+ active.SetPage TabZellschutz
+ Kontext "TabZellschutz"
+ TabZellschutz.Cancel
+
+ printlog " - check find&replace-dialog"
+ EditSearchAndReplace
+ Kontext "SuchenUndErsetzenCalc"
+ if bAsianTrue = TRUE then
+ if HalbNormalbreiteFormen.Exists then
+ if HalbNormalbreiteFormen.IsVisible = FALSE then Warnlog "'Match half-/full-width forms' is not visible!"
+ else
+ Warnlog "'Match half-/full-width forms' does not exists!"
+ end if
+ if AehnlicheSchreibweise.Exists then
+ if AehnlicheSchreibweise.IsVisible = FALSE then
+ Warnlog "'Sounds like (Japanese)' is not visible!"
+ else
+ AehnlicheSchreibweise.Check
+ end if
+ else
+ Warnlog "'Sounds like (Japanese)' does not exists!"
+ end if
+ if AehnlicheSchreibweiseOptionen.Exists then
+ if AehnlicheSchreibweiseOptionen.IsVisible = FALSE then Warnlog "'Options for 'Sounds like' is not visible!"
+ else
+ Warnlog "'Options for 'Sounds like' does not exists!"
+ end if
+ else
+ if HalbNormalbreiteFormen.Exists then
+ if HalbNormalbreiteFormen.IsVisible then Warnlog "'Match half-/full-width forms' is visible!"
+ end if
+ if AehnlicheSchreibweise.Exists then
+ if AehnlicheSchreibweise.IsVisible then Warnlog "'Sounds like (Japanese)' is visible!"
+ end if
+ if AehnlicheSchreibweiseOptionen.Exists then
+ if AehnlicheSchreibweiseOptionen.IsVisible then Warnlog "'Options for 'Sounds like' is visible!"
+ end if
+ end if
+ SuchenUndErsetzenCalc.Close
+
+ Call hCloseDocument
+
+end sub
+
+' *********************************************
+' **
+' **
+sub hTestAsianForImpress ( bAsianTrue as Boolean )
+ Dim iTabCounter as Integer
+
+ Printlog "- test in impress"
+ gApplication = "IMPRESS"
+ hNewDocument
+
+ printlog " - check 'asian typography' at Format/Paragraph"
+ FormatParagraph
+ Kontext
+ active.SetPage TabEinzuegeUndAbstaende
+
+ if bAsianTrue = TRUE then
+ try
+ Kontext
+ Active.SetPage TabAsianTypography
+ catch
+ Warnlog "The tabpage 'Asian Typography' does not exists!"
+ endcatch
+ else
+ try
+ Kontext
+ Active.SetPage TabAsianTypography
+ Warnlog "The tabpage 'Asian Typography' exists!"
+ catch
+ endcatch
+ end if
+
+ Kontext
+ active.SetPage TabAusrichtungAbsatz
+
+ Kontext
+ active.SetPage TabTabulator
+ kontext "TabTabulator"
+ TabTabulator.Cancel
+
+ hCloseDocument
+end sub
+
+' *********************************************
+' **
+' **
+sub hTestAsianForDraw ( bAsianTrue as Boolean )
+ Dim iTabCounter as Integer
+
+ Printlog "- test in draw"
+ gApplication = "DRAW"
+ hNewDocument
+
+ printlog " - check 'asian typography' at Format/Paragraph"
+ FormatParagraph
+ Kontext
+ active.SetPage TabEinzuegeUndAbstaende
+
+ if bAsianTrue = TRUE then
+ try
+ Kontext
+ Active.SetPage TabAsianTypography
+ catch
+ Warnlog "The tabpage 'Asian Typography' does not exists!"
+ endcatch
+ else
+ try
+ Kontext
+ Active.SetPage TabAsianTypography
+ Warnlog "The tabpage 'Asian Typography' exists!"
+ catch
+ endcatch
+ end if
+
+ Kontext
+ active.SetPage TabAusrichtungAbsatz
+
+ Kontext
+ active.SetPage TabTabulator
+ kontext "TabTabulator"
+ TabTabulator.Cancel
+
+ hCloseDocument
+end sub
+
diff --git a/testautomation/framework/optional/includes/options_data.inc b/testautomation/framework/optional/includes/options_data.inc
new file mode 100644
index 000000000000..ac4c3240c3f4
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_data.inc
@@ -0,0 +1,192 @@
+'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 : general option test ( datasource - group )
+'*
+'\******************************************************************************
+
+testcase tDatasourceConnections
+ Dim lsTimeout ( 20 ) as String
+ Dim lbPool ( 20 ) as Boolean
+ Dim i as Integer, iCounter as Integer
+ Dim bSave as Boolean
+ Dim sDiv as String
+ Dim iDummy as Single
+
+ iCounter = 9 ' sorry only hard coded the number of entries, it gives no way to get the real count ( GetText crashes )
+qaerrorLog "GetTextCrasjhes??? TBO"
+
+
+ hNewDocument
+ ToolsOptions
+ hToolsOptions ( "Datasources", "Connections" )
+
+ printlog " - save raw data"
+ bSave = ConnectionPoolingEnabled.IsChecked
+ ConnectionPoolingEnabled.Check
+ DriverList.TypeKeys "<Up>", 20
+ for i=1 to iCounter
+ if i <> 1 then DriverList.TypeKeys "<Down>"
+ lbPool (i) = EnablePoolingForThisDriver.IsChecked
+ if lbPool (i) = TRUE then
+ lsTimeout (i) = Timeout.GetText
+ else
+ EnablePoolingForThisDriver.Check
+ lsTimeout (i) = Timeout.GetText
+ end if
+ next i
+
+ printlog " - change all settings"
+ DriverList.TypeKeys "<Up>", 20
+ for i=1 to iCounter
+ if i <> 1 then DriverList.TypeKeys "<Down>"
+ sDiv = str ( i/2 )
+ if Instr ( sDiv, "." ) <> 0 or Instr ( sDiv, "," ) <> 0 then
+ EnablePoolingForThisDriver.Check
+ Timeout.SetText "4" + i
+ else
+ EnablePoolingForThisDriver.Uncheck
+ end if
+ Sleep (1)
+ next i
+ if bSave = TRUE then ConnectionPoolingEnabled.UnCheck
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+ hCloseDocument
+
+ printlog " - exit/restart StarOffice"
+ ExitRestartTheOffice
+
+ printlog " - check all changes"
+ ToolsOptions
+ hToolsOptions ( "Datasources", "Connections" )
+
+ if ConnectionPoolingEnabled.IsChecked = bSave then Warnlog "Connection pooling enabled => changes not saved!"
+ ConnectionPoolingEnabled.Check
+
+ DriverList.TypeKeys "<Up>", 20
+ for i=1 to iCounter
+ if i <> 1 then DriverList.TypeKeys "<Down>"
+ sDiv = str ( i/2 )
+ if Instr ( sDiv, "." ) <> 0 or Instr ( sDiv, "," ) <> 0 then
+ if EnablePoolingForThisDriver.IsChecked <> TRUE then Warnlog "Entry " + i + " : enable pooling for this driver => changes not saved!"
+ EnablePoolingForThisDriver.Check
+ if Timeout.GetText <> "4" + i then Warnlog "Entry " + i + " : timeout => changes not saved!"
+ else
+ if EnablePoolingForThisDriver.Ischecked = TRUE then Warnlog "Entry " + i + " : enable pooling for this driver => changes not saved!"
+ end if
+ Sleep (1)
+ next i
+
+ printlog " - make second changes"
+ DriverList.TypeKeys "<Up>", 20
+ for i=1 to iCounter
+ if i <> 1 then DriverList.TypeKeys "<Down>"
+ sDiv = str ( i/2 )
+ if Instr ( sDiv, "." ) <> 0 or Instr ( sDiv, "," ) <> 0 then
+ EnablePoolingForThisDriver.Uncheck
+ else
+ EnablePoolingForThisDriver.Check
+ if i<>10 then
+ Timeout.SetText "6" + i
+ else
+ Timeout.SetText "540"
+ end if
+ end if
+ Sleep (1)
+ next i
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check all changes"
+ ToolsOptions
+ hToolsOptions ( "Datasources", "Connections" )
+
+ DriverList.TypeKeys "<Up>", 20
+ for i=1 to iCounter
+ if i <> 1 then DriverList.TypeKeys "<Down>"
+ sDiv = str ( i/2 )
+ if Instr ( sDiv, "." ) <> 0 or Instr ( sDiv, "," ) <> 0 then
+ if EnablePoolingForThisDriver.Ischecked = TRUE then Warnlog "Entry " + i + " : enable pooling for this driver => changes not saved!"
+ else
+ if EnablePoolingForThisDriver.IsChecked <> TRUE then Warnlog "Entry " + i + " : enable pooling for this driver => changes not saved!"
+ EnablePoolingForThisDriver.Check
+ if i<>10 then
+ if Timeout.GetText <> "6" + i then Warnlog "Entry " + i + " : timeout => changes not saved!"
+ else
+ if Timeout.GetText <> "540" then Warnlog "Entry " + i + " : timeout => changes not saved!"
+ end if
+
+ end if
+ Sleep (1)
+ next i
+
+ printlog " - reset all settings"
+ DriverList.TypeKeys "<Up>", 20
+ for i=1 to iCounter
+ if i <> 1 then DriverList.TypeKeys "<Down>"
+ EnablePoolingForThisDriver.Check
+ Timeout.SetText lsTimeout (i)
+ if lbPool (i) = TRUE then EnablePoolingForThisDriver.Check else EnablePoolingForThisDriver.UnCheck
+ next i
+ if bSave = TRUE then ConnectionPoolingEnabled.Check else ConnectionPoolingEnabled.UnCheck
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check the raw data"
+ ToolsOptions
+ hToolsOptions ( "Datasources", "Connections" )
+
+ ConnectionPoolingEnabled.check
+ DriverList.TypeKeys "<Up>", 20
+ for i=1 to iCounter
+ if i <> 1 then DriverList.TypeKeys "<Down>"
+ if EnablePoolingForThisDriver.IsChecked <> lbPool (i) then Warnlog "Entry " + i + " : enable pooling for this driver => changes not saved!"
+ EnablePoolingForThisDriver.Check
+ if Timeout.GetText <> lsTimeout (i) then Warnlog "Entry " + i + " : timeout => changes not saved!"
+ if lbPool (i) = TRUE then EnablePoolingForThisDriver.Check else EnablePoolingForThisDriver.UnCheck
+ Sleep (1)
+ next i
+ ConnectionPoolingEnabled.unCheck
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+endcase
+
+
+
+
diff --git a/testautomation/framework/optional/includes/options_int1.inc b/testautomation/framework/optional/includes/options_int1.inc
new file mode 100644
index 000000000000..76b989679c15
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_int1.inc
@@ -0,0 +1,286 @@
+'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 : general options test (test for internet-group)
+'*
+'\******************************************************************************
+
+testcase tInternetProxy
+ Dim iSave as Integer
+ Dim lsSave ( 9 ) as String
+
+
+ hNewDocument
+ ToolsOptions
+ hToolsOptions ( "Internet", "Proxy" )
+
+ printlog " - save settings"
+ iSave = ProxyServer.GetSelIndex
+ ProxyServer.Select ( ProxyServer.GetItemCount )
+ if ProxyServer.GetItemCount > 2 then Warnlog "More than 2 entries are available for ProxyServer-Setting => Bug 88387"
+
+ lsSave (1) = HTTPProxy.GetText
+ lsSave (2) = HTTPPort.GetText
+ lsSave (3) = FTPProxy.GetText
+ lsSave (4) = FTPPort.GetText
+ lsSave (7) = NoProxy.GetText
+
+ printlog " - change settings"
+ HTTPProxy.SetText "staroffice-news.germany.sun.com.test"
+ HTTPPort.SetText "1508"
+ FTPProxy.SetText "staroffice-news.germany.sun.com.test"
+ FTPPort.SetText "1509"
+ NoProxy.SetText "staroffice;stardivision;starstarstar"
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ hCloseDocument
+
+ printlog " - exit/restart StarOffice"
+ ExitRestartTheOffice
+
+ printlog " - check changes"
+ ToolsOptions
+ hToolsOptions ( "Internet", "Proxy" )
+
+ if ProxyServer.GetSelIndex <> ProxyServer.GetItemCount then
+ Warnlog "Proxy Server => changes not saved ( should be the last entry )!"
+ ProxyServer.Select ( ProxyServer.GetItemCount )
+ end if
+
+ if HTTPProxy.GetText <> "staroffice-news.germany.sun.com.test" then warnlog "HTTP Proxy => changes not saved!"
+ if FTPProxy.GetText <> "staroffice-news.germany.sun.com.test" then warnlog "FTP Proxy => changes not saved!"
+ if NoProxy.GetText <> "staroffice;stardivision;starstarstar" then warnlog "No Proxy => changes not saved!"
+ if HTTPPort.GetText <> "1508" then warnlog "HTTP Port => changes not saved!"
+ if FTPPort.GetText <> "1509" then warnlog "FTP Port => changes not saved!"
+
+ if gPlatgroup = "w95" then
+ printlog " - change settings ( only windows )"
+ ProxyServer.Select 2
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check changes"
+ ToolsOptions
+ hToolsOptions ( "Internet", "Proxy" )
+
+ if ProxyServer.GetSelIndex <> 2 then Warnlog "Proxy Server => changes not saved ( should be the 2nd entry )!"
+ end if
+
+ printlog " - reset settings"
+ ProxyServer.Select(3) ' manual
+ HTTPProxy.SetText lsSave (1)
+ HTTPPort.SetText lsSave (2)
+ FTPProxy.SetText lsSave (3)
+ FTPPort.SetText lsSave (4)
+ NoProxy.SetText lsSave (7)
+ ProxyServer.Select iSave
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check default"
+ ToolsOptions
+ hToolsOptions ( "Internet", "Proxy" )
+ if ProxyServer.GetSelIndex <> iSave then Warnlog "Proxy Server => changes not saved!"
+ if HTTPProxy.GetText <> lsSave (1) then warnlog "HTTP Proxy => changes not saved!"
+ if FTPProxy.GetText <> lsSave (3) then warnlog "FTP Proxy => changes not saved!"
+ if NoProxy.GetText <> lsSave (7) then warnlog "No Proxy => changes not saved!"
+ if FTPPort.GetText <> lsSave (4) AND FTPPort.GetText <> "0" then warnlog "FTP Port => changes not saved!"
+ if HTTPPort.GetText <> lsSave (2) AND HTTPPort.GetText <> "0" then warnlog "HTTP Port => changes not saved!"
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+endcase
+
+testcase tInternetSearch
+ Dim iSave, iInterim, i as Integer
+ Dim lbSave ( 3, 10 ) as boolean
+ Dim lsSave ( 6, 10 ) as String
+
+
+ hNewDocument
+ ToolsOptions
+ hToolsOptions ( "Internet", "Search" )
+
+ printlog " - save settings"
+ iSave = SuchenIn.GetItemCount
+ if iSave > 8 then
+ Warnlog "Please change the index for this test, there are too many entries in the Search-List!"
+ iSave = 8
+ end if
+
+ for i=1 to iSave
+ SuchenIn.Select i
+ lsSave (1, i) = DienstName.GetText
+ lsSave (2, i) = Praefix.GetText
+ lsSave (3, i) = Suffix.GetText
+ lsSave (4, i) = Trenner.GetText
+ lsSave (5, i) = Schreibstil.GetSelText
+
+ lbSave (1, i) = Und.IsChecked
+ lbSave (2, i) = Oder.IsChecked
+ lbSave (3, i) = Exakt.IsChecked
+ next i
+
+ printlog " - change/insert settings"
+ if iSave > 0 then
+ SuchenIn.Select 1
+ DienstName.SetText "AAAA_TT_Changes_Name"
+ Und.Check
+ Praefix.SetText "TT_Changes_Prefix"
+ Suffix.SetText "TT_Changes_Suffix"
+ Trenner.SetText ";;;;"
+ Schreibstil.Select 3
+ Sleep (1)
+ Aendern.Click
+ end if
+
+ Neu.Click
+ Sleep (1)
+ DienstName.SetText "ZZZZ_TT_New_Name"
+ Oder.Check
+ Praefix.SetText "TT_New_Prefix"
+ Suffix.SetText "TT_New_Suffix"
+ Trenner.SetText ":::::"
+ Schreibstil.Select 2
+ Hinzufuegen.Click
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ hCloseDocument
+
+ printlog " - exit/restart StarOffice"
+ ExitRestartTheOffice
+
+ printlog " - check changes"
+ ToolsOptions
+ hToolsOptions ( "Internet", "Search" )
+
+ iInterim = SuchenIn.GetItemCount
+ if iInterim = 0 then
+ Warnlog "No entrie in Search-List, entries are not saved! The test ends here! => BugID: 82922"
+ else
+ if iInterim <> ( iSave + 1 ) then
+ Warnlog "Not all entries in the Search-List are saved! => BugID: 82922"
+ else
+ for i=1 to iInterim
+ if i=1 then
+ SuchenIn.Select "AAAA_TT_Changes_Name"
+ if DienstName.GetText <> "AAAA_TT_Changes_Name" then Warnlog "AAAA_TT_Changes_Name : Name => changes not saved"
+ Und.Check
+ if Praefix.GetText <> "TT_Changes_Prefix" then Warnlog "AAAA_TT_Changes_Name : Prefix => changes not saved!"
+ if Suffix.GetText <> "TT_Changes_Suffix" then Warnlog "AAAA_TT_Changes_Name : Suffix => changes not saved!"
+ if Trenner.GetText <> ";;;;" then Warnlog "AAAA_TT_Changes_Name : Seperator => changes not saved!"
+ if Schreibstil.GetSelIndex <> 3 then Warnlog "AAAA_TT_Changes_Name : Case match => changes not saved! BugID:86660"
+ else
+ if i <> ( iSave + 1 ) then
+ SuchenIn.Select i
+ if DienstName.GetText <> lsSave (1, i) then Warnlog lsSave (1, i) + " : Name => old entry not saved correctly!"
+ if Und.IsChecked <> lbSave (1, i) then Warnlog lsSave (1, i) + " : Und => old entry not saved correctly!"
+ if Oder.IsChecked <> lbSave (2, i) then Warnlog lsSave (1, i) + " : Oder => old entry not saved correctly!"
+ if Exakt.IsChecked <> lbSave (3, i) then Warnlog lsSave (1, i) + " : Exakt => old entry not saved correctly!"
+ if Praefix.GetText <> lsSave (2, i) then Warnlog lsSave (1, i) + " : Prefix => old entry not saved correctly!"
+ if Suffix.GetText <> lsSave (3, i) then Warnlog lsSave (1, i) + " : Suffix => old entry not saved correctly!"
+ if Trenner.GetText <> lsSave (4, i) then Warnlog lsSave (1, i) + " : Seperator => old entry not saved correctly!"
+ if Schreibstil.GetSelText <> lsSave (5, i) then Warnlog lsSave (1, i) + " : Case match => old entry not saved correctly!"
+ else
+ SuchenIn.Select "ZZZZ_TT_New_Name"
+ if DienstName.GetText <> "ZZZZ_TT_New_Name" then Warnlog "ZZZZ_TT_New_Name : Name => new entry not saved correctly!"
+ Oder.Check
+ if Praefix.GetText <> "TT_New_Prefix" then Warnlog "ZZZZ_TT_New_Name : Prefix => new entry not saved correctly!"
+ if Suffix.GetText <> "TT_New_Suffix" then Warnlog "ZZZZ_TT_New_Name : Suffix => new entry not saved correctly!"
+ if Trenner.GetText <> ":::::" then Warnlog "ZZZZ_TT_New_Name : Seperator => new entry not saved correctly!"
+ if Schreibstil.GetSelIndex <> 2 then Warnlog "ZZZZ_TT_New_Name : Case match => new entry not saved correctly! BugID:86660"
+ end if
+ end if
+ next i
+ end if
+
+ printlog " - reset settings"
+ SuchenIn.Select "AAAA_TT_Changes_Name"
+ DienstName.SetText lsSave (1, 1)
+ if lbSave(1, 1) = TRUE then Und.Check
+ if lbSave(2, 1) = TRUE then Oder.Check
+ if lbSave(3, 1) = TRUE then Exakt.Check
+ Praefix.SetText lsSave (2, 1)
+ Suffix.SetText lsSave (3, 1)
+ Trenner.SetText lsSave (4, 1)
+ Schreibstil.Select lsSave (5, 1)
+ Sleep (1)
+ Aendern.Click
+ Sleep (1)
+
+ SuchenIn.Select "ZZZZ_TT_New_Name"
+ Sleep (1)
+ Loeschen.Click
+ Sleep (1)
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check the reset"
+ ToolsOptions
+ hToolsOptions ( "Internet", "Search" )
+
+ iInterim = SuchenIn.GetItemCount
+ if iInterim <> iSave then
+ Warnlog "The default can't be reached!"
+ else
+ for i=1 to iInterim
+ SuchenIn.Select lsSave (1, i)
+ if DienstName.GetText <> lsSave (1, i) then Warnlog lsSave (1, i) + " : Name => old entry not saved correctly!"
+ if Und.IsChecked <> lbSave (1, i) then Warnlog lsSave (1, i) + " : Und => old entry not saved correctly!"
+ if Oder.IsChecked <> lbSave (2, i) then Warnlog lsSave (1, i) + " : Oder => old entry not saved correctly!"
+ if Exakt.IsChecked <> lbSave (3, i) then Warnlog lsSave (1, i) + " : Exakt => old entry not saved correctly!"
+ if Praefix.GetText <> lsSave (2, i) then Warnlog lsSave (1, i) + " : Prefix => old entry not saved correctly!"
+ if Suffix.GetText <> lsSave (3, i) then Warnlog lsSave (1, i) + " : Suffix => old entry not saved correctly!"
+ if Trenner.GetText <> lsSave (4, i) then Warnlog lsSave (1, i) + " : Seperator => old entry not saved correctly!"
+ if Schreibstil.GetSelText <> lsSave (5, i) then Warnlog lsSave (1, i) + " : Case match => old entry not saved correctly!"
+ next i
+ end if
+ end if
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/options_lan1.inc b/testautomation/framework/optional/includes/options_lan1.inc
new file mode 100644
index 000000000000..c3659cb68f14
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_lan1.inc
@@ -0,0 +1,894 @@
+'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 : general option test (test for language-group)
+'*
+'\******************************************************************************
+
+sub opt_lan1
+ Dim bOld as Boolean
+
+ bOld = ActiveDeactivateAsianSupport ( FALSE )
+
+ Call tLanguageSettingsLanguages
+ Call tLanguageSettingsWritingAids
+
+ printlog "++ activate the asian support in StarOffice ++"
+ ActiveDeactivateAsianSupport ( TRUE )
+ Call tLanguageSettingsJapaneseFind
+ Call tLanguageSettingsAsianLayout
+
+ printlog "++ reset asian support in StarOffice to default ++"
+ if bOld = TRUE then
+ ActiveDeactivateAsianSupport ( TRUE )
+ else
+ ActiveDeactivateAsianSupport ( FALSE )
+ end if
+
+end sub
+
+'*******************************************************************************
+
+testcase tLanguageSettingsLanguages
+
+ Dim lsSave ( 5 ) as String, lsSave2 (3) as String
+ Dim bChanged as Boolean, bSave as Boolean, bSave2 as Boolean
+
+ bChanged = FALSE
+
+
+
+ hNewDocument
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "Languages" )
+
+ printlog "- check dependences in this dialog"
+ printlog " - asian support"
+ if Aktivieren.IsChecked() = FALSE then
+ if Asiatisch.IsEnabled() = TRUE then
+ Warnlog "Asian support is not active, the listbox is in wrong state:"
+ printlog "...the language for asian is active => Perhaps #108220#"
+ end if
+ if Aktivieren.isEnabled then
+ Aktivieren.Check
+ else
+ qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'")
+ printlog Aktivieren.isEnabled
+ endif
+ if Asiatisch.IsEnabled() <> TRUE then
+ Warnlog "Asian support is active, the listbox is in wrong state:"
+ printlog "...language for asian is not active => BUG!"
+ end if
+ if Aktivieren.isEnabled then
+ Aktivieren.unCheck
+ else
+ qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'")
+ printlog Aktivieren.isEnabled
+ endif
+ else
+ if Asiatisch.IsEnabled() <> TRUE then
+ Warnlog "Asian support is not active, the listbox is in wrong state:"
+ printlog "...language for asian is not active => BUG!"
+ end if
+ if Aktivieren.isEnabled then
+ Aktivieren.unCheck
+ else
+ qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'")
+ printlog Aktivieren.isEnabled
+ endif
+ if Asiatisch.IsEnabled() = TRUE then
+ Warnlog "Asian support is active, the listbox is in wrong state:"
+ printlog "...language for asian is active => BUG!"
+ end if
+ if Aktivieren.isEnabled then
+ Aktivieren.Check
+ else
+ qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'")
+ printlog Aktivieren.isEnabled
+ endif
+ end if
+
+ printlog " - CTL support"
+ if ComplexScriptEnabled.IsChecked() = FALSE then
+ if LanguageComplexScript.IsEnabled() = TRUE then
+ Warnlog "CTL support is not active, the listbox is in wrong state:"
+ printlog "...language for CTL is active => BUG!"
+ end if
+ ComplexScriptEnabled.Check()
+ if LanguageComplexScript.IsEnabled() <> TRUE then
+ Warnlog "CTL support is active, the listbox is in wrong state:"
+ printlog "...language for CTL is not active => BUG!"
+ end if
+ ComplexScriptEnabled.UnCheck()
+ else
+ if LanguageComplexScript.IsEnabled() <> TRUE then
+ Warnlog "CTL support is active, the listbox is in wrong state:"
+ printlog "...language for CTL is not active => BUG!"
+ end if
+ ComplexScriptEnabled.UnCheck()
+ if LanguageComplexScript.IsEnabled() = TRUE then
+ Warnlog "CTL support is not active, the listbox is in wrong state:"
+ printlog "...the language for CTL is active => BUG!"
+ end if
+ ComplexScriptEnabled.Check()
+ end if
+
+ printlog "- save raw data"
+ lsSave (1) = Gebietsschema.GetSelText()
+ lsSave (2) = StandardWaehrung.GetSelText()
+ lsSave (3) = Westlich.GetSelText()
+ bSave = Aktivieren.IsChecked()
+ if Aktivieren.isEnabled then
+ Aktivieren.Check
+ else
+ qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'")
+ printlog Aktivieren.isEnabled
+ endif
+ lsSave (4) = Asiatisch.GetSelText()
+
+ if lsSave (4) = "" then
+ Warnlog "Empty entry is selected for 'Asian'! => Bug 102046"
+ endif
+
+ bSave2 = ComplexScriptEnabled.IsChecked()
+ ComplexScriptEnabled.Check()
+ lsSave (5) = LanguageComplexScript.GetSelText()
+
+ if lsSave (5) = "" then
+ Warnlog "Empty entry is selected for 'Complex script'! => Bug 102046"
+ endif
+
+ printlog "- change settings"
+ select case iSprache
+ case 34 : Gebietsschema.Select( 40 )
+ case 39 : Gebietsschema.Select( 17 )
+ case 81 : Gebietsschema.Select( 22 )
+ case 88 : Gebietsschema.Select( 19 )
+ case else : Gebietsschema.Select( 15 )
+ end select
+ StandardWaehrung.Select( 20 )
+ Westlich.Select( 10 )
+ lsSave2(1) = Westlich.GetSelText()
+
+ if Aktivieren.isEnabled then
+ Aktivieren.Check
+ else
+ qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'")
+ printlog Aktivieren.isEnabled
+ endif
+ Asiatisch.Select( 5 )
+ lsSave2(2) = Asiatisch.GetSelText()
+ AktuellesDokument.Uncheck()
+
+ ComplexScriptEnabled.Check
+ LanguageComplexScript.Select( 7 )
+ lsSave2 (3) = LanguageComplexScript.GetSelText()
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK()
+ Sleep ( 3 )
+
+ hCloseDocument
+
+ printlog "- exit/restart StarOffice"
+ ExitRestartTheOffice
+ hNewDocument
+ printlog "- check changes"
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "Languages" )
+
+ select case iSprache
+ case 34 : if Gebietsschema.GetSelIndex <> 40 then
+ Warnlog "locale settings => changes not saved!"
+ endif
+ case 39 : if Gebietsschema.GetSelIndex <> 17 then
+ Warnlog "locale settings => changes not saved!"
+ endif
+ case 81 : if Gebietsschema.GetSelIndex <> 22 then
+ Warnlog "locale settings => changes not saved!"
+ endif
+ case 88 : if Gebietsschema.GetSelIndex <> 19 then
+ Warnlog "locale settings => changes not saved!"
+ endif
+ case else : if Gebietsschema.GetSelIndex <> 15 then
+ Warnlog "locale settings => changes not saved!"
+ endif
+ end select
+
+ if StandardWaehrung.GetSelIndex <> 20 then
+ Warnlog "default currency => changes not saved!"
+ endif
+
+ if Westlich.GetSelText <> lsSave2(1) then
+ Warnlog "western => changes not saved! "
+ endif
+
+ if Aktivieren.IsChecked <> TRUE then
+ Warnlog "Enabled asian support => changes not saved!"
+ endif
+
+ if Asiatisch.GetSelText <> lsSave2(2) then
+ Warnlog "asian => changes not saved! "
+ endif
+
+ if ComplexScriptEnabled.IsChecked <> TRUE then
+ Warnlog "CTL support => changes not saved!"
+ endif
+
+ if LanguageComplexScript.GetSelText <> lsSave2 (3) then
+ Warnlog "CTL language => changes not saved! "
+ endif
+
+ printlog "- set to default"
+ Gebietsschema.Select lsSave(1)
+ StandardWaehrung.Select lsSave (2)
+ Westlich.Select lsSave (3)
+ AktuellesDokument.Uncheck()
+ if Aktivieren.isEnabled then
+ Aktivieren.Check
+ else
+ qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'")
+ printlog Aktivieren.isEnabled
+ endif
+
+ if lsSave (4) <> "" then
+ Asiatisch.Select lsSave (4)
+ else
+ Asiatisch.Select 1
+ end if
+
+ if Aktivieren.isEnabled then
+ if bSave = TRUE then
+ Aktivieren.Check
+ else
+ Aktivieren.Uncheck
+ endif
+ else
+ qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'")
+ printlog Aktivieren.isEnabled
+ endif
+ ComplexScriptEnabled.Check()
+
+ if lsSave (5) <> "" then
+ LanguageComplexScript.Select( lsSave(5) )
+ else
+ LanguageComplexScript.Select( 1 )
+ end if
+
+ if bSave2 = TRUE then
+ ComplexScriptEnabled.Check()
+ else
+ ComplexScriptEnabled.Uncheck()
+ endif
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK()
+ Sleep (3)
+
+ printlog "- check the data"
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "Languages" )
+
+ if Gebietsschema.GetSelText() <> lsSave(1) then
+ Warnlog "locale settings => changes not saved! => BugID : 87977"
+ endif
+
+ if StandardWaehrung.GetSelText() <> lsSave(2) then
+ Warnlog "default currency => changes not saved!"
+ endif
+
+ if Westlich.GetSelText() <> lsSave (3) then
+ Warnlog "western => changes not saved!"
+ endif
+
+ if Aktivieren.IsChecked() <> bSave then
+ Warnlog "Enabled asian support => changes not saved!"
+ endif
+
+ if Aktivieren.isEnabled then
+ Aktivieren.Check
+ else
+ qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'")
+ printlog Aktivieren.isEnabled
+ endif
+ if lsSave (4) <> "" then
+ if Asiatisch.GetSelText() <> lsSave (4) then
+ Warnlog "asian => changes not saved!"
+ endif
+ end if
+
+ if ComplexScriptEnabled.IsChecked() <> bSave2 then
+ Warnlog "CTL support => changes not saved!"
+ endif
+
+ ComplexScriptEnabled.Check()
+
+ if lsSave (5) <> "" then
+ if LanguageComplexScript.GetSelText() <> lsSave (5) then
+ Warnlog "CTL language => changes not saved! "
+ endif
+ end if
+ if Aktivieren.isEnabled then
+ if bSave = TRUE then
+ Aktivieren.Check
+ else
+ Aktivieren.Uncheck
+ endif
+ else
+ qaErrorLog("Asian locale setting is selected: '"+Gebietsschema.getSelText()+"'")
+ printlog Aktivieren.isEnabled
+ endif
+ if bSave2 = TRUE then
+ ComplexScriptEnabled.Check()
+ else
+ ComplexScriptEnabled.Uncheck()
+ endif
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK()
+ Sleep (3)
+ hclosedocument
+endcase
+
+' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
+' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
+testcase tLanguageSettingsWritingAids
+
+ Dim lbSave1 ( 5 ) as Boolean
+ Dim lbSave2 ( 5 ) as Boolean
+ Dim lbSave3 ( 15 ) as Boolean
+ dim iCounter as Integer
+ Dim i as Integer, iCounter1 as Integer, iCounter2 as Integer, iCounter3 as Integer
+
+
+
+ hNewDocument
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "WritingAids" )
+
+ printlog " - save raw data / and inverted settings"
+ iCounter1 = Sprachmodule.GetItemCount
+ Sprachmodule.TypeKeys "<PageUp>", 6
+
+ for i=1 to iCounter1
+ lbSave1 (i) = Sprachmodule.IsChecked
+ if lbSave1 (i) = TRUE then Sprachmodule.Uncheck else Sprachmodule.Check
+ Sprachmodule.TypeKeys "<Down>"
+ next i
+
+ iCounter2 = Benutzerwoerterbuch.GetItemCount
+ Benutzerwoerterbuch.TypeKeys "<PageUp>", 6
+
+ for i=1 to iCounter2 - 1
+ lbSave2 (i) = Benutzerwoerterbuch.IsChecked
+ if lbSave2 (i) = TRUE then Benutzerwoerterbuch.Uncheck else Benutzerwoerterbuch.Check
+ Benutzerwoerterbuch.TypeKeys "<Down>"
+ next i
+
+ if Benutzerwoerterbuch.IsChecked <> TRUE then
+ Warnlog "Last entry in 'User-defined dictionaries' should be checked ( internal Ignore-All List ), but it isn't => BUG?!"
+ endif
+
+ iCounter3 = Optionen.GetItemCount
+ Optionen.TypeKeys "<PageUp>", 6
+ for i=1 to iCounter3
+ if i<>9 AND i<>10 AND i<>11 then
+ lbSave3 (i) = Optionen.IsChecked
+ if lbSave3 (i) = TRUE then Optionen.Uncheck else Optionen.Check
+ end if
+ Optionen.TypeKeys "<Down>"
+ next i
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+ hCloseDocument
+
+ printlog " - exit/restart StarOffice"
+ ExitRestartTheOffice
+
+ printlog " - check changes"
+
+ hNewDocument
+
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "WritingAids" )
+ printlog " 'available language modules'"
+ Sprachmodule.TypeKeys "<PageUp>", 6
+
+ for i=1 to iCounter1
+ if Sprachmodule.Ischecked = lbSave1 (i) then
+ Warnlog "entry no. " + i + " => changes not saved! perhaps #i15841!"
+ end if
+ Sprachmodule.TypeKeys "<Down>"
+ next i
+
+ printlog " 'user-definded dictonaries'"
+ Benutzerwoerterbuch.TypeKeys "<PageUp>", 6
+
+ for i=1 to iCounter2 - 1
+ if Benutzerwoerterbuch.Ischecked = lbSave2 (i) then Warnlog "entry no. " + i + " => changes not saved!"
+ Benutzerwoerterbuch.TypeKeys "<Down>"
+ next i
+
+ if Benutzerwoerterbuch.IsChecked <> TRUE then
+ Warnlog "Last entry in 'User-defined dictionaries' should be checked ( internal Ignore-All List ), but it isn't => BUG?!"
+ endif
+
+ printlog " 'options'"
+ Optionen.TypeKeys "<PageUp>", 6
+ for i=1 to iCounter3
+ if i<>9 AND i<>10 AND i<>11 then
+ if Optionen.IsChecked = lbSave3 (i) then Warnlog "entry no. " + i + " => changes not saved!"
+ end if
+ Optionen.TypeKeys "<Down>"
+ next i
+
+ printlog " - make second changes"
+ Optionen.TypeKeys "<PageUp>", 6
+
+ for i=1 to iCounter3
+ if i=1 then Optionen.Uncheck
+ if i=3 then Optionen.Check
+ if i=5 then Optionen.Uncheck
+ if i=6 then Optionen.Check
+ if i=7 then Optionen.Uncheck
+ if i=12 then Optionen.Check
+ Optionen.TypeKeys "<Down>"
+ next i
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ hCloseDocument
+
+ printlog " - check second changes"
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "WritingAids" )
+ Optionen.TypeKeys "<PageUp>", 6
+
+ for i=1 to iCounter
+ select case i
+ case 1 : if Optionen.IsChecked <> FALSE then
+ Warnlog "entry no. 1 => changes not saved!"
+ endif
+ case 3 : if Optionen.IsChecked <> TRUE then
+ Warnlog "entry no. 3 => changes not saved!"
+ endif
+ case 5 : if Optionen.IsChecked <> FALSE then
+ Warnlog "entry no. 5 => changes not saved!"
+ endif
+ case 6 : if Optionen.IsChecked <> TRUE then
+ Warnlog "entry no. 6 => changes not saved!"
+ endif
+ case 7 : if Optionen.IsChecked <> FALSE then
+ printlog "entry no. 7 => not saved! => it is only for documents"
+ endif
+ case 12 : if Optionen.IsChecked <> TRUE then
+ Warnlog "entry no. 12 => changes not saved!"
+ endif
+ end select
+ Optionen.TypeKeys "<Down>"
+ next i
+
+ printlog " - reset settings"
+ Sprachmodule.TypeKeys "<PageUp>", 6
+
+ for i=1 to iCounter1
+ if lbSave1 (i) = TRUE then Sprachmodule.Check else Sprachmodule.UnCheck
+ Sprachmodule.TypeKeys "<Down>"
+ next i
+
+ Benutzerwoerterbuch.TypeKeys "<PageUp>", 6
+
+ for i=1 to iCounter2 - 1
+ if lbSave2 (i) = TRUE then Benutzerwoerterbuch.Check else Benutzerwoerterbuch.UnCheck
+ Benutzerwoerterbuch.TypeKeys "<Down>"
+ next i
+
+ Optionen.TypeKeys "<PageUp>", 6
+
+ for i=1 to iCounter3
+ if i<>9 AND i<>10 AND i<>11 then
+ if lbSave3 (i) = TRUE then Optionen.Check else Optionen.UnCheck
+ end if
+ Optionen.TypeKeys "<Down>"
+ next i
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check raw data"
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "WritingAids" )
+
+ printlog " 'available language modules'"
+ Sprachmodule.TypeKeys "<PageUp>", 6
+
+ for i=1 to iCounter1
+ if Sprachmodule.Ischecked <> lbSave1 (i) then Warnlog "entry no. " + i + " => changes not saved!"
+ Sprachmodule.TypeKeys "<Down>"
+ next i
+
+ printlog " 'user-definded dictonaries'"
+ Benutzerwoerterbuch.TypeKeys "<PageUp>", 6
+ for i=1 to iCounter2 - 1
+ if Benutzerwoerterbuch.Ischecked <> lbSave2 (i) then Warnlog "entry no. " + i + " => changes not saved!"
+ Benutzerwoerterbuch.TypeKeys "<Down>"
+ next i
+
+ printlog " 'options'"
+ Optionen.TypeKeys "<PageUp>", 6
+ for i=1 to iCounter3
+ if i<>9 AND i<>10 AND i<>11 then
+ if Optionen.IsChecked <> lbSave3 (i) then Warnlog "entry no. " + i + " => changes not saved!"
+ end if
+ Optionen.TypeKeys "<Down>"
+ next i
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+endcase
+
+' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
+' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
+testcase tLanguageSettingsJapaneseFind
+ Dim bSave ( 20 ) as Boolean
+
+
+ hNewDocument
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "SearchingInJapanese" )
+
+ printlog " - save data"
+ bSave (1 ) = MatchCase.IsChecked
+ bSave (2 ) = MatchFullHalf.IsChecked
+ bSave (3 ) = MatchHiraganaKatakana.IsChecked
+ bSave (4 ) = MatchContractions.IsChecked
+ bSave (5 ) = MatchMinusDashChoOn.IsChecked
+ bSave (6 ) = MatchRepeatcharacterMarks.IsChecked
+ bSave (7 ) = MatchVariantFormKanji.IsChecked
+ bSave (8 ) = MatchOldKanaForms.IsChecked
+ bSave (9 ) = MatchDiZiDuZu.IsChecked
+ bSave (10) = MatchBaVaHaFa.IsChecked
+ bSave (11) = MatchTsiThiChiDhiZi.IsChecked
+ bSave (12) = MatchHyuFyuByuVyu.IsChecked
+ bSave (13) = MatchDeSheZeJe.IsChecked
+ bSave (14) = MatchIaIya.IsChecked
+ bSave (15) = MatchKiKu.IsChecked
+ bSave (16) = PunctuationCharacters.IsChecked
+ bSave (17) = WhitespaceCharacters.IsChecked
+ bSave (18) = ProlongedSoundmarks.IsChecked
+ bSave (19) = MiddleDots.IsChecked
+
+ printlog " - invert data"
+ if bSave (1 ) = TRUE then MatchCase.Uncheck else MatchCase.Check
+ if bSave (2 ) = TRUE then MatchFullHalf.Uncheck else MatchFullHalf.Check
+ if bSave (3 ) = TRUE then MatchHiraganaKatakana.Uncheck else MatchHiraganaKatakana.Check
+ if bSave (4 ) = TRUE then MatchContractions.Uncheck else MatchContractions.Check
+ if bSave (5 ) = TRUE then MatchMinusDashChoOn.Uncheck else MatchMinusDashChoOn.Check
+ if bSave (6 ) = TRUE then MatchRepeatcharacterMarks.Uncheck else MatchRepeatcharacterMarks.Check
+ if bSave (7 ) = TRUE then MatchVariantFormKanji.Uncheck else MatchVariantFormKanji.Check
+ if bSave (8 ) = TRUE then MatchOldKanaForms.Uncheck else MatchOldKanaForms.Check
+ if bSave (9 ) = TRUE then MatchDiZiDuZu.Uncheck else MatchDiZiDuZu.Check
+ if bSave (10) = TRUE then MatchBaVaHaFa.Uncheck else MatchBaVaHaFa.Check
+ if bSave (11) = TRUE then MatchTsiThiChiDhiZi.Uncheck else MatchTsiThiChiDhiZi.Check
+ if bSave (12) = TRUE then MatchHyuFyuByuVyu.Uncheck else MatchHyuFyuByuVyu.Check
+ if bSave (13) = TRUE then MatchDeSheZeJe.Uncheck else MatchDeSheZeJe.Check
+ if bSave (14) = TRUE then MatchIaIya.Uncheck else MatchIaIya.Check
+ if bSave (15) = TRUE then MatchKiKu.Uncheck else MatchKiKu.Check
+ if bSave (16) = TRUE then PunctuationCharacters.Uncheck else PunctuationCharacters.Check
+ if bSave (17) = TRUE then WhitespaceCharacters.Uncheck else WhitespaceCharacters.Check
+ if bSave (18) = TRUE then ProlongedSoundmarks.Uncheck else ProlongedSoundmarks.Check
+ if bSave (19) = TRUE then MiddleDots.Uncheck else MiddleDots.Check
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+ hCloseDocument
+
+ printlog " - exit/restart StarOffice"
+ ExitRestartTheOffice
+
+ printlog " - check changes"
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "SearchingInJapanese" )
+
+ if MatchCase.IsChecked = bSave (1 ) then Warnlog "Match Case => changes not saved!"
+ if MatchFullHalf.IsChecked = bSave (2 ) then Warnlog "Match Full Half => changes not saved!"
+ if MatchHiraganaKatakana.IsChecked = bSave (3 ) then Warnlog "Match Hiragana Katakana => changes not saved!"
+ if MatchContractions.IsChecked = bSave (4 ) then Warnlog "Match Contractions => changes not saved!"
+ if MatchMinusDashChoOn.IsChecked = bSave (5 ) then Warnlog "Match Minus Dash Cho On => changes not saved!"
+ if MatchRepeatcharacterMarks.IsChecked = bSave (6 ) then Warnlog "Match Repeatcharacter Marks => changes not saved!"
+ if MatchVariantFormKanji.IsChecked = bSave (7 ) then Warnlog "Match Variant Form Kanji => changes not saved!"
+ if MatchOldKanaForms.IsChecked = bSave (8 ) then Warnlog "Match Old Kana Forms => changes not saved!"
+ if MatchDiZiDuZu.IsChecked = bSave (9 ) then Warnlog "Match Di Zi Du Zu => changes not saved!"
+ if MatchBaVaHaFa.IsChecked = bSave (10) then Warnlog "Match Ba Va Ha Fa => changes not saved!"
+ if MatchTsiThiChiDhiZi.IsChecked = bSave (11) then Warnlog "Match Tsi Thi Chi Dhi Zi => changes not saved!"
+ if MatchHyuFyuByuVyu.IsChecked = bSave (12) then Warnlog "Match Hyu Iyu Byu Vyu => changes not saved!"
+ if MatchDeSheZeJe.IsChecked = bSave (13) then Warnlog "Match De She Ze Je => changes not saved!"
+ if MatchIaIya.IsChecked = bSave (14) then Warnlog "Match Ia Iya => changes not saved!"
+ if MatchKiKu.IsChecked = bSave (15) then Warnlog "Match Ki Ku => changes not saved!"
+ if PunctuationCharacters.IsChecked = bSave (16) then Warnlog "Punctuation Characters => changes not saved!"
+ if WhitespaceCharacters.IsChecked = bSave (17) then Warnlog "Whitespace Characters => changes not saved!"
+ if ProlongedSoundmarks.IsChecked = bSave (18) then Warnlog "Prolonged Soundmarks => changes not saved!"
+ if MiddleDots.IsChecked = bSave (19) then Warnlog "Middle Dots => changes not saved!"
+
+ printlog " - second changes"
+ MatchCase.Check
+ MatchFullHalf.Uncheck
+ MatchHiraganaKatakana.Check
+ MatchContractions.Check
+ MatchMinusDashChoOn.Uncheck
+ MatchRepeatcharacterMarks.Uncheck
+ MatchVariantFormKanji.Check
+ MatchOldKanaForms.Check
+ MatchDiZiDuZu.Uncheck
+ MatchBaVaHaFa.Check
+ MatchTsiThiChiDhiZi.Uncheck
+ MatchHyuFyuByuVyu.Check
+ MatchDeSheZeJe.Uncheck
+ MatchIaIya.Check
+ MatchKiKu.Uncheck
+ PunctuationCharacters.Uncheck
+ WhitespaceCharacters.Uncheck
+ ProlongedSoundmarks.Uncheck
+ MiddleDots.Check
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check changes"
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "SearchingInJapanese" )
+
+ if MatchCase.IsChecked <> TRUE then Warnlog "Match Case => changes not saved!"
+ if MatchFullHalf.IsChecked <> FALSE then Warnlog "Match Full Half => changes not saved!"
+ if MatchHiraganaKatakana.IsChecked <> TRUE then Warnlog "Match Hiragana Katakana => changes not saved!"
+ if MatchContractions.IsChecked <> TRUE then Warnlog "Match Contractions => changes not saved!"
+ if MatchMinusDashChoOn.IsChecked <> FALSE then Warnlog "Match Minus Dash Cho On => changes not saved!"
+ if MatchRepeatcharacterMarks.IsChecked <> FALSE then Warnlog "Match Repeatcharacter Marks => changes not saved!"
+ if MatchVariantFormKanji.IsChecked <> TRUE then Warnlog "Match Variant Form Kanji => changes not saved!"
+ if MatchOldKanaForms.IsChecked <> TRUE then Warnlog "Match Old Kana Forms => changes not saved!"
+ if MatchDiZiDuZu.IsChecked <> FALSE then Warnlog "Match Di Zi Du Zu => changes not saved!"
+ if MatchBaVaHaFa.IsChecked <> TRUE then Warnlog "Match Ba Va Ha Fa => changes not saved!"
+ if MatchTsiThiChiDhiZi.IsChecked <> FALSE then Warnlog "Match Tsi Thi Chi Dhi Zi => changes not saved!"
+ if MatchHyuFyuByuVyu.IsChecked <> TRUE then Warnlog "Match Hyu Iyu Byu Vyu => changes not saved!"
+ if MatchDeSheZeJe.IsChecked <> FALSE then Warnlog "Match De She Ze Je => changes not saved!"
+ if MatchIaIya.IsChecked <> TRUE then Warnlog "Match Ia Iya => changes not saved!"
+ if MatchKiKu.IsChecked <> FALSE then Warnlog "Match Ki Ku => changes not saved!"
+ if PunctuationCharacters.IsChecked <> FALSE then Warnlog "Punctuation Characters => changes not saved!"
+ if WhitespaceCharacters.IsChecked <> FALSE then Warnlog "Whitespace Characters => changes not saved!"
+ if ProlongedSoundmarks.IsChecked <> FALSE then Warnlog "Prolonged Soundmarks => changes not saved!"
+ if MiddleDots.IsChecked <> TRUE then Warnlog "Middle Dots => changes not saved!"
+
+ printlog " - reset to saved data"
+ if bSave (1 ) = TRUE then MatchCase.Check else MatchCase.UnCheck
+ if bSave (2 ) = TRUE then MatchFullHalf.Check else MatchFullHalf.UnCheck
+ if bSave (3 ) = TRUE then MatchHiraganaKatakana.Check else MatchHiraganaKatakana.UnCheck
+ if bSave (4 ) = TRUE then MatchContractions.Check else MatchContractions.UnCheck
+ if bSave (5 ) = TRUE then MatchMinusDashChoOn.Check else MatchMinusDashChoOn.UnCheck
+ if bSave (6 ) = TRUE then MatchRepeatcharacterMarks.Check else MatchRepeatcharacterMarks.UnCheck
+ if bSave (7 ) = TRUE then MatchVariantFormKanji.Check else MatchVariantFormKanji.UnCheck
+ if bSave (8 ) = TRUE then MatchOldKanaForms.Check else MatchOldKanaForms.UnCheck
+ if bSave (9 ) = TRUE then MatchDiZiDuZu.Check else MatchDiZiDuZu.UnCheck
+ if bSave (10) = TRUE then MatchBaVaHaFa.Check else MatchBaVaHaFa.UnCheck
+ if bSave (11) = TRUE then MatchTsiThiChiDhiZi.Check else MatchTsiThiChiDhiZi.UnCheck
+ if bSave (12) = TRUE then MatchHyuFyuByuVyu.Check else MatchHyuFyuByuVyu.UnCheck
+ if bSave (13) = TRUE then MatchDeSheZeJe.Check else MatchDeSheZeJe.UnCheck
+ if bSave (14) = TRUE then MatchIaIya.Check else MatchIaIya.UnCheck
+ if bSave (15) = TRUE then MatchKiKu.Check else MatchKiKu.UnCheck
+ if bSave (16) = TRUE then PunctuationCharacters.Check else PunctuationCharacters.UnCheck
+ if bSave (17) = TRUE then WhitespaceCharacters.Check else WhitespaceCharacters.UnCheck
+ if bSave (18) = TRUE then ProlongedSoundmarks.Check else ProlongedSoundmarks.UnCheck
+ if bSave (19) = TRUE then MiddleDots.Check else MiddleDots.UnCheck
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check saved data"
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "SearchingInJapanese" )
+
+ if MatchCase.IsChecked <> bSave (1 ) then Warnlog "Match Case => changes not saved!"
+ if MatchFullHalf.IsChecked <> bSave (2 ) then Warnlog "Match Full Half => changes not saved!"
+ if MatchHiraganaKatakana.IsChecked <> bSave (3 ) then Warnlog "Match Hiragana Katakana => changes not saved!"
+ if MatchContractions.IsChecked <> bSave (4 ) then Warnlog "Match Contractions => changes not saved!"
+ if MatchMinusDashChoOn.IsChecked <> bSave (5 ) then Warnlog "Match Minus Dash Cho On => changes not saved!"
+ if MatchRepeatcharacterMarks.IsChecked <> bSave (6 ) then Warnlog "Match Repeatcharacter Marks => changes not saved!"
+ if MatchVariantFormKanji.IsChecked <> bSave (7 ) then Warnlog "Match Variant Form Kanji => changes not saved!"
+ if MatchOldKanaForms.IsChecked <> bSave (8 ) then Warnlog "Match Old Kana Forms => changes not saved!"
+ if MatchDiZiDuZu.IsChecked <> bSave (9 ) then Warnlog "Match Di Zi Du Zu => changes not saved!"
+ if MatchBaVaHaFa.IsChecked <> bSave (10) then Warnlog "Match Ba Va Ha Fa => changes not saved!"
+ if MatchTsiThiChiDhiZi.IsChecked <> bSave (11) then Warnlog "Match Tsi Thi Chi Dhi Zi => changes not saved!"
+ if MatchHyuFyuByuVyu.IsChecked <> bSave (12) then Warnlog "Match Hyu Fyu Byu Vyu => changes not saved!"
+ if MatchDeSheZeJe.IsChecked <> bSave (13) then Warnlog "Match De She Ze Je => changes not saved!"
+ if MatchIaIya.IsChecked <> bSave (14) then Warnlog "Match Ia Iya => changes not saved!"
+ if MatchKiKu.IsChecked <> bSave (15) then Warnlog "Match Ki Ku => changes not saved!"
+ if PunctuationCharacters.IsChecked <> bSave (16) then Warnlog "Punctuation Characters => changes not saved!"
+ if WhitespaceCharacters.IsChecked <> bSave (17) then Warnlog "Whitespace Characters => changes not saved!"
+ if ProlongedSoundmarks.IsChecked <> bSave (18) then Warnlog "Prolonged Soundmarks => changes not saved!"
+ if MiddleDots.IsChecked <> bSave (19) then Warnlog "Middle Dots => changes not saved!"
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+endcase
+
+' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
+' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
+testcase tLanguageSettingsAsianLayout
+ Dim bSave ( 20 ) as Boolean
+ Dim sSave ( 20 ) as String
+ Dim i as Integer, iLan as Integer
+
+
+ hNewDocument
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "AsianLayout" )
+
+ printlog " - save raw data"
+ bSave ( 1 ) = WesternCharactersOnly.IsChecked
+ bSave ( 2 ) = WesternTextAndPunctuation.IsChecked
+ bSave ( 3 ) = NoCompression.IsChecked
+ bSave ( 4 ) = CompressPunctuationOnly.IsChecked
+ bSave ( 5 ) = CompressPunctuationAndJapaneseKana.IsChecked
+
+ iLan = Language.GetItemCount
+ if iLan > 4 then
+ Warnlog "There are more than 4 languages in the list. The test break here, because it can't work with more than 4 entries. Bug?!?"
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ hclosedocument
+ goto endsub
+ end if
+
+ for i=1 to iLan
+ Language.Select i
+ sSave ( i ) = Language.GetSelText
+ bSave ( 5+i ) = Standard.IsChecked
+ Standard.Uncheck
+ sSave ( 5+i ) = NoStartOfLine.GetText
+ sSave ( 10+i ) = NoEndOfLine.GetText
+ if bSave ( 5+1 ) = TRUE then
+ Standard.Check
+ else
+ Standard.Uncheck
+ end if
+ next i
+
+ printlog " - change data"
+ WesternTextAndPunctuation.Check
+ CompressPunctuationOnly.Check
+ for i=1 to Language.GetItemCount
+ Language.Select i
+ Standard.UnCheck
+ select case i
+ case 1 : NoStartOfLine.SetText "avc" : NoEndOfLine.SetText "vca"
+ case 2 : NoStartOfLine.SetText ">" : NoEndOfLine.SetText "<"
+ case 3 : NoStartOfLine.SetText "!d?$" : NoEndOfLine.SetText "!d?$"
+ case 4 : NoStartOfLine.SetText "aS$%6" : NoEndOfLine.SetText "aS$$6"
+ end select
+ next i
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+ hCloseDocument
+
+ printlog " - exit/restart StarOffice"
+ ExitRestartTheOffice
+
+ printlog " - check changes"
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "AsianLayout" )
+
+ if WesternTextAndPunctuation.IsChecked <> TRUE then Warnlog "Western Text And Punctuation => changes not saved!"
+ if CompressPunctuationOnly.IsChecked <> TRUE then Warnlog "Compress Punctuation Only => changes not saved!"
+ for i=1 to iLan
+ Language.Select i
+ if Language.GetSelText <> sSave (i) then Warnlog "The language-entries are changed!"
+ if Standard.IsChecked then
+ Warnlog sSave(i) + " : Standard is not unchecked"
+ Standard.Uncheck
+ end if
+ select case i
+ case 1 : if NoStartOfLine.GetText <> "avc" then Warnlog sSave (i) + " : NoStartOfLine -> changes not saved"
+ if NoEndOfLine.GetText <> "vca" then Warnlog sSave (i) + " : NoEndOfLine -> changes not saved"
+ case 2 : if NoStartOfLine.GetText <> ">" then Warnlog sSave (i) + " : NoStartOfLine -> changes not saved"
+ if NoEndOfLine.GetText <> "<" then Warnlog sSave (i) + " : NoEndOfLine -> changes not saved"
+ case 3 : if NoStartOfLine.GetText <> "!d?$" then Warnlog sSave (i) + " : NoStartOfLine -> changes not saved"
+ if NoEndOfLine.GetText <> "!d?$" then Warnlog sSave (i) + " : NoEndOfLine -> changes not saved"
+ case 4 : if NoStartOfLine.GetText <> "aS$%6" then Warnlog sSave (i) + " : NoStartOfLine -> changes not saved"
+ if NoEndOfLine.GetText <> "aS$$6" then Warnlog sSave (i) + " : NoEndOfLine -> changes not saved"
+ end select
+ next i
+
+ printlog " - second changes"
+ WesternCharactersOnly.Check
+ CompressPunctuationAndJapaneseKana.Check
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check changes"
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "AsianLayout" )
+
+ if WesternCharactersOnly.IsChecked <> TRUE then Warnlog "Western Characters Only => changes not saved!"
+ if CompressPunctuationAndJapaneseKana.IsChecked <> TRUE then Warnlog "Compress Punctuation And Japanese Kana => changes not saved!"
+
+ printlog " - reset to saved data"
+ if bSave ( 1 ) = TRUE then WesternCharactersOnly.Check
+ if bSave ( 2 ) = TRUE then WesternTextAndPunctuation.Check
+ if bSave ( 3 ) = TRUE then NoCompression.Check
+ if bSave ( 4 ) = TRUE then CompressPunctuationOnly.Check
+ if bSave ( 5 ) = TRUE then CompressPunctuationAndJapaneseKana.Check
+
+ for i=1 to iLan
+ Language.Select sSave(i)
+ Standard.Uncheck
+ NoStartOfLine.SetText sSave ( 5+i )
+ NoEndOfLine.SetText sSave ( 10+i )
+ if bSave ( 5+i ) = TRUE then Standard.Check else Standard.Uncheck
+ next i
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check reset"
+ ToolsOptions
+ hToolsOptions ( "LanguageSettings", "AsianLayout" )
+
+ if WesternCharactersOnly.IsChecked <> bSave ( 1 ) then Warnlog "Western Characters Only => changes not saved!"
+ if WesternTextAndPunctuation.IsChecked <> bSave ( 2 ) then Warnlog "Western Text And Punctuation => changes not saved!"
+ if NoCompression.IsChecked <> bSave ( 3 ) then Warnlog "No Compression => changes not saved!"
+ if CompressPunctuationOnly.IsChecked <> bSave ( 4 ) then Warnlog "Compress Punctuation Only => changes not saved!"
+ if CompressPunctuationAndJapaneseKana.IsChecked <> bSave ( 5 ) then Warnlog "Compress Punctuation And Japanese Kana => changes not saved!"
+ for i=1 to iLan
+ Language.Select sSave(i)
+ if Standard.IsChecked <> bSave ( 5+i ) then Warnlog sSave(i) + " : Standard -> changes not saved"
+ Standard.Uncheck
+ if NoStartOfLine.GetText <> sSave ( 5+i ) then Warnlog sSave(i) + " : NoStartOfLine -> changes not saved"
+ if NoEndOfLine.GetText <> sSave ( 10+i ) then Warnlog sSave(i) + " : NoEndOfLine -> changes not saved"
+ if bSave ( 5+i ) = TRUE then Standard.Check else Standard.Uncheck
+ next i
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+endcase
diff --git a/testautomation/framework/optional/includes/options_loadsave_general.inc b/testautomation/framework/optional/includes/options_loadsave_general.inc
new file mode 100644
index 000000000000..39885ffc2e3c
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_loadsave_general.inc
@@ -0,0 +1,284 @@
+'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 : Tools->Options Load/Save: General
+'*
+'\******************************************************************************
+
+testcase tLoadSaveGeneral
+ Dim lbSave(15) as Boolean
+ Dim lsSave(20) as String
+ Dim AppCount as Integer
+ dim i as Integer
+
+
+ ToolsOptions
+ hToolsOptions("LoadSave","General")
+ printlog " - save old settings"
+ lbSave(13) = BenutzerspezifischeEinstellungen.IsChecked
+ lbSave(1) = DokumenteigenschaftenBearbeiten.IsChecked
+ lbSave(2) = Sicherungskopie.IsChecked
+ lbSave(3) = AutomatischSpeichern.IsChecked
+
+ if AutomatischSpeichern.IsChecked then
+ lsSave(1) = Minuten.GetText
+ endif
+
+ lbSave(10) = NoPrettyPrinting.IsChecked
+ lbSave(11) = URLimDateisystem.IsChecked
+ lbSave(12) = URLimInternet.IsChecked
+
+ printlog("Listed Documenttypes are: ")
+ AppCount = Dokumenttyp.GetItemCount
+ if (AppCount > 7) then
+ Warnlog( "Seven applications should be listed, there are " & AppCount )
+ for i = 1 to AppCount
+ DokumentTyp.select(i)
+ printlog( " - " & DokumentTyp.getSelText)
+ next i
+ endif
+ for i=1 to AppCount
+ Dokumenttyp.Select(i)
+ lsSave(2+i) = Dokumenttyp.GetSelText
+ lsSave(2+AppCount+i) = Filter.GetSelText
+ next i
+
+ printlog " - invert/change settings"
+ if lbSave(13) then BenutzerspezifischeEinstellungen.UnCheck else BenutzerspezifischeEinstellungen.Check
+ if lbSave(1) then DokumenteigenschaftenBearbeiten.Uncheck else DokumenteigenschaftenBearbeiten.Check
+ if lbSave(2) then Sicherungskopie.Uncheck else Sicherungskopie.Check
+ if lbSave(3) then AutomatischSpeichern.Uncheck else AutomatischSpeichern.Check
+ if AutomatischSpeichern.IsChecked then
+ lsSave(1) = Minuten.GetText
+ Minuten.SetText "23"
+ endif
+ if lbSave(10) then NoPrettyPrinting.Uncheck else NoPrettyPrinting.Check
+ if lbSave(11) then URLimDateisystem.Uncheck else URLimDateisystem.Check
+ if lbSave(12) then URLimInternet.Uncheck else URLimInternet.Check
+ printlog( "Setting filters for documenttypes: Select third item from every list" )
+ for i=1 to AppCount
+ Dokumenttyp.Select(i)
+ Filter.Select(3)
+ printlog( "Doctype: " & Dokumenttyp.getSelText() & " has filter: " & Filter.getSelText() )
+ next i
+
+ printlog " - close options-dlg with OK"
+ kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ sleep(3)
+
+ printlog " - exit/restart StarOffice"
+ ExitRestartTheOffice
+
+ printlog " - check inverting/changes"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "General" )
+
+ if BenutzerspezifischeEinstellungen.IsChecked = lbSave ( 13 ) then
+ Warnlog "'Load user setting with document' => changes not saved"
+ endif
+ if DokumenteigenschaftenBearbeiten.IsChecked = lbSave ( 1 ) then
+ Warnlog "'Edit document properties before saving' => changes not saved"
+ endif
+ if Sicherungskopie.IsChecked = lbSave ( 2 ) then
+ Warnlog "'Create backup copy' => changes not saved"
+ endif
+ if AutomatischSpeichern.IsChecked = lbSave ( 3 ) then
+ printlog "AutoSave => changes not saved"
+ endif
+ if AutomatischSpeichern.IsChecked then
+ if Minuten.GetText <> "23" then
+ Warnlog "Minutes for AutoSave => changes not saved"
+ endif
+ endif
+ if NoPrettyPrinting.IsChecked = lbSave ( 10 ) then
+ Warnlog "no pretty printing => changes not saved"
+ endif
+ if URLimDateisystem.IsChecked = lbSave ( 11 ) then
+ Warnlog "URL: File system => changes not saved"
+ endif
+ if URLimInternet.IsChecked = lbSave ( 12 ) then
+ Warnlog "URL: Internet => changes not saved"
+ endif
+
+ printlog( "Verifying filters for documenttypes: Select third item from every list" )
+ for i=1 to AppCount
+ Dokumenttyp.Select(i)
+ printlog( "Doctype: " & Dokumenttyp.getSelText() & " has filter: " & Filter.getSelText() )
+
+ if Filter.GetSelIndex <> 3 then
+ warnlog( "#i79150# some options in Tools/Options->Load/Save->General are not saved" )
+ endif
+ next i
+
+ printlog " - make other changes"
+ BenutzerspezifischeEinstellungen.Uncheck
+ DokumenteigenschaftenBearbeiten.Check
+ Sicherungskopie.Uncheck
+ AutomatischSpeichern.Check
+ Minuten.SetText "01"
+ NoPrettyPrinting.Uncheck
+ URLimDateisystem.Uncheck
+ URLimInternet.Uncheck
+ for i=1 to AppCount
+ Dokumenttyp.Select(i)
+ Filter.Select(4)
+ next i
+
+ printlog " - close options-dlg with OK"
+
+ kontext "extrasoptionendlg"
+ ExtrasOptionenDlg.OK
+ Sleep (1)
+
+ printlog " - react on messageboxes for loosing settings after changing default-filters"
+ kontext "FilterWarning"
+ for i=1 to AppCount
+ if FilterWarning.Exists(5) then
+ FilterWarning.OK
+ else
+ i = AppCount + 1
+ endif
+ next i
+ Sleep (3)
+
+ printlog " - check second changes"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "General" )
+
+ if BenutzerspezifischeEinstellungen.IsChecked <> FALSE then
+ Warnlog "'Load user setting with document' => changes not saved"
+ endif
+ if DokumenteigenschaftenBearbeiten.IsChecked <> TRUE then
+ Warnlog "'Edit document properties before saving' => changes not saved"
+ endif
+ if Sicherungskopie.IsChecked <> FALSE then
+ Warnlog "'Create backup copy' => changes not saved"
+ endif
+ if AutomatischSpeichern.IsChecked <> TRUE then
+ Warnlog "AutoSave => changes not saved"
+ endif
+ if Minuten.GetText <> "1" then
+ Warnlog "Minutes for AutoSave => changes not saved"
+ endif
+ if NoPrettyPrinting.IsChecked <> FALSE then
+ Warnlog "no pretty printing => changes not saved"
+ endif
+ if URLimDateisystem.IsChecked <> FALSE then
+ Warnlog "URL: File system => changes not saved"
+ endif
+ if URLimInternet.IsChecked <> FALSE then
+ Warnlog "URL: Internet => changes not saved"
+ endif
+ for i=1 to AppCount
+ Dokumenttyp.Select(i)
+ if Filter.GetSelIndex <> 4 then
+ Warnlog "Document '" + Dokumenttyp.GetSelText + "': changes not saved"
+ endif
+ next i
+
+ printlog " - reset to saved settings"
+ if lbSave ( 13 ) = FALSE then
+ BenutzerspezifischeEinstellungen.UnCheck else BenutzerspezifischeEinstellungen.Check
+ endif
+ if lbSave ( 1 ) = FALSE then
+ DokumenteigenschaftenBearbeiten.UnCheck else DokumenteigenschaftenBearbeiten.Check
+ endif
+ if lbSave ( 2 ) = FALSE then
+ Sicherungskopie.Uncheck else Sicherungskopie.Check
+ endif
+ AutomatischSpeichern.Check
+ Minuten.SetText lsSave ( 1 )
+ if lbSave ( 3 ) = FALSE then
+ AutomatischSpeichern.Uncheck else AutomatischSpeichern.Check
+ endif
+ if lbSave ( 10 ) = FALSE then
+ NoPrettyPrinting.Uncheck else NoPrettyPrinting.Check
+ endif
+ if lbSave ( 11 ) = FALSE then
+ URLimDateisystem.UnCheck else URLimDateisystem.Check
+ endif
+ if lbSave ( 12 ) = FALSE then
+ URLimInternet.UnCheck else URLimInternet.Check
+ endif
+ for i=1 to AppCount
+ Dokumenttyp.Select(i)
+ if Dokumenttyp.GetSelText <> lsSave ( 2 + i ) then
+ Warnlog "The sorting of the document-listbox has been changed!"
+ endif
+ Filter.Select(lsSave(2+AppCount+i))
+ next i
+
+ kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check settings"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "General" )
+
+ if BenutzerspezifischeEinstellungen.IsChecked <> lbSave ( 13 ) then
+ Warnlog "'Load user setting with document' => changes not saved"
+ endif
+ if DokumenteigenschaftenBearbeiten.IsChecked <> lbSave ( 1 ) then
+ Warnlog "'Edit document properties before saving' => changes not saved"
+ endif
+ if Sicherungskopie.IsChecked <> lbSave ( 2 ) then
+ Warnlog "'Create backup copy' => changes not saved"
+ endif
+ if AutomatischSpeichern.IsChecked <> lbSave ( 3 ) then
+ Warnlog "AutoSave => changes not saved"
+ endif
+ if AutomatischSpeichern.IsChecked then
+ if Minuten.GetText <> lsSave( 1 ) then
+ Warnlog "Minutes for AutoSave => changes not saved"
+ endif
+ endif
+ if NoPrettyPrinting.IsChecked <> lbSave ( 10 ) then
+ Warnlog "no pretty printing => changes not saved"
+ endif
+ if URLimDateisystem.IsChecked <> lbSave ( 11 ) then
+ Warnlog "URL: File system => changes not saved"
+ endif
+ if URLimInternet.IsChecked <> lbSave ( 12 ) then
+ Warnlog "URL: Internet => changes not saved"
+ endif
+ for i=1 to AppCount
+ Dokumenttyp.Select(i)
+ if Dokumenttyp.GetSelText <> lsSave ( 2 + i ) then
+ Warnlog "The sorting of the document-listbox has been changed!"
+ endif
+ if Filter.GetSelText <> lsSave ( 2 + AppCount + i ) then
+ Warnlog "Document '" + Dokumenttyp.GetSelText + "': changes not saved"
+ endif
+ next i
+
+ kontext "extrasoptionendlg"
+ ExtrasOptionenDlg.OK
+endcase
diff --git a/testautomation/framework/optional/includes/options_loadsave_html.inc b/testautomation/framework/optional/includes/options_loadsave_html.inc
new file mode 100644
index 000000000000..072f4f4dea24
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_loadsave_html.inc
@@ -0,0 +1,220 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Test the Load/Save HTML compatibility page
+'*
+'\******************************************************************************
+
+testcase tLoadSaveHTML
+
+ Dim lbSave ( 10 ) as Boolean
+ Dim lsSave2 ( 8 ) as String
+ Dim lsSave ( 10 ) as String
+ Dim i as Integer
+
+
+ hNewDocument
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "HTMLCompatibility" )
+
+ printlog " - save old settings"
+ lsSave ( 1 ) = Groesse1.GetText
+ lsSave ( 2 ) = Groesse2.GetText
+ lsSave ( 3 ) = Groesse3.GetText
+ lsSave ( 4 ) = Groesse4.GetText
+ lsSave ( 5 ) = Groesse5.GetText
+ lsSave ( 6 ) = Groesse6.GetText
+ lsSave ( 7 ) = Groesse7.GetText
+ lbSave ( 1 ) = UnbekannteHTML.IsChecked
+ lbSave ( 2 ) = FontEinstellungen.IsChecked
+ lbSave ( 3 ) = StarBasic.IsChecked
+ lbSave ( 4 ) = WarnungAnzeigen.IsChecked
+ lbSave ( 5 ) = Drucklayout.IsChecked
+ lbSave ( 6 ) = Grafikenkopieren.IsChecked
+ lsSave ( 8 ) = Export.GetSelText
+ lsSave ( 9 ) = Zeichensatz.GetSelText
+ lbSave ( 7 ) = UseEnglishlocaleForNumbers.isChecked
+
+ printlog " - change/invert settings"
+ Groesse1.More 1 : lsSave2 (1) = Groesse1.GetText
+ Groesse2.More 2 : lsSave2 (2) = Groesse2.GetText
+ Groesse3.More 3 : lsSave2 (3) = Groesse3.GetText
+ Groesse4.More 4 : lsSave2 (4) = Groesse4.GetText
+ Groesse5.More 5 : lsSave2 (5) = Groesse5.GetText
+ Groesse6.More 6 : lsSave2 (6) = Groesse6.GetText
+ Groesse7.More 7 : lsSave2 (7) = Groesse7.GetText
+ if lbSave ( 1 ) = TRUE then UnbekannteHTML.Uncheck else UnbekannteHTML.Check
+ if lbSave ( 2 ) = TRUE then FontEinstellungen.Uncheck else FontEinstellungen.Check
+ if FontEinstellungen.IsChecked <> TRUE then
+ if lbSave ( 3 ) = TRUE then StarBasic.Uncheck else StarBasic.Check
+ end if
+ if lbSave ( 4 ) = TRUE then WarnungAnzeigen.Uncheck else WarnungAnzeigen.Check
+ if lbSave ( 5 ) = TRUE then Drucklayout.Uncheck else Drucklayout.Check
+ if lbSave ( 6 ) = TRUE then Grafikenkopieren.Uncheck else Grafikenkopieren.Check
+ if lbSave ( 7 ) = TRUE then UseEnglishlocaleForNumbers.Uncheck else UseEnglishlocaleForNumbers.Check
+ Export.Select 1
+ Zeichensatz.Select 10
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ hCloseDocument
+
+ printlog " - exit/restart StarOffice"
+ ExitRestartTheOffice
+
+ printlog " - check inverting / changes"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "HTMLCompatibility" )
+
+ if Groesse1.GetText <> lsSave2 (1) then Warnlog "Size 1 => changes not saved!"
+ if Groesse2.GetText <> lsSave2 (2) then Warnlog "Size 2 => changes not saved!"
+ if Groesse3.GetText <> lsSave2 (3) then Warnlog "Size 3 => changes not saved!"
+ if Groesse4.GetText <> lsSave2 (4) then Warnlog "Size 4 => changes not saved!"
+ if Groesse5.GetText <> lsSave2 (5) then Warnlog "Size 5 => changes not saved!"
+ if Groesse6.GetText <> lsSave2 (6) then Warnlog "Size 6 => changes not saved!"
+ if Groesse7.GetText <> lsSave2 (7) then Warnlog "Size 7 => changes not saved!"
+ if UnbekannteHTML.IsChecked = lbSave ( 1 ) then Warnlog "Unknown HTML => changes not saved!"
+ if FontEinstellungen.IsChecked = lbSave ( 2 ) then Warnlog "Font settings => changes not saved!"
+ if FontEinstellungen.IsChecked <> TRUE then
+ if StarBasic.IsChecked = lbSave ( 3 ) then Warnlog "StarBasic => changes not saved!"
+ end if
+ if WarnungAnzeigen.IsChecked = lbSave ( 4 ) then Warnlog "Show Warnings => changes not saved!"
+ if Drucklayout.IsEnabled then
+ if Drucklayout.IsChecked = lbSave ( 5 ) then Warnlog "Printlayout => changes not saved!"
+ end if
+ if Grafikenkopieren.IsChecked = lbSave ( 6 ) then Warnlog "Copy graphics => changes not saved!"
+ if UseEnglishlocaleForNumbers.IsChecked = lbSave ( 7 ) then Warnlog "UseEnglishlocaleForNumbers => changes not saved!"
+ if Export.GetSelIndex <> 1 then Warnlog "Export => changes not saved!"
+ if Zeichensatz.GetSelIndex <> 10 then Warnlog "Font => changes not saved!"
+
+ printlog " - 2. changes"
+ Groesse1.SetText "6"
+ Groesse2.SetText "9"
+ Groesse3.SetText "10"
+ Groesse4.SetText "11"
+ Groesse5.SetText "20"
+ Groesse6.SetText "38"
+ Groesse7.SetText "50"
+ UnbekannteHTML.Uncheck
+ FontEinstellungen.Check
+ Export.Select 2
+ StarBasic.UnCheck
+ WarnungAnzeigen.UnCheck
+ Drucklayout.Check
+ Grafikenkopieren.Check
+ UseEnglishlocaleForNumbers.Check
+ Zeichensatz.Select 2
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check 2. changes"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "HTMLCompatibility" )
+
+ if Groesse1.GetText <> "6" then Warnlog "Size 1 => changes not saved!"
+ if Groesse2.GetText <> "9" then Warnlog "Size 2 => changes not saved!"
+ if Groesse3.GetText <> "10" then Warnlog "Size 3 => changes not saved!"
+ if Groesse4.GetText <> "11" then Warnlog "Size 4 => changes not saved!"
+ if Groesse5.GetText <> "20" then Warnlog "Size 5 => changes not saved!"
+ if Groesse6.GetText <> "38" then Warnlog "Size 6 => changes not saved!"
+ if Groesse7.GetText <> "50" then Warnlog "Size 7 => changes not saved!"
+ if UnbekannteHTML.IsChecked <> FALSE then Warnlog "Unknown HTML => changes not saved!"
+ if FontEinstellungen.IsChecked <> TRUE then Warnlog "Font settings => changes not saved!"
+ if StarBasic.IsChecked <> FALSE then
+ Warnlog "StarBasic => changes not saved!"
+ else
+ if WarnungAnzeigen.IsChecked <> FALSE then Warnlog "Show Warnings => changes not saved!"
+ end if
+ if Drucklayout.IsEnabled then
+ if Drucklayout.IsChecked <> TRUE then Warnlog "Printlayout => changes not saved!"
+ end if
+ if Grafikenkopieren.IsChecked <> TRUE then Warnlog "Copy graphics => changes not saved!"
+ if UseEnglishlocaleForNumbers.IsChecked <> TRUE then Warnlog "UseEnglishlocaleForNumbers => changes not saved!"
+ if Export.GetSelIndex <> 2 then Warnlog "Export => changes not saved!"
+ if Zeichensatz.GetSelIndex <> 2 then Warnlog "Font => changes not saved!"
+
+ printlog " - reset to saved settings"
+ Groesse1.SetText lsSave (1)
+ Groesse2.SetText lsSave (2)
+ Groesse3.SetText lsSave (3)
+ Groesse4.SetText lsSave (4)
+ Groesse5.SetText lsSave (5)
+ Groesse6.SetText lsSave (6)
+ Groesse7.SetText lsSave (7)
+ if lbSave(1) = TRUE then UnbekannteHTML.Check else UnbekannteHTML.UnCheck
+ if lbSave(2) = TRUE then FontEinstellungen.Check else FontEinstellungen.UnCheck
+ StarBasic.Uncheck
+ if lbSave(4) = TRUE then WarnungAnzeigen.Check else WarnungAnzeigen.UnCheck
+
+ if lbSave(3) = TRUE then StarBasic.Check else StarBasic.UnCheck
+ Export.Select lsSave ( 8 )
+ if lbSave(5) = TRUE then Drucklayout.Check else Drucklayout.UnCheck
+ if lbSave(6) = TRUE then Grafikenkopieren.Check else Grafikenkopieren.UnCheck
+ if lbSave(7) = TRUE then UseEnglishlocaleForNumbers.Check else UseEnglishlocaleForNumbers.UnCheck
+ Export.Select lsSave ( 8 )
+ Zeichensatz.Select lsSave ( 9 )
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check default settings"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "HTMLCompatibility" )
+
+ if Groesse1.GetText <> lsSave (1) then Warnlog "Size 1 => changes not saved!"
+ if Groesse2.GetText <> lsSave (2) then Warnlog "Size 2 => changes not saved!"
+ if Groesse3.GetText <> lsSave (3) then Warnlog "Size 3 => changes not saved!"
+ if Groesse4.GetText <> lsSave (4) then Warnlog "Size 4 => changes not saved!"
+ if Groesse5.GetText <> lsSave (5) then Warnlog "Size 5 => changes not saved!"
+ if Groesse6.GetText <> lsSave (6) then Warnlog "Size 6 => changes not saved!"
+ if Groesse7.GetText <> lsSave (7) then Warnlog "Size 7 => changes not saved!"
+ if UnbekannteHTML.IsChecked <> lbSave(1) then Warnlog "Unknown HTML => changes not saved!"
+ if FontEinstellungen.IsChecked <> lbSave(2) then Warnlog "Font settings => changes not saved!"
+ if StarBasic.IsChecked <> lbSave(3) then Warnlog "StarBasic => changes not saved!"
+ StarBasic.Uncheck
+ if WarnungAnzeigen.IsChecked <> lbSave(4) then Warnlog "Show Warnings => changes not saved!"
+
+ if lbSave(3) = TRUE then StarBasic.Check else StarBasic.UnCheck
+ if Drucklayout.IsEnabled then
+ if Drucklayout.IsChecked <> lbSave(5) then Warnlog "Printlayout => changes not saved!"
+ end if
+ if Grafikenkopieren.IsChecked <> lbSave(6) then Warnlog "Copy graphics => changes not saved!"
+ if UseEnglishlocaleForNumbers.IsChecked <> lbSave(7) then Warnlog "UseEnglishlocaleForNumbers => changes not saved!"
+ if Export.GetSeltext <> lsSave (8) then Warnlog "Export => changes not saved!"
+ if Zeichensatz.GetSeltext <> lsSave (9) then Warnlog "Font => changes not saved!"
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+
+endcase
diff --git a/testautomation/framework/optional/includes/options_loadsave_msoffice.inc b/testautomation/framework/optional/includes/options_loadsave_msoffice.inc
new file mode 100644
index 000000000000..b02f4778fd02
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_loadsave_msoffice.inc
@@ -0,0 +1,127 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Test Load/Save MS-Office settings page
+'*
+'\******************************************************************************
+
+testcase tLoadSaveMSOffice
+
+ Dim lbSave1 ( 9 ) as Boolean
+ Dim lbSave2 ( 9 ) as Boolean
+ Dim i as Integer
+ printlog "If you get errors in this test, please check the settings."
+ printlog "This test can only run without an error, when all checkboxes are checked or all are unchecked."
+
+
+ hNewDocument
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "MicrosoftOffice" )
+
+ printlog " - save old settings"
+ Auswahl.TypeKeys "<PageUp>"
+ for i=1 to 4
+ lbSave1(i) = Auswahl.IsChecked (1)
+ lbSave2(i) = Auswahl.IsChecked (2)
+ Auswahl.TypeKeys "<Down>"
+ next i
+
+
+ Auswahl.TypeKeys "<PageUp>"
+ for i=1 to 4
+
+ printlog( " - invert setting: " + i )
+
+ if lbSave1(i) = TRUE then
+ if lbSave2(i) = FALSE then Auswahl.TypeKeys ("<Space>") ' 2. checkboxes must be checked
+ if lbSave2(i) = TRUE then Auswahl.TypeKeys ("<Space><Space><Space>") ' 2. checkboxes must be unchecked
+ else
+ if lbSave2(i) = FALSE then Auswahl.TypeKeys ("<Space>") ' 2. checkboxes must be checked
+ if lbSave2(i) = TRUE then Auswahl.TypeKeys ("<Space><Space><Space>") ' 2. checkboxes must be unchecked
+ end if
+
+ Auswahl.TypeKeys ("<Down>")
+
+ next i
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ hCloseDocument
+
+ printlog " - exit/restart StarOffice"
+ ExitRestartTheOffice
+
+ printlog " - check inverting"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "MicrosoftOffice" )
+
+ Auswahl.TypeKeys( "<PageUp>" )
+ for i=1 to 4
+ if Auswahl.IsChecked(1) = lbSave1(i) then warnlog "Entry " + i + ": state of 1. checkbox isn't saved"
+ if Auswahl.IsChecked(2) = lbSave2(i) then warnlog "Entry " + i + ": state of 2. checkbox isn't saved"
+ Auswahl.TypeKeys( "<Down>" )
+ next i
+
+ printlog " - reset to saved settings"
+ Auswahl.TypeKeys "<PageUp>"
+ for i=1 to 4
+
+ if lbSave1(i) = TRUE then
+ if lbSave2(i) = FALSE then Auswahl.TypeKeys ("<Space><Space><Space>") ' 2. checkboxes must be unchecked
+ if lbSave2(i) = TRUE then Auswahl.TypeKeys ("<Space>") ' 2. checkboxes must be checked
+ else
+ if lbSave2(i) = FALSE then Auswahl.TypeKeys ("<Space><Space><Space>") ' 2. checkboxes must be unchecked
+ if lbSave2(i) = TRUE then Auswahl.TypeKeys ("<Space>") ' 2. checkboxes must be checked
+ end if
+
+ Auswahl.TypeKeys ("<Down>")
+
+ next i
+
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check default settings"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "MicrosoftOffice" )
+
+ for i=1 to 4
+ if Auswahl.IsChecked(1) <> lbSave1(i) then warnlog "Entry " + i + ": state of 1. checkbox isn't saved"
+ if Auswahl.IsChecked(2) <> lbSave2(i) then warnlog "Entry " + i + ": state of 2. checkbox isn't saved"
+ Auswahl.TypeKeys "<Down>"
+ next i
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+
+endcase
diff --git a/testautomation/framework/optional/includes/options_loadsave_vba.inc b/testautomation/framework/optional/includes/options_loadsave_vba.inc
new file mode 100644
index 000000000000..3238f4de37d6
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_loadsave_vba.inc
@@ -0,0 +1,129 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Test VBA settings-page
+'*
+'\******************************************************************************
+
+testcase tLoadSaveVBA
+
+ Dim lbSave ( 7 ) as Boolean
+
+
+ hNewDocument
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "VBAProperties" )
+
+ printlog " - save old settings"
+ lbSave ( 1 ) = WinwordBasicLaden.IsChecked
+ lbSave ( 2 ) = WinwordBasicSpeichern.IsChecked
+ lbSave ( 3 ) = ExcelBasicLaden.IsChecked
+ lbSave ( 4 ) = ExcelBasicSpeichern.IsChecked
+ lbSave ( 5 ) = PowerpointBasicLaden.IsChecked
+ lbSave ( 6 ) = PowerpointBasicSpeichern.IsChecked
+
+ printlog " - invert settings"
+ if lbSave ( 1 ) = TRUE then WinwordBasicLaden.UnCheck else WinwordBasicLaden.Check
+ if lbSave ( 2 ) = TRUE then WinwordBasicSpeichern.UnCheck else WinwordBasicSpeichern.Check
+ if lbSave ( 3 ) = TRUE then ExcelBasicLaden.UnCheck else ExcelBasicLaden.Check
+ if lbSave ( 4 ) = TRUE then ExcelBasicSpeichern.UnCheck else ExcelBasicSpeichern.Check
+ if lbSave ( 5 ) = TRUE then PowerpointBasicLaden.UnCheck else PowerpointBasicLaden.Check
+ if lbSave ( 6 ) = TRUE then PowerpointBasicSpeichern.UnCheck else PowerpointBasicSpeichern.Check
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ hCloseDocument
+
+ printlog " - exit/restart StarOffice"
+ ExitRestartTheOffice
+
+ printlog " - check inverting"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "VBAProperties" )
+
+ if WinwordBasicLaden.IsChecked = lbSave ( 1 ) then Warnlog "'Load Winword basic' => changes not saved!"
+ if WinwordBasicSpeichern.IsChecked = lbSave ( 2 ) then Warnlog "'Save Winword basic' => changes not saved!"
+ if ExcelBasicLaden.IsChecked = lbSave ( 3 ) then Warnlog "'Load Excel basic' => changes not saved!"
+ if ExcelBasicSpeichern.IsChecked = lbSave ( 4 ) then Warnlog "'Save Excel basic' => changes not saved!"
+ if PowerpointBasicLaden.IsChecked = lbSave ( 5 ) then Warnlog "'Load Powerpoint basic' => changes not saved!"
+ if PowerpointBasicSpeichern.IsChecked = lbSave ( 6 ) then Warnlog "'Save Powerpoint basic' => changes not saved!"
+
+ printlog " - make other changes"
+ WinwordBasicLaden.Check
+ WinwordBasicSpeichern.Uncheck
+ ExcelBasicLaden.Uncheck
+ ExcelBasicSpeichern.Check
+ PowerpointBasicLaden.Uncheck
+ PowerpointBasicSpeichern.Check
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check changes"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "VBAProperties" )
+
+ if WinwordBasicLaden.IsChecked <> TRUE then Warnlog "'Load Winword basic' => changes not saved!"
+ if WinwordBasicSpeichern.IsChecked <> FALSE then Warnlog "'Save Winword basic' => changes not saved!"
+ if ExcelBasicLaden.IsChecked <> FALSE then Warnlog "'Load Excel basic' => changes not saved!"
+ if ExcelBasicSpeichern.IsChecked <> TRUE then Warnlog "'Save Excel basic' => changes not saved!"
+ if PowerpointBasicLaden.IsChecked <> FALSE then Warnlog "'Load Powerpoint basic' => changes not saved!"
+ if PowerpointBasicSpeichern.IsChecked <> TRUE then Warnlog "'Save Powerpoint basic' => changes not saved!"
+
+ printlog " - reset to saved settings"
+
+ if lbSave ( 1 ) = TRUE then WinwordBasicLaden.Check else WinwordBasicLaden.UnCheck
+ if lbSave ( 2 ) = TRUE then WinwordBasicSpeichern.Check else WinwordBasicSpeichern.UnCheck
+ if lbSave ( 3 ) = TRUE then ExcelBasicLaden.Check else ExcelBasicLaden.UnCheck
+ if lbSave ( 4 ) = TRUE then ExcelBasicSpeichern.Check else ExcelBasicSpeichern.UnCheck
+ if lbSave ( 5 ) = TRUE then PowerpointBasicLaden.Check else PowerpointBasicLaden.UnCheck
+ if lbSave ( 6 ) = TRUE then PowerpointBasicSpeichern.Check else PowerpointBasicSpeichern.UnCheck
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check settings"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "VBAProperties" )
+
+ if WinwordBasicLaden.IsChecked <> lbSave ( 1 ) then Warnlog "'Load Winword basic' => changes not saved!"
+ if WinwordBasicSpeichern.IsChecked <> lbSave ( 2 ) then Warnlog "'Save Winword basic' => changes not saved!"
+ if ExcelBasicLaden.IsChecked <> lbSave ( 3 ) then Warnlog "'Load Excel basic' => changes not saved!"
+ if ExcelBasicSpeichern.IsChecked <> lbSave ( 4 ) then Warnlog "'Save Excel basic' => changes not saved!"
+ if PowerpointBasicLaden.IsChecked <> lbSave ( 5 ) then Warnlog "'Load Powerpoint basic' => changes not saved!"
+ if PowerpointBasicSpeichern.IsChecked <> lbSave ( 6 ) then Warnlog "'Save Powerpoint basic' => changes not saved!"
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+
+endcase
diff --git a/testautomation/framework/optional/includes/options_ls_2.inc b/testautomation/framework/optional/includes/options_ls_2.inc
new file mode 100644
index 000000000000..f3e9cee13250
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_ls_2.inc
@@ -0,0 +1,307 @@
+'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 : (functionality test for load/save group)
+'*
+'\******************************************************************************
+
+testcase func_LoadSaveGeneral_1
+
+ warnlog( "#i95523# - cannot access custom tabpage on document info dialog" )
+ goto endsub
+
+ Dim bSave as boolean, bPromptSave as boolean
+ Dim sSaveTime as String
+ Dim sFilename, sFilebak as String
+ Dim i as Integer
+
+ gApplication = "WRITER"
+
+
+ sFilename = ConvertPath ( gOfficePath + "user\work\o_save.sxw" )
+ sFilebak = ConvertPath ( gOfficePath + "user\backup\o_save.bak" )
+
+ if app.Dir ( sFilename ) <> "" then app.kill ( sFilename )
+ if app.Dir ( sFilebak ) <> "" then app.kill ( sFilebak )
+
+ printlog " - save"
+ printlog " - document properties before saving"
+ printlog " open a new document"
+ hNewDocument
+
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "tools/options/load-save/general: save-> edit document properties before saving<Return>"
+ printlog " open tools / options / load & save / general"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "General" )
+
+ printlog " check 'document properties before saving'"
+ bSave = DokumenteigenschaftenBearbeiten.IsChecked
+ DokumenteigenschaftenBearbeiten.Check
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (2)
+ printlog " save the document"
+
+ FileSaveAs
+ Kontext "SpeichernDlg"
+ Dateiname.SetText sFilename
+ Sleep (1)
+ Speichern.Click
+ Sleep (1)
+ kontext
+ 'overwrite warning on rerun
+ if active.exists(3) then
+ active.yes
+ endif
+
+ printlog " activate all tabpages on properties dialog and cancel it"
+ try
+ Kontext
+ active.SetPage( TabDokument)
+ active.SetPage TabDokumentinfo
+ active.SetPage TabBenutzer
+ active.SetPage TabInternet
+ active.SetPage TabStatistik
+ Kontext "TabStatistik"
+ TabStatistik.Cancel
+ catch
+ Warnlog "Perhaps the document properties aren't active after saving => the dialog come not up after file save!"
+ endcatch
+
+ printlog " - always create backup copy"
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "tools/options/load-save/general: save-> always create backup copy<Return>"
+ printlog " open tools / options / load & save / general"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "General" )
+
+ if bSave = TRUE then DokumenteigenschaftenBearbeiten.Check else DokumenteigenschaftenBearbeiten.UnCheck
+ bSave = Sicherungskopie.IsChecked
+ Sicherungskopie.Check
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ if app.Dir ( sFilebak ) <> "" then Warnlog "Before saving the document the backup-file exists!"
+ hFileSave
+ if app.Dir ( sFilebak ) = "" then Warnlog "After saving the document the backup-file doesn't exists => BUG!"
+
+ printlog " - autosave : after 1 min, with prompt"
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "tools/options/load-save/general: save-> autosave after 1 min with prompt<Return>"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "General" )
+
+ if bSave = TRUE then Sicherungskopie.Check else Sicherungskopie.UnCheck
+ bSave = AutomatischSpeichern.IsChecked
+ AutomatischSpeichern.Check
+ sSaveTime = 15 'debug
+
+ Minuten.SetText "2"
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (130)
+
+ for i=1 to 2
+ Kontext "Active"
+ if Active.Exists (3) then
+ Active.Yes
+ Kontext "SpeichernDlg"
+ if SpeichernDlg.Exists then SpeichernDlg.Cancel
+ Sleep (2)
+ printlog "Active came up :-) " + i
+ else
+ printlog "Active didn't come up :-( " + i
+ end if
+ next i
+
+ printlog " - close the document and check the saved data"
+ hCloseDocument ' closes the document with 'discard'
+ hFileOpen ( sFilename )
+kontext
+if active.exists(5) then
+warnlog active.gettext
+goto endsub
+endif
+ ' This part compares the content of the file after reload with text entered
+ ' during the entire test. It should contain three lines of text.
+ printlog( " - Compare the content of the file with the text entered during the test." )
+ printlog( " First line..." )
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "<Up>", 5
+ DocumentWriter.TypeKeys "<Home>"
+ DocumentWriter.TypeKeys "<Shift End>"
+ EditCopy
+ WaitSlot()
+ if lcase ( GetClipboardText ) <> "tools/options/load-save/general: save-> edit document properties before saving" then Warnlog "The first sentence is wrong!"
+
+ printlog( " Second line..." )
+ DocumentWriter.TypeKeys "<Down>"
+ DocumentWriter.TypeKeys "<Home>"
+ DocumentWriter.TypeKeys "<Shift End>"
+ EditCopy
+ WaitSlot()
+ if lcase ( GetClipboardText ) <> "tools/options/load-save/general: save-> always create backup copy" then Warnlog "The second sentence is wrong!"
+
+ printlog( " Third line..." )
+ DocumentWriter.TypeKeys "<Down>"
+ DocumentWriter.TypeKeys "<Home>"
+ DocumentWriter.TypeKeys "<Shift End>"
+ EditCopy
+ WaitSlot()
+ if lcase ( GetClipboardText ) <> "tools/options/load-save/general: save-> autosave after 1 min with prompt" then Warnlog "The third sentence is wrong!"
+
+ hCloseDocument
+
+ printlog " - load the backup-file"
+ hOpenFile ( sFilebak )
+
+ Kontext "Filterauswahl"
+ if Filterauswahl.Exists(2) then
+ warnlog "Is bugId 107399 present? => Detection of our own fileformar fails when the extension is not the standard extension!"
+ Filterauswahl.Close
+ else
+ Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys "<Up>", 5
+ DocumentWriter.TypeKeys "<Home>"
+ DocumentWriter.TypeKeys "<Shift End>"
+ EditCopy
+
+ WaitSlot()
+
+ if GetClipboardText <> "" then
+ call hCloseDocument
+ else
+ warnlog "Perhaps the bak-file was not loaded. => Verify BugID 86607!"
+ end if
+ end if
+
+ printlog " - reset options"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "General" )
+ AutomatischSpeichern.Check
+ Minuten.SetText sSaveTime
+ if bSave = TRUE then AutomatischSpeichern.Check else AutomatischSpeichern.UnCheck
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+
+endcase
+
+' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
+' > * > * > * > * > * > * > * > * > * > * > * > * > * > * > * > *
+testcase func_LoadSaveGeneral_2
+ Dim bSave as Boolean
+ Dim sFilename, sFilename2, sCharSet as String
+
+ const ICWAIT as integer = 1
+
+
+ sFilename = ConvertPath ( gOfficePath + "user\work\o_save_1.html" )
+ sFilename2 = ConvertPath ( gOfficePath + "user\work\o_save_2.html" )
+
+ if app.dir ( sFilename ) <> "" then app.kill ( sFilename )
+ if app.dir ( sFilename2 ) <> "" then app.kill ( sFilename2 )
+
+ printlog " - save"
+ printlog " - save URL relative to"
+
+ if bAsianLan = TRUE then
+ sCharSet = GetHTMLCharSet
+ if SetHTMLCharSetToUTF8 = FALSE then
+ Warnlog "The test cannot find the UTF8 Character Set for HTML-Export. The test can have many errors at saving HTML-Files!"
+ else
+ printlog "The Character Set for HTML-Export is now Unicode UTF8!"
+ end if
+ end if
+
+ gApplication = "HTML"
+ hNewDocument
+
+ if gNetzInst = TRUE then
+ hGrafikEinfuegen ( ConvertPath ( gNetzOfficePath + "share\gallery\photos\desert1.jpg" ) )
+ else
+ hGrafikEinfuegen ( ConvertPath ( gOfficePath + "share\gallery\photos\desert1.jpg" ) )
+ end if
+
+ printlog " - relative to filesystem"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "General" )
+
+ bSave = URLimDateisystem.IsChecked
+ URLimDateisystem.Check
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (2)
+
+ printlog " save the HTML file"
+ hFileSaveAs ( sFilename )
+
+ printlog " check the relativ path in source code of HTML file"
+ Call URLGraphicCheck ( TRUE, sFilename )
+
+ printlog " - relative to filesystem ( unchecked )"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "General" )
+
+ URLimDateisystem.UnCheck
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (2)
+
+ printlog " save the HTML file"
+ hFileSaveAs ( sFilename2 )
+
+ printlog " check the hard coded path in source code of HTML file"
+ Call URLGraphicCheck ( FALSE, sFilename2 )
+
+ hCloseDocument
+
+ printlog " - reset the options"
+ ToolsOptions
+ hToolsOptions ( "LoadSave", "General" )
+
+ if bSave = TRUE then URLimDateisystem.Check else URLimDateisystem.UnCheck
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (2)
+
+ printlog "No test for 'relative to internet'"
+
+ if bAsianLan = TRUE then
+ printlog Chr(13 ) + "Reset the Character Set back to default : " + sCharSet
+ SetHTMLCharSet ( sCharSet )
+ end if
+
+ gApplication = "WRITER"
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/options_ooo_accessibility.inc b/testautomation/framework/optional/includes/options_ooo_accessibility.inc
new file mode 100644
index 000000000000..93e389a67d69
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_ooo_accessibility.inc
@@ -0,0 +1,185 @@
+'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 : Tools->Options: OpenOffice.org Accessibility
+'*
+'\******************************************************************************
+
+testcase tOOoAccessibility
+
+ Dim lbSave ( 10 ) as Boolean
+ Dim sSave as String
+
+ printlog " - save default setting"
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Accessibility" )
+
+ lbSave (9) = AutomaticDetectHC.IsChecked
+ lbSave (2) = ForPagePreviews.IsChecked
+ lbSave (3) = HelpTips.IsChecked
+ sSave = After.GetText
+ lbSave (4) = AllowAnimatedGraphics.IsChecked
+ lbSave (5) = AllowAnimatedText.IsChecked
+ lbSave (6) = AlwaysUseAutomaticFontColor.IsChecked
+ 'lbSave (7) = UseSystemFont.IsChecked
+ lbSave (10) = UseTextSelectionCursor.IsChecked
+ if SupportAssistiveTechnologyTools.Exists and SupportAssistiveTechnologyTools.IsVisible then
+ lbSave (8) = SupportAssistiveTechnologyTools.IsChecked
+ end if
+
+
+ printlog " - revers/change settings"
+ if lbSave (9) = TRUE then AutomaticDetectHC.UnCheck else AutomaticDetectHC.Check
+ if lbSave (2) = TRUE then ForPagePreviews.Uncheck else ForPagePreviews.Check
+ HelpTips.Check
+ After.SetText "17"
+ if lbSave (3) = TRUE then HelpTips.Uncheck else HelpTips.Check
+ if lbSave (4) = TRUE then AllowAnimatedGraphics.Uncheck else AllowAnimatedGraphics.Check
+ if lbSave (5) = TRUE then AllowAnimatedText.Uncheck else AllowAnimatedText.Check
+ if lbSave (6) = TRUE then AlwaysUseAutomaticFontColor.Uncheck else AlwaysUseAutomaticFontColor.Check
+ 'if lbSave (7) = TRUE then UseSystemFont.Uncheck else UseSystemFont.Check
+ if lbSave (10) = TRUE then UseTextSelectionCursor.Uncheck else UseTextSelectionCursor.Check
+ if SupportAssistiveTechnologyTools.Exists and SupportAssistiveTechnologyTools.IsVisible then
+ if (gPlatgroup <> "unx") then
+ Printlog "'Support assistive technology tools' won't be tested due to system dialog could come up and look the test out :-("
+ else
+ Warnlog "unexpected error 4711 :-)"
+ endif
+' if lbSave (8) = TRUE then SupportAssistiveTechnologyTools.Uncheck else SupportAssistiveTechnologyTools.Check
+ else
+ if (gPlatgroup <> "unx") then
+ Warnlog "'Support assistive technology tools' is not available :-("
+ endif
+ end if
+
+ printlog " - press OK at the options dialog"
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - exit/restart StarOffice"
+ ExitRestartTheOffice
+
+ printlog " - check settings"
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Accessibility" )
+
+ if AutomaticDetectHC.IsChecked = lbSave (9) then warnlog "Automatic Detect HC ... : => changes not saved!"
+ if ForPagePreviews.IsChecked = lbSave (2) then warnlog "For Page Previews : => changes not saved!"
+ if HelpTips.IsChecked = lbSave (3) then warnlog "Help Tips : => changes not saved!"
+ HelpTips.Check
+ if After.GetText <> "17" then warnlog "After... : => changes not saved!"
+ if AllowAnimatedGraphics.IsChecked = lbSave (4) then warnlog "Allow Animated Graphics : => changes not saved!"
+ if AllowAnimatedText.IsChecked = lbSave (5) then warnlog "Allow Animated Text : => changes not saved!"
+ if AlwaysUseAutomaticFontColor.IsChecked = lbSave (6) then warnlog "Always Use Automatic Font Color : => changes not saved!"
+ 'if UseSystemFont.IsChecked = lbSave (7) then warnlog "Use System Font : => changes not saved!"
+ if UseTextSelectionCursor.IsChecked = lbSave (10) then warnlog "Use Text Selection Cursor : => changes not saved!"
+' if SupportAssistiveTechnologyTools.Exists and SupportAssistiveTechnologyTools.IsVisible then
+' if SupportAssistiveTechnologyTools.IsChecked = lbSave (8) then warnlog "Support Assistive Technology Tools : => changes not saved!"
+' end if
+
+ printlog " - second settings"
+ AutomaticDetectHC.UnCheck
+ ForPagePreviews.Check
+ HelpTips.Check
+ After.SetText "1"
+ AllowAnimatedGraphics.Uncheck
+ AllowAnimatedText.Check
+ AlwaysUseAutomaticFontColor.Uncheck
+ 'UseSystemFont.Check
+ UseTextSelectionCursor.UnCheck
+ if SupportAssistiveTechnologyTools.Exists and SupportAssistiveTechnologyTools.IsVisible then
+ SupportAssistiveTechnologyTools.Uncheck
+ end if
+
+ printlog " - press OK at the options dialog"
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check changes"
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Accessibility" )
+
+ if AutomaticDetectHC.IsChecked <> FALSE then warnlog "Automatic Detect HC ... : => changes not saved!"
+ if ForPagePreviews.IsChecked <> TRUE then warnlog "For Page Previews : => changes not saved!"
+ if HelpTips.IsChecked <> TRUE then warnlog "Help Tips : => changes not saved!"
+ if After.GetText <> "1" then warnlog "After... : => changes not saved!"
+ if AllowAnimatedGraphics.IsChecked <> FALSE then warnlog "Allow Animated Graphics : => changes not saved!"
+ if AllowAnimatedText.IsChecked <> TRUE then warnlog "Allow Animated Text : => changes not saved!"
+ if AlwaysUseAutomaticFontColor.IsChecked <> FALSE then warnlog "Always Use Automatic Font Color : => changes not saved!"
+ 'if UseSystemFont.IsChecked <> TRUE then warnlog "Use System Font : => changes not saved!"
+ if UseTextSelectionCursor.IsChecked <> FALSE then warnlog "Use Text Selection Cursor : => changes not saved!"
+ if SupportAssistiveTechnologyTools.Exists and SupportAssistiveTechnologyTools.IsVisible then
+ if SupportAssistiveTechnologyTools.IsChecked <> FALSE then warnlog "Support Assistive Technology Tools : => changes not saved!"
+ end if
+
+ if lbSave (9) = TRUE then AutomaticDetectHC.Check else AutomaticDetectHC.UnCheck
+ if lbSave (2) = TRUE then ForPagePreviews.Check else ForPagePreviews.UnCheck
+ HelpTips.Check
+ After.SetText sSave
+ if lbSave (3) = TRUE then HelpTips.Check else HelpTips.UnCheck
+ if lbSave (4) = TRUE then AllowAnimatedGraphics.Check else AllowAnimatedGraphics.UnCheck
+ if lbSave (5) = TRUE then AllowAnimatedText.Check else AllowAnimatedText.UnCheck
+ if lbSave (6) = TRUE then AlwaysUseAutomaticFontColor.Check else AlwaysUseAutomaticFontColor.UnCheck
+ 'if lbSave (7) = TRUE then UseSystemFont.Check else UseSystemFont.UnCheck
+ if lbSave (10) = TRUE then UseTextSelectionCursor.Check else UseTextSelectionCursor.UnCheck
+ if SupportAssistiveTechnologyTools.Exists and SupportAssistiveTechnologyTools.IsVisible then
+ if lbSave (8) = TRUE then SupportAssistiveTechnologyTools.Check else SupportAssistiveTechnologyTools.UnCheck
+ end if
+
+ printlog " - press OK at the options dialog"
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check reset"
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Accessibility" )
+
+ if AutomaticDetectHC.IsChecked <> lbSave (9) then warnlog "Automatic Detect HC ... : => changes not saved!"
+ if ForPagePreviews.IsChecked <> lbSave (2) then warnlog "For Page Previews : => changes not saved!"
+ if HelpTips.IsChecked <> lbSave (3) then warnlog "Help Tips : => changes not saved!"
+ HelpTips.Check
+ if After.GetText <> sSave then warnlog "After... : => changes not saved!"
+ if AllowAnimatedGraphics.IsChecked <> lbSave (4) then warnlog "Allow Animated Graphics : => changes not saved!"
+ if AllowAnimatedText.IsChecked <> lbSave (5) then warnlog "Allow Animated Text : => changes not saved!"
+ if AlwaysUseAutomaticFontColor.IsChecked <> lbSave (6) then warnlog "Always Use Automatic Font Color : => changes not saved!"
+ 'if UseSystemFont.IsChecked <> lbSave (7) then warnlog "Use System Font : => changes not saved!"
+ if UseTextSelectionCursor.IsChecked <> lbSave (10) then warnlog "Use Text Selection Cursor : => changes not saved!"
+ if SupportAssistiveTechnologyTools.Exists and SupportAssistiveTechnologyTools.IsVisible then
+ if SupportAssistiveTechnologyTools.IsChecked <> lbSave (8) then warnlog "Support Assistive Technology Tools : => changes not saved!"
+ end if
+ printlog " - press OK at the options dialog"
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/options_ooo_appearance.inc b/testautomation/framework/optional/includes/options_ooo_appearance.inc
new file mode 100644
index 000000000000..afe8efa26be7
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_ooo_appearance.inc
@@ -0,0 +1,169 @@
+'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 : Tools->Options: OpenOffice.org Appearance
+'*
+'\******************************************************************************
+
+testcase tOOoAppearance
+ Dim iSchemes as Integer
+ Dim sSchemeNames (10) as String
+ Dim sCurScheme as String, sCurScheme2 as String
+ Dim bIsError as Boolean
+ dim i as integer
+
+
+ printlog " - save settings"
+'tools / options / staroffice / appearance
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Appearance" )
+
+'get the number of schemes
+ iSchemes = Scheme.GetItemCount
+ sCurScheme = Scheme.GetSelText
+ if iSchemes > 10 then Warnlog "There are more than 10 schemes, please update the test for it!"
+'get the name of schemes
+ for i=1 to iSchemes
+ ListAppend ( sSchemeNames(), Scheme.GetItemText (i) )
+ next i
+
+ printlog " - change settings"
+'insert a new scheme ( press Save, insert TT-Scheme as name, and close all dialogs with OK )
+ Save.Click
+ Kontext "SaveScheme"
+ SchemeName.SetText "TT-Scheme"
+ try
+ SaveScheme.OK()
+ catch
+ warnlog( "The newly created scheme cannot be saved (ok is disabled) -> #i26913")
+ bIsError=true
+ SaveScheme.Cancel()
+ endcatch
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - exit/restart StarOffice"
+ ExitRestartTheOffice
+
+ printlog " - check settings"
+'tools / options / staroffice / appearance
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Appearance" )
+
+'try to select the TT-Scheme
+ try
+ Scheme.Select "TT-Scheme"
+ bIsError = FALSE
+ catch
+ if Scheme.GetItemCount <> iSchemes + 1 then
+ Warnlog "The new scheme 'TT-Scheme' is not saved!"
+ else
+ Warnlog "The new scheme 'TT-Scheme' has another name!"
+ end if
+ bIsError = TRUE
+ endcatch
+
+ printlog " - delete the new scheme"
+
+ 'select 'TT-Scheme'
+ if bIsError = FALSE then
+ try
+ Scheme.Select "TT-Scheme"
+ 'press delete and click 'no'
+ Delete.Click()
+ Kontext "Active"
+ Active.No()
+ catch
+ warnlog( "The scheme does not exist in the scheme-selector listbox")
+ endcatch
+
+ Kontext "TabAppearance"
+ try
+ 'press delete and click 'yes'
+ Scheme.Select "TT-Scheme"
+ Delete.Click
+
+ Kontext "Active"
+ Active.Yes
+ catch
+ Warnlog "Perhaps the Scheme is deleted! But the messagebox was left with 'NO'!"
+ endcatch
+
+'select the default-entry
+ Sleep (1)
+ Kontext "TabAppearance"
+ sCurScheme2 = Scheme.GetSelText
+
+ printlog " - press OK for options dialog"
+'press OK for options dialog
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check if the scheme is deleted and the saved base state is current"
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Appearance" )
+
+ if Scheme.GetSelText <> sCurScheme2 then
+ Warnlog "The last selected entry after deleting is not selected after restart the options dialog!"
+ end if
+ if iSchemes <> Scheme.GetItemCount then Warnlog "There are not " + iSchemes + " items in the scheme list! There are " + Scheme.GetItemCount
+ for i = 1 to Scheme.GetItemCount
+ if Scheme.GetItemText(i) <> sSchemeNames(i) then
+ Warnlog "The " + i + " entry is not the same -> should : '" + sSchemeNames(i) + "' is '" + Scheme.GetItemText(i) + "'"
+ end if
+ next i
+
+ printlog " - set the selected scheme to default"
+ Scheme.Select sCurScheme
+
+ printlog " - press OK at the options dialog"
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check if the default setting is active, after deleting a scheme and a restart of the options dialog"
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Appearance" )
+
+ if Scheme.GetSelText <> sCurScheme then
+ Warnlog "The default scheme is not selected!"
+ end if
+
+ end if
+
+ printlog " - press OK at the options dialog"
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/options_ooo_colors.inc b/testautomation/framework/optional/includes/options_ooo_colors.inc
new file mode 100644
index 000000000000..ccf4b4642173
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_ooo_colors.inc
@@ -0,0 +1,206 @@
+'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 : Tools->Options: OpenOffice.org Colors
+'*
+'\******************************************************************************
+
+testcase tOOoColors
+
+ printlog( "OOo color palette" )
+
+ dim myColor(4) as String
+ dim oldColor(4) as String
+ dim currentColor(4) as String
+ dim chColor(4) as String
+
+ const DEFAULT_COLOR_COUNT = 103
+ const CHANGED_COLOR_COUNT = 104
+ const USER_COLOR = "TT-Test-Color"
+
+ myColor(1) = USER_COLOR
+ myColor(2) = "255"
+ myColor(3) = "245"
+ myColor(4) = "200"
+
+ printlog( "Check if all settings are saved in configuration ( StarOffice / Colors )" )
+ printlog( "Open Tools / Options / StarOffice / Colors" )
+ ToolsOptions
+
+ Kontext "ExtrasOptionenDlg"
+ if ( ExtrasOptionenDlg.exists( 1 ) ) then
+
+ hToolsOptions ( "StarOffice", "Colors" )
+
+ printlog( "Delete the userdefined color if it exists" )
+ if ( Farbe.GetItemCount() <> DEFAULT_COLOR_COUNT + 1 ) then
+ call DeleteColor( USER_COLOR )
+ endif
+
+ printlog( "Check the number of currently registered colors - cancel test on error" )
+ Kontext "TabFarben"
+ if ( Farbe.GetItemCount() <> DEFAULT_COLOR_COUNT ) then
+ warnlog( "The number of colors has changed, stopping test" )
+ printlog( "Expected: " & DEFAULT_COLOR_COUNT )
+ printlog( "Found...: " & Farbe.getItemCount() )
+ printlog( "Close the Tools/Options dialog with OK" )
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ WaitSlot( 2000 )
+ goto endsub
+ else
+ printlog( "Number of colors is ok: " & DEFAULT_COLOR_COUNT )
+ endif
+
+ printlog( "Jump to the last color in the list." )
+ Kontext "TabFarben"
+ Farbe.Select( Farbe.GetItemCount() )
+
+ printlog( "Get the settings for the current selected color" )
+ call getColorRGB(oldColor()) '(204,204,255)
+
+ printlog( "Change settings for last color and press 'modify'" )
+ call ModifyColorRGB_PGUP( DEFAULT_COLOR_COUNT ) '(255,255,255)
+
+ printlog( "Get the changed colors (Sun 4,255,255,255)" )
+ call GetColorRGB(chColor())
+
+ printlog( "Change the settings again and save it as TT-Test (adding to the list)" )
+ call CreateNewColor(myColor()) '(255,245,200)
+
+ printlog( "Check the number of currently registered colors" )
+ Kontext "TabFarben"
+ if ( Farbe.getItemCount() <> CHANGED_COLOR_COUNT ) then
+ warnlog( "The number of colors has changed" )
+ printlog( "Expected: " & CHANGED_COLOR_COUNT )
+ printlog( "Found...: " & Farbe.getItemCount() )
+ else
+ printlog( "Number of colors is ok: " & DEFAULT_COLOR_COUNT )
+ endif
+
+ printlog( "Close the Tools/Options dialog with OK" )
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ WaitSlot( 2000 )
+ else
+ warnlog( "Tools/Options dialog not open" )
+ endif
+
+ printlog( "Exit and restart the office" )
+ ExitRestartTheOffice
+
+ printlog( "Check the changes" )
+ ToolsOptions
+
+ Kontext "ExtrasOptionenDlg"
+ if ( ExtrasOptionenDlg.exists( 1 ) ) then
+
+ hToolsOptions ( "StarOffice", "Colors" )
+
+ printlog( "Check the number of colors (Plus one color)" )
+ Kontext "TabFarben"
+ if ( Farbe.getItemCount() <> CHANGED_COLOR_COUNT ) then
+ warnlog( "The number of colors has changed" )
+ printlog( "Expected: " & CHANGED_COLOR_COUNT )
+ printlog( "Found...: " & Farbe.getItemCount() )
+ else
+ printlog( "Number of colors is ok: " & DEFAULT_COLOR_COUNT )
+ endif
+
+ printlog( "Select the changed color and check the changes" )
+ Kontext "TabFarben"
+ Farbe.Select( DEFAULT_COLOR_COUNT )
+ call compareTwoColorsRGB(chColor())
+
+ printlog( "Select the new color ( TT-Test ) and check the name and the settings" )
+ Kontext "TabFarben"
+ Farbe.Select( CHANGED_COLOR_COUNT )
+ call CompareTwoColorsRGB(myColor())
+
+ printlog( "Delete the new userdefined color" )
+ call deleteColor( USER_COLOR )
+
+ printlog( "Check the number of colors (One removed)" )
+ Kontext "TabFarben"
+ if ( Farbe.getItemCount() <> DEFAULT_COLOR_COUNT ) then
+ warnlog( "The number of colors has changed" )
+ printlog( "Expected: " & DEFAULT_COLOR_COUNT )
+ printlog( "Found...: " & Farbe.getItemCount() )
+ else
+ printlog( "Number of colors is ok: " & DEFAULT_COLOR_COUNT )
+ endif
+
+ printlog( "reset the modified color to default" )
+ Kontext "TabFarben"
+ Farbe.Select( DEFAULT_COLOR_COUNT )
+ call ModifyColorRGB(oldColor())
+
+ printlog( "Close options dialog with OK" )
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ WaitSlot( 2000 )
+
+ else
+ warnlog( "Tools/Options dialog not open" )
+ endif
+
+ printlog( "Reopen options dialog and check the reset" )
+ ToolsOptions
+
+ Kontext "ExtrasOptionenDlg"
+ if ( ExtrasOptionenDlg.exists( 1 ) ) then
+
+ hToolsOptions ( "StarOffice", "Colors" )
+
+ printlog( "Check if the number of colors in the list has been restored" )
+ Kontext "TabFarben"
+ if ( Farbe.getItemCount() <> DEFAULT_COLOR_COUNT ) then
+ warnlog( "The number of colors has changed" )
+ printlog( "Expected: " & DEFAULT_COLOR_COUNT )
+ printlog( "Found...: " & Farbe.getItemCount() )
+ else
+ printlog( "Number of colors is ok: " & DEFAULT_COLOR_COUNT )
+ endif
+
+
+ printlog( "Check if the last color has been reset to defaults." )
+ Kontext "TabFarben"
+ Farbe.Select( DEFAULT_COLOR_COUNT )
+ call compareTwoColorsRGB(oldColor())
+
+ printlog( "Close options dialog with OK" )
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ WaitSlot( 2000 )
+
+ else
+ warnlog( "Tools/Options dialog not open" )
+ endif
+
+endcase
diff --git a/testautomation/framework/optional/includes/options_ooo_fontreplacement.inc b/testautomation/framework/optional/includes/options_ooo_fontreplacement.inc
new file mode 100644
index 000000000000..d83be235b765
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_ooo_fontreplacement.inc
@@ -0,0 +1,118 @@
+'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 : Tools->Options: OpenOffice.org Fonts
+'*
+'\******************************************************************************
+
+testcase tOOoFontReplacement
+ Dim i, il as Integer
+
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Fontreplacement" )
+
+ printlog " - change settings"
+ if Anwenden.IsChecked then
+ Warnlog "The default for this page is wrong. 'Apply replacement table' has top be unchecked!"
+ else
+ Anwenden.Check
+ end if
+
+ Schriftart.Select 4
+ ErsetzenDurch.Select 6
+ Uebernehmen.Click
+ sleep 1 'gh13
+ Schriftart.Select 10
+ ErsetzenDurch.Select 5
+ Uebernehmen.Click
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - exit/restart StarOffice"
+ ExitRestartTheOffice
+
+ printlog " - check changes"
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Fontreplacement" )
+
+ if Anwenden.IsChecked = FALSE then
+ Warnlog "Apply replacement table' => changes not saved!"
+ else
+ Anwenden.Check
+ end if
+
+ il = Liste.GetItemCount
+ if il <> 2 then Warnlog "Not all entries are saved!"
+
+ for i=1 to il
+ if i=1 then
+ Liste.TypeKeys "<Down><Up>"
+ else
+ Liste.TypeKeys "<Down>"
+ end if
+ if i=1 then
+ if Schriftart.GetSelIndex <> 4 then Warnlog "Font : the first entrie is not correctly saved!"
+ if ErsetzenDurch.GetSelIndex <> 6 then Warnlog "Replace with : the first entrie is not correctly saved!"
+ end if
+ if i=2 then
+ if Schriftart.GetSelIndex <> 10 then Warnlog "Font : the first entrie is not correctly saved!"
+ if ErsetzenDurch.GetSelIndex <> 5 then Warnlog "Replace with : the first entrie is not correctly saved!"
+ end if
+ next i
+
+ printlog " - reset to default"
+ for i=1 to il
+ Liste.TypeKeys "<Down><Up>"
+ Loeschen.Click
+ sleep 1 'gh13
+ next i
+ Anwenden.Uncheck
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check the default"
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Fontreplacement" )
+
+ if Anwenden.IsChecked = TRUE then
+ Warnlog "Apply replacement table' => changes not saved!"
+ else
+ Anwenden.Check
+ end if
+ if Liste.GetItemCount <> 0 then Warnlog "Not all deleted entries are realy deleted!"
+ Anwenden.UnCheck
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+endcase
diff --git a/testautomation/framework/optional/includes/options_ooo_general.inc b/testautomation/framework/optional/includes/options_ooo_general.inc
new file mode 100644
index 000000000000..8197a4fe54d9
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_ooo_general.inc
@@ -0,0 +1,583 @@
+'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 : Grid Layout for CJK test in Writer
+'*
+'\***********************************************************************
+
+private const SOURCE_PATH = "framework\optional\input\CJK\"
+
+testcase tTextGridDialog_1
+
+ '/// Check if tabpage 'Text Grid' disappears when "Asian Language support" is NOT checked
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+ hNewDocument()
+ FormatPageWriter
+ try
+ Kontext
+ Active.SetPage TabGrid
+ Kontext "TabGrid"
+ TabGrid.Cancel
+ warnlog "Shouldn't get Tabpage: Grid Text"
+ catch
+ Kontext
+ Active.SetPage TabSeite
+ Kontext "TabSeite"
+ TabSeite.Cancel
+ endcatch
+ endif
+
+ '/// Check if tabpage 'Text Grid' appears when "Asian Language support" is checked
+ Call CheckAsianLanguageSupport("On")
+
+ hNewDocument
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "General" )
+
+ printlog " - save old data"
+ lsSave ( 1 ) = Zweistellig.GetText
+ lbSave ( 1 ) = Aktivieren.IsChecked
+ Aktivieren.Check
+ if gPlatgroup = "w95" then
+ lbSave (2) = StarOfficeDialogeBenutzen.IsChecked
+ end if
+ lbSave ( 3 ) = DruckenStatus.IsChecked
+ lsSave ( 3 ) = StyleSheet.GetSelText
+
+ printlog " - invert/change data"
+ Zweistellig.SetText "1950"
+ Zuruecksetzen.Click
+ if gPlatgroup = "w95" then
+ if lbSave (2) = TRUE then StarOfficeDialogeBenutzen.Uncheck else StarOfficeDialogeBenutzen.Check
+ end if
+ If lbSave ( 3 ) = TRUE then DruckenStatus.Uncheck else DruckenStatus.Check
+ StyleSheet.Select 3
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ if ( ExtrasOptionenDlg.notExists( 3 ) ) then
+ printlog( "Options closed" )
+ endif
+ hCloseDocument()
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tTextGridDialog_2
+ '/// No grid is active, no changes to existing version
+ Dim testFile , sCorrectResult as String
+
+ testFile = "gridtest.sxw"
+ sCorrectResult = "1"
+
+ Call hNewDocument
+
+ '/// open a test file , and check No Grid checkbox
+ Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
+ sMakeReadOnlyDocumentEditable
+
+ FormatPageWriter
+ Kontext
+ if active.exists(5) then
+ Active.SetPage TabGrid
+ endif
+ Kontext "TabGrid"
+ NoGrid.Check
+ Sleep 1
+ TabGrid.OK
+ Sleep 1
+
+ '/// Active navigator dialogue , set page to '2' and wait for a while
+ Kontext
+ ViewNavigator
+ Kontext "NavigatorWriter"
+
+ Seitennummer.SetText "2"
+ Sleep 5
+ hCloseNavigator
+
+ '/// In No Grid mode, there should be only 1 page, the focus is before the first line
+ Kontext "DocumentWriter"
+ Call DocumentWriter.TypeKeys "<End>"
+ Sleep 1
+ Call DocumentWriter.TypeKeys "<Shift Left>"
+ hUseAsyncSlot( "EditCopy" )
+
+ if GetClipboardText <> sCorrectResult then Warnlog "Something wrong when choosing NoGrid option!"
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tTextGridDialog_3
+ '/// Grid (lines only): The page is set up with a defined number of lines
+ Dim testFile , sCorrectResult , sLinesPerPage as String
+
+ testFile = "gridtest.sxw"
+ sCorrectResult = "G"
+ sLinesPerPage = "10"
+
+ Call hNewDocument
+
+ '/// open a test file and check Grid(lines onle) checkbox ,
+ '/// + set 10 line/page
+ Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
+ sMakeReadOnlyDocumentEditable
+ FormatPageWriter
+ Kontext
+ if active.exists(5) then
+ Active.SetPage TabGrid
+ endif
+ Kontext "TabGrid"
+ LinesGrid.Check
+ LinesPerPage.SetText sLinesPerPage
+ Sleep 1
+ TabGrid.OK
+ Sleep 1
+
+ '/// Active navigator dialogue , set page to '2' and wait for a while
+ Kontext
+ ViewNavigator
+ Kontext "NavigatorWriter"
+
+ Seitennummer.SetText "2"
+ Sleep 5
+ hCloseNavigator
+
+ Kontext "DocumentWriter"
+ Call DocumentWriter.TypeKeys "<End>"
+ Sleep 1
+ Call DocumentWriter.TypeKeys "<Shift Left>"
+ hUseAsyncSlot( "EditCopy" )
+
+ if GetClipboardText <> sCorrectResult then Warnlog "Something wrong when choosing Grid(lines only) option!"
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tTextGridDialog_4
+ '/// Grid (lines and characters): The page is set up with a defined number of lines and a defined number of characters in each line
+ Dim testFile , sCorrectResult as String
+ Dim sLinesPerPage , sCharsPerLine as String
+
+ testFile = "gridtest.sxw"
+ sCorrectResult = "E"
+ sLinesPerPage = "10"
+ sCharsPerLine = "9"
+
+ Call hNewDocument
+
+ '/// open a test file and check Grid(lines and characters) checkbox
+ '/// + set 10 line/page and 9 characters/line
+ Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
+ sMakeReadOnlyDocumentEditable
+ FormatPageWriter
+ Kontext
+ if active.exists(5) then
+ Active.SetPage TabGrid
+ endif
+ Kontext "TabGrid"
+ CharsGrid.Check
+ LinesPerPage.SetText sLinesPerPage
+ CharsPerLine.SetText sCharsPerLine
+ Sleep 1
+ TabGrid.OK
+ Sleep 1
+
+ '/// Active navigator dialogue , set page to '2' and wait for a while
+ Kontext
+ ViewNavigator
+ Kontext "NavigatorWriter"
+
+ Seitennummer.SetText "2"
+ Sleep 5
+ hCloseNavigator
+
+ Kontext "DocumentWriter"
+ Call DocumentWriter.TypeKeys "<End>"
+ Sleep 1
+ Call DocumentWriter.TypeKeys "<Shift Left>"
+ hUseAsyncSlot( "EditCopy" )
+
+ if GetClipboardText <> sCorrectResult then Warnlog "Something wrong when choosing Grid(lines and characters) option!"
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tGridDisplay_1
+ '/// Print grid: The grid lines will be printed. Inactive if "Display grid" is inactive.
+ Call hNewDocument
+
+ '/// format / page / tabpage Text grid
+ '/// + check "display grid" and check "print grid"
+ FormatPageWriter
+ Kontext
+ if active.exists(5) then
+ Active.SetPage TabGrid
+ endif
+ Kontext "TabGrid"
+ CharsGrid.Check
+ Display.Check
+ Sleep 1
+ PrintGrid.Check
+ Sleep 1
+ TabGrid.OK
+ Sleep 1
+
+ '/// Print to printer
+ FilePrint
+ Kontext "Active"
+ if ( Active.Exists( 5 ) ) then
+ if Active.GetRT() = 304 then
+ Active.Ok()
+ QAErrorLog "No Default-Printer!"
+ Kontext "Printing"
+ if ( Printing.exists( 1 )) then
+ Printing.Cancel
+ endif
+ endif
+ else
+ Kontext "Printing"
+ if ( Printing.exists( 2 )) then
+ Printing.OK()
+ Printing.notExists( 5 )
+ endif
+
+ kontext "Active"
+ if active.exists(5) then
+ qaErrorLog active.getText()
+ active.ok()
+ endif
+ endif
+
+ '/// format / page / tabpage Text grid
+ '/// + check "display grid" and uncheck "print grid"
+ FormatPageWriter
+ Kontext
+ if active.exists(5) then
+ Active.SetPage TabGrid
+ endif
+ Kontext "TabGrid"
+ CharsGrid.Check
+ Display.Check
+ Sleep 1
+ PrintGrid.UnCheck
+ Sleep 1
+ TabGrid.OK
+ Sleep 1
+
+ '/// Print to printer
+ FilePrint
+ Kontext "Active"
+ if ( Active.Exists( 5 ) )then
+ if Active.GetRT() = 304 then
+ Active.Ok()
+ QAErrorLog "No Default-Printer!"
+ Kontext "Printing"
+ if ( Printing.exists( 1 )) then
+ Printing.Cancel()
+ endif
+ endif
+ else
+ Kontext "Printing"
+ if( Printing.exists( 1 )) then
+ Printing.OK
+ Printing.notExists( 5 )
+ endif
+ kontext
+ if ( active.exists( 2 ) ) then
+ qaErrorLog active.getText
+ active.ok
+ endif
+ endif
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tUserDefineLayout_1
+ '/// Decrease characters per line will cause lines per page decrease accordingly
+ Dim sLinesPerPage , sCharsPerLine as String
+ Dim sExpectLinesPerPage , sExpectLinesPerPage1 as String
+
+ sLinesPerPage = "20"
+ sCharsPerLine = "2"
+ sExpectLinesPerPage = "2"
+ sExpectLinesPerPage1 = "3"
+
+ Call hNewDocument
+
+ '/// Format/page , set lines per page to 20, and set charsets per line to 2
+ '/// + wait for a moment , then check the the number of lines per page.
+ FormatPageWriter
+ Kontext
+ if active.exists(5) then
+ Active.SetPage TabGrid
+ endif
+ Kontext "TabGrid"
+ CharsGrid.Check
+
+ LinesPerPage.SetText sLinesPerPage
+ Sleep 2
+ CharsPerLine.SetText sCharsPerLine
+ Sleep 2
+
+ 'This step is no use, just let the LinesPerPage change the number
+ CharsGrid.Check
+
+ if LinesPerPage.GetText <> sExpectLinesPerPage AND LinesPerPage.GetText <> sExpectLinesPerPage1 then
+ Warnlog "The lines per page should be" + sExpectLinesPerPage + " OR " + sExpectLinesPerPage1 +" but get " +LinesPerPage.GetText
+ endif
+
+ TabGrid.Cancel
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tFontSizeChanges_1
+ '/// Change the font size to bigger enough will change the layout
+ Dim testFile , sCorrectResult as String
+ Dim sLinesPerPage , sCharsPerLine as String
+ dim sTemp as string
+
+ testFile = "FontSizeChanges_1.sxw"
+ sCorrectResult = "1"
+ sLinesPerPage = "2"
+ sCharsPerLine = "9"
+
+ Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
+ sMakeReadOnlyDocumentEditable
+ Kontext "DocumentWriter"
+ Call DocumentWriter.TypeKeys "<Shift Right>"
+
+ Kontext "FormatObjectbar"
+ Schriftgroesse.Select "60"
+ Schriftgroesse.TypeKeys "<Return>"
+ Sleep 1
+
+ Kontext "DocumentWriter"
+ FormatPageWriter
+ Kontext
+ if active.exists(5) then
+ Active.SetPage TabGrid
+ endif
+ Kontext "TabGrid"
+ if TabGrid.exists(5) then
+ sTemp = LinesPerPage.GetText
+ if sTemp <> sLinesPerPage then
+ Warnlog "The lines per page should be: '" + sLinesPerPage + "'; but get: '" + sTemp + "'"
+ endif
+ sTemp = CharsPerLine.GetText
+ if sTemp <> sCharsPerLine then
+ Warnlog "The chars per line should be: '" + sCharsPerLine + "'; but get: '" +sTemp + "'"
+ endif
+ TabGrid.Cancel
+ else
+ warnlog "TabGrid is not available."
+ endif
+
+ Kontext
+ ViewNavigator
+ Kontext "NavigatorWriter"
+ if NavigatorWriter.exists(5) then
+ Seitennummer.SetText "2"
+ Sleep 5
+ else
+ warnlog "Navigator not available"
+ endif
+ hCloseNavigator
+
+ Kontext "DocumentWriter"
+ sleep 3
+ Call DocumentWriter.TypeKeys "<Shift Right>"
+
+ hUseAsyncSlot( "EditCopy" )
+ sTemp = GetClipboardText
+ if sTemp <> sCorrectResult then
+ Warnlog "Don't get the expected result , hope to be: '" + sCorrectResult + "'; but get: '" + sTemp + "'"
+ endif
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tRubyText_1
+ '/// If Ruby Text is applied and longer than its Base Text it will stretch over more grid cells than the base text itself.
+ Dim testFile , sRubyText as String
+
+ testFile = "rubytest.sxw"
+ sRubyText = "Ruby Test Text ....................."
+
+ Call hNewDocument
+
+ '/// open a test file , and insert long ruby test text
+ Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
+ sMakeReadOnlyDocumentEditable
+ Kontext "DocumentWriter"
+ Call DocumentWriter.TypeKeys "<Shift Right>"
+ Sleep 1
+
+ FormatRuby
+ Kontext "RubyDialog"
+ Sleep 3
+ RubyText1.setText sRubyText
+ Sleep 2
+ RubyDialog.OK
+ Sleep 2
+ DialogClose.Click
+ Sleep 1
+
+ Kontext "DocumentWriter"
+ FormatAutoformatApply
+ Sleep 2
+ Call DocumentWriter.TypeKeys "<End>"
+ Sleep 2
+ Call DocumentWriter.TypeKeys "<Shift Left>"
+ hUseAsyncSlot( "EditCopy" )
+
+ if NOT(GetClipboardText = "5" OR GetClipboardText = "6") then
+ Warnlog "Don't get the correct result after inserting ruby text! Get " + GetClipboardText
+ endif
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tIndentsTest_1
+ '/// Indents should work and always indenting as close as possible to their measurements by snapping to the appropriate grid cell. Tabs therefore will be ignored.
+ Dim testFile , sCorrectPage1 , sCorrectPage2 as String
+
+ testFile = "IndentsTest.sxw"
+ sCorrectPage1 = "1"
+ sCorrectPage2 = "2"
+
+ Call hNewDocument
+
+ '/// open a test file , and press TAB in second line
+ Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
+ sMakeReadOnlyDocumentEditable
+ Kontext "DocumentWriter"
+ Call DocumentWriter.TypeKeys "<Down>"
+ Sleep 1
+ Call DocumentWriter.TypeKeys "<Tab>"
+ Sleep 1
+ Call DocumentWriter.TypeKeys "<End>"
+ Sleep 1
+
+ '/// Active navigator dialogue , check if the page number is 1
+ Kontext
+ ViewNavigator
+ Kontext "NavigatorWriter"
+ if Seitennummer.GetText <> sCorrectPage1 then Warnlog "First test :Something wrong in indents test!"
+ hCloseNavigator
+
+ '/// press TAB in second line again
+ Kontext "DocumentWriter"
+ Call DocumentWriter.TypeKeys "<Home>"
+ Sleep 1
+ Call DocumentWriter.TypeKeys "<Tab>"
+ Sleep 1
+ Call DocumentWriter.TypeKeys "<End>"
+ Sleep 1
+
+ '/// Active navigator dialogue , check if the page number is 2
+ Kontext
+ ViewNavigator
+ Kontext "NavigatorWriter"
+ if Seitennummer.GetText <> sCorrectPage2 then Warnlog "Second test :Something wrong in indents test!"
+ hCloseNavigator
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tObjectsTest_1
+ '/// If objects are anchored to text they will "wander" with its surrounding text.
+ '/// If they are anchored as character they will snap to the appropriate grid cell (since they are a character).
+ Dim testFile , sCorrectPage1 , sCorrectPage2 as String
+
+ testFile = "objectsTest.sxw"
+ sCorrectPage1 = "1"
+ sCorrectPage2 = "2"
+
+ Call hNewDocument
+
+ '/// open a test file , and press TAB in second line
+ Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
+
+ '/// If object is anchored as Character , check if it will snap to the appropriate grid cell
+ fStartupNavigator( "OLEObject" , 1 )
+ Sleep 1
+ Auswahlliste.TypeKeys "<Return>"
+ Sleep 1
+ hCloseNavigator
+
+ Kontext
+ FormatAnchorAsCharacter
+ WaitSlot()
+
+
+ ViewNavigator
+ Kontext "NavigatorWriter"
+ Seitennummer.SetText sCorrectPage2
+ Sleep 5
+ if Seitennummer.GetText <> sCorrectPage2 then Warnlog "Something wrong when object is anchored as Character!"
+ hCloseNavigator
+
+ '/// If object is anchored to Character , check if it will NOT snap to the appropriate grid cell
+ fStartupNavigator( "OLEObject" , 1 )
+ Auswahlliste.TypeKeys "<Return>"
+ hCloseNavigator
+
+ Kontext
+ FormatAnchorToCharacter
+
+ ViewNavigator
+ Kontext "NavigatorWriter"
+ Seitennummer.SetText sCorrectPage2
+ Sleep 5
+ if Seitennummer.GetText <> sCorrectPage1 then Warnlog "Something wrong when object is anchored to Character!"
+ hCloseNavigator
+ Kontext
+
+ Call hCloseDocument
+endcase
+
diff --git a/testautomation/framework/optional/includes/options_ooo_java.inc b/testautomation/framework/optional/includes/options_ooo_java.inc
new file mode 100644
index 000000000000..4e8d39e124d9
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_ooo_java.inc
@@ -0,0 +1,131 @@
+'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 : Tools->Options: OpenOffice.org Java
+'*
+'\******************************************************************************
+
+testcase tOOoJava
+ dim bJavaState as boolean
+
+ ToolsOptions
+ hToolsOptions( "StarOffice", "Java" )
+
+ printlog( "Verify that Java is enabled and configured" )
+ if ( usejava.isChecked() = false ) then
+ warnlog( "Java should be enabled by default, checking and restarting" )
+ bJavaState = hChangeJavaState( true )
+ if ( bJavaState = false ) then
+ warnlog( "Java is still not enabled, aborting test." )
+ kontext "OptionenDlg"
+ OptionenDlg.cancel()
+ goto endsub
+ endif
+ else
+ printlog( " Java is enabled. Good." )
+ endif
+
+ ' Needs a delay, it might take some time until the listbox gets populated
+ sleep( 3 )
+
+ ' There should be a java-runtime installed. If not -> leave test
+ printlog( "Make sure at least one Java runtime is installed" )
+ if ( javalist.getitemcount() = 0 ) then
+ warnlog( "No java listed in listbox, the test will stop" )
+ kontext "OptionenDlg"
+ OptionenDlg.cancel()
+ goto endsub
+ else
+ printlog( " Java is installed, good." )
+ endif
+
+ printlog( "Quickly test that all controls are active" )
+ if ( add.isEnabled() ) then
+ printlog( " 'Add...' is enabled" )
+ else
+ warnlog( "The 'Add...' button is disabled" )
+ endif
+
+ if ( parameters.isEnabled() ) then
+ printlog( " 'Parameters...' is enabled" )
+ else
+ warnlog( "The 'Parameters...' button is disabled" )
+ endif
+
+ if ( classpath.isEnabled() ) then
+ printlog( " 'Class Path...' is enabled" )
+ else
+ warnlog( "The 'Class Path...' button is disabled" )
+ endif
+
+ if ( JavaList.isEnabled() ) then
+ printlog( " 'JavaList' is enabled" )
+ else
+ warnlog( "The 'JavaList' button is disabled" )
+ endif
+
+ kontext "OptionenDlg"
+ OptionenDlg.ok
+endcase
+
+'*******************************************************************************
+
+function hChangeJavaState( bEnable as boolean ) as boolean
+ ' this little fella switches Java support on and off including a restart of
+ ' the office to make the change active. The state is returned
+
+ if ( bEnable ) then
+ printlog( " Enable Java" )
+ usejava.check()
+ else
+ printlog( " Disable Java" )
+ useJava.unCheck()
+ endif
+
+ ' leave tools/options
+ printlog( " Leave Tools/Options" )
+ kontext "OptionenDlg"
+ OptionenDlg.ok()
+
+ ' restart the office to make the change take effect
+ printlog( " Restart the application" )
+ call exitRestartTheOffice()
+
+ ' return to java page
+ printlog( " Return to Tools/Options Java-page" )
+ ToolsOptions
+ hToolsOptions( "StarOffice", "Java" )
+ kontext "TabJava"
+
+ if ( useJava.isChecked() ) then
+ hChangeJavaState() = true
+ else
+ hChangeJavaState() = false
+ endif
+end function
diff --git a/testautomation/framework/optional/includes/options_ooo_memory.inc b/testautomation/framework/optional/includes/options_ooo_memory.inc
new file mode 100644
index 000000000000..3f50fb90076d
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_ooo_memory.inc
@@ -0,0 +1,219 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : 1. test for general group userdata ... view)
+'*
+'\******************************************************************************
+
+testcase tOOoMemory
+
+ Dim lsSave (7) as String
+ Dim lbSave as Boolean
+ Dim sValue as String
+
+ dim bHasQuickstarter as boolean
+
+ hNewDocument
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Memory" )
+
+ printlog " - check platform dependences "
+
+ if ( LoadQuickstarter.exists() and LoadQuickstarter.isVisible() and LoadQuickstarter.isEnabled() ) then
+ bHasQuickstarter = TRUE
+ printlog( "Quickstarter is available" )
+ else
+ bHasQuickstarter = FALSE
+ printlog( "Quickstarter is NOT available on this platform" )
+ endif
+
+ printlog " - save old data"
+ lsSave(1) = UndoSteps.GetText
+ lsSave(2) = StarOffice.GetText
+ lsSave(3) = MemoryPerObject.GetText
+ lsSave(4) = RemoveFromMemoryAfter.GetText
+ lsSave(5) = NumberOfObjects.GetText
+ if ( bHasQuickstarter ) then
+ lbSave = LoadQuickstarter.IsChecked
+ endif
+
+ printlog " - invert/change data"
+ UndoSteps.SetText "80"
+ StarOffice.SetText "50"
+ if Instr ( lsSave(3), "," ) <> 0 then
+ sValue = "4,1"
+ else
+ sValue = "4.1"
+ end if
+ MemoryPerObject.SetText sValue
+ RemoveFromMemoryAfter.SetText "00:41"
+ NumberOfObjects.SetText "81"
+ if ( bHasQuickstarter ) then
+ LoadQuickstarter.UnCheck
+ endif
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ if ( ExtrasOptionenDlg.notExists( 3 ) ) then
+ printlog( "Options closed" )
+ endif
+
+
+ hCloseDocument
+
+ printlog " - exit/restart StarOffice"
+ ExitRestartTheOffice
+
+ printlog " - check data"
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Memory" )
+
+ if UndoSteps.GetText <> "80" then
+ Warnlog "Undo steps => changes not saved!"
+ endif
+ if StarOffice.GetText <> "50" then
+ Warnlog "Use For StarOffice => changes not saved!"
+ endif
+ if MemoryPerObject.GetText <> sValue then
+ Warnlog "Memory per object => changes not saved! => " + MemoryPerObject.GetText
+ endif
+ if RemoveFromMemoryAfter.GetText <> "00:41" then
+ Warnlog "Remove from memory after => changes not saved! =>" + RemoveFromMemoryAfter.GetText
+ endif
+ if NumberOfObjects.GetText <> "81" then
+ Warnlog "Number of objects => changes not saved!"
+ endif
+ if ( bHasQuickstarter ) then
+ if LoadQuickstarter.IsEnabled then
+ if LoadQuickstarter.IsChecked = TRUE then
+ Warnlog "Load StarOffice during system-startup => changes not saved!"
+ end if
+ end if
+ endif
+
+ printlog " - 2. change data"
+ UndoSteps.SetText "5"
+ StarOffice.SetText "11"
+ if Instr ( lsSave(3), "," ) <> 0 then
+ sValue = "1,9"
+ else
+ sValue = "1.9"
+ end if
+ MemoryPerObject.SetText sValue
+ RemoveFromMemoryAfter.SetText "01:32"
+ NumberOfObjects.SetText "2"
+ if ( bHasQuickstarter ) then
+ LoadQuickstarter.Check
+ endif
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ if ( ExtrasOptionenDlg.notExists( 3 ) ) then
+ printlog( "Options closed" )
+ endif
+
+ printlog " - check data"
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Memory" )
+
+ if UndoSteps.GetText <> "5" then
+ Warnlog "Undo steps => changes not saved!"
+ endif
+ if StarOffice.GetText <> "11" then
+ Warnlog "Use For StarOffice => changes not saved!"
+ endif
+ if MemoryPerObject.GetText <> sValue then
+ Warnlog "Memory per object => changes not saved! => " + MemoryPerObject.GetText
+ endif
+ if RemoveFromMemoryAfter.GetText <> "01:32" then
+ Warnlog "Remove from memory after => changes not saved! => " + RemoveFromMemoryAfter.GetText
+ endif
+ if NumberOfObjects.GetText <> "2" then
+ Warnlog "Number of objects => changes not saved!"
+ endif
+ if ( bHasQuickstarter ) then
+ if LoadQuickstarter.IsChecked <> TRUE then
+ Warnlog "Load StarOffice during system-startup => changes not saved!"
+ end if
+ endif
+
+ printlog " - reset to saved data"
+ UndoSteps.SetText lsSave(1)
+ StarOffice.SetText lsSave(2)
+ MemoryPerObject.SetText lsSave(3)
+ RemoveFromMemoryAfter.SetText lsSave(4)
+ NumberOfObjects.SetText lsSave(5)
+
+ if ( bHasQuickstarter ) then
+ if lbSave = TRUE then
+ LoadQuickstarter.Check else LoadQuickstarter.UnCheck
+ endif
+ endif
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ if ( ExtrasOptionenDlg.notExists( 3 ) ) then
+ printlog( "Options closed" )
+ endif
+
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Memory" )
+
+ printlog " - check the reset data"
+ if UndoSteps.GetText <> lsSave(1) then
+ Warnlog "Undo steps => changes not saved!"
+ endif
+ if StarOffice.GetText <> lsSave(2) then
+ Warnlog "Use For StarOffice => changes not saved!"
+ endif
+ if MemoryPerObject.GetText <> lsSave(3) then
+ Warnlog "Memory per object => changes not saved! => " + MemoryPerObject.GetText
+ endif
+ if RemoveFromMemoryAfter.GetText <> lsSave(4) then
+ Warnlog "Remove from memory after => changes not saved! =>" + RemoveFromMemoryAfter.GetText
+ endif
+ if NumberOfObjects.GetText <> lsSave(5) then
+ Warnlog "Number of objects => changes not saved!"
+ endif
+ if ( bHasQuickstarter ) then
+ if LoadQuickstarter.IsChecked <> lbSave then
+ Warnlog "Load StarOffice during system-startup => changes not saved!"
+ endif
+ endif
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ if ( ExtrasOptionenDlg.notExists( 3 ) ) then
+ printlog( "Options closed" )
+ endif
+
+endcase
+
+
+
diff --git a/testautomation/framework/optional/includes/options_ooo_paths.inc b/testautomation/framework/optional/includes/options_ooo_paths.inc
new file mode 100644
index 000000000000..692f538d6507
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_ooo_paths.inc
@@ -0,0 +1,349 @@
+'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 : Options - StarOffice - path settings
+'*
+'\******************************************************************************
+
+
+testcase tOOoPaths
+ Dim lsPathOptions(50) as String
+ Dim lsDialtype(50) as String
+ Dim lsPaths(10,50) as String
+ Dim lsEntry(50) as String
+ Dim i, j, a as Integer
+ Dim sTTInputPath as String
+ dim iTypeOfDialog as integer
+ dim sTyp as string
+ dim iPaths as integer
+ dim iTyp as integer
+ dim iCountOfDialogs(3) as integer
+ dim aPath() as string
+ dim i68646 as boolean
+
+ i68646 = FALSE
+ sTTInputPath = ConvertPath ( gOfficePath + "user\work" )
+ ' Name; which open dialog; Count of Paths
+' call GetPathList ( lsPathOptions (), lsDialtype (), lsEntry () )
+ ' which open dialog: 1: File Open; Else (2): Paths dialog
+ 'call DumpPathList( lsPathOptions (), lsDialtype (), lsEntry () )
+
+ ToolsOptions
+ hToolsOptions("StarOffice", "Paths")
+
+ 'reset everything to default; changes made in master.inc are undone for this test.
+ Typ.TypeKeys("<down><HOME>")
+ iTyp = Typ.getItemCount
+ if iTyp <> 8 then
+ warnlog "Unexpected count of File Types: should: " + 8 + "; is: " + iTyp
+ else
+ printlog "Count of Path Types: " + iTyp
+ endif
+ for i = 1 to iTyp
+ try
+ standard.click
+ catch
+ qaerrorlog "Unexpected: No Standard"
+ endcatch
+ Typ.TypeKeys( "<DOWN>" )
+ next i
+
+ printlog("save settings")
+ for i = 1 to iTyp
+ if i <> 1 then
+ Typ.TypeKeys "<Down>"
+ else
+ Typ.TypeKeys "<Down>"
+ Typ.TypeKeys "<Home>"
+ endif
+ sleep 1
+ sTyp = Typ.getText
+ aPath() = split(Typ.getItemText(i,2),";")
+ lsPathOptions(i) = sTyp
+
+ Bearbeiten.Click
+ kontext
+ if active.exists(5) then
+ qaerrorlog "Active: " + active.getText
+ active.ok
+ endif
+ kontext "OeffnenDlg"
+ if OeffnenDlg.Exists(5) then
+ iTypeOfDialog = 1
+ inc(iCountOfDialogs(1))
+ else
+ kontext "PfadeAuswaehlen"
+ if PfadeAuswaehlen.Exists(5) then
+ iTypeOfDialog = 2
+ inc(iCountOfDialogs(2))
+ else
+ ' EXIT CONDITION
+ warnlog "No kind of File Dialog is open - exiting test"
+ iTypeOfDialog = 0
+ goto endsub
+ endif
+ endif
+
+ lsDialtype(i) = iTypeOfDialog
+ select case iTypeOfDialog
+ case 1:' printlog( " - Dialogtype: FileOpen" )
+ kontext "OeffnenDlg"
+ if OeffnenDlg.Exists(2) then
+ lsPaths(1,i) = Pfad.GetSelText
+ ' change Path
+ Pfad.SetText sTTInputPath
+ try
+ Auswaehlen.Click
+ catch
+ qaErrorlog "Catch -1-?"
+ OeffnenDlg.typekeys("<MOD+S>")
+ endcatch
+ printlog "" + i + "/1: " + right(lsPaths(1,i),10) + " : " + sTyp + " " + lsPaths(1,i)
+ else
+ warnlog "No Path dialog available"
+ end if
+ case 2:' printlog( " - Dialogtype: PathDialog" )
+ kontext "PfadeAuswaehlen"
+ if PfadeAuswaehlen.Exists(2) then
+ try
+ iPaths = Pfade.GetItemCount
+ catch
+ qaErrorLog "#i68646# Path Multilistbox is invisible to TestTool application"
+ i68646 = TRUE
+ iPaths=0
+ endcatch
+ lsEntry(i) = iPaths
+ if NOT i68646 then
+ if (2 <> iPaths) then
+ warnlog "Unexpected count of paths; Should: " + 2 + "; Is: " + iPaths
+ endif
+ endif
+ for j=1 to iPaths
+ lsPaths(j,i) = Pfade.GetItemtext(j)
+ next j
+ Hinzufuegen.Click
+ kontext "OeffnenDlg"
+ if OeffnenDlg.exists(5) then
+ Pfad.SetText sTTInputPath
+ lsPaths(iPaths+1,i) = sTTInputPath
+ Sleep (1)
+ try
+ Auswaehlen.Click
+ catch
+ OeffnenDlg.typekeys( "<MOD+S>" )
+ endcatch
+ kontext
+ if active.exists(5) then
+ qaErrorLog "Active about already existsing path?: '" + active.getText + "' + '" + sTTInputPath + "'"
+ active.OK
+ endif
+ else
+ warnlog "No Path dialog available"
+ endif
+ kontext "PfadeAusWaehlen"
+ PfadeAuswaehlen.OK
+ printlog "" + i + "/"+iPaths+": " + right(lsPaths(1,i),10) + " : " + sTyp
+ printlog "" + i + "/-: " + right(lsPaths(2,i),10) + " : " + sTyp
+ else
+ warnlog "No Path dialog available"
+ endif
+ case else: warnlog "Unexpected kind of Path dialog available"
+ end select
+ Sleep(1)
+ ' double cross check of Paths in both dialogs
+ if (uBound(aPath()) <> (iTypeOfDialog-1)) then
+ qaErrorLog ("Sanity check failed.")
+ endif
+ kontext "tabpfade"
+ next i
+ printlog "Path changed to, or added: '" + sTTInputPath + "'"
+
+ 'Check if count of kinds of dialogs match
+ if iCountOfDialogs(1) <> 4 then
+ warnlog "Unexpected count of File Open Dialogs: should: " + 4 + "; is: " + iCountOfDialogs(1)
+ else
+ printlog "Count of File Open Dialogs: " + iCountOfDialogs(1)
+ endif
+ if iCountOfDialogs(2) <> 4 then
+ warnlog "Unexpected count of File Open Dialogs: should: " + 4 + "; is: " + iCountOfDialogs(2)
+ else
+ printlog "Count of File Open Dialogs: " + iCountOfDialogs(2)
+ endif
+
+ kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (4)
+ printlog("Exit/restart StarOffice")
+ ExitRestartTheOffice
+ printlog( "Check changes")
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Paths" )
+
+ for i = 1 to iTyp
+ ' It's a treelistbox with multiselection;
+ ' .select would select an additional item :-(
+ ' a lonely <home> wouldn't change the selction :-<
+ if i <> 1 then
+ Typ.typeKeys("<down>")
+ else
+ Typ.typeKeys("<down>")
+ Typ.typeKeys("<Home>")
+ endif
+ sleep(1)
+
+ try
+ Bearbeiten.Click
+ catch
+ warnlog "Multiselection ?"
+ endcatch
+ kontext
+ if active.exists(5) then
+ warnlog "#i72017# '"+active.getText+"'"
+ active.ok
+ endif
+ select case lsDialtype(i)
+ case 1:
+ kontext "OeffnenDlg"
+ if OeffnenDlg.Exists(5) then
+ sTyp = Pfad.GetSelText
+ if (sTyp <> sTTInputPath) then
+ if (sTyp <> ( sTTInputPath + gPathSigne)) then
+ Warnlog "'" + lsPathOptions(i) + "' options is not saved! => must: '" + sTTInputPath + "' is: '" + sTyp +"'"
+ endif
+ end if
+ ' reset to default
+ ' compute path's that were changed in TestStartUp (work and temp)
+ if ((Right(lsPaths(1,i),5)="work"+gPathSigne) OR (Right(lsPaths(1,i),4)="work")) then
+ Pfad.SetText(lsPaths(1,i))
+ Auswaehlen.Click
+ else
+ OeffnenDlg.Cancel
+ kontext "tabpfade"
+ if Standard.IsEnabled then
+ Standard.Click
+ else
+ warnlog "Can't reset to standard"
+ endif
+ endif
+ end if
+ case 2:
+ kontext "PfadeAuswaehlen"
+ if PfadeAuswaehlen.exists (5) then
+ try
+ iPaths = Pfade.GetItemCount
+ catch
+ printlog "failed"
+ iPaths=0
+ endcatch
+ for j=1 to iPaths
+ if (lsPaths(j,i) <> Pfade.GetItemtext(j)) then
+ Warnlog "'" + lsPathOptions(i) + "': " + j + ". options is not saved! Path found: '" + Pfade.GetItemtext(j) + "'; expected: '" + lsPaths(j,i) +"'"
+ endif
+ next j
+ PfadeAuswaehlen.Cancel
+ end if
+ ' reset to default
+ kontext "tabpfade"
+ if Standard.IsEnabled then
+ Standard.Click
+ else
+ warnlog "Can't reset to standard"
+ endif
+ case else: warnlog "Unexpected kind of file open dialog"
+ end select
+ sleep 1
+ kontext "tabpfade"
+ next i
+
+ printlog("Reset to default ( with default-button )")
+ if gPlatgroup = "unx" then
+ hToolsOptions ( "StarOffice", "General" )
+ endif
+ Sleep (4)
+ kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK()
+ Sleep (4)
+ printlog("Check the reset")
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Paths" )
+ for i = 1 to iTyp
+ if i <> 1 then
+ Typ.TypeKeys "<Down>"
+ else
+ Typ.TypeKeys "<Down>"
+ Typ.TypeKeys "<Home>"
+ end if
+ sleep(1)
+ Bearbeiten.Click
+ kontext
+ if active.exists(5) then
+ qaerrorlog active.getText
+ active.ok
+ endif
+ select case lsDialtype(i)
+ case 1:
+ kontext "OeffnenDlg"
+ if OeffnenDlg.Exists(5) then
+ sTyp = Pfad.GetSelText
+ if (sTyp <> lsPaths(1,i)) then
+ Warnlog "'" + lsPathOptions(i) + "' options is not saved! => must: '" + lsPaths(1,i) + "' is: '" + sTyp +"'"
+ endif
+ OeffnenDlg.Cancel
+ end if
+ case 2:
+ kontext "PfadeAuswaehlen"
+ if PfadeAuswaehlen.exists(5) then
+ try
+ iPaths = Pfade.GetItemCount
+ catch
+ printlog "failed"
+ iPaths = 0
+ endcatch
+ for j=1 to iPaths
+ if (lsPaths(j,i) <> Pfade.GetItemtext(j)) then
+ Warnlog "'" + lsPathOptions(i) + "': " + j + ". options is not saved! Path found: '" + Pfade.GetItemtext(j) + "'; expected: '" + lsPaths(j,i) +"'"
+ endif
+ next j
+ PfadeAuswaehlen.Cancel
+ end if
+ case else: warnlog "Unexpected kind of file open dialog"
+ end select
+ sleep(1)
+ kontext "tabpfade"
+ next i
+ if gPlatgroup = "unx" then
+ hToolsOptions ( "StarOffice", "General" )
+ endif
+ Sleep (4)
+ kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ printlog("Exit/restart StarOffice")
+ ExitRestartTheOffice
+endcase
+
diff --git a/testautomation/framework/optional/includes/options_ooo_print.inc b/testautomation/framework/optional/includes/options_ooo_print.inc
new file mode 100644
index 000000000000..23cced8c737d
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_ooo_print.inc
@@ -0,0 +1,438 @@
+'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 : Tools->Options: OpenOffice.org Print
+'*
+'\******************************************************************************
+
+
+testcase tOOoPrint
+
+ Dim lbSave ( 3 ) as Boolean
+ Dim lsSavePrinter ( 3 ) as String
+ Dim lbSavePrinter ( 13 ) as Boolean
+ Dim lsSaveFile ( 3 ) as String
+ Dim lbSaveFile ( 13 ) as Boolean
+
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Print" )
+
+ printlog " - save old settings"
+ printlog " - save settings for 'printer'"
+ Printer.Check
+ Sleep (2)
+ lbSavePrinter (1) = ReduceTransparency.IsChecked
+ ReduceTransparency.Uncheck
+ lbSave(3) = Transparency.IsChecked
+ ReduceTransparency.Check
+ lbSavePrinter (2) = Automatically.IsChecked
+ lbSavePrinter (3) = NoTransparency.IsChecked
+
+ lbSavePrinter (4) = ReduceGradients.IsChecked
+ ReduceGradients.Check
+ lbSavePrinter (5) = GradientStripes.IsChecked
+ lbSavePrinter (6) = IntermediateColor.IsChecked
+ GradientStripes.Check
+ lsSavePrinter (1) = Stripes.GetText
+
+ lbSavePrinter (7) = ReduceBitmaps.IsChecked
+ ReduceBitmaps.Check
+ lbSavePrinter (8) = GoodPrintQuality.IsChecked
+ lbSavePrinter (9) = NormalPrintQuality.IsChecked
+ lbSavePrinter (10) = Resolution.IsChecked
+ lbSavePrinter (11) = IncludeTransparentObjects.IsChecked
+ Resolution.Check
+ lsSavePrinter (2) = DPI.GetSelText
+
+ lbSavePrinter (12) = ConvertColorsToGrayscale.IsChecked
+
+ printlog " - save settings for 'print to file'"
+ PrintToFile.Check
+ Sleep (2)
+ lbSaveFile (1) = ReduceTransparency.IsChecked
+ ReduceTransparency.Check
+ lbSaveFile (2) = Automatically.IsChecked
+ lbSaveFile (3) = NoTransparency.IsChecked
+
+ lbSaveFile (4) = ReduceGradients.IsChecked
+ ReduceGradients.Check
+ lbSaveFile (5) = GradientStripes.IsChecked
+ lbSaveFile (6) = IntermediateColor.IsChecked
+ GradientStripes.Check
+ lsSaveFile (1) = Stripes.GetText
+
+ lbSaveFile (7) = ReduceBitmaps.IsChecked
+ ReduceBitmaps.Check
+ lbSaveFile (8) = GoodPrintQuality.IsChecked
+ lbSaveFile (9) = NormalPrintQuality.IsChecked
+ lbSaveFile (10) = Resolution.IsChecked
+ lbSaveFile (11) = IncludeTransparentObjects.IsChecked
+ Resolution.Check
+ lsSaveFile (2) = DPI.GetSelText
+
+ lbSaveFile (12) = ConvertColorsToGrayscale.IsChecked
+
+ printlog " - save general settings "
+ lbSave(1) = PaperOrientation.IsChecked
+ lbSave(2) = PaperSize.IsChecked
+
+ printlog " - invert/change settings"
+ printlog " - changes for 'printer'"
+ Printer.Check
+ Sleep (2)
+ if lbSavePrinter (1) = FALSE then ReduceTransparency.Check else ReduceTransparency.UnCheck
+ if ReduceTransparency.IsChecked then
+ NoTransparency.Check
+ else
+ if lbSave(3) = FALSE then Transparency.Check else Transparency.UnCheck
+ end if
+
+ if lbSavePrinter (4) = FALSE then ReduceGradients.Check else ReduceGradients.UnCheck
+ if ReduceGradients.IsChecked then
+ IntermediateColor.Check
+ end if
+
+ if lbSavePrinter (7) = FALSE then ReduceBitmaps.Check else ReduceBitmaps.UnCheck
+ if ReduceBitmaps.IsChecked then
+ Resolution.Check
+ DPI.select 1
+ if lbSavePrinter (11) = FALSE then IncludeTransparentObjects.Check else IncludeTransparentObjects.UnCheck
+ end if
+
+ if lbSavePrinter (12) = FALSE then ConvertColorsToGrayscale.Check else ConvertColorsToGrayscale.UnCheck
+
+ printlog " - changes for 'print to file'"
+ PrintToFile.Check
+ Sleep (2)
+ if lbSaveFile (1) = FALSE then ReduceTransparency.Check else ReduceTransparency.UnCheck
+ if ReduceTransparency.IsChecked then
+ Automatically.Check
+ end if
+
+ if lbSaveFile (4) = FALSE then ReduceGradients.Check else ReduceGradients.UnCheck
+ if ReduceGradients.IsChecked then
+ GradientStripes.Check
+ Stripes.SetText "30"
+ end if
+
+ if lbSaveFile (7) = FALSE then ReduceBitmaps.Check else ReduceBitmaps.UnCheck
+ if ReduceBitmaps.IsChecked then
+ GoodPrintQuality.Check
+ if lbSaveFile (11) = FALSE then IncludeTransparentObjects.Check else IncludeTransparentObjects.UnCheck
+ end if
+
+ if lbSaveFile (12) = FALSE then ConvertColorsToGrayscale.Check else ConvertColorsToGrayscale.UnCheck
+
+ printlog " - changes for general settings"
+ if lbSave(1) = FALSE then PaperOrientation.Check else PaperOrientation.UnCheck
+ if lbSave(2) = FALSE then PaperSize.Check else PaperSize.UnCheck
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - exit/restart StarOffice"
+ ExitRestartTheOffice
+
+ printlog " - check invertation/changes"
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Print" )
+
+ printlog " - check for 'printer'"
+ Printer.Check
+ Sleep (2)
+ if ReduceTransparency.IsChecked = lbSavePrinter (1) then Warnlog "Reduce transparency => changes not saved! => BugID 87446"
+ if ReduceTransparency.IsChecked then
+ if NoTransparency.IsChecked <> TRUE then Warnlog "No transparency => changes not saved!"
+ else
+ if Transparency.IsChecked = lbSave(2) then Warnlog "Transparency => changes not saved!"
+ end if
+
+
+ if ReduceGradients.IsChecked = lbSavePrinter (4) then Warnlog "ReduceGradients => changes not saved!"
+ if ReduceGradients.IsChecked then
+ if IntermediateColor.IsChecked <> TRUE then Warnlog "Intermediate color => changes not saved!"
+ end if
+
+ if ReduceBitmaps.IsChecked = lbSavePrinter (7) then Warnlog "Reduce bitmaps => changes not saved!"
+ if ReduceBitmaps.IsChecked then
+ if Resolution.IsChecked <> TRUE then
+ Warnlog "Resolution => changes not saved!"
+ else
+ if DPI.GetSelIndex <> 1 then Warnlog "DPI => changes not saved!"
+ end if
+ if IncludeTransparentObjects.IsChecked = lbSavePrinter (11) then Warnlog "Include Transparent Objects => changes not saved!"
+ end if
+
+ if ConvertColorsToGrayscale.IsChecked = lbSavePrinter (12) then Warnlog "Convert Colors To Grayscale => changes not saved!"
+
+ printlog " - check for 'print to file'"
+ PrintToFile.Check
+ Sleep (2)
+ if ReduceTransparency.IsChecked = lbSaveFile (1) then Warnlog "Reduce transparency => changes not saved!"
+ if ReduceTransparency.IsChecked then
+ if Automatically.IsChecked <> TRUE then Warnlog "Automatically => changes not saved!"
+ end if
+
+ if ReduceGradients.IsChecked = lbSaveFile (4) then Warnlog "Reduce gradients => changes not saved!"
+ if ReduceGradients.IsChecked then
+ if GradientStripes.IsChecked <> TRUE then Warnlog "GradientStripes => changes not saved!"
+ if GradientStripes.IsChecked then
+ if Stripes.GetText <> "30" then Warnlog "Stripes => changes not saved!"
+ end if
+ end if
+
+ if ReduceBitmaps.IsChecked = lbSaveFile (7) then Warnlog "Reduce bitmaps => changes not saved!"
+
+ if ReduceBitmaps.IsChecked then
+ if GoodPrintQuality.IsChecked <> TRUE then Warnlog "Good print quality => changes not saved!"
+ if IncludeTransparentObjects.IsChecked = lbSaveFile (11) then Warnlog "Include transparent objects = changes not saved!"
+ end if
+
+ if ConvertColorsToGrayscale.IsChecked = lbSaveFile (12) then warnlog "Convert colors to grayscale => changes not saved!"
+
+ printlog " - check for general settings"
+ if PaperOrientation.IsChecked = lbSave(1) then warnlog "Paper orientation => changes not saved! #i29960"
+ if PaperSize.IsChecked = lbSave(2) then Warnlog "Paper size => changes not saved! #i29960"
+
+ printlog " - 2. changes"
+ printlog " - 'printer'"
+ Printer.Check
+ Sleep (2)
+ ReduceTransparency.UnCheck
+ ReduceGradients.Check
+ GradientStripes.Check
+ Stripes.SetText "120"
+ ReduceBitmaps.Check
+ GoodPrintQuality.Check
+ IncludeTransparentObjects.Check
+ ConvertColorsToGrayscale.UnCheck
+
+ printlog " - 'print to file'"
+ PrintToFile.Check
+ ReduceTransparency.Check
+ NoTransparency.Check
+ ReduceGradients.Uncheck
+ ReduceBitmaps.UnCheck
+ ConvertColorsToGrayscale.Check
+
+ printlog " - general settings"
+ PaperOrientation.UnCheck
+ PaperSize.Check
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check 2. changes"
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Print" )
+
+ printlog " - check for 'printer'"
+ Printer.Check
+ Sleep (2)
+ if ReduceTransparency.IsChecked <> FALSE then Warnlog "Reduce transparency => changes not saved!"
+ if ReduceGradients.IsChecked <> TRUE then
+ Warnlog "ReduceGradients => changes not saved!"
+ else
+ if GradientStripes.IsChecked <> TRUE then
+ Warnlog "GradientStripes => changes not saved!"
+ else
+ if Stripes.GetText <> "120" then Warnlog "Stripes => changes not saved!"
+ end if
+ end if
+ if ReduceBitmaps.IsChecked <> TRUE then
+ Warnlog "Reduce bitmaps => changes not saved!"
+ else
+ if GoodPrintQuality.IsChecked <> TRUE then Warnlog "Good print quality => changes not saved!"
+ if IncludeTransparentObjects.IsChecked <> TRUE then Warnlog "Include Transparent Objects => changes not saved!"
+ end if
+ if ConvertColorsToGrayscale.IsChecked <> FALSE then Warnlog "Convert Colors To Grayscale => changes not saved!"
+
+ printlog " - check 'print to file'"
+ PrintToFile.Check
+ Sleep (2)
+ if ReduceTransparency.IsChecked <> TRUE then
+ Warnlog "Reduce transparency => changes not saved!"
+ else
+ if NoTransparency.IsChecked <> TRUE then Warnlog "No transpanency => changes not saved!"
+ end if
+ if ReduceGradients.IsChecked <> FALSE then Warnlog "Reduce gradients => changes not saved!"
+ if ReduceBitmaps.IsChecked <> FALSE then Warnlog "Reduce bitmaps => changes not saved!"
+ if ConvertColorsToGrayscale.IsChecked <> TRUE then Warnlog "Convert colors to grayscale => changes not saved!"
+
+ printlog " - check general settings"
+ if PaperOrientation.IsChecked <> FALSE then warnlog "Paper orientation => changes not saved!"
+ if PaperSize.IsChecked <> TRUE then Warnlog "Paper size => changes not saved! #i29960"
+
+ printlog " - reset to saved settings"
+ printlog " - 'printer'"
+ Printer.Check
+ Sleep (2)
+ ReduceTransparency.Check
+ if lbSavePrinter (2) = TRUE then Automatically.Check
+ if lbSavePrinter (3) = TRUE then NoTransparency.Check
+ ReduceTransparency.UnCheck
+ if lbSave(3) = TRUE then Transparency.Check else Transparency.Uncheck
+ if lbSavePrinter (1) = TRUE then ReduceTransparency.check else ReduceTransparency.Uncheck
+
+ ReduceGradients.Check
+ GradientStripes.Check
+ Stripes.SetText lsSavePrinter (1)
+ if lbSavePrinter (5) = TRUE then GradientStripes.Check
+ if lbSavePrinter (6) = TRUE then IntermediateColor.Check
+ if lbSavePrinter (4) = TRUE then ReduceGradients.Check else ReduceGradients.UnCheck
+ if lbSavePrinter (4) = TRUE then ReduceGradients.Check else ReduceGradients.UnCheck
+
+ ReduceBitmaps.Check
+ Resolution.Check
+ DPI.Select lsSavePrinter (2)
+ if lbSavePrinter (8) = TRUE then GoodPrintQuality.Check
+ if lbSavePrinter (9) = TRUE then NormalPrintQuality.Check
+ if lbSavePrinter (10) = TRUE then Resolution.Check
+ if lbSavePrinter (11) = TRUE then IncludeTransparentObjects.Check else IncludeTransparentObjects.UnCheck
+ if lbSavePrinter (7) = TRUE then ReduceBitmaps.Check else ReduceBitmaps.UnCheck
+
+ if lbSavePrinter (12) = TRUE then ConvertColorsToGrayscale.Check else ConvertColorsToGrayscale.UnCheck
+
+ printlog " - 'print to file'"
+ PrintToFile.Check
+ Sleep (2)
+ ReduceTransparency.Check
+ if lbSaveFile (2) = TRUE then Automatically.Check
+ if lbSaveFile (3) = TRUE then NoTransparency.Check
+ if lbSaveFile (1) = TRUE then ReduceTransparency.Check else ReduceTransparency.UnCheck
+
+ ReduceGradients.Check
+ GradientStripes.Check
+ Stripes.SetText lsSaveFile (1)
+ if lbSaveFile (5) = TRUE then GradientStripes.Check
+ if lbSaveFile (6) = TRUE then IntermediateColor.Check
+ if lbSaveFile (4) = TRUE then ReduceGradients.Check else ReduceGradients.UnCheck
+
+ ReduceBitmaps.Check
+ Resolution.Check
+ DPI.Select lsSaveFile (2)
+ if lbSaveFile (8) = TRUE then GoodPrintQuality.Check
+ if lbSaveFile (9) = TRUE then NormalPrintQuality.Check
+ if lbSaveFile (10) = TRUE then Resolution.Check
+ if lbSaveFile (11) = TRUE then IncludeTransparentObjects.Check else IncludeTransparentObjects.UnCheck
+ if lbSaveFile (7) = TRUE then ReduceBitmaps.Check else ReduceBitmaps.Uncheck
+
+ if lbSaveFile (12) = TRUE then ConvertColorsToGrayscale.Check else ConvertColorsToGrayscale.UnCheck
+
+ printlog " - general settings"
+ if lbSave(1) = TRUE then PaperOrientation.check else PaperOrientation.Uncheck
+ if lbSave(2) = TRUE then PaperSize.Check else PaperSize.UnCheck
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+
+ printlog " - check changes"
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "Print" )
+
+ printlog " - check for 'printer'"
+ Printer.Check
+ Sleep (2)
+ if ReduceTransparency.IsChecked <> lbSavePrinter (1) then Warnlog "Reduce transparency => changes not saved!"
+ ReduceTransparency.Check
+ if Automatically.IsChecked <> lbSavePrinter (2) then Warnlog "Automatically => changes not saved!"
+ if NoTransparency.IsChecked <> lbSavePrinter (3) then Warnlog "No transparency => changes not saved!"
+ ReduceTransparency.UnCheck
+ if Transparency.IsChecked <> lbSave(3) then Warnlog "Transparency => changes not saved!"
+ if lbSavePrinter (1) = TRUE then ReduceTransparency.Check else ReduceTransparency.UnCheck
+
+ if ReduceGradients.IsChecked <> lbSavePrinter (4) then Warnlog "Reduce Gradients => changes not saved!"
+ ReduceGradients.Check
+ if GradientStripes.IsChecked <> lbSavePrinter (5) then Warnlog "GradientStripes => changes not saved!"
+ if IntermediateColor.IsChecked <> lbSavePrinter (6) then Warnlog "Intermediate color => changes not saved!"
+ GradientStripes.Check
+ if Stripes.GetText <> lsSavePrinter (1) then Warnlog "Stripes => changes not saved!"
+ if lbSavePrinter (5) = TRUE then GradientStripes.Check else IntermediateColor.Check
+ if lbSavePrinter (4) = TRUE then ReduceGradients.Check else ReduceGradients.UnCheck
+
+ if ReduceBitmaps.IsChecked <> lbSavePrinter (7) then Warnlog "Reduce Bitmaps => changes not saved!"
+ ReduceBitmaps.Check
+ if GoodPrintQuality.IsChecked <> lbSavePrinter (8) then Warnlog "Good print quality => changes not saved!"
+ if NormalPrintQuality.IsChecked <> lbSavePrinter (9) then Warnlog "Normal print quality => changes not saved!"
+ if Resolution.IsChecked <> lbSavePrinter (10) then Warnlog "Resolution => changes not saved!"
+ if IncludeTransparentObjects.IsChecked <> lbSavePrinter (11) then Warnlog "Include transparent objects => changes not saved!"
+ Resolution.Check
+ if DPI.GetSelText <> lsSavePrinter (2) then Warnlog "DPI => changes not saved!"
+ if lbSavePrinter (8) = TRUE then GoodPrintQuality.Check
+ if lbSavePrinter (9) = TRUE then NormalPrintQuality.Check
+ if lbSavePrinter (10) = TRUE then Resolution.Check
+ if lbSavePrinter (7) = TRUE then ReduceBitmaps.Check else ReduceBitmaps.Uncheck
+
+ if ConvertColorsToGrayscale.IsChecked <> lbSavePrinter (12) then Warnlog "Convert colors to grayscale => changes not saved!"
+
+ printlog " - 'print to file'"
+ PrintToFile.Check
+ Sleep (2)
+ if ReduceTransparency.IsChecked <> lbSaveFile (1) then Warnlog "Reduce transparency => changes not saved!"
+ ReduceTransparency.Check
+ if Automatically.IsChecked <> lbSaveFile (2) then Warnlog "Automatically => changes not saved!"
+ if NoTransparency.IsChecked <> lbSaveFile (3) then Warnlog "No transparency => changes not saved!"
+ if lbSaveFile (1) = TRUE then ReduceTransparency.Check else ReduceTransparency.UnCheck
+
+ if ReduceGradients.IsChecked <> lbSaveFile (4) then Warnlog "Reduce Gradients => changes not saved!"
+ ReduceGradients.Check
+ if GradientStripes.IsChecked <> lbSaveFile (5) then Warnlog "GradientStripes => changes not saved!"
+ if IntermediateColor.IsChecked <> lbSaveFile (6) then Warnlog "Intermediate color => changes not saved!"
+ GradientStripes.Check
+ if Stripes.GetText <> lsSaveFile (1) then Warnlog "Stripes => changes not saved!"
+ if lbSaveFile (5) = TRUE then GradientStripes.Check else IntermediateColor.Check
+ if lbSaveFile (4) = TRUE then ReduceGradients.Check else ReduceGradients.UnCheck
+
+ if ReduceBitmaps.IsChecked <> lbSaveFile (7) then Warnlog "Reduce Bitmaps => changes not saved!"
+ ReduceBitmaps.Check
+ if GoodPrintQuality.IsChecked <> lbSaveFile (8) then Warnlog "Good print quality => changes not saved!"
+ if NormalPrintQuality.IsChecked <> lbSaveFile (9) then Warnlog "Normal print quality => changes not saved!"
+ if Resolution.IsChecked <> lbSaveFile (10) then Warnlog "Resolution => changes not saved!"
+ if IncludeTransparentObjects.IsChecked <> lbSaveFile (11) then Warnlog "Include transparent objects => changes not saved!"
+ Resolution.Check
+ if DPI.GetSelText <> lsSavePrinter (2) then Warnlog "DPI => changes not saved!"
+ if lbSaveFile (8) = TRUE then GoodPrintQuality.Check
+ if lbSaveFile (9) = TRUE then NormalPrintQuality.Check
+ if lbSaveFile (10) = TRUE then Resolution.Check
+ if lbSaveFile (7) = TRUE then ReduceBitmaps.Check else ReduceBitmaps.Uncheck
+
+ if ConvertColorsToGrayscale.IsChecked <> lbSaveFile (12) then Warnlog "Convert colors to grayscale => changes not saved!"
+
+ printlog " - general settings"
+ if PaperOrientation.Ischecked <> lbSave(1) then Warnlog "Paper orientation => changes not saved!"
+ if PaperSize.IsChecked <> lbSave(2) then Warnlog "Paper size. => changes not saved!"
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ Sleep (3)
+endcase
+
diff --git a/testautomation/framework/optional/includes/options_ooo_security.inc b/testautomation/framework/optional/includes/options_ooo_security.inc
new file mode 100644
index 000000000000..c3dece4de849
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_ooo_security.inc
@@ -0,0 +1,134 @@
+'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 : Tools->Options: OpenOffice.org Security
+'*
+'\******************************************************************************
+
+testcase tOOoSecurity
+ dim _file as string
+
+ if ( getDocumentCount() < 1 ) then call hNewDocument()
+ _file = gTesttoolPath & "framework\optional\input\options\ooo_security_defaults.ref"
+ checkSecurityPage( _file )
+
+ if ( getDocumentCount() < 1 ) then call hNewDocument()
+ _file = gTesttoolPath & "framework\optional\input\options\ooo_security_changed.ref"
+ changeSecurityPage( _file )
+
+ if ( getDocumentCount() < 1 ) then call hNewDocument()
+ checkSecurityPage( _file )
+
+ if ( getDocumentCount() < 1 ) then call hNewDocument()
+ _file = gTesttoolPath & "framework\optional\input\options\ooo_security_defaults.ref"
+ changeSecurityPage( _file )
+
+ if ( getDocumentCount() < 1 ) then call hNewDocument()
+ checkSecurityPage( _file )
+
+ kontext "ExtrasOptionenDlg"
+ if ( ExtrasOptionenDlg.exists() ) then
+ ExtrasOptionenDlg.ok()
+ else
+ warnlog( "options dialog not available"
+ endif
+ if ( getDocumentCount() > 0 ) then call hCloseDocument()
+
+endcase
+
+'*******************************************************************************
+
+sub checkSecurityPage( _file as string )
+ _file = convertpath( _file )
+
+ printlog( " * Testing current settings against a reference list." )
+ printlog( " * Using settings from file: " & _file )
+
+ ToolsOptions
+ call hToolsOptions("StarOffice", "Security")
+
+ kontext "TabSecurity"
+ if ( TabSecurity.exists() ) then
+
+ Options.click
+
+ Kontext "TabSecurityOptionsAndWarnings"
+ if ( TabSecurityOptionsAndWarnings.exists( 2 ) ) then
+ checkCheckBox( _file , "*" , SavingOrSendingDocuments )
+ checkCheckBox( _file , "*" , SigningDocuments )
+ checkCheckBox( _file , "*" , PrintingDocuments )
+ checkCheckBox( _file , "*" , CreatingPDFfiles )
+ checkCheckBox( _file , "*" , RemovePersonalInformationOnSaving )
+ checkCheckBox( _file , "*" , RecommendPasswordProtectionOnSaving )
+ TabSecurityOptionsAndWarnings.cancel
+ else
+ warnlog( "Failed to open Security options" )
+ endif
+
+ Kontext "TabSecurity"
+ if ( TabSecurity.exists() ) then
+ checkCheckBox( _file , "*" , RecommendToOpenDocumentReadOnly )
+ checkCheckBox( _file , "*" , RecordChanges )
+ else
+ warnlog( "Could not return to Security Tabpage" )
+ endif
+ else
+ warnlog( "Security Tabpage not available" )
+ endif
+end sub
+
+'*******************************************************************************
+
+sub changeSecurityPage( _file as string )
+ _file = convertpath( _file )
+
+ printlog( " * Changing current settings according to the reference list." )
+ printlog( " * Using settings from file: " & _file )
+
+ Options.click
+ Kontext "TabSecurityOptionsAndWarnings"
+ setCheckBox( _file , "*" , SavingOrSendingDocuments )
+ setCheckBox( _file , "*" , SigningDocuments )
+ setCheckBox( _file , "*" , PrintingDocuments )
+ setCheckBox( _file , "*" , CreatingPDFfiles )
+ setCheckBox( _file , "*" , RemovePersonalInformationOnSaving )
+ setCheckBox( _file , "*" , RecommendPasswordProtectionOnSaving )
+ TabSecurityOptionsAndWarnings.cancel
+ Kontext "TabSecurity"
+ setCheckBox( _file , "*" , RecommendToOpenDocumentReadOnly )
+ setCheckBox( _file , "*" , RecordChanges )
+
+ Kontext "OptionenDLG"
+ OptionenDLG.OK
+
+ sleep(2)
+ call exitRestartTheOffice()
+end sub
+
+
diff --git a/testautomation/framework/optional/includes/options_ooo_userdata.inc b/testautomation/framework/optional/includes/options_ooo_userdata.inc
new file mode 100644
index 000000000000..9d5da5da6194
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_ooo_userdata.inc
@@ -0,0 +1,212 @@
+'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 : Tools->Options: OpenOffice.org User Data
+'*
+'\******************************************************************************
+
+
+testcase tOOoUserData
+ Dim lsSave ( 20 ) as String
+
+
+ hInitSingleDoc()
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "UserData" )
+
+ printlog " - save old data"
+ lsSave ( 1 ) = Firma.GetText
+ lsSave ( 2 ) = VorName.GetText
+ lsSave ( 3 ) = ZuName.GetText
+ lsSave ( 4 ) = Kuerzel.GetText
+ lsSave ( 5 ) = Strasse.GetText
+ lsSave ( 6 ) = Land.GetText
+ lsSave ( 7 ) = Titel.GetText
+ lsSave ( 8 ) = Position.GetText
+ lsSave ( 9 ) = TelPriv.GetText
+ lsSave ( 10 ) = TelGe.GetText
+ lsSave ( 11 ) = Fax.GetText
+ lsSave ( 12 ) = EMail.GetText
+
+ if iSprache = 01 then
+ lsSave ( 13 ) = City.GetText
+ lsSave ( 14 ) = State.GetText
+ lsSave ( 15 ) = Zip.GetText
+ else
+ lsSave ( 16 ) = PLZ.GetText
+ lsSave ( 17 ) = Ort.GetText
+ end if
+ if Apartmentnummer.IsVisible then lsSave ( 18 ) = Apartmentnummer.GetText
+ if iSprache = 07 then lsSave ( 19 ) = NameDesVaters.GetText
+
+ printlog " - change data"
+ Firma.SetText "Company name"
+ VorName.SetText "First name"
+ ZuName.SetText "Last name"
+ Kuerzel.SetText "FnLn"
+ Strasse.SetText "Street name"
+ Land.SetText "Land name"
+ Titel.SetText "Title name"
+ Position.SetText "Position name"
+ TelPriv.SetText "TelHome number"
+ TelGe.SetText "TelWork number"
+ Fax.SetText "Fax number"
+ EMail.SetText "eMail-adress"
+
+ if iSprache = 01 then
+ City.SetText "City name"
+ State.SetText "State name"
+ Zip.SetText "Zip code"
+ else
+ PLZ.SetText "PLZ name"
+ Ort.SetText "Ort name"
+ end if
+ if Apartmentnummer.IsVisible then Apartmentnummer.SetText "Appart number"
+ if iSprache = 07 then NameDesVaters.SetText "Farthers name"
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ if ( ExtrasOptionenDlg.notExists( 3 ) ) then
+ printlog( "Options closed" )
+ endif
+
+
+ hCloseDocument
+
+ printlog " - exit/restart StarOffice"
+ ExitRestartTheOffice
+
+ printlog " - check changes"
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "UserData" )
+
+ if Firma.GetText <> "Company name" then Warnlog "Company => changes not saved"
+ if VorName.GetText <> "First name" then Warnlog "First name => changes not saved"
+ if ZuName.GetText <> "Last name" then Warnlog "Last name => changes not saved"
+ if Kuerzel.GetText <> "FnLn" then Warnlog "Initials => changes not saved"
+ if Strasse.GetText <> "Street name" then Warnlog "Street => changes not saved"
+ if Land.GetText <> "Land name" then Warnlog "Land => changes not saved"
+ if Titel.GetText <> "Title name" then Warnlog "Title => changes not saved"
+ if Position.GetText <> "Position name" then Warnlog "Position => changes not saved"
+ if TelPriv.GetText <> "TelHome number" then Warnlog "Tel-home => changes not saved"
+ if TelGe.GetText <> "TelWork number" then Warnlog "tel-work => changes not saved"
+ if Fax.GetText <> "Fax number" then Warnlog "Fax => changes not saved"
+ if EMail.GetText <> "eMail-adress" then Warnlog "eMail => changes not saved"
+
+ if iSprache = 01 then
+ if City.GetText <> "City name" then Warnlog "City => changes not saved"
+ if State.GetText <> "State name" then Warnlog "State => changes not saved"
+ if Zip.GetText <> "Zip code" then Warnlog "Zip => changes not saved"
+ else
+ if PLZ.GetText <> "PLZ name" then Warnlog "PLZ => changes not saved"
+ if Ort.GetText <> "Ort name" then Warnlog "Ort => changes not saved"
+ end if
+ if Apartmentnummer.IsVisible then
+ if Apartmentnummer.GetText <> "Appart number" then Warnlog "Appartment => changes not saved"
+ end if
+ if iSprache = 07 then
+ if NameDesVaters.GetText <> "Farthers name" then Warnlog "Farthers name => changes not saved"
+ end if
+
+ printlog " - reset to saved data"
+
+ Firma.SetText lsSave ( 1 )
+ VorName.SetText lsSave ( 2 )
+ ZuName.SetText lsSave ( 3 )
+ Kuerzel.SetText lsSave ( 4 )
+ Strasse.SetText lsSave ( 5 )
+ Land.SetText lsSave ( 6 )
+ Titel.SetText lsSave ( 7 )
+ Position.SetText lsSave ( 8 )
+ TelPriv.SetText lsSave ( 9 )
+ TelGe.SetText lsSave ( 10 )
+ Fax.SetText lsSave ( 11 )
+ EMail.SetText lsSave ( 12 )
+
+ if iSprache = 01 then
+ City.SetText lsSave ( 13 )
+ State.SetText lsSave ( 14 )
+ Zip.SetText lsSave ( 15 )
+ else
+ PLZ.SetText lsSave ( 16 )
+ Ort.SetText lsSave ( 17 )
+ end if
+ if Apartmentnummer.IsVisible then Apartmentnummer.SetText lsSave ( 18 )
+ if iSprache = 07 then NameDesVaters.SetText lsSave ( 19 )
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ if ( ExtrasOptionenDlg.notExists( 3 ) ) then
+ printlog( "Options closed" )
+ endif
+
+
+ printlog " - check data"
+
+ ToolsOptions
+ hToolsOptions ( "StarOffice", "UserData" )
+
+ if Firma.GetText <> lsSave ( 1 ) then Warnlog "Company => changes not saved"
+ if VorName.GetText <> lsSave ( 2 ) then Warnlog "First name => changes not saved"
+ if ZuName.GetText <> lsSave ( 3 ) then Warnlog "Last name => changes not saved"
+ if Kuerzel.GetText <> lsSave ( 4 ) then Warnlog "Initials => changes not saved"
+ if Strasse.GetText <> lsSave ( 5 ) then Warnlog "Street => changes not saved"
+ if Land.GetText <> lsSave ( 6 ) then Warnlog "Land => changes not saved"
+ if Titel.GetText <> lsSave ( 7 ) then Warnlog "Title => changes not saved"
+ if Position.GetText <> lsSave ( 8 ) then Warnlog "Position => changes not saved"
+ if TelPriv.GetText <> lsSave ( 9 ) then Warnlog "Tel-home => changes not saved"
+ if TelGe.GetText <> lsSave ( 10 ) then Warnlog "tel-work => changes not saved"
+ if Fax.GetText <> lsSave ( 11 ) then Warnlog "Fax => changes not saved"
+ if EMail.GetText <> lsSave ( 12 ) then Warnlog "eMail => changes not saved"
+
+ if iSprache = 01 then
+ if City.GetText <> lsSave ( 13 ) then Warnlog "City => changes not saved"
+ if State.GetText <> lsSave ( 14 ) then Warnlog "State => changes not saved"
+ if Zip.GetText <> lsSave ( 15 ) then Warnlog "Zip => changes not saved"
+ else
+ if PLZ.GetText <> lsSave ( 16 ) then Warnlog "PLZ => changes not saved"
+ if Ort.GetText <> lsSave ( 17 ) then Warnlog "Ort => changes not saved"
+ end if
+ if Apartmentnummer.IsVisible then
+ if Apartmentnummer.GetText <> lsSave ( 18 ) then Warnlog "Appartment => changes not saved"
+ end if
+ if iSprache = 07 then
+ if NameDesVaters.GetText <> lsSave ( 19 ) then Warnlog "Farthers name => changes not saved"
+ end if
+
+ Kontext "ExtrasOptionenDlg"
+ ExtrasOptionenDlg.OK
+ if ( ExtrasOptionenDlg.notExists( 3 ) ) then
+ printlog( "Options closed" )
+ endif
+
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/options_ooo_view.inc b/testautomation/framework/optional/includes/options_ooo_view.inc
new file mode 100644
index 000000000000..ff3ee7936751
--- /dev/null
+++ b/testautomation/framework/optional/includes/options_ooo_view.inc
@@ -0,0 +1,243 @@
+'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 : Tools->Options: OpenOffice.org View
+'*
+'\******************************************************************************
+
+testcase tOOoView
+
+
+ dim sFile as string
+
+ printlog "Check if the defaults are correct"
+ sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_defaults.ref"
+ call checkPage( sFile , false )
+
+ printlog "Change all settings to something different to the default"
+ sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_changed.ref"
+ call changePage( sFile , true, 1 )
+
+ printlog "Verify that all changes persist after a restart"
+ sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_changed.ref"
+ call checkPage( sFile , true, 1 )
+
+ printlog "Re-apply the defaults to all controls and restart the application"
+ sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_defaults.ref"
+ call changePage( sFile , false )
+
+ printlog "Verify that all settings have indeed been reset to defaults"
+ call checkPage( sFile , false )
+
+endcase
+
+'*******************************************************************************
+
+sub checkPage( sFile as string , bDisabled as boolean, optional iMiddleMouseButtonControl as integer)
+ dim iMiddleMouseButton as integer
+ dim iMiddleMouseButtonExtern as integer
+ dim iTemp as integer
+
+ ' depends on if defaults or chnges are checked;
+ ' changes : 1
+ ' defaults: 0
+ if isMissing(iMiddleMouseButtonControl) then
+ iMiddleMouseButtonExtern = 0
+ else
+ iMiddleMouseButtonExtern = iMiddleMouseButtonControl
+ endif
+ sFile = convertpath( sFile )
+
+ printlog( " * Testing current settings against a reference list." )
+ printlog( " * Using settings from file: " & sFile )
+
+ ToolsOptions
+ call hToolsOptions( "StarOffice" , "View" )
+
+ ' Antialiasing settings only exist for Linux and Solaris
+ if ( gPlatgroup() <> "w95" ) then
+ if ( bDisabled ) then
+ checkCheckBox( sFile , "*" , FontAntiAliasing)
+ checkEntryField( sFile , "state_aapixel" , AAPixel)
+ else
+ checkEntryField( sFile , "*" , AAPixel)
+ checkCheckBox( sFile , "*" , FontAntiAliasing)
+ endif
+ else
+ if ( FontAntiAliasing.exists() ) then
+ warnlog( "Antialiasing controls not expected on Windows" )
+ endif
+ if ( AAPixel.exists() ) then
+ warnlog( "Antialiasing controls not expected on Windows" )
+ endif
+ endif
+
+ checkEntryField( sFile , "*" , FontScale)
+ checkListBox( sFile , "*" , IconScale )
+ checkListBox( sFile , "*" , IconStyle )
+ checkListBox( sFile , "*" , IconsInMenueAnzeigen )
+ checkListBox( sFile , "*" , IconStyle )
+ checkCheckBox( sFile , "*" , VorschauInSchriftlisten )
+ checkCheckBox( sFile , "*" , SchriftenHistorie )
+
+ if ( UseHardwareAcceleration.isEnabled ) then
+ checkCheckBox( sFile , "*" , UseHardwareAcceleration )
+ else
+ printlog( "Hardware acceleration is not available on this system" )
+ endif
+
+ if ( UseAntiAliasing.isEnabled() ) then
+ checkCheckBox( sFile , "*" , UseAntiAliasing )
+ else
+ printlog( "Antialiasing is not available on this system" )
+ endif
+
+ checkListBox( sFile , "*" , MousePositioning)
+ ' needs to get handled differently on platforms!
+ iMiddleMouseButton = MausAktion.getSelIndex
+ if iMiddleMouseButtonExtern = 1 then
+ checkListBox( sFile , "*" , MausAktion)
+ else
+ if gPlatGroup = "unx" then
+ iTemp = 3 ' Paste clipboard
+ else
+ iTemp = 2 ' Automatic scrolling
+ endif
+ if Itemp = iMiddleMouseButton then
+ printlog " * Middle mouse button: ok"
+ else
+ warnlog "Middle mouse button: expected: '" + iTemp + "' '" _
+ + MausAktion.getItemText(iTemp) + "'; is: '" _
+ + iMiddleMouseButton + "' '" _
+ + MausAktion.getItemText(iMiddleMouseButton) + "'"
+ endif
+ endif
+
+ if ( Transparency.isEnabled() ) then
+ if ( Transparency.isChecked() ) then
+ checkCheckBox( sFile , "*" , transparency )
+ checkEntryField( sFile , "*", selectionopacity )
+ else
+ Transparency.check()
+ checkEntryField( sFile , "*", selectionopacity, "i104150" )
+ Transparency.unCheck()
+ endif
+ else
+ printlog( "Transparency is not available on this system" )
+ endif
+
+ Kontext "OptionenDLG"
+ OptionenDLG.OK
+ WaitSlot()
+ call exitRestartTheOffice
+end sub
+
+'*******************************************************************************
+
+sub changePage( sFile as string , bInverted as boolean, optional iMiddleMouseButtonControl as integer )
+ dim iMiddleMouseButtonExtern as integer
+
+ ' depends on if defaults or chnges are checked;
+ ' changes : 1
+ ' defaults: 0
+ if isMissing(iMiddleMouseButtonControl) then
+ iMiddleMouseButtonExtern = 0
+ else
+ iMiddleMouseButtonExtern = iMiddleMouseButtonControl
+ endif
+
+ sFile = convertpath( sFile )
+ printlog( " * Changing current settings according to the reference list." )
+ printlog( " * Using settings from file: " & sFile )
+
+ ToolsOptions
+ call hToolsOptions( "StarOffice" , "View" )
+ sleep( 2 )
+
+ ' Antialiasing settings only exist for Linux and Solaris
+ if ( gPlatGroup <> "w95" ) then
+ if ( bInverted ) then
+ setEntryField( sFile , "*" , AAPixel )
+ setCheckBox( sFile , "*" , FontAntiAliasing )
+ else
+ setCheckBox( sFile , "*" , FontAntiAliasing )
+ setEntryField( sFile , "*" , AAPixel )
+ endif
+ endif
+
+ setEntryField( sFile , "*" , FontScale )
+ setListBox( sFile , "*" , IconScale )
+ setListBox( sFile , "*" , IconStyle )
+ setListBox( sFile , "*" , IconsInMenueAnzeigen )
+ setCheckBox( sFile , "*" , VorschauInSchriftlisten )
+ setCheckBox( sFile , "*" , SchriftenHistorie )
+
+ if ( UseHardwareAcceleration.isEnabled() ) then
+ setCheckBox( sFile , "*" , UseHardwareAcceleration )
+ else
+ printlog( "Harware acceleration is not available on this system" )
+ endif
+
+ if ( UseAntiAliasing.isEnabled() ) then
+ setCheckBox( sFile , "*" , useantialiasing )
+ else
+ printlog( "Antialiasing is not available on this system" )
+ endif
+
+ setListBox( sFile , "*" , MousePositioning )
+ ' needs to get handled differently on platforms!
+ if iMiddleMouseButtonExtern = 1 then
+ setListBox( sFile , "*" , MausAktion )
+ else
+ if gPlatGroup = "unx" then
+ MausAktion.select(3) ' Paste clipboard
+ else
+ MausAktion.select(2) ' Automatic scrolling
+ endif
+ endif
+
+ if ( Transparency.isEnabled() ) then
+ if ( Transparency.isChecked() ) then
+ setEntryField( sFile , "*", selectionopacity )
+ setCheckBox( sFile , "*" , transparency )
+ else
+ setCheckBox( sFile , "*" , transparency )
+ setEntryField( sFile , "*", selectionopacity )
+ endif
+ else
+ printlog( "Transparency is not available on this system" )
+ endif
+
+ Kontext "OptionenDLG"
+ OptionenDLG.OK
+ WaitSlot()
+ call exitRestartTheOffice
+end sub
+
+
diff --git a/testautomation/framework/optional/includes/scripting_basics.inc b/testautomation/framework/optional/includes/scripting_basics.inc
new file mode 100644
index 000000000000..36f5ce44feec
--- /dev/null
+++ b/testautomation/framework/optional/includes/scripting_basics.inc
@@ -0,0 +1,73 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Quick short test for the scripting framework
+'*
+'\******************************************************************************
+
+testcase tScripting
+
+
+ const ORGANIZER_ITEMS = 2
+
+ hInitBackingMode()
+
+ ToolsMacrosOrganizeMacrosBeanShell
+
+ Kontext "ScriptOrganizer"
+ if ( ScriptOrganizer.exists( 5 ) ) then
+ printlog( "Beanshell Script Organizer is present. Good" )
+ if ( ScriptTreeList.getItemCount() <> ORGANIZER_ITEMS ) then
+ warnlog( "The Treelist does not contain the expected number " & _
+ "of items. Please verify that exactly three top-nodes exist" )
+ endif
+ ScriptOrganizer.cancel()
+ else
+ warnlog( "Script Organizer for Beanshell is missing" )
+ endif
+
+ ToolsMacrosOrganizeMacrosJavaScript
+
+ Kontext "ScriptOrganizer"
+ if ( ScriptOrganizer.exists( 5 ) ) then
+ printlog( "JavaScript Script Organizer is present. Good" )
+ if ( ScriptTreeList.getItemCount() <> ORGANIZER_ITEMS ) then
+ warnlog( "The Treelist does not contain the expected number " & _
+ "of items. Please verify that exactly three top-nodes exist" )
+ endif
+ ScriptOrganizer.cancel()
+ else
+ warnlog( "Script Organizer for JavaScript is missing" )
+ endif
+
+
+endcase
+
+
+
diff --git a/testautomation/framework/optional/includes/scripting_organizers.inc b/testautomation/framework/optional/includes/scripting_organizers.inc
new file mode 100644
index 000000000000..b9b7dcebde7a
--- /dev/null
+++ b/testautomation/framework/optional/includes/scripting_organizers.inc
@@ -0,0 +1,278 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Test scripting-organizers / document-attached scripts
+'*
+'\******************************************************************************
+
+testcase tScriptingOrganizers( iDialog as integer )
+
+ if ( instr( gtSysName , "Solaris" ) > 0 ) then
+ qaerrorlog( "#i93502# JavaScript organizer broken" )
+ goto endsub
+ endif
+
+ ' 1 = BeanShell (.bsh)
+ ' 2 = JavaScript (.js)
+
+ const IDOCPOS = 3
+
+ dim cFileName as string
+ cFileName = "sftest" & hGetSuffix( "current" )
+ dim cCompare as string
+
+ dim cFilePath as string
+ cFilePath= hGetWorkPath() & cFileName
+ cFilePath= convertpath( cFilePath )
+
+ dim iPos as integer ' position of the workdocument in treelist
+ dim brc as boolean ' boolean return code used to determine the status
+
+ dim cLibName as string
+ cLibName = "TTLib"
+ dim cModName as string
+ cModName = "TTMod"
+ dim cScriptName as string
+
+ dim iItemCount as integer
+
+ printlog( "" )
+ printlog( "Test init: set macro security level to low" )
+ hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_LOW )
+
+ select case iDialog
+ case 1 : cScriptName = cModName & ".bsh"
+ case 2 : cScriptName = cModName & ".js"
+ end select
+
+ brc = hDeleteFile( cFilePath )
+
+ printlog( "Test init: Create and prepare document" )
+ brc = hCreateDocument()
+
+ call hChangeDoc()
+
+ brc = hFileSaveAsKill( cFilePath )
+
+ printlog( "" )
+ printlog( "Test 1: ScriptOrganizer/Documents" )
+ brc = hOpenScriptOrganizer( iDialog )
+ if ( not brc ) then
+ warnlog( "Could not open the script Organizer, aborting" )
+ brc = hDestroyDocument()
+ goto endsub
+ endif
+
+ kontext "ScriptOrganizer"
+ iItemCount = hGetNodeCount( ScriptTreeList )
+
+ if ( ScriptTreeList.getItemCount() <> IDOCPOS ) then
+ warnlog( "Incorrect number of documents listed in treelist, aborting" )
+ kontext "ScriptOrganizer"
+ ScriptOrganizer.cancel()
+ brc = hDestroyDocument()
+ goto endsub
+ endif
+
+ kontext "ScriptOrganizer"
+ ScriptTreeList.select( IDOCPOS )
+
+ if ( not PBCreate.isEnabled() ) then
+ warnlog( "Create button should be enabled" )
+ endif
+
+ if ( PBEdit.isEnabled() ) then
+ warnlog( "Edit button should be disabled" )
+ endif
+
+ if ( PBRename.isEnabled() ) then
+ warnlog( "Rename button should be disabled" )
+ endif
+
+ if ( PBDelete.isEnabled() ) then
+ qaerrorlog( "#i50527# - Delete button should be disabled" )
+ endif
+
+
+ printlog( "" )
+ printlog( "Test 2: Libraries/Scripts create/rename" )
+
+ brc = hCreateScriptingObject( "initial_lib" )
+
+ brc = hRenameScriptingObject( cLibName )
+
+ brc = hVerifyNodeName( ScriptTreeList , cLibName )
+ if ( not brc ) then
+ qaerrorlog( "#i50526# Renaming failed: " & cLibName )
+ endif
+
+ cLibName = ScriptTreeList.getSelText()
+
+ if ( not PBCreate.isEnabled() ) then
+ warnlog( "Create button should be enabled" )
+ endif
+
+ if ( PBEdit.isEnabled() ) then
+ warnlog( "Edit button should be disabled" )
+ endif
+
+ if ( not PBRename.isEnabled() ) then
+ warnlog( "Rename button should be enabled" )
+ endif
+
+ if ( not PBDelete.isEnabled() ) then
+ warnlog( "Delete button should be enabled" )
+ endif
+
+ brc = hCreateScriptingObject( "initial_mod" )
+
+ brc = hRenameScriptingObject( cModName )
+
+ brc = hVerifyNodeName( ScriptTreeList , cScriptName )
+ if ( not brc ) then
+ qaerrorlog( "#i50526# Renaming failed: " & cScriptName )
+ endif
+
+ cModName = ScriptTreeList.getSelText()
+
+ if ( PBCreate.isEnabled() ) then
+ warnlog( "Create button should not be enabled" )
+ endif
+
+ if ( not PBEdit.isEnabled() ) then
+ warnlog( "Edit button should be enabled" )
+ endif
+
+ if ( not PBRename.isEnabled() ) then
+ warnlog( "Rename button should be enabled" )
+ endif
+
+ if ( not PBDelete.isEnabled() ) then
+ warnlog( "Delte button should be enabled" )
+ endif
+
+ kontext "ScriptOrganizer"
+ brc = hCloseScriptOrganizer()
+
+ printlog( "" )
+ printlog( "Test 3: Script storage in documents (save/load)" )
+ try
+ hFileSave
+ catch
+ warnlog( "Document Changed status not set" )
+ hChangeDoc()
+ hFileSave
+ endcatch
+
+ brc = hDestroyDocument()
+
+ brc = hFileOpen( cFilePath )
+
+ brc = hOpenScriptOrganizer( iDialog )
+
+ ScriptTreeList.select( 3 )
+
+ iPos = hExpandNode( ScriptTreeList , 0 )
+
+ ScriptTreeList.select( 4 )
+
+ iPos = hExpandNode( ScriptTreeList , 0 )
+ ScriptTreeList.select( 5 )
+
+
+ printlog( "" )
+
+ printlog( "Test 4: Script removal / Document changed" )
+ brc = hDeleteScript( cModName , true )
+ if ( not brc ) then
+ warnlog( "Bad rc: hDelteScript()" )
+ endif
+
+ brc = hDeleteScript( cLibName , true )
+ if ( not brc ) then
+ warnlog( "Bad rc: hDelteScript()" )
+ endif
+
+ brc = hDeleteScript( cFileName , false )
+ if ( not brc ) then
+ qaerrorlog( "#i50527# Delete enabled for document object" )
+ endif
+
+ kontext "ScriptOrganizer"
+ brc = hCloseScriptOrganizer()
+
+ try
+ hFileSave
+ catch
+ warnlog( "Document Changed status expected after script deletion" )
+ brc = hChangeDoc()
+ hFileSave
+ endcatch
+
+ brc = hDestroyDocument()
+
+ printlog( "Reload the document." )
+ brc = hFileOpen( cFilePath )
+ if ( brc ) then
+ qaerrorlog( "#i50530# Macros not completely removed from doc when deleted" )
+ endif
+
+ printlog( "" )
+ printlog( "Test 5: Verification of script removal" )
+ brc = hOpenScriptOrganizer( iDialog )
+ kontext "ScriptOrganizer"
+ iItemCount = hGetNodeCount( ScriptTreeList )
+ if ( iItemCount <> IDOCPOS ) then
+ warnlog( "Treelist not populated, the test cannot continue" )
+ brc = hCloseScriptOrganizer()
+ brc = hDestroyDocument()
+ goto endsub
+ endif
+
+ iPos = hExpandNode( ScriptTreeList , IDOCPOS )
+ if ( iPos <> 3 ) then
+ warnlog( "Not all libraries/scripts have been deleted" )
+ endif
+
+ brc = hCloseScriptOrganizer()
+
+ brc = hCloseNavigator()
+
+ brc = hDestroyDocument()
+
+ brc = hDeleteFile( cFilePath )
+ if ( not brc ) then
+ warnlog( "Could not delete: " & cFilePath & " - do so manually!" )
+ endif
+
+
+ hSetmacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT )
+
+
+endcase
diff --git a/testautomation/framework/optional/includes/security_broken_signature.inc b/testautomation/framework/optional/includes/security_broken_signature.inc
new file mode 100644
index 000000000000..3d7d822a9693
--- /dev/null
+++ b/testautomation/framework/optional/includes/security_broken_signature.inc
@@ -0,0 +1,71 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Load documents containing hidden BASIC scripts
+'*
+'\******************************************************************************
+
+testcase tBrokenSignature()
+
+ printlog( "Load documents containing hidden BASIC scripts" )
+
+ dim aFile as string
+ aFile = "framework\optional\input\security\test_macro (signed).odt"
+ aFile = convertpath( gTesttoolPath & aFile )
+
+ printlog( "" )
+ printlog( "File: " & aFile )
+
+ FileOpen
+
+ kontext "OeffnenDlg"
+ Dateiname.setText( aFile )
+
+ Oeffnen.click()
+ hAllowMacroExecution()
+
+ kontext "Active"
+ if ( active.exists( 2 ) ) then
+ printlog( active.getText() )
+
+ if ( Active.getButtonCount() > 1 ) then
+ warnlog( "This is not the expected dialog" )
+ printlog( "The warning about the not recognized signature is missing" )
+ else
+ printlog( "This appears to be the correct dialog" )
+ endif
+ active.ok()
+ else
+ warnlog( "A messagebox was expected informing about the invalid signature" )
+ endif
+
+ call hCloseDocument()
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/security_certification_dialogs.inc b/testautomation/framework/optional/includes/security_certification_dialogs.inc
new file mode 100644
index 000000000000..2b645712cc02
--- /dev/null
+++ b/testautomation/framework/optional/includes/security_certification_dialogs.inc
@@ -0,0 +1,98 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Walk through a number of dialogs related to digital signatures
+'*
+'\******************************************************************************
+
+testcase tCertificationDialogs
+
+
+ dim brc as boolean
+ const CFN = "tCertificationDialogs::"
+ const SVERSION = "680"
+
+ dim sFile as string
+ sFile = gOfficePath & "user\work\certdlg" & hGetSuffix( SVERSION )
+ sFile = convertpath( sFile )
+
+ hDeleteFile( sFile )
+
+ call hNewDocument()
+
+ call hChangeDoc()
+
+ brc = hOpenDigitalSignaturesDialog()
+
+ kontext "active"
+ if ( active.exists( 1 ) ) then
+ printlog( "MSGBOX: " & active.getText() )
+ active.yes()
+ printlog( CFN & "Allow to save the document" )
+ else
+ if ( gApplication <> "MASTERDOCUMENT" ) then
+ warnlog( CFN & "No message that the file must be saved to be signed" )
+ else
+ printlog( CFN & "OK - No save-message for Masterdoc." )
+ endif
+ endif
+
+ kontext "SpeichernDlg"
+ if ( SpeichernDlg.exists( 1 ) ) then
+ DateiName.setText( sFile )
+ if AutomatischeDateinamenserweiterung.Exists then
+ AutomatischeDateinamenserweiterung.Uncheck
+ endif
+ Speichern.click()
+ else
+ if ( gApplication <> "MASTERDOCUMENT" ) then
+ warnlog( CFN & "Save As Dialog is not open" )
+ else
+ printlog( CFN & "OK - No filesave for Masterdoc." )
+ endif
+ endif
+
+ kontext "DigitalSignature"
+ if ( DigitalSignature.exists( 2 ) ) then
+ printlog( CFN & "Digital signatures is open" )
+ DigitalSignature.cancel()
+ else
+ if ( gApplication <> "MASTERDOCUMENT" ) then
+ warnlog( CFN & "Digital Signatures Dialog is not open" )
+ else
+ printlog( CFN & "OK - No signature dialog for Masterdoc." )
+ endif
+ endif
+
+ call hCloseDocument()
+
+
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/security_certified_docs.inc b/testautomation/framework/optional/includes/security_certified_docs.inc
new file mode 100644
index 000000000000..59f74e809c6f
--- /dev/null
+++ b/testautomation/framework/optional/includes/security_certified_docs.inc
@@ -0,0 +1,147 @@
+'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 : joerg.skottke@sun.co
+'*
+'* short description : Load certified documents and verify the certificate
+'*
+'\******************************************************************************
+
+testcase tLoadCertifiedFile( cBuildID as string )
+
+
+ ' Build the path to the file we want to work with
+ dim cFile as string
+ cFile = gTesttoolpath & "framework\optional\input\security\DigitalSignature"
+ cFile = cFile & hGetSuffix( cBuildId )
+ cFile = convertpath( cFile )
+ printlog( "Using file: " & cFile )
+
+ dim cSigName as string
+ dim sCertData( 20 ) as string
+
+ dim sFileIn as string
+ sFileIn = gTesttoolPath & "framework\optional\input\security\certificate_data.txt"
+ sFileIn = convertpath( sFileIn )
+
+ dim sFileOut as string
+ sFileOut = hGetWorkPath() & "certificate_data.txt"
+
+ ' Variable to store boolean returncodes from functions
+ dim brc as boolean
+ brc = true
+
+ ' the number of certificates attached to the current document
+ dim iCertCount as integer
+
+ printlog( "Load the file" )
+ brc = hFileOpen( cFile )
+ brc = hHandleActivesOnLoad( 0 , 2 )
+
+ ' in case the file did not get loaded, handle the problem by aborting the test
+ if ( not brc ) then
+ warnlog( "The requested file could not be loaded, aborting test" )
+ goto endsub
+ endif
+
+ brc = hOpenDigitalSignaturesDialog()
+
+ ' If the menuitem should not be available, clicking it will fail. In
+ ' this case we must assume that the file has been loaded but the certificate
+ ' does not exist. So we close the document and abort the test here.
+ if ( not brc ) then
+ warnlog( "The requested menuitem is not available, the test ends" )
+ call hCloseDocument()
+ goto endsub
+ endif
+
+ ' second line of defense: If something was opened but this is not the
+ ' digital signatures dialog, we abort as well.
+ ' If no mozill a profile exists, we don't have the means to verify
+ ' certificates, so the test aborts here as well. We get a messagebox then.
+ Kontext "DigitalSignature"
+ if ( not DigitalSignature.exists( 2 ) ) then
+ Kontext "active"
+ if ( active.exists() ) then
+ qaerrorlog( "#i48252# Mozilla profile missing?: " & active.getText() )
+ active.OK()
+ else
+ warnlog( "The current dialog is not <Digital Signatures>. Aborting" )
+ endif
+ call hCloseDocument()
+ goto endsub
+ endif
+
+ ' If we have zero or more than one certificate, this is probably a bug
+ ' introduced by the test maintainer. However, we warn but the test can
+ ' continue
+ Kontext "DigitalSignature"
+
+ ViewCertificate.click()
+
+ hSelectXMLSecTab( "PATH" )
+
+ qaerrorlog( "Skipping EditBrowseBox: Not implemented in Testtool yet" )
+ goto SkipEditBrowseBox
+
+ kontext "TabXMLSecCertPath"
+ XMLSecViewSigTree.select( 1 )
+ cSigName = XMLSecViewSigTree.getSelText()
+ if ( cSigName <> "Dummy Certificate for Testing" ) then
+ warnlog( "The certificate at pos. 1 is not the dummy certificate: " & cSigName )
+ else
+ printlog( "Found correct certificate name: " & cSigName )
+ endif
+
+ hSelectXMLSecTab( "DETAILS" )
+
+ kontext "TabXMLSecDetails"
+ hGetListItems( XMLSecDetailsListBox, sCertData() )
+
+ brc = hManageComparisionList( sFileIn, sFileOut, sCertData() )
+ if ( not brc ) then
+ warnlog( "The data of the certificate appears to be incorrect" )
+ else
+ printlog( "Verification of the certificate succeeded" )
+ endif
+
+ SkipEditBrowseBox:
+
+ hSelectXMLSecTab( "GENERAL" )
+ kontext "TabXMLSecGeneral"
+
+ TabXMLSecGeneral.ok()
+
+ printlog( "Close the dialog with OK" )
+ Kontext "DigitalSignature"
+ DigitalSignature.OK()
+
+ printlog( "Close the document" )
+ call hCloseDocument()
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/security_evilmacro1.inc b/testautomation/framework/optional/includes/security_evilmacro1.inc
new file mode 100644
index 000000000000..7fb6ad1de02a
--- /dev/null
+++ b/testautomation/framework/optional/includes/security_evilmacro1.inc
@@ -0,0 +1,100 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Load documents containing hidden BASIC scripts
+'*
+'\******************************************************************************
+
+testcase tSecurityEvilMacro1()
+
+
+ dim acFile( 2 ) as string
+
+ acFile( 1 ) = gTesttoolPath & "framework\optional\input\security\test_macro.html"
+ acFile( 1 ) = convertpath( acFile( 1 ) )
+
+ acFile( 2 ) = gTesttoolPath & "framework\optional\input\security\test_macro.odt"
+ acFile( 2 ) = convertpath( acFile( 2 ) )
+
+ dim iCurrentFile as integer ' increment variable
+ dim cMsg as string ' string from messagebox
+ dim brc as boolean ' some returnvalue
+
+
+
+ for iCurrentFile = 1 to ubound( acFile() )
+
+ printlog( "" )
+ printlog( "File: " & acFile( iCurrentFile ) )
+
+ FileOpen
+
+ kontext "OeffnenDlg"
+ Dateiname.setText( acFile( iCurrentFile ) )
+
+ Oeffnen.click()
+
+ brc = hAllowMacroExecution()
+ if ( not brc ) then
+ warnlog( "Macro security dialog not triggered by document with macro" )
+ endif
+
+
+ kontext "Active"
+ if ( active.exists( 5 ) ) then
+
+ ' warn if macro runs without security warning
+ if ( not brc ) then
+ cMsg = active.getText()
+ cMsg = hRemoveLineBreaks( cMsg )
+ if ( cMsg = "Hello from StarBasic" ) then
+ warnlog( "The macro was executed without asking for permission" )
+ else
+ printlog( "Messagebox: " & cMsg )
+ endif
+ endif
+
+ ' get the string on the messagebox
+ cMsg = active.getText()
+ cMsg = hRemoveLineBreaks( cMsg )
+ if ( cMsg = "Hello from StarBasic!" ) then
+ printlog( "Macro was executed: " & cMsg )
+ else
+ warnlog( "Unknown dialog is open. This is not the macro" )
+ endif
+ active.ok()
+ endif
+
+ call ExitRestartTheOffice()
+
+ next iCurrentFile
+
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/security_evilmacro2.inc b/testautomation/framework/optional/includes/security_evilmacro2.inc
new file mode 100644
index 000000000000..00ae5ee0a938
--- /dev/null
+++ b/testautomation/framework/optional/includes/security_evilmacro2.inc
@@ -0,0 +1,89 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Load documents containing hidden BASIC scripts
+'*
+'\******************************************************************************
+
+testcase tSecurityEvilMacro2()
+
+
+ dim acFile( 2 ) as string
+
+ acFile( 1 ) = gTesttoolPath & "framework\optional\input\security\test_macro.html"
+ acFile( 1 ) = convertpath( acFile( 1 ) )
+
+ acFile( 2 ) = gTesttoolPath & "framework\optional\input\security\test_macro.odt"
+ acFile( 2 ) = convertpath( acFile( 2 ) )
+
+ dim iCurrentFile as integer ' increment variable
+ dim cMsg as string ' string from messagebox
+ dim brc as boolean ' some returnvalue
+
+
+
+ for iCurrentFile = 1 to ubound( acFile() )
+
+ printlog( "" )
+ printlog( "File: " & acFile( iCurrentFile ) )
+
+ FileOpen
+
+ kontext "OeffnenDlg"
+ Dateiname.setText( acFile( iCurrentFile ) )
+
+ Oeffnen.click()
+
+ brc = hDenyMacroExecution()
+ if ( not brc ) then
+ warnlog( "Macro security dialog not triggered by document with macro" )
+ endif
+
+ kontext "Active"
+ if ( active.exists( 5 ) ) then
+
+ ' warn if macro runs without security warning
+ warnlog( "A macro was executed without permission" )
+
+ ' get the string on the messagebox
+ cMsg = active.getText()
+ cMsg = hRemoveLineBreaks( cMsg )
+ warnlog( "Macro was executed: " & cMsg )
+ active.ok()
+ else
+ printlog( "Macro has not been executed" )
+ endif
+
+ call ExitRestartTheOffice()
+
+ next iCurrentFile
+
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/security_evilmacro3.inc b/testautomation/framework/optional/includes/security_evilmacro3.inc
new file mode 100644
index 000000000000..1fb86e329088
--- /dev/null
+++ b/testautomation/framework/optional/includes/security_evilmacro3.inc
@@ -0,0 +1,95 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Load documents containing hidden BASIC scripts
+'*
+'\******************************************************************************
+
+testcase tSecurityEvilMacro3()
+
+
+ dim acFile( 2 ) as string
+
+ acFile( 1 ) = gTesttoolPath & "framework\optional\input\security\test_macro.html"
+ acFile( 1 ) = convertpath( acFile( 1 ) )
+
+ acFile( 2 ) = gTesttoolPath & "framework\optional\input\security\test_macro.odt"
+ acFile( 2 ) = convertpath( acFile( 2 ) )
+
+ dim iCurrentFile as integer ' increment variable
+ dim cMsg as string ' string from messagebox
+ dim brc as boolean ' some returnvalue
+
+
+
+ for iCurrentFile = 1 to ubound( acFile() )
+
+ printlog( "" )
+ printlog( "File: " & acFile( iCurrentFile ) )
+
+ FileOpen
+
+ kontext "OeffnenDlg"
+ Dateiname.setText( acFile( iCurrentFile ) )
+
+ Oeffnen.click()
+
+
+ kontext "Active"
+ if ( active.exists() ) then
+ cMsg = active.getText()
+ cMsg = hRemoveLineBreaks( cMsg )
+ printlog( "Messagebox: " & cMsg )
+ active.ok()
+ else
+ warnlog( "Missing messagebox: Document contains macros ..." )
+ endif
+
+ kontext "Active"
+ if ( active.exists( 5 ) ) then
+
+ ' warn if macro runs without security warning
+ warnlog( "A macro was executed without permission" )
+
+ ' get the string on the messagebox
+ cMsg = active.getText()
+ cMsg = hRemoveLineBreaks( cMsg )
+ warnlog( "Macro was executed: " & cMsg )
+ active.ok()
+ else
+ printlog( "Macro was not executed" )
+ endif
+
+ call ExitRestartTheOffice()
+
+ next iCurrentFile
+
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/security_incorrect_password.inc b/testautomation/framework/optional/includes/security_incorrect_password.inc
new file mode 100644
index 000000000000..c3f90cb4fbd0
--- /dev/null
+++ b/testautomation/framework/optional/includes/security_incorrect_password.inc
@@ -0,0 +1,136 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Password protect files
+'*
+'\******************************************************************************
+
+testcase tIncorrectPassword( filetypeID as string )
+
+
+ const WORKFILE = "password"
+ dim suffix as string
+ dim workpath as string
+
+ dim rc as integer
+ dim brc as boolean
+ dim iCurrentFilter as integer
+ dim cCurrentFilter as string
+
+ const PASSWORD_VALID = "MyPasswd09#+1"
+ const PASSWORD_FALSE = "MyPasswd00#+1"
+ const DOC_ID = "f_sec_incorrect_password.bas testdocument"
+
+ workpath = hGetWorkPath()
+
+ suffix = hGetSuffix( filetypeID )
+
+ printlog( "Delete the workfile - if it was left over by a former testrun" )
+ hDeleteFile( workpath & WORKFILE & suffix )
+
+ printlog( "Make sure we have exactly one single document open" )
+ do while( getDocumentCount > 0 )
+ hDestroyDocument()
+ loop
+ hCreateDocument()
+
+ printlog( "Change the document" )
+ hChangeDoc()
+
+ printlog( "Click on FileSave" )
+ FileSave
+
+ Kontext "SpeichernDlg"
+ printlog( "Check the password checkbox" )
+ Passwort.check()
+
+ printlog( "Name the file as " & workpath & WORKFILE )
+ Dateiname.settext( workpath & WORKFILE )
+
+ if ( filetypeID <> "current" ) then
+ for iCurrentFilter = 1 to DateiTyp.getItemCount()
+
+ DateiTyp.select( iCurrentFilter )
+ cCurrentFilter = DateiTyp.getSelText()
+ if ( instr( cCurrentFilter , suffix ) > 0 ) then
+ printlog( "Using custom filter: " & cCurrentFilter )
+ exit for
+ endif
+ next iCurrentFilter
+ else
+ printlog( "Using default filter: " & DateiTyp.getSelText() )
+ endif
+
+ printlog( "Click on the Save-Button" )
+ Speichern.click()
+
+ brc = hSecurityEnterPasswordOnSave( PASSWORD_VALID )
+
+ if ( brc ) then
+
+ kontext "AlienWarning"
+ if ( AlienWarning.exists( 3 ) ) then
+ AlienWarning.ok()
+ if ( filetypeID <> "current" ) then
+ printlog( "Accepted to save in alien format" )
+ else
+ warnlog( "Alien warning not expected for default file format" )
+ endif
+ endif
+
+ printlog( "Close the document" )
+ brc = hDestroyDocument()
+ if ( not brc ) then
+ warnlog( "Something went wrong while closing the document. please check" )
+ endif
+
+ else
+ warnlog( "Something went wrong setting the password for the docuemnt" )
+ endif
+
+ printlog( "Load the file again" )
+ hFileOpen( workpath & WORKFILE & suffix )
+ brc = hSecurityEnterPasswordOnLoad( PASSWORD_FALSE , false )
+ if ( not brc ) then
+ warnlog( "Something went wrong while using the password dialog" )
+ endif
+
+ hDestroyDocument()
+
+ printlog( "Verify that we have no open documents" )
+ if ( getDocumentCount <> 0 ) then
+ warnlog( "No documents should be open at this point" )
+ endif
+
+ printlog( "Delete the workfile" )
+ hDeleteFile( workpath & WORKFILE & suffix )
+
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/security_macrosecurity.inc b/testautomation/framework/optional/includes/security_macrosecurity.inc
new file mode 100644
index 000000000000..b996ff4a2cf8
--- /dev/null
+++ b/testautomation/framework/optional/includes/security_macrosecurity.inc
@@ -0,0 +1,169 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Macros with all security-levels
+'*
+'\******************************************************************************
+
+sub tMacroSecurityLevelsControlModule
+
+ dim iApplication as integer
+
+ for iApplication = 1 to 6
+
+ printlog( "" )
+ printlog( hNumericDocType( iApplication ) )
+ call tMacroSecurityLevels( "current" )
+ call tMacroSecurityLevels( "645" )
+
+ next iApplication
+
+end sub
+
+'*******************************************************************************
+
+testcase tMacroSecurityLevels( cFileFormat )
+
+ printlog( "Check macro execution behavior for all macro security levels" )
+
+ dim cWorkFile as string
+ cWorkFile = gTesttoolPath & "framework\optional\input\BasicDocs\"
+ cWorkFile = cWorkFile & "basic" & hGetSuffix( cFileFormat )
+ cWorkFile = convertpath( cWorkFile )
+ cWorkFile = convertToURL( cWorkFile )
+
+ dim iSecLevel as integer
+ dim brc as boolean
+
+ ' We have quite a bunch of possible combinations here. Some trigger a security warning
+ ' others do not. Depending on the security level we either get no warning at all, the
+ ' "classic" Security Warning or a message that the macros will not be executed (Blocked)
+
+ ' |---------------------------------------------------------|
+ ' | Trusted | Security Level / Warning displayed |
+ ' | Path | Low | Medium | High | Very High |
+ ' |---------------------------------------------------------|
+ ' | Yes*) | No | No | No | No |
+ ' |---------------------------------------------------------|
+ ' | No | No | Yes | Blocked | Blocked |
+ ' |---------------------------------------------------------|
+ ' *) Covered by test "f_sec_trusted_path.bas"
+
+ printlog( "Load a document with macro for each of the four security levels" )
+ for iSecLevel = 0 to 3
+
+ printlog( "Set macro security level to " & iSecLevel )
+ hSetMacroSecurityAPI( iSecLevel )
+
+ printlog( "Load document..." )
+ hFileOpen( cWorkFile )
+
+ printlog( "Check security level dependent behavior" )
+ select case iSecLevel
+ case 0 : brc = hIdentifyExecutedMacro()
+ if ( not brc ) then
+ if ( gApplication = "MATH" ) then
+ qaerrorlog( "#i68291# Math document forgets eventbinding" )
+ else
+ warnlog( "#i53711# Macro was not found/executed" )
+ endif
+ endif
+
+ case 1 : brc = hAllowMacroExecution()
+ if ( not brc ) then
+ warnlog( "Macro execution warning missing, chek the file/security settings" )
+ endif
+ brc = hIdentifyExecutedMacro()
+ if ( not brc ) then
+ if ( gApplication = "MATH" ) then
+ qaerrorlog( "#i68291# Math document forgets eventbinding" )
+ else
+ warnlog( "#i53711# Macro was not found/executed" )
+ endif
+ endif
+
+ case 2 : brc = hHandleActivesOnLoad( 1 , 1 )
+ if ( not brc ) then
+ qaerrorlog( "#i53710# unexpected second messagebox" )
+ endif
+ brc = hIdentifyExecutedMacro()
+ if ( brc ) then
+ warnlog( "Macro was executed" )
+ endif
+
+ case 3 : brc = hHandleActivesOnLoad( 1 , 0 )
+ brc = hIdentifyExecutedMacro()
+ if ( brc ) then
+ warnlog( "Macro was executed" )
+ endif
+ end select
+
+ printlog( "Close document" )
+ brc = hDestroyDocument()
+
+ next iSecLevel
+
+ printlog( "Reset security level to default" )
+ hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT )
+
+endcase
+
+'*******************************************************************************
+
+function hIdentifyExecutedMacro() as boolean
+
+
+ dim cMessage as string
+ const CFN = "hIdentifyExecutedMacro::"
+
+ sleep( 1 )
+
+ kontext "active"
+ if ( active.exists( 3 ) ) then
+
+ cMessage = active.getText()
+
+ if ( cMessage = "TTMacro3" ) then
+ printlog( CFN & "The Macro has been executed" )
+ hIdentifyExecutedMacro() = true
+ active.ok()
+ else
+ warnlog( CFN & "The WRONG macro/dialog is open" )
+ hIdentifyExecutedMacro() = false
+ hHandleActivesOnLoad( 0 , 2 )
+ endif
+
+ else
+
+ printlog( CFN & "No macro/dialog is open" )
+ hIdentifyExecutedMacro() = false
+
+ endif
+
+end function
diff --git a/testautomation/framework/optional/includes/security_recommend_password.inc b/testautomation/framework/optional/includes/security_recommend_password.inc
new file mode 100644
index 000000000000..33811d35a7b7
--- /dev/null
+++ b/testautomation/framework/optional/includes/security_recommend_password.inc
@@ -0,0 +1,123 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Password settings in Tools/Options
+'*
+'\******************************************************************************
+
+testcase tRecommendPassword( filetypeID as string )
+
+
+ dim workfile as string
+ workfile = "password" & hGetSuffix( filetypeID )
+ printlog( " * Name of workfile: " & workfile )
+
+ dim workpath as string
+ workpath = convertpath( gOfficePath & "user\work\" )
+ printlog( " * Save file to....: " & workpath )
+
+ dim rc as integer
+
+ printlog( "Open a new document" )
+ call hNewDocument()
+
+ printlog( "Change the document" )
+ call hChangeDoc()
+
+ printlog( "Open filesave" )
+ FileSave
+ kontext "SpeichernDlg"
+ if ( SpeichernDlg.exists( 2 ) ) then
+ printlog( "File Open dialog is open. Good" )
+ else
+ warnlog( "File Open dialog is not open." )
+ goto endsub
+ endif
+
+ printlog( "Verify that the password-checkbox is enabled" )
+ if ( passwort.isenabled() ) then
+ printlog( " * Password checkbox is enabled. Good." )
+
+ if ( passwort.ischecked() ) then
+ printlog( " * Password checkbox is checked. Good." )
+ rc = 0
+ else
+ warnlog( "Password checkbox is not checked, the option " & _
+ "has not been transported from tools/options " & _
+ "to the dialog -> bug" )
+ rc = 1
+ endif
+ else
+ warnlog( "#i36663# Password checkbox is disabled" )
+ rc = 2
+ endif
+
+ if ( rc = 0 ) then
+
+ if AutomatischeDateinamenserweiterung.Exists then
+ QAErrorLog "OBSOLETE: Check-box Automatic file extension in file dialog will be removed soon!"
+ AutomatischeDateinamenserweiterung.Uncheck
+ endif
+
+
+ printlog( "Name the file" )
+ Dateiname.settext( workpath & workfile )
+
+ printlog( "Uncheck password-protection" )
+ passwort.uncheck()
+
+ printlog( "Save the file" )
+ Speichern.click()
+
+ Kontext "active"
+ if ( active.exists( 2 ) ) then
+ printlog( " - handle overwrite warning (if any)" )
+ active.yes()
+ endif
+
+ Kontext "passwordDlg"
+ if ( passwordDlg.exists( 2 ) ) then
+ warnlog( "Password dialog comes up, this is not expected at this " & _
+ "point. Trying to handle the error gracefully" )
+ Password.settext( workfile )
+ PasswordConfirm.settext( workfile )
+ PasswordDlg.ok()
+ else
+ printlog( " * No password dialog is displayed. Good." )
+ endif
+
+ hDeleteFile( workpath & workfile )
+
+ endif
+
+ printlog( "Close the current document" )
+ call hCloseDocument()
+
+
+endcase
diff --git a/testautomation/framework/optional/includes/security_trusted_path.inc b/testautomation/framework/optional/includes/security_trusted_path.inc
new file mode 100644
index 000000000000..679abdcc9be4
--- /dev/null
+++ b/testautomation/framework/optional/includes/security_trusted_path.inc
@@ -0,0 +1,86 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : Execute macros from trusted path
+'*
+'\******************************************************************************
+
+testcase tSecTrustedPath( cWorkFile as string, iSecLevel as integer )
+
+
+ dim irc as integer
+ dim cMsg as string
+
+ cWorkFile = convertToUrl( convertpath( cWorkFile ) )
+ FileOpen( "URL", cWorkFile, "FrameName", "_default"
+ irc = hFileWait( false )
+
+ ' We have quite a bunch of possible combinations here. Some trigger a security warning
+ ' others do not. Files within a trusted path should never prompt.
+
+ ' |---------------------------------------------------------|
+ ' | Trusted | Security Level / Warning displayed |
+ ' | Path | Low | Medium | High | Very High |
+ ' |---------------------------------------------------------|
+ ' | Yes | No | No | No | No |
+ ' |---------------------------------------------------------|
+ ' | No*) | No | Yes | Blocked | Blocked |
+ ' |---------------------------------------------------------|
+ ' *) Covered by test "f_sec_macrosecurity.bas"
+
+
+ if ( irc = -2 ) then
+ kontext "SecurityWarning"
+ if ( SecurityWarning.exists() ) then
+ warnlog( "Macro Security Warning was not expected at this point" )
+ SecurityWarning.ok()
+ endif
+ endif
+
+ printlog( "Verify that the macro is executed" )
+ kontext "Active"
+ if ( active.exists( 2 ) ) then
+ cMsg = active.getText()
+ cMsg = hRemoveLineBreaks( cMsg )
+ if ( cMsg = "TTMacro3" ) then
+ printlog( "Macro was executed" )
+ else
+ warnlog( "Invalid messagebox is open, please check" )
+ endif
+
+ active.ok()
+
+ endif
+
+ hDestroyDocument()
+
+
+
+endcase
+
diff --git a/testautomation/framework/optional/includes/standardbar2.inc b/testautomation/framework/optional/includes/standardbar2.inc
new file mode 100644
index 000000000000..a4252179b198
--- /dev/null
+++ b/testautomation/framework/optional/includes/standardbar2.inc
@@ -0,0 +1,160 @@
+'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 : joerg.skottke@sun.com
+'*
+'* short description : global update test (Standardbar)
+'*
+'\***************************************************************************
+
+testcase tStandardBar_2
+
+ printlog( "Extended toolbar test for the standardbar" )
+
+ if ( gtSysName = "Solaris x86" ) then
+ qaerrorlog( "#i62423# - New Database crashes office (Evolution)" )
+ goto endsub
+ endif
+
+ dim iCurrentApplication as Integer
+ dim iNewButtonItem as Integer
+ dim iPresentItemCount as integer
+
+ hUseImpressAutopilot( false )
+ hCreateDocument()
+
+ kontext "standardbar"
+ try
+ Neu.openMenu()
+ iPresentItemCount = hMenuItemGetCount()
+ catch
+ warnlog( "Failed to access New-Button, skipping test" )
+ goto endsub
+ endcatch
+
+ if ( iPresentItemCount <> 12 ) then
+ warnlog( "Items missing on New-Button, Expected: 12, Found: " & _
+ iPresentItemCount & " -> Running limited test!" )
+ iPresentItemCount = 8 ' the first eight usually work (no guarantee)
+ endif
+
+ for iCurrentApplication = 1 to 7
+
+ printlog( "" )
+ printlog ( hNumericDoctype( iCurrentApplication ) )
+ hNewDocument()
+
+ for iNewButtonItem = 1 to iPresentItemCount
+
+ ' For some reason Impress needs an extra kick...
+ if ( iCurrentApplication = 3 ) then
+ kontext "documentimpress"
+ DocumentImpress.MouseDoubleClick ( 50, 50 )
+ endif
+
+ printlog( "Click on the " & iNewButtonItem & ". item on the new-button" )
+
+ kontext "standardbar"
+ try
+ Neu.openMenu()
+ sleep( 1 )
+ iPresentItemCount = hMenuItemGetCount()
+ catch
+ warnlog( "Failed to access New-Button, skipping test" )
+ goto endsub
+ endcatch
+
+ sleep( 1 )
+ hMenuselectNr ( iNewButtonItem )
+ sleep( 3 )
+
+ hCloseNavigator()
+
+ select case iNewButtonItem
+ case 1 : Kontext "DocumentWriter"
+ DocumentWriter.TypeKeys( "Hallo" )
+ hDestroyDocument()
+ printlog( "- Writer document" )
+ case 2 : Kontext "DocumentCalc"
+ DocumentCalc.TypeKeys( "Hallo" )
+ hDestroyDocument()
+ printlog( "- Spreadsheet document" )
+ case 3 : Kontext "AutoPilotPraesentation1"
+ Kontext "DocumentImpress"
+ DocumentImpress.MouseDoubleClick ( 50, 50 )
+ hDestroyDocument()
+ printlog( "- Presentation document" )
+ case 4 : Kontext "DocumentDraw"
+ DocumentDraw.MouseDoubleClick ( 50, 50 )
+ hDestroyDocument()
+ printlog( "- Drawing document" )
+ case 5 : Kontext "DatabaseWizard"
+ CancelBtn.click()
+ printlog( "- Database wizard" )
+ case 6 : Kontext "DocumentWriter" ' HTML Document
+ DocumentWriter.TypeKeys( "Hallo" )
+ hDestroyDocument()
+ printlog( "- HTML document" )
+ case 7 : Kontext "DocumentWriter" ' XML Form
+ DocumentWriter.TypeKeys( "Hallo" )
+ hDestroyDocument()
+ printlog( "- XML Form" )
+ case 8 : Kontext "DocumentWriter" ' Master Document
+ DocumentWriter.TypeKeys( "Hallo" )
+ hDestroyDocument()
+ printlog( "- Master document" )
+ case 9 : SchreibenInMathdok "a over b"
+ hDestroyDocument()
+ printlog( "- Formula document" )
+ case 10 : Kontext
+ Active.SetPage( TabEtiketten )
+ kontext "tabetiketten"
+ TabEtiketten.Cancel()
+ printlog( "- Labels (Labels dialog)" )
+ case 11 : Kontext
+ Active.SetPage( TabEtikettenMedium )
+ kontext "tabetikettenmedium"
+ TabEtikettenMedium.Cancel()
+ printlog( "- Business cards (Labels dialog)" )
+ case 12 : Kontext "TemplateAndDocuments"
+ TemplateAndDocuments.cancel()
+ printlog( "- Template dialog" )
+ end select
+
+ sleep( 2 )
+
+ next iNewButtonItem
+
+ hCloseDocument()
+
+ next iCurrentApplication
+
+ hDestroyDocument()
+
+endcase
+
+
diff --git a/testautomation/framework/optional/includes/toolbar_behavior.inc b/testautomation/framework/optional/includes/toolbar_behavior.inc
new file mode 100644
index 000000000000..5f7357df7e31
--- /dev/null
+++ b/testautomation/framework/optional/includes/toolbar_behavior.inc
@@ -0,0 +1,152 @@
+'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 : Resource test of toolbar behavior
+'*
+'\************************************************************************
+
+testcase tToolbarBehavior
+ hNewDocument()
+ sleep (5)
+ 'ViewToolbarsReset
+ hUseMenu()
+ printlog hMenuSelectNr(3)
+ printlog hMenuSelectNr(3)
+ printlog hMenuSelectNr(-1)
+ kontext
+ if active.exists(5) then
+ active.setPage TabCustomizeMenu
+ if TabCustomizeMenu.exists(5) then
+ printlog "All Tooolbars are available."
+ TabCustomizeMenu.cancel
+ else
+ printlog "Resetet Toolbars."
+ endif
+ else
+ printlog "Toolbars resetet"
+ endif
+ kontext "TableObjectBar"
+ if TableObjectBar.exists(5) then
+ warnlog "Toolbar is already available?"
+ else
+ printlog "Toolbar is not available"
+ endif
+ InsertTableWriter
+ kontext "TabelleEinfuegenWriter"
+ if TabelleEinfuegenWriter.exists (5) then
+ TabelleEinfuegenWriter.ok
+ sleep (2)
+ else
+ warnlog "no table"
+ endif
+ kontext "TableObjectBar"
+ if TableObjectBar.exists(5) then
+ printlog "Toolbar is available."
+ else
+ warnlog "Toolbar is not available"
+ endif
+
+ if NOT TableObjectBar.isDocked then
+ TableObjectBar.dock
+ printlog "Toolbar got docked, to use thier kontext menu"
+ endif
+ TableObjectBar.openContextMenu
+ printlog hMenuSelectNr(-1)
+ kontext "TableObjectBar"
+ if TableObjectBar.exists(5) then
+ warnlog "Toolbar is still available"
+ else
+ printlog "Toolbar is not available"
+ endif
+ hTypeKeys("<mod1 end><mod1 end>")
+ kontext "TableObjectBar"
+ if TableObjectBar.exists(5) then
+ warnlog "Toolbar is still available"
+ else
+ printlog "Toolbar is not available"
+ endif
+ hTypeKeys("<mod1 home>")
+ kontext "TableObjectBar"
+ if TableObjectBar.exists(5) then
+ printlog "Toolbar is available."
+ else
+ warnlog "Toolbar is not available"
+ endif
+
+ Call hToolbarSelect ( "Table", false )
+ kontext "TableObjectBar"
+ if TableObjectBar.exists(5) then
+ warnlog "Toolbar is still available"
+ else
+ printlog "Toolbar is not available"
+ endif
+
+ hTypeKeys("<mod1 end><mod1 end>")
+ kontext "TableObjectBar"
+ if TableObjectBar.exists(5) then
+ warnlog "Toolbar is available again"
+ else
+ printlog "Toolbar is not available"
+ endif
+
+ hTypeKeys("<mod1 home>")
+ kontext "TableObjectBar"
+ if TableObjectBar.exists(5) then
+ warnlog "Toolbar is available again"
+ else
+ printlog "Toolbar is not available"
+ endif
+
+ 'ViewToolbarsReset
+ hUseMenu()
+ printlog hMenuSelectNr(3)
+ printlog hMenuSelectNr(3)
+ printlog hMenuSelectNr(-1)
+ kontext
+ if active.exists(5) then
+ active.setPage TabCustomizeMenu
+ if TabCustomizeMenu.exists(5) then
+ warnlog "Can't reset toolbars"
+ TabCustomizeMenu.cancel
+ else
+ printlog "Resetet Toolbars."
+ endif
+ else
+ printlog "Toolbars resetet"
+ endif
+ kontext "TableObjectBar"
+ if TableObjectBar.exists(5) then
+ printlog "Toolbar is available."
+ else
+ warnlog "Toolbar is not available"
+ endif
+
+ hCloseDocument()
+endcase
+
diff --git a/testautomation/framework/optional/includes/w_grid_layout1.inc b/testautomation/framework/optional/includes/w_grid_layout1.inc
new file mode 100644
index 000000000000..737cf850ad65
--- /dev/null
+++ b/testautomation/framework/optional/includes/w_grid_layout1.inc
@@ -0,0 +1,576 @@
+'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 : Grid Layout for CJK test in Writer
+'*
+'\***********************************************************************
+
+private const SOURCE_PATH = "framework\optional\input\CJK\"
+
+testcase tTextGridDialog_1
+
+ '/// Check if tabpage 'Text Grid' disappears when "Asian Language support" is NOT checked
+ if iSystemSprache <> 81 AND iSystemSprache <> 82 AND iSystemSprache <> 86 AND iSystemSprache <> 88 then
+ Call CheckAsianLanguageSupport("Off")
+ hNewDocument()
+ FormatPageWriter
+ try
+ Kontext
+ Active.SetPage TabGrid
+ Kontext "TabGrid"
+ TabGrid.Cancel
+ warnlog "Shouldn't get Tabpage: Grid Text"
+ catch
+ Kontext
+ Active.SetPage TabSeite
+ Kontext "TabSeite"
+ TabSeite.Cancel
+ endcatch
+ endif
+
+ '/// Check if tabpage 'Text Grid' appears when "Asian Language support" is checked
+ Call CheckAsianLanguageSupport("On")
+
+ sleep 5
+ FormatPageWriter
+ Kontext
+ if Active.exists (10) then
+ try
+ Kontext
+ Active.SetPage TabGrid
+ Kontext "TabGrid"
+ TabGrid.Cancel
+ catch
+ Kontext
+ Active.SetPage TabSeite
+ Kontext "TabSeite"
+ TabSeite.Cancel
+ warnlog "Couldn't get Tabpage: Grid Text"
+ endcatch
+ else
+ warnlog "FormatPageWriter didn't bring up ndialog"
+ endif
+ hCloseDocument()
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tTextGridDialog_2
+ '/// No grid is active, no changes to existing version
+ Dim testFile , sCorrectResult as String
+
+ testFile = "gridtest.sxw"
+ sCorrectResult = "1"
+
+ Call hNewDocument
+
+ '/// open a test file , and check No Grid checkbox
+ Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
+ sMakeReadOnlyDocumentEditable
+
+ FormatPageWriter
+ Kontext
+ if active.exists(5) then
+ Active.SetPage TabGrid
+ endif
+ Kontext "TabGrid"
+ NoGrid.Check
+ Sleep 1
+ TabGrid.OK
+ Sleep 1
+
+ '/// Active navigator dialogue , set page to '2' and wait for a while
+ Kontext
+ ViewNavigator
+ Kontext "NavigatorWriter"
+
+ Seitennummer.SetText "2"
+ Sleep 5
+ hCloseNavigator
+
+ '/// In No Grid mode, there should be only 1 page, the focus is before the first line
+ Kontext "DocumentWriter"
+ Call DocumentWriter.TypeKeys "<End>"
+ Sleep 1
+ Call DocumentWriter.TypeKeys "<Shift Left>"
+ hUseAsyncSlot( "EditCopy" )
+
+ if GetClipboardText <> sCorrectResult then Warnlog "Something wrong when choosing NoGrid option!"
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tTextGridDialog_3
+ '/// Grid (lines only): The page is set up with a defined number of lines
+ Dim testFile , sCorrectResult , sLinesPerPage as String
+
+ testFile = "gridtest.sxw"
+ sCorrectResult = "G"
+ sLinesPerPage = "10"
+
+ Call hNewDocument
+
+ '/// open a test file and check Grid(lines onle) checkbox ,
+ '/// + set 10 line/page
+ Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
+ sMakeReadOnlyDocumentEditable
+ FormatPageWriter
+ Kontext
+ if active.exists(5) then
+ Active.SetPage TabGrid
+ endif
+ Kontext "TabGrid"
+ LinesGrid.Check
+ LinesPerPage.SetText sLinesPerPage
+ Sleep 1
+ TabGrid.OK
+ Sleep 1
+
+ '/// Active navigator dialogue , set page to '2' and wait for a while
+ Kontext
+ ViewNavigator
+ Kontext "NavigatorWriter"
+
+ Seitennummer.SetText "2"
+ Sleep 5
+ hCloseNavigator
+
+ Kontext "DocumentWriter"
+ Call DocumentWriter.TypeKeys "<End>"
+ Sleep 1
+ Call DocumentWriter.TypeKeys "<Shift Left>"
+ hUseAsyncSlot( "EditCopy" )
+
+ if GetClipboardText <> sCorrectResult then Warnlog "Something wrong when choosing Grid(lines only) option!"
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tTextGridDialog_4
+ '/// Grid (lines and characters): The page is set up with a defined number of lines and a defined number of characters in each line
+ Dim testFile , sCorrectResult as String
+ Dim sLinesPerPage , sCharsPerLine as String
+
+ testFile = "gridtest.sxw"
+ sCorrectResult = "E"
+ sLinesPerPage = "10"
+ sCharsPerLine = "9"
+
+ Call hNewDocument
+
+ '/// open a test file and check Grid(lines and characters) checkbox
+ '/// + set 10 line/page and 9 characters/line
+ Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
+ sMakeReadOnlyDocumentEditable
+ FormatPageWriter
+ Kontext
+ if active.exists(5) then
+ Active.SetPage TabGrid
+ endif
+ Kontext "TabGrid"
+ CharsGrid.Check
+ LinesPerPage.SetText sLinesPerPage
+ CharsPerLine.SetText sCharsPerLine
+ Sleep 1
+ TabGrid.OK
+ Sleep 1
+
+ '/// Active navigator dialogue , set page to '2' and wait for a while
+ Kontext
+ ViewNavigator
+ Kontext "NavigatorWriter"
+
+ Seitennummer.SetText "2"
+ Sleep 5
+ hCloseNavigator
+
+ Kontext "DocumentWriter"
+ Call DocumentWriter.TypeKeys "<End>"
+ Sleep 1
+ Call DocumentWriter.TypeKeys "<Shift Left>"
+ hUseAsyncSlot( "EditCopy" )
+
+ if GetClipboardText <> sCorrectResult then Warnlog "Something wrong when choosing Grid(lines and characters) option!"
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tGridDisplay_1
+ '/// Print grid: The grid lines will be printed. Inactive if "Display grid" is inactive.
+ Call hNewDocument
+
+ '/// format / page / tabpage Text grid
+ '/// + check "display grid" and check "print grid"
+ FormatPageWriter
+ Kontext
+ if active.exists(5) then
+ Active.SetPage TabGrid
+ endif
+ Kontext "TabGrid"
+ CharsGrid.Check
+ Display.Check
+ Sleep 1
+ PrintGrid.Check
+ Sleep 1
+ TabGrid.OK
+ Sleep 1
+
+ '/// Print to printer
+ FilePrint
+ Kontext "Active"
+ if ( Active.Exists( 5 ) ) then
+ if Active.GetRT() = 304 then
+ Active.Ok()
+ QAErrorLog "No Default-Printer!"
+ Kontext "Printing"
+ if ( Printing.exists( 1 )) then
+ Printing.Cancel
+ endif
+ endif
+ else
+ Kontext "Printing"
+ if ( Printing.exists( 2 )) then
+ printing.cancel()
+ Printing.notExists( 5 )
+ endif
+
+ kontext "Active"
+ if active.exists(5) then
+ qaErrorLog active.getText()
+ active.ok()
+ endif
+ endif
+
+ '/// format / page / tabpage Text grid
+ '/// + check "display grid" and uncheck "print grid"
+ FormatPageWriter
+ Kontext
+ if active.exists(5) then
+ Active.SetPage TabGrid
+ endif
+ Kontext "TabGrid"
+ CharsGrid.Check
+ Display.Check
+ Sleep 1
+ PrintGrid.UnCheck
+ Sleep 1
+ TabGrid.OK
+ Sleep 1
+
+ '/// Print to printer
+ FilePrint
+ Kontext "Active"
+ if ( Active.Exists( 5 ) )then
+ if Active.GetRT() = 304 then
+ Active.Ok()
+ QAErrorLog "No Default-Printer!"
+ Kontext "Printing"
+ if ( Printing.exists( 1 )) then
+ Printing.Cancel()
+ endif
+ endif
+ else
+ Kontext "Printing"
+ if( Printing.exists( 1 )) then
+ printing.cancel()
+ Printing.notExists( 5 )
+ endif
+ kontext
+ if ( active.exists( 2 ) ) then
+ qaErrorLog active.getText
+ active.ok
+ endif
+ endif
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tUserDefineLayout_1
+ '/// Decrease characters per line will cause lines per page decrease accordingly
+ Dim sLinesPerPage , sCharsPerLine as String
+ Dim sExpectLinesPerPage , sExpectLinesPerPage1 as String
+
+ sLinesPerPage = "20"
+ sCharsPerLine = "2"
+ sExpectLinesPerPage = "2"
+ sExpectLinesPerPage1 = "3"
+
+ Call hNewDocument
+
+ '/// Format/page , set lines per page to 20, and set charsets per line to 2
+ '/// + wait for a moment , then check the the number of lines per page.
+ FormatPageWriter
+ Kontext
+ if active.exists(5) then
+ Active.SetPage TabGrid
+ endif
+ Kontext "TabGrid"
+ CharsGrid.Check
+
+ LinesPerPage.SetText sLinesPerPage
+ Sleep 2
+ CharsPerLine.SetText sCharsPerLine
+ Sleep 2
+
+ 'This step is no use, just let the LinesPerPage change the number
+ CharsGrid.Check
+
+ if LinesPerPage.GetText <> sExpectLinesPerPage AND LinesPerPage.GetText <> sExpectLinesPerPage1 then
+ Warnlog( "#i106381# - LInes per page changed" )
+ printlog( "The lines per page should be" + sExpectLinesPerPage & " OR " & sExpectLinesPerPage1 & " but get " &LinesPerPage.GetText )
+ endif
+
+ TabGrid.Cancel
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tFontSizeChanges_1
+
+ '/// Change the font size to bigger enough will change the layout
+ Dim testFile , sCorrectResult as String
+ Dim sLinesPerPage , sCharsPerLine as String
+ dim sTemp as string
+
+ testFile = "FontSizeChanges_1.sxw"
+ sCorrectResult = "1"
+ sLinesPerPage = "2"
+ sCharsPerLine = "9"
+
+ Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
+ sMakeReadOnlyDocumentEditable
+ Kontext "DocumentWriter"
+ Call DocumentWriter.TypeKeys "<Shift Right>"
+
+ Kontext "FormatObjectbar"
+ Schriftgroesse.Select "60"
+ Schriftgroesse.TypeKeys "<Return>"
+ Sleep 1
+
+ Kontext "DocumentWriter"
+ FormatPageWriter
+ Kontext
+ if active.exists(5) then
+ Active.SetPage TabGrid
+ endif
+ Kontext "TabGrid"
+ if TabGrid.exists(5) then
+ sTemp = LinesPerPage.GetText
+ if sTemp <> sLinesPerPage then
+ Warnlog "The lines per page should be: '" & sLinesPerPage & "'; but get: '" & sTemp & "'"
+ endif
+ sTemp = CharsPerLine.GetText
+ if sTemp <> sCharsPerLine then
+ Warnlog "The chars per line should be: '" & sCharsPerLine & "'; but get: '" &sTemp & "'"
+ endif
+ TabGrid.Cancel
+ else
+ warnlog "TabGrid is not available."
+ endif
+
+ Kontext
+ ViewNavigator
+ Kontext "NavigatorWriter"
+ if NavigatorWriter.exists(5) then
+ Seitennummer.SetText "2"
+ Sleep 5
+ else
+ warnlog "Navigator not available"
+ endif
+ hCloseNavigator
+
+ Kontext "DocumentWriter"
+ sleep 3
+ Call DocumentWriter.TypeKeys "<Shift Right>"
+
+ hUseAsyncSlot( "EditCopy" )
+ sTemp = GetClipboardText
+ if sTemp <> sCorrectResult then
+ Warnlog "Don't get the expected result , hope to be: '" & sCorrectResult & "'; but get: '" & sTemp & "'"
+ endif
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tRubyText_1
+ '/// If Ruby Text is applied and longer than its Base Text it will stretch over more grid cells than the base text itself.
+ Dim testFile , sRubyText as String
+
+ testFile = "rubytest.sxw"
+ sRubyText = "Ruby Test Text ....................."
+
+ Call hNewDocument
+
+ '/// open a test file , and insert long ruby test text
+ Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
+ sMakeReadOnlyDocumentEditable
+ Kontext "DocumentWriter"
+ Call DocumentWriter.TypeKeys "<Shift Right>"
+ Sleep 1
+
+ FormatRuby
+ Kontext "RubyDialog"
+ Sleep 3
+ RubyText1.setText sRubyText
+ Sleep 2
+ RubyDialog.OK
+ Sleep 2
+ DialogClose.Click
+ Sleep 1
+
+ Kontext "DocumentWriter"
+ FormatAutoformatApply
+ Sleep 2
+ Call DocumentWriter.TypeKeys "<End>"
+ Sleep 2
+ Call DocumentWriter.TypeKeys "<Shift Left>"
+ hUseAsyncSlot( "EditCopy" )
+
+ if NOT(GetClipboardText = "5" OR GetClipboardText = "6") then
+ Warnlog "Don't get the correct result after inserting ruby text! Get " & GetClipboardText
+ endif
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tIndentsTest_1
+ '/// Indents should work and always indenting as close as possible to their measurements by snapping to the appropriate grid cell. Tabs therefore will be ignored.
+ Dim testFile , sCorrectPage1 , sCorrectPage2 as String
+
+ testFile = "IndentsTest.sxw"
+ sCorrectPage1 = "1"
+ sCorrectPage2 = "2"
+
+ Call hNewDocument
+
+ '/// open a test file , and press TAB in second line
+ Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
+ sMakeReadOnlyDocumentEditable
+ Kontext "DocumentWriter"
+ Call DocumentWriter.TypeKeys "<Down>"
+ Sleep 1
+ Call DocumentWriter.TypeKeys "<Tab>"
+ Sleep 1
+ Call DocumentWriter.TypeKeys "<End>"
+ Sleep 1
+
+ '/// Active navigator dialogue , check if the page number is 1
+ Kontext
+ ViewNavigator
+ Kontext "NavigatorWriter"
+ if Seitennummer.GetText <> sCorrectPage1 then Warnlog "First test :Something wrong in indents test!"
+ hCloseNavigator
+
+ '/// press TAB in second line again
+ Kontext "DocumentWriter"
+ Call DocumentWriter.TypeKeys "<Home>"
+ Sleep 1
+ Call DocumentWriter.TypeKeys "<Tab>"
+ Sleep 1
+ Call DocumentWriter.TypeKeys "<End>"
+ Sleep 1
+
+ '/// Active navigator dialogue , check if the page number is 2
+ Kontext
+ ViewNavigator
+ Kontext "NavigatorWriter"
+ if Seitennummer.GetText <> sCorrectPage2 then Warnlog "Second test :Something wrong in indents test!"
+ hCloseNavigator
+
+ Call hCloseDocument
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tObjectsTest_1
+ '/// If objects are anchored to text they will "wander" with its surrounding text.
+ '/// If they are anchored as character they will snap to the appropriate grid cell (since they are a character).
+ Dim testFile , sCorrectPage1 , sCorrectPage2 as String
+
+ testFile = "objectsTest.sxw"
+ sCorrectPage1 = "1"
+ sCorrectPage2 = "2"
+
+ Call hNewDocument
+
+ '/// open a test file , and press TAB in second line
+ Call hFileOpen ( gTesttoolPath + SOURCE_PATH + testFile )
+
+ '/// If object is anchored as Character , check if it will snap to the appropriate grid cell
+ fStartupNavigator( "OLEObject" , 1 )
+ Sleep 1
+ Auswahlliste.TypeKeys "<Return>"
+ Sleep 1
+ hCloseNavigator
+
+ Kontext
+ FormatAnchorAsCharacter
+ WaitSlot()
+
+
+ ViewNavigator
+ Kontext "NavigatorWriter"
+ Seitennummer.SetText sCorrectPage2
+ Sleep 5
+ if Seitennummer.GetText <> sCorrectPage2 then Warnlog "Something wrong when object is anchored as Character!"
+ hCloseNavigator
+
+ '/// If object is anchored to Character , check if it will NOT snap to the appropriate grid cell
+ fStartupNavigator( "OLEObject" , 1 )
+ Auswahlliste.TypeKeys "<Return>"
+ hCloseNavigator
+
+ Kontext
+ FormatAnchorToCharacter
+
+ ViewNavigator
+ Kontext "NavigatorWriter"
+ Seitennummer.SetText sCorrectPage2
+ Sleep 5
+ if Seitennummer.GetText <> sCorrectPage1 then Warnlog "Something wrong when object is anchored to Character!"
+ hCloseNavigator
+ Kontext
+
+ Call hCloseDocument
+endcase
+