Revert "Introduce org-odt-begin-table-cell and org-odt-end-table-cell"

This reverts commit e887881e13.  Keep things
simple for now.
This commit is contained in:
Jambunathan K 2011-09-01 22:26:17 +05:30
parent a611170b57
commit 30aa8f61da
2 changed files with 9 additions and 32 deletions

View File

@ -693,12 +693,6 @@ and then converted to \"doc\" then org-lparse-backend is set to
(defvar org-lparse-to-buffer nil (defvar org-lparse-to-buffer nil
"Bind this to TO-BUFFER arg of `org-lparse'.") "Bind this to TO-BUFFER arg of `org-lparse'.")
(defvar org-lparse-current-paragraph-style nil
"Default paragraph style to use.
Exporter sets or resets this as it enters and leaves special
contexts. Currently this is used for formatting of paragraphs
that are part of table-cells created from list-tables.")
(defun org-do-lparse (arg &optional hidden ext-plist (defun org-do-lparse (arg &optional hidden ext-plist
to-buffer body-only pub-dir) to-buffer body-only pub-dir)
"Export the outline to various formats. "Export the outline to various formats.
@ -728,7 +722,6 @@ version."
; collecting styles ; collecting styles
org-lparse-encode-pending org-lparse-encode-pending
org-lparse-par-open org-lparse-par-open
org-lparse-current-paragraph-style
org-lparse-list-table-p org-lparse-list-table-p
(org-lparse-list-level 0) ; list level starts at 1. A (org-lparse-list-level 0) ; list level starts at 1. A
; value of 0 implies we are ; value of 0 implies we are
@ -1274,7 +1267,7 @@ version."
;; kill collection buffer ;; kill collection buffer
(when org-lparse-collect-buffer (when org-lparse-collect-buffer
(kill-buffer org-lparse-collect-buffer)) (kill-buffer org-lparse-collect-buffer))
(goto-char (point-min)) (goto-char (point-min))
(or (org-export-push-to-kill-ring (or (org-export-push-to-kill-ring
(upcase (symbol-name org-lparse-backend))) (upcase (symbol-name org-lparse-backend)))

View File

@ -383,8 +383,6 @@ PUB-DIR is set, use this as the publishing directory."
. (org-odt-begin-table org-odt-end-table)) . (org-odt-begin-table org-odt-end-table))
(TABLE-ROWGROUP (TABLE-ROWGROUP
. (org-odt-begin-table-rowgroup org-odt-end-table-rowgroup)) . (org-odt-begin-table-rowgroup org-odt-end-table-rowgroup))
(TABLE-CELL
. (org-odt-begin-table-cell org-odt-end-table-cell))
(LIST (LIST
. (org-odt-begin-list org-odt-end-list)) . (org-odt-begin-list org-odt-end-list))
(LIST-ITEM (LIST-ITEM
@ -524,10 +522,7 @@ PUB-DIR is set, use this as the publishing directory."
(defun org-odt-end-outline-text () (defun org-odt-end-outline-text ()
(ignore)) (ignore))
(defvar org-lparse-current-paragraph-style) ; bound during
; `org-do-lparse'
(defun org-odt-begin-paragraph (&optional style) (defun org-odt-begin-paragraph (&optional style)
(setq style (or style org-lparse-current-paragraph-style))
(org-lparse-insert-tag (org-lparse-insert-tag
"<text:p%s>" (org-odt-get-extra-attrs-for-paragraph-style style))) "<text:p%s>" (org-odt-get-extra-attrs-for-paragraph-style style)))
@ -548,8 +543,7 @@ PUB-DIR is set, use this as the publishing directory."
(defun org-odt-format-stylized-paragraph (style text) (defun org-odt-format-stylized-paragraph (style text)
(org-odt-format-tags (org-odt-format-tags
'("<text:p%s>" . "</text:p>") text '("<text:p%s>" . "</text:p>") text
(org-odt-get-extra-attrs-for-paragraph-style (org-odt-get-extra-attrs-for-paragraph-style style)))
(or style org-lparse-current-paragraph-style))))
(defun org-odt-begin-environment (style) (defun org-odt-begin-environment (style)
(case style (case style
@ -728,26 +722,16 @@ PUB-DIR is set, use this as the publishing directory."
(when org-lparse-table-is-styled (when org-lparse-table-is-styled
(format "@@table-cell:style-name@@%03d@@%03d@@" r c))) (format "@@table-cell:style-name@@%03d@@%03d@@" r c)))
(defun org-odt-begin-table-cell (r c) (defun org-odt-format-table-cell (data r c)
(setq org-lparse-current-paragraph-style (let* ((paragraph-style-cookie
(org-odt-get-paragraph-style-cookie-for-table-cell r c)) (org-odt-get-paragraph-style-cookie-for-table-cell r c))
(let* ((style-name-cookie (style-name-cookie
(org-odt-get-style-name-cookie-for-table-cell r c)) (org-odt-get-style-name-cookie-for-table-cell r c))
(extra (if style-name-cookie (extra (if style-name-cookie
(format " table:style-name=\"%s\"" style-name-cookie) ""))) (format " table:style-name=\"%s\"" style-name-cookie) "")))
(org-lparse-insert-tag "<table:table-cell%s>" extra))) (org-odt-format-tags
'("<table:table-cell%s>" . "</table:table-cell>")
(defun org-odt-end-table-cell () (org-odt-format-stylized-paragraph paragraph-style-cookie data) extra)))
(org-lparse-insert-tag "</table:table-cell>")
(setq org-lparse-current-paragraph-style nil))
(defun org-odt-format-table-cell (data r c)
(with-temp-buffer
(org-odt-begin-table-cell r c)
(insert (org-odt-format-stylized-paragraph
org-lparse-current-paragraph-style data))
(org-odt-end-table-cell)
(buffer-string)))
(defun org-odt-begin-footnote-definition (n) (defun org-odt-begin-footnote-definition (n)
(org-lparse-begin-paragraph 'footnote)) (org-lparse-begin-paragraph 'footnote))