Grammalecte  Check-in [6426ba35ee]

Overview
Comment:[lo] context menu: fix dictionary loading
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | lo | multid
Files: files | file ages | folders
SHA3-256: 6426ba35ee575c4dc1b4fcdc6b017154795f306b748d19813f9bb2fbbf2e9841
User & Date: olr on 2018-02-16 16:54:49
Other Links: branch diff | manifest | tags
Context
2018-02-16
16:56
[graphspell][py] spellchecker: fix wrong var name check-in: 8d0a8d18c8 user: olr tags: graphspell, multid
16:54
[lo] context menu: fix dictionary loading check-in: 6426ba35ee user: olr tags: lo, multid
15:54
[fx] new default name for personal dictionary to export check-in: e8e3249304 user: olr tags: fx, multid
Changes

Modified gc_lang/fr/oxt/ContextMenu/ContextMenu.py from [3b33016da8] to [786f8f5273].

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
...
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141

from com.sun.star.task import XJob
from com.sun.star.ui import XContextMenuInterceptor
#from com.sun.star.ui.ContextMenuInterceptorAction import IGNORED
#from com.sun.star.ui.ContextMenuInterceptorAction import EXECUTE_MODIFIED

import grammalecte.fr.lexicographe as lxg
from grammalecte.ibdawg import IBDAWG
from grammalecte.echo import echo
import helpers


xDesktop = None
oDict = None
oLexicographe = None

................................................................................
        global oLexicographe
        try:
            if not xDesktop:
                xDesktop = self.ctx.getServiceManager().createInstanceWithContext('com.sun.star.frame.Desktop', self.ctx)
            if not oDict:
                xCurCtx = uno.getComponentContext()
                oGC = self.ctx.ServiceManager.createInstanceWithContext("org.openoffice.comp.pyuno.Lightproof.grammalecte", self.ctx)
                if hasattr(oGC, "getDictionary"):
                    # https://bugs.documentfoundation.org/show_bug.cgi?id=97790
                    oDict = oGC.getDictionary()
                else:
                    oDict = IBDAWG("French.bdic")
            if not oLexicographe:
                oLexicographe = lxg.Lexicographe(oDict)
        except:
            traceback.print_exc()
        
    def execute (self, args):
        if not args:







|
|







 







|

|

|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
...
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141

from com.sun.star.task import XJob
from com.sun.star.ui import XContextMenuInterceptor
#from com.sun.star.ui.ContextMenuInterceptorAction import IGNORED
#from com.sun.star.ui.ContextMenuInterceptorAction import EXECUTE_MODIFIED

import grammalecte.fr.lexicographe as lxg
from grammalecte.graphspell.ibdawg import IBDAWG
from grammalecte.graphspell.echo import echo
import helpers


xDesktop = None
oDict = None
oLexicographe = None

................................................................................
        global oLexicographe
        try:
            if not xDesktop:
                xDesktop = self.ctx.getServiceManager().createInstanceWithContext('com.sun.star.frame.Desktop', self.ctx)
            if not oDict:
                xCurCtx = uno.getComponentContext()
                oGC = self.ctx.ServiceManager.createInstanceWithContext("org.openoffice.comp.pyuno.Lightproof.grammalecte", self.ctx)
                if hasattr(oGC, "getSpellChecker"):
                    # https://bugs.documentfoundation.org/show_bug.cgi?id=97790
                    oDict = oGC.getSpellChecker()
                else:
                    oDict = IBDAWG("${dic_filename}.bdic")
            if not oLexicographe:
                oLexicographe = lxg.Lexicographe(oDict)
        except:
            traceback.print_exc()
        
    def execute (self, args):
        if not args: