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

86 lines
7.4 KiB
Plaintext
Raw 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" script:moduleType="normal">REM ***** BASIC *****
'************************************************************************
'* Copyright 2021 by Bastien Dumont (bastien.dumont@posteo.net)
'*
'* This file is part of the ApresZotero library.
'*
'* ApresZotero 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 3 of the License, or
'* (at your option) any later version.
'*
'* ApresZotero 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 ApresZotero. If not, see &lt;https://www.gnu.org/licenses/&gt;.
'*
'************************************************************************
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;
oSearch.SearchString = sLineRefRegex
oSearch.SearchRegularExpression = TRUE
oResult = oDocument.findAll(oSearch)
For n = 0 To oResult.count - 1
oFound = oResult.getByIndex(n)
oFoundCursor = oFound.Text.createTextCursorByRange(oFound)
oFoundCursor.CharEscapement = nExponentCharSizePercentage
oFoundCursor.CharEscapementHeight = nExponentCharHeightPercentage
Next n
ReplaceString(sLineRefRegex, &quot;$1&quot;, TRUE)
SetFolioToPluralForm(&quot;f. &quot;, &quot;ff. &quot;)
ReplaceString(&quot;&quot;, &quot; &quot;, FALSE) &apos; Replace narrow non breakable spaces (automatically generated by Zotero) by simple non breakable spaces.
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>