1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: g_clipexport3.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 10:42:39 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* Owner : wolfram.garten@sun.com
36 '* short description : Procedures for the Clipboard-Export-Test
38 '*******************************************************************
40 ' #1 Get_Position_Size_Attributes :Getting values from the position and size dialog
41 ' #1 Get_Colour_Attributes :Geting Attributes from Area Dialog
42 ' #1 Check_Position_Size_Attributes :Pasting object and comparing attributes with the stored values
43 ' #1 Check_Text_Formatting :Checking text formatting of pasted object
44 ' #1 Check_Colors_Borders_Attributes :
45 ' #1 SetKontextApplication :-
50 ' #1 Choose_Toapplication :-
53 '\*******************************************************************
55 Sub Get_Position_Size_Attributes
57 Printlog " Get_Position_Size_Attributes Starts"
64 Select Case gApplication
65 Case "WRITER" : active.SetPage TabPositionAndSizeWriter
66 Kontext "TabPositionAndSizeWriter"
67 Case else : active.SetPage TabPositionAndSize
68 Kontext "TabPositionAndSize"
72 ' /// Size-values ///'
73 PositionWidth = Width.GetText
74 PositionHeight = Height.GetText
76 if KeepRatio.IsChecked then SetText.PositionKeepRatio = "TRUE"
77 if ProtectPosition.IsChecked then SetText.PositionProtectPosition = "TRUE"
78 if ProtectSize.IsChecked then SetText.PositionProtectSize = "TRUE"
82 Select Case gApplication
83 Case "WRITER" : active.SetPage TabPositionAndSizeWriter
84 Kontext "TabPositionAndSizeWriter"
85 TabPositionAndSizeWriter.OK
86 Case else : active.SetPage TabPositionAndSize
87 Kontext "TabPositionAndSize"
93 Printlog " Get_Position_Size_Attributes Ends"
97 '-------------------------------------------------------------------------------
98 sub Get_Colour_Attributes
100 printlog " Get_Colour_Attributes Starts"
105 Active.setpage TabArea
111 if FillOptions.GetSelIndex <> 2 then Errorlog "Couldnt click on 'Color' in FormatArea"
112 AreaColourListValue = ColourList.GetSelText
113 printlog "AreaColourListValue = " + AreaColourListValue
117 if FillOptions.GetSelIndex <> 3 then Errorlog "Couldnt click on .Gradient. in FormatArea"
119 AreaGradientListValue = GradientList.GetSelText 'AreaGradientValue = "TRUE"
120 If Automatic.IsVisible then
121 If Automatic.IsChecked then AreaAutomaticValue = "TRUE"
123 If Increments.IsVisible then
124 AreaIncrementsValue = Increments.GetText
129 if FillOptions.GetSelIndex <> 4 then Errorlog "Couldnt click on 'Hatching' in FormatArea"
131 AreaHatchingListValue = HatchingList.GetSelText 'Then = "TRUE" ' lista
132 If BackgroundColour.IsVisible then
133 If BackgroundColour.IsChecked then
134 AreaBackgroundColourValue = BackgroundColour.GetText
137 If BackgroundColourList.IsVisible then
138 AreaBackgroundColourListValue = BackgroundColourList.GetSelText
142 if FillOptions.GetSelIndex <> 5 then Errorlog "Couldnt click on 'Hatching' in FormatArea"
144 AreaBitmapListValue = BitmapList.GetSelText
146 If Original.IsChecked then
147 AreaOriginalListValue = "TRUE"
149 If Relative.IsChecked then
150 AreaRelativeValue = "TRUE"
151 AreaWidthValue = Width.GetText
152 AreaHeightValue = Height.GetText
154 AreaWidthValue = Width.GetText
155 AreaHeightValue = Height.GetText
159 If Tile.IsChecked then AreaTileValue = "TRUE"
160 If Stretch.IsChecked then AreaStretchValue = "TRUE"
161 If Row.IsChecked then
162 AreaRowValue = "TRUE"
163 AreaOffsetValue = Offset.GetText
165 If Column.IsChecked then
166 AreaColumnValue = "TRUE"
167 AreaOffsetValue = Offset.GetText
175 Active.setpage TabSchatten
176 Kontext "TabSchatten"
178 If Anzeigen.IsChecked then
179 ShadowUseShadowsValue = "TRUE"
180 ShadowDistanceValue = Entfernung.GetText
181 ShadowColorValue = Farbe.GetText
182 ShadowTransparencyValue = Transparenz.GetText
189 Active.SetPage TabTransparenz
190 Kontext "TabTransparenz"
191 if KeineTransparenz.IsEnabled = FALSE then
192 warnlog " Couldnt check 'No transparency' in Area - Transparency'"
194 KeineTransparenz.Check
197 If KeineTransparenz.IsChecked then LineareTransparenz.Check
198 If LineareTransparenz.IsChecked then
199 TransparencyTransparencyValue = MFLinTransparenz.GetText
203 Transparenzverlauf.Check
204 If Transparenzverlauf.IsChecked then
205 TransparencyGradientType = TransparenzverlaufTyp.GetItemText
206 TransparencyMFZentrumX = MFZentrumX.GetText
207 TransparencyMFZentrumY = MFZentrumY.GetText
208 TransparencyMFWinkel = MFWinkel.GetText
209 TransparencyMFRand = MFRand.GetText
210 TransparencyMFStartwert = MFStartwert.GetText
211 TransparencyMFEndwert = MFEndwert.GetText
218 Active.setpage TabFarben
221 ColorName = FarbName.GetText
222 ColorColor = Farbe.GetItemText
223 ColorModel = Farbmodell.GetSelText
224 printlog " The colormodel is: " + ColorModel
226 if ColorModel = "RGB" then
230 elseif ColorModel = "RVB" then
242 Active.setpage TabFarbverlaeufe
243 Kontext "TabFarbverlaeufe"
245 GradientsType = Typ.GetItemText
246 GradientsCenterX = ZentrumX.GetText
247 GradientsCenterZ = ZentrumY.GetText
248 GradientsAngle = Winkel.GetText
249 GradientsBorder = Rand.GetText
250 GradientsFromColor = Von.GetItemText
251 GradientsFromValue = VonWert.GetText
252 GradientsToColor = Bis.GetItemText
253 GradientsToValue = BisWert.GetText
257 Active.setpage TabSchraffuren
258 Kontext "TabSchraffuren"
260 HatchingDistance = Abstand.GetText
261 HatchingAngle = Winkel.GetText
263 HatchingLineType = Linientyp.GetSelText
264 HatchingLineColor = Linienfarbe.GetSelText
265 HatchingLineTable = Tabelle.GetItemText
269 Active.setpage TabBitmap
272 BitmapForeground = Vordergrund.GetSelText
273 BitmapBackground = Hintergrund.GetSelText
274 BitmapTable = Tabelle.GetSelText
277 Active.setpage TabArea
280 printlog " Get_Colour_Attributes ends"
284 '-------------------------------------------------------------------------------
285 sub Check_Position_Size_Attributes
287 printlog " Check_Position_Size_Attributes Starts"
293 FormatPositionAndSize
296 if gApplication = "WRITER" then
297 Kontext "TabPositionAndSizeWriter"
299 active.SetPage TabPositionAndSizeWriter
301 active.SetPage TabPositionAndSizeWriter
302 Kontext "TabPositionAndSizeWriter"
306 If LiberalMeasurement(PositionWidth, Width.GetText) <> TRUE then QaErrorLog "PositionWidth is: " + Width.GetText + " should be: '" + PositionWidth + "'. Possibly caused by i71631."
307 If LiberalMeasurement(PositionHeight, Height.GetText) <> TRUE then QaErrorLog "PositionHeight is: " + Height.GetText + " should be: '" + PositionHeight + "'. Possibly caused by i71631."
309 If PositionKeepRatio = "TRUE" then
310 If KeepRatio.IsChecked = "FALSE" then Warnlog "KeepRatio isnt checked"
313 If PositionProtectPosition = "TRUE" then
314 If ProtectPosition.IsChecked = "FALSE" then Warnlog "ProtectPosition isnt checked"
317 If PositionProtectSize = "TRUE" then
318 If ProtectSize.IsChecked = "FALSE" then Warnlog "ProtectPosition isnt checked"
322 Kontext "TabPositionAndSizeWriter"
324 Active.setpage TabPositionAndSizeWriter
325 Kontext "TabPositionAndSizeWriter"
327 TabPositionAndSizeWriter.OK
331 active.SetPage TabPositionAndSize
332 Kontext "TabPositionAndSize"
336 If LiberalMeasurement(PositionWidth, Width.GetText) <> TRUE then QaErrorLog "PositionWidth is: " + Width.GetText + " should be: " + PositionWidth + "'. Possibly caused by i71631."
337 If LiberalMeasurement(PositionHeight, Height.GetText) <> TRUE then QaErrorLog "PositionHeight is: " + Height.GetText + " should be: " + PositionHeight + "'. Possibly caused by i71631."
339 If PositionKeepRatio = "TRUE" then
340 If KeepRatio.IsChecked = "FALSE" then Warnlog "KeepRatio isnt checked"
343 If PositionProtectPosition = "TRUE" then
344 If ProtectPosition.IsChecked = "FALSE" then Warnlog "ProtectPosition isnt checked"
347 If PositionProtectSize = "TRUE" then
348 If ProtectSize.IsChecked = "FALSE" then Warnlog "ProtectPosition isnt checked"
352 Kontext "TabPositionAndSize"
354 Active.setpage TabPositionAndSize
355 Kontext "TabPositionAndSize"
357 TabPositionAndSize.OK
360 SetKontextApplication
362 printlog " Check_Position_Size_Attributes Ends"
366 '----------------------------------------------------------------------------------------------------
367 sub Check_Text_Formatting
369 printlog " Check_Text_Formatting Starts"
374 select case (gApplication)
375 case "DRAW" : hTypeKeys "<RETURN>"
376 hTypeKeys "<SHIFT HOME>" 'Mark the whole text'
377 case "IMPRESS" : hTypeKeys "<RETURN>"
378 hTypeKeys "<SHIFT HOME>" 'Mark the whole text'
379 case "WRITER" : EditSelectAll 'Since there is currently only (should only be) one object (the text) in the document.
380 case "CALC" : hTypeKeys "<MOD1 HOME>"
381 ' hTypeKeys "<SHIFT HOME>" 'Mark the whole text'
382 case else : warnlog " the test has not been configured for this application ( '" + gApplication + "' ). Please notify testwriter."
386 Kontext "TextObjectbar"
387 if TextObjectbar.Exists = FALSE then
388 ViewToolbarsTextFormatting
391 Printlog " - Check if the Fontname is still the same."
392 if Schriftart.GetSelText <> Text1 then warnlog " Fontname should be: " + Text1 + " but was: " + Schriftart.GetSelText
394 Printlog " - Check if the Text still has the same Size."
395 if Schriftgroesse.GetSelText <> Text2 then warnlog " Fontsize should be: " + Text2 + " but was: " + Schriftgroesse.GetSelText
397 Kontext "TextObjectbar"
398 Printlog " - Check if the Font-attribute is set to Bold."
399 if Fett.GetState(2) <> Text4 then warnlog " Bold should be: " + Text4 + " but was: " + Fett.GetState(2)
401 Kontext "TextObjectbar"
402 Printlog " - Font attribute cursive"
403 if Kursiv.GetState(2) <> Text5 then warnlog " Italic should be: " + Text5 + " but was: " + Kursiv.GetState(2)
405 Kontext "TextObjectbar"
406 Printlog " - Check if the Font-attribute is set to Underlined"
408 if Unterstrichen.GetState(2) <> Text6 then warnlog " Underline should be: " + Text6 + " but was: " + Unterstrichen.GetState(2)
410 Kontext "TextObjectbar"
411 if (gApplication) = "CALC" then
412 kontext "FormatObjectBar"
413 Printlog " - Check if the Font-attribute is set to Justified"
414 if Block.GetState(2) <> Text7 then warnlog " Justified should be: " + Text7 + " but was: " + Blocksatz.GetState(2)
416 if Blocksatz.GetState(2) <> Text7 then warnlog " Justified should be: " + Text7 + " but was: " + Blocksatz.GetState(2)
418 SetKontextApplication
419 printlog " Check_Text_Formatting Ends"
422 '----------------------------------------------------------------------------------------------------
423 sub Check_Colors_Borders_Attributes
425 printlog " Check_Colors_Borders_Attributes Starts"
431 Active.setpage TabArea
436 if FillOptions.GetSelIndex <> 2 then Errorlog "Couldnt click on 'Color' in FormatArea"
438 If AreaColourListValue <> ColourList.GetSelText then
439 WarnLog " Area ColourList doesn't have the right Colour selected."
440 printlog " AreaColourListValue = " + AreaColourListValue + " should be = " + ColourList.GetSelText
446 if FillOptions.GetSelIndex <> 3 then Errorlog "Couldnt click on 'Gradient.' in FormatArea"
448 If AreaGradientListValue <> GradientList.GetSelText then WarnLog "Area GradientList has changed it's value."
449 If Automatic.IsVisible then
450 If AreaAutomaticValue = "TRUE" then
451 If Automatic.IsChecked then
452 Printlog " Area Automatic Value is correct"
454 WarnLog " Area Automatic Value wasnt checked. It should have been."
458 If Increments.IsVisible then
459 If AreaIncrementsValue <> Increments.GetText then WarnLog "Area Increments has changed."
464 if FillOptions.GetSelIndex <> 4 then Errorlog "Couldnt click on 'Hatching' in FormatArea"
466 If AreaHatchingListValue <> HatchingList.GetSelText then Errorlog "Area HatchingList has changed it's value."
467 If BackgroundColour.IsVisible then
468 If BackgroundColour.IsChecked then
469 If AreaBackgroundColourValue <> BackgroundColour.GetText then Errorlog "Area Background Color has changed it's value."
472 If BackgroundColourList.IsVisible then
473 If AreaBackgroundColourListValue <> BackgroundColourList.GetSelText then Errorlog "Area Background ColourList has changed it's value."
477 if FillOptions.GetSelIndex <> 5 then Errorlog "Couldnt click on 'Color' in FormatArea"
479 If BitmapList.IsVisible then
480 If AreaBitmapListValue <> BitmapList.GetSelText then Errorlog "Area Bitmap List has changed it's value."
482 warnlog " No Area-Bitmap-List visible!"
484 If Original.IsChecked = "TRUE" then
485 If AreaOriginalListValue <> "TRUE" then Errorlog "Original List has changed it's value."
487 If Relative.IsChecked = "TRUE" then
488 If AreaRelativeValue <> "TRUE" then Errorlog "Area Relative has changed it's value." = "TRUE"
489 If AreaWidthValue <> Width.GetText then Errorlog "AreaWidthValue has changed."
490 If AreaHeightValue <> Height.GetText then Errorlog "AreaHeightValue has changed."
492 If AreaWidthValue <> Width.GetText then Errorlog "AreaWidthValue has changed."
493 If AreaHeightValue <> Height.GetText then Errorlog "AreaHeightValue has changed."
497 If Tile.IsChecked then
498 If AreaTileValue <> "TRUE" then Errorlog "AreaTileValue has changed."
501 If Stretch.IsChecked then
502 If AreaStretchValue <> "TRUE" then Errorlog "AreaStretchValue has changed."
505 If Row.IsChecked then
506 If AreaRowValue <> "TRUE" then Errorlog "AreRowValue has changed."
507 If AreaOffsetValue <> Offset.GetText then Errorlog "AreaOffsetValue has changed."
510 If Column.IsChecked then
511 If AreaColumnValue <> "TRUE" then Errorlog "AreaColumnValue has changed."
512 If AreaOffsetValue <> Offset.GetText then Errorlog "AreaOffsetValue has changed."
519 Active.setpage TabSchatten
520 Kontext "TabSchatten"
522 If Anzeigen.IsChecked then
523 ShadowUseShadowsValue = "TRUE"
524 ShadowDistanceValue = Entfernung.GetText
525 ShadowColorValue = Farbe.GetText
526 ShadowTransparencyValue = Transparenz.GetText
532 Active.SetPage TabTransparenz
533 Kontext "TabTransparenz"
535 if KeineTransparenz.IsEnabled = FALSE then
536 warnlog " Couldnt check 'No transparency' in Area - Transparency'"
538 KeineTransparenz.Check
541 If KeineTransparenz.IsChecked then LineareTransparenz.Check
542 If LineareTransparenz.IsChecked then
543 TransparencyTransparencyValue = MFLinTransparenz.GetText
546 Transparenzverlauf.Check
547 If Transparenzverlauf.IsChecked then
548 TransparencyGradientType = TransparenzverlaufTyp.GetItemText
549 TransparencyMFZentrumX = MFZentrumX.GetText
550 TransparencyMFZentrumY = MFZentrumY.GetText
551 TransparencyMFWinkel = MFWinkel.GetText
552 TransparencyMFRand = MFRand.GetText
553 TransparencyMFStartwert = MFStartwert.GetText
554 TransparencyMFEndwert = MFEndwert.GetText
560 Active.setpage TabFarben
562 ColorName = FarbName.GetText
563 ColorColor = Farbe.GetItemText
564 ColorModel = Farbmodell.GetSelText
565 printlog " " + ColorModel
567 select case iSprache ' Prepared for future language-problematics.
568 if ColorR <> R.GetText then Warnlog "Wrong R-Color. Should be: " + ColorR + " but was: " + R.GetText
569 if ColorG <> G.GetText then Warnlog "Wrong V-Color. Should be: " + ColorG + " but was: " + G.GetText
570 if ColorB <> B.GetText then Warnlog "Wrong B-Color. Should be: " + ColorB + " but was: " + B.GetText
572 if ColorC <> C.GetText then Warnlog "Wrong C-Color. Should be: " + ColorC + " but was: " + C.GetText
573 if ColorM <> M.GetText then Warnlog "Wrong M-Color. Should be: " + ColorM + " but was: " + M.GetText
574 if ColorY <> Y.GetText then Warnlog "Wrong J-Color. Should be: " + ColorY + " but was: " + Y.GetText
575 if ColorK <> K.GetText then Warnlog "Wrong N-Color. Should be: " + ColorK + " but was: " + K.GetText
577 if ColorR <> R.GetText then Warnlog "Wrong R-Color. Should be: " + ColorR + " but was: " + R.GetText
578 if ColorG <> G.GetText then Warnlog "Wrong G-Color. Should be: " + ColorG + " but was: " + G.GetText
579 if ColorB <> B.GetText then Warnlog "Wrong B-Color. Should be: " + ColorB + " but was: " + B.GetText
581 if ColorC <> C.GetText then Warnlog "Wrong C-Color. Should be: " + ColorC + " but was: " + C.GetText
582 if ColorM <> M.GetText then Warnlog "Wrong M-Color. Should be: " + ColorM + " but was: " + M.GetText
583 if ColorY <> Y.GetText then Warnlog "Wrong Y-Color. Should be: " + ColorY + " but was: " + Y.GetText
584 if ColorK <> K.GetText then Warnlog "Wrong K-Color. Should be: " + ColorK + " but was: " + K.GetText
589 Active.setpage TabFarbverlaeufe
590 Kontext "TabFarbverlaeufe"
592 GradientsType = Typ.GetItemText
593 GradientsCenterX = ZentrumX.GetText
594 GradientsCenterZ = ZentrumY.GetText
595 GradientsAngle = Winkel.GetText
596 GradientsBorder = Rand.GetText
597 GradientsFromColor = Von.GetItemText
598 GradientsFromValue = VonWert.GetText
599 GradientsToColor = Bis.GetItemText
600 GradientsToValue = BisWert.GetText
603 Active.setpage TabSchraffuren
604 Kontext "TabSchraffuren"
606 HatchingDistance = Abstand.GetText
607 HatchingAngle = Winkel.GetText
609 HatchingLineType = Linientyp.GetSelText
610 HatchingLineColor = Linienfarbe.GetSelText
611 HatchingLineTable = Tabelle.GetItemText
614 Active.setpage TabBitmap
617 BitmapForeground = Vordergrund.GetSelText
618 BitmapBackground = Hintergrund.GetSelText
619 BitmapTable = Tabelle.GetSelText
622 Active.setpage TabArea
626 SetKontextApplication
628 printlog "Check_Colors_Borders_Attributes Ends"
630 Printlog "End of one application"
633 '---------------------------------- Set the Kontext to the current Application ----------------------------------'
634 sub SetKontextApplication
637 Select Case gApplication
639 Kontext "DocumentDraw"
640 ' Printlog "gApplication / Kontext is now: DocumentDraw"
643 Kontext "DocumentImpress"
644 ' Printlog "gApplication / Kontext is now: DocumentImpress"
647 Kontext "DocumentWriter"
648 ' Printlog "gApplication / Kontext is now: DocumentWriter"
651 Kontext "DocumentCalc"
652 ' Printlog "gApplication / Kontext is now: DocumentCalc"
659 '------------------------- Part with "create new windows" ---------------------
662 gApplication = "DRAW"
664 printlog "to app has changed to: " + gApplication
666 SetKontextApplication
670 '-------------------------------------------------------------------------------
673 printlog "Copied object from application: " + FromApp2
674 gApplication = "IMPRESS"
676 printlog "to app has changed to: " + gApplication
678 SetKontextApplication
682 '-------------------------------------------------------------------------------
685 printlog "Copied object from application: " + FromApp2
686 gApplication = "CALC"
688 printlog "to app has changed to: " + gApplication
690 SetKontextApplication
694 '-------------------------------------------------------------------------------
697 printlog "Copied object from application: " + FromApp2
698 gApplication = "WRITER"
700 printlog "to app has changed to: " + gApplication
702 SetKontextApplication
706 '-------------------------------------------------------------------------------
707 sub Choose_Toapplication
709 For ToAppCounter = 1 to 4
711 Select case ToAppCounter
712 case "1" : Call hCloseDocument
713 printlog "to app: " + gApplication ' Since the first application is Draw by default, we'll skip that one.
715 case "2" : Call hCloseDocument
716 gApplication = "IMPRESS"
717 printlog "to app: " + gApplication
719 case "3" : Call hCloseDocument
720 gApplication = "CALC"
721 printlog "to app: " + gApplication
723 case "4" : Call hCloseDocument
724 gApplication = "WRITER"
725 printlog "to app: " + gApplication
727 case else : goto endsub
731 SetKontextApplication
735 '--------------------------------------------------------------------------------------------------------