summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-09-28 10:01:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-09-28 13:47:28 +0200
commite75a545f2869a4406bb434c356d481745f000271 (patch)
tree5f7b64b1c21096a98c18c47e4df855a58572be8a /starmath
parentc1e31ee0433232104c73cfa56e24e056833213dc (diff)
loplugin:constmethod in sdext..starmath
Change-Id: Ib1b60382c9ec62f35f0f232c3f2c2d5664ea669e Reviewed-on: https://gerrit.libreoffice.org/79779 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/inc/cursor.hxx2
-rw-r--r--starmath/inc/document.hxx8
-rw-r--r--starmath/inc/visitors.hxx2
-rw-r--r--starmath/source/cursor.cxx4
-rw-r--r--starmath/source/document.cxx2
-rw-r--r--starmath/source/mathmlexport.hxx2
-rw-r--r--starmath/source/mathmlimport.hxx4
7 files changed, 12 insertions, 12 deletions
diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx
index 2ba17fb0a46c..14897656c0a3 100644
--- a/starmath/inc/cursor.hxx
+++ b/starmath/inc/cursor.hxx
@@ -83,7 +83,7 @@ public:
const SmCaretPos& GetPosition() const { return mpPosition->CaretPos; }
/** True, if the cursor has a selection */
- bool HasSelection() { return mpAnchor != mpPosition; }
+ bool HasSelection() const { return mpAnchor != mpPosition; }
/** Move the position of this cursor */
void Move(OutputDevice* pDev, SmMovementDirection direction, bool bMoveAnchor = true);
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx
index c192ef2fc655..dd1f540a3fe3 100644
--- a/starmath/inc/document.hxx
+++ b/starmath/inc/document.hxx
@@ -157,7 +157,7 @@ public:
//Access for the View. This access is not for the OLE-case!
//and for the communication with the SFX!
//All internal printer uses should work with the SmPrinterAccess only
- bool HasPrinter() { return mpPrinter != nullptr; }
+ bool HasPrinter() const { return mpPrinter != nullptr; }
SfxPrinter *GetPrinter() { GetPrt(); return mpPrinter; }
void SetPrinter( SfxPrinter * );
@@ -168,9 +168,9 @@ public:
void UpdateText();
void SetText(const OUString& rBuffer);
- const OUString& GetText() { return maText; }
+ const OUString& GetText() const { return maText; }
void SetFormat(SmFormat const & rFormat);
- const SmFormat& GetFormat() { return maFormat; }
+ const SmFormat& GetFormat() const { return maFormat; }
void Parse();
SmParser & GetParser() { return maParser; }
@@ -205,7 +205,7 @@ public:
/** True, if cursor have previously been requested and thus
* has some sort of position.
*/
- bool HasCursor();
+ bool HasCursor() const;
void writeFormulaOoxml(const ::sax_fastparser::FSHelperPtr& pSerializer,
oox::core::OoxmlVersion version,
diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx
index 39f5c6323064..e90e3e187a40 100644
--- a/starmath/inc/visitors.hxx
+++ b/starmath/inc/visitors.hxx
@@ -141,7 +141,7 @@ public:
virtual ~SmCaretPos2LineVisitor() {}
void Visit( SmTextNode* pNode ) override;
using SmDefaultingVisitor::Visit;
- const SmCaretLine& GetResult( ) {
+ const SmCaretLine& GetResult( ) const {
return maLine;
}
private:
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index b6575b8655b3..c7a1ba31e90e 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -40,7 +40,7 @@ void SmCursor::Move(OutputDevice* pDev, SmMovementDirection direction, bool bMov
best_line, //Best approximated line found so far
curr_line; //Current line
long dbp_sq = 0; //Distance squared to best line
- for(auto &pEntry : *mpGraph)
+ for(const auto &pEntry : *mpGraph)
{
//Reject it if it's the current position
if(pEntry->CaretPos == mpPosition->CaretPos) continue;
@@ -84,7 +84,7 @@ void SmCursor::MoveTo(OutputDevice* pDev, const Point& pos, bool bMoveAnchor)
SmCaretPosGraphEntry* NewPos = nullptr;
long dp_sq = 0, //Distance to current line squared
dbp_sq = 1; //Distance to best line squared
- for(auto &pEntry : *mpGraph)
+ for(const auto &pEntry : *mpGraph)
{
OSL_ENSURE(pEntry->CaretPos.IsValid(), "The caret position graph may not have invalid positions!");
//Compute current line
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index b3c7c512e3b0..62f0e0fc04fd 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -468,7 +468,7 @@ SmCursor& SmDocShell::GetCursor(){
return *mpCursor;
}
-bool SmDocShell::HasCursor() { return mpCursor != nullptr; }
+bool SmDocShell::HasCursor() const { return mpCursor != nullptr; }
SmPrinterAccess::SmPrinterAccess( SmDocShell &rDocShell )
{
diff --git a/starmath/source/mathmlexport.hxx b/starmath/source/mathmlexport.hxx
index ba7abf51d0ce..72ce800ad3af 100644
--- a/starmath/source/mathmlexport.hxx
+++ b/starmath/source/mathmlexport.hxx
@@ -107,7 +107,7 @@ public:
virtual void GetViewSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps) override;
virtual void GetConfigurationSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps) override;
- bool GetSuccess() {return bSuccess;}
+ bool GetSuccess() const {return bSuccess;}
};
diff --git a/starmath/source/mathmlimport.hxx b/starmath/source/mathmlimport.hxx
index c9a2f9d1f17c..2357c9f09bf9 100644
--- a/starmath/source/mathmlimport.hxx
+++ b/starmath/source/mathmlimport.hxx
@@ -180,8 +180,8 @@ public:
SmNodeStack & GetNodeStack() { return aNodeStack; }
- bool GetSuccess() { return bSuccess; }
- [[nodiscard]] const OUString& GetText() { return aText; }
+ bool GetSuccess() const { return bSuccess; }
+ [[nodiscard]] const OUString& GetText() const { return aText; }
void SetText(const OUString &rStr) { aText = rStr; }
virtual void SetViewSettings(const css::uno::Sequence<css::beans::PropertyValue>& aViewProps) override;