honor lib version in import tests again

Change-Id: Idf99aab4bc136ac4a8a07945001e4f34a34a0e17
This commit is contained in:
David Tardon 2017-01-11 17:24:59 +01:00
parent aa1ee198b5
commit c2447d0b6a
2 changed files with 13 additions and 0 deletions

View file

@ -28,6 +28,7 @@ $(eval $(call gb_Library_use_libraries,wpftqahelper,\
cppu \
sal \
test \
tl \
ucbhelper \
unotest \
))

View file

@ -11,6 +11,8 @@
#include <com/sun/star/document/XFilter.hpp>
#include <tools/urlobj.hxx>
#include "WpftLoader.hxx"
namespace uno = com::sun::star::uno;
@ -31,6 +33,16 @@ WpftFilterTestBase::WpftFilterTestBase(const rtl::OUString &rFactoryURL)
bool WpftFilterTestBase::load(const OUString &, const OUString &rURL, const OUString &,
SfxFilterFlags, SotClipboardFormatId, unsigned int)
{
if (m_pOptionalMap)
{
// first check if this test file is supported by the used version of the library
const INetURLObject aUrl(rURL);
const WpftOptionalMap_t::const_iterator it(m_pOptionalMap->find(aUrl.getName()));
if ((it != m_pOptionalMap->end()) && !it->second)
return true; // skip the file
}
const WpftLoader aLoader(rURL, m_xFilter, m_aFactoryURL, m_xDesktop, m_xTypeMap, m_xContext);
return aLoader.getDocument().is();
}