Show locale paragraph names
This commit is contained in:
parent
e5b2241008
commit
fa4069030f
|
@ -2889,7 +2889,7 @@ class LOWriterStyles(object):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def names(self):
|
def names(self):
|
||||||
return self._styles.ElementNames
|
return {s.DisplayName: s.Name for s in self._styles}
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return '\n'.join(self.names)
|
return '\n'.join(self.names)
|
||||||
|
|
Binary file not shown.
|
@ -2889,7 +2889,7 @@ class LOWriterStyles(object):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def names(self):
|
def names(self):
|
||||||
return self._styles.ElementNames
|
return {s.DisplayName: s.Name for s in self._styles}
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return '\n'.join(self.names)
|
return '\n'.join(self.names)
|
||||||
|
|
|
@ -18,6 +18,7 @@ class Controllers(object):
|
||||||
|
|
||||||
def __init__(self, dlg):
|
def __init__(self, dlg):
|
||||||
self.d = dlg
|
self.d = dlg
|
||||||
|
self.styles = {}
|
||||||
|
|
||||||
@app.catch_exception
|
@app.catch_exception
|
||||||
def cmd_replace_by_paragraph_action(self, event):
|
def cmd_replace_by_paragraph_action(self, event):
|
||||||
|
@ -41,6 +42,9 @@ class Controllers(object):
|
||||||
if not app.question(msg):
|
if not app.question(msg):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
source = self.styles[source]
|
||||||
|
target = self.styles[target]
|
||||||
|
|
||||||
doc = app.active
|
doc = app.active
|
||||||
i = 0
|
i = 0
|
||||||
for p in doc.paragraphs:
|
for p in doc.paragraphs:
|
||||||
|
@ -128,8 +132,9 @@ def _create_dialog_replace_styles():
|
||||||
|
|
||||||
doc = app.active
|
doc = app.active
|
||||||
styles = doc.styles['Paragraph'].names
|
styles = doc.styles['Paragraph'].names
|
||||||
dlg.lst_paragraph_source.data = styles
|
dlg.lst_paragraph_source.data = tuple(styles.keys())
|
||||||
dlg.lst_paragraph_target.data = styles
|
dlg.lst_paragraph_target.data = tuple(styles.keys())
|
||||||
|
dlg.events.styles = styles
|
||||||
|
|
||||||
return dlg
|
return dlg
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue