summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-04-28 17:36:30 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-04-28 17:39:13 +0200
commit306b29a62f7735fb0d80b7e6e987c7921ebf2c82 (patch)
treead0eb6e19c62e295cbd07287e690127e7fad0a5e /desktop
parent2c72660137baf08e1b4611e30750970a688cbacb (diff)
libLO: add extension map for draw's formats
Change-Id: Ie447f334e3fca606323870f0ce21e85d4fc0978f
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx40
1 files changed, 32 insertions, 8 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index da4b8542005e..3b045590e0f1 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -100,6 +100,24 @@ static const ExtensionMap aImpressExtensionMap[] =
{ NULL, NULL }
};
+static const ExtensionMap aDrawExtensionMap[] =
+{
+ { "odg", "draw8" },
+ { "fodg", "draw_ODG_FlatXML" },
+ { "html", "draw_html_Export" },
+ { "svg", "draw_svg_Export" },
+ { "swf", "draw_flash_Export" },
+ { "xhtml", "XHTML Draw File" },
+ { "vdx", "draw_Visio_Document" },
+ { "vsd", "draw_Visio_Document" },
+ { "vsdm", "draw_Visio_Document" },
+ { "vsdx", "draw_Visio_Document" },
+ { "pub", "draw_Publisher_Document" },
+ { "cdr", "draw_CorelDraw_Document" },
+ { "wpg", "draw_WordPerfect_Graphics" },
+ { NULL, NULL }
+};
+
static OUString getUString(const char* pString)
{
if (pString == NULL)
@@ -230,18 +248,24 @@ static int doc_saveAsWithOptions(LibreOfficeDocument* pThis, const char* sUrl, c
if (aDocumentService.isEmpty())
{
- gImpl->maLastExceptionMsg = "Unknown document type";
+ gImpl->maLastExceptionMsg = "unknown document type";
return false;
}
const ExtensionMap* pMap;
-
- if( aDocumentService == "com.sun.star.sheet.SpreadsheetDocument" )
- pMap = (const ExtensionMap *)aCalcExtensionMap;
- else if( aDocumentService == "com.sun.star.presentation.PresentationDocument" )
- pMap = (const ExtensionMap *)aImpressExtensionMap;
- else // for the sake of argument only writer documents ...
- pMap = (const ExtensionMap *)aWriterExtensionMap;
+ if (aDocumentService == "com.sun.star.sheet.SpreadsheetDocument")
+ pMap = (const ExtensionMap*) aCalcExtensionMap;
+ else if (aDocumentService == "com.sun.star.presentation.PresentationDocument")
+ pMap = (const ExtensionMap*) aImpressExtensionMap;
+ else if (aDocumentService == "com.sun.star.drawing.DrawingDocument")
+ pMap = (const ExtensionMap*) aDrawExtensionMap;
+ else if (aDocumentService == "com.sun.star.text.TextDocument")
+ pMap = (const ExtensionMap*) aWriterExtensionMap;
+ else
+ {
+ gImpl->maLastExceptionMsg = "unknown document mapping";
+ return false;
+ }
if (pFormat == NULL)
{