summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/addruno.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/unoobj/addruno.cxx
parentdc519b6dea7653e4b68b45aa664e3c0b5189d682 (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/unoobj/addruno.cxx')
-rw-r--r--sc/source/ui/unoobj/addruno.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/sc/source/ui/unoobj/addruno.cxx b/sc/source/ui/unoobj/addruno.cxx
index 1e90822bd0df..e31d80c3627a 100644
--- a/sc/source/ui/unoobj/addruno.cxx
+++ b/sc/source/ui/unoobj/addruno.cxx
@@ -66,12 +66,12 @@ bool ScAddressConversionObj::ParseUIString( const OUString& rUIString, ::formula
bool bSuccess = false;
if ( bIsRange )
{
- sal_uInt16 nResult = aRange.ParseAny( rUIString, &rDoc, eConv );
- if ( nResult & SCA_VALID )
+ ScRefFlags nResult = aRange.ParseAny( rUIString, &rDoc, eConv );
+ if ( nResult & ScRefFlags::VALID )
{
- if ( ( nResult & SCA_TAB_3D ) == 0 )
+ if ( ( nResult & ScRefFlags::TAB_3D ) == ScRefFlags::ZERO )
aRange.aStart.SetTab( static_cast<SCTAB>(nRefSheet) );
- if ( ( nResult & SCA_TAB2_3D ) == 0 )
+ if ( ( nResult & ScRefFlags::TAB2_3D ) == ScRefFlags::ZERO )
aRange.aEnd.SetTab( aRange.aStart.Tab() );
// different sheets are not supported in CellRangeAddress
if ( aRange.aStart.Tab() == aRange.aEnd.Tab() )
@@ -80,10 +80,10 @@ bool ScAddressConversionObj::ParseUIString( const OUString& rUIString, ::formula
}
else
{
- sal_uInt16 nResult = aRange.aStart.Parse( rUIString, &rDoc, eConv );
- if ( nResult & SCA_VALID )
+ ScRefFlags nResult = aRange.aStart.Parse( rUIString, &rDoc, eConv );
+ if ( nResult & ScRefFlags::VALID )
{
- if ( ( nResult & SCA_TAB_3D ) == 0 )
+ if ( ( nResult & ScRefFlags::TAB_3D ) == ScRefFlags::ZERO )
aRange.aStart.SetTab( static_cast<SCTAB>(nRefSheet) );
bSuccess = true;
}
@@ -251,9 +251,9 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const OUString& aPro
{
// generate UI representation string - include sheet only if different from ref sheet
OUString aFormatStr;
- sal_uInt16 nFlags = SCA_VALID;
+ ScRefFlags nFlags = ScRefFlags::VALID;
if ( aRange.aStart.Tab() != nRefSheet )
- nFlags |= SCA_TAB_3D;
+ nFlags |= ScRefFlags::TAB_3D;
if ( bIsRange )
aFormatStr = aRange.Format(nFlags, &rDoc);
else
@@ -266,14 +266,14 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const OUString& aPro
::formula::FormulaGrammar::CONV_XL_A1 : ::formula::FormulaGrammar::CONV_OOO;
// generate file format string - always include sheet
- OUString aFormatStr(aRange.aStart.Format(SCA_VALID | SCA_TAB_3D, &rDoc, eConv));
+ OUString aFormatStr(aRange.aStart.Format(ScRefFlags::VALID | ScRefFlags::TAB_3D, &rDoc, eConv));
if ( bIsRange )
{
// manually concatenate range so both parts always have the sheet name
aFormatStr += ":";
- sal_uInt16 nFlags = SCA_VALID;
+ ScRefFlags nFlags = ScRefFlags::VALID;
if( eConv != ::formula::FormulaGrammar::CONV_XL_A1 )
- nFlags |= SCA_TAB_3D;
+ nFlags |= ScRefFlags::TAB_3D;
OUString aSecond(aRange.aEnd.Format(nFlags, &rDoc, eConv));
aFormatStr += aSecond ;
}