diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2016-03-09 15:23:11 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-03-12 00:21:29 +0000 |
commit | 51d0b4037b36a4a74c9181b95edb18017542ab79 (patch) | |
tree | c13c5ac4782888e1640ee60911d68329018dcc05 /sc/source/ui/view/gridwin.cxx | |
parent | dc519b6dea7653e4b68b45aa664e3c0b5189d682 (diff) |
tdf#84938 Change defines to typed_flags
Put defines into an enum class and use typed_flags template from o3tl
to give them flag operators.
There were some shift operations to apply flags from start references
to end references, these went into a helper in address.hxx to hide
them. A marco with shift operations in address.cxx was rewritten in two
helpers without shifts.
One shift remained in ScRange::Format with a comment.
The other flag untypical operator was a minus 1 in a helper for
ScRefFinder::ToggleRel, which iteratates through all possible
combinations for absolute references. This is used to make referecnces
absolute via SHIFT+F4. A replacement would be too complex.
Change-Id: I4850f1623e01e56c60ac2260b95fc5cad8b6fd71
Signed-off-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Reviewed-on: https://gerrit.libreoffice.org/22840
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/ui/view/gridwin.cxx')
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index e1274fe5f333..d74fb713abc0 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -2458,8 +2458,8 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) { ScAddress aTempAddr; ScAddress::ExternalInfo aExtInfo; - sal_uInt16 nRes = aTempAddr.Parse(aUrl, pDoc, pDoc->GetAddressConvention(), &aExtInfo); - if (!(nRes & SCA_VALID)) + ScRefFlags nRes = aTempAddr.Parse(aUrl, pDoc, pDoc->GetAddressConvention(), &aExtInfo); + if (!(nRes & ScRefFlags::VALID)) { // Not a reference string. Pass it through unmodified. ScGlobal::OpenURL(aUrl, aTarget); @@ -2478,7 +2478,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) aBuf.append('#'); aBuf.append(aExtInfo.maTabName); aBuf.append('.'); - OUString aRefCalcA1(aTempAddr.Format(SCA_ABS, nullptr, formula::FormulaGrammar::CONV_OOO)); + OUString aRefCalcA1(aTempAddr.Format(ScRefFlags::ADDR_ABS, nullptr, formula::FormulaGrammar::CONV_OOO)); aBuf.append(aRefCalcA1); ScGlobal::OpenURL(aBuf.makeStringAndClear(), aTarget); } @@ -2486,7 +2486,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) { // Internal reference. aBuf.append('#'); - OUString aUrlCalcA1(aTempAddr.Format(SCA_ABS_3D, pDoc, formula::FormulaGrammar::CONV_OOO)); + OUString aUrlCalcA1(aTempAddr.Format(ScRefFlags::ADDR_ABS_3D, pDoc, formula::FormulaGrammar::CONV_OOO)); aBuf.append(aUrlCalcA1); ScGlobal::OpenURL(aBuf.makeStringAndClear(), aTarget); } @@ -2545,7 +2545,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) { ScRange aScRange; rMark.GetMarkArea( aScRange ); - aAddr = aScRange.Format(SCR_ABS); + aAddr = aScRange.Format(ScRefFlags::RANGE_ABS); if ( aScRange.aStart == aScRange.aEnd ) { // make sure there is a range selection string even for a single cell @@ -2558,7 +2558,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) else // only move cursor { ScAddress aScAddress( pViewData->GetCurX(), pViewData->GetCurY(), 0 ); - aAddr = aScAddress.Format(SCA_ABS); + aAddr = aScAddress.Format(ScRefFlags::ADDR_ABS); } SfxStringItem aPosItem( SID_CURRENTCELL, aAddr ); @@ -4227,7 +4227,7 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos OUString aChartName; if (pThisDoc->HasChartAtPoint( nThisTab, rLogicPos, aChartName )) { - OUString aRangeName(aSource.Format(SCR_ABS_3D, pThisDoc)); + OUString aRangeName(aSource.Format(ScRefFlags::RANGE_ABS_3D, pThisDoc)); SfxStringItem aNameItem( SID_CHART_NAME, aChartName ); SfxStringItem aRangeItem( SID_CHART_SOURCE, aRangeName ); sal_uInt16 nId = bIsMove ? SID_CHART_SOURCE : SID_CHART_ADDSOURCE; @@ -4413,7 +4413,7 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos { OUString aApp = Application::GetAppName(); OUString aTopic = pSourceSh->GetTitle( SFX_TITLE_FULLNAME ); - OUString aItem(aSource.Format(SCA_VALID | SCA_TAB_3D, pSourceDoc)); + OUString aItem(aSource.Format(ScRefFlags::VALID | ScRefFlags::TAB_3D, pSourceDoc)); // TODO: we could define ocQuote for " const OUString aQuote('"'); |