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

56 lines
2.0 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" 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;.
'*
'************************************************************************
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>