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

55 lines
2.1 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="ApZotUtilities" 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;************************************************************************
Sub CountOccurrencesPerReference
Dim vSortedItemMap As Variant
Dim oScope As Object
oScope = ThisComponent
vSortedItemMap = getOccurrencesCount(oScope)
PrintMap(vSortedItemMap)
End Sub
Sub ChangeGreekFont
Dim oSearch As Object
Dim oDocument As Object
Dim oResult As Object
Dim i As Integer
Dim oFound As Object
Dim oFoundCursor As Object
oDocument = ThisComponent
oSearch = oDocument.createSearchDescriptor
oSearch.SearchString = sGreekTextRegex
oSearch.SearchRegularExpression = TRUE
oResult = oDocument.findAll(oSearch)
For i = 0 To oResult.count - 1
oFound = oResult.getByIndex(i)
oFoundCursor = oFound.Text.createTextCursorByRange(oFound)
oFoundCursor.CharFontName = GreekFont
Next i
End Sub
</script:module>