forked from oahrens/Zotero-Tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZtConfigFinalCitationGroup.cls
97 lines (75 loc) · 4.81 KB
/
ZtConfigFinalCitationGroup.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "ZtConfigFinalCitationGroup"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' Class ZtConfigFinalCitationGroup.
' It preserves a part of the final configuration informations and methods to read them from ZtConfig.xml.
'
' Zotero Tools.
' This software is under Revised ('New') BSD license.
' Copyright © 2019, Olaf Ahrens. All rights reserved.
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' Private variables.
Private pvtBetweenDeleteRegExp As ZtRegExp
Private pvtBetweenDeleteMultipleSpaceRegExp As ZtRegExp
Private pvtBetweenDeleteAffixedSpaceRegExp As ZtRegExp
Private pvtPunctuationRegExp() As ZtRegExp
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
' Friend procedures and properties.
Friend Sub Initialize(ByVal valConfig As ZtConfig, ByVal valXml As MSXML2.DOMDocument60)
Dim locNode As MSXML2.IXMLDOMNode
ReDim pvtPunctuationRegExp(3)
Set locNode = valXml.SelectSingleNode("/zoteroTools/final/citationGroup")
With locNode
valConfig.RegExpFactory pvtBetweenDeleteRegExp, _
"delete between citation groups", _
valConfig.ResolveTextElement(.SelectSingleNode("betweenDeleteRegString"), True), _
True
valConfig.RegExpFactory pvtBetweenDeleteMultipleSpaceRegExp, _
"delete multiple spaces between citation groups", _
valConfig.ResolveTextElement(.SelectSingleNode("betweenDeleteMultipleSpaceRegString"), True), _
True
valConfig.RegExpFactory pvtBetweenDeleteAffixedSpaceRegExp, _
"delete affixed spaces between citation groups", _
valConfig.ResolveTextElement(.SelectSingleNode("betweenDeleteAffixedSpaceRegString"), True), _
True
valConfig.RegExpFactory pvtPunctuationRegExp(SignsBeforeAndAfter), _
"punctuation", _
valConfig.ResolveTextElement(.SelectSingleNode("punctuationRegString[@surroundingSigns='" & CStr(SignsBeforeAndAfter) & "']"), True), _
True
valConfig.RegExpFactory pvtPunctuationRegExp(SignBefore), _
"punctuation", _
valConfig.ResolveTextElement(.SelectSingleNode("punctuationRegString[@surroundingSigns='" & CStr(SignBefore) & "']"), True), _
True
valConfig.RegExpFactory pvtPunctuationRegExp(SignAfter), _
"punctuation", _
valConfig.ResolveTextElement(.SelectSingleNode("punctuationRegString[@surroundingSigns='" & CStr(SignAfter) & "']"), True), _
True
valConfig.RegExpFactory pvtPunctuationRegExp(NoSigns), _
"punctuation", _
valConfig.ResolveTextElement(.SelectSingleNode("punctuationRegString[@surroundingSigns='" & CStr(NoSigns) & "']"), True), _
True
End With
End Sub
Friend Property Get BetweenDeleteRegExp() As ZtRegExp
Set BetweenDeleteRegExp = pvtBetweenDeleteRegExp
End Property
Friend Property Get BetweenDeleteMultipleSpaceRegExp() As ZtRegExp
Set BetweenDeleteMultipleSpaceRegExp = pvtBetweenDeleteMultipleSpaceRegExp
End Property
Friend Property Get BetweenDeleteAffixedSpaceRegExp() As ZtRegExp
Set BetweenDeleteAffixedSpaceRegExp = pvtBetweenDeleteAffixedSpaceRegExp
End Property
Friend Function PunctuationRegExp(ByVal valSurroundingSigns As ZtFSurroundingSigns) As ZtRegExp
Set PunctuationRegExp = pvtPunctuationRegExp(valSurroundingSigns)
End Function
' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *