From 366e35799d8c4d9ef871edbb592747b0f4d7ef70 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 22 Nov 2017 13:19:26 +0000 Subject: fuzzing: common case of embedded charts in docx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Idc6fdc221ce60e33e6b9fcb1689840dd96570d6b Reviewed-on: https://gerrit.libreoffice.org/45089 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- embeddedobj/source/commonembedding/persistence.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'embeddedobj/source') diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index 07bc635a44a4..ab171e3a478b 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -56,6 +56,7 @@ #include #include +#include #include "persistence.hxx" using namespace ::com::sun::star; @@ -440,9 +441,15 @@ OUString OCommonEmbeddedObject::GetFilterName( sal_Int32 nVersion ) const OUString aFilterName = GetPresetFilterName(); if ( aFilterName.isEmpty() ) { + OUString sDocumentServiceName = GetDocumentServiceName(); + if (utl::ConfigManager::IsFuzzing() && nVersion == SOFFICE_FILEFORMAT_CURRENT && + sDocumentServiceName == "com.sun.star.chart2.ChartDocument") + { + return "chart8"; + } try { ::comphelper::MimeConfigurationHelper aHelper( m_xContext ); - aFilterName = aHelper.GetDefaultFilterFromServiceName( GetDocumentServiceName(), nVersion ); + aFilterName = aHelper.GetDefaultFilterFromServiceName(sDocumentServiceName, nVersion); // If no filter is found, fall back to the FileFormatVersion=6200 filter, Base only has that. if (aFilterName.isEmpty() && nVersion == SOFFICE_FILEFORMAT_CURRENT) -- cgit