-Ce dépôt rassemble les développements de macros pour OpenOffice.org.
+Ce dépôt rassemble les développements de macros pour LibreOffice.
--- /dev/null
+* Macro CODA : voir http://wiki.auf.org/wikiteki/OpenOffice/MacroCoda
+
+* Macro CODA : afficher une fenêtre avertissant de l'attente.
+
+ Le transfert pourrait mettre jusqu'à NN secondes avant de se
+ terminer. OpenOffice restera bloqué pendant toute cette période.
+ Veuillez patienter le temps du transfert des données...
+
+* Macro CODA : permettre de supprimer les lignes de sous-total d'une
+ interrogation des détails.
--- /dev/null
+PACKAGE = $(shell dpkg-parsechangelog | sed -n 's/^Source: //p')
+VERSION = $(shell dpkg-parsechangelog | sed -n 's/^Version: //p')
+DIST = $(shell dpkg-parsechangelog | sed -n 's/^Distribution: //p')
+
+all: build
+
+build:
+ sed -i '/^ <version /s/="[^"]*"/="'$(VERSION)'"/' extension/description.xml
+
+install:
+ install -m 0755 -d $(DESTDIR)/usr/lib/libreoffice/share/extensions
+ cp -a extension $(DESTDIR)/usr/lib/libreoffice/share/extensions/
+
+clean:
+
+deb:
+ debuild -I.git -I*.ex -us -uc -b && \
+ echo -e "\n\n==> Lancer \"sudo debi\" pour tester l'installation.\n"
+
+release:
+ debuild -I.git -I*.ex -us -uc -tc -sa && debrelease --dput $(DIST)-test
--- /dev/null
+auf-libreoffice-extension (1204.1) precise; urgency=low
+
+ * changement d'objectif : des extensions pour LibreOffice
+
+ -- Progfou <jean-christophe.andre@auf.org> Tue, 10 Sep 2013 00:34:32 -0400
+
+auf-macros-openoffice (1.13) lucid; urgency=low
+
+ * retour à l'objectif d'origine : les macros pour OpenOffice
+
+ -- Progfou <jean-christophe.andre@auf.org> Tue, 10 Sep 2013 00:34:32 -0400
+
+auf-poste-client-reflets (1.12) jaunty; urgency=low
+
+ * rdesktop:
+ - Support du clavier au Laos.
+
+ * OpenOffice.org:
+ - Utilisation des boîtes de dialogue du système par défaut.
+
+ -- Progfou <jean-christophe.andre@auf.org> Tue, 21 Sep 2010 23:34:22 +0700
+
+auf-poste-client-reflets (1.11.1) jaunty; urgency=low
+
+ * Complément de support de la distribution officielle de OpenOffice.org.
+
+ -- Progfou <jean-christophe.andre@auf.org> Thu, 11 Mar 2010 05:10:51 +0700
+
+auf-poste-client-reflets (1.11) jaunty; urgency=low
+
+ * OpenOffice.org :
+ - Support de la distribution officielle de OpenOffice.org.
+
+ * Macro CODA :
+ - Mise à jour et ajout d'informations de droits d'auteur (copyright).
+ - Constante pour la liste des colonnes à garder au format numérique.
+
+ -- Progfou <jean-christophe.andre@auf.org> Fri, 05 Mar 2010 09:45:25 +0700
+
+auf-poste-client-reflets (1.10.3) jaunty; urgency=high
+
+ * rdesktop: argl !!! effacement abusif en cas de non diversion ! :-(
+
+ -- Progfou <jean-christophe.andre@auf.org> Tue, 27 Oct 2009 03:37:57 +0700
+
+auf-poste-client-reflets (1.10.2) jaunty; urgency=low
+
+ * rdesktop: annulation du support du capslock qui pose problème. :-(
+
+ -- Progfou <jean-christophe.andre@auf.org> Tue, 27 Oct 2009 03:00:19 +0700
+
+auf-poste-client-reflets (1.10.1) jaunty; urgency=low
+
+ * rdesktop: correction de la gestion des diversions
+
+ -- Progfou <jean-christophe.andre@auf.org> Sun, 25 Oct 2009 02:26:58 +0700
+
+auf-poste-client-reflets (1.10) jaunty; urgency=low
+
+ * rdesktop :
+ - Diversion du clavier commun pour ajouter le support du capslock.
+ (LP: #251709)
+ - Ajout d'un correctif sur le [.] du pavé numérique via xmodmap.
+ - Ajout d'une dépendance à x11-xserver-utils pour xmodmap.
+
+ * OpenOffice.org :
+ - Ajout d'une version (≥ 3.1.1) à la dépendance sur openoffice.org.
+ (http://wiki.auf.org/wikiteki/OpenOffice/Alerte311)
+ - Ajout du paramétrage de la sécurité des macros sur « moyenne ».
+
+ * Macro CODA :
+ - Correction des bogues relevés et optimisation du code.
+ (http://wiki.auf.org/wikiteki/OpenOffice/MacroCoda)
+ - Ajout de raccourcis claviers pour le menu CODA dans Calc.
+ - Ajout d'un choix pour coller une interrogation détails à la suite.
+
+ -- Progfou <jean-christophe.andre@auf.org> Sun, 25 Oct 2009 00:35:00 +0700
+
+auf-poste-client-reflets (1.9) jaunty; urgency=low
+
+ * Ajout d'une macro pour coller les interrogations CODA.
+ * Intégration de cette macro dans la barre de menu de Calc.
+ * Ajout du support pour OOo 3.x dans les scripts Debian.
+
+ -- Progfou <jean-christophe.andre@auf.org> Thu, 03 Sep 2009 04:16:44 +0700
+
+auf-poste-client-reflets (1.8.1) jaunty; urgency=low
+
+ * Licence : le nom de machine est limité à 15 caractères.
+ * Timeout : mis à 30 par défaut puisque c'est ce que l'aide conseille.
+
+ -- Progfou <jean-christophe.andre@auf.org> Sun, 09 Aug 2009 04:25:18 +0700
+
+auf-poste-client-reflets (1.8) jaunty; urgency=low
+
+ * Réactivation de l'extension "auf-reflets-tse.oxt" pour OpenOffice.org.
+ * Ajout d'une catégorie d'options « Extensions AUF » et d'une page
+ d'options « Support Reflets-TSE (CODA) » afin de faciliter le
+ paramétrage du délai pour le copier/coller.
+ * Ajout d'un logo AUF, d'une description de l'extension et son auteur
+ pour un affichage plus officiel dans le gestionnaire des extensions.
+
+ -- Progfou <jean-christophe.andre@auf.org> Thu, 16 Jul 2009 04:03:05 +0700
+
+auf-poste-client-reflets (1.7) hardy; urgency=low
+
+ * Bogue sur le test d'existence d'une ancienne licence.
+
+ -- Progfou <jean-christophe.andre@auf.org> Thu, 28 May 2009 23:35:16 +0700
+
+auf-poste-client-reflets (1.6.1) hardy; urgency=low
+
+ * Suppression de la construction du paquet auf-reflets-tse.
+
+ -- Progfou <jean-christophe.andre@auf.org> Fri, 08 May 2009 04:00:22 +0700
+
+auf-poste-client-reflets (1.6) hardy; urgency=low
+
+ * Configuration spécifique à une machine via /etc/auf-reflets-tse.conf.
+ * Suppression de la licence sélectionnée si elle vient du serveur "AD".
+ * Construction du nom de la machine à partir du "username" configuré.
+ (uniquement si le nom de la machine n'est pas lui-même configuré)
+
+ -- Progfou <jean-christophe.andre@auf.org> Fri, 08 May 2009 03:16:19 +0700
+
+auf-poste-client-reflets (1.5) hardy; urgency=low
+
+ * La géométrie "auto" fait maintenant du « presque plein-écran ».
+ * Retrait de la décoration de fenêtre pour la géométrie "workarea".
+ * Ajout d'une variable "extra" pour la configuration personnalisée.
+
+ -- Progfou <jean-christophe.andre@auf.org> Sat, 22 Nov 2008 03:02:00 +0700
+
+auf-poste-client-reflets (1.4) hardy; urgency=low
+
+ * Début de support Coda dans OpenOffice.
+
+ -- Progfou <jean-christophe.andre@auf.org> Wed, 15 Oct 2008 03:15:16 +0700
+
+auf-poste-client-reflets (1.3.3) hardy; urgency=low
+
+ * Création d'un paquet transitionnel pour migration automatique.
+
+ -- Progfou <jean-christophe.andre@auf.org> Wed, 08 Oct 2008 16:04:17 +0700
+
+auf-poste-client-reflets (1.3.2) hardy; urgency=low
+
+ * Gestion du cas d'imprimantes PDF multiples : on prend la première.
+
+ -- Progfou <jean-christophe.andre@auf.org> Mon, 06 Oct 2008 10:44:38 +0700
+
+auf-poste-client-reflets (1.3.1) hardy; urgency=low
+
+ * Utilisation de Zenity pour signaler l'imprimante PDF manquante.
+
+ -- Progfou <jean-christophe.andre@auf.org> Wed, 01 Oct 2008 06:05:06 +0700
+
+auf-poste-client-reflets (1.3) stable; urgency=low
+
+ * thomatisation (nettoyage à la thomas, aucun changement autre que
+ cosmétique)
+
+ -- Thomas NOEL <thomas.noel@auf.org> Tue, 30 Sep 2008 14:50:45 +0000
+
+auf-poste-client-reflets (1.2.1) gutsy; urgency=low
+
+ * Déplacement des pixmaps au bon endroit, grmph...
+
+ -- Progfou <jean-christophe.andre@auf.org> Sat, 26 Jan 2008 04:59:29 +0700
+
+auf-poste-client-reflets (1.2) gutsy; urgency=low
+
+ * Version officielle sur le dépôt APT de l'AuF
+ * L'option geometry est maintenant positionnée à "fullscreen" par defaut
+ * L'option printer est maintenant positionnée à "auto" par defaut
+ * Les options geometry et printer sont forcées lors de cette mise à jour
+ * Calcul dynamique des options de configuration manquantes
+
+ -- Progfou <jean-christophe.andre@auf.org> Sat, 26 Jan 2008 04:11:41 +0700
+
+auf-poste-client-reflets (1.1) feisty; urgency=low
+
+ * Auto-adaptation à la taille de l'écran
+
+ -- Progfou <jean-christophe.andre@auf.org> Fri, 21 Sep 2007 09:43:00 +0700
+
+auf-poste-client-reflets (1.0) feisty; urgency=low
+
+ * Version initiale
+ * Crée automatiquement un fichier de configuration à la première exécution
+
+ -- Progfou <jean-christophe.andre@auf.org> Mon, 16 Jul 2007 17:54:00 +0700
+
--- /dev/null
+Source: auf-libreoffice-extension
+Section: editors
+Priority: optional
+Maintainer: Progfou <jean-christophe.andre@auf.org>
+Build-Depends: debhelper (>= 5)
+Standards-Version: 3.9.3
+
+Package: auf-libreoffice-extension
+Architecture: all
+Depends: ${misc:Depends}, libreoffice-core (>= 1:3.3~), python3-uno (>= 4.0~) | python-uno
+Recommends: libreoffice-calc
+Description: installation de l'extension LibreOffice de l'AUF
+ Ce paquet fournit une extension LibreOffice pour effectuer quelques réglages
+ spécifiques à l'AUF :
+ * choix des boîtes de dialogue intégrées au bureau plutôt que natives ;
+ * changement du niveau de sécurité des macros (un peu plus tolérant) ;
+ * augmentation du délai (à 30 secondes) pour un copier-coller via TSE ;
+ * macro Calc pour le copier-coller des interrogations depuis CODA ;
+ * macro Calc pour le copier-coller d'une sélection vers un wiki MoinMoin.
--- /dev/null
+This package was debianized by Progfou <jean-christophe.andre@auf.org> on
+Mon, 16 Jul 2007 17:54:00 +0700.
+
+It was downloaded from http://git.auf.org/?p=macros-openoffice.git
+
+Upstream Author:
+
+ Progfou <jean-christophe.andre@auf.org>
+
+Copyright Holder:
+
+ Copyright (C) 2007-2010,2013 AUF -- www.auf.org
+
+License:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This package 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 License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2007-2010,2013 AUF -- www.auf.org
+and is licensed under the GPL, see above.
--- /dev/null
+auf-libreoffice-extension: image-file-in-usr-lib usr/lib/libreoffice/share/extensions/extension/images/coda-26x26.png
+auf-libreoffice-extension: image-file-in-usr-lib usr/lib/libreoffice/share/extensions/extension/images/logo-auf.png
--- /dev/null
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This has to be exported to make some magic below work.
+#export DH_OPTIONS
+
+%:
+ dh $@
--- /dev/null
+activate /usr/lib/libreoffice/share/extensions
--- /dev/null
+<?xml version='1.0' encoding='UTF-8'?>
+<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Addons" oor:package="org.openoffice.Office">
+ <node oor:name="AddonUI">
+ <node oor:name="OfficeMenuBar">
+ <node oor:name="org.auf.openoffice.Macros" oor:op="replace">
+ <prop oor:name="Context" oor:type="xs:string">
+ <value>com.sun.star.sheet.SpreadsheetDocument</value>
+ </prop>
+ <prop oor:name="Title" oor:type="xs:string">
+ <value>A~UF</value>
+ </prop>
+ <prop oor:name="ImageIdentifier" oor:type="xs:string">
+ <value>%origin%/images/logo-auf.png</value>
+ </prop>
+ <node oor:name="Submenu">
+ <node oor:name="menu00" oor:op="replace">
+ <prop oor:name="Context" oor:type="xs:string">
+ <value>com.sun.star.sheet.SpreadsheetDocument</value>
+ </prop>
+ <prop oor:name="Title" oor:type="xs:string">
+ <value>Copier le contenu de la feuille courante vers un wiki ~MoinMoin</value>
+ </prop>
+ <prop oor:name="URL" oor:type="xs:string">
+ <value>service:org.auf.openoffice.calc2moin.Copier?execute</value>
+ </prop>
+ <prop oor:name="Target" oor:type="xs:string">
+ <value>_self</value>
+ </prop>
+ <prop oor:name="ImageIdentifier" oor:type="xs:string">
+ <value/>
+ </prop>
+ </node>
+ <node oor:name="menu01" oor:op="replace">
+ <prop oor:name="Context" oor:type="xs:string">
+ <value>com.sun.star.sheet.SpreadsheetDocument</value>
+ </prop>
+ <prop oor:name="Title" oor:type="xs:string">
+ <value>Coller une interrogation des ~détails</value>
+ </prop>
+ <prop oor:name="URL" oor:type="xs:string">
+ <value>service:org.auf.openoffice.CODA.CollerDetails?execute</value>
+ </prop>
+ <prop oor:name="Target" oor:type="xs:string">
+ <value>_self</value>
+ </prop>
+ <prop oor:name="ImageIdentifier" oor:type="xs:string">
+ <value/>
+ </prop>
+ </node>
+ <node oor:name="menu02" oor:op="replace">
+ <prop oor:name="Context" oor:type="xs:string">
+ <value>com.sun.star.sheet.SpreadsheetDocument</value>
+ </prop>
+ <prop oor:name="Title" oor:type="xs:string">
+ <value>Coller une interrogation des ~cumuls</value>
+ </prop>
+ <prop oor:name="URL" oor:type="xs:string">
+ <value>service:org.auf.openoffice.CODA.CollerCumuls?execute</value>
+ </prop>
+ <prop oor:name="Target" oor:type="xs:string">
+ <value>_self</value>
+ </prop>
+ <prop oor:name="ImageIdentifier" oor:type="xs:string">
+ <value/>
+ </prop>
+ </node>
+ <node oor:name="menu03" oor:op="replace">
+ <prop oor:name="Context" oor:type="xs:string">
+ <value>com.sun.star.sheet.SpreadsheetDocument</value>
+ </prop>
+ <prop oor:name="Title" oor:type="xs:string">
+ <value>Coller une interrogation des détails ~supplémentaire</value>
+ </prop>
+ <prop oor:name="URL" oor:type="xs:string">
+ <value>service:org.auf.openoffice.CODA.CollerDetailsEncore?execute</value>
+ </prop>
+ <prop oor:name="Target" oor:type="xs:string">
+ <value>_self</value>
+ </prop>
+ <prop oor:name="ImageIdentifier" oor:type="xs:string">
+ <value/>
+ </prop>
+ </node>
+ </node>
+ </node>
+ </node>
+<!--
+ <node oor:name="Images">
+ <node oor:name="org.auf.openoffice.CODA.icone" oor:op="replace">
+ <prop oor:name="URL" oor:type="xs:string">
+ <value>macro:///AUF.CODA.CodaCopieDetails</value>
+ </prop>
+ <node oor:name="UserDefinedImages">
+ <prop oor:name="ImageBigURL">
+ <value>%origin%/AUF/CODA_26.bmp</value>
+ </prop>
+ <prop oor:name="ImageSmallURL">
+ <value>%origin%/AUF/CODA_16.bmp</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+-->
+ </node>
+</oor:component-data>
--- /dev/null
+#!
+# -*- coding: utf-8 -*-
+"""
+Macro pour faciliter l'intégration des données provenant du logiciel
+CODA dans une feuille de calcul.
+
+Copyright : Agence universitaire de la Francophonie
+Licence : GNU General Public Licence, version 2
+Auteur : Jean Christophe André
+Date de création : septembre 2009
+"""
+import re
+import datetime
+import uno
+import unohelper
+from com.sun.star.awt import WindowDescriptor
+from com.sun.star.awt.WindowClass import MODALTOP
+from com.sun.star.awt.VclWindowPeerAttribute import OK, DEF_OK
+from com.sun.star.uno import Exception as UnoException, RuntimeException
+from com.sun.star.connection import NoConnectException
+from com.sun.star.lang import Locale, IllegalArgumentException
+from com.sun.star.beans import PropertyValue
+#from com.sun.star.util.ParagraphProperties import CENTER
+from com.sun.star.util.NumberFormat import CURRENCY, DATE, NUMBER
+from com.sun.star.i18n.NumberFormatIndex import NUMBER_1000DEC2
+from com.sun.star.container import NoSuchElementException
+
+COLONNES_NUMERIQUES = ('Montant doc','Montant EUR')
+
+##############################################################################
+
+def clipboard_data(ctx, mimetype='text/plain;charset=utf-16'):
+ clipboard = ctx.ServiceManager.createInstanceWithContext(
+ "com.sun.star.datatransfer.clipboard.SystemClipboard", ctx)
+ contents = clipboard.getContents()
+ #print "Contents:\n%s\n%s\n%s" % ("-" * 78, "* " + "\n* ".join(dir(contents)), "=" * 78)
+ #flavors = contents.getTransferDataFlavors()
+ #print "Flavors:\n%s\n%s\n%s" % ("-" * 78, "* " + "\n* ".join([flavor.MimeType for flavor in flavors]), "=" * 78)
+ found_flavor = None
+ for flavor in contents.getTransferDataFlavors():
+ if flavor.MimeType == mimetype:
+ found_flavor = flavor
+ break
+ if not found_flavor:
+ raise RuntimeError, u"Erreur : type de données '%s' non disponible.\n" \
+ u"\nAvez-vous bien sélectionné puis copié les données dans CODA ?" \
+ % mimetype
+ data = contents.getTransferData(found_flavor)
+ #print "Data:\n", "-" * 78, "\n", data
+ return data
+
+##############################################################################
+
+def main(ctx, action):
+ data = clipboard_data(ctx)
+
+ numeric_pattern = re.compile('^[+-]?[0-9]+([\. ][0-9][0-9][0-9])*([\.,][0-9]+)?$')
+ date_pattern = re.compile('^([0-9]?[0-9])/([0-9]?[0-9])/([0-9]?[0-9]?[0-9]?[0-9])$')
+
+ if action == 'cumuls':
+ sheet_name = u'CODA-Cumuls'
+ # on découpe le texte reçu en lignes puis en colonnes
+ # on ne garde ici que les 10 premières colonnes
+ data = [row.split('\t')[:10] for row in data.splitlines()]
+ data[0][6] = '' # suppression de la 2nde colonne 'Engagement'
+ data[0][8] = '' # suppression de la colonne 'Colonne9'
+
+ elif action == 'details' or action == 'details-encore':
+ sheet_name = u'CODA-Détails'
+ # on découpe le texte reçu en lignes puis en colonnes
+ data = [row.split('\t') for row in data.splitlines()]
+
+ else:
+ raise RuntimeError, u"Action inconnue (erreur de programmation)."
+
+ # on efface la dernière ligne pleine de car. nuls, le cas échéant
+ last = data[len(data)-1]
+ if len(last) == 1 and last[0].strip('\x00') == '':
+ del data[len(data)-1]
+
+ # on détermine le type des données, par colonne :
+ # - on vérifie si toutes les valeurs de la colonne sont identiques
+ # - on vérifie si la colonne ne contient que des dates
+ # - on vérifie si la colonne ne contient que des nombres
+ column_type = [str] * len(data[0])
+ for column in range(len(data[0])-1,-1,-1):
+ # quelques colonnes ne doivent pas être testées
+ if action in ('details','details-encore') and data[0][column] in ('Num doc','PCG'):
+ continue
+ # on prend la première valeur, nettoyée un peu pour l'analyse
+ first = data[1][column].strip().replace(u'\xa0','')
+ flag_date = first and re.match(date_pattern, first)
+ flag_numeric = first and first != '#DEV!' and re.match(numeric_pattern, first)
+ diff = False
+ # parcours des autres valeurs de la colonne
+ for row in range(2,len(data)):
+ value = data[row][column].strip().replace(u'\xa0','')
+ if value:
+ if not diff and value != first:
+ diff = True
+ if flag_date and not re.match(date_pattern, value):
+ flag_date = False
+ if flag_numeric and value != '#DEV!' and not re.match(numeric_pattern, value):
+ flag_numeric = False
+ # s'il y a au moins 2 lignes et que les valeurs dans la colonne
+ # sont toutes identiques et qu'il n'y a pas d'intitulé sur la
+ # colonne alors on supprime toute la colonne
+ if len(data) > 2 and not diff and not data[0][column]:
+ for row in range(len(data)):
+ del data[row][column]
+ del column_type[column]
+ continue
+ # si la colonne contient des dates, conversion des valeurs comme telles
+ if flag_date:
+ for row in range(1,len(data)):
+ value = data[row][column].strip().replace(u'\xa0','')
+ if value and value != '#DEV!':
+ m = re.match(date_pattern, value)
+ if m:
+ (day, month, year) = [int(x) for x in m.groups()]
+ if year < 50:
+ year += 2000
+ elif year < 100:
+ year += 1900
+ value = '%02d/%02d/%04d' % (month, day, year)
+ data[row][column] = value
+ column_type[column] = datetime.date
+ continue
+ # si la colonne est numérique, conversion des valeurs comme telles
+ if flag_numeric:
+ for row in range(1,len(data)):
+ value = data[row][column].strip().replace(u'\xa0','')
+ if value and value != '#DEV!':
+ data[row][column] = float(value.replace('.','').replace(',','.'))
+ column_type[column] = float
+ continue
+
+ #print "Data:\n", "-" * 78, "\n", data
+
+ # récupération du document en cours, vérification du type Spreadsheet
+ desktop = ctx.ServiceManager.createInstanceWithContext(
+ "com.sun.star.frame.Desktop", ctx)
+ document = desktop.getCurrentComponent()
+ if not document.supportsService("com.sun.star.sheet.SpreadsheetDocument"):
+ raise RuntimeError, u"Ce n'est pas un document de type Spreadsheet (Calc)."
+
+ # basculement vers la feuille de calcul concernée, création au besoin
+ sheets = document.getSheets()
+ try:
+ sheet = sheets.getByName(sheet_name)
+ new_sheet = False
+ except NoSuchElementException, e:
+ sheets.insertNewByName(sheet_name, 0)
+ sheet = sheets.getByName(sheet_name)
+ new_sheet = True
+ controller = document.getCurrentController()
+ controller.setActiveSheet(sheet)
+
+ # récupération des formats date, monétaire et nombre en français
+ # http://api.openoffice.org/docs/common/ref/com/sun/star/util/XNumberFormatTypes.html
+ # http://api.openoffice.org/docs/common/ref/com/sun/star/i18n/NumberFormatIndex.html
+ locale_fr_FR = Locale('fr', 'FR', '')
+ number_formats = document.getNumberFormats()
+ date_format = number_formats.getStandardFormat(DATE, locale_fr_FR)
+ currency_format = number_formats.getStandardFormat(CURRENCY, locale_fr_FR)
+ number_format = number_formats.getFormatIndex(NUMBER_1000DEC2, locale_fr_FR)
+ #format_string = number_formats.generateFormat(
+ # NUMBER, locale_fr_FR, True, False, 2, 1)
+ #format_key = number_formats.queryKey(format_string, locale_fr_FR, True)
+ #if format_key < 0:
+ # format_key = number_formats.addNew(format_string, locale_fr_FR)
+ #print "NUMBER_1000DEC2=%s key=%s" % (NUMBER_1000DEC2, format_key)
+ #number_format = number_formats.getByKey(format_key)
+
+ # détermination de la zone de travail
+ if action.endswith('-encore'):
+ # localisation de la la zone déjà utilisée
+ cursor = sheet.createCursor()
+ cursor.gotoEndOfUsedArea(False)
+ cursor.gotoStartOfUsedArea(True)
+ rangeAddress = cursor.getRangeAddress()
+ row = rangeAddress.EndRow
+ # FIXME: on devrait comparer ici rangeAddress.EndColumn avec len(data[0])
+ else:
+ row = 0
+
+ cell_range = sheet.getCellRangeByPosition(
+ 0, row, len(data[0])-1, row + len(data)-1)
+ cursor = sheet.createCursorByRange(cell_range)
+
+ # insertion des données
+ for row in range(1, len(data)):
+ for column in range(len(data[row])):
+ value = data[row][column]
+ cell = cursor.getCellByPosition(column, row)
+ if column_type[column] == float and value != '#DEV!':
+ cell.Value = value
+ else:
+ cell.Formula = value
+
+ # insertion des en-têtes, après les données pour un autofit correct
+ if new_sheet:
+ for column in range(len(data[0])):
+ # écriture de l'en-tête de la colonne
+ cell = cursor.getCellByPosition(column, 0)
+ cell.Formula = data[0][column]
+ # formatage par défaut pour la colonne
+ sheet_column = sheet.Columns.getByIndex(column)
+ if column_type[column] == datetime.date:
+ sheet_column.NumberFormat = date_format
+ elif column_type[column] == float:
+ if action == 'cumuls':
+ sheet_column.NumberFormat = currency_format
+ else:
+ if data[0][column] in COLONNES_NUMERIQUES:
+ sheet_column.NumberFormat = number_format
+ else:
+ sheet_column.NumberFormat = currency_format
+ # ajustement automatique, une fois toutes les valeurs écrites
+ sheet_column.OptimalWidth = True
+ # formatage spécifique pour la ligne d'en-têtes
+ headers_row = sheet.Rows.getByIndex(0)
+ headers_row.ParaAdjust = 3 # CENTER
+
+##############################################################################
+
+# Show a message box with the UNO based toolkit
+def messageBox(ctx, message):
+ document = XSCRIPTCONTEXT.getDocument()
+ window = document.CurrentController.Frame.ContainerWindow
+
+ aDescriptor = WindowDescriptor()
+ aDescriptor.Type = MODALTOP
+ aDescriptor.WindowServiceName = "infobox"
+ aDescriptor.ParentIndex = -1
+ aDescriptor.Parent = window
+ #aDescriptor.Bounds = Rectangle()
+ aDescriptor.WindowAttributes = OK
+
+ tk = window.getToolkit()
+ msgbox = tk.createWindow(aDescriptor)
+ msgbox.setCaptionText("Collage d'interrogation CODA")
+ msgbox.setMessageText(unicode(message))
+
+ return msgbox.execute()
+
+def coller_cumuls(event=False):
+ u"""Coller une interrogation des cumuls CODA."""
+ ctx = uno.getComponentContext()
+ try:
+ main(ctx, 'cumuls')
+ except Exception, e:
+ messageBox(ctx, e)
+ return None
+
+def coller_details(event=False):
+ u"""Coller une interrogation des détails CODA."""
+ ctx = uno.getComponentContext()
+ try:
+ main(ctx, 'details')
+ except Exception, e:
+ messageBox(ctx, e)
+ return None
+
+def coller_details_encore(event=False):
+ u"""Coller une interrogation des détails CODA supplémentaire."""
+ ctx = uno.getComponentContext()
+ try:
+ main(ctx, 'details-encore')
+ except Exception, e:
+ messageBox(ctx, e)
+ return None
+
+g_exportedScripts = (coller_cumuls, coller_details, coller_details_encore)
+
+##############################################################################
+
+from com.sun.star.task import XJobExecutor
+
+class CollerCumulsJob(unohelper.Base, XJobExecutor):
+ def __init__(self, context):
+ self._context = context
+
+ def trigger(self, args):
+ try:
+ main(self._context, 'cumuls')
+ except Exception, e:
+ messageBox(self._context, e)
+
+class CollerDetailsJob(unohelper.Base, XJobExecutor):
+ def __init__(self, context):
+ self._context = context
+
+ def trigger(self, args):
+ try:
+ main(self._context, 'details')
+ except Exception, e:
+ messageBox(self._context, e)
+
+class CollerDetailsEncoreJob(unohelper.Base, XJobExecutor):
+ def __init__(self, context):
+ self._context = context
+
+ def trigger(self, args):
+ try:
+ main(self._context, 'details-encore')
+ except Exception, e:
+ messageBox(self._context, e)
+
+g_ImplementationHelper = unohelper.ImplementationHelper()
+g_ImplementationHelper.addImplementation( \
+ CollerCumulsJob, "org.auf.openoffice.CODA.CollerCumuls", \
+ ("com.sun.star.task.Job",),)
+g_ImplementationHelper.addImplementation( \
+ CollerDetailsJob, "org.auf.openoffice.CODA.CollerDetails", \
+ ("com.sun.star.task.Job",),)
+g_ImplementationHelper.addImplementation( \
+ CollerDetailsEncoreJob, "org.auf.openoffice.CODA.CollerDetailsEncore", \
+ ("com.sun.star.task.Job",),)
--- /dev/null
+#!
+# -*- coding: utf_8 -*-
+"""
+Extension pour faciliter l'intégration du logiciel Coda.
+Gestion de la fenêtre des options.
+
+Copyright : Agence universitaire de la Francophonie
+Licence : GNU General Public Licence, version 2
+Auteur : Jean Christophe André
+Date de création : juillet 2009
+"""
+import uno
+import unohelper
+
+# interfaces
+from com.sun.star.lang import XServiceInfo
+from com.sun.star.awt import XContainerWindowEventHandler
+
+# main class
+class DialogHandler(unohelper.Base, XServiceInfo, XContainerWindowEventHandler):
+ def __init__(self, ctx):
+ self.ctx = ctx;
+ self.cp = self.ctx.ServiceManager.createInstanceWithContext(
+ "com.sun.star.configuration.ConfigurationProvider",
+ self.ctx)
+ node = uno.createUnoStruct("com.sun.star.beans.PropertyValue")
+ node.Name = "nodepath"
+ node.Value = "/org.openoffice.VCL/Settings/Transfer"
+ self.node = node
+ self.cfg_names = ("SelectionTimeout",)
+ return
+
+ # XContainerWindowEventHandler
+ def callHandlerMethod(self, window, eventObject, method):
+ if method == "external_event":
+ try:
+ self.handleExternalEvent(window, eventObject)
+ except:
+ pass
+ return True
+
+ # XContainerWindowEventHandler
+ def getSupportedMethodNames(self):
+ return ("external_event",)
+
+ def supportsService(self, name):
+ return False
+
+ def getImplementationName(self):
+ return "org.auf.openoffice.macros.DialogHandler"
+
+ def getSupportedServiceNames(self):
+ return ()
+
+ def handleExternalEvent(self, window, eventName):
+ if eventName == "ok":
+ self.saveData(window)
+ elif eventName == "back":
+ self.loadData(window, "back")
+ elif eventName == "initialize":
+ self.loadData(window, "initialize")
+ return True
+
+ # load and set the data
+ def loadData(self, window, ev):
+ name = window.getModel().Name
+ if name != "MacrosDialog":
+ return
+ settings = self.configreader()
+ if not settings:
+ return
+ for name in self.cfg_names:
+ window.getControl(name).setValue(settings.get(name, ''))
+ return
+
+ # making the save data
+ def saveData(self,window):
+ name = window.getModel().Name
+ if name != "MacrosDialog":
+ return
+ settings = []
+ for name in self.cfg_names:
+ settings.append(str(int(window.getControl(name).Value)))
+ self.configwriter(tuple(settings))
+ return
+
+ # read configuration
+ def configreader(self):
+ settings = {}
+ try:
+ ConfigReader = self.cp.createInstanceWithArguments(
+ "com.sun.star.configuration.ConfigurationAccess",
+ (self.node,))
+ #cfg_values = ConfigReader.getPropertyValues(self.cfg_names)
+ for i in range(len(self.cfg_names)):
+ cfg_value = ConfigReader.getByName(self.cfg_names[i])
+ settings[self.cfg_names[i]] = cfg_value
+ except:
+ pass
+ return settings
+
+ # write configuration, cfg_values: tuple
+ # keep the order of the values
+ def configwriter(self, cfg_values):
+ try:
+ ConfigWriter = self.cp.createInstanceWithArguments(
+ "com.sun.star.configuration.ConfigurationUpdateAccess",
+ (self.node,))
+ #ConfigWriter.setPropertyValues(self.cfg_names, cfg_values)
+ for i in range(len(self.cfg_names)):
+ ConfigWriter.replaceByName(self.cfg_names[i], cfg_values[i])
+ ConfigWriter.commitChanges()
+ except:
+ pass
+
+# uno implementation
+g_ImplementationHelper = unohelper.ImplementationHelper()
+g_ImplementationHelper.addImplementation( \
+ DialogHandler, "org.auf.openoffice.macros.DialogHandler", \
+ ("org.auf.openoffice.macros.DialogHandler",),)
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">
+<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest">
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.package-bundle-description" manifest:full-path="description_fr.txt;locale=fr"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data" manifest:full-path="Addons.xcu"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data" manifest:full-path="rdesktop.xcu"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data" manifest:full-path="macrosecurity.xcu"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data" manifest:full-path="systemfiledialog.xcu"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data" manifest:full-path="OptionsDialog.xcu"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=Python" manifest:full-path="DialogHandler.py"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=Python" manifest:full-path="CODA.py"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=Python" manifest:full-path="calc2moin.py"/>
+ <manifest:file-entry manifest:media-type="application/vnd.sun.star.dialog-library" manifest:full-path="dialogs/"/>
+</manifest:manifest>
--- /dev/null
+<?xml version='1.0' encoding='UTF-8'?>
+<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="OptionsDialog" oor:package="org.openoffice.Office">
+<node oor:name="Nodes">
+ <node oor:name="org.auf.openoffice.Addons" oor:op="fuse">
+ <prop oor:name="Label">
+ <value xml:lang="fr-FR">Extensions AUF</value>
+ </prop>
+ <prop oor:name="OptionsPage">
+ <value>%origin%/dialogs/Extensions/ExtensionsDialog.xdl</value>
+ </prop>
+ <prop oor:name="AllModules">
+ <value>true</value>
+ </prop>
+ <node oor:name="Leaves">
+ <node oor:name="org.auf.openoffice.macros" oor:op="replace">
+ <prop oor:name="Id">
+ <value>org.auf.openoffice.macros.General</value>
+ </prop>
+ <prop oor:name="Label">
+ <value xml:lang="fr-FR">Macros AUF pour OpenOffice.org</value>
+ </prop>
+ <prop oor:name="OptionsPage">
+ <value>%origin%/dialogs/Macros/MacrosDialog.xdl</value>
+ </prop>
+ <prop oor:name="EventHandlerService">
+ <value>org.auf.openoffice.macros.DialogHandler</value>
+ </prop>
+ </node>
+ </node>
+ </node>
+</node>
+</oor:component-data>
--- /dev/null
+#!
+# -*- coding: utf-8 -*-
+"""
+Macro pour faciliter l'intégration des données d'une feuille de calcul
+vers un wiki MoinMoin.
+
+Copyright : Agence universitaire de la Francophonie
+Licence : GNU General Public Licence, version 2
+Auteur : Jean Christophe André
+Date de création : septembre 2009
+"""
+import uno
+import unohelper
+from com.sun.star.task import XJobExecutor
+from com.sun.star.beans import PropertyValue
+from com.sun.star.table.CellContentType import EMPTY, VALUE, TEXT, FORMULA
+from com.sun.star.table.CellHoriJustify import STANDARD, LEFT, CENTER, RIGHT
+
+def calc2moin(ctx):
+ data = []
+
+ ## The context variable is of type XScriptContext and is available to
+ ## all BeanShell scripts executed by the Script Framework
+ #curdoc = XSCRIPTCONTEXT.getDocument()
+ #ctx = uno.getComponentContext()
+
+ # récupération du document en cours, vérification du type Spreadsheet
+ smgr = ctx.ServiceManager
+ desktop = smgr.createInstanceWithContext(
+ "com.sun.star.frame.Desktop", ctx)
+ curdoc = desktop.getCurrentComponent()
+ if not curdoc.supportsService("com.sun.star.sheet.SpreadsheetDocument"):
+ raise RuntimeError, u"Ce n'est pas un document de type Spreadsheet (Calc)."
+
+ controller = curdoc.getCurrentController()
+ sheet = controller.getActiveSheet()
+
+ # localisation de la la zone déjà utilisée
+ cursor = sheet.createCursor()
+ cursor.gotoEndOfUsedArea(False)
+ cursor.gotoStartOfUsedArea(True)
+ rangeAddress = cursor.getRangeAddress()
+ rows = rangeAddress.EndRow - rangeAddress.StartRow + 1
+ columns = rangeAddress.EndColumn - rangeAddress.StartColumn + 1
+ for row in range(rows):
+ row_data = []
+ for column in range(columns):
+ cell_data = []
+ cell = cursor.getCellByPosition(column, row)
+ cell_type = cell.getType()
+ cell_string = cell.getString()
+ # process cell' styles
+ cell_styles = []
+ if hasattr(cell, 'CellBackColor'):
+ color = cell.getPropertyValue('CellBackColor')
+ if color >= 0:
+ cell_styles.append('background: #%06x' % color)
+ if hasattr(cell, 'HoriJustify'):
+ horiJustify = cell.getPropertyValue('HoriJustify')
+ if horiJustify == LEFT:
+ text_align = '' #text_align = 'left'
+ elif horiJustify == CENTER:
+ text_align = 'center'
+ elif horiJustify == RIGHT:
+ text_align = 'right'
+ else:
+ if cell_type == TEXT:
+ text_align = '' #text_align = 'left'
+ elif cell_type != EMPTY:
+ text_align = 'right'
+ if text_align and cell_string:
+ cell_styles.append('text-align: ' + text_align)
+ # add cell to row
+ if cell_styles:
+ cell_data.append('<style="%s;">' % '; '.join(cell_styles))
+ if cell_string:
+ cell_data.append(cell_string)
+ else:
+ cell_data.append(' ')
+ row_data.append(''.join(cell_data))
+ # display row's code
+ data.append('||' + '||'.join(row_data) + '||')
+
+ #
+ # création d'un document Writer pour écrire le code MoinMoin
+ #
+ # ouverture d'un document Writer caché
+ hidden = PropertyValue()
+ hidden.Name = "Hidden"
+ hidden.Value = True
+ doc = desktop.loadComponentFromURL(
+ "private:factory/swriter", "_blank", 0, (hidden, ) )
+ text = doc.Text
+ textcursor = text.createTextCursor()
+ text.insertString(textcursor, '\n'.join(data) + '\n', 0)
+ # on copie ça dans le presse papier
+ dispatcher = smgr.createInstanceWithContext(
+ "com.sun.star.frame.DispatchHelper", ctx)
+ frame = doc.getCurrentController().getFrame()
+ dispatcher.executeDispatch(frame, ".uno:SelectAll", "", 0, ())
+ dispatcher.executeDispatch(frame, ".uno:Copy", "", 0, ())
+ doc.close(True)
+
+##############################################################################
+
+def copier(event=False):
+ u"""Copier une feuille de calcul vers un wiki MoinMoin."""
+ ctx = uno.getComponentContext()
+ calc2moin(ctx)
+ return None
+
+g_exportedScripts = (copier, )
+
+##############################################################################
+
+class CopierJob(unohelper.Base, XJobExecutor):
+ def __init__(self, context):
+ self._context = context
+
+ def trigger(self, args):
+ calc2moin(self._context)
+
+g_ImplementationHelper = unohelper.ImplementationHelper()
+g_ImplementationHelper.addImplementation( \
+ CopierJob, "org.auf.openoffice.calc2moin.Copier", \
+ ("com.sun.star.task.Job",),)
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<description xmlns="http://openoffice.org/extensions/description/2006" xmlns:d="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink">
+
+ <identifier value="org.auf.openoffice.macros" />
+ <version value="1204.1" />
+ <platform value="all" />
+
+ <dependencies>
+ <OpenOffice.org-minimal-version value="3.2.1" d:name="OpenOffice.org 3.2.1" />
+ </dependencies>
+
+ <!-- If you uploaded your extension to the repository (which should be
+ the default!) you do not need to have this one.
+ <update-information>
+ <src xlink:href="http://macros.openoffice.auf.org/update.xml" />
+ </update-information>
+ -->
+
+ <!-- Check if this is already generated by repository.
+ Otherwise you may like to provide it manually.
+ -->
+ <publisher>
+ <name xlink:href="http://www.auf.org/" lang="fr">Agence universitaire de la Francophonie</name>
+ </publisher>
+
+ <display-name>
+ <name lang="fr">Extension AUF</name>
+ </display-name>
+
+ <icon>
+ <default xlink:href="images/logo-auf.png" />
+ </icon>
+
+ <extension-description>
+ <src xlink:href="description_fr.txt" lang="fr" />
+ </extension-description>
+
+</description>
--- /dev/null
+Extension LibreOffice de l'Agence universitaire de la Francophonie
+
+Copyright ©2008–2013 Agence universitaire de la Francophonie — www.auf.org
+Licence : GNU Lesser General Public License version 2.1
+Auteur : Jean Christophe André <jean-christophe.andre@auf.org>
+
+Cette extension apporte quelques réglages spécifiques à l'AUF :
+ * choix des boîtes de dialogue intégrées au bureau (plutôt que natives) ;
+ * changement du niveau de sécurité des macros (un peu plus tolérant) ;
+ * augmentation du délai (à 30 secondes) pour un copier-coller via TSE ;
+ * macros Calc pour le copier-coller des interrogations depuis CODA ;
+ * macro Calc pour le copier-coller d'une sélection vers un wiki MoinMoin.
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
+<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="ExtensionsDialog" dlg:left="11" dlg:top="91" dlg:width="263" dlg:height="185" dlg:help-text="&38.ExtensionsDialog.HelpText" dlg:closeable="true" dlg:moveable="true" dlg:title="&39.ExtensionsDialog.Title" dlg:withtitlebar="false">
+ <dlg:styles>
+ <dlg:style dlg:style-id="0" dlg:font-height="12"/>
+ <dlg:style dlg:style-id="1" dlg:border="none"/>
+ </dlg:styles>
+ <dlg:bulletinboard>
+ <dlg:text dlg:style-id="0" dlg:id="label_title" dlg:tab-index="1" dlg:left="31" dlg:top="10" dlg:width="220" dlg:height="17" dlg:help-text="&40.ExtensionsDialog.label_title.HelpText" dlg:value="&41.ExtensionsDialog.label_title.Label"/>
+ <dlg:img dlg:style-id="1" dlg:id="image_icon" dlg:tab-index="3" dlg:left="8" dlg:top="8" dlg:width="20" dlg:height="20" dlg:help-text="&42.ExtensionsDialog.image_icon.HelpText"/>
+ <dlg:text dlg:id="label_description" dlg:tab-index="2" dlg:left="32" dlg:top="47" dlg:width="220" dlg:height="121" dlg:help-text="&43.ExtensionsDialog.label_description.HelpText" dlg:value="&44.ExtensionsDialog.label_description.Label"/>
+ <dlg:fixedline dlg:id="line_separator" dlg:tab-index="0" dlg:left="5" dlg:top="33" dlg:width="252" dlg:height="1" dlg:help-text="&45.ExtensionsDialog.line_separator.HelpText" dlg:value="&46.ExtensionsDialog.line_separator.Label"/>
+ </dlg:bulletinboard>
+</dlg:window>
--- /dev/null
+# ExtensionsDialog strings
+38.ExtensionsDialog.HelpText=
+39.ExtensionsDialog.Title=
+40.ExtensionsDialog.label_title.HelpText=
+41.ExtensionsDialog.label_title.Label=Extensions AUF
+42.ExtensionsDialog.image_icon.HelpText=
+43.ExtensionsDialog.label_description.HelpText=
+44.ExtensionsDialog.label_description.Label=Extensions AUF pour OpenOffice.org.
+45.ExtensionsDialog.line_separator.HelpText=
+46.ExtensionsDialog.line_separator.Label=
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
+<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="MacrosDialog" dlg:left="186" dlg:top="130" dlg:width="260" dlg:height="185" dlg:help-text="&0.MacrosDialog.HelpText" dlg:closeable="true" dlg:moveable="true" dlg:title="&1.MacrosDialog.Title" dlg:withtitlebar="false">
+ <dlg:bulletinboard>
+ <dlg:titledbox dlg:id="FrameControl1" dlg:tab-index="0" dlg:left="10" dlg:top="10" dlg:width="240" dlg:height="60" dlg:help-text="&2.MacrosDialog.FrameControl1.HelpText">
+ <dlg:title dlg:value="&3.MacrosDialog.FrameControl1.Label"/>
+ </dlg:titledbox>
+ <dlg:text dlg:id="SelectionTimeoutLabel" dlg:tab-index="0" dlg:left="15" dlg:top="20" dlg:width="70" dlg:height="12" dlg:help-text="&4.MacrosDialog.SelectionTimeoutLabel.HelpText" dlg:value="&5.MacrosDialog.SelectionTimeoutLabel.Label"/>
+ <dlg:numericfield dlg:id="SelectionTimeout" dlg:tab-index="1" dlg:left="90" dlg:top="18" dlg:width="20" dlg:height="12" dlg:help-text="&6.MacrosDialog.SelectionTimeout.HelpText" dlg:value="&7.MacrosDialog.SelectionTimeout.Label" dlg:decimal-accuracy="0" dlg:value-min="3"/>
+ </dlg:bulletinboard>
+</dlg:window>
--- /dev/null
+# MacrosDialog strings
+0.MacrosDialog.HelpText=
+1.MacrosDialog.Title=
+2.MacrosDialog.FrameControl1.HelpText=
+3.MacrosDialog.FrameControl1.Label=
+4.MacrosDialog.SelectionTimeoutLabel.HelpText=
+5.MacrosDialog.SelectionTimeoutLabel.Label=D\u00e9lai pour le copier/coller :
+6.MacrosDialog.SelectionTimeout.HelpText=D\u00e9lai maximum, en secondes, pour le copier/coller (conseil : 30)
+7.MacrosDialog.SelectionTimeout.Label=30
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="macros" library:readonly="false" library:passwordprotected="false"/>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Common" oor:package="org.openoffice.Office">
+ <node oor:name="Security">
+ <node oor:name="Scripting">
+ <prop oor:name="MacroSecurityLevel" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ </node>
+</oor:component-data>
--- /dev/null
+<?xml version='1.0' encoding='UTF-8'?>
+<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="VCL" oor:package="org.openoffice">
+ <node oor:name="Settings">
+ <node oor:name="Transfer" oor:op="replace">
+ <prop oor:name="SelectionTimeout" oor:type="xs:string" oor:op="replace">
+ <value>30</value>
+ </prop>
+ </node>
+ </node>
+</oor:component-data>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Common" oor:package="org.openoffice.Office">
+ <node oor:name="Misc">
+ <prop oor:name="UseSystemFileDialog" oor:type="xs:boolean">
+ <value>true</value>
+ </prop>
+ </node>
+</oor:component-data>
+++ /dev/null
-* Macro CODA : voir http://wiki.auf.org/wikiteki/OpenOffice/MacroCoda
-
-* Macro CODA : afficher une fenêtre avertissant de l'attente.
-
- Le transfert pourrait mettre jusqu'à NN secondes avant de se
- terminer. OpenOffice restera bloqué pendant toute cette période.
- Veuillez patienter le temps du transfert des données...
-
-* Macro CODA : permettre de supprimer les lignes de sous-total d'une
- interrogation des détails.
+++ /dev/null
-VERSION = $(shell dpkg-parsechangelog | sed -n 's/^Version: //p')
-DIST = $(shell dpkg-parsechangelog | sed -n 's/^Distribution: //p')
-
-all: build
-
-build:
- rm -f auf-macros.oxt
- sed -i '/^ <version /s/="[^"]*"/="'$(VERSION)'"/' openoffice/description.xml
- cd openoffice ; zip -9rpD ../auf-macros.oxt .
-
-install:
- install -m 0644 auf-macros.oxt $(DESTDIR)/usr/lib/openoffice/share/extension/install/
-
-clean:
- rm -f auf-macros.oxt
-
-deb:
- debuild -I.git -I*.ex -b -us -uc && \
- echo -e "\n\n==> Lancer \"sudo debi\" pour tester l'installation.\n"
-
-release:
- debuild -I.git -I*.ex -tc -sa -us -uc && debrelease --dput $(DIST)-test
+++ /dev/null
-auf-macros-openoffice (1.13) lucid; urgency=low
-
- * retour à l'objectif d'origine : les macros pour OpenOffice
-
- -- Progfou <jean-christophe.andre@auf.org> Tue, 10 Sep 2013 00:34:32 -0400
-
-auf-poste-client-reflets (1.12) jaunty; urgency=low
-
- * rdesktop:
- - Support du clavier au Laos.
-
- * OpenOffice.org:
- - Utilisation des boîtes de dialogue du système par défaut.
-
- -- Progfou <jean-christophe.andre@auf.org> Tue, 21 Sep 2010 23:34:22 +0700
-
-auf-poste-client-reflets (1.11.1) jaunty; urgency=low
-
- * Complément de support de la distribution officielle de OpenOffice.org.
-
- -- Progfou <jean-christophe.andre@auf.org> Thu, 11 Mar 2010 05:10:51 +0700
-
-auf-poste-client-reflets (1.11) jaunty; urgency=low
-
- * OpenOffice.org :
- - Support de la distribution officielle de OpenOffice.org.
-
- * Macro CODA :
- - Mise à jour et ajout d'informations de droits d'auteur (copyright).
- - Constante pour la liste des colonnes à garder au format numérique.
-
- -- Progfou <jean-christophe.andre@auf.org> Fri, 05 Mar 2010 09:45:25 +0700
-
-auf-poste-client-reflets (1.10.3) jaunty; urgency=high
-
- * rdesktop: argl !!! effacement abusif en cas de non diversion ! :-(
-
- -- Progfou <jean-christophe.andre@auf.org> Tue, 27 Oct 2009 03:37:57 +0700
-
-auf-poste-client-reflets (1.10.2) jaunty; urgency=low
-
- * rdesktop: annulation du support du capslock qui pose problème. :-(
-
- -- Progfou <jean-christophe.andre@auf.org> Tue, 27 Oct 2009 03:00:19 +0700
-
-auf-poste-client-reflets (1.10.1) jaunty; urgency=low
-
- * rdesktop: correction de la gestion des diversions
-
- -- Progfou <jean-christophe.andre@auf.org> Sun, 25 Oct 2009 02:26:58 +0700
-
-auf-poste-client-reflets (1.10) jaunty; urgency=low
-
- * rdesktop :
- - Diversion du clavier commun pour ajouter le support du capslock.
- (LP: #251709)
- - Ajout d'un correctif sur le [.] du pavé numérique via xmodmap.
- - Ajout d'une dépendance à x11-xserver-utils pour xmodmap.
-
- * OpenOffice.org :
- - Ajout d'une version (≥ 3.1.1) à la dépendance sur openoffice.org.
- (http://wiki.auf.org/wikiteki/OpenOffice/Alerte311)
- - Ajout du paramétrage de la sécurité des macros sur « moyenne ».
-
- * Macro CODA :
- - Correction des bogues relevés et optimisation du code.
- (http://wiki.auf.org/wikiteki/OpenOffice/MacroCoda)
- - Ajout de raccourcis claviers pour le menu CODA dans Calc.
- - Ajout d'un choix pour coller une interrogation détails à la suite.
-
- -- Progfou <jean-christophe.andre@auf.org> Sun, 25 Oct 2009 00:35:00 +0700
-
-auf-poste-client-reflets (1.9) jaunty; urgency=low
-
- * Ajout d'une macro pour coller les interrogations CODA.
- * Intégration de cette macro dans la barre de menu de Calc.
- * Ajout du support pour OOo 3.x dans les scripts Debian.
-
- -- Progfou <jean-christophe.andre@auf.org> Thu, 03 Sep 2009 04:16:44 +0700
-
-auf-poste-client-reflets (1.8.1) jaunty; urgency=low
-
- * Licence : le nom de machine est limité à 15 caractères.
- * Timeout : mis à 30 par défaut puisque c'est ce que l'aide conseille.
-
- -- Progfou <jean-christophe.andre@auf.org> Sun, 09 Aug 2009 04:25:18 +0700
-
-auf-poste-client-reflets (1.8) jaunty; urgency=low
-
- * Réactivation de l'extension "auf-reflets-tse.oxt" pour OpenOffice.org.
- * Ajout d'une catégorie d'options « Extensions AUF » et d'une page
- d'options « Support Reflets-TSE (CODA) » afin de faciliter le
- paramétrage du délai pour le copier/coller.
- * Ajout d'un logo AUF, d'une description de l'extension et son auteur
- pour un affichage plus officiel dans le gestionnaire des extensions.
-
- -- Progfou <jean-christophe.andre@auf.org> Thu, 16 Jul 2009 04:03:05 +0700
-
-auf-poste-client-reflets (1.7) hardy; urgency=low
-
- * Bogue sur le test d'existence d'une ancienne licence.
-
- -- Progfou <jean-christophe.andre@auf.org> Thu, 28 May 2009 23:35:16 +0700
-
-auf-poste-client-reflets (1.6.1) hardy; urgency=low
-
- * Suppression de la construction du paquet auf-reflets-tse.
-
- -- Progfou <jean-christophe.andre@auf.org> Fri, 08 May 2009 04:00:22 +0700
-
-auf-poste-client-reflets (1.6) hardy; urgency=low
-
- * Configuration spécifique à une machine via /etc/auf-reflets-tse.conf.
- * Suppression de la licence sélectionnée si elle vient du serveur "AD".
- * Construction du nom de la machine à partir du "username" configuré.
- (uniquement si le nom de la machine n'est pas lui-même configuré)
-
- -- Progfou <jean-christophe.andre@auf.org> Fri, 08 May 2009 03:16:19 +0700
-
-auf-poste-client-reflets (1.5) hardy; urgency=low
-
- * La géométrie "auto" fait maintenant du « presque plein-écran ».
- * Retrait de la décoration de fenêtre pour la géométrie "workarea".
- * Ajout d'une variable "extra" pour la configuration personnalisée.
-
- -- Progfou <jean-christophe.andre@auf.org> Sat, 22 Nov 2008 03:02:00 +0700
-
-auf-poste-client-reflets (1.4) hardy; urgency=low
-
- * Début de support Coda dans OpenOffice.
-
- -- Progfou <jean-christophe.andre@auf.org> Wed, 15 Oct 2008 03:15:16 +0700
-
-auf-poste-client-reflets (1.3.3) hardy; urgency=low
-
- * Création d'un paquet transitionnel pour migration automatique.
-
- -- Progfou <jean-christophe.andre@auf.org> Wed, 08 Oct 2008 16:04:17 +0700
-
-auf-poste-client-reflets (1.3.2) hardy; urgency=low
-
- * Gestion du cas d'imprimantes PDF multiples : on prend la première.
-
- -- Progfou <jean-christophe.andre@auf.org> Mon, 06 Oct 2008 10:44:38 +0700
-
-auf-poste-client-reflets (1.3.1) hardy; urgency=low
-
- * Utilisation de Zenity pour signaler l'imprimante PDF manquante.
-
- -- Progfou <jean-christophe.andre@auf.org> Wed, 01 Oct 2008 06:05:06 +0700
-
-auf-poste-client-reflets (1.3) stable; urgency=low
-
- * thomatisation (nettoyage à la thomas, aucun changement autre que
- cosmétique)
-
- -- Thomas NOEL <thomas.noel@auf.org> Tue, 30 Sep 2008 14:50:45 +0000
-
-auf-poste-client-reflets (1.2.1) gutsy; urgency=low
-
- * Déplacement des pixmaps au bon endroit, grmph...
-
- -- Progfou <jean-christophe.andre@auf.org> Sat, 26 Jan 2008 04:59:29 +0700
-
-auf-poste-client-reflets (1.2) gutsy; urgency=low
-
- * Version officielle sur le dépôt APT de l'AuF
- * L'option geometry est maintenant positionnée à "fullscreen" par defaut
- * L'option printer est maintenant positionnée à "auto" par defaut
- * Les options geometry et printer sont forcées lors de cette mise à jour
- * Calcul dynamique des options de configuration manquantes
-
- -- Progfou <jean-christophe.andre@auf.org> Sat, 26 Jan 2008 04:11:41 +0700
-
-auf-poste-client-reflets (1.1) feisty; urgency=low
-
- * Auto-adaptation à la taille de l'écran
-
- -- Progfou <jean-christophe.andre@auf.org> Fri, 21 Sep 2007 09:43:00 +0700
-
-auf-poste-client-reflets (1.0) feisty; urgency=low
-
- * Version initiale
- * Crée automatiquement un fichier de configuration à la première exécution
-
- -- Progfou <jean-christophe.andre@auf.org> Mon, 16 Jul 2007 17:54:00 +0700
-
+++ /dev/null
-Source: auf-macros-openoffice
-Section: editors
-Priority: optional
-Maintainer: Progfou <jean-christophe.andre@auf.org>
-Build-Depends: debhelper (>= 5), zip
-Standards-Version: 3.7.2
-
-Package: auf-macros-openoffice
-Architecture: all
-Depends: openoffice.org-common (>= 1:3.1.1) | openoffice.org3 (>= 3.2.0), python-uno | ooobasis3.2-pyuno
-Recommends: openoffice.org-calc | openoffice.org3-calc
-Description: installation des macros pour OpenOffice de l'AUF
- Ce paquet fournit une extension OpenOffice pour effectuer quelques réglages
- spécifiques à l'AUF :
- * changement du niveau de sécurité des macros ;
- * augmentation du timeout pour un copier-coller via TSE ;
- * macro pour le copier-coller depuis CODA vers Calc ;
- * macro pour le copier-coller de Calc vers MoinMoin.
+++ /dev/null
-This package was debianized by Progfou <jean-christophe.andre@auf.org> on
-Mon, 16 Jul 2007 17:54:00 +0700.
-
-It was downloaded from http://git.auf.org/?p=macros-openoffice.git
-
-Upstream Author:
-
- Progfou <jean-christophe.andre@auf.org>
-
-Copyright Holder:
-
- Copyright (C) 2007-2010 Agence universitaire de la Francophonie
- http://www.auf.org/
-
-License:
-
- This package is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This package 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 License
- along with this package; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-On Debian systems, the complete text of the GNU General
-Public License can be found in `/usr/share/common-licenses/GPL'.
-
-The Debian packaging is (C) 2007-2010, Progfou <jean-christophe.andre@auf.org>
-and is licensed under the GPL, see above.
-
+++ /dev/null
-usr/lib/openoffice/share/extension/install
+++ /dev/null
-auf-macros-openoffice source: maintainer-not-full-name Progfou
-auf-macros-openoffice: maintainer-not-full-name Progfou
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-#
-# OpenOffice
-#
-
-if test -d "/opt/openoffice.org3" ; then
- unopkg="/opt/openoffice.org3/program/unopkg"
-else
- unopkg="/usr/lib/openoffice/program/unopkg"
-fi
-
-add_extension() {
- echo -n "Adding extension $1..."
- INSTDIR=`mktemp -d`
- if test -d "/usr/lib/openoffice/basis3.1"
- then
- export PYTHONPATH="/usr/lib/openoffice/basis3.1/program"
- basis=`readlink /usr/lib/openoffice/basis-link`
- $unopkg add --shared $1 \
- "-env:UserInstallation=file:///$INSTDIR" \
- "-env:UNO_JAVA_JFW_INSTALL_DATA=file:///var/lib/openoffice/$basis/share/config/javasettingsunopkginstall.xml" \
- "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
- else
- $unopkg add --shared $1 \
- "-env:UserInstallation=file:///$INSTDIR" \
- '-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' \
- "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
- fi
- if [ -n $INSTDIR ]; then rm -rf $INSTDIR; fi
- echo " done."
-}
-
-if [ "$1" = "configure" -o "$1" = "upgrade" ]; then
- add_extension /usr/lib/openoffice/share/extension/install/auf-macros.oxt
-fi
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-#
-# OpenOffice
-#
-
-if test -d "/opt/openoffice.org3" ; then
- unopkg="/opt/openoffice.org3/program/unopkg"
-else
- unopkg="/usr/lib/openoffice/program/unopkg"
-fi
-
-flush_unopkg_cache() {
- $unopkg list --shared > /dev/null 2>&1
-}
-
-remove_extension() {
- if $unopkg list --shared $1 >/dev/null; then
- echo -n "Removing extension $1..."
- INSTDIR=`mktemp -d`
- if test -d "/usr/lib/openoffice/basis3.1"
- then
- export PYTHONPATH="/usr/lib/openoffice/basis3.1/program"
- basis=`readlink /usr/lib/openoffice/basis-link`
- $unopkg remove --shared $1 \
- "-env:UserInstallation=file://$INSTDIR" \
- "-env:UNO_JAVA_JFW_INSTALL_DATA=file:///var/lib/openoffice/$basis/share/config/javasettingsunopkginstall.xml" \
- "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
- else
- $unopkg remove --shared $1 \
- "-env:UserInstallation=file://$INSTDIR" \
- '-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' \
- "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
- fi
- if [ -n $INSTDIR ]; then rm -rf $INSTDIR; fi
- echo " done."
- flush_unopkg_cache
- fi
-}
-
-if [ "$1" = "upgrade" ]; then
- # this is a legacy package, so we need to find it first...
- id=`$unopkg list --shared | grep Identifier:.*auf.*reflets | cut -d":" -f2`
- remove_extension $id
-fi
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-#
-# OpenOffice
-#
-
-if test -d "/opt/openoffice.org3" ; then
- unopkg="/opt/openoffice.org3/program/unopkg"
-else
- unopkg="/usr/lib/openoffice/program/unopkg"
-fi
-
-flush_unopkg_cache() {
- $unopkg list --shared > /dev/null 2>&1
-}
-
-remove_extension() {
- if $unopkg list --shared $1 >/dev/null; then
- echo -n "Removing extension $1..."
- INSTDIR=`mktemp -d`
- if test -d "/usr/lib/openoffice/basis3.1"
- then
- export PYTHONPATH="/usr/lib/openoffice/basis3.1/program"
- basis=`readlink /usr/lib/openoffice/basis-link`
- $unopkg remove --shared $1 \
- "-env:UserInstallation=file://$INSTDIR" \
- "-env:UNO_JAVA_JFW_INSTALL_DATA=file:///var/lib/openoffice/$basis/share/config/javasettingsunopkginstall.xml" \
- "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
- else
- $unopkg remove --shared $1 \
- "-env:UserInstallation=file://$INSTDIR" \
- '-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' \
- "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
- fi
- if [ -n $INSTDIR ]; then rm -rf $INSTDIR; fi
- echo " done."
- flush_unopkg_cache
- fi
-}
-
-if [ "$1" = "remove" ]; then
- # this is a legacy package, so we need to find it first...
- id=`$unopkg list --shared | grep Identifier:.*auf.openoffice.macros | cut -d":" -f2`
- remove_extension $id
-fi
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-# This has to be exported to make some magic below work.
-export DH_OPTIONS
-
-%:
- dh $@
+++ /dev/null
-<?xml version='1.0' encoding='UTF-8'?>
-<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Addons" oor:package="org.openoffice.Office">
- <node oor:name="AddonUI">
- <node oor:name="OfficeMenuBar">
- <node oor:name="org.auf.openoffice.Macros" oor:op="replace">
- <prop oor:name="Context" oor:type="xs:string">
- <value>com.sun.star.sheet.SpreadsheetDocument</value>
- </prop>
- <prop oor:name="Title" oor:type="xs:string">
- <value>A~UF</value>
- </prop>
- <prop oor:name="ImageIdentifier" oor:type="xs:string">
- <value>%origin%/images/logo-auf.png</value>
- </prop>
- <node oor:name="Submenu">
- <node oor:name="menu00" oor:op="replace">
- <prop oor:name="Context" oor:type="xs:string">
- <value>com.sun.star.sheet.SpreadsheetDocument</value>
- </prop>
- <prop oor:name="Title" oor:type="xs:string">
- <value>Copier le contenu de la feuille courante vers un wiki ~MoinMoin</value>
- </prop>
- <prop oor:name="URL" oor:type="xs:string">
- <value>service:org.auf.openoffice.calc2moin.Copier?execute</value>
- </prop>
- <prop oor:name="Target" oor:type="xs:string">
- <value>_self</value>
- </prop>
- <prop oor:name="ImageIdentifier" oor:type="xs:string">
- <value/>
- </prop>
- </node>
- <node oor:name="menu01" oor:op="replace">
- <prop oor:name="Context" oor:type="xs:string">
- <value>com.sun.star.sheet.SpreadsheetDocument</value>
- </prop>
- <prop oor:name="Title" oor:type="xs:string">
- <value>Coller une interrogation des ~détails</value>
- </prop>
- <prop oor:name="URL" oor:type="xs:string">
- <value>service:org.auf.openoffice.CODA.CollerDetails?execute</value>
- </prop>
- <prop oor:name="Target" oor:type="xs:string">
- <value>_self</value>
- </prop>
- <prop oor:name="ImageIdentifier" oor:type="xs:string">
- <value/>
- </prop>
- </node>
- <node oor:name="menu02" oor:op="replace">
- <prop oor:name="Context" oor:type="xs:string">
- <value>com.sun.star.sheet.SpreadsheetDocument</value>
- </prop>
- <prop oor:name="Title" oor:type="xs:string">
- <value>Coller une interrogation des ~cumuls</value>
- </prop>
- <prop oor:name="URL" oor:type="xs:string">
- <value>service:org.auf.openoffice.CODA.CollerCumuls?execute</value>
- </prop>
- <prop oor:name="Target" oor:type="xs:string">
- <value>_self</value>
- </prop>
- <prop oor:name="ImageIdentifier" oor:type="xs:string">
- <value/>
- </prop>
- </node>
- <node oor:name="menu03" oor:op="replace">
- <prop oor:name="Context" oor:type="xs:string">
- <value>com.sun.star.sheet.SpreadsheetDocument</value>
- </prop>
- <prop oor:name="Title" oor:type="xs:string">
- <value>Coller une interrogation des détails ~supplémentaire</value>
- </prop>
- <prop oor:name="URL" oor:type="xs:string">
- <value>service:org.auf.openoffice.CODA.CollerDetailsEncore?execute</value>
- </prop>
- <prop oor:name="Target" oor:type="xs:string">
- <value>_self</value>
- </prop>
- <prop oor:name="ImageIdentifier" oor:type="xs:string">
- <value/>
- </prop>
- </node>
- </node>
- </node>
- </node>
-<!--
- <node oor:name="Images">
- <node oor:name="org.auf.openoffice.CODA.icone" oor:op="replace">
- <prop oor:name="URL" oor:type="xs:string">
- <value>macro:///AUF.CODA.CodaCopieDetails</value>
- </prop>
- <node oor:name="UserDefinedImages">
- <prop oor:name="ImageBigURL">
- <value>%origin%/AUF/CODA_26.bmp</value>
- </prop>
- <prop oor:name="ImageSmallURL">
- <value>%origin%/AUF/CODA_16.bmp</value>
- </prop>
- </node>
- </node>
- </node>
--->
- </node>
-</oor:component-data>
+++ /dev/null
-#!
-# -*- coding: utf-8 -*-
-"""
-Macro pour faciliter l'intégration des données provenant du logiciel
-CODA dans une feuille de calcul.
-
-Copyright : Agence universitaire de la Francophonie
-Licence : GNU General Public Licence, version 2
-Auteur : Jean Christophe André
-Date de création : septembre 2009
-"""
-import re
-import datetime
-import uno
-import unohelper
-from com.sun.star.awt import WindowDescriptor
-from com.sun.star.awt.WindowClass import MODALTOP
-from com.sun.star.awt.VclWindowPeerAttribute import OK, DEF_OK
-from com.sun.star.uno import Exception as UnoException, RuntimeException
-from com.sun.star.connection import NoConnectException
-from com.sun.star.lang import Locale, IllegalArgumentException
-from com.sun.star.beans import PropertyValue
-#from com.sun.star.util.ParagraphProperties import CENTER
-from com.sun.star.util.NumberFormat import CURRENCY, DATE, NUMBER
-from com.sun.star.i18n.NumberFormatIndex import NUMBER_1000DEC2
-from com.sun.star.container import NoSuchElementException
-
-COLONNES_NUMERIQUES = ('Montant doc','Montant EUR')
-
-##############################################################################
-
-def clipboard_data(ctx, mimetype='text/plain;charset=utf-16'):
- clipboard = ctx.ServiceManager.createInstanceWithContext(
- "com.sun.star.datatransfer.clipboard.SystemClipboard", ctx)
- contents = clipboard.getContents()
- #print "Contents:\n%s\n%s\n%s" % ("-" * 78, "* " + "\n* ".join(dir(contents)), "=" * 78)
- #flavors = contents.getTransferDataFlavors()
- #print "Flavors:\n%s\n%s\n%s" % ("-" * 78, "* " + "\n* ".join([flavor.MimeType for flavor in flavors]), "=" * 78)
- found_flavor = None
- for flavor in contents.getTransferDataFlavors():
- if flavor.MimeType == mimetype:
- found_flavor = flavor
- break
- if not found_flavor:
- raise RuntimeError, u"Erreur : type de données '%s' non disponible.\n" \
- u"\nAvez-vous bien sélectionné puis copié les données dans CODA ?" \
- % mimetype
- data = contents.getTransferData(found_flavor)
- #print "Data:\n", "-" * 78, "\n", data
- return data
-
-##############################################################################
-
-def main(ctx, action):
- data = clipboard_data(ctx)
-
- numeric_pattern = re.compile('^[+-]?[0-9]+([\. ][0-9][0-9][0-9])*([\.,][0-9]+)?$')
- date_pattern = re.compile('^([0-9]?[0-9])/([0-9]?[0-9])/([0-9]?[0-9]?[0-9]?[0-9])$')
-
- if action == 'cumuls':
- sheet_name = u'CODA-Cumuls'
- # on découpe le texte reçu en lignes puis en colonnes
- # on ne garde ici que les 10 premières colonnes
- data = [row.split('\t')[:10] for row in data.splitlines()]
- data[0][6] = '' # suppression de la 2nde colonne 'Engagement'
- data[0][8] = '' # suppression de la colonne 'Colonne9'
-
- elif action == 'details' or action == 'details-encore':
- sheet_name = u'CODA-Détails'
- # on découpe le texte reçu en lignes puis en colonnes
- data = [row.split('\t') for row in data.splitlines()]
-
- else:
- raise RuntimeError, u"Action inconnue (erreur de programmation)."
-
- # on efface la dernière ligne pleine de car. nuls, le cas échéant
- last = data[len(data)-1]
- if len(last) == 1 and last[0].strip('\x00') == '':
- del data[len(data)-1]
-
- # on détermine le type des données, par colonne :
- # - on vérifie si toutes les valeurs de la colonne sont identiques
- # - on vérifie si la colonne ne contient que des dates
- # - on vérifie si la colonne ne contient que des nombres
- column_type = [str] * len(data[0])
- for column in range(len(data[0])-1,-1,-1):
- # quelques colonnes ne doivent pas être testées
- if action in ('details','details-encore') and data[0][column] in ('Num doc','PCG'):
- continue
- # on prend la première valeur, nettoyée un peu pour l'analyse
- first = data[1][column].strip().replace(u'\xa0','')
- flag_date = first and re.match(date_pattern, first)
- flag_numeric = first and first != '#DEV!' and re.match(numeric_pattern, first)
- diff = False
- # parcours des autres valeurs de la colonne
- for row in range(2,len(data)):
- value = data[row][column].strip().replace(u'\xa0','')
- if value:
- if not diff and value != first:
- diff = True
- if flag_date and not re.match(date_pattern, value):
- flag_date = False
- if flag_numeric and value != '#DEV!' and not re.match(numeric_pattern, value):
- flag_numeric = False
- # s'il y a au moins 2 lignes et que les valeurs dans la colonne
- # sont toutes identiques et qu'il n'y a pas d'intitulé sur la
- # colonne alors on supprime toute la colonne
- if len(data) > 2 and not diff and not data[0][column]:
- for row in range(len(data)):
- del data[row][column]
- del column_type[column]
- continue
- # si la colonne contient des dates, conversion des valeurs comme telles
- if flag_date:
- for row in range(1,len(data)):
- value = data[row][column].strip().replace(u'\xa0','')
- if value and value != '#DEV!':
- m = re.match(date_pattern, value)
- if m:
- (day, month, year) = [int(x) for x in m.groups()]
- if year < 50:
- year += 2000
- elif year < 100:
- year += 1900
- value = '%02d/%02d/%04d' % (month, day, year)
- data[row][column] = value
- column_type[column] = datetime.date
- continue
- # si la colonne est numérique, conversion des valeurs comme telles
- if flag_numeric:
- for row in range(1,len(data)):
- value = data[row][column].strip().replace(u'\xa0','')
- if value and value != '#DEV!':
- data[row][column] = float(value.replace('.','').replace(',','.'))
- column_type[column] = float
- continue
-
- #print "Data:\n", "-" * 78, "\n", data
-
- # récupération du document en cours, vérification du type Spreadsheet
- desktop = ctx.ServiceManager.createInstanceWithContext(
- "com.sun.star.frame.Desktop", ctx)
- document = desktop.getCurrentComponent()
- if not document.supportsService("com.sun.star.sheet.SpreadsheetDocument"):
- raise RuntimeError, u"Ce n'est pas un document de type Spreadsheet (Calc)."
-
- # basculement vers la feuille de calcul concernée, création au besoin
- sheets = document.getSheets()
- try:
- sheet = sheets.getByName(sheet_name)
- new_sheet = False
- except NoSuchElementException, e:
- sheets.insertNewByName(sheet_name, 0)
- sheet = sheets.getByName(sheet_name)
- new_sheet = True
- controller = document.getCurrentController()
- controller.setActiveSheet(sheet)
-
- # récupération des formats date, monétaire et nombre en français
- # http://api.openoffice.org/docs/common/ref/com/sun/star/util/XNumberFormatTypes.html
- # http://api.openoffice.org/docs/common/ref/com/sun/star/i18n/NumberFormatIndex.html
- locale_fr_FR = Locale('fr', 'FR', '')
- number_formats = document.getNumberFormats()
- date_format = number_formats.getStandardFormat(DATE, locale_fr_FR)
- currency_format = number_formats.getStandardFormat(CURRENCY, locale_fr_FR)
- number_format = number_formats.getFormatIndex(NUMBER_1000DEC2, locale_fr_FR)
- #format_string = number_formats.generateFormat(
- # NUMBER, locale_fr_FR, True, False, 2, 1)
- #format_key = number_formats.queryKey(format_string, locale_fr_FR, True)
- #if format_key < 0:
- # format_key = number_formats.addNew(format_string, locale_fr_FR)
- #print "NUMBER_1000DEC2=%s key=%s" % (NUMBER_1000DEC2, format_key)
- #number_format = number_formats.getByKey(format_key)
-
- # détermination de la zone de travail
- if action.endswith('-encore'):
- # localisation de la la zone déjà utilisée
- cursor = sheet.createCursor()
- cursor.gotoEndOfUsedArea(False)
- cursor.gotoStartOfUsedArea(True)
- rangeAddress = cursor.getRangeAddress()
- row = rangeAddress.EndRow
- # FIXME: on devrait comparer ici rangeAddress.EndColumn avec len(data[0])
- else:
- row = 0
-
- cell_range = sheet.getCellRangeByPosition(
- 0, row, len(data[0])-1, row + len(data)-1)
- cursor = sheet.createCursorByRange(cell_range)
-
- # insertion des données
- for row in range(1, len(data)):
- for column in range(len(data[row])):
- value = data[row][column]
- cell = cursor.getCellByPosition(column, row)
- if column_type[column] == float and value != '#DEV!':
- cell.Value = value
- else:
- cell.Formula = value
-
- # insertion des en-têtes, après les données pour un autofit correct
- if new_sheet:
- for column in range(len(data[0])):
- # écriture de l'en-tête de la colonne
- cell = cursor.getCellByPosition(column, 0)
- cell.Formula = data[0][column]
- # formatage par défaut pour la colonne
- sheet_column = sheet.Columns.getByIndex(column)
- if column_type[column] == datetime.date:
- sheet_column.NumberFormat = date_format
- elif column_type[column] == float:
- if action == 'cumuls':
- sheet_column.NumberFormat = currency_format
- else:
- if data[0][column] in COLONNES_NUMERIQUES:
- sheet_column.NumberFormat = number_format
- else:
- sheet_column.NumberFormat = currency_format
- # ajustement automatique, une fois toutes les valeurs écrites
- sheet_column.OptimalWidth = True
- # formatage spécifique pour la ligne d'en-têtes
- headers_row = sheet.Rows.getByIndex(0)
- headers_row.ParaAdjust = 3 # CENTER
-
-##############################################################################
-
-# Show a message box with the UNO based toolkit
-def messageBox(ctx, message):
- document = XSCRIPTCONTEXT.getDocument()
- window = document.CurrentController.Frame.ContainerWindow
-
- aDescriptor = WindowDescriptor()
- aDescriptor.Type = MODALTOP
- aDescriptor.WindowServiceName = "infobox"
- aDescriptor.ParentIndex = -1
- aDescriptor.Parent = window
- #aDescriptor.Bounds = Rectangle()
- aDescriptor.WindowAttributes = OK
-
- tk = window.getToolkit()
- msgbox = tk.createWindow(aDescriptor)
- msgbox.setCaptionText("Collage d'interrogation CODA")
- msgbox.setMessageText(unicode(message))
-
- return msgbox.execute()
-
-def coller_cumuls(event=False):
- u"""Coller une interrogation des cumuls CODA."""
- ctx = uno.getComponentContext()
- try:
- main(ctx, 'cumuls')
- except Exception, e:
- messageBox(ctx, e)
- return None
-
-def coller_details(event=False):
- u"""Coller une interrogation des détails CODA."""
- ctx = uno.getComponentContext()
- try:
- main(ctx, 'details')
- except Exception, e:
- messageBox(ctx, e)
- return None
-
-def coller_details_encore(event=False):
- u"""Coller une interrogation des détails CODA supplémentaire."""
- ctx = uno.getComponentContext()
- try:
- main(ctx, 'details-encore')
- except Exception, e:
- messageBox(ctx, e)
- return None
-
-g_exportedScripts = (coller_cumuls, coller_details, coller_details_encore)
-
-##############################################################################
-
-from com.sun.star.task import XJobExecutor
-
-class CollerCumulsJob(unohelper.Base, XJobExecutor):
- def __init__(self, context):
- self._context = context
-
- def trigger(self, args):
- try:
- main(self._context, 'cumuls')
- except Exception, e:
- messageBox(self._context, e)
-
-class CollerDetailsJob(unohelper.Base, XJobExecutor):
- def __init__(self, context):
- self._context = context
-
- def trigger(self, args):
- try:
- main(self._context, 'details')
- except Exception, e:
- messageBox(self._context, e)
-
-class CollerDetailsEncoreJob(unohelper.Base, XJobExecutor):
- def __init__(self, context):
- self._context = context
-
- def trigger(self, args):
- try:
- main(self._context, 'details-encore')
- except Exception, e:
- messageBox(self._context, e)
-
-g_ImplementationHelper = unohelper.ImplementationHelper()
-g_ImplementationHelper.addImplementation( \
- CollerCumulsJob, "org.auf.openoffice.CODA.CollerCumuls", \
- ("com.sun.star.task.Job",),)
-g_ImplementationHelper.addImplementation( \
- CollerDetailsJob, "org.auf.openoffice.CODA.CollerDetails", \
- ("com.sun.star.task.Job",),)
-g_ImplementationHelper.addImplementation( \
- CollerDetailsEncoreJob, "org.auf.openoffice.CODA.CollerDetailsEncore", \
- ("com.sun.star.task.Job",),)
+++ /dev/null
-#!
-# -*- coding: utf_8 -*-
-"""
-Extension pour faciliter l'intégration du logiciel Coda.
-Gestion de la fenêtre des options.
-
-Copyright : Agence universitaire de la Francophonie
-Licence : GNU General Public Licence, version 2
-Auteur : Jean Christophe André
-Date de création : juillet 2009
-"""
-import uno
-import unohelper
-
-# interfaces
-from com.sun.star.lang import XServiceInfo
-from com.sun.star.awt import XContainerWindowEventHandler
-
-# main class
-class DialogHandler(unohelper.Base, XServiceInfo, XContainerWindowEventHandler):
- def __init__(self, ctx):
- self.ctx = ctx;
- self.cp = self.ctx.ServiceManager.createInstanceWithContext(
- "com.sun.star.configuration.ConfigurationProvider",
- self.ctx)
- node = uno.createUnoStruct("com.sun.star.beans.PropertyValue")
- node.Name = "nodepath"
- node.Value = "/org.openoffice.VCL/Settings/Transfer"
- self.node = node
- self.cfg_names = ("SelectionTimeout",)
- return
-
- # XContainerWindowEventHandler
- def callHandlerMethod(self, window, eventObject, method):
- if method == "external_event":
- try:
- self.handleExternalEvent(window, eventObject)
- except:
- pass
- return True
-
- # XContainerWindowEventHandler
- def getSupportedMethodNames(self):
- return ("external_event",)
-
- def supportsService(self, name):
- return False
-
- def getImplementationName(self):
- return "org.auf.openoffice.macros.DialogHandler"
-
- def getSupportedServiceNames(self):
- return ()
-
- def handleExternalEvent(self, window, eventName):
- if eventName == "ok":
- self.saveData(window)
- elif eventName == "back":
- self.loadData(window, "back")
- elif eventName == "initialize":
- self.loadData(window, "initialize")
- return True
-
- # load and set the data
- def loadData(self, window, ev):
- name = window.getModel().Name
- if name != "MacrosDialog":
- return
- settings = self.configreader()
- if not settings:
- return
- for name in self.cfg_names:
- window.getControl(name).setValue(settings.get(name, ''))
- return
-
- # making the save data
- def saveData(self,window):
- name = window.getModel().Name
- if name != "MacrosDialog":
- return
- settings = []
- for name in self.cfg_names:
- settings.append(str(int(window.getControl(name).Value)))
- self.configwriter(tuple(settings))
- return
-
- # read configuration
- def configreader(self):
- settings = {}
- try:
- ConfigReader = self.cp.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationAccess",
- (self.node,))
- #cfg_values = ConfigReader.getPropertyValues(self.cfg_names)
- for i in range(len(self.cfg_names)):
- cfg_value = ConfigReader.getByName(self.cfg_names[i])
- settings[self.cfg_names[i]] = cfg_value
- except:
- pass
- return settings
-
- # write configuration, cfg_values: tuple
- # keep the order of the values
- def configwriter(self, cfg_values):
- try:
- ConfigWriter = self.cp.createInstanceWithArguments(
- "com.sun.star.configuration.ConfigurationUpdateAccess",
- (self.node,))
- #ConfigWriter.setPropertyValues(self.cfg_names, cfg_values)
- for i in range(len(self.cfg_names)):
- ConfigWriter.replaceByName(self.cfg_names[i], cfg_values[i])
- ConfigWriter.commitChanges()
- except:
- pass
-
-# uno implementation
-g_ImplementationHelper = unohelper.ImplementationHelper()
-g_ImplementationHelper.addImplementation( \
- DialogHandler, "org.auf.openoffice.macros.DialogHandler", \
- ("org.auf.openoffice.macros.DialogHandler",),)
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">
-<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest">
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data" manifest:full-path="Addons.xcu"/>
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data" manifest:full-path="rdesktop.xcu"/>
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data" manifest:full-path="macrosecurity.xcu"/>
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data" manifest:full-path="systemfiledialog.xcu"/>
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data" manifest:full-path="OptionsDialog.xcu"/>
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=Python" manifest:full-path="DialogHandler.py"/>
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=Python" manifest:full-path="CODA.py"/>
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=Python" manifest:full-path="calc2moin.py"/>
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.dialog-library" manifest:full-path="dialogs/"/>
-</manifest:manifest>
+++ /dev/null
-<?xml version='1.0' encoding='UTF-8'?>
-<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="OptionsDialog" oor:package="org.openoffice.Office">
-<node oor:name="Nodes">
- <node oor:name="org.auf.openoffice.Addons" oor:op="fuse">
- <prop oor:name="Label">
- <value xml:lang="fr-FR">Extensions AUF</value>
- </prop>
- <prop oor:name="OptionsPage">
- <value>%origin%/dialogs/Extensions/ExtensionsDialog.xdl</value>
- </prop>
- <prop oor:name="AllModules">
- <value>true</value>
- </prop>
- <node oor:name="Leaves">
- <node oor:name="org.auf.openoffice.macros" oor:op="replace">
- <prop oor:name="Id">
- <value>org.auf.openoffice.macros.General</value>
- </prop>
- <prop oor:name="Label">
- <value xml:lang="fr-FR">Macros AUF pour OpenOffice.org</value>
- </prop>
- <prop oor:name="OptionsPage">
- <value>%origin%/dialogs/Macros/MacrosDialog.xdl</value>
- </prop>
- <prop oor:name="EventHandlerService">
- <value>org.auf.openoffice.macros.DialogHandler</value>
- </prop>
- </node>
- </node>
- </node>
-</node>
-</oor:component-data>
+++ /dev/null
-#!
-# -*- coding: utf-8 -*-
-"""
-Macro pour faciliter l'intégration des données d'une feuille de calcul
-vers un wiki MoinMoin.
-
-Copyright : Agence universitaire de la Francophonie
-Licence : GNU General Public Licence, version 2
-Auteur : Jean Christophe André
-Date de création : septembre 2009
-"""
-import uno
-import unohelper
-from com.sun.star.task import XJobExecutor
-from com.sun.star.beans import PropertyValue
-from com.sun.star.table.CellContentType import EMPTY, VALUE, TEXT, FORMULA
-from com.sun.star.table.CellHoriJustify import STANDARD, LEFT, CENTER, RIGHT
-
-def calc2moin(ctx):
- data = []
-
- ## The context variable is of type XScriptContext and is available to
- ## all BeanShell scripts executed by the Script Framework
- #curdoc = XSCRIPTCONTEXT.getDocument()
- #ctx = uno.getComponentContext()
-
- # récupération du document en cours, vérification du type Spreadsheet
- smgr = ctx.ServiceManager
- desktop = smgr.createInstanceWithContext(
- "com.sun.star.frame.Desktop", ctx)
- curdoc = desktop.getCurrentComponent()
- if not curdoc.supportsService("com.sun.star.sheet.SpreadsheetDocument"):
- raise RuntimeError, u"Ce n'est pas un document de type Spreadsheet (Calc)."
-
- controller = curdoc.getCurrentController()
- sheet = controller.getActiveSheet()
-
- # localisation de la la zone déjà utilisée
- cursor = sheet.createCursor()
- cursor.gotoEndOfUsedArea(False)
- cursor.gotoStartOfUsedArea(True)
- rangeAddress = cursor.getRangeAddress()
- rows = rangeAddress.EndRow - rangeAddress.StartRow + 1
- columns = rangeAddress.EndColumn - rangeAddress.StartColumn + 1
- for row in range(rows):
- row_data = []
- for column in range(columns):
- cell_data = []
- cell = cursor.getCellByPosition(column, row)
- cell_type = cell.getType()
- cell_string = cell.getString()
- # process cell' styles
- cell_styles = []
- if hasattr(cell, 'CellBackColor'):
- color = cell.getPropertyValue('CellBackColor')
- if color >= 0:
- cell_styles.append('background: #%06x' % color)
- if hasattr(cell, 'HoriJustify'):
- horiJustify = cell.getPropertyValue('HoriJustify')
- if horiJustify == LEFT:
- text_align = '' #text_align = 'left'
- elif horiJustify == CENTER:
- text_align = 'center'
- elif horiJustify == RIGHT:
- text_align = 'right'
- else:
- if cell_type == TEXT:
- text_align = '' #text_align = 'left'
- elif cell_type != EMPTY:
- text_align = 'right'
- if text_align and cell_string:
- cell_styles.append('text-align: ' + text_align)
- # add cell to row
- if cell_styles:
- cell_data.append('<style="%s;">' % '; '.join(cell_styles))
- if cell_string:
- cell_data.append(cell_string)
- else:
- cell_data.append(' ')
- row_data.append(''.join(cell_data))
- # display row's code
- data.append('||' + '||'.join(row_data) + '||')
-
- #
- # création d'un document Writer pour écrire le code MoinMoin
- #
- # ouverture d'un document Writer caché
- hidden = PropertyValue()
- hidden.Name = "Hidden"
- hidden.Value = True
- doc = desktop.loadComponentFromURL(
- "private:factory/swriter", "_blank", 0, (hidden, ) )
- text = doc.Text
- textcursor = text.createTextCursor()
- text.insertString(textcursor, '\n'.join(data) + '\n', 0)
- # on copie ça dans le presse papier
- dispatcher = smgr.createInstanceWithContext(
- "com.sun.star.frame.DispatchHelper", ctx)
- frame = doc.getCurrentController().getFrame()
- dispatcher.executeDispatch(frame, ".uno:SelectAll", "", 0, ())
- dispatcher.executeDispatch(frame, ".uno:Copy", "", 0, ())
- doc.close(True)
-
-##############################################################################
-
-def copier(event=False):
- u"""Copier une feuille de calcul vers un wiki MoinMoin."""
- ctx = uno.getComponentContext()
- calc2moin(ctx)
- return None
-
-g_exportedScripts = (copier, )
-
-##############################################################################
-
-class CopierJob(unohelper.Base, XJobExecutor):
- def __init__(self, context):
- self._context = context
-
- def trigger(self, args):
- calc2moin(self._context)
-
-g_ImplementationHelper = unohelper.ImplementationHelper()
-g_ImplementationHelper.addImplementation( \
- CopierJob, "org.auf.openoffice.calc2moin.Copier", \
- ("com.sun.star.task.Job",),)
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<description xmlns="http://openoffice.org/extensions/description/2006" xmlns:d="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink">
-
- <identifier value="org.auf.openoffice.macros" />
- <version value="1.13" />
- <platform value="all" />
-
- <dependencies>
- <OpenOffice.org-minimal-version value="3.2.1" d:name="OpenOffice.org 3.2.1" />
- </dependencies>
-
- <!-- If you uploaded your extension to the repository (which should be
- the default!) you do not need to have this one.
- <update-information>
- <src xlink:href="http://macros.openoffice.auf.org/update.xml" />
- </update-information>
- -->
-
- <!-- Check if this is already generated by repository.
- Otherwise you may like to provide it manually.
- -->
- <publisher>
- <name xlink:href="http://www.auf.org/" lang="fr">AUF / ARI / Jean Christophe André</name>
- </publisher>
-
- <display-name>
- <name lang="fr">Macros AUF pour OpenOffice.org</name>
- </display-name>
-
- <icon>
- <default xlink:href="images/logo-auf.png" />
- </icon>
-
- <!--
- <extension-description>
- <src xlink:href="description/desc_en.txt" lang="fr" />
- </extension-description>
- -->
-
-</description>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
-<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="ExtensionsDialog" dlg:left="11" dlg:top="91" dlg:width="263" dlg:height="185" dlg:help-text="&38.ExtensionsDialog.HelpText" dlg:closeable="true" dlg:moveable="true" dlg:title="&39.ExtensionsDialog.Title" dlg:withtitlebar="false">
- <dlg:styles>
- <dlg:style dlg:style-id="0" dlg:font-height="12"/>
- <dlg:style dlg:style-id="1" dlg:border="none"/>
- </dlg:styles>
- <dlg:bulletinboard>
- <dlg:text dlg:style-id="0" dlg:id="label_title" dlg:tab-index="1" dlg:left="31" dlg:top="10" dlg:width="220" dlg:height="17" dlg:help-text="&40.ExtensionsDialog.label_title.HelpText" dlg:value="&41.ExtensionsDialog.label_title.Label"/>
- <dlg:img dlg:style-id="1" dlg:id="image_icon" dlg:tab-index="3" dlg:left="8" dlg:top="8" dlg:width="20" dlg:height="20" dlg:help-text="&42.ExtensionsDialog.image_icon.HelpText"/>
- <dlg:text dlg:id="label_description" dlg:tab-index="2" dlg:left="32" dlg:top="47" dlg:width="220" dlg:height="121" dlg:help-text="&43.ExtensionsDialog.label_description.HelpText" dlg:value="&44.ExtensionsDialog.label_description.Label"/>
- <dlg:fixedline dlg:id="line_separator" dlg:tab-index="0" dlg:left="5" dlg:top="33" dlg:width="252" dlg:height="1" dlg:help-text="&45.ExtensionsDialog.line_separator.HelpText" dlg:value="&46.ExtensionsDialog.line_separator.Label"/>
- </dlg:bulletinboard>
-</dlg:window>
+++ /dev/null
-# ExtensionsDialog strings
-38.ExtensionsDialog.HelpText=
-39.ExtensionsDialog.Title=
-40.ExtensionsDialog.label_title.HelpText=
-41.ExtensionsDialog.label_title.Label=Extensions AUF
-42.ExtensionsDialog.image_icon.HelpText=
-43.ExtensionsDialog.label_description.HelpText=
-44.ExtensionsDialog.label_description.Label=Extensions AUF pour OpenOffice.org.
-45.ExtensionsDialog.line_separator.HelpText=
-46.ExtensionsDialog.line_separator.Label=
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
-<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="MacrosDialog" dlg:left="186" dlg:top="130" dlg:width="260" dlg:height="185" dlg:help-text="&0.MacrosDialog.HelpText" dlg:closeable="true" dlg:moveable="true" dlg:title="&1.MacrosDialog.Title" dlg:withtitlebar="false">
- <dlg:bulletinboard>
- <dlg:titledbox dlg:id="FrameControl1" dlg:tab-index="0" dlg:left="10" dlg:top="10" dlg:width="240" dlg:height="60" dlg:help-text="&2.MacrosDialog.FrameControl1.HelpText">
- <dlg:title dlg:value="&3.MacrosDialog.FrameControl1.Label"/>
- </dlg:titledbox>
- <dlg:text dlg:id="SelectionTimeoutLabel" dlg:tab-index="0" dlg:left="15" dlg:top="20" dlg:width="70" dlg:height="12" dlg:help-text="&4.MacrosDialog.SelectionTimeoutLabel.HelpText" dlg:value="&5.MacrosDialog.SelectionTimeoutLabel.Label"/>
- <dlg:numericfield dlg:id="SelectionTimeout" dlg:tab-index="1" dlg:left="90" dlg:top="18" dlg:width="20" dlg:height="12" dlg:help-text="&6.MacrosDialog.SelectionTimeout.HelpText" dlg:value="&7.MacrosDialog.SelectionTimeout.Label" dlg:decimal-accuracy="0" dlg:value-min="3"/>
- </dlg:bulletinboard>
-</dlg:window>
+++ /dev/null
-# MacrosDialog strings
-0.MacrosDialog.HelpText=
-1.MacrosDialog.Title=
-2.MacrosDialog.FrameControl1.HelpText=
-3.MacrosDialog.FrameControl1.Label=
-4.MacrosDialog.SelectionTimeoutLabel.HelpText=
-5.MacrosDialog.SelectionTimeoutLabel.Label=D\u00e9lai pour le copier/coller :
-6.MacrosDialog.SelectionTimeout.HelpText=D\u00e9lai maximum, en secondes, pour le copier/coller (conseil : 30)
-7.MacrosDialog.SelectionTimeout.Label=30
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
-<library:library xmlns:library="http://openoffice.org/2000/library" library:name="macros" library:readonly="false" library:passwordprotected="false"/>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Common" oor:package="org.openoffice.Office">
- <node oor:name="Security">
- <node oor:name="Scripting">
- <prop oor:name="MacroSecurityLevel" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
- </node>
-</oor:component-data>
+++ /dev/null
-<?xml version='1.0' encoding='UTF-8'?>
-<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="VCL" oor:package="org.openoffice">
- <node oor:name="Settings">
- <node oor:name="Transfer" oor:op="replace">
- <prop oor:name="SelectionTimeout" oor:type="xs:string" oor:op="replace">
- <value>30</value>
- </prop>
- </node>
- </node>
-</oor:component-data>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Common" oor:package="org.openoffice.Office">
- <node oor:name="Misc">
- <prop oor:name="UseSystemFileDialog" oor:type="xs:boolean">
- <value>true</value>
- </prop>
- </node>
-</oor:component-data>