summaryrefslogtreecommitdiffstats
path: root/sc/source/ui/view/tabvwsh3.cxx
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-03-09 15:23:11 +0100
committerEike Rathke <erack@redhat.com>2016-03-12 00:21:29 +0000
commit51d0b4037b36a4a74c9181b95edb18017542ab79 (patch)
treec13c5ac4782888e1640ee60911d68329018dcc05 /sc/source/ui/view/tabvwsh3.cxx
parentFix .NET detection on 32bit platform (diff)
downloadcore-51d0b4037b36a4a74c9181b95edb18017542ab79.tar.gz
core-51d0b4037b36a4a74c9181b95edb18017542ab79.zip
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/tabvwsh3.cxx')
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx40
1 files changed, 20 insertions, 20 deletions
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 4ea02a9fde79..7b43c896ce09 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -69,44 +69,44 @@
#include <memory>
-static sal_uInt16 lcl_ParseRange(ScRange& rScRange, const OUString& aAddress, ScDocument* pDoc, sal_uInt16 /* nSlot */)
+static ScRefFlags lcl_ParseRange(ScRange& rScRange, const OUString& aAddress, ScDocument* pDoc, sal_uInt16 /* nSlot */)
{
// start with the address convention set in the document
formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
- sal_uInt16 nResult = rScRange.Parse(aAddress, pDoc, eConv);
- if ( (nResult & SCA_VALID) )
+ ScRefFlags nResult = rScRange.Parse(aAddress, pDoc, eConv);
+ if ( nResult & ScRefFlags::VALID )
return nResult;
// try the default Calc (A1) address convention
nResult = rScRange.Parse(aAddress, pDoc);
- if ( (nResult & SCA_VALID) )
+ if ( nResult & ScRefFlags::VALID )
return nResult;
// try the Excel A1 address convention
nResult = rScRange.Parse(aAddress, pDoc, formula::FormulaGrammar::CONV_XL_A1);
- if ( (nResult & SCA_VALID) )
+ if ( nResult & ScRefFlags::VALID )
return nResult;
// try Excel R1C1 address convention
return rScRange.Parse(aAddress, pDoc, formula::FormulaGrammar::CONV_XL_R1C1);
}
-static sal_uInt16 lcl_ParseAddress(ScAddress& rScAddress, const OUString& aAddress, ScDocument* pDoc, sal_uInt16 /* nSlot */)
+static ScRefFlags lcl_ParseAddress(ScAddress& rScAddress, const OUString& aAddress, ScDocument* pDoc, sal_uInt16 /* nSlot */)
{
// start with the address convention set in the document
formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
- sal_uInt16 nResult = rScAddress.Parse(aAddress, pDoc, eConv);
- if ( (nResult & SCA_VALID) )
+ ScRefFlags nResult = rScAddress.Parse(aAddress, pDoc, eConv);
+ if ( nResult & ScRefFlags::VALID )
return nResult;
// try the default Calc (A1) address convention
nResult = rScAddress.Parse(aAddress, pDoc);
- if ( (nResult & SCA_VALID) )
+ if ( nResult & ScRefFlags::VALID )
return nResult;
// try the Excel A1 address convention
nResult = rScAddress.Parse(aAddress, pDoc, formula::FormulaGrammar::CONV_XL_A1);
- if ( (nResult & SCA_VALID) )
+ if ( nResult & ScRefFlags::VALID )
return nResult;
// try Excel R1C1 address convention
@@ -278,14 +278,14 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
ScMarkData& rMark = rViewData.GetMarkData();
ScRange aScRange;
ScAddress aScAddress;
- sal_uInt16 nResult = lcl_ParseRange(aScRange, aAddress, pDoc, nSlot);
+ ScRefFlags nResult = lcl_ParseRange(aScRange, aAddress, pDoc, nSlot);
SCTAB nTab = rViewData.GetTabNo();
bool bMark = true;
// Is this a range ?
- if( nResult & SCA_VALID )
+ if( nResult & ScRefFlags::VALID )
{
- if ( nResult & SCA_TAB_3D )
+ if ( nResult & ScRefFlags::TAB_3D )
{
if( aScRange.aStart.Tab() != nTab )
SetTabNo( nTab = aScRange.aStart.Tab() );
@@ -297,9 +297,9 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
}
}
// Is this a cell ?
- else if ( (nResult = lcl_ParseAddress(aScAddress, aAddress, pDoc, nSlot)) & SCA_VALID )
+ else if ( (nResult = lcl_ParseAddress(aScAddress, aAddress, pDoc, nSlot)) & ScRefFlags::VALID )
{
- if ( nResult & SCA_TAB_3D )
+ if ( nResult & ScRefFlags::TAB_3D )
{
if( aScAddress.Tab() != nTab )
SetTabNo( nTab = aScAddress.Tab() );
@@ -319,13 +319,13 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
if( ScRangeUtil::MakeRangeFromName( aAddress, pDoc, nTab, aScRange, RUTL_NAMES, eConv ) ||
ScRangeUtil::MakeRangeFromName( aAddress, pDoc, nTab, aScRange, RUTL_DBASE, eConv ) )
{
- nResult |= SCA_VALID;
+ nResult |= ScRefFlags::VALID;
if( aScRange.aStart.Tab() != nTab )
SetTabNo( nTab = aScRange.aStart.Tab() );
}
}
- if ( !(nResult & SCA_VALID) && comphelper::string::isdigitAsciiString(aAddress) )
+ if ( !(nResult & ScRefFlags::VALID) && comphelper::string::isdigitAsciiString(aAddress) )
{
sal_Int32 nNumeric = aAddress.toInt32();
if ( nNumeric > 0 && nNumeric <= MAXROW+1 )
@@ -337,15 +337,15 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
aScAddress.SetTab( nTab );
aScRange = ScRange( aScAddress, aScAddress );
bMark = false;
- nResult = SCA_VALID;
+ nResult = ScRefFlags::VALID;
}
}
if ( !ValidRow(aScRange.aStart.Row()) || !ValidRow(aScRange.aEnd.Row()) )
- nResult = 0;
+ nResult = ScRefFlags::ZERO;
// we have found something
- if( nResult & SCA_VALID )
+ if( nResult & ScRefFlags::VALID )
{
bFound = true;
SCCOL nCol = aScRange.aStart.Col();