diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-07 14:17:38 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-03-10 19:22:01 +0100 |
commit | 6529cd54c29c5800340530a1b8182c341fbeeafb (patch) | |
tree | 2b09ee9429a0759b8104575aa97e1f4aeadd443e /sc/source/ui/miscdlgs | |
parent | 4ea605cb5c31fe4c7d3931a656782a652b4d96fc (diff) |
don't use heap for elements in ScRangeList
no need to store small objects like this out of line.
Also
- add move constructor and move assignment operator
- drop Assign method since it now has the same
signature as push_back
Change-Id: I9a8647d3a11f24166a83d399a358a2bce3b2cb79
Reviewed-on: https://gerrit.libreoffice.org/50899
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/ui/miscdlgs')
-rw-r--r-- | sc/source/ui/miscdlgs/acredlin.cxx | 20 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/anyrefdg.cxx | 22 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/highred.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/optsolver.cxx | 2 |
4 files changed, 24 insertions, 24 deletions
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 6a6f6f3e2684..210392eaf8be 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -244,8 +244,8 @@ void ScAcceptChgDlg::Init() if( !aChangeViewSet.GetTheRangeList().empty() ) { - const ScRange* pRangeEntry = aChangeViewSet.GetTheRangeList().front(); - OUString aRefStr(pRangeEntry->Format(ScRefFlags::RANGE_ABS_3D, pDoc)); + const ScRange & rRangeEntry = aChangeViewSet.GetTheRangeList().front(); + OUString aRefStr(rRangeEntry.Format(ScRefFlags::RANGE_ABS_3D, pDoc)); pTPFilter->SetRange(aRefStr); } @@ -338,8 +338,8 @@ bool ScAcceptChgDlg::IsValidAction(const ScChangeAction* pScChangeAction) { for ( size_t i = 0, nRanges = aRangeList.size(); i < nRanges; ++i ) { - ScRange* pRangeEntry = aRangeList[ i ]; - if (pRangeEntry->Intersects(aRef)) { + ScRange const & rRangeEntry = aRangeList[ i ]; + if (rRangeEntry.Intersects(aRef)) { bFlag = true; break; } @@ -457,8 +457,8 @@ SvTreeListEntry* ScAcceptChgDlg::AppendChangeAction( { for ( size_t i = 0, nRanges = aRangeList.size(); i < nRanges; ++i ) { - ScRange* pRangeEntry = aRangeList[ i ]; - if( pRangeEntry->Intersects(aRef) ) + ScRange const & rRangeEntry = aRangeList[ i ]; + if( rRangeEntry.Intersects(aRef) ) { bHasFilterEntry=true; bFlag=true; @@ -527,8 +527,8 @@ SvTreeListEntry* ScAcceptChgDlg::AppendFilteredAction( { for ( size_t i = 0, nRanges = aRangeList.size(); i < nRanges; ++i ) { - ScRange* pRangeEntry=aRangeList[ i ]; - if( pRangeEntry->Intersects(aRef) ) + ScRange const & rRangeEntry=aRangeList[ i ]; + if( rRangeEntry.Intersects(aRef) ) { if( pScChangeAction->GetState()==eState ) bFlag = true; @@ -647,8 +647,8 @@ SvTreeListEntry* ScAcceptChgDlg::InsertChangeActionContent(const ScChangeActionC { for ( size_t i = 0, nRanges = aRangeList.size(); i < nRanges; ++i ) { - ScRange* pRangeEntry = aRangeList[ i ]; - if( pRangeEntry->Intersects(aRef) ) + ScRange const & rRangeEntry = aRangeList[ i ]; + if( rRangeEntry.Intersects(aRef) ) { bFlag=true; break; diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx index 8a9c71ee6eb6..e4e51f964091 100644 --- a/sc/source/ui/miscdlgs/anyrefdg.cxx +++ b/sc/source/ui/miscdlgs/anyrefdg.cxx @@ -144,9 +144,9 @@ void ScFormulaReferenceHelper::ShowSimpleReference(const OUString& rStr) { for ( size_t i = 0, nRanges = aRangeList.size(); i < nRanges; ++i ) { - ScRange* pRangeEntry = aRangeList[ i ]; + ScRange const & rRangeEntry = aRangeList[ i ]; Color aColName = ScRangeFindList::GetColorName( i ); - pTabViewShell->AddHighlightRange( *pRangeEntry, aColName ); + pTabViewShell->AddHighlightRange( rRangeEntry, aColName ); } } } @@ -173,10 +173,10 @@ bool ScFormulaReferenceHelper::ParseWithNames( ScRangeList& rRanges, const OUStr aRange.aStart.SetTab( nRefTab ); if ( (nFlags & ScRefFlags::TAB2_3D) == ScRefFlags::ZERO ) aRange.aEnd.SetTab( aRange.aStart.Tab() ); - rRanges.Append( aRange ); + rRanges.push_back( aRange ); } else if ( ScRangeUtil::MakeRangeFromName( aRangeStr, pDoc, nRefTab, aRange, RUTL_NAMES, aDetails ) ) - rRanges.Append( aRange ); + rRanges.push_back( aRange ); else bError = true; } @@ -304,13 +304,13 @@ void ScFormulaReferenceHelper::ReleaseFocus( formula::RefEdit* pEdit ) { if ( !aRangeList.empty() ) { - const ScRange* pRange = aRangeList.front(); - pViewShell->SetTabNo( pRange->aStart.Tab() ); - pViewShell->MoveCursorAbs( pRange->aStart.Col(), - pRange->aStart.Row(), SC_FOLLOW_JUMP, false, false ); - pViewShell->MoveCursorAbs( pRange->aEnd.Col(), - pRange->aEnd.Row(), SC_FOLLOW_JUMP, true, false ); - m_pDlg->SetReference( *pRange, pDoc ); + const ScRange & rRange = aRangeList.front(); + pViewShell->SetTabNo( rRange.aStart.Tab() ); + pViewShell->MoveCursorAbs( rRange.aStart.Col(), + rRange.aStart.Row(), SC_FOLLOW_JUMP, false, false ); + pViewShell->MoveCursorAbs( rRange.aEnd.Col(), + rRange.aEnd.Row(), SC_FOLLOW_JUMP, true, false ); + m_pDlg->SetReference( rRange, pDoc ); } } } diff --git a/sc/source/ui/miscdlgs/highred.cxx b/sc/source/ui/miscdlgs/highred.cxx index 9601a7c68195..627fb68af76b 100644 --- a/sc/source/ui/miscdlgs/highred.cxx +++ b/sc/source/ui/miscdlgs/highred.cxx @@ -123,8 +123,8 @@ void ScHighlightChgDlg::Init() if ( !aChangeViewSet.GetTheRangeList().empty() ) { - const ScRange* pRangeEntry = aChangeViewSet.GetTheRangeList().front(); - OUString aRefStr(pRangeEntry->Format(ScRefFlags::RANGE_ABS_3D, pDoc)); + const ScRange & rRangeEntry = aChangeViewSet.GetTheRangeList().front(); + OUString aRefStr(rRangeEntry.Format(ScRefFlags::RANGE_ABS_3D, pDoc)); m_pFilterCtr->SetRange(aRefStr); } m_pFilterCtr->Enable(); diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx index 73141f48b822..6ffb40cd8453 100644 --- a/sc/source/ui/miscdlgs/optsolver.cxx +++ b/sc/source/ui/miscdlgs/optsolver.cxx @@ -868,7 +868,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal for ( size_t nRangePos=0, nRange = aVarRanges.size(); nRangePos < nRange; ++nRangePos ) { - ScRange aRange(*aVarRanges[ nRangePos ] ); + ScRange aRange( aVarRanges[ nRangePos ] ); aRange.PutInOrder(); SCTAB nTab = aRange.aStart.Tab(); |