summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-07-08 22:02:48 +0200
committerEike Rathke <erack@redhat.com>2015-07-08 22:21:08 +0200
commit5ee9e2983a4b0f3df31e7f8ea4695c2c789edc56 (patch)
tree52fa748b1811f3db90a5233ca0e82f80f102f361 /sc
parentb4317a01a72b2e0944311e6ad407cdf2ac0b1f1a (diff)
remove ScRange::Justify() and replace calls with PutInOrder()
Change-Id: I350050ac085b1f220d5288d33c253ba0c9a5fd2c
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/address.hxx3
-rw-r--r--sc/source/core/data/document.cxx4
-rw-r--r--sc/source/core/data/markdata.cxx2
-rw-r--r--sc/source/core/tool/address.cxx19
-rw-r--r--sc/source/core/tool/compiler.cxx2
-rw-r--r--sc/source/core/tool/interpr3.cxx2
-rw-r--r--sc/source/core/tool/interpr4.cxx2
-rw-r--r--sc/source/filter/excel/xehelper.cxx2
-rw-r--r--sc/source/filter/excel/xename.cxx2
-rw-r--r--sc/source/ui/app/inputhdl.cxx2
-rw-r--r--sc/source/ui/app/scmod.cxx2
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx2
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx2
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx10
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx2
-rw-r--r--sc/source/ui/unoobj/cursuno.cxx18
-rw-r--r--sc/source/ui/view/gridwin.cxx6
-rw-r--r--sc/source/ui/view/gridwin4.cxx2
-rw-r--r--sc/source/ui/view/tabview3.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx4
-rw-r--r--sc/source/ui/view/viewfun2.cxx4
21 files changed, 37 insertions, 57 deletions
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index f6650d4e975f..9c062b82b531 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -540,15 +540,14 @@ public:
inline void GetVars( SCCOL& nCol1, SCROW& nRow1, SCTAB& nTab1,
SCCOL& nCol2, SCROW& nRow2, SCTAB& nTab2 ) const;
+ SC_DLLPUBLIC void PutInOrder();
// The document for the maximum defined sheet number
SC_DLLPUBLIC bool Move( SCsCOL aDeltaX, SCsROW aDeltaY, SCsTAB aDeltaZ, ScDocument* pDocument = NULL );
- SC_DLLPUBLIC void Justify();
SC_DLLPUBLIC void ExtendTo( const ScRange& rRange );
SC_DLLPUBLIC bool Intersects( const ScRange& rRange ) const; // do two ranges intersect?
ScRange Intersection( const ScRange& rOther ) const;
- void PutInOrder();
inline bool operator==( const ScRange& rRange ) const;
inline bool operator!=( const ScRange& rRange ) const;
inline bool operator<( const ScRange& rRange ) const;
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index c8e9a0ec12be..95655f295cdd 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2008,7 +2008,7 @@ void ScDocument::CopyToDocument(const ScRange& rRange,
const ScMarkData* pMarks, bool bColRowFlags)
{
ScRange aNewRange = rRange;
- aNewRange.Justify();
+ aNewRange.PutInOrder();
if( pDestDoc->aDocName.isEmpty() )
pDestDoc->aDocName = aDocName;
@@ -2041,7 +2041,7 @@ void ScDocument::UndoToDocument(const ScRange& rRange,
sc::AutoCalcSwitch aAutoCalcSwitch(*this, false);
ScRange aNewRange = rRange;
- aNewRange.Justify();
+ aNewRange.PutInOrder();
SCTAB nTab1 = aNewRange.aStart.Tab();
SCTAB nTab2 = aNewRange.aEnd.Tab();
diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx
index 55537b23f12c..28c18d7e5ce4 100644
--- a/sc/source/core/data/markdata.cxx
+++ b/sc/source/core/data/markdata.cxx
@@ -99,7 +99,7 @@ void ScMarkData::ResetMark()
void ScMarkData::SetMarkArea( const ScRange& rRange )
{
aMarkRange = rRange;
- aMarkRange.Justify();
+ aMarkRange.PutInOrder();
if ( !bMarked )
{
// Upon creation of a document ScFormatShell GetTextAttrState
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index a3f756d6a327..81e4047ff0d3 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1426,25 +1426,6 @@ void ScRange::PutInOrder()
}
}
-void ScRange::Justify()
-{
- SCCOL nTempCol;
- if ( aEnd.Col() < (nTempCol = aStart.Col()) )
- {
- aStart.SetCol(aEnd.Col()); aEnd.SetCol(nTempCol);
- }
- SCROW nTempRow;
- if ( aEnd.Row() < (nTempRow = aStart.Row()) )
- {
- aStart.SetRow(aEnd.Row()); aEnd.SetRow(nTempRow);
- }
- SCTAB nTempTab;
- if ( aEnd.Tab() < (nTempTab = aStart.Tab()) )
- {
- aStart.SetTab(aEnd.Tab()); aEnd.SetTab(nTempTab);
- }
-}
-
void ScRange::ExtendTo( const ScRange& rRange )
{
OSL_ENSURE( rRange.IsValid(), "ScRange::ExtendTo - cannot extend to invalid range" );
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index e75bce80a222..0583f71b2bf6 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -5287,7 +5287,7 @@ bool ScCompiler::HandleTableRef()
else
{
aColRange.aEnd = mpToken->GetSingleRef()->toAbs( aPos);
- aColRange.Justify();
+ aColRange.PutInOrder();
bCol2Rel = mpToken->GetSingleRef()->IsColRel();
bCol2RelName = mpToken->GetSingleRef()->IsRelName();
}
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index 47ac91e2e35b..f064f65c4fbd 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -3692,7 +3692,7 @@ void ScInterpreter::GetNumberSequenceArray( sal_uInt8 nParamCount, vector<double
if (nGlobalError)
break;
- aRange.Justify();
+ aRange.PutInOrder();
SCSIZE nCellCount = aRange.aEnd.Col() - aRange.aStart.Col() + 1;
nCellCount *= aRange.aEnd.Row() - aRange.aStart.Row() + 1;
rArray.reserve( rArray.size() + nCellCount);
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 72e0ce1cd5db..08c76b889aec 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -1308,7 +1308,7 @@ void ScInterpreter::DoubleRefToRange( const ScComplexRefData & rCRef,
rRange.aStart.Set( nCol, nRow, nTab );
SingleRefToVars( rCRef.Ref2, nCol, nRow, nTab);
rRange.aEnd.Set( nCol, nRow, nTab );
- rRange.Justify();
+ rRange.PutInOrder();
if (! pDok->aTableOpList.empty() && !bDontCheckForTableOp )
{
if ( IsTableOpInRange( rRange ) )
diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx
index 0109d5eef95c..ab144bba1f76 100644
--- a/sc/source/filter/excel/xehelper.cxx
+++ b/sc/source/filter/excel/xehelper.cxx
@@ -203,7 +203,7 @@ bool XclExpAddressConverter::CheckRange( const ScRange& rScRange, bool bWarn )
bool XclExpAddressConverter::ValidateRange( ScRange& rScRange, bool bWarn )
{
- rScRange.Justify();
+ rScRange.PutInOrder();
// check start position
bool bValidStart = CheckAddress( rScRange.aStart, bWarn );
diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx
index d6347bc98fe2..30707526a322 100644
--- a/sc/source/filter/excel/xename.cxx
+++ b/sc/source/filter/excel/xename.cxx
@@ -601,7 +601,7 @@ void XclExpNameManagerImpl::CreateBuiltInNames()
// Calc document does not care about sheet index in print ranges
aRange.aStart.SetTab( nScTab );
aRange.aEnd.SetTab( nScTab );
- aRange.Justify();
+ aRange.PutInOrder();
aRangeList.Append( aRange );
}
// create the NAME record (do not warn if ranges are shrunken)
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index e2a7bc0d9453..001aa27bb664 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -339,7 +339,7 @@ void ScInputHandler::UpdateRange( sal_uInt16 nIndex, const ScRange& rNew )
ColorData nNewColor = pRangeFindList->FindColor( rNew, nIndex );
ScRange aJustified = rNew;
- aJustified.Justify(); // Always display Ref in the Formula the right way
+ aJustified.PutInOrder(); // Always display Ref in the Formula the right way
ScDocument* pDoc = pDocView->GetViewData().GetDocument();
const ScAddress::Details aAddrDetails( pDoc, aCursorPos );
OUString aNewStr(aJustified.Format(rData.nFlags, pDoc, aAddrDetails));
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index c135b531975a..754ba8b1efa8 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -1723,7 +1723,7 @@ void ScModule::SetReference( const ScRange& rRef, ScDocument* pDoc,
// In RefDialogs we also trigger the ZoomIn, if the Ref's Start and End are different
ScRange aNew = rRef;
- aNew.Justify(); // Always in the right direction
+ aNew.PutInOrder(); // Always in the right direction
if( nCurRefDlgId )
{
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 042201ded1c8..ce775508dab0 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2170,7 +2170,7 @@ ScExternalRefCache::TokenArrayRef ScExternalRefManager::getDoubleRefTokensFromSr
}
ScRange aRange(rRange);
- aRange.Justify();
+ aRange.PutInOrder();
SCTAB nTabSpan = aRange.aEnd.Tab() - aRange.aStart.Tab();
vector<ScExternalRefCache::SingleRangeData> aCacheData;
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index 7f960aca2994..bb55b6f134e4 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -896,7 +896,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 ] );
- aRange.Justify();
+ aRange.PutInOrder();
SCTAB nTab = aRange.aStart.Tab();
// resolve into single cells
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index b7922d608ee6..6f0a83569789 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1414,7 +1414,7 @@ ScCellRangesBase::ScCellRangesBase(ScDocShell* pDocSh, const ScRange& rR) :
--m_refCount;
ScRange aCellRange(rR);
- aCellRange.Justify();
+ aCellRange.PutInOrder();
aRanges.Append( aCellRange );
if (pDocShell) // Null if created with createInstance
@@ -1705,7 +1705,7 @@ void ScCellRangesBase::InitInsertRange(ScDocShell* pDocSh, const ScRange& rR)
pDocShell = pDocSh;
ScRange aCellRange(rR);
- aCellRange.Justify();
+ aCellRange.PutInOrder();
aRanges.RemoveAll();
aRanges.Append( aCellRange );
@@ -1727,7 +1727,7 @@ void ScCellRangesBase::AddRange(const ScRange& rRange, const bool bMergeRanges)
void ScCellRangesBase::SetNewRange(const ScRange& rNew)
{
ScRange aCellRange(rNew);
- aCellRange.Justify();
+ aCellRange.PutInOrder();
aRanges.RemoveAll();
aRanges.Append( aCellRange );
@@ -4792,7 +4792,7 @@ ScCellRangeObj::ScCellRangeObj(ScDocShell* pDocSh, const ScRange& rR) :
pRangePropSet( lcl_GetRangePropertySet() ),
aRange( rR )
{
- aRange.Justify(); // Anfang / Ende richtig
+ aRange.PutInOrder(); // Anfang / Ende richtig
}
ScCellRangeObj::~ScCellRangeObj()
@@ -4809,7 +4809,7 @@ void ScCellRangeObj::RefChanged()
{
const ScRange* pFirst = rRanges[0];
aRange = ScRange(*pFirst);
- aRange.Justify();
+ aRange.PutInOrder();
}
}
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index d98cea5b3c18..755b7aa8477f 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -3125,7 +3125,7 @@ public:
ScRange r;
bool bExternal = ScRefTokenHelper::isExternalRef(pToken);
ScRefTokenHelper::getRangeFromToken(r, pToken, ScAddress(), bExternal);
- r.Justify();
+ r.PutInOrder();
mnCols += r.aEnd.Col() - r.aStart.Col() + 1;
mnRows += r.aEnd.Row() - r.aStart.Row() + 1;
}
diff --git a/sc/source/ui/unoobj/cursuno.cxx b/sc/source/ui/unoobj/cursuno.cxx
index 285042f76ff3..fd30a8a048c1 100644
--- a/sc/source/ui/unoobj/cursuno.cxx
+++ b/sc/source/ui/unoobj/cursuno.cxx
@@ -100,7 +100,7 @@ void SAL_CALL ScCellCursorObj::collapseToCurrentRegion() throw(uno::RuntimeExcep
OSL_ENSURE( rRanges.size() == 1, "Range? Ranges?" );
ScRange aOneRange( *rRanges[ 0 ] );
- aOneRange.Justify();
+ aOneRange.PutInOrder();
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -126,7 +126,7 @@ void SAL_CALL ScCellCursorObj::collapseToCurrentArray()
OSL_ENSURE( rRanges.size() == 1, "Range? Ranges?" );
ScRange aOneRange( *rRanges[ 0 ] );
- aOneRange.Justify();
+ aOneRange.PutInOrder();
ScAddress aCursor(aOneRange.aStart); // use the start address of the range
ScDocShell* pDocSh = GetDocShell();
@@ -210,7 +210,7 @@ void SAL_CALL ScCellCursorObj::collapseToSize( sal_Int32 nColumns, sal_Int32 nRo
OSL_ENSURE( rRanges.size() == 1, "Range? Ranges?" );
ScRange aNewRange( *rRanges[ 0 ] );
- aNewRange.Justify(); //! wirklich?
+ aNewRange.PutInOrder(); //! wirklich?
long nEndX = aNewRange.aStart.Col() + nColumns - 1;
long nEndY = aNewRange.aStart.Row() + nRows - 1;
@@ -223,7 +223,7 @@ void SAL_CALL ScCellCursorObj::collapseToSize( sal_Int32 nColumns, sal_Int32 nRo
aNewRange.aEnd.SetCol((SCCOL)nEndX);
aNewRange.aEnd.SetRow((SCROW)nEndY);
- aNewRange.Justify(); //! wirklich?
+ aNewRange.PutInOrder(); //! wirklich?
SetNewRange( aNewRange );
}
@@ -299,7 +299,7 @@ void SAL_CALL ScCellCursorObj::gotoStart() throw(uno::RuntimeException, std::exc
OSL_ENSURE( rRanges.size() == 1, "Range? Ranges?" );
ScRange aOneRange( *rRanges[ 0 ]);
- aOneRange.Justify();
+ aOneRange.PutInOrder();
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -327,7 +327,7 @@ void SAL_CALL ScCellCursorObj::gotoEnd() throw(uno::RuntimeException, std::excep
OSL_ENSURE( rRanges.size() == 1, "Range? Ranges?" );
ScRange aOneRange( *rRanges[ 0 ] );
- aOneRange.Justify();
+ aOneRange.PutInOrder();
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
@@ -352,7 +352,7 @@ void SAL_CALL ScCellCursorObj::gotoNext() throw(uno::RuntimeException, std::exce
OSL_ENSURE( rRanges.size() == 1, "Range? Ranges?" );
ScRange aOneRange( *rRanges[ 0 ] );
- aOneRange.Justify();
+ aOneRange.PutInOrder();
ScAddress aCursor(aOneRange.aStart); // bei Block immer den Start nehmen
ScMarkData aMark; // not used with bMarked=FALSE
@@ -374,7 +374,7 @@ void SAL_CALL ScCellCursorObj::gotoPrevious() throw(uno::RuntimeException, std::
OSL_ENSURE( rRanges.size() == 1, "Range? Ranges?" );
ScRange aOneRange( *rRanges[ 0 ] );
- aOneRange.Justify();
+ aOneRange.PutInOrder();
ScAddress aCursor(aOneRange.aStart); // bei Block immer den Start nehmen
ScMarkData aMark; // not used with bMarked=FALSE
@@ -396,7 +396,7 @@ void SAL_CALL ScCellCursorObj::gotoOffset( sal_Int32 nColumnOffset, sal_Int32 nR
const ScRangeList& rRanges = GetRangeList();
OSL_ENSURE( rRanges.size() == 1, "Range? Ranges?" );
ScRange aOneRange( *rRanges[ 0 ] );
- aOneRange.Justify();
+ aOneRange.PutInOrder();
if ( aOneRange.aStart.Col() + nColumnOffset >= 0 &&
aOneRange.aEnd.Col() + nColumnOffset <= MAXCOL &&
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 5acc912fa2af..c6ba729d9f2c 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5068,8 +5068,8 @@ static void lcl_PaintRefChanged( ScDocShell* pDocSh, const ScRange& rOldUn, cons
ScRange aOld = rOldUn;
ScRange aNew = rNewUn;
- aOld.Justify();
- aNew.Justify();
+ aOld.PutInOrder();
+ aNew.PutInOrder();
if ( aOld.aStart == aOld.aEnd ) //! Tab ignorieren?
pDocSh->GetDocument().ExtendMerge(aOld);
@@ -5255,7 +5255,7 @@ void ScGridWindow::RFMouseMove( const MouseEvent& rMEvt, bool bUp )
}
if ( bUp )
- aNew.Justify(); // beim ButtonUp wieder richtigherum
+ aNew.PutInOrder(); // beim ButtonUp wieder richtigherum
if ( aNew != aOld )
{
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 4357f52c46df..9a0dfd6d68e7 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -855,7 +855,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
ScRangeFindData& rData = pRangeFinder->GetObject(i);
ScRange aRef = rData.aRef;
- aRef.Justify();
+ aRef.PutInOrder();
if ( aRef.aStart.Tab() >= nTab && aRef.aEnd.Tab() <= nTab )
aOutputData.DrawRefMark( aRef.aStart.Col(), aRef.aStart.Row(),
aRef.aEnd.Col(), aRef.aEnd.Row(),
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 3229f08d8446..80f7858f6363 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -2028,7 +2028,7 @@ void ScTabView::PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCRO
void ScTabView::PaintRangeFinderEntry (ScRangeFindData* pData, const SCTAB nTab)
{
ScRange aRef = pData->aRef;
- aRef.Justify(); // Justify fuer die Abfragen unten
+ aRef.PutInOrder(); // PutInOrder fuer die Abfragen unten
if ( aRef.aStart == aRef.aEnd ) //! Tab ignorieren?
aViewData.GetDocument()->ExtendMerge(aRef);
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 8fdce4451234..f0fc87f34a63 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -360,9 +360,9 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
{
ScRange aOldMark;
rMark.GetMarkArea( aOldMark );
- aOldMark.Justify();
+ aOldMark.PutInOrder();
ScRange aCurrent = aScRange;
- aCurrent.Justify();
+ aCurrent.PutInOrder();
bNothing = ( aCurrent == aOldMark );
}
else
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 991995636e5d..ce0457a47791 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1503,7 +1503,7 @@ void ScViewFunc::FillCrossDblClick()
{
ScRange aRange;
GetViewData().GetSimpleArea( aRange );
- aRange.Justify();
+ aRange.PutInOrder();
SCTAB nTab = GetViewData().GetCurPos().Tab();
SCCOL nStartX = aRange.aStart.Col();
@@ -1563,7 +1563,7 @@ void ScViewFunc::ConvertFormulaToValue()
{
ScRange aRange;
GetViewData().GetSimpleArea(aRange);
- aRange.Justify();
+ aRange.PutInOrder();
ScDocShell* pDocSh = GetViewData().GetDocShell();
pDocSh->GetDocFunc().ConvertFormulaToValue(aRange, true, true);