[Libreoffice-commits] core.git: 2 commits - sc/inc sc/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Sep 16 07:44:14 UTC 2020
sc/inc/document.hxx | 2 +-
sc/source/core/data/documen5.cxx | 4 ++--
sc/source/core/data/drwlayer.cxx | 2 +-
sc/source/core/tool/charthelper.cxx | 2 +-
sc/source/ui/view/cliputil.cxx | 8 ++++----
5 files changed, 9 insertions(+), 9 deletions(-)
New commits:
commit 705ee514e228dc6b6fe6f13964ef866cd9df1702
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Sep 15 09:51:25 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Sep 16 09:43:37 2020 +0200
lcl_checkClassification never passed a null ScDocument* destination doc
Change-Id: Ic0010d785e49c96a19e6e04e44fe6bc02cc44375
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102790
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/source/ui/view/cliputil.cxx b/sc/source/ui/view/cliputil.cxx
index ff3878e600f2..595e5b2e9d7a 100644
--- a/sc/source/ui/view/cliputil.cxx
+++ b/sc/source/ui/view/cliputil.cxx
@@ -27,13 +27,13 @@ namespace
{
/// Paste only if SfxClassificationHelper recommends so.
-bool lcl_checkClassification(ScDocument* pSourceDoc, const ScDocument* pDestinationDoc)
+bool lcl_checkClassification(ScDocument* pSourceDoc, const ScDocument& rDestinationDoc)
{
- if (!pSourceDoc || !pDestinationDoc)
+ if (!pSourceDoc)
return true;
ScClipOptions* pSourceOptions = pSourceDoc->GetClipOptions();
- SfxObjectShell* pDestinationShell = pDestinationDoc->GetDocumentShell();
+ SfxObjectShell* pDestinationShell = rDestinationDoc.GetDocumentShell();
if (!pSourceOptions || !pDestinationShell)
return true;
@@ -84,7 +84,7 @@ void ScClipUtil::PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTab
// For multi-range paste, we paste values by default.
nFlags &= ~InsertDeleteFlags::FORMULA;
- if (lcl_checkClassification(pClipDoc, &rThisDoc))
+ if (lcl_checkClassification(pClipDoc, rThisDoc))
pTabViewShell->PasteFromClip( nFlags, pClipDoc,
ScPasteFunc::NONE, false, false, false, INS_NONE, InsertDeleteFlags::NONE,
bShowDialog ); // allow warning dialog
commit 4e65a506f29c886195be3ee17e166a9fe1cb7a7a
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Sep 15 09:50:19 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Sep 16 09:43:14 2020 +0200
GetChartRanges never passed a null ScDocument*
Change-Id: I021544d0cdfb68f6e30a4bb229eb0e8b3ea695d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102789
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 370effa1b01b..36bd437c2773 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -840,7 +840,7 @@ public:
css::uno::Reference< css::chart2::XChartDocument > GetChartByName( const OUString& rChartName );
- SC_DLLPUBLIC void GetChartRanges( const OUString& rChartName, std::vector< ScRangeList >& rRanges, const ScDocument* pSheetNameDoc );
+ SC_DLLPUBLIC void GetChartRanges( const OUString& rChartName, std::vector< ScRangeList >& rRanges, const ScDocument& rSheetNameDoc );
void SetChartRanges( const OUString& rChartName, const std::vector< ScRangeList >& rRanges );
void UpdateChartArea( const OUString& rChartName, const ScRange& rNewArea,
diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx
index 2ae03f5f299b..33d0d74703b0 100644
--- a/sc/source/core/data/documen5.cxx
+++ b/sc/source/core/data/documen5.cxx
@@ -164,7 +164,7 @@ uno::Reference< chart2::XChartDocument > ScDocument::GetChartByName( const OUStr
return xReturn;
}
-void ScDocument::GetChartRanges( const OUString& rChartName, ::std::vector< ScRangeList >& rRangesVector, const ScDocument* pSheetNameDoc )
+void ScDocument::GetChartRanges( const OUString& rChartName, ::std::vector< ScRangeList >& rRangesVector, const ScDocument& rSheetNameDoc )
{
rRangesVector.clear();
uno::Reference< chart2::XChartDocument > xChartDoc( GetChartByName( rChartName ) );
@@ -175,7 +175,7 @@ void ScDocument::GetChartRanges( const OUString& rChartName, ::std::vector< ScRa
for(const OUString & aRangeString : aRangeStrings)
{
ScRangeList aRanges;
- aRanges.Parse( aRangeString, *pSheetNameDoc, pSheetNameDoc->GetAddressConvention() );
+ aRanges.Parse( aRangeString, rSheetNameDoc, rSheetNameDoc.GetAddressConvention() );
rRangesVector.push_back(aRanges);
}
}
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 4830dcc4f0fb..3a22bc354a18 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -1751,7 +1751,7 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const
{
OUString aChartName = static_cast<SdrOle2Obj*>(pNewObject)->GetPersistName();
::std::vector< ScRangeList > aRangesVector;
- pDoc->GetChartRanges( aChartName, aRangesVector, pDoc );
+ pDoc->GetChartRanges( aChartName, aRangesVector, *pDoc );
if( !aRangesVector.empty() )
{
bool bInSourceRange = false;
diff --git a/sc/source/core/tool/charthelper.cxx b/sc/source/core/tool/charthelper.cxx
index 572da8014b47..326b041857be 100644
--- a/sc/source/core/tool/charthelper.cxx
+++ b/sc/source/core/tool/charthelper.cxx
@@ -134,7 +134,7 @@ void ScChartHelper::AdjustRangesOfChartsOnDestinationPage( const ScDocument* pSr
if( xChartDoc.is() && xReceiver.is() && !xChartDoc->hasInternalDataProvider() )
{
::std::vector< ScRangeList > aRangesVector;
- pDestDoc->GetChartRanges( aChartName, aRangesVector, pSrcDoc );
+ pDestDoc->GetChartRanges( aChartName, aRangesVector, *pSrcDoc );
for( ScRangeList& rScRangeList : aRangesVector )
{
More information about the Libreoffice-commits
mailing list