summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/odt/META-INF/manifest.xml (renamed from data/odt-styles/META-INF/manifest.xml)0
-rw-r--r--data/odt/Thumbnails/thumbnail.png (renamed from data/odt-styles/Thumbnails/thumbnail.png)bin1943 -> 1943 bytes
-rw-r--r--data/odt/meta.xml (renamed from data/odt-styles/meta.xml)0
-rw-r--r--data/odt/mimetype (renamed from data/odt-styles/mimetype)0
-rw-r--r--data/odt/settings.xml (renamed from data/odt-styles/settings.xml)0
-rw-r--r--data/odt/styles.xml (renamed from data/odt-styles/styles.xml)0
-rw-r--r--pandoc.cabal12
-rw-r--r--src/Text/Pandoc/ODT.hs8
8 files changed, 13 insertions, 7 deletions
diff --git a/data/odt-styles/META-INF/manifest.xml b/data/odt/META-INF/manifest.xml
index 5ecd5d892..5ecd5d892 100644
--- a/data/odt-styles/META-INF/manifest.xml
+++ b/data/odt/META-INF/manifest.xml
diff --git a/data/odt-styles/Thumbnails/thumbnail.png b/data/odt/Thumbnails/thumbnail.png
index 4e213b6b3..4e213b6b3 100644
--- a/data/odt-styles/Thumbnails/thumbnail.png
+++ b/data/odt/Thumbnails/thumbnail.png
Binary files differ
diff --git a/data/odt-styles/meta.xml b/data/odt/meta.xml
index 93363b77e..93363b77e 100644
--- a/data/odt-styles/meta.xml
+++ b/data/odt/meta.xml
diff --git a/data/odt-styles/mimetype b/data/odt/mimetype
index 2e95b81c9..2e95b81c9 100644
--- a/data/odt-styles/mimetype
+++ b/data/odt/mimetype
diff --git a/data/odt-styles/settings.xml b/data/odt/settings.xml
index bb6998b79..bb6998b79 100644
--- a/data/odt-styles/settings.xml
+++ b/data/odt/settings.xml
diff --git a/data/odt-styles/styles.xml b/data/odt/styles.xml
index df9a15634..df9a15634 100644
--- a/data/odt-styles/styles.xml
+++ b/data/odt/styles.xml
diff --git a/pandoc.cabal b/pandoc.cabal
index 6c9189774..5f7cc791e 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -43,12 +43,12 @@ Data-Files:
templates/rst.template, templates/s5.template,
templates/mediawiki.template, templates/rtf.template,
-- data for ODT writer
- data/odt-styles/meta.xml,
- data/odt-styles/settings.xml,
- data/odt-styles/META-INF/manifest.xml,
- data/odt-styles/Thumbnails/thumbnail.png,
- data/odt-styles/styles.xml,
- data/odt-styles/mimetype,
+ data/odt/meta.xml,
+ data/odt/settings.xml,
+ data/odt/META-INF/manifest.xml,
+ data/odt/Thumbnails/thumbnail.png,
+ data/odt/styles.xml,
+ data/odt/mimetype,
-- data for LaTeXMathML writer
data/LaTeXMathML.js.comment,
data/LaTeXMathML.js.packed,
diff --git a/src/Text/Pandoc/ODT.hs b/src/Text/Pandoc/ODT.hs
index d2e8f45f8..01390cbbf 100644
--- a/src/Text/Pandoc/ODT.hs
+++ b/src/Text/Pandoc/ODT.hs
@@ -39,6 +39,7 @@ import Text.ParserCombinators.Parsec
import System.Time
import Text.Pandoc.Shared ( inDirectory )
import Paths_pandoc ( getDataFileName )
+import System.Directory
-- | Produce an ODT file from OpenDocument XML.
saveOpenDocumentAsODT :: FilePath -- ^ Pathname of ODT file to be produced.
@@ -46,7 +47,12 @@ saveOpenDocumentAsODT :: FilePath -- ^ Pathname of ODT file to be produced.
-> String -- ^ OpenDocument XML contents.
-> IO ()
saveOpenDocumentAsODT destinationODTPath sourceDirRelative xml = do
- refArchivePath <- getDataFileName $ "data" </> "odt-styles"
+ userDir <- getAppUserDataDirectory "pandoc"
+ userOdtExists <- doesFileExist $
+ userDir </> "data" </> "odt" </> "styles.xml"
+ refArchivePath <- if userOdtExists
+ then return $ userDir </> "data" </> "odt"
+ else getDataFileName $ "data" </> "odt"
refArchive <- inDirectory refArchivePath $
addFilesToArchive [OptRecursive] emptyArchive ["."]
-- handle pictures