split up doc testing for three major variants
Change-Id: Iac1b5cb1c209ba27d185c8a7ba1e59c663553d77
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index 2834227..298f4c4 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -177,13 +177,13 @@ protected:
#define SW_STREAM_READER 1
#define SW_STORAGE_READER 2
extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportDOC(const OUString &rUrl, const OUString &rFltName);
extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportDOC(SvStream &rStream, const OUString &rFltName);
extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportRTF(SvStream &rStream);
class SW_DLLPUBLIC Reader
{
friend class SwReader;
friend bool TestImportDOC(const OUString &rUrl, const OUString &rFltName);
friend bool TestImportDOC(SvStream &rStream, const OUString &rFltName);
friend bool TestImportRTF(SvStream &rStream);
rtl::Reference<SwDoc> mxTemplate;
OUString aTemplateNm;
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 108bf11..f86a2c2 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -6190,16 +6190,15 @@ extern "C" SAL_DLLPUBLIC_EXPORT Reader* SAL_CALL ImportDOC()
return new WW8Reader;
}
extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportDOC(const OUString &rURL, const OUString &rFltName)
bool SAL_CALL TestImportDOC(SvStream &rStream, const OUString &rFltName)
{
Reader *pReader = ImportDOC();
SvFileStream aFileStream(rURL, StreamMode::READ);
tools::SvRef<SotStorage> xStorage;
pReader->pStrm = &aFileStream;
pReader->pStrm = &rStream;
if (rFltName != "WW6")
{
xStorage = tools::SvRef<SotStorage>(new SotStorage(aFileStream));
xStorage = tools::SvRef<SotStorage>(new SotStorage(rStream));
pReader->pStg = xStorage.get();
}
pReader->SetFltName(rFltName);
@@ -6223,6 +6222,21 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportDOC(const OUString &rURL
return bRet;
}
extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportWW8(SvStream &rStream)
{
return TestImportDOC(rStream, "CWW8");
}
extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportWW6(SvStream &rStream)
{
return TestImportDOC(rStream, "CWW6");
}
extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportWW2(SvStream &rStream)
{
return TestImportDOC(rStream, "WW6");
}
sal_uLong WW8Reader::OpenMainStream( tools::SvRef<SotStorageStream>& rRef, sal_uInt16& rBuffSize )
{
sal_uLong nRet = ERR_SWG_READ_ERROR;
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 3364acd..fc441fd 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -87,7 +87,7 @@ namespace
const wwSprmSearcher *wwSprmParser::GetWW2SprmSearcher()
{
//double lock me
// WW7- Sprms
// WW2 Sprms
static const SprmInfoRow aSprms[] =
{
{ 0, { 0, L_FIX} }, // "Default-sprm", will be skipped
diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx
index 63e33e1..636970f 100644
--- a/vcl/workben/fftester.cxx
+++ b/vcl/workben/fftester.cxx
@@ -323,26 +323,47 @@ try_again:
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) (*pfnImport)(aFileStream, aGraphic, nullptr);
}
else if ( (strcmp(argv[2], "doc") == 0) ||
(strcmp(argv[2], "ww8") == 0) ||
(strcmp(argv[2], "ww6") == 0) ||
(strcmp(argv[2], "ww2") == 0) )
else if ((strcmp(argv[2], "doc") == 0) || (strcmp(argv[2], "ww8") == 0))
{
static WFilterCall pfnImport(nullptr);
static FFilterCall pfnImport(nullptr);
if (!pfnImport)
{
osl::Module aLibrary;
aLibrary.loadRelative(&thisModule, "libmswordlo.so", SAL_LOADMODULE_LAZY);
pfnImport = reinterpret_cast<WFilterCall>(
aLibrary.getFunctionSymbol("TestImportDOC"));
pfnImport = reinterpret_cast<FFilterCall>(
aLibrary.getFunctionSymbol("TestImportWW8"));
aLibrary.release();
}
if (strcmp(argv[2], "ww6") == 0)
ret = (int) (*pfnImport)(out, OUString("CWW6"));
else if (strcmp(argv[2], "ww2") == 0)
ret = (int) (*pfnImport)(out, OUString("WW6"));
else
ret = (int) (*pfnImport)(out, OUString("CWW8"));
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) (*pfnImport)(aFileStream);
}
else if (strcmp(argv[2], "ww6") == 0)
{
static FFilterCall pfnImport(nullptr);
if (!pfnImport)
{
osl::Module aLibrary;
aLibrary.loadRelative(&thisModule, "libmswordlo.so", SAL_LOADMODULE_LAZY);
pfnImport = reinterpret_cast<FFilterCall>(
aLibrary.getFunctionSymbol("TestImportWW6"));
aLibrary.release();
}
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) (*pfnImport)(aFileStream);
}
else if (strcmp(argv[2], "ww2") == 0)
{
static FFilterCall pfnImport(nullptr);
if (!pfnImport)
{
osl::Module aLibrary;
aLibrary.loadRelative(&thisModule, "libmswordlo.so", SAL_LOADMODULE_LAZY);
pfnImport = reinterpret_cast<FFilterCall>(
aLibrary.getFunctionSymbol("TestImportWW2"));
aLibrary.release();
}
SvFileStream aFileStream(out, StreamMode::READ);
ret = (int) (*pfnImport)(aFileStream);
}
else if (strcmp(argv[2], "rtf") == 0)
{