csl-clio/Macros/LibreOffice/ApresZotero/ApZotRevues.xba

80 lines
7.3 KiB
Plaintext
Raw Permalink Normal View History

<?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="ApZotRevues" script:language="StarBasic">REM ***** BASIC *****
&apos;************************************************************************
&apos;* Copyright 2021 by Bastien Dumont (bastien.dumont@posteo.net)
&apos;*
&apos;* This file is part of the ApresZotero library.
&apos;*
&apos;* ApresZotero is free software: you can redistribute it and/or modify
&apos;* it under the terms of the GNU General Public License as published by
&apos;* the Free Software Foundation, either version 3 of the License, or
&apos;* (at your option) any later version.
&apos;*
&apos;* ApresZotero is distributed in the hope that it will be useful,
&apos;* but WITHOUT ANY WARRANTY; without even the implied warranty of
&apos;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
&apos;* GNU General Public License for more details.
&apos;*
&apos;* You should have received a copy of the GNU General Public License
&apos;* along with ApresZotero. If not, see &lt;https://www.gnu.org/licenses/&gt;.
&apos;*
&apos;************************************************************************
Option Compatible
Option Explicit
Sub REB
Const mJournal As String = &quot;REB&quot;
Const sCitedPrefix As String = &quot;, cité n. &quot;
Dim mTitreLong() As String
mTitreLong = Array(&quot;Acta Sanctorum&quot;, &quot;Acta Conciliorum Oecumenicorum&quot;, &quot;Analecta Bollandiana&quot;, &quot;Archives de l&apos;Orient chrétien&quot;, &quot;Byzantinische Forschungen&quot;, &quot;Bibliotheca Hagiographica Graeca&quot;, &quot;Byzantine and Modern Greek Studies&quot;, &quot;Byzantinisch-Neugriechische Jahrbücher&quot;, &quot;Byzantinoslavica&quot;, &quot;Byzantion&quot;, &quot;Byzantinische Zeitschrift&quot;, &quot;Cahiers Archéologiques&quot;, &quot;Corpus Christianorum, Series Graeca&quot;, &quot;Corpus Fontium Historiae Byzantinae&quot;, &quot;Clavis Patrum Graecorum&quot;, &quot;Corpus Scriptorum Christianorum Orientalium&quot;, &quot;Corpus Scriptorum Historiae Byzantinae&quot;, &quot;Dictionnaire d&apos;Archéologie Chrétienne et de Liturgie&quot;, &quot;Δελτίον τῆς Χριστιανικῆς καὶ Ἀρχαιολογικῆς Ἑταιρείας&quot;, &quot;Dictionnaire dHistoire et de Géographie Ecclésiastiques&quot;, &quot;Dumbarton Oaks Papers&quot;, &quot;Dictionnaire de Théologie Catholique&quot;, &quot;Ἐπετηρὶς Ἑταιρείας Βυζαντινῶν Σπουδῶν&quot;, &quot;Échos d&apos;Orient&quot;, &quot;Greek, Roman and Byzantine Studies&quot;, &quot;Известия Русскаго Археолгическаго Института в Константинополие&quot;, &quot;Jahrbuch der Österreichischen Byzantinistik&quot;, &quot;Lexikon zur byzantinischen Gräzität&quot;, &quot;Lexikon für Theologie und Kirche&quot;, &quot;Μεσαιωνικὴ Βιβλιοθήκη&quot;, &quot;Medioevo Greco&quot;, &quot;Monumenta Germaniae Historica&quot;, &quot;F. Miklosich, J. Müller (éd.), Acta et diplomata&quot;, &quot;Νέος Ἑλληνομνήμων&quot;, &quot;Orientalia Christiana Analecta&quot;, &quot;Orientalia Christiana Periodica&quot;, &quot;The Oxford Dictionary of Byzantium, I-III, New York Oxford 1991&quot;, &quot;Prosopography of the Byzantine Empire I (641-867)&quot;, &quot;Prosopography of the Byzantine World&quot;, &quot;Patrologia Graeca&quot;, &quot;Patrologie grecque&quot;, &quot;Patrologia Latina&quot;, &quot;Patrologie latine&quot;, &quot;Prosopographisches Lexikon der Palaiologenzeit&quot;, &quot;Prosopographie der mittelbyzantinischen Zeit (641-1025)&quot;, &quot;Patrologia Orientalis&quot;, &quot;Patrologie orientale&quot;, &quot;Patristische Texte und Studien&quot;, &quot;Revue des Études Byzantines&quot;, &quot;Revue des Études Grecques&quot;, &quot;Revue des Études Sud-Est Européennes&quot;, &quot;Repertorium der griechischen Kopisten&quot;, &quot;Rivista di Studi Bizantini e Neoellenici&quot;, &quot;Rivista di Studi Bizantini e Slavi&quot;, &quot;Studies in Byzantine Sigillography&quot;, &quot;Sources Chrétiennes&quot;, &quot;Synaxarium Ecclesiae Constantinopolitanae&quot;, &quot;Θρησκευτικὴ καὶ Ἠθικὴ Ἐγκυκλοπαιδεία&quot;, &quot;Tabula Imperii Byzantini&quot;, &quot;Travaux et Mémoires&quot;, &quot;Византийский Временник&quot;)
Dim mAbrev() As String
mAbrev= Array(&quot;AASS&quot;, &quot;ACO&quot;, &quot;An. Boll.&quot;, &quot;AOC&quot;, &quot;BF&quot;, &quot;BHG&quot;, &quot;BMGS&quot;, &quot;BNJ&quot;, &quot;BS&quot;, &quot;Byz.&quot;, &quot;BZ&quot;, &quot;CA&quot;, &quot;CCSG&quot;, &quot;CFHB&quot;, &quot;CPG&quot;, &quot;CSCO&quot;, &quot;CSHB&quot;, &quot;DACL&quot;, &quot;DChAE&quot;, &quot;DHGE&quot;, &quot;DOP&quot;, &quot;DTC&quot;, &quot;EEBS&quot;, &quot;EO&quot;, &quot;GRBS&quot;, &quot;IRAIK&quot;, &quot;JÖB&quot;, &quot;LBG&quot;, &quot;LTK&quot;, &quot;MB&quot;, &quot;MEG&quot;, &quot;MGH&quot;, &quot;MM&quot;, &quot;NE&quot;, &quot;OCA&quot;, &quot;OCP&quot;, &quot;ODB&quot;, &quot;PBE&quot;, &quot;PBW&quot;, &quot;PG&quot;, &quot;PG&quot;, &quot;PL&quot;, &quot;PL&quot;, &quot;PLP&quot;, &quot;PMBZ&quot;, &quot;PO&quot;, &quot;PO&quot;, &quot;PTS&quot;, &quot;REB&quot;, &quot;REG&quot;, &quot;RESEE&quot;, &quot;RGK&quot;, &quot;RSBN&quot;, &quot;RSBS&quot;, &quot;SBS&quot;, &quot;SC&quot;, &quot;Syn. CP&quot;, &quot;ThEE&quot;, &quot;TIB&quot;, &quot;TM&quot;, &quot;VV&quot;)
Const sLineRefRegex As String = &quot;, l\.[  ]([A-D0-9-]+)&quot;
Dim oDocument As Object
Dim oSearch As Object, oReplace As Object, oResult As Object
Dim oFound As Object, oFoundCursor As Object
Dim n As Integer
Dim iReturnCode As Integer
&apos; Initialisation des objets utilisés dans plusieurs blocs de code
oDocument = ThisComponent
oSearch = oDocument.createSearchDescriptor
oReplace = oDocument.createReplaceDescriptor
&apos; Vérifier que le document n&apos;a plus à être modifié.
If Check(mJournal) = 7 Then
Exit Sub
End If
&apos; Abrègement des titres de revues
Abbreviate (oDocument, mTitreLong(), mAbrev(), mJournal, False)
AbbrevAnnee_Philologique(True)
&apos; Numéros de lignes en exposant sans &quot;l. &quot;
MsgBox(&quot;Vous allez d&apos;abord être interrogé·e pour vérifier que les&quot; &amp;_
&quot; références aux lignes sont correctement reconnues. Chaque fois&quot; &amp;_
&quot; que vous répondrez OUI, elles seront mises en exposant. Dans un&quot; &amp;_
&quot; second temps, les chaînes de caractères “, l. ” seront supprimées.&quot;,_
0, mJournal)
SetStringPartToExponent(oDocument, sLineRefRegex, sLineRefRegex)
ReplaceString(sLineRefRegex, &quot;$1&quot;, TRUE)
SetFolioToPluralForm(&quot;f. &quot;, &quot;ff. &quot;)
ReplaceString(&quot; - &quot;, &quot;-&quot;, FALSE)
SetStringPartToExponent(oDocument, sRectoVersoRegex, &quot;[rv](-v)?&quot;)
SetStringPartToExponent(oDocument, sNumberOrIssueRegex, &quot;os?&quot;)
SetFontSlantToString(&quot;CPG&quot;, com.sun.star.awt.FontSlant.ITALIC)
SetFontSlantToString(&quot;BHG&quot;, com.sun.star.awt.FontSlant.ITALIC)
HandleItemsInBibliography(&quot;Titre Liste des abréviations&quot;)
end sub
</script:module>