summaryrefslogtreecommitdiff
path: root/starmath/source/cursor.cxx
AgeCommit message (Collapse)Author
2020-10-23CreateTextFromNode is goneIlmari Lauhakangas
Change-Id: Ia5786a642a4eea57eef224ace384cb3f9da9fe75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104728 Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2020-10-22long->tools::Long in slideshow..starmathNoel
Change-Id: I18f5b7c5da513d386f8ac848835b0410ebc7d95b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104629 Reviewed-by: Dante DM <dante19031999@gmail.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-08starmath: stop change to caret pos graph when moving after braceLuke Dixon
Currently, the code that moves the cursor after the brace changes the current caret pos instead of moving to the next pos. Because of this, we end up with one missing graph pos and a duplicate graph pos. This can be seen by moving to the end of a brace body, pressing the key for the closing brace and then pressing left and right to move in and out of the brace. This fix uses the existing code that sets the cursor position to the next element in the graph instead of changing the cursor pos directly. It also marks the caret pos as const to suggest not changing the caret pos inside a graph entry. Change-Id: I5492e54f1bddbfc90036f29698982fd8696f5e88 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102214 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-02Fix crash when entering newline in starmath experimental editorLuke Dixon
Currently things crash when adding a newline using the experimental editor in Math Formula editor. It looks like this is happening because the newly inserted line was getting destroyed when the unique_ptr goes out of scope. This change releases the unique_ptr so it doesn't get destroyed. As it is now part of the tree it should be destroyed elsewhere. Change-Id: Icfe2c0289c12302d39883dc04cef0351467aa845 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101737 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-03loplugin:stringaddNoel Grandin
tweak the plugin to be more permissive, then validate by hand afterwards Change-Id: I40c5c911fe6ff7e45baaca372abf7dac211d9654 Reviewed-on: https://gerrit.libreoffice.org/81942 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-28loplugin:constmethod in sdext..starmathNoel Grandin
Change-Id: Ib1b60382c9ec62f35f0f232c3f2c2d5664ea669e Reviewed-on: https://gerrit.libreoffice.org/79779 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-20loplugin:constvars in solenv..svtoolsNoel Grandin
Change-Id: Ieb0116321bbddd804db6d1789ea3521c5b220840 Reviewed-on: https://gerrit.libreoffice.org/77807 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-16Fix typosAndrea Gelmini
Split from https://gerrit.libreoffice.org/#/c/76764/ Change-Id: I19f11f80f08ce0d5b4ffda20449f1cddea980b7d Reviewed-on: https://gerrit.libreoffice.org/77596 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-20cid#1448322 try silence Splice iterator mismatchCaolán McNamara
Change-Id: If419d66811e5a60d50575f7b984811a29785459a Reviewed-on: https://gerrit.libreoffice.org/76019 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-08tdf#42949 Fix IWYU warnings in include/sfx2/[t-z]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib3252828385d1dc8faf48a428b1593199647a679 Reviewed-on: https://gerrit.libreoffice.org/70383 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-10loplugin:indentation in soltools..svlNoel Grandin
Change-Id: I270a12cdb68920b8fa23b82dd933724e30334485 Reviewed-on: https://gerrit.libreoffice.org/67565 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-18use unique_ptr in starmathNoel Grandin
Change-Id: Ib9c555507d5271343424686f2321ae13efcbf41a Reviewed-on: https://gerrit.libreoffice.org/66550 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-30use unique_ptr in SmStructureNode::SetSubNodesNoel Grandin
Change-Id: I1dafb03f72a3a662eeae3bb23fb0a8b7ba4e6d95 Reviewed-on: https://gerrit.libreoffice.org/65734 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-29Simplify containers iterations in slideshow, sot, starmath, stocArkadiy Illarionov
Use range-based loop or replace with STL functions Change-Id: I94792c28b283a0998bf813317e5beb37d93e0c23 Reviewed-on: https://gerrit.libreoffice.org/64125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-13loplugin:useuniqeptr in starmathNoel Grandin
Change-Id: I2a62b63f17b7a9daf4d42f2e9d7272d3b78bdf7f Reviewed-on: https://gerrit.libreoffice.org/60408 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-18loplugin:useuniqueptr pass SmNodeList around by std::unique_ptr(2)Noel Grandin
Change-Id: I53b7f39ddc150367bc5f9c4a7ee7049d59e9f485 Reviewed-on: https://gerrit.libreoffice.org/59231 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-17loplugin:useuniqueptr pass SmNodeList around by std::unique_ptrNoel Grandin
Change-Id: I263a7afd23a38f68ee54ecb11f00bcfbdda30c64 Reviewed-on: https://gerrit.libreoffice.org/59230 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-15starmath: Prefer moving subnodes to copying themTakeshi Abe
Change-Id: Id92dd0715daf43a63d09529f01a6583c23de7c7d Reviewed-on: https://gerrit.libreoffice.org/49725 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2018-01-17starmath: Make SmParser::ParseExpression() return std::unique_ptrTakeshi Abe
Change-Id: Ib8b65dced2af3ac7dca3fe9dd02e70f02c865f79 Reviewed-on: https://gerrit.libreoffice.org/47974 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-10ofz#5221 depth protect PrepareCaolán McNamara
Change-Id: I49804a8c65b3af204bfd79d6ff5b3280ab876ec4 Reviewed-on: https://gerrit.libreoffice.org/47693 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-21ofz#4703 Direct-leakCaolán McNamara
Change-Id: I5f3385d87aa5a48a8df3b6774dd1166cec60ebf8 Reviewed-on: https://gerrit.libreoffice.org/46893 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-23loplugin:includeform: starmathStephan Bergmann
Change-Id: Ic5d81bdeb98024f41f9dfca260eca0359b27b809
2017-08-03loplugin:constparams in starmathNoel Grandin
Change-Id: Iac470b572311241216622f22bc543c0bd10a28f6 Reviewed-on: https://gerrit.libreoffice.org/40714 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-03starmath: cleanup includes with iwyuJochen Nitschke
Change-Id: I6de145f8b59d3ebcbc0cb32df3f955c9ee738eeb Reviewed-on: https://gerrit.libreoffice.org/40666 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-02remove unnecessary use of 'this->'Noel Grandin
Change-Id: I5c115389af7d24c18ddaf5fbec8c00f35017a5b4 Reviewed-on: https://gerrit.libreoffice.org/40671 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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