/usr/lib/libreoffice/share/extensions/DmathsAddon/DmInstall/Install_Addon.xba is in libreoffice-dmaths 3.4+dfsg1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Install_Addon" script:language="StarBasic">'************************************************
'Copyright (C) 2006-2010 Didier Dorange-Pattoret
'38, chemin de l'Abbaye
'74940 Annecy le Vieux
'France
'ddorange@dmaths.com
'
'
'This library is free software; you can redistribute it and/or
'modify it under the terms of the GNU General Public Licence (GPL)
'as published by the Free Software Foundation; either
'version 2.1 of the License, or (at your option) any later version.
'This library is distributed in the hope that it will be useful,
'but WITHOUT ANY WARRANTY; without even the implied warranty of
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
'General Public License for more details.
'You should have received a copy of the GNU General Public Licence (GPL)
'along with this library; if not, write to the Free Software
'Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'************************************************
REM ***** BASIC *****
Public oChoixrepinstallation, oDmProgInst as Object
Public iLangInstall as Integer
Public sLang as String
Public sNotfound as String rem sInstallOpen,
rem sInstallOpen est la racine du rep utilisateur,
Public sUserPath as String
Public oDeskTop,oSheetLangues,oCalcLangues as Object
Public mFileProperties(0) As New com.sun.star.beans.PropertyValue
Public sUrl,sMotVar as String
Public bPremInstall, bMiseAJour as Boolean
Public AppsPref(9,2) as String
Public sRepertoireDmaths as String
Public const iVersion = " 3.4.0.0 "
Public const iNumVersionDmaths = 3400 rem à changer également dans Dmaths Tools
Public const iNbreThemesIcones = 5
Sub LanceFinInstallation (bOnMetAJour as Boolean)
DialogLibraries.loadLibrary( "DmInstall")
oDmProgInst = CreateUnoDialog(DialogLibraries.DmInstall.DmProgInst)
oDmProgInst.Visible = True
Wait 500
oDmProgInst.getControl("ProgressBar1").Value = 0
If bOnMetAJour Then rem on fait une mise a jour
bPremInstall = FALSE
bMiseAJour = TRUE
Else rem on fait une premiere installation
bPremInstall = TRUE
bMiseAJour = FALSE
Endif
iLangInstall = TrouveLang rem on charge les langues
BasicLibraries.loadLibrary("Dmaths")
oDmProgInst.getControl("ProgressBar1").Value = 5
Call TestPresencesMath rem verifie que le module math est installé
Call AfficheChoixRepertoireInstallation
End Sub
Sub TestPresencesMath
Dim sCheminMath, sAvertoMessage As String
sCheminMath = GetRepertoirePathprog & "smath"
If GetGuiType = 1 Then sCheminMath = sCheminMath & ".exe"
If Not FileExists(sCheminMath) Then
MsgBox("Le module Math n'est pas installé"+chr(13)+chr(13)+"Math module is not installed",48,"Dmaths")
Stop
Endif
End Sub
Sub AfficheChoixRepertoireInstallation
oDmProgInst.getControl("ProgressBar1").Value = 10
oChoixrepinstallation = CreateUnoDialog( DialogLibraries.DmInstall.Choixrepinstallation )
rem recherche des logiciels installes
LoadAppsPref(oChoixrepinstallation,bPremInstall,False,PreselectionneNumeroTheme)
sUserPath = GetRepertoirePath("user") rem utilité a revoir
Call Fininstallation rem nouveauté
End sub
Sub Fininstallation
oDmProgInst.getControl("ProgressBar1").Value = 15
BasicLibraries.loadLibrary("Dmaths")
sLeChemindeDmaths = sCheminDmaths
rem---------------------------------------------------------------------------------------
' en cas d'installation reseau
' Print TestInstallRezo
If bPremInstall Then
If TestInstallRezo Then
If Not FileExists(GetRepertoirePath("user")+GetPathSeparator+"dmaths") Then MkDir GetRepertoirePath("user")+GetPathSeparator+"dmaths"
If FileExists(GetRepertoirePath("user")+GetPathSeparator+"dmaths"+GetPathSeparator+"dmaths.ods") Then Kill GetRepertoirePath("user")+GetPathSeparator+"dmaths"+GetPathSeparator+"dmaths.ods"
FileCopy fChemindmaths+"dmaths.ods", ConvertToURL(GetRepertoirePath("user")+"/dmaths/dmaths.ods")
EndIf
Endif
oDmProgInst.getControl("ProgressBar1").Value = 35
rem configure les raccourcis clavier pour les MAC
If IsMacOS Then
Config4Mac(True)
EndIf
rem configure les raccourcis claviers pour OOo < 3.1
If OOONumVersion < 310 Then
RaccourcisClavier
End if
rem-----------------------------------------------------------------------------------
' copie des fontes Cmath
rem Fontes
rem------------------------------------------------------------------------------------
'regler le numerotation des icones et choix du theme d'icones
RegleNumerotationIcones rem cette macro regle lors de l'installation la numerotation des icones de la barre dmaths
RegleIconesAppsPref(oChoixrepinstallation,DeterminesThemeIcons(oChoixrepinstallation)) rem regle les icones des 3 applications preferees
ChoisirThemeIcone(DeterminesThemeIcons(oChoixrepinstallation)) rem met en place le theme d'icones choisi
oDmProgInst.getControl("ProgressBar1").Value = 50
rem ---------------------------------------------------------------------------------------------------------------------------
'regler les icones du menu dmaths
MaJIconesDuMenuDmaths
oDmProgInst.getControl("ProgressBar1").Value = 65
rem-------------------------------------------------------------------------------------
'installation des options en cas de première installation
If bPremInstall Then Options Else OptionsUtilisateur
If bPremInstall Then OptionsBackup
oDmProgInst.getControl("ProgressBar1").Value = 80
rem------------------------------------------------------------------------------------
' renommage des barres d'Addon en Dmaths, Afficher-Masquer, Gdmath
Dim sNomdeBarre as String
REM ------- modul:writer Dmaths
oConfigAccess = GetConfigAccess( "/org.openoffice.Office.UI.WriterWindowState/UIElements/States", True )
If iLangInstall = 0 Then sNomdeBarre = "Dmaths Barre" Else sNomdeBarre = "Dmaths-Addon"
If oConfigAccess.HasByName( "private:resource/toolbar/addon_org.openoffice.Office.addon.DMathsBarre") Then
oAddon = oConfigAccess.getByName( "private:resource/toolbar/addon_org.openoffice.Office.addon.DMathsBarre")
oAddon.UIName = sNomdeBarre
Elseif oConfigAccess.HasByName( "private:resource/toolbar/addon_1") Then
oAddon = oConfigAccess.getByName( "private:resource/toolbar/addon_1")
oAddon.UIName = sNomdeBarre
Elseif oConfigAccess.HasByName( "private:resource/toolbar/Add-on 1") Then
oAddon = oConfigAccess.getByName( "private:resource/toolbar/Add-on 1")
oAddon.UIName = sNomdeBarre
Endif
oConfigAccess.commitChanges()
REM ------- modul:writer Dmaths on/off
If iLangInstall = 0 Then
sNomdeBarre = "Dmaths Afficher/Masquer"
Elseif iLangInstall = 2 Then
sNomdeBarre = "Dmaths an/aus-Schalter"
Else
sNomdeBarre = "Dmaths on/off switch"
Endif
If oConfigAccess.HasByName( "private:resource/toolbar/addon_org.openoffice.Office.addon.DMathsDisplayBarre") Then
oAddon = oConfigAccess.getByName( "private:resource/toolbar/addon_org.openoffice.Office.addon.DMathsDisplayBarre")
oAddon.UIName = sNomdeBarre
Elseif oConfigAccess.HasByName( "private:resource/toolbar/addon_0") Then
oAddon = oConfigAccess.getByName( "private:resource/toolbar/addon_0")
oAddon.UIName = sNomdeBarre
Elseif oConfigAccess.HasByName( "private:resource/toolbar/Add-on 2") Then
oAddon = oConfigAccess.getByName( "private:resource/toolbar/Add-on 2")
oAddon.UIName = sNomdeBarre
Endif
oConfigAccess.commitChanges()
REM ------- modul:writer OOoTep
If iLangInstall = 0 Then
sNomdeBarre = "OOoTep-Gdmath Afficher/Masquer"
Elseif iLangInstall = 2 Then
sNomdeBarre = "OooTep-Gdmath an/aus-Schalter"
Else
sNomdeBarre = "OooTep-Gdmath on/off switch"
Endif
If oConfigAccess.HasByName( "private:resource/toolbar/addon_org.openoffice.Office.addon.OOoTep-Gdmath") Then
oAddon = oConfigAccess.getByName( "private:resource/toolbar/addon_org.openoffice.Office.addon.OOoTep-Gdmath")
oAddon.UIName = sNomdeBarre
Elseif oConfigAccess.HasByName( "private:resource/toolbar/addon_2") Then
oAddon = oConfigAccess.getByName( "private:resource/toolbar/addon_2")
oAddon.UIName = sNomdeBarre
Elseif oConfigAccess.HasByName( "private:resource/toolbar/Add-on 2") Then
oAddon = oConfigAccess.getByName( "private:resource/toolbar/Add-on 3")
oAddon.UIName = sNomdeBarre
Endif
oConfigAccess.commitChanges()
REM ------- modul:writer OOoGdmath
If iLangInstall = 0 Then sNomdeBarre = "OOoGdmath" Else sNomdeBarre = "OOoGdmath-Addon"
oConfigAccessW = GetConfigAccess( "/org.openoffice.Office.UI.WriterWindowState/UIElements/States", True )
If oConfigAccessW.HasByName( "private:resource/toolbar/addon_org.openoffice.Office.addon.OOoGdmathBarre1") Then
oAddon = oConfigAccessW.getByName( "private:resource/toolbar/addon_org.openoffice.Office.addon.OOoGdmathBarre1")
oAddon.UIName = sNomdeBarre
Elseif oConfigAccessW.HasByName( "private:resource/toolbar/addon_2") Then
oAddon = oConfigAccessW.getByName( "private:resource/toolbar/addon_2")
oAddon.UIName = sNomdeBarre
Elseif oConfigAccessW.HasByName( "private:resource/toolbar/Add-on 2") Then
oAddon = oConfigAccessW.getByName( "private:resource/toolbar/Add-on 3")
oAddon.UIName = sNomdeBarre
Endif
oConfigAccessW.commitChanges()
REM ------- modul:draw OOoGdmath
If iLangInstall = 0 Then sNomdeBarre = "OOoGdmath" Else sNomdeBarre = "OOoGdmath-Addon"
oConfigAccessD = GetConfigAccess( "/org.openoffice.Office.UI.DrawWindowState/UIElements/States", True )
If oConfigAccessD.HasByName( "private:resource/toolbar/addon_org.openoffice.Office.addon.OOoGdmathBarre1") Then
oAddon = oConfigAccessD.getByName( "private:resource/toolbar/addon_org.openoffice.Office.addon.OOoGdmathBarre1")
oAddon.UIName = sNomdeBarre
Elseif oConfigAccessD.HasByName( "private:resource/toolbar/addon_2") Then
oAddon = oConfigAccessD.getByName( "private:resource/toolbar/addon_2")
oAddon.UIName = sNomdeBarre
Elseif oConfigAccessD.HasByName( "private:resource/toolbar/Add-on 2") Then
oAddon = oConfigAccessD.getByName( "private:resource/toolbar/Add-on 3")
oAddon.UIName = sNomdeBarre
Endif
oConfigAccessD.commitChanges()
REM ------- modul:draw OOoTep
If iLangInstall = 0 Then
sNomdeBarre = "OOoTep-Gdmath Afficher/Masquer"
Elseif iLangInstall = 2 Then
sNomdeBarre = "OooTep-Gdmath an/aus-Schalter"
Else
sNomdeBarre = "OooTep-Gdmath on/off switch"
Endif
oConfigAccessD = GetConfigAccess( "/org.openoffice.Office.UI.DrawWindowState/UIElements/States", True )
If oConfigAccessD.HasByName( "private:resource/toolbar/addon_org.openoffice.Office.addon.OOoTep-Gdmath") Then
oAddon = oConfigAccessD.getByName( "private:resource/toolbar/addon_org.openoffice.Office.addon.OOoTep-Gdmath")
oAddon.UIName = sNomdeBarre
Elseif oConfigAccessD.HasByName( "private:resource/toolbar/addon_2") Then
oAddon = oConfigAccessD.getByName( "private:resource/toolbar/addon_2")
oAddon.UIName = sNomdeBarre
Elseif oConfigAccessD.HasByName( "private:resource/toolbar/Add-on 2") Then
oAddon = oConfigAccessD.getByName( "private:resource/toolbar/Add-on 3")
oAddon.UIName = sNomdeBarre
Endif
oConfigAccessD.commitChanges()
oDmProgInst.getControl("ProgressBar1").Value = 85
rem ------------------------------------------------------------------------------------------------------------------
rem supprime le test de nouvelle version au demarrage
oConfigAccess = GetConfigAccess( "/org.openoffice.Office.Events/ApplicationEvents/Bindings", True )
If oConfigAccess.hasByName("OnStartApp") Then
If oConfigAccess.OnStartApp.hasByName("BindingURL") Then
If InStr(oConfigAccess.OnStartApp.BindingURL,"TestNewVersionDemarrage") > 0 Then
oConfigAccess.RemoveByName("OnStartApp")
oConfigAccess.commitChanges()
Endif
Endif
Endif
rem fin de la suppression
oDmProgInst.getControl("ProgressBar1").Value = 90
oChoixrepinstallation.Dispose()
rem on recharge la bibliothèque Standard et on supprime le module DmCloseQuick
If GetguiType = 1 Then
BasicLibraries.loadLibrary("Standard")
oLib = GlobalScope.BasicLibraries.Standard
If oLib.hasByName("DmCloseQuick") Then
oLib.removeByName("DmCloseQuick")
EndIf
Endif
oDmProgInst.getControl("ProgressBar1").Value = 95
rem met à jour le fichier description.xml si DmathsClub presente
MetAJourDescription
rem ----------------------------------------------------------------------------
rem regle le chemin des icones des autres comptes dans les installations multiutilisateurs
If (TestInstallRezo and ControleDroits(GetRepertoirePath("inst")) and Len(sLeChemindeDmaths)<>0) Then
RegleCheminDesIcones(sLeChemindeDmaths)
Endif
oDmProgInst.getControl("ProgressBar1").Value = 100
' Wait 3000
oFinInst = CreateUnoDialog(DialogLibraries.DmInstall.FinInst )
oFinInst.GetControl("Label1").Peer.Text = oFinInst.GetControl("Label1").Peer.Text & chr(13) & chr(13) & chr(13) & "Version " & iVersion
oDmProgInst.Dispose()
oFinInst.execute()
End sub
Function TrouveLang as Integer 'retourne un nombre correspondant a la langue de l'utilisateur.
Dim iLangT as Integer
Dim oLibT as Object rem sLang est un variable Public
oLibT = GlobalScope.BasicLibraries.Standard
If oLibT.hasByName("DmOptions") Then
iLangT = iLang
Else
sLang = GetRepertoirePath("vlang")
Select Case sLang
Case "fr"
iLangT = 0
Case "de"
iLangT = 2
' Case "es"
' iLangT = 3
' Case "it"
' iLangT = 4
' Case "da"
' iLangT = 5
' Case "sk"
' iLangT = 6
Case Else
iLangT = 1
End Select
Endif
If iLangT <> 2 Then sLang = "fr" rem pour l'installation des autotextes
TrouveLang = iLangT
End Function
Sub RaccourcisClavier rem écrite par Jérôme Ortais modifiee par Didier Dorange-Pattoret le 24 fevririer 2008
Dim sNomFichier as String, iF1 as Integer, sLigne as String, sDebut as String, sFin as String
sNomFichier=GetRepertoirePath("user")+"/config/soffice.cfg/modules/swriter/accelerator/"+GetRepertoirePath("vlang")+"/current.xml"
sNomFichierOld=GetRepertoirePath("user")+"/config/soffice.cfg/modules/swriter/accelerator/"+GetRepertoirePath("vlang")+"/current.old"
If Not FileExists(sNomFichier) Then
MkDir GetRepertoirePath("user")+"/config/soffice.cfg/modules/swriter/accelerator/"+GetRepertoirePath("vlang")
FileCopy fCheminDmaths+"current.xml", sNomFichier
Elseif Not FileExists(sNomFichierOld) Then
FileCopy sNomFichier, sNomFichierOld
EndIf
iF1=FreeFile
Open sNomFichier For Input As #iF1
For iCpt = 1 to 3
Line Input #iF1, sLigne
sDebut=sDebut+sLigne
If iCpt<3 Then sDebut=sDebut+Chr(10)
Next
While Not Eof(iF1)
Line Input #iF1, sLigne
If (InStr(sLigne,"vnd.sun.star.script:Dmaths.")=0 and InStr(sLigne,"vnd.sun.star.script:DmathsInstall.")=0 and InStr(sLigne,"vnd.sun.star.script:CmathOOo.")=0 and InStr(sLigne,"vnd.sun.star.script:OOoGdmath.")=0 and InStr(sLigne,"vnd.sun.star.script:OOoTep.")=0) Then sFin=sFin+sLigne+Chr(10) 'Ne garde que les lignes ne concernant pas DMaths, pour éviter les doublons.
WEnd
Close #iF1
iF1=FreeFile
Open sNomFichier For Output As #iF1
Print #iF1, sDebut
'Ajoute les raccourcis clavier
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_T"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Tableau.LanceCreationTableau?language=Basic&amp;location=application"+Chr(34)+" accel:mod1="+Chr(34)+"true"+Chr(34)+"/>"
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_F10"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Module1.MetenFormule?language=Basic&amp;location=application"+Chr(34)+"/>"
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_F9"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Module1.MetentreAccolades?language=Basic&amp;location=application"+Chr(34)+"/>"
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_F10"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Module1.MetentreAccolades?language=Basic&amp;location=application"+Chr(34)+" accel:shift="+Chr(34)+"true"+Chr(34)+"/>"
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_V"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Module1.MetenVecteur?language=Basic&amp;location=application"+Chr(34)+" accel:shift="+Chr(34)+"true"+Chr(34)+" accel:mod1="+Chr(34)+"true"+Chr(34)+"/>"
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_E"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Module1.MetenMesureAlgebrique?language=Basic&amp;location=application"+Chr(34)+" accel:shift="+Chr(34)+"true"+Chr(34)+" accel:mod1="+Chr(34)+"true"+Chr(34)+"/>"
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_A"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Module1.MetenAngle?language=Basic&amp;location=application"+Chr(34)+" accel:shift="+Chr(34)+"true"+Chr(34)+" accel:mod1="+Chr(34)+"true"+Chr(34)+"/>"
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_L"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Module1.MetenLimite?language=Basic&amp;location=application"+Chr(34)+" accel:shift="+Chr(34)+"true"+Chr(34)+" accel:mod1="+Chr(34)+"true"+Chr(34)+"/>"
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_I"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Module1.MetenIntegrale?language=Basic&amp;location=application"+Chr(34)+" accel:shift="+Chr(34)+"true"+Chr(34)+" accel:mod1="+Chr(34)+"true"+Chr(34)+"/>"
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_S"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Module1.MetenSomme?language=Basic&amp;location=application"+Chr(34)+" accel:shift="+Chr(34)+"true"+Chr(34)+" accel:mod1="+Chr(34)+"true"+Chr(34)+"/>"
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_R"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Module1.MetenRacine?language=Basic&amp;location=application"+Chr(34)+" accel:shift="+Chr(34)+"true"+Chr(34)+" accel:mod1="+Chr(34)+"true"+Chr(34)+"/>"
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_X"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Module1.MetenSysteme?language=Basic&amp;location=application"+Chr(34)+" accel:shift="+Chr(34)+"true"+Chr(34)+" accel:mod1="+Chr(34)+"true"+Chr(34)+"/>"
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_M"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Module1.MetenMatrice?language=Basic&amp;location=application"+Chr(34)+" accel:shift="+Chr(34)+"true"+Chr(34)+" accel:mod1="+Chr(34)+"true"+Chr(34)+"/>"
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_F10"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Module1.MetentreParentheses?language=Basic&amp;location=application"+Chr(34)+" accel:shift="+Chr(34)+"true"+Chr(34)+" accel:mod1="+Chr(34)+"true"+Chr(34)+"/>"
If iLangInstall = 0 Then
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_F3"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.RaccAutotextes.SuperAutotexte?language=Basic&amp;location=application"+Chr(34)+"/>"
Else
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_F3"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Module1.LoadParCro?language=Basic&amp;location=application"+Chr(34)+" accel:shift="+Chr(34)+"true"+Chr(34)+" accel:mod1="+Chr(34)+"true"+Chr(34)+"/>"
Endif
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_F3"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Tools.MetenItalic?language=Basic&amp;location=application"+Chr(34)+" accel:shift="+Chr(34)+"true"+Chr(34)+"/>"
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_F4"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Tools.MetenAtalante?language=Basic&amp;location=application"+Chr(34)+" accel:shift="+Chr(34)+"true"+Chr(34)+"/>"
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_Z"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:Dmaths.Module1.LoadParCro?language=Basic&amp;location=application"+Chr(34)+" accel:shift="+Chr(34)+"true"+Chr(34)+" accel:mod1="+Chr(34)+"true"+Chr(34)+"/>"
Print #iF1, " <accel:item accel:code="+Chr(34)+"KEY_O"+Chr(34)+" xlink:href="+Chr(34)+"vnd.sun.star.script:DmInstall.Options.ChoixOptionsDmaths?language=Basic&amp;location=application"+Chr(34)+" accel:shift="+Chr(34)+"true"+Chr(34)+" accel:mod1="+Chr(34)+"true"+Chr(34)+"/>"
Print #iF1, sFin
Close #iF1
End Sub
Sub Fontes
End Sub
Sub Autotextes rem écrite par Jérôme Ortais modifiée par Didier Dorange-Pattoret
Dim sFrom as String, sTo as String
On error resume next
sTo=ConvertFromURL(GetRepertoirePath("user")+"/autotext/dmaths.bau")
If FileExists(sTo) Then Kill sTo
On error goto 0
SetGalleryAndAutotext("AutoText", sLang, True )
End Sub
Sub Galeries
On error resume next
For I = 1 To 8
If FileExists(ConvertToURL(sUserPath+"/gallery/sg100"+cStr(I)+".sdg")) Then Kill ConvertToURL(sUserPath+"/gallery/sg100"+cStr(I)+".sdg")
If FileExists(ConvertToURL(sUserPath+"/gallery/sg100"+cStr(I)+".sdv")) Then Kill ConvertToURL(sUserPath+"/gallery/sg100"+cStr(I)+".sdv")
If FileExists(ConvertToURL(sUserPath+"/gallery/sg100"+cStr(I)+".thm")) Then Kill ConvertToURL(sUserPath+"/gallery/sg100"+cStr(I)+".thm")
Next I
On error goto 0
SetGalleryAndAutotext("Gallery", sLang, True )
End Sub
Sub Options rem cette macro installe les options par défaut
Dim sCheminSoftware1, sCheminSoftware2, sCheminSoftware3, sNomPoliceCursive, sUsingDispatcher as String
If oChoixrepinstallation.Model.FileControl2.Text <> sNotfound then sCheminSoftware1 = oChoixrepinstallation.Model.FileControl2.Text
If oChoixrepinstallation.Model.FileControl3.Text <> sNotfound then sCheminSoftware2 = oChoixrepinstallation.Model.FileControl3.Text
If oChoixrepinstallation.Model.FileControl4.Text <> sNotfound then sCheminSoftware3 = oChoixrepinstallation.Model.FileControl4.Text
rem on utilise le dispatcher si la version de OOo est > 230
sUsingDispatcher = "FALSE"
If GetguiType = 4 Then
sCheminSoftware1 = RegleAppsSousLinux(sCheminSoftware1)
sCheminSoftware2 = RegleAppsSousLinux(sCheminSoftware2)
sCheminSoftware3 = RegleAppsSousLinux(sCheminSoftware3)
Endif
If (GetguiType = 4 and FileExists("/Users")) Then
sNomPoliceCursive = "Apple Chancery"
Else
sNomPoliceCursive = "Atalante"
Endif
sSource="Rem (C) Didier Dorange-Pattoret www.dmaths.org"+Chr(13)
sSource=sSource+"Global const iLang = "+iLangInstall+Chr(13)
sSource=sSource+"Public const iNumVersionDmathsCourante = "+ iNumVersionDmaths +""+Chr(13)
sSource=sSource+"Public const sChemindmaths = """ + DetermineRepertoireDmaths + """"+Chr(13)
sSource=sSource+"Public const sChemindmathsODS = """ + fCheminduFichierDmathsODS + """" + Chr(13) rem sChemindmathsODS est le fichier dmaths.ods
sSource=sSource+"Public const bItalic = TRUE"+Chr(13)
sSource=sSource+"Public const bEdroit = TRUE"+Chr(13)
sSource=sSource+"Public const bIdroit = TRUE"+Chr(13)
sSource=sSource+"Public const bChiffresDroits = TRUE"+Chr(13)
sSource=sSource+"Public const bVecteursItalic = TRUE"+Chr(13)
sSource=sSource+"Public const bAnglesItalic = TRUE"+Chr(13)
sSource=sSource+"Public const bMesuresAlgItalic = TRUE"+Chr(13)
sSource=sSource+"Public const bLettresAreScalaires = TRUE"+Chr(13)
sSource=sSource+"Public const sLettresScalaires = """ + "abcdexyzt" + """" +Chr(13)
sSource=sSource+"Public const bFormulesGras = FALSE"+Chr(13)
sSource=sSource+"Public const iTailleFormules = "+Cstr(12)+Chr(13)
sSource=sSource+"Public const bTailleFormCarac = TRUE"+Chr(13)
sSource=sSource+"Public const bPoliceFormCarac = TRUE"+Chr(13)
sSource=sSource+"Public const iMargesFormules = " + Cstr(0) + Chr(13)
sSource=sSource+"Public const bConcateneFormules = TRUE"+Chr(13)
sSource=sSource+"Public const iMarqHorPoints = " + Cstr(40)+ Chr(13)
sSource=sSource+"Public const iMarqVerPoints = "+ Cstr(0)+ Chr(13)
sSource=sSource+"Public const sBorneInfIntegrales = ""from"""+Chr(13)
sSource=sSource+"Public const sBorneSupIntegrales = ""to"""+Chr(13)
sSource=sSource+"Public const bTextMode = FALSE"+Chr(13)
sSource=sSource+"Public const bCoordColonne = FALSE"+Chr(13)
sSource=sSource+"Public const bSystemesAlignes = FALSE"+Chr(13)
sSource=sSource+"Public const bMatricesRondes = TRUE"+Chr(13)
sSource=sSource+"Public const bFormulesEspacees = FALSE"+Chr(13)
sSource=sSource+"Public const bFormulesEncadrees = FALSE"+Chr(13)
sSource=sSource+"Public const bGrandesParentheses = TRUE"+Chr(13)
sSource=sSource+"Public const bModeFactoriel = FALSE"+Chr(13)
sSource=sSource+"Public const bFractions = FALSE"+Chr(13)
If iLangInstall = 0 Then
sSource=sSource+"Public const bXpointaulieux = FALSE"+Chr(13)
Else
sSource=sSource+"Public const bXpointaulieux = TRUE"+Chr(13)
Endif
sSource=sSource+"Public const bUsingDispatcher = "+ sUsingDispatcher +Chr(13)
sSource=sSource+"Public const iDelaiEntreSauvegardes = "+ Cstr(0) + Chr(13)
sSource=sSource+"Public const sThemeIcons = """+DeterminesThemeIcons(oChoixrepinstallation)+""""+Chr(13)
sSource=sSource+"Public const sCheminSoftware1 = """+sCheminSoftware1+""""+Chr(13)
sSource=sSource+"Public const sCheminSoftware2 = """+sCheminSoftware2+""""+Chr(13)
sSource=sSource+"Public const sCheminSoftware3 = """+sCheminSoftware3+""""+Chr(13)
sSource=sSource+"Public const sNomPoliceCursive = """+sNomPoliceCursive+""""+Chr(13)
sSource=sSource+"Sub MyTest2" & Chr(13) & "Print ""Vive Dmaths !""" & Chr(13) & "End Sub"
EcritFichierDmOptionsTXT(sSource) rem ecrit le fichier dmoptions
InsertModuleDmOptions(sSource) rem cree le module des options
End Sub
rem cette macro met a jour les options en gardant celles de l utilisateur
Sub OptionsUtilisateur
BasicLibraries.loadLibrary("Dmaths")
bIconesChangees = False
bAfficherMasquerIcones = False
oDmOptions = Dmaths.Module5.LoadDialog("DmInstall","DmOptions")
rem la ligne suivante permet de remplir par besoin le champ des scalaires.
If Len(oDmOptions.GetControl("TextField7").Peer.Text) = 0 Then oDmOptions.GetControl("TextField7").Peer.Text = "abcdexyzt"
DmInstall.Install_Addon.LoadAppsPref(oDmOptions,False,True,sThemeIcons) rem bPremInstall=False bRegleOptions = True
ValidOptionsDmaths
oDmOptions.Dispose()
End Sub
Sub OptionsBackup
sSource="Rem (C) Didier Dorange-Pattoret www.dmaths.org 2005"+Chr(13)
sSource=sSource+"Public const sDateSauvegarde = """+Date()+""""+Chr(13)
sSource=sSource+"Public Const sRepertoireSourceDefaut = """+GetRepertoirePath("home")+""""+Chr(13)
sSource=sSource+"Public Const sRepertoireBackupDefaut = """+GetRepertoirePath("home")+""""+Chr(13)
sSource=sSource+"Sub MyTest3" & Chr(13) & "Print ""Vive Dmaths !""" & Chr(13) & "End Sub"
sMod = "DmBackup"
oLib = GlobalScope.BasicLibraries.Standard
If oLib.hasByName(sMod) Then
oLib.removeByName(sMod)
EndIf
oLib.InsertByName(sMod,sSource)
End Sub
Sub LoadAppsPref(oBoiteApps as Object, bParDefaut, bRegleOptions as Boolean,sThemeIcons as String)
If bParDefaut Then rem on charge les applications reconnues par defaut
If (GetguiType = 4 and Not IsMacOs) Then
Call LoadAppsLinux
Elseif GetguiType = 1 Then
Call LoadAppsWin rem charge les noms des applications préférées
End If
oBoiteApps.Model.FileControl4.Text = ""
oBoiteApps.Model.FileControl3.Text = ""
oBoiteApps.Model.FileControl2.Text = ""
For I = 9 To 0 Step -1
If FileExists(AppsPref(I,0)) Then
oBoiteApps.Model.FileControl4.Text = oBoiteApps.Model.FileControl3.Text
oBoiteApps.Model.FileControl3.Text = oBoiteApps.Model.FileControl2.Text
oBoiteApps.Model.FileControl2.Text = AppsPref(I,0)
Endif
Next I
rem on charge les icones par defaut si OS<>Mac
' If (GetguiType = 1 or Not FileExists("/Users")) Then
If oBoiteApps.Model.FileControl2.Text <> "" Then
oBoiteApps.GetControl("SoftButton1").Visible = True
rem si l'icone existe dans la base on la passe en image du bouton
If FileExists(AppsPref(GetIndiceAppsPref(oBoiteApps.Model.FileControl2.Text),1)) Then
oBoiteApps.GetControl("SoftButton1").Model.ImageURL = AppsPref(GetIndiceAppsPref(oBoiteApps.Model.FileControl2.Text),1)
rem si l'image n'est pas dans la base donnée on la fabrique
FabriqueImages(oBoiteApps,oBoiteApps.GetControl("SoftButton1").Model.ImageURL,1)
Else
rem si l'image ne peut etre fabriquee on met l'image par defaut
oBoiteApps.GetControl("SoftButton1").Model.ImageURL = fCheminDmaths+"icons/"+sThemeIcons+"/launchsoftware1_16.bmp"
Endif
End If
If oBoiteApps.Model.FileControl3.Text <> "" Then
oBoiteApps.GetControl("SoftButton2").Visible = True
If FileExists(AppsPref(GetIndiceAppsPref(oBoiteApps.Model.FileControl3.Text),1)) Then
oBoiteApps.GetControl("SoftButton2").Model.ImageURL = AppsPref(GetIndiceAppsPref(oBoiteApps.Model.FileControl3.Text),1)
FabriqueImages(oBoiteApps,oBoiteApps.GetControl("SoftButton2").Model.ImageURL,2)
Else
oBoiteApps.GetControl("SoftButton2").Model.ImageURL = fCheminDmaths+"icons/"+sThemeIcons+"/launchsoftware2_16.bmp"
Endif
End If
If oBoiteApps.Model.FileControl4.Text <> "" Then
oBoiteApps.GetControl("SoftButton3").Visible = True
If FileExists(AppsPref(GetIndiceAppsPref(oBoiteApps.Model.FileControl4.Text),1)) Then
oBoiteApps.GetControl("SoftButton3").Model.ImageURL = AppsPref(GetIndiceAppsPref(oBoiteApps.Model.FileControl4.Text),1)
FabriqueImages(oBoiteApps,oBoiteApps.GetControl("SoftButton3").Model.ImageURL,3)
Else
oBoiteApps.GetControl("SoftButton3").Model.ImageURL = fCheminDmaths+"icons/"+sThemeIcons+"/launchsoftware3_16.bmp"
Endif
End If
' Endif
Else rem on charge les applications que l'utilisateur a deja installées
oBoiteApps.Model.FileControl2.Text = sCheminSoftware1
oBoiteApps.Model.FileControl3.Text = sCheminSoftware2
oBoiteApps.Model.FileControl4.Text = sCheminSoftware3
If Not bRegleOptions Then
oBoiteApps.GetControl("Label1").Visible = False
oBoiteApps.GetControl("FileControl2").Enable = False
oBoiteApps.GetControl("FileControl3").Enable = False
oBoiteApps.GetControl("FileControl4").Enable = False
For I = 1 To iNbreThemesIcones
oBoiteApps.GetControl("OptionButton"+Cstr(I)).Visible = False
Next I
oBoiteApps.GetControl("Label3").Visible = False
End if
rem recherche des icônes des apps preferees sauf sous Mac
' If (GetguiType = 1 or Not FileExists("/Users")) Then
oConfigAccess = GetConfigAccess( "/org.openoffice.Office.Addons/AddonUI/OfficeToolBar", True )
If oConfigAccess.hasByName("org.openoffice.Office.addon.DMathsBarre") Then
oAddon = oConfigAccess.getByName("org.openoffice.Office.addon.DMathsBarre")
If sCheminSoftware1 <> "" Then
oBoiteApps.GetControl("SoftButton1").Visible = True
If Not bRegleOptions Then oBoiteApps.GetControl("SoftButton1").Enable = False
If FileExists(oAddon.getByName("soft1").ImageIdentifier & "_16.bmp") Then
oBoiteApps.GetControl("SoftButton1").Model.ImageURL = oAddon.getByName("soft1").ImageIdentifier & "_16.bmp"
Else
oBoiteApps.GetControl("SoftButton1").Model.ImageURL = fCheminDmaths+"icons/"+sThemeIcons+"/launchsoftware1_16.bmp"
Endif
Endif
If sCheminSoftware2 <> "" Then
oBoiteApps.GetControl("SoftButton2").Visible = True
If Not bRegleOptions Then oBoiteApps.GetControl("SoftButton2").Enable = False
If FileExists(oAddon.getByName("soft2").ImageIdentifier & "_16.bmp") Then
oBoiteApps.GetControl("SoftButton2").Model.ImageURL = oAddon.getByName("soft2").ImageIdentifier & "_16.bmp"
Else
oBoiteApps.GetControl("SoftButton2").Model.ImageURL = fCheminDmaths+"icons/"+sThemeIcons+"/launchsoftware2_16.bmp"
Endif
Endif
If sCheminSoftware3 <> "" Then
oBoiteApps.GetControl("SoftButton3").Visible = True
If Not bRegleOptions Then oBoiteApps.GetControl("SoftButton3").Enable = False
If FileExists(oAddon.getByName("soft3").ImageIdentifier & "_16.bmp") Then
oBoiteApps.GetControl("SoftButton3").Model.ImageURL = oAddon.getByName("soft3").ImageIdentifier & "_16.bmp"
Else
oBoiteApps.GetControl("SoftButton3").Model.ImageURL = fCheminDmaths+"icons/"+sThemeIcons+"/launchsoftware3_16.bmp"
Endif
Endif
Endif
' Endif
Endif
End Sub
Sub RegleIconesAppsPref(oBoiteApps as Object,sThemeIcons as String)
oConfigAccess = GetConfigAccess( "/org.openoffice.Office.Addons/AddonUI/OfficeToolBar", True )
If oConfigAccess.hasByName("org.openoffice.Office.addon.DMathsBarre") Then
oAddon = oConfigAccess.getByName("org.openoffice.Office.addon.DMathsBarre")
If oBoiteApps.Model.FileControl2.Text <> "" Then
rem le contexte puis l'icone
'oAddon.getByName("soft1").Context = "com.sun.star.text.TextDocument"
If oBoiteApps.GetControl("SoftButton1").Model.ImageURL <>"" Then
oAddon.getByName("soft1").ImageIdentifier = Mid(oBoiteApps.GetControl("SoftButton1").Model.ImageURL,1,Len(oBoiteApps.GetControl("SoftButton1").Model.ImageURL)-7)
Else
oAddon.getByName("soft1").ImageIdentifier = fCheminDmaths+"icons/"+sThemeIcons+"/launchsoftware1"
Endif
rem l'infobulle
If GetIndiceAppsPref(oBoiteApps.Model.FileControl2.Text) = -1 Then
oAddon.getByName("soft1").Title = getFileNameOnly(ConvertToURL(oBoiteApps.GetControl("FileControl2").Text))
Elseif AppsPref(GetIndiceAppsPref(oBoiteApps.Model.FileControl2.Text),2)<>"" Then
oAddon.getByName("soft1").Title = AppsPref(GetIndiceAppsPref(oBoiteApps.Model.FileControl2.Text),2)
Else oAddon.getByName("soft1").Title = "Software 1"
End If
Else
oAddon.getByName("soft1").Context = "hidden"
End If
If oBoiteApps.Model.FileControl3.Text <> "" Then
rem le contexte puis l'icone
'oAddon.getByName("soft2").Context = "com.sun.star.text.TextDocument"
If oBoiteApps.GetControl("SoftButton2").Model.ImageURL <>"" Then
oAddon.getByName("soft2").ImageIdentifier = Mid(oBoiteApps.GetControl("SoftButton2").Model.ImageURL,1,Len(oBoiteApps.GetControl("SoftButton2").Model.ImageURL)-7)
Else
oAddon.getByName("soft2").ImageIdentifier = fCheminDmaths+"icons/"+sThemeIcons+"/launchsoftware2"
Endif
rem l'infobulle
If GetIndiceAppsPref(oBoiteApps.Model.FileControl3.Text) = -1 Then
oAddon.getByName("soft2").Title = getFileNameOnly(ConvertToURL(oBoiteApps.GetControl("FileControl3").Text))
Elseif AppsPref(GetIndiceAppsPref(oBoiteApps.Model.FileControl3.Text),2)<>"" Then
oAddon.getByName("soft2").Title = AppsPref(GetIndiceAppsPref(oBoiteApps.Model.FileControl3.Text),2)
Else oAddon.getByName("soft2").Title = "Software 2"
End If
Else
oAddon.getByName("soft2").Context = "hidden"
End If
If oBoiteApps.Model.FileControl4.Text <> "" Then
rem le contexte puis l'icone
'oAddon.getByName("soft3").Context = "com.sun.star.text.TextDocument"
If oBoiteApps.GetControl("SoftButton3").Model.ImageURL <>"" Then
oAddon.getByName("soft3").ImageIdentifier = Mid(oBoiteApps.GetControl("SoftButton3").Model.ImageURL,1,Len(oBoiteApps.GetControl("SoftButton3").Model.ImageURL)-7)
Else
oAddon.getByName("soft3").ImageIdentifier = fCheminDmaths+"icons/"+sThemeIcons+"/launchsoftware3"
Endif
rem l'info bulle
If GetIndiceAppsPref(oBoiteApps.Model.FileControl4.Text) = -1 Then
oAddon.getByName("soft3").Title = getFileNameOnly(ConvertToURL(oBoiteApps.GetControl("FileControl4").Text))
Elseif AppsPref(GetIndiceAppsPref(oBoiteApps.Model.FileControl4.Text),2)<>"" Then
oAddon.getByName("soft3").Title = AppsPref(GetIndiceAppsPref(oBoiteApps.Model.FileControl4.Text),2)
Else oAddon.getByName("soft3").Title = "Software 3"
End If
Else
oAddon.getByName("soft3").Context = "hidden"
End If
Endif
oConfigAccess.commitChanges()
End Sub
Function RegleAppsSousLinux(sCheminApps as String)as String
If (InStr(sCheminApps,"konqueror") > 0 and InStr(sCheminApps,"home") = 0) Then sCheminApps = sCheminApps & " " & GetRepertoirePath("home")
If (getFileExt(ConvertToURL(sCheminApps)) = ".jar" and Mid(sCheminApps,1,4) <> "file") Then sCheminApps = sCheminJava & " -jar " & sCheminApps
RegleAppsSousLinux = sCheminApps
End Function
Sub RegleNumerotationIcones rem cette macro regle lors de l'installation la numerotation des icones de la barre dmaths
NomIcone = Array("writeformula","lancecreationtableau","metenformule","metenvecteur","metenmesurealgebrique","metenangle","metenlimite","metenintegrale","metensomme","metenproduit","metenpointe","metendoublepointe","metenracine","metensysteme","metenmatrice","systemegraphique","matricegraphique","formulegraphique","formulegraphique2",_
"loadparcro","metentreaccolades","metentreparentheses","metenitalic","atalante","bordure_selection","affectetailleformule","encadreformule","augmentetailleformule","diminuetailleformule","repregraphique","lancetablevar","repregrille","reprediagbox","fairefigure","changemodeformule","lancebackup")
oConfigAccess = GetConfigAccess( "/org.openoffice.Office.Addons/AddonUI/OfficeToolBar", True )
If oConfigAccess.hasByName("org.openoffice.Office.addon.DMathsBarre") Then
oAddon = oConfigAccess.getByName("org.openoffice.Office.addon.DMathsBarre")
Dim sCheminImages$
Dim sElementNames$(),sTheme$, sCheminIcones$
Dim iPosition as Integer
sElementNames = oAddon.getElementNames()
iPosition = Instr(oAddon.getByname(oAddon.ElementNames(1)).ImageIdentifier,"theme")
sTheme = iif(iPosition<>0 , Mid(oAddon.getByname(oAddon.ElementNames(1)).ImageIdentifier,iPosition,6),"theme1")
sCheminIcones = fCheminDmaths & "icons/" & sTheme & "/"
For I = LBound(sElementNames()) To UBound(sElementNames())-3 rem car il y a les trois images des applications preferees
oAddon.getByname(sElementNames(I)).ImageIdentifier = sCheminIcones & NomIcone(I)
Next I
Endif
oConfigAccess.commitChanges()
End Sub
Sub MaJIconesDuMenuDmaths rem cette macro ecrite le 20/02/2007 regle lors de l'installation les icones du menu dmaths
NomIcone = Array("aide","faq","ref","addon","update","choixoptionsdmaths","update","info")
oConfigAccess = GetConfigAccess( "/org.openoffice.Office.Addons/AddonUI/OfficeMenuBar", True )
If oConfigAccess.hasByName("org.openoffice.Office.addon.aide") Then
oAddon = oConfigAccess.getByName("org.openoffice.Office.addon.aide").Submenu
Dim sCheminImages$
Dim sElementNames$(),sTheme$, sCheminIcones$
Dim iPosition as Integer
sElementNames = oAddon.getElementNames()
iPosition = Instr(oAddon.getByname(oAddon.ElementNames(1)).ImageIdentifier,"theme")
sTheme = iif(iPosition<>0 , Mid(oAddon.getByname(oAddon.ElementNames(1)).ImageIdentifier,iPosition,6),"theme1")
sCheminIcones = fCheminDmaths & "icons/" & sTheme & "/"
For I = LBound(sElementNames()) To UBound(sElementNames())
oAddon.getByname(sElementNames(I)).ImageIdentifier = sCheminIcones & NomIcone(I)
Next I
Endif
oConfigAccess.commitChanges()
End Sub
Sub ChoisirThemeIcone(sTheme as String) rem cette macro permet choisir le theme des icones affichées
sRepertoireDmaths = DetermineRepertoireDmaths rem sRepertoireDmaths donne l adresse des fichiers
Dim sElementNames$()
oConfigAccess = GetConfigAccess( "/org.openoffice.Office.Addons/AddonUI/OfficeToolBar", True )
If oConfigAccess.hasByName("org.openoffice.Office.addon.DMathsBarre") Then
oAddon = oConfigAccess.getByName("org.openoffice.Office.addon.DMathsBarre")
sElementNames = oAddon.getElementNames()
For I = LBound(sElementNames()) To UBound(sElementNames())
oAddon.getByname(sElementNames(I)).ImageIdentifier = ReplacesTheme(oAddon.getByname(sElementNames(I)).ImageIdentifier , sTheme)
' oAddon.getByname(sElementNames(I)).Context = "com.sun.star.text.TextDocument"
Next I
Endif
oConfigAccess.commitChanges()
oConfigAccess = GetConfigAccess( "/org.openoffice.Office.Addons/AddonUI/OfficeToolBar", True )
If oConfigAccess.hasByName("org.openoffice.Office.addon.DMathsDisplayBarre") Then
oAddon = oConfigAccess.getByName("org.openoffice.Office.addon.DMathsDisplayBarre")
sElementNames = oAddon.getElementNames()
For I = LBound(sElementNames()) To UBound(sElementNames())
oAddon.getByname(sElementNames(I)).ImageIdentifier = ReplacesTheme(oAddon.getByname(sElementNames(I)).ImageIdentifier , sTheme)
' oAddon.getByname(sElementNames(I)).Context = "com.sun.star.text.TextDocument"
Next I
Endif
oConfigAccess.commitChanges()
oConfigAccess = GetConfigAccess( "/org.openoffice.Office.Addons/AddonUI/OfficeMenuBar", True )
If oConfigAccess.hasByName("org.openoffice.Office.addon.aide") Then
oConfigAccess.getByName("org.openoffice.Office.addon.aide").Context = "com.sun.star.text.TextDocument"
oAddon = oConfigAccess.getByName("org.openoffice.Office.addon.aide").SubMenu
sElementNames = oAddon.getElementNames()
For I = LBound(sElementNames()) To UBound(sElementNames())
oAddon.getByname(sElementNames(I)).ImageIdentifier = ReplacesTheme(oAddon.getByname(sElementNames(I)).ImageIdentifier , sTheme)
Next I
Endif
oConfigAccess.commitChanges()
End Sub
Sub PreselectionneNumeroTheme as String
Dim iNumeroTheme, iPos as Integer
iNumeroTheme = 1
oConfigAccess = GetConfigAccess( "/org.openoffice.Office.Addons/AddonUI/OfficeToolBar", True )
If oConfigAccess.hasByName("org.openoffice.Office.addon.DMathsBarre") Then
oAddon = oConfigAccess.getByName("org.openoffice.Office.addon.DMathsBarre")
iPos = Instr(oAddon.getByname(oAddon.ElementNames(0)).ImageIdentifier,"theme")
If iPos > 0 Then
iNumeroTheme = Cint(Mid(oAddon.getByname(oAddon.ElementNames(0)).ImageIdentifier,iPos+5,1)
Endif
End If
oChoixrepinstallation.GetControl("OptionButton"&Cstr(iNumeroTheme)).State = 1
PreselectionneNumeroTheme = "theme" & Cstr(iNumeroTheme)
End Sub
rem cette macro détermine la chaine theme 1, 2 ou 3 ... choisie dans la boite
Function DeterminesThemeIcons(oBoiteApps as Object) as String
Dim sResult as String
sResult = "theme1"
For I = 2 To iNbreThemesIcones
If oBoiteApps.GetControl("OptionButton"&Cstr(I)).State = True then sResult = "theme"& Cstr(I)
Next I
DeterminesThemeIcons = sResult
End Function
rem cette macro fabrique l'image identifier
Function ReplacesTheme(sCheminImage,sTheme as String) as String
Dim iPos,iLen as Integer
iPos = Instr(sCheminImage,"theme")
iLen = Len(sCheminImage)
if iPos > 0 Then
ReplacesTheme = sRepertoireDmaths & "icons/" & sTheme & Mid(sCheminImage,iPos+6,iLen-iPos-5)
Else
ReplacesTheme = sCheminImage
Endif
End Function
rem macros gérant les boutons soft après changement du texte d'un filecontrol
Sub GereSoftButton1
GereSoftButton(oChoixrepinstallation,1)
End Sub
Sub GereSoftButton2
GereSoftButton(oChoixrepinstallation,2)
End Sub
Sub GereSoftButton3
GereSoftButton(oChoixrepinstallation,3)
End Sub
Sub GereSoftButton(oBoiteApps as Object, iNumero as Integer)
If oBoiteApps.GetControl("FileControl"+Cint(iNumero+1)).Text <> "" Then
If Len(oBoiteApps.GetControl("FileControl"+Cint(iNumero+1)).Model.Text) = 1 Then oBoiteApps.GetControl("SoftButton"+Cint(iNumero)).Model.ImageURL = fCheminDmaths & "icons/launchsoftware" & Cint(iNumero) &"_16.bmp"
oBoiteApps.GetControl("SoftButton"+Cint(iNumero)).Visible = True
oBoiteApps.GetControl("SoftButton"+Cint(iNumero)).Enable = True
Else
oBoiteApps.GetControl("SoftButton"+Cint(iNumero)).Visible = False
oBoiteApps.GetControl("SoftButton"+Cint(iNumero)).Enable = False
Endif
End Sub
rem donne l'indice correspondant a l'application
Function GetIndiceAppsPref(sAppsPref as String) as Integer
GetIndiceAppsPref = -1 rem valeur si pas dans la liste prédéfinie
For I = 0 To 9
If AppsPref(I,0) = sAppsPref Then
GetIndiceAppsPref = I
Exit For
End If
Next I
End Function
Sub LoadAppsLinux
rem les images incluses dans l'addon n'ont pas d'extension.
AppsPref(0,0) = "/usr/bin/dia"
AppsPref(0,1) = fCheminDmaths+"icons/appspref/launchdia_16.bmp"
AppsPref(0,2) = " Dia "
AppsPref(1,0) = "/usr/bin/drgeo"
AppsPref(1,1) = ""
AppsPref(1,2) = " Dr Geo "
AppsPref(2,0) = "/usr/local/Declic/declic.sh"
AppsPref(2,1) = ""
AppsPref(2,2) = " Déclic "
AppsPref(3,0) = CurDir+"/Declic/declic.sh"
AppsPref(3,1) = ""
AppsPref(3,2) = " Déclic "
AppsPref(4,0) = "/usr/bin/konqueror"
AppsPref(4,1) = fCheminDmaths+"icons/appspref/konqueror_16.bmp"
AppsPref(4,2) = " Konqueror "
AppsPref(5,0) = "/usr/bin/konsole"
AppsPref(5,1) = ""
AppsPref(5,2) = " Konsole "
AppsPref(6,0) = "/usr/bin/kmail"
AppsPref(6,1) = ""
AppsPref(6,2) = " Kmail "
AppsPref(7,0) = CurDir+"/Declic/declic.sh"
AppsPref(7,1) = ""
AppsPref(7,2) = " Declic "
End Sub
Sub LoadAppsWin
AppsPref(0,0) = "C:\Program Files\GeoGebra\Geogebra.exe"
AppsPref(0,1) = ""
AppsPref(0,2) = " GeoGebra "
AppsPref(1,0) = "C:\Program Files\dia\bin\dia.bat"
AppsPref(1,1) = fCheminDmaths+"icons/appspref/launchdia_16.bmp"
AppsPref(1,2) = " Dia "
AppsPref(2,0) = "C:\Program Files\ATELIERS\geom3D\Geom3d.exe"
AppsPref(2,1) = ""
AppsPref(2,2) = " Atelier géomtrie 3D "
AppsPref(3,0) = "C:\Program Files\ATELIERS\geom2D\Geom96.exe"
AppsPref(3,1) = ""
AppsPref(3,2) = " Atelier géométrie 2D "
End Sub
Sub SetGalleryAndAutotext(sModule, Optional sLangue as String, Optional bInst as Boolean)
Dim I, J, Nbre as integer
Dim sLeCheminGaleAuto(), sSuffixe as String
sRepertoireDmaths = DetermineRepertoireDmaths rem sRepertoireDmaths donne l adresse des fichiers
If IsMissing(bInst) Then bInst = False
If IsMissing(sLangue) Then sLangue = "fr"
If sModule = "Gallery" Then sSuffixe = "gallery" Else sSuffixe = "autotext/" & sLangue
oConfigAccess = GetConfigAccess( "/org.openoffice.Office.Common", True )
sLeCheminGaleAuto() = oConfigAccess.getByName("Path").getByName("Current").getByName(sModule)
rem suppression du chemin inutile
J = -1
If Not IsEmpty(sLeCheminGaleAuto()) Then
For I = LBound(sLeCheminGaleAuto()) To Ubound(sLeCheminGaleAuto())
If Instr(sLeCheminGaleAuto(I),"DmathsAddon") = 0 Then
J = J+1
sLeCheminGaleAuto(J) = sLeCheminGaleAuto(I)
Endif
Next I
Endif
rem ajout du nouveau chemin
If bInst = True Then
ReDim Preserve sLeCheminGaleAuto(J+1)
sLeCheminGaleAuto(J+1) = sRepertoireDmaths & sSuffixe
ElseIf J>=0 Then
ReDim Preserve sLeCheminGaleAuto(J)
Endif
oConfigAccess.getByName("Path").getByName("Current").replaceByName(sModule,sLeCheminGaleAuto())
oConfigAccess.Commitchanges()
End Sub
Function GetRepertoirePath(sInstPath as String) as String 'donne le répertoire correspondant
Dim oPathSubstSrv as Object
Dim sPath as String
sInstPath = "$("+sInstPath+")"
oPathSubstSrv = createUnoService("com.sun.star.comp.framework.PathSubstitution")
sPath = ConvertFromUrl(oPathSubstSrv.getSubstituteVariableValue(sInstPath))
GetRepertoirePath = sPath
End Function
Function fCheminDmaths() as String rem écrite par Didier Dorange-Pattoret
' Dim GetPIP as Object, repExt as String
' GetPIP = GetDefaultContext.getValueByName("/singletons/com.sun.star.deployment.PackageInformationProvider")
' repExt = GetPIP.getPackageLocation("Dmaths")
' fCheminDmaths = repExt & "/Fichiers/"
Dim xContext, LeRep as String rem modifiee le 20 mars 2009
Dim oAC As Object
oCmdEnv = CreateUnoListener( "CmdEnv_","com.sun.star.deployment.XCommandEnvironment" )
GetPMF = GetDefaultContext.getValueByName("/singletons/com.sun.star.deployment.thePackageManagerFactory")
If TestInstallRezo Then xContext = "shared" Else xContext = "user"
LeRep = GetPMF.getPackageManager(xContext).getDeployedPackage("Dmaths","DmathsAddon.oxt",oAc,oCmdEnv).URL & "/Fichiers/"
fCheminDmaths = LeRep
End Function
Function fCheminduFichierDmathsODS as String rem cette fonction donne le chemin du fichier dmaths.ods utilise pour les tracer point par point
If TestInstallRezo Then
fCheminduFichierDmathsODS = ConvertToURL(GetRepertoirePath("user")+"/dmaths/dmaths.ods")
Else
fCheminduFichierDmathsODS = fChemindmaths & "dmaths.ods"
EndIf
End function
Rem devra etre remplacee par fChemindmaths
Function DetermineRepertoireDmaths as String rem cette fonction determine le fichier racine pour le choix des icones, autotext, galleries
Dim xContext, LeRep as String rem modifiee le 20 mars 2009
Dim oAC As Object
oCmdEnv = CreateUnoListener( "CmdEnv_","com.sun.star.deployment.XCommandEnvironment" )
GetPMF = GetDefaultContext.getValueByName("/singletons/com.sun.star.deployment.thePackageManagerFactory")
If TestInstallRezo Then xContext = "shared" Else xContext = "user"
LeRep = GetPMF.getPackageManager(xContext).getDeployedPackage("Dmaths","DmathsAddon.oxt",oAc,oCmdEnv).URL & "/Fichiers/"
DetermineRepertoireDmaths = LeRep
End Function
'Function DetermineOS as Integer
' If Getguitype = 1 Then
' DetermineOS = 1
' ElseIf Getguitype = 3 or (Getguitype = 4 and FileExists("/Users")) Then
' DetermineOS = 3
' Else
' DetermineOS = 4
' Endif
'End Function
Function IsMacOS as Boolean
IsMacOS = False
If Getguitype = 3 or (Getguitype = 4 and FileExists("/Users")) Then IsMacOS = True
End Function
Function OOoNumVersion() As Integer
'Retreives the running OOO version
Dim aSettings, aConfigProvider
Dim aParams2(0) As new com.sun.star.beans.PropertyValue
Dim sProvider$, sAccess$
sProvider = "com.sun.star.configuration.ConfigurationProvider"
sAccess = "com.sun.star.configuration.ConfigurationAccess"
aConfigProvider = createUnoService(sProvider)
aParams2(0).Name = "nodepath"
aParams2(0).Value = "/org.openoffice.Setup/Product"
aSettings = aConfigProvider.createInstanceWithArguments(sAccess, aParams2())
If aSettings.hasbyname("ooSetupVersionAboutBox") Then
sOOOVersion = aSettings.getbyname("ooSetupVersionAboutBox")
Else
sOOOVersion = aSettings.getbyname("ooSetupVersion")
EndIf
If Len(sOOOVersion) = 3 Then sOOOVersion = sOOOVersion & ".0"
OOoNumVersion = Cint(Mid(sOOOVersion,1,1))*100 + Cint(Mid(sOOOVersion,3,1))*10 + Cint(Mid(sOOOVersion,5,1))
End Function
Function OOoName As String
'Retreives the running OOO version
Dim aSettings, aConfigProvider
Dim aParams2(0) As new com.sun.star.beans.PropertyValue
Dim sProvider$, sAccess$
sProvider = "com.sun.star.configuration.ConfigurationProvider"
sAccess = "com.sun.star.configuration.ConfigurationAccess"
aConfigProvider = createUnoService(sProvider)
aParams2(0).Name = "nodepath"
aParams2(0).Value = "/org.openoffice.Setup/Product"
aSettings = aConfigProvider.createInstanceWithArguments(sAccess, aParams2())
' Print aSettings.getbyname("ooName")
OOoName = aSettings.getbyname("ooName")
End Function
rem******************************************************************************************************************
Sub RegleCheminDesIcones(sLeChemindeDmaths as String) rem cette macro regle le chemin des icones des comptes non admin dans les install multi
rem à reprendre pour Mac
Dim sPath, sRacine, sValue, sCheminDuCompte as String
sLeNouveauChemindeDmaths = fCheminDmaths
rem determine les comptes et appelle la procedure de nettoyage de chacun
If GetGuitype = 1 Then
sPath = GetRepertoirePath("home")
sRacine = GetRepertoire(sPath)
ElseIf IsMacOS Then
sRacine = "/Users"
Else
sRacine = "/home"
EndIf
sValue = Dir$(sRacine+GetPathSeparator,16)
Do
If sValue<>".." and Mid(sValue,1,1)<>"." Then
If (GetAttr(sRacine+GetPathSeparator+sValue) AND 16 > 0) Then
sCheminDuCompte = sRacine+GetPathSeparator+sValue
Call RegleChemin(sCheminDuCompte,sLeChemindeDmaths,sLeNouveauChemindeDmaths)
EndIf
End If
sValue = Dir$
Loop Until sValue = ""
End Sub
Sub RegleChemin(sCheminDuCompte,src,dest as String)
Dim sCheminUser, aFile, aNewFile, sLine as String ' contient le chemin de l'utilisateur en cours
sCheminUser = sCheminDuCompte + SuffixeDuCompte
aFile = ConvertToUrl(sCheminUser & "/registry/data/org/openoffice/Office/Addons.xcu")
'Print aFile
'Print FileExists(aFile)
If FileExists(aFile) Then
aFileNew = ConvertToUrl(sCheminUser & "/registry/data/org/openoffice/Office/Addons.new")
iNumberNew = Freefile
Open aFileNew For Output As iNumberNew
iNumber = Freefile
Open aFile For Input As iNumber
While not eof(iNumber)
Line Input #iNumber, sLine
' If InStr(sLine,src)>0 then print "on change"
sLine = RemplaceChaine(sLine,src,dest,False)
Print #iNumberNew, sLine
wend
Close #iNumber
Close #iNumberNew
kill (aFile)
Name aFileNew as aFile
End If
End Sub
Function SuffixeDuCompte
Dim iPos , iLong as Integer
If GetGuitype = 1 Then iPos = Len(GetRepertoire(GetRepertoirePath("home")&"\"))+1 Else iPos = Len(GetRepertoirePath("home"))+1
iLong = Len(GetRepertoirePath("user"))
SuffixeDuCompte = Mid(GetRepertoirePath("user"),iPos,iLong-iPos+1)
End Function
Function RemplaceChaine(ByVal chaine As String, src As String, dest As String, casse As Boolean)
' fournit une chaine dont toutes les occurences de src ont été remplacées par dest
'casse = true pour distinguer majuscules/minuscules, = false sinon
Dim lsrc As Integer, i As Integer, kas As Integer
dim limite as string
limite=""
kas = iif(casse, 0, 1)
lsrc = len(src)
i = instr(1, chaine, src, kas)
while i<>0
while i<0
limite=limite+left(chaine,32000)
chaine=mid(chaine,32001)
i=instr(1, chaine, src, kas)
wend
' ici i est toujours positif non nul
if i>1 then
limite = limite + Left(chaine, i-1) +dest
else ' ici i vaut toujours 1
limite = limite +dest
endif
' raccourcir en deux temps car risque : i+src > 32767
chaine = Mid(chaine, i)
chaine = Mid(chaine, 1+lsrc)
i = instr(1, chaine, src, kas)
wend
RemplaceChaine = limite + chaine
End Function
Function ControleDroits(byVal optional LeChemin as string) as boolean
on error goto PasDroit
leChemin=convertToURL(leChemin)+"/"
open leChemin+"temp" for output as #1
Print #1,cstr(now)
close #1
Kill LeChemin+"temp"
ControleDroits=True
Exit function
PasDroit:
ControleDroits=false
end function
function GetRepertoire (thePath as String) as String rem donne le repertoire situe deux branches en aval
Dim newSplit()
ReDim NewSplit(0)
splitted = split(thePath,GetPathSeparator)
newSplit() = splitted()
ReDim Preserve newSplit(0 to ubound(splitted)-2)
GetRepertoire = join(NewSplit(),GetPathSeparator)
End Function
Sub Nommage_Gdmath_bars 'for testing: GF
' renommage des barres d'Addon en Gdmath
Dim sNomdeBarre as String
REM ------- modul:writer OOoGdmath
If iLangInstall = 0 Then sNomdeBarre = "OOoGdmath" Else sNomdeBarre = "OOoGdmath-Addon"
oConfigAccessW = GetConfigAccess( "/org.openoffice.Office.UI.WriterWindowState/UIElements/States", True )
If oConfigAccessW.HasByName( "private:resource/toolbar/addon_org.openoffice.Office.addon.OOoGdmathBarre1") Then
oAddon = oConfigAccessW.getByName( "private:resource/toolbar/addon_org.openoffice.Office.addon.OOoGdmathBarre1")
oAddon.UIName = sNomdeBarre
Elseif oConfigAccessW.HasByName( "private:resource/toolbar/addon_2") Then
oAddon = oConfigAccessW.getByName( "private:resource/toolbar/addon_2")
oAddon.UIName = sNomdeBarre
Elseif oConfigAccessW.HasByName( "private:resource/toolbar/Add-on 2") Then
oAddon = oConfigAccessW.getByName( "private:resource/toolbar/Add-on 3")
oAddon.UIName = sNomdeBarre
Endif
oConfigAccessW.commitChanges()
REM ------- modul:draw OOoGdmath
If iLangInstall = 0 Then sNomdeBarre = "OOoGdmath" Else sNomdeBarre = "OOoGdmath-Addon"
oConfigAccessD = GetConfigAccess( "/org.openoffice.Office.UI.DrawWindowState/UIElements/States", True )
If oConfigAccessD.HasByName( "private:resource/toolbar/addon_org.openoffice.Office.addon.OOoGdmathBarre1") Then
oAddon = oConfigAccessD.getByName( "private:resource/toolbar/addon_org.openoffice.Office.addon.OOoGdmathBarre1")
oAddon.UIName = sNomdeBarre
Elseif oConfigAccessD.HasByName( "private:resource/toolbar/addon_2") Then
oAddon = oConfigAccessD.getByName( "private:resource/toolbar/addon_2")
oAddon.UIName = sNomdeBarre
Elseif oConfigAccessD.HasByName( "private:resource/toolbar/Add-on 2") Then
oAddon = oConfigAccessD.getByName( "private:resource/toolbar/Add-on 3")
oAddon.UIName = sNomdeBarre
Endif
oConfigAccessD.commitChanges()
End Sub
</script:module>
|