org-odt--paragraph-style: Use `org-element-lineage'

This commit is contained in:
Ihor Radchenko 2023-05-22 15:14:54 +02:00
parent 69383dfc24
commit a2730b47fa
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 6 additions and 7 deletions

View File

@ -2816,13 +2816,12 @@ information."
(defun org-odt--paragraph-style (paragraph) (defun org-odt--paragraph-style (paragraph)
"Return style of PARAGRAPH. "Return style of PARAGRAPH.
Style is a symbol among `quoted', `centered' and nil." Style is a symbol among `quoted', `centered' and nil."
(let ((up paragraph)) (cl-case (org-element-type
(while (and (setq up (org-element-property :parent up)) (org-element-lineage
(not (org-element-type-p paragraph
up '(center-block quote-block section))))) '(center-block quote-block section)))
(cl-case (org-element-type up) (center-block 'center)
(center-block 'centered) (quote-block 'quoted)))
(quote-block 'quoted))))
(defun org-odt--format-paragraph (paragraph contents info default center quote) (defun org-odt--format-paragraph (paragraph contents info default center quote)
"Format paragraph according to given styles. "Format paragraph according to given styles.