summaryrefslogtreecommitdiff
path: root/sc/source/ui/xmlsource
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/xmlsource
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/xmlsource')
-rw-r--r--sc/source/ui/xmlsource/xmlsourcedlg.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index a1a84d901110..433e31a4831f 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -146,7 +146,7 @@ void ScXMLSourceDlg::SetReference(const ScRange& rRange, ScDocument* pDoc)
if (rRange.aStart != rRange.aEnd)
RefInputStart(mpActiveEdit);
- OUString aStr(rRange.aStart.Format(SCA_ABS_3D, pDoc, pDoc->GetAddressConvention()));
+ OUString aStr(rRange.aStart.Format(ScRefFlags::ADDR_ABS_3D, pDoc, pDoc->GetAddressConvention()));
mpActiveEdit->SetRefString(aStr);
RefEditModified();
@@ -308,7 +308,7 @@ void ScXMLSourceDlg::TreeItemSelected()
const ScAddress& rPos = pUserData->maLinkedPos;
if (rPos.IsValid())
{
- OUString aStr(rPos.Format(SCA_ABS_3D, mpDoc, mpDoc->GetAddressConvention()));
+ OUString aStr(rPos.Format(ScRefFlags::ADDR_ABS_3D, mpDoc, mpDoc->GetAddressConvention()));
mpRefEdit->SetRefString(aStr);
}
else
@@ -618,8 +618,8 @@ void ScXMLSourceDlg::RefEditModified()
// Check if the address is valid.
ScAddress aLinkedPos;
- sal_uInt16 nRes = aLinkedPos.Parse(aRefStr, mpDoc, mpDoc->GetAddressConvention());
- bool bValid = (nRes & SCA_VALID) == SCA_VALID;
+ ScRefFlags nRes = aLinkedPos.Parse(aRefStr, mpDoc, mpDoc->GetAddressConvention());
+ bool bValid = ( (nRes & ScRefFlags::VALID) == ScRefFlags::VALID );
// TODO: For some unknown reason, setting the ref invalid will hide the text altogether.
// Find out how to make this work.