diff options
-rw-r--r-- | sc/source/filter/excel/excel.cxx | 13 | ||||
-rw-r--r-- | sc/source/filter/inc/qpro.hxx | 3 | ||||
-rw-r--r-- | sc/source/filter/qpro/qpro.cxx | 27 |
3 files changed, 27 insertions, 16 deletions
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx index f39766edd83a..9cfa5493e91f 100644 --- a/sc/source/filter/excel/excel.cxx +++ b/sc/source/filter/excel/excel.cxx @@ -222,19 +222,6 @@ ErrCode ScFormatFilterPluginImpl::ScExportExcel5( SfxMedium& rMedium, ScDocument return eRet; } -extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportQPW(SvStream &rStream) -{ - ScDLL::Init(); - ScDocument aDocument; - ScDocOptions aDocOpt = aDocument.GetDocOptions(); - aDocOpt.SetLookUpColRowNames(false); - aDocument.SetDocOptions(aDocOpt); - aDocument.MakeTable(0); - aDocument.EnableExecuteLink(false); - aDocument.SetInsertingFromOtherDoc(true); - return ScFormatFilter::Get().ScImportQuattroPro(&rStream, &aDocument) == ERRCODE_NONE; -} - extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportCalcRTF(SvStream &rStream) { ScDLL::Init(); diff --git a/sc/source/filter/inc/qpro.hxx b/sc/source/filter/inc/qpro.hxx index 5410b8145d64..94d6c4325ddd 100644 --- a/sc/source/filter/inc/qpro.hxx +++ b/sc/source/filter/inc/qpro.hxx @@ -50,7 +50,8 @@ public: sal_uInt16 getLength() { return mnLength; } OUString readString(sal_uInt16 nLength); - ErrCode import( ScDocument *pDoc ); + ErrCode parse( ScDocument *pDoc ); + ErrCode import( ScDocument *pDoc ); //parse + CalcAfterLoad ErrCode readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pStyle ); }; #endif diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx index 676c297900d6..5ac793a0efec 100644 --- a/sc/source/filter/qpro/qpro.cxx +++ b/sc/source/filter/qpro/qpro.cxx @@ -32,6 +32,8 @@ #include <document.hxx> #include <formulacell.hxx> #include <tools/stream.hxx> +#include <docoptio.hxx> +#include <scdll.hxx> #include <memory> ErrCode ScQProReader::readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pStyle ) @@ -154,8 +156,7 @@ ScQProReader::~ScQProReader() mpStream->SetBufferSize( 0 ); } - -ErrCode ScQProReader::import( ScDocument *pDoc ) +ErrCode ScQProReader::parse( ScDocument *pDoc ) { ErrCode eRet = ERRCODE_NONE; sal_uInt16 nVersion; @@ -223,10 +224,32 @@ ErrCode ScQProReader::import( ScDocument *pDoc ) break; } } + return eRet; +} + +ErrCode ScQProReader::import( ScDocument *pDoc ) +{ + ErrCode eRet = parse(pDoc); pDoc->CalcAfterLoad(); return eRet; } +extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportQPW(SvStream &rStream) +{ + ScDLL::Init(); + ScDocument aDocument; + ScDocOptions aDocOpt = aDocument.GetDocOptions(); + aDocOpt.SetLookUpColRowNames(false); + aDocument.SetDocOptions(aDocOpt); + aDocument.MakeTable(0); + aDocument.EnableExecuteLink(false); + aDocument.SetInsertingFromOtherDoc(true); + + ScQProReader aReader(&rStream); + ErrCode eRet = aReader.parse(&aDocument); + return eRet == ERRCODE_NONE; +} + bool ScQProReader::recordsLeft() { return mpStream && mpStream->good(); |