summaryrefslogtreecommitdiff
path: root/starmath/source/cursor.cxx
AgeCommit message (Collapse)Author
2017-06-27loplugin:oncevar in starmath..svlNoel Grandin
Change-Id: I20e3796407c7e429a88d2811673929ac1141a41c Reviewed-on: https://gerrit.libreoffice.org/39280 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-18loplugin:unusedmethodsNoel Grandin
Change-Id: I1c50d176e793397a1f9625f797a3750cf191a61c Reviewed-on: https://gerrit.libreoffice.org/37679 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-02untranslated strings are just stringsCaolán McNamara
removes starmaths InsertCommand in favour of InsertCommandText Change-Id: I5659adcaa28e5b5861d1a1cc5d2afa84009490f6 Reviewed-on: https://gerrit.libreoffice.org/37113 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-27starmath: Convert SmScaleMode to scoped enumTakeshi Abe
Change-Id: I88024e9cc1147cc44a087315968c3462ab5baf73 Reviewed-on: https://gerrit.libreoffice.org/36978 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2017-04-25tools: svstream.hxx needs only errcode.hxx & not errinf.hxxChris Sherlock
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca Reviewed-on: https://gerrit.libreoffice.org/36896 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-18starmath: Convert SmNodeType to scoped enumTakeshi Abe
Change-Id: I30921f9426e0e50ab8c6dfb1e86400847176b707 Reviewed-on: https://gerrit.libreoffice.org/36613 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2017-04-14starmath: size() > 0 -> !empty()Takeshi Abe
Change-Id: Id7c73870f58ebf04c2703cdf8b3d0ffe258b2c0d Reviewed-on: https://gerrit.libreoffice.org/36545 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2017-03-25Fix typosAndrea Gelmini
Change-Id: I4eda687db6ad8d41e6a28430c76b288510da605d Reviewed-on: https://gerrit.libreoffice.org/35645 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-02-21loplugin:subtlezeroinit: starmathStephan Bergmann
Change-Id: Ifc6f4788bb285e28451df9c98a72b454b7685160
2017-02-15convert SmBracketType to scoped enumNoel Grandin
and drop unused enumerators Change-Id: Icda3ff510331f9f0adb97d6dac56edf325d0d1a7
2016-12-26starmath: Prefix n to SmCaretPos's IndexTakeshi Abe
Change-Id: Ie1647d8143c4c38ebcf5111bffc291c26704c4c0 Reviewed-on: https://gerrit.libreoffice.org/32428 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2016-11-15tdf#76296 Import MathML's <mspace>Takeshi Abe
as possibly multiple "~" and/or "`" by honoring its width attribute. Change-Id: I17e361c3f8f5d061c856b72266332369497d16b9 Reviewed-on: https://gerrit.libreoffice.org/30809 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2016-09-06starmath: Drop unused 1st argument of SmErrorNode's ctorTakeshi Abe
Change-Id: I01d8fa4bcfbfd4757230ff54902967f709216111 Reviewed-on: https://gerrit.libreoffice.org/28678 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-08-31Replace use of our own SmNodeIterator with range-based for loopTakeshi Abe
in starmath/source/cursor.cxx and starmath/qa/cppunit/mock-visitor.hxx. Change-Id: I7733d5d17bb03532d6c4f1d6967c69d65bc3bede Reviewed-on: https://gerrit.libreoffice.org/28538 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2016-08-24SmCursor::FindTopMostNodeInLine() requires non-null argumentTakeshi Abe
Change-Id: I3643c8a299276d7f3568747e6428ced4c8a6e2bf Reviewed-on: https://gerrit.libreoffice.org/28345 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2016-08-22starmath: Do SmCursor::MoveTo() more simplyTakeshi Abe
... without unnecessary copy and re-calculation of squared distances. Change-Id: I2900f8ef690cae750be036dcb3c4270c82286a4c
2016-08-18starmath: Use SmCaretPos::GetPosAfter()Takeshi Abe
Change-Id: Ie05354f9e359b9dbc10f9d8ee8a9579c67ec5e5f Reviewed-on: https://gerrit.libreoffice.org/28185 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-08-17starmath: Avoid assigned but unused valueTakeshi Abe
Change-Id: I3d8ede40e2231e3b88c43b17e353ea962e02acc7
2016-07-25new loplugin overrideparamNoel Grandin
verify that parameters on override methods have the same set of default values for their params as their parent/super-methods do. Change-Id: Ibdbc1c6e417fbaa680ea025a6bbf5ba9c2e5bcd2 Reviewed-on: https://gerrit.libreoffice.org/27437 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-07-22starmath: Return early if the cursor locates after a text nodeTakeshi Abe
No longer create unnecessary copy of nodes. Change-Id: Icf8cdd3ce0f9ebbf7159e9e7eaea7abe52c05060 Reviewed-on: https://gerrit.libreoffice.org/27366 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2016-07-15starmath: Make AdjustFontDesc() precede Prepare()Takeshi Abe
because what Prepare() does depends on both nFontDesc and token of the SmTextNode. Change-Id: Ib7f8c408eb8f95a10f27ccbd3d80cdd0d6ea6d56 Reviewed-on: https://gerrit.libreoffice.org/27210 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2016-07-11starmath: Prefer assert to SAL_WARN hereTakeshi Abe
as defined enum cases are exhausted. Change-Id: I6564cc0cd64d593f6aa02f0651ecb490bf7845bd Reviewed-on: https://gerrit.libreoffice.org/27081 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2016-06-10Pass it by const refTakeshi Abe
Change-Id: I0c2b48a503e2501210af690f02858dade994a733 Reviewed-on: https://gerrit.libreoffice.org/26048 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2016-06-03Null pointer dereferences must not happenTakeshi Abe
This is a follow-up of 09981cd6383ecb99e4b6c83b98b03af5cf3ff59b. Inspired by coverity#1362478 etc. Change-Id: If5507c52552393cccbb255cbf4b7e9f4b80db917 Reviewed-on: https://gerrit.libreoffice.org/25840 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-06-02coverity#1362478 Explicit null dereferencedCaolán McNamara
and coverity#1362479, coverity#1362480, coverity#1362481, coverity#1362482, coverity#1362483, coverity#1362485 Change-Id: Ia3a32b69bcbe5ac3e7cc50dacfa02e8bf1aab787
2016-05-31Use std::vector for SmCaretPosGraphTakeshi Abe
instead of employing ad hoc linked list and its iterator. Change-Id: Ibc4709a2e67aa805cf54117303c47d9a8a5eede9 Reviewed-on: https://gerrit.libreoffice.org/25699 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-05-31Prefix SmDocShell's membersTakeshi Abe
as well as remaning aInterpreter to maParser. Change-Id: I5f86737ffe05be981477e9dc65d433de0e1d5378 Reviewed-on: https://gerrit.libreoffice.org/25650 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2016-05-26starmath: nodes in the clipboard are owened by SmClipboardTakeshi Abe
This also omits the bIsOnlyIfSelected parameter for former CloneLineToList(), which was true at its sole call site. Change-Id: Idb71323f68f13ecc90d430ec8e18e0eef766ae4b Reviewed-on: https://gerrit.libreoffice.org/25444 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2016-05-24starmath: Fix missing call of AnnotationSelection() for SmCursor::CopyTakeshi Abe
... with unit tests of Copy/Cut/Paste. Change-Id: I74dd6f235b52ef2c1388ea0d15d32af0fb30b2c8 Reviewed-on: https://gerrit.libreoffice.org/25362 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2016-05-23starmath: This should be an assert()Takeshi Abe
Change-Id: Ia8dd75512168fd0775a8019fc514627a7353b056 Reviewed-on: https://gerrit.libreoffice.org/25231 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2016-05-17convert TG constants to scoped enumNoel Grandin
Change-Id: Ide719e8bb0d5aacc8d5da18f385b6373c7e48184 Reviewed-on: https://gerrit.libreoffice.org/24973 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2016-05-02Fix typoTakeshi Abe
Change-Id: Ib8e891f3af7a9de87c54bc65be98d94a16545d71
2016-04-27starmath: Drop unnecessary castTakeshi Abe
Change-Id: Ia892100507de7365bcecfa0708f76931f84d797b Reviewed-on: https://gerrit.libreoffice.org/24389 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2016-04-26update loplugin stylepolice to check local pointers varsNoel Grandin
are actually pointer vars. Also convert from regex to normal code, so we can enable this plugin all the time. Change-Id: Ie36a25ecba61c18f99c77c77646d6459a443cbd1 Reviewed-on: https://gerrit.libreoffice.org/24391 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-23loplugin:constantparam in starmathNoel Grandin
Change-Id: I7a1b83ec51565f56b07ae77177e064c04f703d5f
2016-03-09starmath: Drop SmNode::FindIndexTakeshi Abe
Its sole usage can be replaced with SmNode::IndexOfSubNode. Change-Id: Icfd4a3fe846b585c5fa3f47e0768729aba66d73e Reviewed-on: https://gerrit.libreoffice.org/23064 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-03-01loplugin:unuseddefaultparam in starmathNoel Grandin
Change-Id: I740d931c0236c1a4d40013b458f249692695d6e5
2015-12-23starmath: Assert that a parent always finds its childTakeshi Abe
Change-Id: I6cb75e0d62141dba2809aaec62761cedd8c3257a Reviewed-on: https://gerrit.libreoffice.org/20733 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: Ife1eef04d905f12308b64b971176c2f045a1b268
2015-10-08starmath: Represent ownership by std::unique_ptrTakeshi Abe
Change-Id: I7ce39cbdc0199d3508e7d16d1ce0b78f8d8ca620 Reviewed-on: https://gerrit.libreoffice.org/19230 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-07starmath: Prefix members of SmCursorTakeshi Abe
Change-Id: Ib3407b5457f4d69294c95879455553dc013cc340 Reviewed-on: https://gerrit.libreoffice.org/19186 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-09-30Fix typosAndrea Gelmini
Change-Id: Ic3d2171521e308261c354d8f699b44b26c95f1ea Reviewed-on: https://gerrit.libreoffice.org/18978 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2015-08-20loplugin: defaultparamsNoel Grandin
Change-Id: Ibf0ea539d2a95073a12f84964759d9c7a94baa7b
2015-06-30Fix typosAndrea Gelmini
Change-Id: I1c5e4970d4e90bdea68a901294594104de5e189e Reviewed-on: https://gerrit.libreoffice.org/16582 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2015-06-16Fix typosAndrea Gelmini
Change-Id: Ieaf67cf597e05dbae5affa153af907fda4462a41 Reviewed-on: https://gerrit.libreoffice.org/16295 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-04-10convert SfxObjectCreateMode to scoped enumNoel Grandin
and fix some dodgy usage in /sc in the process Change-Id: Ia2bee267df31aba431fc8cb81195bb83e5b64deb
2015-02-21Various typosJulien Nabet
Change-Id: I61d6a92e5301e07c9180d94dafec23ef1a06e0ef
2015-02-11coverity#1267649 Logically dead codeCaolán McNamara
and coverity#1267645 Logically dead code coverity#1267651 Logically dead code Change-Id: If92e17708576bf11cefc28f903a24ad271b826c8
2015-01-26coverity#1266461 Improper use of negative valueCaolán McNamara
Change-Id: I4f78617129de21f7088d6f0d8b781674faa6b45a
2014-12-03loplugin: cstylecastNoel Grandin
Change-Id: I759f55218538c8d39018626f14e78cd56341d44b