Changes In Branch multid
Through [635fcc243b]
Excluding Merge-Ins
This is equivalent to a diff from
94e2e47aea
to 635fcc243b
Modified gc_core/js/lang_core/gc_engine.js
from [2ba338046d]
to [7ee1350cd7].
︙ | | |
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
|
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
|
-
+
-
+
|
//// Initialization
load: function (sContext="JavaScript", sPath="") {
try {
if (typeof(require) !== 'undefined') {
var spellchecker = require("resource://grammalecte/graphspell/spellchecker.js");
_oSpellChecker = new spellchecker.SpellChecker("${lang}", "", "${dic_main_filename_js}", "${dic_extended_filename_js}", "${dic_personal_filename_js}");
_oSpellChecker = new spellchecker.SpellChecker("${lang}", "", "${dic_main_filename_js}", "${dic_extended_filename_js}", "${dic_community_filename_js}", "${dic_personal_filename_js}");
} else {
_oSpellChecker = new SpellChecker("${lang}", sPath, "${dic_main_filename_js}", "${dic_extended_filename_js}", "${dic_personal_filename_js}");
_oSpellChecker = new SpellChecker("${lang}", sPath, "${dic_main_filename_js}", "${dic_extended_filename_js}", "${dic_community_filename_js}", "${dic_personal_filename_js}");
}
_sAppContext = sContext;
_dOptions = gc_options.getOptions(sContext).gl_shallowCopy(); // duplication necessary, to be able to reset to default
}
catch (e) {
helpers.logerror(e);
}
|
︙ | | |
Modified gc_core/py/lang_core/gc_engine.py
from [b15edd00ca]
to [72ecd7c680].
︙ | | |
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
|
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
|
-
+
|
def load (sContext="Python"):
global _oSpellChecker
global _sAppContext
global _dOptions
try:
_oSpellChecker = SpellChecker("${lang}", "${dic_main_filename_py}", "${dic_extended_filename_py}", "${dic_personal_filename_py}")
_oSpellChecker = SpellChecker("${lang}", "${dic_main_filename_py}", "${dic_extended_filename_py}", "${dic_community_filename_py}", "${dic_personal_filename_py}")
_sAppContext = sContext
_dOptions = dict(gc_options.getOptions(sContext)) # duplication necessary, to be able to reset to default
except:
traceback.print_exc()
def setOption (sOpt, bVal):
|
︙ | | |
Modified gc_core/py/oxt/Grammalecte.py
from [1e4211990b]
to [6b2cfc5228].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
-
+
+
|
# -*- encoding: UTF-8 -*-
# Grammalecte for Writer
# License: MPL 2
# A derivative work of Lightproof from László Németh (http://cgit.freedesktop.org/libreoffice/lightproof/)
import uno
import unohelper
import json
import sys
import traceback
from collections import deque
from com.sun.star.linguistic2 import XProofreader, XSupportedLocales
from com.sun.star.linguistic2 import ProofreadingResult
from com.sun.star.lang import XServiceInfo, XServiceName, XServiceDisplayName
from com.sun.star.lang import Locale
import helpers
import grammalecte.${lang} as gce
#import lightproof_handler_${implname} as opt_handler
import Options
class Grammalecte (unohelper.Base, XProofreader, XServiceInfo, XServiceName, XServiceDisplayName, XSupportedLocales):
|
︙ | | |
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
+
+
-
+
-
|
xCurCtx = uno.getComponentContext()
# init
gce.load("Writer")
# GC options
# opt_handler.load(xCurCtx)
dOpt = Options.load(xCurCtx)
gce.setOptions(dOpt)
# dictionaries options
self.loadUserDictionaries()
# store for results of big paragraphs
self.dResult = {}
self.nMaxRes = 1500
self.lLastRes = deque(maxlen=self.nMaxRes)
self.nRes = 0
#oSpellChecker = gce.getSpellChecker();
#oSpellChecker.setPersonalDictionary("fr.personal.json")
# XServiceName method implementations
def getServiceName (self):
return self.ImplementationName
# XServiceInfo method implementations
def getImplementationName (self):
|
︙ | | |
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
+
+
+
+
+
+
+
+
+
+
+
+
|
# XServiceDisplayName
def getServiceDisplayName (self, aLocale):
return gce.name
# Grammalecte
def getSpellChecker (self):
return gce.getSpellChecker()
def loadUserDictionaries (self):
try:
xSettingNode = helpers.getConfigSetting("/org.openoffice.Lightproof_grammalecte/Other/", False)
xChild = xSettingNode.getByName("o_${lang}")
if xChild.getPropertyValue("use_personal_dic"):
sJSON = xChild.getPropertyValue("personal_dic")
if sJSON:
oSpellChecker = gce.getSpellChecker();
oSpellChecker.setPersonalDictionary(json.loads(sJSON))
except:
traceback.print_exc()
g_ImplementationHelper = unohelper.ImplementationHelper()
g_ImplementationHelper.addImplementation(Grammalecte, "org.openoffice.comp.pyuno.Lightproof."+gce.pkg, ("com.sun.star.linguistic2.Proofreader",),)
# g_ImplementationHelper.addImplementation( opt_handler.LightproofOptionsEventHandler, \
# "org.openoffice.comp.pyuno.LightproofOptionsEventHandler." + gce.pkg, ("com.sun.star.awt.XContainerWindowEventHandler",),)
|
Modified gc_core/py/oxt/OptionsDialog.xcs
from [bfbbfee5a6]
to [3732fcdcec].
︙ | | |
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
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
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
<templates>
<group oor:name="${lang}">
<info>
<desc>The data for one leaf.</desc>
</info>
${xcs_options}
</group>
<group oor:name="o_${lang}">
<info>
<desc>The data for one leaf.</desc>
</info>
<prop oor:name="use_graphspell" oor:type="xs:int"><value>1</value></prop>
<prop oor:name="use_graphspell_sugg" oor:type="xs:int"><value>1</value></prop>
<prop oor:name="use_extended_dic" oor:type="xs:int"><value>0</value></prop>
<prop oor:name="use_personal_dic" oor:type="xs:int"><value>1</value></prop>
<prop oor:name="extended_dic" oor:type="xs:string"><value></value></prop>
<prop oor:name="personal_dic" oor:type="xs:string"><value></value></prop>
</group>
</templates>
<component>
<group oor:name="Leaves">
<node-ref oor:name="${lang}" oor:node-type="${lang}" />
</group>
<group oor:name="Other">
<node-ref oor:name="o_${lang}" oor:node-type="o_${lang}" />
</group>
</component>
</oor:component-schema>
|
Added gc_core/py/oxt/helpers.py version [f3ef6493bc].
|
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
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
# Helpers for LibreOffice extension
import os
import traceback
import uno
from com.sun.star.beans import PropertyValue
from com.sun.star.uno import RuntimeException as _rtex
def xray (myObject):
"XRay - API explorer"
try:
sm = uno.getComponentContext().ServiceManager
mspf = sm.createInstanceWithContext("com.sun.star.script.provider.MasterScriptProviderFactory", uno.getComponentContext())
scriptPro = mspf.createScriptProvider("")
xScript = scriptPro.getScript("vnd.sun.star.script:XrayTool._Main.Xray?language=Basic&location=application")
xScript.invoke((myObject,), (), ())
return
except:
raise _rtex("\nBasic library Xray is not installed", uno.getComponentContext())
def mri (ctx, xTarget):
"MRI - API Explorer"
try:
xMri = ctx.ServiceManager.createInstanceWithContext("mytools.Mri", ctx)
xMri.inspect(xTarget)
except:
raise _rtex("\nPython extension MRI is not installed", uno.getComponentContext())
def getConfigSetting (sNodeConfig, bUpdate=False):
"get a configuration node"
# example: xNode = getConfigSetting("/org.openoffice.Office.Common/Path/Current", False)
xSvMgr = uno.getComponentContext().ServiceManager
xConfigProvider = xSvMgr.createInstanceWithContext("com.sun.star.configuration.ConfigurationProvider", uno.getComponentContext())
xPropertyValue = uno.createUnoStruct("com.sun.star.beans.PropertyValue")
xPropertyValue.Name = "nodepath"
xPropertyValue.Value = sNodeConfig
if bUpdate:
sService = "com.sun.star.configuration.ConfigurationUpdateAccess"
else:
sService = "com.sun.star.configuration.ConfigurationAccess"
return xConfigProvider.createInstanceWithArguments(sService, (xPropertyValue,)) # return xNode
def printServices (o):
for s in o.getAvailableServiceNames():
print(' > '+s)
def getWindowSize ():
"return main window size"
xCurCtx = uno.getComponentContext()
xDesktop = xCurCtx.getServiceManager().createInstanceWithContext('com.sun.star.frame.Desktop', xCurCtx)
xContainerWindow = xDesktop.getCurrentComponent().CurrentController.Frame.ContainerWindow
xWindowSize = xContainerWindow.convertSizeToLogic(xContainerWindow.Size, uno.getConstantByName("com.sun.star.util.MeasureUnit.POINT"))
#print(xContainerWindow.Size.Width, ">", xWindowSize.Width)
#print(xContainerWindow.Size.Height, ">", xWindowSize.Height)
xWindowSize.Width = xWindowSize.Width * 0.666
xWindowSize.Height = xWindowSize.Height * 0.666
return xWindowSize
def getAbsolutePathOf (sPath=""):
xDefaultContext = uno.getComponentContext().ServiceManager.DefaultContext
xPackageInfoProvider = xDefaultContext.getValueByName("/singletons/com.sun.star.deployment.PackageInformationProvider")
sFullPath = xPackageInfoProvider.getPackageLocation("French.linguistic.resources.from.Dicollecte.by.OlivierR")
if sPath and not sPath.startswith("/"):
sPath = "/" + sPath
sFullPath = sFullPath[8:] + sPath
return os.path.abspath(sFullPath)
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Modified gc_lang/fr/config.ini
from [eb081b50e5]
to [cac02a5706].
︙ | | |
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
+
+
+
+
|
lexicon_src = lexicons/French.lex
dic_filename = fr
dic_name = French
# extended dictionary
lexicon_extended_src = lexicons/French.extended.lex
dic_extended_filename = fr.extended
dic_extended_name = Français - dictionnaire étendu
# community dictionary
lexicon_community_src = lexicons/French.community.lex
dic_community_filename = fr.community
dic_community_name = Français - dictionnaire communautaire
# personal dictionary
lexicon_personal_src = lexicons/French.personal.lex
dic_personal_filename = fr.personal
dic_personal_name = Français - dictionnaire personnel
# Finite state automaton compression: 1, 2 (experimental) or 3 (experimental)
fsa_method = 1
# stemming method: S for suffixes only, A for prefixes and suffixes
|
︙ | | |
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
-
+
+
+
+
+
+
+
+
+
|
oxt/_img/logo120_text.png = img/logo120_text.png
oxt/_img/LaMouette_small.png = img/LaMouette_small.png
oxt/_img/Algoo_logo.png = img/Algoo_logo.png
oxt/_img/grammalecte_16.bmp = img/grammalecte_16.bmp
oxt/_img/french_flag_16.bmp = img/french_flag_16.bmp
# AppLauncher
oxt/AppLauncher.py = AppLauncher.py
oxt/helpers.py = pythonpath/helpers.py
# About
oxt/About/About.py = pythonpath/About.py
oxt/About/ab_strings.py = pythonpath/ab_strings.py
# Dictionaries
oxt/Dictionnaires/dictionaries = dictionaries
oxt/Dictionnaires/dictionaries.xcu = dictionaries.xcu
oxt/Dictionnaires/DictionarySwitcher.py = pythonpath/DictionarySwitcher.py
oxt/Dictionnaires/ds_strings.py = pythonpath/ds_strings.py
# Dictionary Options
oxt/DictOptions/DictOptions.py = pythonpath/DictOptions.py
oxt/DictOptions/do_strings.py = pythonpath/do_strings.py
oxt/DictOptions/LexiconEditor.py = pythonpath/LexiconEditor.py
oxt/DictOptions/lxe_strings.py = pythonpath/lxe_strings.py
oxt/DictOptions/SearchWords.py = pythonpath/SearchWords.py
oxt/DictOptions/sw_strings.py = pythonpath/sw_strings.py
oxt/DictOptions/TagsInfo.py = pythonpath/TagsInfo.py
oxt/DictOptions/ti_strings.py = pythonpath/ti_strings.py
# ContextMenu
oxt/ContextMenu/ContextMenu.py = ContextMenu.py
oxt/ContextMenu/jobs.xcu = config/jobs.xcu
# TextFormatter
oxt/TextFormatter/TextFormatter.py = pythonpath/TextFormatter.py
oxt/TextFormatter/tf_strings.py = pythonpath/tf_strings.py
oxt/TextFormatter/tf_options.py = pythonpath/tf_options.py
|
︙ | | |
Added gc_lang/fr/modules-js/conj_generator.js version [058e3de2f7].