diff --git a/easymacro.py b/easymacro.py index 2cd3309..d081e3e 100644 --- a/easymacro.py +++ b/easymacro.py @@ -2889,7 +2889,7 @@ class LOWriterStyles(object): @property def names(self): - return self._styles.ElementNames + return {s.DisplayName: s.Name for s in self._styles} def __str__(self): return '\n'.join(self.names) diff --git a/files/ZazDoc_v0.1.0.oxt b/files/ZazDoc_v0.1.0.oxt index 12a330d..fc4197d 100644 Binary files a/files/ZazDoc_v0.1.0.oxt and b/files/ZazDoc_v0.1.0.oxt differ diff --git a/source/pythonpath/easymacro.py b/source/pythonpath/easymacro.py index 2cd3309..d081e3e 100644 --- a/source/pythonpath/easymacro.py +++ b/source/pythonpath/easymacro.py @@ -2889,7 +2889,7 @@ class LOWriterStyles(object): @property def names(self): - return self._styles.ElementNames + return {s.DisplayName: s.Name for s in self._styles} def __str__(self): return '\n'.join(self.names) diff --git a/source/pythonpath/main.py b/source/pythonpath/main.py index 8418a5e..c2d1d6a 100644 --- a/source/pythonpath/main.py +++ b/source/pythonpath/main.py @@ -18,6 +18,7 @@ class Controllers(object): def __init__(self, dlg): self.d = dlg + self.styles = {} @app.catch_exception def cmd_replace_by_paragraph_action(self, event): @@ -41,6 +42,9 @@ class Controllers(object): if not app.question(msg): return + source = self.styles[source] + target = self.styles[target] + doc = app.active i = 0 for p in doc.paragraphs: @@ -128,8 +132,9 @@ def _create_dialog_replace_styles(): doc = app.active styles = doc.styles['Paragraph'].names - dlg.lst_paragraph_source.data = styles - dlg.lst_paragraph_target.data = styles + dlg.lst_paragraph_source.data = tuple(styles.keys()) + dlg.lst_paragraph_target.data = tuple(styles.keys()) + dlg.events.styles = styles return dlg