LibreOffice plugin to pipe whole Writer documents through Google Translate, that ought to keep most of the page formatting.

⌈⌋ branch:  PageTranslate


Check-in [aba3df934c]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Introduce XNamedAsEnumeration wrapper
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: aba3df934c0e70f0d8e90f8f816763b552bddac2
User & Date: mario 2020-05-30 16:53:57
Context
2020-05-30
16:54
add format_exc() for import translate.Translator failure check-in: dcaa58f47b user: mario tags: trunk
16:53
Introduce XNamedAsEnumeration wrapper check-in: aba3df934c user: mario tags: trunk
16:53
Add <kbd>🏴</kbd> to Draw/Impress. Submenus still missing there however. check-in: 75f1bf7f56 user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pythonpath/unocompat.py.

1
2
3
4
5
6
7
8


9
10
11
12
13
14
15
16
17
18



















# encoding: utf-8
# api: uno
# type: functions
# version: 0.1
# title: UNO helper
# description: compatibility between LO and AOO
#
# Just the shorter `PropertyValue` for now.



import uno, unohelper
from com.sun.star.beans import PropertyValue as UNO_PropertyValue

# AOO uno version doesn't have constructor with name/value params
def PropertyValue(Name="nodepath", Value=None):
    pv = UNO_PropertyValue()
    pv.Name = Name
    pv.Value = Value
    return pv






















|




>
>










>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
# encoding: utf-8
# api: uno
# type: functions
# version: 0.2
# title: UNO helper
# description: compatibility between LO and AOO
#
# Just the shorter `PropertyValue` for now.
# And a convenience wrapper for TextFrames, to match the iterator interface.
#

import uno, unohelper
from com.sun.star.beans import PropertyValue as UNO_PropertyValue

# AOO uno version doesn't have constructor with name/value params
def PropertyValue(Name="nodepath", Value=None):
    pv = UNO_PropertyValue()
    pv.Name = Name
    pv.Value = Value
    return pv

# faux XEnumerationAccesss for XNamedAccess
class XNamedAsEnumeration:
    names = []

    def __init__(self, elements):
        self.elements = elements
        self.names = elements.getElementNames()
        if type(self.names) is tuple:
            self.names = list(self.names)
        else:
            self.names = []

    def hasMoreElements(self):
        return len(self.names) > 0

    def nextElement(self):
        return self.elements.getByName(self.names.pop(0))