Grammalecte  Diff

Differences From Artifact [84e566480c]:

To Artifact [95fd6d10c1]:


1
2
3
4
5
6
7
8

1
2
3
4
5
6
7
-







# -*- coding: utf8 -*-
# Grammalecte - Lexicographe
# by Olivier R. License: MPL 2

import uno
import unohelper
import traceback

93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
92
93
94
95
96
97
98

99
100
101
102
103
104
105







-







    def _addItemToContextMenu (self, xContextMenu, i, sType, **args):
        xMenuItem = xContextMenu.createInstance("com.sun.star.ui."+sType)
        #echo("com.sun.star.ui."+sType)
        for k, v in args.items():
            xMenuItem.setPropertyValue(k, v)
            #print("> ", k, v, xMenuItem)
        xContextMenu.insertByIndex(i, xMenuItem)

        return i + 1

    def _getWord (self):
        try:
            xDoc = xDesktop.getCurrentComponent()
            xViewCursor = xDoc.CurrentController.ViewCursor
            if xViewCursor.CharLocale.Language != "fr":