diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-31 15:47:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-01 18:12:09 +0200 |
commit | dabd26614ddf73a2fb382e7a105c8c11c88741d9 (patch) | |
tree | 42365adb8b0d740da2dee4dc82aa76ad80542902 /sc/source/ui/view/printfun.cxx | |
parent | 49b9401465730b1151917bffcbc0ad1f0622fcee (diff) |
pass ScRange around by value
it's a very small object, and trivially movable. No need to allocate it
separately
Change-Id: I0adf947433e73a425f39004297c450a93ac4e5f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135216
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/view/printfun.cxx')
-rw-r--r-- | sc/source/ui/view/printfun.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 92e593a9dcca..d5f1d8634865 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -1001,8 +1001,8 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions ) //! walk through all PrintAreas of the table !!! const ScRange* pPrintArea = rDoc.GetPrintRange( nPrintTab, 0 ); - const ScRange* pRepeatCol = rDoc.GetRepeatColRange( nPrintTab ); - const ScRange* pRepeatRow = rDoc.GetRepeatRowRange( nPrintTab ); + std::optional<ScRange> oRepeatCol = rDoc.GetRepeatColRange( nPrintTab ); + std::optional<ScRange> oRepeatRow = rDoc.GetRepeatRowRange( nPrintTab ); // ignoring ATTR_PAGE_PRINTTABLES @@ -1055,11 +1055,11 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions ) } } - if ( pRepeatCol ) + if ( oRepeatCol ) { aAreaParam.bRepeatCol = true; - nRepeatStartCol = pRepeatCol->aStart.Col(); - nRepeatEndCol = pRepeatCol->aEnd .Col(); + nRepeatStartCol = oRepeatCol->aStart.Col(); + nRepeatEndCol = oRepeatCol->aEnd .Col(); } else { @@ -1067,11 +1067,11 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions ) nRepeatStartCol = nRepeatEndCol = SCCOL_REPEAT_NONE; } - if ( pRepeatRow ) + if ( oRepeatRow ) { aAreaParam.bRepeatRow = true; - nRepeatStartRow = pRepeatRow->aStart.Row(); - nRepeatEndRow = pRepeatRow->aEnd .Row(); + nRepeatStartRow = oRepeatRow->aStart.Row(); + nRepeatEndRow = oRepeatRow->aEnd .Row(); } else { |