diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-12-13 23:50:12 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-14 13:34:45 +0000 |
commit | 318e8142c6d170a56204ba07f69fb95164f60569 (patch) | |
tree | 10afbc1eb155254d0cd53357123cbaf5201bacb2 | |
parent | ab222f78ca7338dbf745f91858c2daa09878ca2e (diff) |
remove local macro
don't store string length, construct string with createFromAscii and
inline SERVICE_MAP_ENTRY macro
Change-Id: Ib25da99f3ad24f58179a0231a42b29e177967bfc
Reviewed-on: https://gerrit.libreoffice.org/32006
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | xmloff/source/core/XMLEmbeddedObjectImportContext.cxx | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx index 0fd0011b28a0..f25d02c8dd0c 100644 --- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx +++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx @@ -47,27 +47,23 @@ struct XMLServiceMapEntry_Impl { enum XMLTokenEnum eClass; const sal_Char *sFilterService; - sal_Int32 nFilterServiceLen; }; -} - -#define SERVICE_MAP_ENTRY( cls, app ) \ - { XML_##cls, \ - XML_IMPORT_FILTER_##app, sizeof(XML_IMPORT_FILTER_##app)-1} - const XMLServiceMapEntry_Impl aServiceMap[] = { - SERVICE_MAP_ENTRY( TEXT, WRITER ), - SERVICE_MAP_ENTRY( ONLINE_TEXT, WRITER ), - SERVICE_MAP_ENTRY( SPREADSHEET, CALC ), - SERVICE_MAP_ENTRY( DRAWING, DRAW ), - SERVICE_MAP_ENTRY( GRAPHICS, DRAW ), - SERVICE_MAP_ENTRY( PRESENTATION, IMPRESS ), - SERVICE_MAP_ENTRY( CHART, CHART ), - { XML_TOKEN_INVALID, nullptr, 0 } + { XML_TEXT, XML_IMPORT_FILTER_WRITER }, + { XML_ONLINE_TEXT, XML_IMPORT_FILTER_WRITER }, + { XML_SPREADSHEET, XML_IMPORT_FILTER_CALC }, + { XML_DRAWING, XML_IMPORT_FILTER_DRAW }, + { XML_GRAPHICS, XML_IMPORT_FILTER_DRAW }, + { XML_PRESENTATION, XML_IMPORT_FILTER_IMPRESS }, + { XML_CHART, XML_IMPORT_FILTER_CHART }, + { XML_TOKEN_INVALID, nullptr } + }; +} + class XMLEmbeddedObjectImportContext_Impl : public SvXMLImportContext { css::uno::Reference< css::xml::sax::XDocumentHandler > xHandler; @@ -219,9 +215,7 @@ XMLEmbeddedObjectImportContext::XMLEmbeddedObjectImportContext( { if( IsXMLToken( sClass, pEntry->eClass ) ) { - sFilterService = OUString( pEntry->sFilterService, - pEntry->nFilterServiceLen, - RTL_TEXTENCODING_ASCII_US ); + sFilterService = OUString::createFromAscii( pEntry->sFilterService ); switch( pEntry->eClass ) { |