summaryrefslogtreecommitdiff
path: root/sc/source/ui/Accessibility
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-11 10:46:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-15 07:56:12 +0200
commitfb1d3b580763a333bbbfe115d09e1b5cd8849675 (patch)
tree93cf0598c86ba188f69ab30425ffea856ea9886b /sc/source/ui/Accessibility
parent40bc840da261fcc5652e5278dc2566b61f990884 (diff)
loplugin:constfields in sc
Change-Id: If326175d571d15752efd1b63df45b2bc785f7541 Reviewed-on: https://gerrit.libreoffice.org/61653 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/Accessibility')
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx29
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx12
-rw-r--r--sc/source/ui/Accessibility/AccessibleFilterMenu.cxx2
3 files changed, 22 insertions, 21 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index ace156f82e9a..6966e9ac9428 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -110,13 +110,9 @@ ScAccessibleShapeData::~ScAccessibleShapeData()
struct ScShapeDataLess
{
- OUString msLayerId;
- OUString msZOrder;
- ScShapeDataLess()
- : msLayerId( "LayerID" ),
- msZOrder( "ZOrder" )
- {
- }
+ static constexpr OUStringLiteral gsLayerId = "LayerID";
+ static constexpr OUStringLiteral gsZOrder = "ZOrder";
+
static void ConvertLayerId(sal_Int16& rLayerID) // changes the number of the LayerId so it the accessibility order
{
// note: MSVC 2017 ICE's if this is written as "switch" so use "if"
@@ -137,13 +133,13 @@ struct ScShapeDataLess
rLayerID = 3;
}
}
- bool LessThanSheet(const ScAccessibleShapeData* pData) const
+ static bool LessThanSheet(const ScAccessibleShapeData* pData)
{
bool bResult(false);
uno::Reference< beans::XPropertySet> xProps(pData->xShape, uno::UNO_QUERY);
if (xProps.is())
{
- uno::Any aPropAny = xProps->getPropertyValue(msLayerId);
+ uno::Any aPropAny = xProps->getPropertyValue(gsLayerId);
sal_Int16 nLayerID = 0;
if( aPropAny >>= nLayerID )
{
@@ -162,17 +158,17 @@ struct ScShapeDataLess
uno::Reference< beans::XPropertySet> xProps2(pData2->xShape, uno::UNO_QUERY);
if (xProps1.is() && xProps2.is())
{
- uno::Any aPropAny1 = xProps1->getPropertyValue(msLayerId);
- uno::Any aPropAny2 = xProps2->getPropertyValue(msLayerId);
+ uno::Any aPropAny1 = xProps1->getPropertyValue(gsLayerId);
+ uno::Any aPropAny2 = xProps2->getPropertyValue(gsLayerId);
sal_Int16 nLayerID1(0);
sal_Int16 nLayerID2(0);
if( (aPropAny1 >>= nLayerID1) && (aPropAny2 >>= nLayerID2) )
{
if (nLayerID1 == nLayerID2)
{
- uno::Any aAny1 = xProps1->getPropertyValue(msZOrder);
+ uno::Any aAny1 = xProps1->getPropertyValue(gsZOrder);
sal_Int32 nZOrder1 = 0;
- uno::Any aAny2 = xProps2->getPropertyValue(msZOrder);
+ uno::Any aAny2 = xProps2->getPropertyValue(gsZOrder);
sal_Int32 nZOrder2 = 0;
if ( (aAny1 >>= nZOrder1) && (aAny2 >>= nZOrder2) )
bResult = (nZOrder1 < nZOrder2);
@@ -196,6 +192,11 @@ struct ScShapeDataLess
}
};
+#if !HAVE_CPP_INLINE_VARIABLES
+constexpr OUStringLiteral ScShapeDataLess::gsLayerId;
+constexpr OUStringLiteral ScShapeDataLess::gsZOrder;
+#endif
+
struct DeselectShape
{
void operator() (const ScAccessibleShapeData* pAccShapeData) const
@@ -297,7 +298,7 @@ private:
mutable sal_uInt32 mnShapesSelected;
ScTabViewShell* mpViewShell;
ScAccessibleDocument* mpAccessibleDocument;
- ScSplitPos meSplitPos;
+ ScSplitPos const meSplitPos;
void FillShapes(std::vector < uno::Reference < drawing::XShape > >& rShapes) const;
bool FindSelectedShapesChanges(const css::uno::Reference<css::drawing::XShapes>& xShapes) const;
diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index 84cdfe7df845..8fe872f73da4 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -97,7 +97,7 @@ public:
private:
ScPreviewShell* mpViewShell;
- ScAccessibleDocumentPagePreview* mpAccDoc;
+ ScAccessibleDocumentPagePreview* const mpAccDoc;
typedef std::vector<ScAccNote> ScAccNotes;
mutable ScAccNotes maNotes;
mutable ScAccNotes maMarks;
@@ -258,7 +258,7 @@ uno::Reference<XAccessible> ScNotesChildren::GetChild(sal_Int32 nIndex) const
struct ScPointFound
{
- tools::Rectangle maPoint;
+ tools::Rectangle const maPoint;
sal_Int32 mnParagraphs;
explicit ScPointFound(const Point& rPoint) : maPoint(rPoint, Size(0, 0)), mnParagraphs(0) {}
bool operator() (const ScAccNote& rNote)
@@ -416,7 +416,7 @@ sal_Int32 ScNotesChildren::CheckChanges(const ScPreviewLocationData& rData,
struct ScChildGone
{
- ScAccessibleDocumentPagePreview* mpAccDoc;
+ ScAccessibleDocumentPagePreview* const mpAccDoc;
explicit ScChildGone(ScAccessibleDocumentPagePreview* pAccDoc) : mpAccDoc(pAccDoc) {}
void operator() (const uno::Reference<XAccessible>& xAccessible) const
{
@@ -434,7 +434,7 @@ struct ScChildGone
struct ScChildNew
{
- ScAccessibleDocumentPagePreview* mpAccDoc;
+ ScAccessibleDocumentPagePreview* const mpAccDoc;
explicit ScChildNew(ScAccessibleDocumentPagePreview* pAccDoc) : mpAccDoc(pAccDoc) {}
void operator() (const uno::Reference<XAccessible>& xAccessible) const
{
@@ -635,7 +635,7 @@ public:
void SetDrawBroadcaster();
private:
- ScAccessibleDocumentPagePreview* mpAccDoc;
+ ScAccessibleDocumentPagePreview* const mpAccDoc;
ScPreviewShell* mpViewShell;
ScShapeRangeVec maShapeRanges;
@@ -927,7 +927,7 @@ uno::Reference<XAccessible> ScShapeChildren::GetControl(sal_Int32 nIndex) const
struct ScShapePointFound
{
- Point maPoint;
+ Point const maPoint;
explicit ScShapePointFound(const awt::Point& rPoint) : maPoint(VCLPoint(rPoint)) {}
bool operator() (const ScShapeChild& rShape)
{
diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx
index 79de53138b64..2edec7eb6391 100644
--- a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx
+++ b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx
@@ -72,7 +72,7 @@ public:
}
private:
Reference<XAccessibleEventListener> mxListener;
- bool mbAdd;
+ bool const mbAdd;
};
}