5 messages in org.openoffice.fr.progRe: [prog] Petites modifs sur la vers...
FromSent OnAttachments
FabienOct 14, 2008 12:02 am 
Bernard MarcellyOct 14, 2008 2:27 am 
fabs...@wanadoo.frOct 14, 2008 2:58 am 
fabs...@wanadoo.frOct 14, 2008 3:51 am 
Bernard MarcellyOct 14, 2008 5:19 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [prog] Petites modifs sur la version 3Actions...
From:Bernard Marcelly (marc@club-internet.fr)
Date:Oct 14, 2008 2:27:36 am
List:org.openoffice.fr.prog

Bonjour, Message de Fabien date 2008-10-14 09:02 :

Bonjour,

Je viens de constater quelques changements de comportement de mes macros sous ooo3 Je les relaye à tout hasard.

Avant, pour supprimer une bibliothèque, j'utilisais la fonction suivante:

Sub DeleteBasicLibrary(srcname) Dim SrcLibraryName As String Dim oSrcLib As Object, iCounter As Integer Dim oLib As Object, oGlobalLib As Object Dim iLib As Integer Dim sSrcModules SrcLibraryName = srcname oGlobalLib = GlobalScope.BasicLibraries For iLib = 1 To 2 ' this makes two passes, one for the dialogues and one for the macros If oGlobalLib.hasByName( SrcLibraryName ) Then oSrcLib = oGlobalLib.getByName( SrcLibraryName ) sSrcModules = oSrcLib.getElementNames() iCounter = lBound( sSrcModules() ) while( iCounter <= uBound( sSrcModules() ) )

oSrcLib.removeByName( sSrcModules(iCounter) ) '<-- une erreur apparaît maintenant ici: la bibliothèque n'est pas chargée.

iCounter = iCounter + 1 wend oGlobalLib.removeLibrary( SrcLibraryName ) End If oGlobalLib = GlobalScope.DialogLibraries Next iLib End Sub

Ca marchait très bien. Maintenant, j'ai un message d'erreur me disant que la bibliothèque n'est pas chargée.

Il est inutile de supprimer les modules avant de supprimer la bibliothèque. Seul oGlobalLib.removeLibrary( SrcLibraryName ) est utile.

Pour les bizarreries, je n'ai pas d'explication.

Autre changement: dans une boite de dialogue, j'ai des cases à cocher. Il y en a que je ne voulais pas afficher, et pour cela j'utilisais le code suivant:

Label = BoiteDialogue.GetControl("CheckBox"&CStr(i)) Label.Model.Height = 0

Maintenant, ça ne marche plus.

C'est une mauvaise méthode.

Le plus simple est de changer la propriété Visible du contrôle. Label.Visible = False Une autre solution est de jouer avec la propriété step du modèle du dialogue et des contrôles.

Bonne journée Bernard