93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
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":
|
<
|
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":
|