Browse Source

org-odt.el: Fix earlier commit

Jambunathan K 13 years ago
parent
commit
4beec074d0
1 changed files with 3 additions and 3 deletions
  1. 3 3
      lisp/org-odt.el

+ 3 - 3
lisp/org-odt.el

@@ -33,17 +33,17 @@
   :tag "Org Export ODT"
   :group 'org-export)
 
+(defvar org-lparse-dyn-first-heading-pos) ; let bound during org-do-lparse
 (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))))
+    (goto-char org-lparse-dyn-first-heading-pos)))
+  (insert (org-odt-format-toc)))
 
 (defun org-odt-end-export ()
   (org-odt-insert-toc)