summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-13 19:48:10 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-14 09:55:21 +0200
commit07ef98d1a6a49eb34b1ed1d421e26f216c1646ab (patch)
tree93ce7fc8d895dc7e64f6a7436a607430168eb5f2
parent8e20041296f39c3447289064f65b83a36f3c2bf1 (diff)
ScImportQuattroPro never passed a nullptr
Change-Id: I96f463f126908cb26a312428b6e2d1e57b937544 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102605 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/inc/filter.hxx2
-rw-r--r--sc/source/filter/inc/ftools.hxx2
-rw-r--r--sc/source/filter/inc/qpro.hxx4
-rw-r--r--sc/source/filter/qpro/qpro.cxx20
-rw-r--r--sc/source/ui/docshell/docsh.cxx2
5 files changed, 15 insertions, 15 deletions
diff --git a/sc/inc/filter.hxx b/sc/inc/filter.hxx
index 1e7beac1184c..25a4c6e2cc56 100644
--- a/sc/inc/filter.hxx
+++ b/sc/inc/filter.hxx
@@ -58,7 +58,7 @@ class SAL_DLLPUBLIC_RTTI ScFormatFilterPlugin {
public:
// various import filters
virtual ErrCode ScImportLotus123( SfxMedium&, ScDocument&, rtl_TextEncoding eSrc ) = 0;
- virtual ErrCode ScImportQuattroPro(SvStream* pStream, ScDocument *pDoc) = 0;
+ virtual ErrCode ScImportQuattroPro(SvStream* pStream, ScDocument& rDoc) = 0;
virtual ErrCode ScImportExcel( SfxMedium&, ScDocument*, const EXCIMPFORMAT ) = 0;
// eFormat == EIF_AUTO -> matching filter is used automatically
// eFormat == EIF_BIFF5 -> only Biff5 stream is read successfully (in an Excel97 doc, too)
diff --git a/sc/source/filter/inc/ftools.hxx b/sc/source/filter/inc/ftools.hxx
index fb0ac8ac455a..ffd510fc025a 100644
--- a/sc/source/filter/inc/ftools.hxx
+++ b/sc/source/filter/inc/ftools.hxx
@@ -262,7 +262,7 @@ public:
virtual ~ScFormatFilterPluginImpl();
// various import filters
virtual ErrCode ScImportLotus123( SfxMedium&, ScDocument&, rtl_TextEncoding eSrc ) override;
- virtual ErrCode ScImportQuattroPro(SvStream* pStream, ScDocument *pDoc) override;
+ virtual ErrCode ScImportQuattroPro(SvStream* pStream, ScDocument& rDoc) override;
virtual ErrCode ScImportExcel( SfxMedium&, ScDocument*, const EXCIMPFORMAT ) override;
// eFormat == EIF_AUTO -> matching filter is used automatically
// eFormat == EIF_BIFF5 -> only Biff5 stream leads to success (even in an Excel97 doc)
diff --git a/sc/source/filter/inc/qpro.hxx b/sc/source/filter/inc/qpro.hxx
index bd8b52f416f8..5bdc913eadd8 100644
--- a/sc/source/filter/inc/qpro.hxx
+++ b/sc/source/filter/inc/qpro.hxx
@@ -50,8 +50,8 @@ public:
sal_uInt16 getLength() const { return mnLength; }
OUString readString(sal_uInt16 nLength);
- ErrCode parse( ScDocument *pDoc );
- ErrCode import( ScDocument *pDoc ); //parse + CalcAfterLoad
+ ErrCode parse( ScDocument& rDoc );
+ ErrCode import( ScDocument& rDoc ); //parse + CalcAfterLoad
ErrCode readSheet( SCTAB nTab, ScDocument& rDoc, ScQProStyle *pStyle );
};
#endif
diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx
index c24ba49584ee..aabf79e64b45 100644
--- a/sc/source/filter/qpro/qpro.cxx
+++ b/sc/source/filter/qpro/qpro.cxx
@@ -127,10 +127,10 @@ ErrCode ScQProReader::readSheet( SCTAB nTab, ScDocument& rDoc, ScQProStyle *pSty
return eRet;
}
-ErrCode ScFormatFilterPluginImpl::ScImportQuattroPro(SvStream *pStream, ScDocument *pDoc)
+ErrCode ScFormatFilterPluginImpl::ScImportQuattroPro(SvStream *pStream, ScDocument& rDoc)
{
ScQProReader aReader(pStream);
- ErrCode eRet = aReader.import( pDoc );
+ ErrCode eRet = aReader.import(rDoc);
return eRet;
}
@@ -155,7 +155,7 @@ ScQProReader::~ScQProReader()
mpStream->SetBufferSize( 0 );
}
-ErrCode ScQProReader::parse( ScDocument *pDoc )
+ErrCode ScQProReader::parse(ScDocument& rDoc)
{
ErrCode eRet = ERRCODE_NONE;
sal_uInt16 nVersion;
@@ -183,11 +183,11 @@ ErrCode ScQProReader::parse( ScDocument *pDoc )
{
OUString aName = OUStringChar( sal_Unicode('A' + nTab) );
if (!nTab)
- pDoc->RenameTab( nTab, aName );
+ rDoc.RenameTab( nTab, aName );
else
- pDoc->InsertTab( nTab, aName );
+ rDoc.InsertTab( nTab, aName );
}
- eRet = readSheet( nTab, *pDoc, pStyleElement.get() );
+ eRet = readSheet( nTab, rDoc, pStyleElement.get() );
nTab++;
}
break;
@@ -225,10 +225,10 @@ ErrCode ScQProReader::parse( ScDocument *pDoc )
return eRet;
}
-ErrCode ScQProReader::import( ScDocument *pDoc )
+ErrCode ScQProReader::import( ScDocument& rDoc)
{
- ErrCode eRet = parse(pDoc);
- pDoc->CalcAfterLoad();
+ ErrCode eRet = parse(rDoc);
+ rDoc.CalcAfterLoad();
return eRet;
}
@@ -246,7 +246,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportQPW(SvStream &rStream)
aDocument.SetHardRecalcState(ScDocument::HardRecalcState::ETERNAL);
ScQProReader aReader(&rStream);
- ErrCode eRet = aReader.parse(&aDocument);
+ ErrCode eRet = aReader.parse(aDocument);
return eRet == ERRCODE_NONE;
}
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 1eb6026c4c4c..b570f3481c43 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1465,7 +1465,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
}
else if (aFltName == pFilterQPro6)
{
- ErrCode eError = ScFormatFilter::Get().ScImportQuattroPro(rMedium.GetInStream(), &m_aDocument);
+ ErrCode eError = ScFormatFilter::Get().ScImportQuattroPro(rMedium.GetInStream(), m_aDocument);
if (eError != ERRCODE_NONE)
{
if (!GetError())