Explorar el Código

org-odt.el: Fix a regression in handling TOC

* lisp/org-odt.el (org-odt-insert-toc): Remove this stray,
dysfunctional routine.  This possibly has crept in because of the
broken merges between "maint" and "origin" branches.
(org-odt-begin-table): Don't emit an empty paragraph when a table is
neither labelled or captioned.
(org-odt-init-outfile): Remove reference to an unused variable.
Jambunathan K hace 13 años
padre
commit
580218709b
Se han modificado 1 ficheros con 4 adiciones y 16 borrados
  1. 4 16
      lisp/org-odt.el

+ 4 - 16
lisp/org-odt.el

@@ -46,18 +46,6 @@
     (goto-char org-lparse-dyn-first-heading-pos)))
   (insert (org-odt-format-toc)))
 
-(defun org-odt-insert-toc ()
-  (goto-char (point-min))
-  (cond
-   ((re-search-forward
-     "\\(<text:p [^>]*>\\)?\\s-*\\[TABLE-OF-CONTENTS\\]\\s-*\\(</text:p>\\)?"
-     nil t)
-    (goto-char (match-beginning 0))
-    (replace-match ""))
-   (t
-    (goto-char org-lparse-dyn-first-heading-pos))
-   (insert (org-odt-format-toc))))
-
 (defun org-odt-end-export ()
   (org-odt-insert-toc)
   (org-odt-fixup-label-references)
@@ -1014,9 +1002,10 @@ new entry in `org-odt-automatic-styles'.  Return (OBJECT-NAME
   (setq org-odt-table-style (plist-get attributes :style))
   (setq org-odt-table-style-spec
 	(assoc org-odt-table-style org-export-odt-table-styles))
-  (insert
-   (org-odt-format-stylized-paragraph
-    'table (org-odt-format-entity-caption label caption "__Table__")))
+  (when (or label caption)
+    (insert
+     (org-odt-format-stylized-paragraph
+      'table (org-odt-format-entity-caption label caption "__Table__"))))
   (let ((name-and-style (org-odt-add-automatic-style "Table" attributes)))
     (org-lparse-insert-tag
      "<table:table table:name=\"%s\" table:style-name=\"%s\">"
@@ -2181,7 +2170,6 @@ CATEGORY-HANDLE is used.  See
     (setq org-odt-manifest-file-entries nil
 	  org-odt-embedded-images-count 0
 	  org-odt-embedded-formulas-count 0
-	  org-odt-section-count 0
 	  org-odt-entity-labels-alist nil
 	  org-odt-list-stack-stashed nil
 	  org-odt-automatic-styles nil