diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-02 21:05:48 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-04-02 22:48:55 +0100 |
commit | 74917d23782413aa0f129bcf9e6bf5a1c496d23b (patch) | |
tree | 6bfbc097ccc73d254e49333c273310929aedfb6a /sw | |
parent | 6fd66ad94040d46904eba8f2ac2b4270787a756a (diff) |
split up doc testing for three major variants
Change-Id: Iac1b5cb1c209ba27d185c8a7ba1e59c663553d77
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/shellio.hxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 22 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 2 |
3 files changed, 21 insertions, 7 deletions
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx index 283422710fc2..298f4c465647 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 108bf115eee5..f86a2c263a2d 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 3364acdf3f58..fc441fdee489 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 |