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)
"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.