From a2730b47fa44a088dcee2149f2cb26e05f673563 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Mon, 22 May 2023 15:14:54 +0200 Subject: [PATCH] org-odt--paragraph-style: Use `org-element-lineage' --- lisp/ox-odt.el | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el index 62b2902f4..280e25593 100644 --- a/lisp/ox-odt.el +++ b/lisp/ox-odt.el @@ -2816,13 +2816,12 @@ information." (defun org-odt--paragraph-style (paragraph) "Return style of PARAGRAPH. Style is a symbol among `quoted', `centered' and nil." - (let ((up paragraph)) - (while (and (setq up (org-element-property :parent up)) - (not (org-element-type-p - up '(center-block quote-block section))))) - (cl-case (org-element-type up) - (center-block 'centered) - (quote-block 'quoted)))) + (cl-case (org-element-type + (org-element-lineage + paragraph + '(center-block quote-block section))) + (center-block 'center) + (quote-block 'quoted))) (defun org-odt--format-paragraph (paragraph contents info default center quote) "Format paragraph according to given styles.