Browse Source

org-odt.el: Fix a bug in outline numbering

* contrib/lisp/org-odt.el
(org-odt-configure-outline-numbering): Fixed a bug with
outline numbering. Also removed the check for
org-export-odt-factory-settings (for now).
Jambunathan K 13 years ago
parent
commit
f131417f7d
1 changed files with 9 additions and 12 deletions
  1. 9 12
      contrib/lisp/org-odt.el

+ 9 - 12
contrib/lisp/org-odt.el

@@ -1757,18 +1757,15 @@ visually."
 (defun org-odt-configure-outline-numbering (level)
   "Outline numbering is retained only upto LEVEL.
 To disable outline numbering pass a LEVEL of 0."
-  (if (not (string= org-export-odt-factory-settings (sha1 (current-buffer))))
-      (org-lparse-warn
-       "org-odt: Using custom styles file? Consider tweaking styles.xml for better output. To suppress this warning update `org-export-odt-factory-settings'")
-    (goto-char (point-min))
-    (let ((regex
-	   "<text:outline-level-style\\(.*\\)text:level=\"\\(.*\\)\"\\(.*\\)>")
-	  (replacement
-	   "<text:outline-level-style\\1text:level=\"\\2\" style:num-format=\"\">"))
-      (while (re-search-forward regex nil t)
-	(when (> (string-to-number (match-string 1)) level)
-	  (replace-match replacement t nil))))
-    (save-buffer 0)))
+  (goto-char (point-min))
+  (let ((regex
+	 "<text:outline-level-style\\(.*\\)text:level=\"\\([^\"]*\\)\"\\(.*\\)>")
+	(replacement
+	 "<text:outline-level-style\\1text:level=\"\\2\" style:num-format=\"\">"))
+    (while (re-search-forward regex nil t)
+      (when (> (string-to-number (match-string 2)) level)
+	(replace-match replacement t nil))))
+  (save-buffer 0))
 
 (provide 'org-odt)