xref: /trunk/main/framework/test/test_documentproperties.bas (revision 08dd9f995c84de233870bfe0ef563690c0d86a88)
1*184e05d2SAndrew Rist' *************************************************************
2*184e05d2SAndrew Rist'
3*184e05d2SAndrew Rist'  Licensed to the Apache Software Foundation (ASF) under one
4*184e05d2SAndrew Rist'  or more contributor license agreements.  See the NOTICE file
5*184e05d2SAndrew Rist'  distributed with this work for additional information
6*184e05d2SAndrew Rist'  regarding copyright ownership.  The ASF licenses this file
7*184e05d2SAndrew Rist'  to you under the Apache License, Version 2.0 (the
8*184e05d2SAndrew Rist'  "License")' you may not use this file except in compliance
9*184e05d2SAndrew Rist'  with the License.  You may obtain a copy of the License at
10*184e05d2SAndrew Rist'
11*184e05d2SAndrew Rist'    http://www.apache.org/licenses/LICENSE-2.0
12*184e05d2SAndrew Rist'
13*184e05d2SAndrew Rist'  Unless required by applicable law or agreed to in writing,
14*184e05d2SAndrew Rist'  software distributed under the License is distributed on an
15*184e05d2SAndrew Rist'  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*184e05d2SAndrew Rist'  KIND, either express or implied.  See the License for the
17*184e05d2SAndrew Rist'  specific language governing permissions and limitations
18*184e05d2SAndrew Rist'  under the License.
19*184e05d2SAndrew Rist'
20*184e05d2SAndrew Rist' *************************************************************
21*184e05d2SAndrew Rist
22cdf0e10cSrcweirSub Main
23cdf0e10cSrcweir        ' Oeffnen der LOG-Datei
24cdf0e10cSrcweir        ' Es gibt 2 Moeglichgkeiten, diesen Test zu absolvieren.
25cdf0e10cSrcweir        ' 1) Ausgabe von Informationen in MessageBoxen
26cdf0e10cSrcweir        ' 2) Ausgabe von Informationen in einer LOG-Datei
27cdf0e10cSrcweir        '
28cdf0e10cSrcweir        ' Die Methoden OpenLOG, CloseLOG, Message, ErrorMessage und InfoMessage beruecksichtigen das automatisch!
29cdf0e10cSrcweir        ' Zum Umschalten zwischen den beiden Zustaenden genuegt es, eine der folgenden
30cdf0e10cSrcweir        ' zwei Programmzeilen zu aktivieren ...
31cdf0e10cSrcweir
32cdf0e10cSrcweir        'bLOGOn = cOn
33cdf0e10cSrcweir        bLOGOn  = cOff
34cdf0e10cSrcweir
35cdf0e10cSrcweir        'bShowErrorsOnly        = cOn
36cdf0e10cSrcweir        bShowErrorsOnly     = cOff
37cdf0e10cSrcweir
38cdf0e10cSrcweir        OpenLOG     ( cTestPath + "TestDocumentProperties.log" )
39cdf0e10cSrcweir        InfoMessage ( "Test DocumentProperties ... [start]" )
40cdf0e10cSrcweir
41cdf0e10cSrcweir        ' Service besorgen
42cdf0e10cSrcweir        InfoMessage ( "Service besorgen ... [start]" )
43cdf0e10cSrcweir        aDocumentProperties = createUnoService ( "com.sun.star.document.DocumentProperties" )
44cdf0e10cSrcweir
45cdf0e10cSrcweir        ' Erfolg abtesten
46cdf0e10cSrcweir        if ( isnull ( aDocumentProperties ) ) then
47cdf0e10cSrcweir            ErrorMessage ( "Service konnte nicht instanziiert werden!"  )
48cdf0e10cSrcweir            exit sub
49cdf0e10cSrcweir        else
50cdf0e10cSrcweir            InfoMessage ( "Service erfolgreich instanziiert ..."    )
51cdf0e10cSrcweir            InfoMessage ( "Service besorgen ... [ende]"             )
52cdf0e10cSrcweir        end if
53cdf0e10cSrcweir
54cdf0e10cSrcweir        ' Unterstuetzte Schnittstellen, Methoden und Properties anzeigen
55cdf0e10cSrcweir        ' Achtung: Methoden und Properties koennen nicht angezeigt werden ...
56cdf0e10cSrcweir        ' neues Uno <-> Basic !?
57cdf0e10cSrcweir        msgbox  aDocumentProperties.dbg_supportedInterfaces
58cdf0e10cSrcweir        'msgbox aDocumentProperties.dbg_methods
59cdf0e10cSrcweir        'msgbox aDocumentProperties.dbg_properties
60cdf0e10cSrcweir
61cdf0e10cSrcweir        ' Testen des Services unter normalen Bedingungen (also wie vorgesehen)
62cdf0e10cSrcweir        bState = Test_NormalUse ( aDocumentProperties )
63cdf0e10cSrcweir        ' Fehlerstatus abfragen
64cdf0e10cSrcweir        if ( bState = cError ) then
65cdf0e10cSrcweir            ErrorMessage ( "Der Service arbeitet unter normalen Bedingungen nicht korrekt!" )
66cdf0e10cSrcweir        end if
67cdf0e10cSrcweir
68cdf0e10cSrcweir        bState = Test_ErrorUse  ( aDocumentProperties )
69cdf0e10cSrcweir        ' Fehlerstatus abfragen
70cdf0e10cSrcweir        if ( bState = cError ) then
71cdf0e10cSrcweir            ErrorMessage ( "Der Service verhaelt sich in Fehlersituationen nicht korrekt!" )
72cdf0e10cSrcweir        end if
73cdf0e10cSrcweir
74cdf0e10cSrcweir        ' Schliessen der Error-Logdatei
75cdf0e10cSrcweir        InfoMessage ( "Test DocumentProperties ... [ende]" )
76cdf0e10cSrcweir        CloseLOG
77cdf0e10cSrcweirEnd Sub
78cdf0e10cSrcweir
79cdf0e10cSrcweir'*****************************************************************************************************************
80cdf0e10cSrcweir' Testfunktionen
81cdf0e10cSrcweir'*****************************************************************************************************************
82cdf0e10cSrcweir
83cdf0e10cSrcweir'----------------------------------------------------------------------------
84cdf0e10cSrcweir' Testmethode: Testet den Service unter normalen Bedingungen
85cdf0e10cSrcweir'
86cdf0e10cSrcweir' Returnwert cOK bedeutet, dass sich das Objekt normal verhaelt ...
87cdf0e10cSrcweir' Returnwert cError bedeutet, dass sich das ein Fehler aufgetreten ist ...
88cdf0e10cSrcweir'----------------------------------------------------------------------------
89cdf0e10cSrcweirFunction Test_NormalUse ( aDocumentProperties ) as Boolean
90cdf0e10cSrcweir
91cdf0e10cSrcweir        ' Zunaechst wird vom Erfolg des Test ausgegangen.
92cdf0e10cSrcweir        ' Sollte einer der Detail-Tests fehlschlagen, dann wird dieser Wert
93cdf0e10cSrcweir        ' zurueckgesetzt. Damit wird dann angezeigt, dass mindestens ein
94cdf0e10cSrcweir        ' Einzeltest nicht korrekt funktionierte.
95cdf0e10cSrcweir
96cdf0e10cSrcweir        Test_NormalUse = cOK
97cdf0e10cSrcweir
98cdf0e10cSrcweir        bState = Test_NormalUse_XPropertySet    ( aDocumentProperties )
99cdf0e10cSrcweir        if ( bState = cError ) then
100cdf0e10cSrcweir            Test_NormalUse = cError
101cdf0e10cSrcweir        end if
102cdf0e10cSrcweir
103cdf0e10cSrcweir        bState = Test_NormalUse_XNameContainer  ( aDocumentProperties )
104cdf0e10cSrcweir        if ( bState = cError ) then
105cdf0e10cSrcweir            Test_NormalUse = cError
106cdf0e10cSrcweir        end if
107cdf0e10cSrcweir
108cdf0e10cSrcweir        bState = Test_NormalUse_XPersist        ( aDocumentProperties )
109cdf0e10cSrcweir        if ( bState = cError ) then
110cdf0e10cSrcweir            Test_NormalUse = cError
111cdf0e10cSrcweir        end if
112cdf0e10cSrcweir
113cdf0e10cSrcweirEnd Function
114cdf0e10cSrcweir
115cdf0e10cSrcweir'----------------------------------------------------------------------------
116cdf0e10cSrcweir' Testmethode: Testet den Service unter Randbedingungen und provoziert Fehlerzustaende
117cdf0e10cSrcweir'
118cdf0e10cSrcweir' Returnwert cOK bedeutet, dass das Objekt damit keine Probleme hat ...
119cdf0e10cSrcweir' Returnwert cError bedeutet, dass das Objekt noch nicht robust genug ist ...
120cdf0e10cSrcweir'----------------------------------------------------------------------------
121cdf0e10cSrcweirFunction Test_ErrorUse ( aDocumentProperties ) as Boolean
122cdf0e10cSrcweir
123cdf0e10cSrcweir        Test_ErrorUse = cOK
124cdf0e10cSrcweir
125cdf0e10cSrcweirEnd Function
126cdf0e10cSrcweir
127cdf0e10cSrcweir'----------------------------------------------------------------------------
128cdf0e10cSrcweir' Testmethode: Testen des unterstuetzten Interfaces "XPropertySet" unter normalen Bedingungen
129cdf0e10cSrcweir'
130cdf0e10cSrcweir' Returnwert = cOK      ; wenn der Test erfolgreich war
131cdf0e10cSrcweir' Returnwert = cError   ; wenn sich das Objekt nicht korrekt verhalten hat
132cdf0e10cSrcweir'----------------------------------------------------------------------------
133cdf0e10cSrcweirFunction Test_NormalUse_XPropertySet ( aDocumentProperties ) as Boolean
134cdf0e10cSrcweir
135cdf0e10cSrcweir        ' Einschalten der Fehlerbehandlung, um Exceptions oder aehnliches abzufangen!
136cdf0e10cSrcweir        on Error goto Test_NormalUse_XPropertySet_Error
137cdf0e10cSrcweir
138cdf0e10cSrcweir        InfoMessage ( "Test_NormalUse_XPropertySet ... [start]" )
139cdf0e10cSrcweir
140cdf0e10cSrcweir        ' 1) Test der Funktion "getPropertySetInfo()"
141cdf0e10cSrcweir        '       Da diese Funktion keine Parameter besitzt und zudem eine "get"-Methode
142cdf0e10cSrcweir        '       darstellt, wird sie durch Basic automatisch als "Property" behandelt!
143cdf0e10cSrcweir        '       Daher schreibt man nicht "getPropertySetInfo()" sondern nur "PropertySetInfo".
144cdf0e10cSrcweir
145cdf0e10cSrcweir        ' Besorgen der Info
146cdf0e10cSrcweir        PropertySetInfo = aDocumentProperties.PropertySetInfo
147cdf0e10cSrcweir        ' Und abtesten auf Gueltigkeit
148cdf0e10cSrcweir        if ( isnull (PropertySetInfo) ) then
149cdf0e10cSrcweir            ErrorMessage ( "getPropertySetInfo() ... Error (Keine Info bestimmbar!)" )
150cdf0e10cSrcweir            goto Test_NormalUse_XPropertySet_Error
151cdf0e10cSrcweir        end if
152cdf0e10cSrcweir
153cdf0e10cSrcweir        ' Hier fehlt noch der Test der InfoStruktur! (Laesst sich unter Basic irgendwie NICHT testen!!!???)
154cdf0e10cSrcweir        ' ...
155cdf0e10cSrcweir
156cdf0e10cSrcweir        InfoMessage ( "getPropertySetInfo() ... OK" )
157cdf0e10cSrcweir
158cdf0e10cSrcweir        ' 2) getPropertyValue() & setPropertyValue ()
159cdf0e10cSrcweir        '       In diesem Service sind mehrere Properties bereits definiert und vorbelegt.
160cdf0e10cSrcweir        '       Zum Test werden repraesentativ einige davon verwendet. Naemlich je eine
161cdf0e10cSrcweir        '       der verschiedenen Datentypen!
162cdf0e10cSrcweir        '       Das sind im folgenden:      OWString, sal_Bool, sal_Int16, sal_uInt16, sal_Int32, DateTime, Sequence< sal_Int8 >
163cdf0e10cSrcweir        '                                   Achtung! sal_uInt16 kann in Basic so nicht dargestellt werden. Daher wird ein normaler
164cdf0e10cSrcweir        '                                   Integer-Wert angenommen - Bedingung ist, das hier im Test der Wertebereich nicht
165cdf0e10cSrcweir        '                                   ueberschritten wird!
166cdf0e10cSrcweir        '       Es wird versucht den Standardwert dieser zu ermitteln und zu merken;
167cdf0e10cSrcweir        '       dann einen neuen Wert zu setzen; sowie diesen wiederum zu lesen und mit den
168cdf0e10cSrcweir        '       vorherigen Werten zu vergleichen!
169cdf0e10cSrcweir
170cdf0e10cSrcweir        ' Zunaechst werden die Standardwerte dieser Properties besorgt ...
171cdf0e10cSrcweir        sDefaultValue_OWString$     = aDocumentProperties.getPropertyValue ( "Author"           )
172cdf0e10cSrcweir        bDefaultValue_sal_Bool      = aDocumentProperties.getPropertyValue ( "AutoloadEnabled"  )
173cdf0e10cSrcweir        nDefaultValue_sal_Int16%    = aDocumentProperties.getPropertyValue ( "EditingCycles"    )
174cdf0e10cSrcweir        nDefaultValue_sal_uInt16%   = aDocumentProperties.getPropertyValue ( "Priority"         )
175cdf0e10cSrcweir        nDefaultValue_sal_Int32&    = aDocumentProperties.getPropertyValue ( "EditingDuration"  )
176cdf0e10cSrcweir        aDefaultValue_DateTime      = aDocumentProperties.getPropertyValue ( "ModifyDate"       )
177cdf0e10cSrcweir'       aDefaultValue_ByteSequence  = aDocumentProperties.getPropertyValue ( "ExtraData"        )
178cdf0e10cSrcweir        aDefaultValue_ByteSequence  = aDocumentProperties.ExtraData
179cdf0e10cSrcweir
180cdf0e10cSrcweir        ' ... dann die Werte zur Kontrolle ausgeben.
181cdf0e10cSrcweir        ShowProperties ( aDocumentProperties )
182cdf0e10cSrcweir
183cdf0e10cSrcweir        InfoMessage ( "getPropertyValue() ... OK" )
184cdf0e10cSrcweir
185cdf0e10cSrcweir        ' Jetzt werden neue Werte vereinbart ...
186cdf0e10cSrcweir        ' Diese werden so gewaehlt, das sie garantiert von den Standardwerten verschieden sind!
187cdf0e10cSrcweir        ' Dazu werden die alten auf Wert abgefragt und entsprechend die neuen gesetzt.
188cdf0e10cSrcweir        sNewValue_OWString$     = sDefaultValue_OWString$   + "NeuerWert"
189cdf0e10cSrcweir        bNewValue_sal_Bool      = not bDefaultValue_sal_Bool
190cdf0e10cSrcweir        nNewValue_sal_Int16%    = nDefaultValue_sal_Int16%  + 1
191cdf0e10cSrcweir        if ( nDefaultValue_sal_uInt16% = 1 ) then
192cdf0e10cSrcweir            nNewValue_sal_uInt16% = 2
193cdf0e10cSrcweir        else
194cdf0e10cSrcweir            nNewValue_sal_uInt16% = 1
195cdf0e10cSrcweir        end if
196cdf0e10cSrcweir        nNewValue_sal_Int32&    = nDefaultValue_sal_Int32&  + 1
197cdf0e10cSrcweir
198cdf0e10cSrcweir        aNewValue_DateTime                  = aDefaultValue_DateTime
199cdf0e10cSrcweir        aNewValue_DateTime.HundredthSeconds = aDefaultValue_DateTime.HundredthSeconds   + 1
200cdf0e10cSrcweir        aNewValue_DateTime.Seconds          = aDefaultValue_DateTime.Seconds            + 1
201cdf0e10cSrcweir        aNewValue_DateTime.Minutes          = aDefaultValue_DateTime.Minutes            + 1
202cdf0e10cSrcweir        aNewValue_DateTime.Hours            = aDefaultValue_DateTime.Hours              + 1
203cdf0e10cSrcweir        aNewValue_DateTime.Day              = aDefaultValue_DateTime.Day                + 1
204cdf0e10cSrcweir        aNewValue_DateTime.Month            = aDefaultValue_DateTime.Month              + 1
205cdf0e10cSrcweir        aNewValue_DateTime.Year             = aDefaultValue_DateTime.Year               + 1
206cdf0e10cSrcweir
207cdf0e10cSrcweir        aNewValue_ByteSequence = aDefaultValue_ByteSequence
208cdf0e10cSrcweir        nElementCount% = UBound ( aDefaultValue_ByteSequence )
209cdf0e10cSrcweir'       for nCounter%=0 to nElementCount% step 1
210cdf0e10cSrcweir'           aNewValue_ByteSequence(nCounter%) = ( aDefaultValue_ByteSequence(nCounter%) + 1 )
211cdf0e10cSrcweir'       next nCounter%
212cdf0e10cSrcweir
213cdf0e10cSrcweir        ' Anschliessend muessen diese neuen Werte gesetzt werden.
214cdf0e10cSrcweir        aDocumentProperties.setPropertyValue ( "Author"         , sNewValue_OWString$       )
215cdf0e10cSrcweir        aDocumentProperties.setPropertyValue ( "AutoloadEnabled", bNewValue_sal_Bool        )
216cdf0e10cSrcweir        aDocumentProperties.setPropertyValue ( "EditingCycles"  , nNewValue_sal_Int16%      )
217cdf0e10cSrcweir        aDocumentProperties.setPropertyValue ( "Priority"       , nNewValue_sal_uInt16%     )
218cdf0e10cSrcweir        aDocumentProperties.setPropertyValue ( "EditingDuration", nNewValue_sal_Int32&      )
219cdf0e10cSrcweir        aDocumentProperties.setPropertyValue ( "ModifyDate"     , aNewValue_DateTime        )
220cdf0e10cSrcweir'       aDocumentProperties.setPropertyValue ( "ExtraData"      , aNewValue_ByteSequence    )
221cdf0e10cSrcweir        aDocumentProperties.ExtraData = aNewValue_ByteSequence
222cdf0e10cSrcweir
223cdf0e10cSrcweir        ' Dann lassen wir sie uns ausgeben, um sie mit den vorherigen vergleichen zu koennen.
224cdf0e10cSrcweir        ' (Das geht natuerlich nur, wenn "bLOGOn=cOn" ist - also eine LOG-Datei geschrieben wird!)
225cdf0e10cSrcweir        ShowProperties ( aDocumentProperties )
226cdf0e10cSrcweir
227cdf0e10cSrcweir        ' Nun werden die Properties wieder gelesen ...
228cdf0e10cSrcweir        sLastValue_OWString$    = aDocumentProperties.getPropertyValue ( "Author"           )
229cdf0e10cSrcweir        bLastValue_sal_Bool     = aDocumentProperties.getPropertyValue ( "AutoloadEnabled"  )
230cdf0e10cSrcweir        nLastValue_sal_Int16%   = aDocumentProperties.getPropertyValue ( "EditingCycles"    )
231cdf0e10cSrcweir        nLastValue_sal_uInt16%  = aDocumentProperties.getPropertyValue ( "Priority"         )
232cdf0e10cSrcweir        nLastValue_sal_Int32&   = aDocumentProperties.getPropertyValue ( "EditingDuration"  )
233cdf0e10cSrcweir        aLastValue_DateTime     = aDocumentProperties.getPropertyValue ( "ModifyDate"       )
234cdf0e10cSrcweir        aLastValue_ByteSequence = aDocumentProperties.getPropertyValue ( "ExtraData"        )
235cdf0e10cSrcweir
236cdf0e10cSrcweir        ' ... und mit den vorher als zu setzend bestimmte Werte vergleichen!
237cdf0e10cSrcweir        ' Es duerfen KEINE Unterschiede auftreten, da sonst "setPropertyValue()" nicht korrekt funktioniert hat!
238cdf0e10cSrcweir
239cdf0e10cSrcweir        if ( CompareOWString            ( sNewValue_OWString$,      sLastValue_OWString$    ) = cDifferent ) then
240cdf0e10cSrcweir            ErrorMessage    ( "setPropertyValue() ... Fehler [OWString fehlerhaft]"     )
241cdf0e10cSrcweir            goto Test_NormalUse_XPropertySet_Error
242cdf0e10cSrcweir        elseif ( CompareBool            ( bNewValue_sal_Bool,       bLastValue_sal_Bool     ) = cDifferent ) then
243cdf0e10cSrcweir            ErrorMessage    ( "setPropertyValue() ... Fehler [sal_Bool fehlerhaft]"     )
244cdf0e10cSrcweir            goto Test_NormalUse_XPropertySet_Error
245cdf0e10cSrcweir        elseif ( CompareInt16           ( nNewValue_sal_Int16%,     nLastValue_sal_Int16%   ) = cDifferent ) then
246cdf0e10cSrcweir            ErrorMessage    ( "setPropertyValue() ... Fehler [sal_Int16 fehlerhaft]"    )
247cdf0e10cSrcweir            goto Test_NormalUse_XPropertySet_Error
248cdf0e10cSrcweir        elseif ( CompareInt16           ( nNewValue_sal_uInt16%,    nLastValue_sal_uInt16%  ) = cDifferent ) then
249cdf0e10cSrcweir            ErrorMessage    ( "setPropertyValue() ... Fehler [sal_uInt16 fehlerhaft]"   )
250cdf0e10cSrcweir            goto Test_NormalUse_XPropertySet_Error
251cdf0e10cSrcweir        elseif ( CompareInt32           ( nNewValue_sal_Int32&,     nLastValue_sal_Int32&   ) = cDifferent ) then
252cdf0e10cSrcweir            ErrorMessage    ( "setPropertyValue() ... Fehler [sal_Int32 fehlerhaft]"    )
253cdf0e10cSrcweir            goto Test_NormalUse_XPropertySet_Error
254cdf0e10cSrcweir        elseif ( CompareDateTime        ( aNewValue_DateTime,       aLastValue_DateTime     ) = cDifferent ) then
255cdf0e10cSrcweir            ErrorMessage    ( "setPropertyValue() ... Fehler [DateTime fehlerhaft]"     )
256cdf0e10cSrcweir            goto Test_NormalUse_XPropertySet_Error
257cdf0e10cSrcweir        elseif ( CompareByteSequence    ( aNewValue_ByteSequence,   aLastValue_ByteSequence ) = cDifferent ) then
258cdf0e10cSrcweir            ErrorMessage    ( "setPropertyValue() ... Fehler [ByteSequence fehlerhaft]" )
259cdf0e10cSrcweir            goto Test_NormalUse_XPropertySet_Error
260cdf0e10cSrcweir        end if
261cdf0e10cSrcweir
262cdf0e10cSrcweir        InfoMessage ( "setPropertyValue() ... OK" )
263cdf0e10cSrcweir
264cdf0e10cSrcweir        ' Nun wird noch mit den zuerst ermittelten Default-Werten verglichen!
265cdf0e10cSrcweir        ' Hier MUESSEN Unterschiede auftreten, da sonst "get-" UND "setPropertyValue()" nicht korrekt funktioniert haben!
266cdf0e10cSrcweir
267cdf0e10cSrcweir        if ( CompareOWString            ( sDefaultValue_OWString$,      sLastValue_OWString$    ) = cEqual ) then
268cdf0e10cSrcweir            ErrorMessage    ( "Zusammenspiel set & getPropertyValue() ... Fehler [OWString fehlerhaft]"     )
269cdf0e10cSrcweir            goto Test_NormalUse_XPropertySet_Error
270cdf0e10cSrcweir        elseif ( CompareBool            ( bDefaultValue_sal_Bool,       bLastValue_sal_Bool     ) = cEqual ) then
271cdf0e10cSrcweir            ErrorMessage    ( "Zusammenspiel set & getPropertyValue() ... Fehler [sal_Bool fehlerhaft]"     )
272cdf0e10cSrcweir            goto Test_NormalUse_XPropertySet_Error
273cdf0e10cSrcweir        elseif ( CompareInt16           ( nDefaultValue_sal_Int16%,     nLastValue_sal_Int16%   ) = cEqual ) then
274cdf0e10cSrcweir            ErrorMessage    ( "Zusammenspiel set & getPropertyValue() ... Fehler [sal_Int16 fehlerhaft]"    )
275cdf0e10cSrcweir            goto Test_NormalUse_XPropertySet_Error
276cdf0e10cSrcweir        elseif ( CompareInt16           ( nDefaultValue_sal_uInt16%,    nLastValue_sal_uInt16%  ) = cEqual ) then
277cdf0e10cSrcweir            ErrorMessage    ( "Zusammenspiel set & getPropertyValue() ... Fehler [sal_uInt16 fehlerhaft]"   )
278cdf0e10cSrcweir            goto Test_NormalUse_XPropertySet_Error
279cdf0e10cSrcweir        elseif ( CompareInt32           ( nDefaultValue_sal_Int32&,     nLastValue_sal_Int32&   ) = cEqual ) then
280cdf0e10cSrcweir            ErrorMessage    ( "Zusammenspiel set & getPropertyValue() ... Fehler [sal_Int32 fehlerhaft]"    )
281cdf0e10cSrcweir            goto Test_NormalUse_XPropertySet_Error
282cdf0e10cSrcweir        elseif ( CompareDateTime        ( aDefaultValue_DateTime,       aLastValue_DateTime     ) = cEqual ) then
283cdf0e10cSrcweir            ErrorMessage    ( "Zusammenspiel set & getPropertyValue() ... Fehler [DateTime fehlerhaft]"     )
284cdf0e10cSrcweir            goto Test_NormalUse_XPropertySet_Error
285cdf0e10cSrcweir'       elseif ( CompareByteSequence    ( aDefaultValue_ByteSequence,   aLastValue_ByteSequence ) = cEqual ) then
286cdf0e10cSrcweir'           ErrorMessage    ( "Zusammenspiel set & getPropertyValue() ... Fehler [ByteSequence fehlerhaft]" )
287cdf0e10cSrcweir'           goto Test_NormalUse_XPropertySet_Error
288cdf0e10cSrcweir        end if
289cdf0e10cSrcweir
290cdf0e10cSrcweir        InfoMessage ( "Zusammenspiel set & getPropertyValue() ... OK" )
291cdf0e10cSrcweir
292cdf0e10cSrcweir        ' Der Test war erfolgreich! Meldung ausgeben und zurueck zm Aufrufer.
293cdf0e10cSrcweir        ' Ausschalten der Fehlerbehandlung
294cdf0e10cSrcweir        on Error goto 0
295cdf0e10cSrcweir        ' Meldung ausgeben
296cdf0e10cSrcweir        InfoMessage ( "Test_NormalUse_XPropertySet ... [ende]" )
297cdf0e10cSrcweir        ' Status setzen
298cdf0e10cSrcweir        Test_NormalUse_XPropertySet = cOK
299cdf0e10cSrcweir        ' Und Funktion beenden
300cdf0e10cSrcweir        Exit Function
301cdf0e10cSrcweir
302cdf0e10cSrcweir' Es ist ein unerwartete Fehler aufgetreten! (Exception ...)
303cdf0e10cSrcweir' Meldung ausgeben und mit Fehler zurueckkehren.
304cdf0e10cSrcweirTest_NormalUse_XPropertySet_Error:
305cdf0e10cSrcweir        ' Ausschalten der Fehlerbehandlung
306cdf0e10cSrcweir        on Error goto 0
307cdf0e10cSrcweir        ' Meldung ausgeben
308cdf0e10cSrcweir        ErrorMessage ( "Test_NormalUse_XPropertySet ... [Error]" )
309cdf0e10cSrcweir        ' und Fehlerstatus setzen
310cdf0e10cSrcweir        Test_NormalUse_XPropertySet = cError
311cdf0e10cSrcweir        ' Abbruch der Funktion erzwingen!
312cdf0e10cSrcweir        Exit Function
313cdf0e10cSrcweir
314cdf0e10cSrcweirEnd Function
315cdf0e10cSrcweir
316cdf0e10cSrcweir'----------------------------------------------------------------------------
317cdf0e10cSrcweir' Testmethode: Testen des unterstuetzten Interfaces "XNameContainer" unter normalen Bedingungen
318cdf0e10cSrcweir'
319cdf0e10cSrcweir' Returnwert = cOK      ; wenn sich das Objekt korrekt verhalten hat
320cdf0e10cSrcweir' Returnwert = cError   ; wenn das Objekt noch nicht robust genug ist
321cdf0e10cSrcweir'----------------------------------------------------------------------------
322cdf0e10cSrcweirFunction Test_NormalUse_XNameContainer ( aDocumentProperties ) as Boolean
323cdf0e10cSrcweir
324cdf0e10cSrcweir        ' Einschalten der Fehlerbehandlung, um Exceptions oder aehnliches abzufangen!
325cdf0e10cSrcweir        on Error goto Test_NormalUse_XNameContainer_Error
326cdf0e10cSrcweir
327cdf0e10cSrcweir        InfoMessage ( "Test_NormalUse_XNameContainer ... [start]" )
328cdf0e10cSrcweir
329cdf0e10cSrcweir        ' Da das Initialisieren im Konstruktor des Objektes und das Aufraeumen im Destruktor
330cdf0e10cSrcweir        ' automatisch geschieht und diese Methode pro Programmablauf nur einmal verwendet wird,
331cdf0e10cSrcweir        ' darf sich kein Element schon im NameContainer befinden!
332cdf0e10cSrcweir        ' Wenn doch, ist das ein Fehler!
333cdf0e10cSrcweir        if ( aDocumentProperties.hasElements () = TRUE ) then
334cdf0e10cSrcweir            ErrorMessage ( "Der NameConatiner sollte eigentlich leer sein, enthaelt initial aber schon Elemente!?" )
335cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
336cdf0e10cSrcweir        end if
337cdf0e10cSrcweir
338cdf0e10cSrcweir        ' Zunaechst werden mehrere Elemente in den NameContainer eingefuegt.
339cdf0e10cSrcweir        sItemName_1$    = "Item 1"
340cdf0e10cSrcweir        sItemName_2$    = "Item 2"
341cdf0e10cSrcweir        sItemName_3$    = "Item 3"
342cdf0e10cSrcweir        sItemName_4$    = "Item 4"
343cdf0e10cSrcweir        sItemName_5$    = "Item 5"
344cdf0e10cSrcweir
345cdf0e10cSrcweir        sFirstValue_1$  = "Value 1"
346cdf0e10cSrcweir        sFirstValue_2$  = "Value 2"
347cdf0e10cSrcweir        sFirstValue_3$  = "Value 3"
348cdf0e10cSrcweir        sFirstValue_4$  = "Value 4"
349cdf0e10cSrcweir        sFirstValue_5$  = "Value 5"
350cdf0e10cSrcweir
351cdf0e10cSrcweir        aDocumentProperties.insertByName ( sItemName_1$, sFirstValue_1$ )
352cdf0e10cSrcweir        aDocumentProperties.insertByName ( sItemName_2$, sFirstValue_2$ )
353cdf0e10cSrcweir        aDocumentProperties.insertByName ( sItemName_3$, sFirstValue_3$ )
354cdf0e10cSrcweir        aDocumentProperties.insertByName ( sItemName_4$, sFirstValue_4$ )
355cdf0e10cSrcweir        aDocumentProperties.insertByName ( sItemName_5$, sFirstValue_5$ )
356cdf0e10cSrcweir
357cdf0e10cSrcweir        ' Zur Kontrolle die Werte ausgeben. (Nur wichtig, wenn geloggt wird!)
358cdf0e10cSrcweir        ' Dabei wird die Methode "getElementNames()" gleich implizit mitgetestet!
359cdf0e10cSrcweir        ShowNameContainer ( aDocumentProperties )
360cdf0e10cSrcweir
361cdf0e10cSrcweir        ' Aber auch die Anzahl kontrollieren.
362cdf0e10cSrcweir        ' (Hier wird eine eigene BASIC-Hilfsfunktion verwendet! keine Interface-Methode)
363cdf0e10cSrcweir        if ( getNameContainerCount ( aDocumentProperties ) <> 5 ) then
364cdf0e10cSrcweir            ErrorMessage ( "insertByName() ... Fehler (Der NameConatiner enthaelt nicht die eingefuegten 5 Elemente!)" )
365cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
366cdf0e10cSrcweir        end if
367cdf0e10cSrcweir
368cdf0e10cSrcweir        ' Nun noch feststellen, ob die 5 denn auch tatsaechlich vorhanden sind.
369cdf0e10cSrcweir        if ( aDocumentProperties.hasByName ( sItemName_1$ ) = FALSE ) then
370cdf0e10cSrcweir            ErrorMessage    ( "hasByName() ... Fehler [Element 1 nicht vorhanden!?]" )
371cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
372cdf0e10cSrcweir        elseif ( aDocumentProperties.hasByName ( sItemName_2$ ) = FALSE ) then
373cdf0e10cSrcweir            ErrorMessage    ( "hasByName() ... Fehler [Element 2 nicht vorhanden!?]" )
374cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
375cdf0e10cSrcweir        elseif ( aDocumentProperties.hasByName ( sItemName_3$ ) = FALSE ) then
376cdf0e10cSrcweir            ErrorMessage    ( "hasByName() ... Fehler [Element 3 nicht vorhanden!?]" )
377cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
378cdf0e10cSrcweir        elseif ( aDocumentProperties.hasByName ( sItemName_4$ ) = FALSE ) then
379cdf0e10cSrcweir            ErrorMessage    ( "hasByName() ... Fehler [Element 4 nicht vorhanden!?]" )
380cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
381cdf0e10cSrcweir        elseif ( aDocumentProperties.hasByName ( sItemName_5$ ) = FALSE ) then
382cdf0e10cSrcweir            ErrorMessage    ( "hasByName() ... Fehler [Element 5 nicht vorhanden!?]" )
383cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
384cdf0e10cSrcweir        end if
385cdf0e10cSrcweir
386cdf0e10cSrcweir        ' Dann die Werte wieder auslesen.
387cdf0e10cSrcweir        sCompareValue_1$ = aDocumentProperties.getByName ( sItemName_1$ )
388cdf0e10cSrcweir        sCompareValue_2$ = aDocumentProperties.getByName ( sItemName_2$ )
389cdf0e10cSrcweir        sCompareValue_3$ = aDocumentProperties.getByName ( sItemName_3$ )
390cdf0e10cSrcweir        sCompareValue_4$ = aDocumentProperties.getByName ( sItemName_4$ )
391cdf0e10cSrcweir        sCompareValue_5$ = aDocumentProperties.getByName ( sItemName_5$ )
392cdf0e10cSrcweir
393cdf0e10cSrcweir        ' Zum Vergleich die Werte ausgeben. (Nur wichtig, wenn geloggt wird!)
394cdf0e10cSrcweir        ShowNameContainer ( aDocumentProperties )
395cdf0e10cSrcweir
396cdf0e10cSrcweir        ' Dann die Werte automatisch vergleichen!
397cdf0e10cSrcweir        if ( CompareOWString        ( sFirstValue_1$, sCompareValue_1$ ) = cDifferent ) then
398cdf0e10cSrcweir            ErrorMessage    ( "getByName() ... Fehler [Element 1 fehlerhaft]" )
399cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
400cdf0e10cSrcweir        elseif ( CompareOWString    ( sFirstValue_2$, sCompareValue_2$ ) = cDifferent ) then
401cdf0e10cSrcweir            ErrorMessage    ( "getByName() ... Fehler [Element 2 fehlerhaft]" )
402cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
403cdf0e10cSrcweir        elseif ( CompareOWString    ( sFirstValue_3$, sCompareValue_3$ ) = cDifferent ) then
404cdf0e10cSrcweir            ErrorMessage    ( "getByName() ... Fehler [Element 3 fehlerhaft]" )
405cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
406cdf0e10cSrcweir        elseif ( CompareOWString    ( sFirstValue_4$, sCompareValue_4$ ) = cDifferent ) then
407cdf0e10cSrcweir            ErrorMessage    ( "getByName() ... Fehler [Element 4 fehlerhaft]" )
408cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
409cdf0e10cSrcweir        elseif ( CompareOWString    ( sFirstValue_5$, sCompareValue_5$ ) = cDifferent ) then
410cdf0e10cSrcweir            ErrorMessage    ( "getByName() ... Fehler [Element 5 fehlerhaft]" )
411cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
412cdf0e10cSrcweir        end if
413cdf0e10cSrcweir
414cdf0e10cSrcweir        InfoMessage ( "getByName() ... OK" )
415cdf0e10cSrcweir
416cdf0e10cSrcweir        ' Jetzt wird versucht einige der Elemente in ihrem Wert zu veraendern.
417cdf0e10cSrcweir        sNewValue_1$    = "NewValue 1"
418cdf0e10cSrcweir        sNewValue_2$    = "NewValue 2"
419cdf0e10cSrcweir        sNewValue_3$    = "NewValue 3"
420cdf0e10cSrcweir        sNewValue_4$    = "NewValue 4"
421cdf0e10cSrcweir        sNewValue_5$    = "NewValue 5"
422cdf0e10cSrcweir
423cdf0e10cSrcweir        aDocumentProperties.replaceByName ( sItemName_1$, sNewValue_1$ )
424cdf0e10cSrcweir        aDocumentProperties.replaceByName ( sItemName_2$, sNewValue_2$ )
425cdf0e10cSrcweir        aDocumentProperties.replaceByName ( sItemName_3$, sNewValue_3$ )
426cdf0e10cSrcweir        aDocumentProperties.replaceByName ( sItemName_4$, sNewValue_4$ )
427cdf0e10cSrcweir        aDocumentProperties.replaceByName ( sItemName_5$, sNewValue_5$ )
428cdf0e10cSrcweir
429cdf0e10cSrcweir        ' Zur Kontrolle die Werte ausgeben. (Nur wichtig, wenn geloggt wird!)
430cdf0e10cSrcweir        ShowNameContainer ( aDocumentProperties )
431cdf0e10cSrcweir
432cdf0e10cSrcweir        ' Dann die Werte wieder auslesen.
433cdf0e10cSrcweir        sCompareValue_1$ = aDocumentProperties.getByName ( sItemName_1$ )
434cdf0e10cSrcweir        sCompareValue_2$ = aDocumentProperties.getByName ( sItemName_2$ )
435cdf0e10cSrcweir        sCompareValue_3$ = aDocumentProperties.getByName ( sItemName_3$ )
436cdf0e10cSrcweir        sCompareValue_4$ = aDocumentProperties.getByName ( sItemName_4$ )
437cdf0e10cSrcweir        sCompareValue_5$ = aDocumentProperties.getByName ( sItemName_5$ )
438cdf0e10cSrcweir
439cdf0e10cSrcweir        ' Zum Vergleich die Werte ausgeben. (Nur wichtig, wenn geloggt wird!)
440cdf0e10cSrcweir        ShowNameContainer ( aDocumentProperties )
441cdf0e10cSrcweir
442cdf0e10cSrcweir        ' Dann die Werte automatisch vergleichen!
443cdf0e10cSrcweir        if ( CompareOWString        ( sNewValue_1$, sCompareValue_1$ ) = cDifferent ) then
444cdf0e10cSrcweir            ErrorMessage    ( "replaceByName() ... Fehler [Element 1 fehlerhaft]" )
445cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
446cdf0e10cSrcweir        elseif ( CompareOWString    ( sNewValue_2$, sCompareValue_2$ ) = cDifferent ) then
447cdf0e10cSrcweir            ErrorMessage    ( "replaceByName() ... Fehler [Element 2 fehlerhaft]" )
448cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
449cdf0e10cSrcweir        elseif ( CompareOWString    ( sNewValue_3$, sCompareValue_3$ ) = cDifferent ) then
450cdf0e10cSrcweir            ErrorMessage    ( "replaceByName() ... Fehler [Element 3 fehlerhaft]" )
451cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
452cdf0e10cSrcweir        elseif ( CompareOWString    ( sNewValue_4$, sCompareValue_4$ ) = cDifferent ) then
453cdf0e10cSrcweir            ErrorMessage    ( "replaceByName() ... Fehler [Element 4 fehlerhaft]" )
454cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
455cdf0e10cSrcweir        elseif ( CompareOWString    ( sNewValue_5$, sCompareValue_5$ ) = cDifferent ) then
456cdf0e10cSrcweir            ErrorMessage    ( "replaceByName() ... Fehler [Element 5 fehlerhaft]" )
457cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
458cdf0e10cSrcweir        end if
459cdf0e10cSrcweir
460cdf0e10cSrcweir        InfoMessage ( "replaceByName() ... OK" )
461cdf0e10cSrcweir
462cdf0e10cSrcweir        ' Hier sollen einige der 5 Eintraege geloescht werden.
463cdf0e10cSrcweir        aDocumentProperties.removeByName ( sItemName_1$ )
464cdf0e10cSrcweir        aDocumentProperties.removeByName ( sItemName_3$ )
465cdf0e10cSrcweir
466cdf0e10cSrcweir        ' Dann wieder die Anzahl kontrollieren.
467cdf0e10cSrcweir        ' (Hier wird eine eigene BASIC-Hilfsfunktion verwendet! keine Interface-Methode)
468cdf0e10cSrcweir        if ( getNameContainerCount ( aDocumentProperties ) <> 3 ) then
469cdf0e10cSrcweir            ErrorMessage ( "removeByName() ... Fehler (Der NameConatiner enthaelt nicht die erwarteten 3 Elemente!)" )
470cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
471cdf0e10cSrcweir        end if
472cdf0e10cSrcweir
473cdf0e10cSrcweir        ' Nun noch feststellen, ob die restlichen 3 denn auch tatsaechlich die richtigen sind.
474cdf0e10cSrcweir        if ( aDocumentProperties.hasByName ( sItemName_2$ ) = FALSE ) then
475cdf0e10cSrcweir            ErrorMessage    ( "removeByName() ... Fehler [Element 2 nicht vorhanden!?]" )
476cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
477cdf0e10cSrcweir        elseif ( aDocumentProperties.hasByName ( sItemName_4$ ) = FALSE ) then
478cdf0e10cSrcweir            ErrorMessage    ( "removeByName() ... Fehler [Element 4 nicht vorhanden!?]" )
479cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
480cdf0e10cSrcweir        elseif ( aDocumentProperties.hasByName ( sItemName_5$ ) = FALSE ) then
481cdf0e10cSrcweir            ErrorMessage    ( "removeByName() ... Fehler [Element 5 nicht vorhanden!?]" )
482cdf0e10cSrcweir            goto Test_NormalUse_XNameContainer_Error
483cdf0e10cSrcweir        end if
484cdf0e10cSrcweir
485cdf0e10cSrcweir        ' Zur Kontrolle die Werte nochmals ausgeben. (Nur wichtig, wenn geloggt wird!)
486cdf0e10cSrcweir        ShowNameContainer ( aDocumentProperties )
487cdf0e10cSrcweir
488cdf0e10cSrcweir        InfoMessage ( "removeByName() ... OK" )
489cdf0e10cSrcweir
490cdf0e10cSrcweir        ' Der Test war erfolgreich! Meldung ausgeben und zurueck zm Aufrufer.
491cdf0e10cSrcweir        ' Ausschalten der Fehlerbehandlung
492cdf0e10cSrcweir        on Error goto 0
493cdf0e10cSrcweir        ' Meldung ausgeben
494cdf0e10cSrcweir        InfoMessage ( "Test_NormalUse_XNameContainer ... [ende]" )
495cdf0e10cSrcweir        ' Status setzen
496cdf0e10cSrcweir        Test_NormalUse_XNameContainer = cOK
497cdf0e10cSrcweir        ' Und Funktion beenden
498cdf0e10cSrcweir        Exit Function
499cdf0e10cSrcweir
500cdf0e10cSrcweir' Es ist ein unerwartete Fehler aufgetreten! (Exception ...)
501cdf0e10cSrcweir' Meldung ausgeben und mit Fehler zurueckkehren.
502cdf0e10cSrcweirTest_NormalUse_XNameContainer_Error:
503cdf0e10cSrcweir        ' Ausschalten der Fehlerbehandlung
504cdf0e10cSrcweir        on Error goto 0
505cdf0e10cSrcweir        ' Meldung ausgeben
506cdf0e10cSrcweir        ErrorMessage ( "Test_NormalUse_XNameContainer ... [Error]" )
507cdf0e10cSrcweir        ' und Fehlerstatus setzen
508cdf0e10cSrcweir        Test_NormalUse_XNameContainer = cError
509cdf0e10cSrcweir        ' Abbruch der Funktion erzwingen!
510cdf0e10cSrcweir        Exit Function
511cdf0e10cSrcweir
512cdf0e10cSrcweirEnd Function
513cdf0e10cSrcweir
514cdf0e10cSrcweir'----------------------------------------------------------------------------
515cdf0e10cSrcweir' Testmethode: Testen des unterstuetzten Interfaces "XPersist" unter normalen Bedingungen
516cdf0e10cSrcweir'
517cdf0e10cSrcweir' Returnwert = cOK      ; wenn der Test erfolgreich war
518cdf0e10cSrcweir' Returnwert = cError   ; wenn sich das Objekt nicht korrekt verhalten hat
519cdf0e10cSrcweir'----------------------------------------------------------------------------
520cdf0e10cSrcweirFunction Test_NormalUse_XPersist ( aDocumentProperties ) as Boolean
521cdf0e10cSrcweir
522cdf0e10cSrcweir        ' Einschalten der Fehlerbehandlung, um Exceptions oder aehnliches abzufangen!
523cdf0e10cSrcweir        on Error goto Test_NormalUse_XPersist_Error
524cdf0e10cSrcweir
525cdf0e10cSrcweir        InfoMessage ( "Test_NormalUse_XPersist ... [start]" )
526cdf0e10cSrcweir
527cdf0e10cSrcweir        ' Laden der Properties aus einer Datei
528cdf0e10cSrcweir        aDocumentProperties.read ( cTestPath + "TestDebug_in.sdw" )
529cdf0e10cSrcweir
530cdf0e10cSrcweir        ' Zur Kontrolle anzeigen
531cdf0e10cSrcweir        ShowProperties ( aDocumentProperties )
532cdf0e10cSrcweir
533cdf0e10cSrcweir        ' Speichern der Properties in einer neuen Datei
534cdf0e10cSrcweir        aDocumentProperties.write   ( cTestPath + "TestDebug_Out.sdw" )
535cdf0e10cSrcweir        aDocumentProperties.read    ( cTestPath + "TestDebug_Out.sdw" )
536cdf0e10cSrcweir
537cdf0e10cSrcweir        ' Zur Kontrolle anzeigen
538cdf0e10cSrcweir        ShowProperties ( aDocumentProperties )
539cdf0e10cSrcweir
540cdf0e10cSrcweir        ' Der Test war erfolgreich! Meldung ausgeben und zurueck zm Aufrufer.
541cdf0e10cSrcweir        ' Ausschalten der Fehlerbehandlung
542cdf0e10cSrcweir        on Error goto 0
543cdf0e10cSrcweir        ' Meldung ausgeben
544cdf0e10cSrcweir        InfoMessage ( "Test_NormalUse_XPersist ... [ende]" )
545cdf0e10cSrcweir        ' Status setzen
546cdf0e10cSrcweir        Test_NormalUse_XPersist = cOK
547cdf0e10cSrcweir        ' Und Funktion beenden
548cdf0e10cSrcweir        Exit Function
549cdf0e10cSrcweir
550cdf0e10cSrcweir' Es ist ein unerwartete Fehler aufgetreten! (Exception ...)
551cdf0e10cSrcweir' Meldung ausgeben und mit Fehler zurueckkehren.
552cdf0e10cSrcweirTest_NormalUse_XPersist_Error:
553cdf0e10cSrcweir        ' Ausschalten der Fehlerbehandlung
554cdf0e10cSrcweir        on Error goto 0
555cdf0e10cSrcweir        ' Meldung ausgeben
556cdf0e10cSrcweir        ErrorMessage ( "Test_NormalUse_XPersist ... [Error]" )
557cdf0e10cSrcweir        ' und Fehlerstatus setzen
558cdf0e10cSrcweir        Test_NormalUse_XPersist = cError
559cdf0e10cSrcweir        ' Abbruch der Funktion erzwingen!
560cdf0e10cSrcweir        Exit Function
561cdf0e10cSrcweir
562cdf0e10cSrcweirEnd Function
563cdf0e10cSrcweir
564cdf0e10cSrcweir'*****************************************************************************************************************
565cdf0e10cSrcweir' Hilfsfunktionen und -methoden
566cdf0e10cSrcweir'*****************************************************************************************************************
567cdf0e10cSrcweir
568cdf0e10cSrcweir'----------------------------------------------------------------------------
569cdf0e10cSrcweir' Hilfsmethode: Oeffnet die LOG-Datei.
570cdf0e10cSrcweir'----------------------------------------------------------------------------
571cdf0e10cSrcweirSub OpenLOG ( sFileName$ )
572cdf0e10cSrcweir        if ( bLOGOn = cOn ) then
573cdf0e10cSrcweir            sLOGFileName$   = sFileName$
574cdf0e10cSrcweir            nLOGFileHandle% = FreeFile
575cdf0e10cSrcweir            open sLOGFileName$ for output as nLOGFileHandle%
576cdf0e10cSrcweir        end if
577cdf0e10cSrcweirEnd Sub
578cdf0e10cSrcweir
579cdf0e10cSrcweir'----------------------------------------------------------------------------
580cdf0e10cSrcweir' Hilfsmethode: Schliesst die LOG-Datei.
581cdf0e10cSrcweir'----------------------------------------------------------------------------
582cdf0e10cSrcweirSub CloseLOG
583cdf0e10cSrcweir        if ( bLOGOn = cOn ) then
584cdf0e10cSrcweir            close #nLOGFileHandle%
585cdf0e10cSrcweir        end if
586cdf0e10cSrcweirEnd Sub
587cdf0e10cSrcweir
588cdf0e10cSrcweir'----------------------------------------------------------------------------
589cdf0e10cSrcweir' Hilfsmethode: Gibt einen Text in einer LOG-Datei aus.
590cdf0e10cSrcweir'----------------------------------------------------------------------------
591cdf0e10cSrcweirSub WriteLOG ( sMessage$ )
592cdf0e10cSrcweir        if ( bLOGOn = cOn ) then
593cdf0e10cSrcweir            Write #nLOGFileHandle% sMessage$
594cdf0e10cSrcweir        end if
595cdf0e10cSrcweirEnd Sub
596cdf0e10cSrcweir
597cdf0e10cSrcweir'----------------------------------------------------------------------------
598cdf0e10cSrcweir' Hilfsmethode: Gibt eine MessageBox mit Fehlertext, Zeilennummer und Warnschild aus.
599cdf0e10cSrcweir'----------------------------------------------------------------------------
600cdf0e10cSrcweirSub ErrorMessage ( sMessage$ )
601cdf0e10cSrcweir        ' Entweder in die LOG-Datei schreiben oder eine MessageBox anzeigen.
602cdf0e10cSrcweir        if ( bLOGOn = cOn ) then
603cdf0e10cSrcweir            WriteLOG ( sMessage$ )
604cdf0e10cSrcweir        else
605cdf0e10cSrcweir            MsgBox ( sMessage$, 16 )
606cdf0e10cSrcweir        end if
607cdf0e10cSrcweirEnd Sub
608cdf0e10cSrcweir
609cdf0e10cSrcweir'----------------------------------------------------------------------------
610cdf0e10cSrcweir' Hilfsmethode: Gibt eine Hinweisbox aus.
611cdf0e10cSrcweir'----------------------------------------------------------------------------
612cdf0e10cSrcweirSub InfoMessage ( sMessage$ )
613cdf0e10cSrcweir        ' Nur was anzeigen, wenn Nutzer es wuenscht!
614cdf0e10cSrcweir        if ( bShowErrorsOnly = cOff ) then
615cdf0e10cSrcweir            ' Ansonsten wird entweder in die LOG-Datei geschrieben oder eine MessageBox angezeigt.
616cdf0e10cSrcweir            if ( bLOGOn = cOn ) then
617cdf0e10cSrcweir                WriteLOG ( sMessage$ )
618cdf0e10cSrcweir            else
619cdf0e10cSrcweir                MsgBox ( sMessage$, 64 )
620cdf0e10cSrcweir            end if
621cdf0e10cSrcweir        end if
622cdf0e10cSrcweirEnd Sub
623cdf0e10cSrcweir
624cdf0e10cSrcweir'----------------------------------------------------------------------------
625cdf0e10cSrcweir' Hilfsfunktion: Vergleicht zwei OWString-Werte
626cdf0e10cSrcweir'
627cdf0e10cSrcweir' Returnwert = cEqual       ; wenn Werte identisch sind
628cdf0e10cSrcweir' Returnwert = cDifferent   ; wenn Werte verschieden sind
629cdf0e10cSrcweir'----------------------------------------------------------------------------
630cdf0e10cSrcweirFunction CompareOWString ( sOWString_1$, sOWString_2$ ) as Boolean
631cdf0e10cSrcweir
632cdf0e10cSrcweir        if ( sOWString_1$ = sOWString_2$ ) then
633cdf0e10cSrcweir            CompareOWString = cEqual
634cdf0e10cSrcweir        else
635cdf0e10cSrcweir            CompareOWString = cDifferent
636cdf0e10cSrcweir        end if
637cdf0e10cSrcweir
638cdf0e10cSrcweirEnd Function
639cdf0e10cSrcweir
640cdf0e10cSrcweir'----------------------------------------------------------------------------
641cdf0e10cSrcweir' Hilfsfunktion: Vergleicht zwei DateTime-Strukturen
642cdf0e10cSrcweir'
643cdf0e10cSrcweir' Returnwert = cEqual       ; wenn Werte identisch sind
644cdf0e10cSrcweir' Returnwert = cDifferent   ; wenn Werte verschieden sind
645cdf0e10cSrcweir'----------------------------------------------------------------------------
646cdf0e10cSrcweirFunction CompareDateTime ( aDateTime_1, aDateTime_2 ) as Boolean
647cdf0e10cSrcweir
648cdf0e10cSrcweir        if ( aDateTime_1.Day = aDateTime_2.Day and aDateTime_1.Month = aDateTime_2.Month and aDateTime_1.Year = aDateTime_2.Year and aDateTime_1.Hours = aDateTime_1.Hours and aDateTime_1.Minutes = aDateTime_1.Minutes and aDateTime_1.Seconds = aDateTime_1.Seconds and aDateTime_1.HundredthSeconds = aDateTime_1.HundredthSeconds ) then
649cdf0e10cSrcweir            CompareDateTime = cEqual
650cdf0e10cSrcweir        else
651cdf0e10cSrcweir            CompareDateTime = cDifferent
652cdf0e10cSrcweir        end if
653cdf0e10cSrcweir
654cdf0e10cSrcweirEnd Function
655cdf0e10cSrcweir
656cdf0e10cSrcweir'----------------------------------------------------------------------------
657cdf0e10cSrcweir' Hilfsfunktion: Vergleicht zwei ByteSequence's
658cdf0e10cSrcweir'
659cdf0e10cSrcweir' Returnwert = cEqual       ; wenn Werte identisch sind
660cdf0e10cSrcweir' Returnwert = cDifferent   ; wenn Werte verschieden sind
661cdf0e10cSrcweir'----------------------------------------------------------------------------
662cdf0e10cSrcweirFunction CompareByteSequence ( seqByteSequence_1, seqByteSequence_2 ) as Boolean
663cdf0e10cSrcweir
664cdf0e10cSrcweir        ' Wenn beide leer sind, sind sie auch identisch !
665cdf0e10cSrcweir        ' Dieser Test mit "IsArray" ist noetig, da bei einem leeren Array die
666cdf0e10cSrcweir        ' Funktion "UBound" einen Fehler produziert!
667cdf0e10cSrcweir        if ( IsArray ( seqByteSequence_1 ) = FALSE and IsArray ( seqByteSequence_2 ) = FALSE ) then
668cdf0e10cSrcweir            CompareByteSequence = cEqual
669cdf0e10cSrcweir            Exit Function
670cdf0e10cSrcweir        end if
671cdf0e10cSrcweir
672cdf0e10cSrcweir        ' Wenn jedoch nur eine leer ist, dann sind sie nicht identisch.
673cdf0e10cSrcweir        if ( IsArray ( seqByteSequence_1 ) = FALSE ) or ( IsArray ( seqByteSequence_2 ) = FALSE ) then
674cdf0e10cSrcweir            CompareByteSequence = cDifferent
675cdf0e10cSrcweir            Exit Function
676cdf0e10cSrcweir        end if
677cdf0e10cSrcweir
678cdf0e10cSrcweir        ' Besorgen der Anzahl der Elemente der Sequences
679cdf0e10cSrcweir        nElementCount_1%    =   UBound ( seqByteSequence_1 )
680cdf0e10cSrcweir        nElementCount_2%    =   UBound ( seqByteSequence_2 )
681cdf0e10cSrcweir
682cdf0e10cSrcweir        ' Wenn diese Anzahl schon verschieden ist, dann ...
683cdf0e10cSrcweir        if ( nElementCount_1% <> nElementCount_2% ) then
684cdf0e10cSrcweir            ' ... sind die Sequences wohl verschieden.
685cdf0e10cSrcweir            CompareByteSequence = cDifferent
686cdf0e10cSrcweir            ' Die Element brauchen dann nicht mehr verglichen zu werden.
687cdf0e10cSrcweir            Exit Function
688cdf0e10cSrcweir        end if
689cdf0e10cSrcweir
690cdf0e10cSrcweir        ' Ansonsten werden die Elemente einzeln miteinander verglichen.
691cdf0e10cSrcweir        for nCounter%=0 to nElementCount_1% step 1
692cdf0e10cSrcweir            ' Wenn auch nur ein paar davon verschieden ist, dann ...
693cdf0e10cSrcweir            if ( nElementCount_1%(nCounter%) <> nElementCount_2%(nCounter%) ) then
694cdf0e10cSrcweir                ' ... kann der Vergleich abgebrochen werden!
695cdf0e10cSrcweir                CompareByteSequence = cDifferent
696cdf0e10cSrcweir                Exit Function
697cdf0e10cSrcweir            end if
698cdf0e10cSrcweir        next nCounter%
699cdf0e10cSrcweir
700cdf0e10cSrcweir        ' Wenn man bis hier gekommen ist, dann sind die Sequences identisch.
701cdf0e10cSrcweir        CompareByteSequence = cEqual
702cdf0e10cSrcweir
703cdf0e10cSrcweirEnd Function
704cdf0e10cSrcweir
705cdf0e10cSrcweir'----------------------------------------------------------------------------
706cdf0e10cSrcweir' Hilfsfunktion: Vergleicht zwei Int16-Werte
707cdf0e10cSrcweir'
708cdf0e10cSrcweir' Returnwert = cEqual       ; wenn Werte identisch sind
709cdf0e10cSrcweir' Returnwert = cDifferent   ; wenn Werte verschieden sind
710cdf0e10cSrcweir'----------------------------------------------------------------------------
711cdf0e10cSrcweirFunction CompareInt16 ( nInt16_1%, nInt16_2% ) as Boolean
712cdf0e10cSrcweir
713cdf0e10cSrcweir        if ( nInt16_1% = nInt16_2% ) then
714cdf0e10cSrcweir            CompareInt16 = cEqual
715cdf0e10cSrcweir        else
716cdf0e10cSrcweir            CompareInt16 = cDifferent
717cdf0e10cSrcweir        end if
718cdf0e10cSrcweir
719cdf0e10cSrcweirEnd Function
720cdf0e10cSrcweir
721cdf0e10cSrcweir'----------------------------------------------------------------------------
722cdf0e10cSrcweir' Hilfsfunktion: Vergleicht zwei Int32-Werte
723cdf0e10cSrcweir'
724cdf0e10cSrcweir' Returnwert = cEqual       ; wenn Werte identisch sind
725cdf0e10cSrcweir' Returnwert = cDifferent   ; wenn Werte verschieden sind
726cdf0e10cSrcweir'----------------------------------------------------------------------------
727cdf0e10cSrcweirFunction CompareInt32 ( nInt32_1&, nInt32_2& ) as Boolean
728cdf0e10cSrcweir
729cdf0e10cSrcweir        if ( nInt32_1& = nInt32_2& ) then
730cdf0e10cSrcweir            CompareInt32 = cEqual
731cdf0e10cSrcweir        else
732cdf0e10cSrcweir            CompareInt32 = cDifferent
733cdf0e10cSrcweir        end if
734cdf0e10cSrcweir
735cdf0e10cSrcweirEnd Function
736cdf0e10cSrcweir
737cdf0e10cSrcweir'----------------------------------------------------------------------------
738cdf0e10cSrcweir' Hilfsfunktion: Vergleicht zwei Bool-Werte
739cdf0e10cSrcweir'
740cdf0e10cSrcweir' Returnwert = cEqual       ; wenn Werte identisch sind
741cdf0e10cSrcweir' Returnwert = cDifferent   ; wenn Werte verschieden sind
742cdf0e10cSrcweir'----------------------------------------------------------------------------
743cdf0e10cSrcweirFunction CompareBool ( bBool_1, bBool_2 ) as Boolean
744cdf0e10cSrcweir
745cdf0e10cSrcweir        if ( bBool_1 = bBool_2 ) then
746cdf0e10cSrcweir            CompareBool = cEqual
747cdf0e10cSrcweir        else
748cdf0e10cSrcweir            CompareBool = cDifferent
749cdf0e10cSrcweir        end if
750cdf0e10cSrcweir
751cdf0e10cSrcweirEnd Function
752cdf0e10cSrcweir
753cdf0e10cSrcweir'----------------------------------------------------------------------------
754cdf0e10cSrcweir' Hilfsfunktion: Vergleicht die Properties zweier Objekte um Unterschiede festzustellen.
755cdf0e10cSrcweir'
756cdf0e10cSrcweir' Returnwert = cEqual       ; wenn Objekte von den Properties her identisch sind
757cdf0e10cSrcweir' Returnwert = cDifferent   ; wenn Objekte von den Properties her verschieden sind
758cdf0e10cSrcweir'----------------------------------------------------------------------------
759cdf0e10cSrcweirFunction CompareDocumentProperties ( aDocumentProperties_1, aDocumentProperties_2 ) as Boolean
760cdf0e10cSrcweir
761cdf0e10cSrcweir        ' Besorgen der Werte und zwischenspeichern (bezogen auf Objekt 1)
762cdf0e10cSrcweir        sAuthor_1$                  = aDocumentProperties_1.getPropertyValue ( "Author"                     )
763cdf0e10cSrcweir        bAutoloadEnabled_1          = aDocumentProperties_1.getPropertyValue ( "AutoloadEnabled"            )
764cdf0e10cSrcweir        nAutoloadSecs_1%            = aDocumentProperties_1.getPropertyValue ( "AutoloadSecs"               )
765cdf0e10cSrcweir        sAutoLoadURL_1$             = aDocumentProperties_1.getPropertyValue ( "AutoloadURL"                )
766cdf0e10cSrcweir        sBliendCopiesTo_1$          = aDocumentProperties_1.getPropertyValue ( "BlindCopiesTo"              )
767cdf0e10cSrcweir        sCopiesTo_1$                = aDocumentProperties_1.getPropertyValue ( "CopiesTo"                   )
768cdf0e10cSrcweir        aCreationDate_1             = aDocumentProperties_1.getPropertyValue ( "CreationDate"               )
769cdf0e10cSrcweir        sDefaultTarget_1$           = aDocumentProperties_1.getPropertyValue ( "DefaultTarget"              )
770cdf0e10cSrcweir        sDescription_1$             = aDocumentProperties_1.getPropertyValue ( "Description"                )
771cdf0e10cSrcweir        nEditingCycles_1%           = aDocumentProperties_1.getPropertyValue ( "EditingCycles"              )
772cdf0e10cSrcweir        nEditingDuration_1&         = aDocumentProperties_1.getPropertyValue ( "EditingDuration"            )
773cdf0e10cSrcweir        seqExtraData_1              = aDocumentProperties_1.getPropertyValue ( "ExtraData"                  )
774cdf0e10cSrcweir        sInReplyTo_1$               = aDocumentProperties_1.getPropertyValue ( "InReplyTo"                  )
775cdf0e10cSrcweir        bIsEncrypted_1              = aDocumentProperties_1.getPropertyValue ( "IsEncrypted"                )
776cdf0e10cSrcweir        sKeywords_1$                = aDocumentProperties_1.getPropertyValue ( "Keywords"                   )
777cdf0e10cSrcweir        sMIMEType_1$                = aDocumentProperties_1.getPropertyValue ( "MIMEType"                   )
778cdf0e10cSrcweir        sModifiedBy_1$              = aDocumentProperties_1.getPropertyValue ( "ModifiedBy"                 )
779cdf0e10cSrcweir        aModifyDate_1               = aDocumentProperties_1.getPropertyValue ( "ModifyDate"                 )
780cdf0e10cSrcweir        sNewsgroups_1$              = aDocumentProperties_1.getPropertyValue ( "Newsgroups"                 )
781cdf0e10cSrcweir        sOriginal_1$                = aDocumentProperties_1.getPropertyValue ( "Original"                   )
782cdf0e10cSrcweir        bPortableGraphics_1         = aDocumentProperties_1.getPropertyValue ( "PortableGraphics"           )
783cdf0e10cSrcweir        aPrintDate_1                = aDocumentProperties_1.getPropertyValue ( "PrintDate"                  )
784cdf0e10cSrcweir        sPrintedBy_1$               = aDocumentProperties_1.getPropertyValue ( "PrintedBy"                  )
785cdf0e10cSrcweir        nPriority_1%                = aDocumentProperties_1.getPropertyValue ( "Priority"                   )
786cdf0e10cSrcweir        bQueryTemplate_1            = aDocumentProperties_1.getPropertyValue ( "QueryTemplate"              )
787cdf0e10cSrcweir        sRecipient_1$               = aDocumentProperties_1.getPropertyValue ( "Recipient"                  )
788cdf0e10cSrcweir        sReferences_1$              = aDocumentProperties_1.getPropertyValue ( "References"                 )
789cdf0e10cSrcweir        sReplyTo_1$                 = aDocumentProperties_1.getPropertyValue ( "ReplyTo"                    )
790cdf0e10cSrcweir        bSaveGraphicsCompressed_1   = aDocumentProperties_1.getPropertyValue ( "SaveGraphicsCompressed"     )
791cdf0e10cSrcweir        bSaveOriginalGraphics_1     = aDocumentProperties_1.getPropertyValue ( "SaveOriginalGraphics"       )
792cdf0e10cSrcweir        bSaveVersionOnClose_1       = aDocumentProperties_1.getPropertyValue ( "SaveVersionOnClose"         )
793cdf0e10cSrcweir        sTemplate_1$                = aDocumentProperties_1.getPropertyValue ( "Template"                   )
794cdf0e10cSrcweir        bTemplateConfig_1           = aDocumentProperties_1.getPropertyValue ( "TemplateConfig"             )
795cdf0e10cSrcweir        aTemplateDate_1             = aDocumentProperties_1.getPropertyValue ( "TemplateDate"               )
796cdf0e10cSrcweir        sTemplateFileName_1$        = aDocumentProperties_1.getPropertyValue ( "TemplateFileName"           )
797cdf0e10cSrcweir        sTheme_1$                   = aDocumentProperties_1.getPropertyValue ( "Theme"                      )
798cdf0e10cSrcweir        sTitle_1$                   = aDocumentProperties_1.getPropertyValue ( "Title"                      )
799cdf0e10cSrcweir        bUserData_1                 = aDocumentProperties_1.getPropertyValue ( "UserData"                   )
800cdf0e10cSrcweir
801cdf0e10cSrcweir        ' Besorgen der Werte und zwischenspeichern (bezogen auf Objekt 2)
802cdf0e10cSrcweir        sAuthor_2$                  = aDocumentProperties_2.getPropertyValue ( "Author"                     )
803cdf0e10cSrcweir        bAutoloadEnabled_2          = aDocumentProperties_2.getPropertyValue ( "AutoloadEnabled"            )
804cdf0e10cSrcweir        nAutoloadSecs_2%            = aDocumentProperties_2.getPropertyValue ( "AutoloadSecs"               )
805cdf0e10cSrcweir        sAutoLoadURL_2$             = aDocumentProperties_2.getPropertyValue ( "AutoloadURL"                )
806cdf0e10cSrcweir        sBliendCopiesTo_2$          = aDocumentProperties_2.getPropertyValue ( "BlindCopiesTo"              )
807cdf0e10cSrcweir        sCopiesTo_2$                = aDocumentProperties_2.getPropertyValue ( "CopiesTo"                   )
808cdf0e10cSrcweir        aCreationDate_2             = aDocumentProperties_2.getPropertyValue ( "CreationDate"               )
809cdf0e10cSrcweir        sDefaultTarget_2$           = aDocumentProperties_2.getPropertyValue ( "DefaultTarget"              )
810cdf0e10cSrcweir        sDescription_2$             = aDocumentProperties_2.getPropertyValue ( "Description"                )
811cdf0e10cSrcweir        nEditingCycles_2%           = aDocumentProperties_2.getPropertyValue ( "EditingCycles"              )
812cdf0e10cSrcweir        nEditingDuration_2&         = aDocumentProperties_2.getPropertyValue ( "EditingDuration"            )
813cdf0e10cSrcweir        seqExtraData_2              = aDocumentProperties_2.getPropertyValue ( "ExtraData"                  )
814cdf0e10cSrcweir        sInReplyTo_2$               = aDocumentProperties_2.getPropertyValue ( "InReplyTo"                  )
815cdf0e10cSrcweir        bIsEncrypted_2              = aDocumentProperties_2.getPropertyValue ( "IsEncrypted"                )
816cdf0e10cSrcweir        sKeywords_2$                = aDocumentProperties_2.getPropertyValue ( "Keywords"                   )
817cdf0e10cSrcweir        sMIMEType_2$                = aDocumentProperties_2.getPropertyValue ( "MIMEType"                   )
818cdf0e10cSrcweir        sModifiedBy_2$              = aDocumentProperties_2.getPropertyValue ( "ModifiedBy"                 )
819cdf0e10cSrcweir        aModifyDate_2               = aDocumentProperties_2.getPropertyValue ( "ModifyDate"                 )
820cdf0e10cSrcweir        sNewsgroups_2$              = aDocumentProperties_2.getPropertyValue ( "Newsgroups"                 )
821cdf0e10cSrcweir        sOriginal_2$                = aDocumentProperties_2.getPropertyValue ( "Original"                   )
822cdf0e10cSrcweir        bPortableGraphics_2         = aDocumentProperties_2.getPropertyValue ( "PortableGraphics"           )
823cdf0e10cSrcweir        aPrintDate_2                = aDocumentProperties_2.getPropertyValue ( "PrintDate"                  )
824cdf0e10cSrcweir        sPrintedBy_2$               = aDocumentProperties_2.getPropertyValue ( "PrintedBy"                  )
825cdf0e10cSrcweir        nPriority_2%                = aDocumentProperties_2.getPropertyValue ( "Priority"                   )
826cdf0e10cSrcweir        bQueryTemplate_2            = aDocumentProperties_2.getPropertyValue ( "QueryTemplate"              )
827cdf0e10cSrcweir        sRecipient_2$               = aDocumentProperties_2.getPropertyValue ( "Recipient"                  )
828cdf0e10cSrcweir        sReferences_2$              = aDocumentProperties_2.getPropertyValue ( "References"                 )
829cdf0e10cSrcweir        sReplyTo_2$                 = aDocumentProperties_2.getPropertyValue ( "ReplyTo"                    )
830cdf0e10cSrcweir        bSaveGraphicsCompressed_2   = aDocumentProperties_2.getPropertyValue ( "SaveGraphicsCompressed"     )
831cdf0e10cSrcweir        bSaveOriginalGraphics_2     = aDocumentProperties_2.getPropertyValue ( "SaveOriginalGraphics"       )
832cdf0e10cSrcweir        bSaveVersionOnClose_2       = aDocumentProperties_2.getPropertyValue ( "SaveVersionOnClose"         )
833cdf0e10cSrcweir        sTemplate_2$                = aDocumentProperties_2.getPropertyValue ( "Template"                   )
834cdf0e10cSrcweir        bTemplateConfig_2           = aDocumentProperties_2.getPropertyValue ( "TemplateConfig"             )
835cdf0e10cSrcweir        aTemplateDate_2             = aDocumentProperties_2.getPropertyValue ( "TemplateDate"               )
836cdf0e10cSrcweir        sTemplateFileName_2$        = aDocumentProperties_2.getPropertyValue ( "TemplateFileName"           )
837cdf0e10cSrcweir        sTheme_2$                   = aDocumentProperties_2.getPropertyValue ( "Theme"                      )
838cdf0e10cSrcweir        sTitle_2$                   = aDocumentProperties_2.getPropertyValue ( "Title"                      )
839cdf0e10cSrcweir        bUserData_2                 = aDocumentProperties_2.getPropertyValue ( "UserData"                   )
840cdf0e10cSrcweir
841cdf0e10cSrcweir        ' Als erwarteten Zielwert schon mal "Properties identisch" annehmen!!!
842cdf0e10cSrcweir        ' F�r den Fall, das nur eine diesen Anspruch nicht erf�llt, wird der Wert einfach zur�ckgesetzt.
843cdf0e10cSrcweir        ' Von da bleibt der neue Wert bestehen und zeigt an, da� sich mindestens eine Property ge�ndert hat!
844cdf0e10cSrcweir        CompareDocumentProperties = cEqual
845cdf0e10cSrcweir
846cdf0e10cSrcweir        ' Dann die Werte vergleichen
847cdf0e10cSrcweir        if ( CompareOWString        ( sAuthor_1$,                   sAuthor_2$                  ) = cDifferent ) then
848cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
849cdf0e10cSrcweir        elseif ( CompareBool        ( bAutoloadEnabled_1,           bAutoloadEnabled_2          ) = cDifferent ) then
850cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
851cdf0e10cSrcweir        elseif ( CompareInt16       ( nAutoloadSecs_1%,             nAutoloadSecs_2%            ) = cDifferent ) then
852cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
853cdf0e10cSrcweir        elseif ( CompareOWString    ( sAutoLoadURL_1$,              sAutoLoadURL_2$             ) = cDifferent ) then
854cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
855cdf0e10cSrcweir        elseif ( CompareOWString    ( sBliendCopiesTo_1$,           sBliendCopiesTo_2$          ) = cDifferent ) then
856cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
857cdf0e10cSrcweir        elseif ( CompareOWString    ( sCopiesTo_1$,                 sCopiesTo_2$                ) = cDifferent ) then
858cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
859cdf0e10cSrcweir        elseif ( CompareDateTime    ( aCreationDate_1,              aCreationDate_2             ) = cDifferent ) then
860cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
861cdf0e10cSrcweir        elseif ( CompareOWString    ( sDefaultTarget_1$,            sDefaultTarget_2$           ) = cDifferent ) then
862cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
863cdf0e10cSrcweir        elseif ( CompareOWString    ( sDescription_1$,              sDescription_2$             ) = cDifferent ) then
864cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
865cdf0e10cSrcweir        elseif ( CompareInt16       ( nEditingCycles_1%,            nEditingCycles_2%           ) = cDifferent ) then
866cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
867cdf0e10cSrcweir        elseif ( CompareInt32       ( nEditingDuration_1&,          nEditingDuration_2&         ) = cDifferent ) then
868cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
869cdf0e10cSrcweir        elseif ( CompareByteSequence( seqExtraData_1,               seqExtraData_2              ) = cDifferent ) then
870cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
871cdf0e10cSrcweir        elseif ( CompareOWString    ( sInReplyTo_1$,                sInReplyTo_2$               ) = cDifferent ) then
872cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
873cdf0e10cSrcweir        elseif ( CompareBool        ( bIsEncrypted_1,               bIsEncrypted_2              ) = cDifferent ) then
874cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
875cdf0e10cSrcweir        elseif ( CompareOWString    ( sKeywords_1$,                 sKeywords_2$                ) = cDifferent ) then
876cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
877cdf0e10cSrcweir        elseif ( CompareOWString    ( sMIMEType_1$,                 sMIMEType_2$                ) = cDifferent ) then
878cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
879cdf0e10cSrcweir        elseif ( CompareOWString    ( sModifiedBy_1$,               sModifiedBy_2$              ) = cDifferent ) then
880cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
881cdf0e10cSrcweir        elseif ( CompareDateTime    ( aModifyDate_1,                aModifyDate_2               ) = cDifferent ) then
882cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
883cdf0e10cSrcweir        elseif ( CompareOWString    ( sNewsgroups_1$,               sNewsgroups_2$              ) = cDifferent ) then
884cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
885cdf0e10cSrcweir        elseif ( CompareOWString    ( sOriginal_1$,                 sOriginal_2$                ) = cDifferent ) then
886cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
887cdf0e10cSrcweir        elseif ( CompareBool        ( bPortableGraphics_1,          bPortableGraphics_2         ) = cDifferent ) then
888cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
889cdf0e10cSrcweir        elseif ( CompareDateTime    ( aPrintDate_1,                 aPrintDate_2                ) = cDifferent ) then
890cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
891cdf0e10cSrcweir        elseif ( CompareOWString    ( sPrintedBy_1$,                sPrintedBy_2$               ) = cDifferent ) then
892cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
893cdf0e10cSrcweir        elseif ( CompareInt16       ( nPriority_1%,                 nPriority_2%                ) = cDifferent ) then
894cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
895cdf0e10cSrcweir        elseif ( CompareBool        ( bQueryTemplate_1,             bQueryTemplate_2            ) = cDifferent ) then
896cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
897cdf0e10cSrcweir        elseif ( CompareOWString    ( sRecipient_1$,                sRecipient_2$               ) = cDifferent ) then
898cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
899cdf0e10cSrcweir        elseif ( CompareOWString    ( sReferences_1$,               sReferences_2$              ) = cDifferent ) then
900cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
901cdf0e10cSrcweir        elseif ( CompareOWString    ( sReplyTo_1$,                  sReplyTo_2$                 ) = cDifferent ) then
902cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
903cdf0e10cSrcweir        elseif ( CompareBool        ( bSaveGraphicsCompressed_1,    bSaveGraphicsCompressed_2   ) = cDifferent ) then
904cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
905cdf0e10cSrcweir        elseif ( CompareBool        ( bSaveOriginalGraphics_1,      bSaveOriginalGraphics_2     ) = cDifferent ) then
906cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
907cdf0e10cSrcweir        elseif ( CompareBool        ( bSaveVersionOnClose_1,        bSaveVersionOnClose_2       ) = cDifferent ) then
908cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
909cdf0e10cSrcweir        elseif ( CompareOWString    ( sTemplate_1$,                 sTemplate_2$                ) = cDifferent ) then
910cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
911cdf0e10cSrcweir        elseif ( CompareBool        ( bTemplateConfig_1,            bTemplateConfig_2           ) = cDifferent ) then
912cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
913cdf0e10cSrcweir        elseif ( CompareDateTime    ( aTemplateDate_1,              aTemplateDate_2             ) = cDifferent ) then
914cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
915cdf0e10cSrcweir        elseif ( CompareOWString    ( sTemplateFileName_1$,         sTemplateFileName_2$        ) = cDifferent ) then
916cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
917cdf0e10cSrcweir        elseif ( CompareOWString    ( sTheme_1$,                    sTheme_2$                   ) = cDifferent ) then
918cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
919cdf0e10cSrcweir        elseif ( CompareOWString    ( sTitle_1$,                    sTitle_2$                   ) = cDifferent ) then
920cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
921cdf0e10cSrcweir        elseif ( CompareBool        ( bUserData_1,                  bUserData_2                 ) = cDifferent ) then
922cdf0e10cSrcweir            CompareDocumentProperties = cDifferent
923cdf0e10cSrcweir        end if
924cdf0e10cSrcweir
925cdf0e10cSrcweirEnd Function
926cdf0e10cSrcweir
927cdf0e10cSrcweir'----------------------------------------------------------------------------
928cdf0e10cSrcweir' Hilfsfunktion: Wandelt eine Struktur des Types DateTime in einen formatierten String um
929cdf0e10cSrcweir'----------------------------------------------------------------------------
930cdf0e10cSrcweirFunction DateTime2String ( aDateTime ) as String
931cdf0e10cSrcweir
932cdf0e10cSrcweir        stempString$ = ""
933cdf0e10cSrcweir        stempString$ = stempString$ + aDateTime.Day                 + "."
934cdf0e10cSrcweir        stempString$ = stempString$ + aDateTime.Month               + "."
935cdf0e10cSrcweir        stempString$ = stempString$ + aDateTime.Year                + " - "
936cdf0e10cSrcweir        stempString$ = stempString$ + aDateTime.Hours               + ":"
937cdf0e10cSrcweir        stempString$ = stempString$ + aDateTime.Minutes             + ":"
938cdf0e10cSrcweir        stempString$ = stempString$ + aDateTime.Seconds             + ":"
939cdf0e10cSrcweir        stempString$ = stempString$ + aDateTime.HundredthSeconds    + " Uhr"
940cdf0e10cSrcweir
941cdf0e10cSrcweir        DateTime2String = stempString$
942cdf0e10cSrcweir
943cdf0e10cSrcweirEnd Function
944cdf0e10cSrcweir
945cdf0e10cSrcweir'----------------------------------------------------------------------------
946cdf0e10cSrcweir' Hilfsfunktion: Wandelt eine Sequence von Bytes in einen formatierten String um
947cdf0e10cSrcweir'----------------------------------------------------------------------------
948cdf0e10cSrcweirFunction ByteSequence2String ( seqByteSequence ) as String
949cdf0e10cSrcweir
950cdf0e10cSrcweir        nElementCount% = UBound ( seqByteSequence() )
951cdf0e10cSrcweir
952cdf0e10cSrcweir        if ( nElementCount% < 1 ) then
953cdf0e10cSrcweir            stempString$ = "leer"
954cdf0e10cSrcweir        else
955cdf0e10cSrcweir            stempString$ = "{"
956cdf0e10cSrcweir            for nCounter%=0 to nElementCount% step 1
957cdf0e10cSrcweir                stempString$ = stempString$ + seqByteSequence(nCounter%)
958cdf0e10cSrcweir            next nCounter%
959cdf0e10cSrcweir            stempString$ = stempString$ + "}"
960cdf0e10cSrcweir        end if
961cdf0e10cSrcweir
962cdf0e10cSrcweir        ByteSequence2String = stempString$
963cdf0e10cSrcweir
964cdf0e10cSrcweirEnd Function
965cdf0e10cSrcweir
966cdf0e10cSrcweir'----------------------------------------------------------------------------
967cdf0e10cSrcweir' Hilfsmethode: Zeigt die aktuellen Werte ALLER Properties an
968cdf0e10cSrcweir'----------------------------------------------------------------------------
969cdf0e10cSrcweirSub ShowProperties ( aDocumentProperties )
970cdf0e10cSrcweir
971cdf0e10cSrcweir        ' Besorgen der Werte und zwischenspeichern
972cdf0e10cSrcweir        sAuthor$                = aDocumentProperties.getPropertyValue ( "Author"                   )
973cdf0e10cSrcweir        bAutoloadEnabled        = aDocumentProperties.getPropertyValue ( "AutoloadEnabled"          )
974cdf0e10cSrcweir        nAutoloadSecs%          = aDocumentProperties.getPropertyValue ( "AutoloadSecs"             )
975cdf0e10cSrcweir        sAutoLoadURL$           = aDocumentProperties.getPropertyValue ( "AutoloadURL"              )
976cdf0e10cSrcweir        sBliendCopiesTo$        = aDocumentProperties.getPropertyValue ( "BlindCopiesTo"            )
977cdf0e10cSrcweir        sCopiesTo$              = aDocumentProperties.getPropertyValue ( "CopiesTo"                 )
978cdf0e10cSrcweir        dCreationDate           = aDocumentProperties.getPropertyValue ( "CreationDate"             )
979cdf0e10cSrcweir        sDefaultTarget$         = aDocumentProperties.getPropertyValue ( "DefaultTarget"            )
980cdf0e10cSrcweir        sDescription$           = aDocumentProperties.getPropertyValue ( "Description"              )
981cdf0e10cSrcweir        nEditingCycles%         = aDocumentProperties.getPropertyValue ( "EditingCycles"            )
982cdf0e10cSrcweir        nEditingDuration&       = aDocumentProperties.getPropertyValue ( "EditingDuration"          )
983cdf0e10cSrcweir        seqExtraData            = aDocumentProperties.getPropertyValue ( "ExtraData"                )
984cdf0e10cSrcweir        sInReplyTo$             = aDocumentProperties.getPropertyValue ( "InReplyTo"                )
985cdf0e10cSrcweir        bIsEncrypted            = aDocumentProperties.getPropertyValue ( "IsEncrypted"              )
986cdf0e10cSrcweir        sKeywords$              = aDocumentProperties.getPropertyValue ( "Keywords"                 )
987cdf0e10cSrcweir        sMIMEType$              = aDocumentProperties.getPropertyValue ( "MIMEType"                 )
988cdf0e10cSrcweir        sModifiedBy$            = aDocumentProperties.getPropertyValue ( "ModifiedBy"               )
989cdf0e10cSrcweir        dModifyDate             = aDocumentProperties.getPropertyValue ( "ModifyDate"               )
990cdf0e10cSrcweir        sNewsgroups$            = aDocumentProperties.getPropertyValue ( "Newsgroups"               )
991cdf0e10cSrcweir        sOriginal$              = aDocumentProperties.getPropertyValue ( "Original"                 )
992cdf0e10cSrcweir        bPortableGraphics       = aDocumentProperties.getPropertyValue ( "PortableGraphics"         )
993cdf0e10cSrcweir        dPrintDate              = aDocumentProperties.getPropertyValue ( "PrintDate"                )
994cdf0e10cSrcweir        sPrintedBy$             = aDocumentProperties.getPropertyValue ( "PrintedBy"                )
995cdf0e10cSrcweir        nPriority%              = aDocumentProperties.getPropertyValue ( "Priority"                 )
996cdf0e10cSrcweir        bQueryTemplate          = aDocumentProperties.getPropertyValue ( "QueryTemplate"            )
997cdf0e10cSrcweir        sRecipient$             = aDocumentProperties.getPropertyValue ( "Recipient"                )
998cdf0e10cSrcweir        sReferences$            = aDocumentProperties.getPropertyValue ( "References"               )
999cdf0e10cSrcweir        sReplyTo$               = aDocumentProperties.getPropertyValue ( "ReplyTo"                  )
1000cdf0e10cSrcweir        bSaveGraphicsCompressed = aDocumentProperties.getPropertyValue ( "SaveGraphicsCompressed"   )
1001cdf0e10cSrcweir        bSaveOriginalGraphics   = aDocumentProperties.getPropertyValue ( "SaveOriginalGraphics"     )
1002cdf0e10cSrcweir        bSaveVersionOnClose     = aDocumentProperties.getPropertyValue ( "SaveVersionOnClose"       )
1003cdf0e10cSrcweir        sTemplate$              = aDocumentProperties.getPropertyValue ( "Template"                 )
1004cdf0e10cSrcweir        bTemplateConfig         = aDocumentProperties.getPropertyValue ( "TemplateConfig"           )
1005cdf0e10cSrcweir        dTemplateDate           = aDocumentProperties.getPropertyValue ( "TemplateDate"             )
1006cdf0e10cSrcweir        sTemplateFileName$      = aDocumentProperties.getPropertyValue ( "TemplateFileName"         )
1007cdf0e10cSrcweir        sTheme$                 = aDocumentProperties.getPropertyValue ( "Theme"                    )
1008cdf0e10cSrcweir        sTitle$                 = aDocumentProperties.getPropertyValue ( "Title"                    )
1009cdf0e10cSrcweir        bUserData               = aDocumentProperties.getPropertyValue ( "UserData"                 )
1010cdf0e10cSrcweir
1011cdf0e10cSrcweir        ' Eine Zeichenkette zusammenbasteln, welche die Werte formatiert darstellt.
1012cdf0e10cSrcweir        sOutLine$ =             "[OWString]"        + chr$(9) + "Author"                    + chr$(9) + "= {" + chr$(9) + sAuthor$                          + "}" + chr$(13)
1013cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[sal_Bool]"        + chr$(9) + "AutoloadEnabled"           + chr$(9) + "= {" + chr$(9) + bAutoloadEnabled                  + "}" + chr$(13)
1014cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[sal_Int16]"       + chr$(9) + "AutoloadSecs"              + chr$(9) + "= {" + chr$(9) + nAutoloadSecs%                    + "}" + chr$(13)
1015cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "AutoLoadURL"               + chr$(9) + "= {" + chr$(9) + sAutoLoadURL$                     + "}" + chr$(13)
1016cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "BliendCopiesTo"            + chr$(9) + "= {" + chr$(9) + sBliendCopiesTo$                  + "}" + chr$(13)
1017cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "CopiesTo"                  + chr$(9) + "= {" + chr$(9) + sCopiesTo$                        + "}" + chr$(13)
1018cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[DateTime]"        + chr$(9) + "CreationDate"              + chr$(9) + "= {" + chr$(9) + DateTime2String(dCreationDate)    + "}" + chr$(13)
1019cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "DefaultTarget"             + chr$(9) + "= {" + chr$(9) + sDefaultTarget$                   + "}" + chr$(13)
1020cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "Description"               + chr$(9) + "= {" + chr$(9) + sDescription$                     + "}" + chr$(13)
1021cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[sal_Int16]"       + chr$(9) + "EditingCycles"             + chr$(9) + "= {" + chr$(9) + nEditingCycles%                   + "}" + chr$(13)
1022cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[sal_Int32]"       + chr$(9) + "EditingDuration"           + chr$(9) + "= {" + chr$(9) + nEditingDuration&                 + "}" + chr$(13)
1023cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[Sequence<Byte>]"  + chr$(9) + "ExtraData"                 + chr$(9) + "= {" + chr$(9) + ByteSequence2String(seqExtraData) + "}" + chr$(13)
1024cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "InReplyTo"                 + chr$(9) + "= {" + chr$(9) + sInReplyTo$                       + "}" + chr$(13)
1025cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[sal_Bool]"        + chr$(9) + "IsEncrypted"               + chr$(9) + "= {" + chr$(9) + bIsEncrypted                      + "}" + chr$(13)
1026cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "Keywords"                  + chr$(9) + "= {" + chr$(9) + sKeywords$                        + "}" + chr$(13)
1027cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "MIMEType"                  + chr$(9) + "= {" + chr$(9) + sMIMEType$                        + "}" + chr$(13)
1028cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "ModifiedBy"                + chr$(9) + "= {" + chr$(9) + sModifiedBy$                      + "}" + chr$(13)
1029cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[DateTime]"        + chr$(9) + "ModifyDate"                + chr$(9) + "= {" + chr$(9) + DateTime2String(dModifyDate)      + "}" + chr$(13)
1030cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "Newsgroups"                + chr$(9) + "= {" + chr$(9) + sNewsgroups$                      + "}" + chr$(13)
1031cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "Original"                  + chr$(9) + "= {" + chr$(9) + sOriginal$                        + "}" + chr$(13)
1032cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[sal_Bool]"        + chr$(9) + "PortableGraphics"          + chr$(9) + "= {" + chr$(9) + bPortableGraphics                 + "}" + chr$(13)
1033cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[DateTime]"        + chr$(9) + "PrintDate"                 + chr$(9) + "= {" + chr$(9) + DateTime2String(dPrintDate)       + "}" + chr$(13)
1034cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "PrintedBy"                 + chr$(9) + "= {" + chr$(9) + sPrintedBy$                       + "}" + chr$(13)
1035cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[sal_Int16]"       + chr$(9) + "Priority"                  + chr$(9) + "= {" + chr$(9) + nPriority%                        + "}" + chr$(13)
1036cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[sal_Bool]"        + chr$(9) + "QueryTemplate"             + chr$(9) + "= {" + chr$(9) + bQueryTemplate                    + "}" + chr$(13)
1037cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "Recipient"                 + chr$(9) + "= {" + chr$(9) + sRecipient$                       + "}" + chr$(13)
1038cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "References"                + chr$(9) + "= {" + chr$(9) + sReferences$                      + "}" + chr$(13)
1039cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "ReplyTo"                   + chr$(9) + "= {" + chr$(9) + sReplyTo$                         + "}" + chr$(13)
1040cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[sal_Bool]"        + chr$(9) + "SaveGraphicsCompressed"    + chr$(9) + "= {" + chr$(9) + bSaveGraphicsCompressed           + "}" + chr$(13)
1041cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[sal_Bool]"        + chr$(9) + "SaveOriginalGraphics"      + chr$(9) + "= {" + chr$(9) + bSaveOriginalGraphics             + "}" + chr$(13)
1042cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[sal_Bool]"        + chr$(9) + "SaveVersionOnClose"        + chr$(9) + "= {" + chr$(9) + bSaveVersionOnClose               + "}" + chr$(13)
1043cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "Template"                  + chr$(9) + "= {" + chr$(9) + sTemplate$                        + "}" + chr$(13)
1044cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[sal_Bool]"        + chr$(9) + "TemplateConfig"            + chr$(9) + "= {" + chr$(9) + bTemplateConfig                   + "}" + chr$(13)
1045cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[DateTime]"        + chr$(9) + "TemplateDate"              + chr$(9) + "= {" + chr$(9) + DateTime2String(dTemplateDate)    + "}" + chr$(13)
1046cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "TemplateFileName"          + chr$(9) + "= {" + chr$(9) + sTemplateFileName$                + "}" + chr$(13)
1047cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "Theme"                     + chr$(9) + "= {" + chr$(9) + sTheme$                           + "}" + chr$(13)
1048cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[OWString]"        + chr$(9) + "Title"                     + chr$(9) + "= {" + chr$(9) + sTitle$                           + "}" + chr$(13)
1049cdf0e10cSrcweir        sOutLine$ = sOutLine$ + "[sal_Bool]"        + chr$(9) + "UserData"                  + chr$(9) + "= {" + chr$(9) + bUserData                         + "}"
1050cdf0e10cSrcweir
1051cdf0e10cSrcweir        ' Ausgabe der formatierten Zeichenkette
1052cdf0e10cSrcweir        InfoMessage ( sOutLine$ )
1053cdf0e10cSrcweirEnd Sub
1054cdf0e10cSrcweir
1055cdf0e10cSrcweir'----------------------------------------------------------------------------
1056cdf0e10cSrcweir' Hilfsmethode: Zeigt die aktuellen Elemente des NameContainers an.
1057cdf0e10cSrcweir'----------------------------------------------------------------------------
1058cdf0e10cSrcweirSub ShowNameContainer ( aDocumentProperties )
1059cdf0e10cSrcweir
1060cdf0e10cSrcweir        if ( aDocumentProperties.hasElements () = FALSE ) then
1061cdf0e10cSrcweir            InfoMessage ( "Keine Elemente im NameContainer enthalten." )
1062cdf0e10cSrcweir            Exit Sub
1063cdf0e10cSrcweir        end if
1064cdf0e10cSrcweir
1065cdf0e10cSrcweir        aNameField      = aDocumentProperties.getElementNames ()
1066cdf0e10cSrcweir        if ( IsArray ( aNameField ) = FALSE ) then
1067cdf0e10cSrcweir            ErrorMessage ( "getElementNames() .... Fehler (Es konnte keine Sequence bestimmt werden!)" )
1068cdf0e10cSrcweir            Exit Sub
1069cdf0e10cSrcweir        end if
1070cdf0e10cSrcweir        nElementCount%  = UBound ( aNameField () )
1071cdf0e10cSrcweir
1072cdf0e10cSrcweir        stempString$ = ""
1073cdf0e10cSrcweir        for nCounter%=0 to nElementCount% step 1
1074cdf0e10cSrcweir            stempString$ = "[" + nCounter% + "]"
1075cdf0e10cSrcweir            stempString$ = stempString$ + chr$(9) + aNameField(nCounter%)
1076cdf0e10cSrcweir            stempString$ = stempString$ + chr$(9) + "="
1077cdf0e10cSrcweir            stempString$ = stempString$ + chr$(9) + aDocumentProperties.getByName ( aNameField(nCounter%) )
1078cdf0e10cSrcweir            stempString$ = stempString$ + chr$(13)
1079cdf0e10cSrcweir        next nCounter%
1080cdf0e10cSrcweir
1081cdf0e10cSrcweir        InfoMessage ( stempString$ )
1082cdf0e10cSrcweir
1083cdf0e10cSrcweirEnd Sub
1084cdf0e10cSrcweir
1085cdf0e10cSrcweir'----------------------------------------------------------------------------
1086cdf0e10cSrcweir' Hilfsfunktion: Ermittelt die Anzahl der im NameContainer enthaltenen Elemente.
1087cdf0e10cSrcweir'
1088cdf0e10cSrcweir' Returnwert = Anzahl der Elemente
1089cdf0e10cSrcweir'----------------------------------------------------------------------------
1090cdf0e10cSrcweirFunction getNameContainerCount ( aDocumentProperties ) as Long
1091cdf0e10cSrcweir
1092cdf0e10cSrcweir        if ( aDocumentProperties.hasElements () = FALSE ) then
1093cdf0e10cSrcweir            getNameContainerCount = 0
1094cdf0e10cSrcweir            Exit Function
1095cdf0e10cSrcweir        end if
1096cdf0e10cSrcweir
1097cdf0e10cSrcweir        aNameField      = aDocumentProperties.getElementNames ()
1098cdf0e10cSrcweir        nElementCount%  = UBound ( aNameField () )
1099cdf0e10cSrcweir
1100cdf0e10cSrcweir        ' Da die Zaehlung bei 0 beginnt, und der ermittelte Wert die obere Grenze darstellt,
1101cdf0e10cSrcweir        ' muss hier eine 1 draufgeschlagen werden.
1102cdf0e10cSrcweir        getNameContainerCount = nElementCount% + 1
1103cdf0e10cSrcweir
1104cdf0e10cSrcweirEnd Function
1105