summaryrefslogtreecommitdiff
path: root/starmath/source
AgeCommit message (Collapse)AuthorFilesLines
7 daysRemoved duplicated includesAndrea Gelmini1-1/+0
Change-Id: Ic981e0916c68181cab7081091303d18c54912377 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137912 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
9 daysclang-tidy modernize-pass-by-value in starmathNoel Grandin3-5/+8
Change-Id: Ib6bd1ed629980d4ff122114bc45396886c94ab78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137842 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-28lok: Properly update sidebar context in MathMike Kaganski1-31/+1
Change-Id: I830c0d9bdeaa6340283eafc3e91251d02602d7aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137247 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-07-28lok: Enable sidebar in MathMike Kaganski1-3/+36
Change-Id: I1554a924eef0bfcaffa893057a37ef45321a0cf7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137246 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-07-25Handle Ctrl+Z / Ctrl+Y in Math graphic window correctlyMike Kaganski1-0/+7
... instead of trying to insert a control character in the formula. Change-Id: Ifcf4d3ce1111a381cd29de310b041c08f7314cff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137402 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-07-25Some refactorMike Kaganski1-87/+82
Change-Id: I58f315e39e33a09585d6325590998ac8195687db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137401 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-07-22elide some makeStringAndClear() callsNoel Grandin2-3/+3
Change-Id: Iccdb04df53bc981e2240240daddf15e9e1bb5a16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137310 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-08[API CHANGE] Drop css::accessibility::XAccessibleStateSetNoel Grandin2-14/+12
which is internal API, unused (as far as I can tell) by external users. This state is purely a bitset (as implemented by utl::AccessibleStateSetHelper) so we can just return it as a 64-bit value. This shaves significant time off the performance profiles of code that loads very complex shapes, because this state is frequently used, and we no longer need to allocate a return value on the heap for every call. Change-Id: Icf1b3bd367c256646ae9015f9127025f59459c2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136786 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-19cid#1506514 Uninitialized scalar fieldCaolán McNamara1-2/+5
Change-Id: I777d9008289b2afb464d1002e8be32072c0a4501 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136099 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-06-18cid#1504663 workaround Resource leak in objectCaolán McNamara2-47/+31
and cid#1504667 Resource leak in object take a simpler approach over an unordered_map Change-Id: Ie0736dcb0c8e7cdcd3b4b6bd303642841b590bf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136087 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-06-09Accessibility for IconViewMike Kaganski1-4/+2
Change-Id: I65ca9d43f70a50e2e95aabfc3b8ba1b15f9ff8be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135226 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-06-02Fix typoAndrea Gelmini1-1/+1
Change-Id: Ie7d5a2b2a6fceb09ffcb6b24a462dd6911886a1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135307 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-06-02Use IconView in SmElementsControlMike Kaganski7-1568/+103
Allows to send individual images over the wire in lok case, instead of sending full canvas at every scroll operation. The control's horizontal and vertical modes (when it's docked to a vertical or a horizontal parent window side) are now identical. Some TODOs: * Re-implement a11y - that needs to be implemented on IconView level; * Make sure that sub-pixel positioning is not used when creating the elements icons (makes elements look a bit slim on Windows); * Maybe restore mouse hover indication; in non-GTK case, a call to m_xIconView->SetHoverSelection would suffice in SalInstanceIconView. Change-Id: Idbc35f4e38e2b49fd0848a96da557fa2c1a1f6e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134761 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-26ofz#47639 avoid Integer-overflowCaolán McNamara1-0/+1
Change-Id: I3f89238187dfb8cfd7a929d5f5576b83f6ec37c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134982 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-25std::set->o3tl::sorted_vector in MathTypeFontSetNoel Grandin2-3/+4
Change-Id: I8b664f10bee232355eeb431de6b1445d9c797f6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134921 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-24modernize and improve PropertySetInfoNoel Grandin5-41/+35
(*) use o3tl::span for the array param, which means we don't need a null entry to terminate the array (*) use std::unordered_map to speed things up (*) mark the array as static at a few more call sites Change-Id: I05b6cae7552f44459e183ec05cb94e60edb3bfe0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134832 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-23elide some OUString allocationNoel Grandin1-4/+3
Change-Id: I5f0b9057b86ec98b66b4ce2d6c681b8cb93d49e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134802 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-23starmath: fix real use-after-free detected by GCC 12Michael Stahl1-1/+5
In file included from starmath/inc/mathml/iterator.hxx:12, from starmath/source/mathml/iterator.cxx:10: In member function ‘SmMlElement* SmMlElement::getParentElement()’, inlined from ‘void mathml::SmMlIteratorBottomToTop(SmMlElement*, runType, void*) [with runType = void (*)(SmMlElement*, void*)]’ at starmath/inc/mathml/iterator.hxx:43:39, inlined from ‘void mathml::SmMlIteratorFree(SmMlElement*)’ at starmath/source/mathml/iterator.cxx:57:28: starmath/inc/mathml/element.hxx:263:46: error: pointer ‘pCurrent’ used after ‘void operator delete(void*, std::size_t)’ [-Werror=use-after-free] 263 | SmMlElement* getParentElement() { return m_aParentElement; }; | ^~~~~~~~~~~~~~~~ In function ‘void mathml::deleteElement(SmMlElement*, void*)’, inlined from ‘void mathml::deleteElement(SmMlElement*, void*)’ at starmath/source/mathml/iterator.cxx:19:20, inlined from ‘void mathml::SmMlIteratorBottomToTop(SmMlElement*, runType, void*) [with runType = void (*)(SmMlElement*, void*)]’ at starmath/inc/mathml/iterator.hxx:65:21, inlined from ‘void mathml::SmMlIteratorFree(SmMlElement*)’ at starmath/source/mathml/iterator.cxx:57:28: starmath/source/mathml/iterator.cxx:19:77: note: call to ‘void operator delete(void*, std::size_t)’ here 19 | static inline void deleteElement(SmMlElement* aSmMlElement, void*) { delete aSmMlElement; } | ^~~~~~~~~~~~ Change-Id: I09acfe3f7e90bd7f919cfba161f72bdd7a8da70a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134742 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-21elide OUString allocationNoel Grandin1-1/+3
Change-Id: I45cc3b8df0c29237b69cab87f0fbb6853776394f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134701 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-20new loplugin:unnecessary lockingNoel Grandin1-3/+1
off by default, since each warning needs careful inspection Change-Id: I805c1d1cdde531a1afdc76e87b22f879fc3c9753 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134641 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-19Simplify SmElementsControlMike Kaganski2-338/+408
Change-Id: Idcb075a474b440447b8566cc92a8f65bbc77127c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134643 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-19the size table in MathType can be compile-time dataNoel Grandin2-11/+12
Change-Id: Ie0769509e38d3414bf227d8d2b7248461bc41aa6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134598 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-17Use structured binding to clarify the codeMike Kaganski1-4/+4
Change-Id: I6b1c0532a64a18d961b7ab112675213eea2fd121 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134438 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-17use reserve before filling some vectorsNoel Grandin1-0/+1
Change-Id: Ib2ae513de46b2a0c16101747540ba09a7cdfb018 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134481 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-17tdf#65067 Remove excessive spacing from Formula objectsRafael Lima1-1/+1
As described in bugs tdf#65067, tdf#103816, tdf#149052 and a few other duplicates, Formula objects in Writer receive 2 unnecessary spacings: 1) From the "Formula" frame style, which has a Left/Right internal spacing of 0.2cm 2) From the Math formula editor itself, that adds an additional 1pt of internal spacing (left/right) In MS Word the default behavior is setting all of these spaces to zero, which makes the formula flow better alongside text in paragraphs. Therefore, this patch set both of these spaces to Zero so that Formula objects in Writer behave similarly as Formulas in MS Word. Change-Id: Iedcef7124afed6b799f85bcefe37016c8fd972e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134185 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-05-14elid some OUString construction in SmXMLExportWrapper::ExportNoel Grandin1-13/+20
Change-Id: Icc091a7fab3c9ce368bd45536de1e75d29431c56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134314 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-13use vector as backing for stackNoel Grandin1-1/+3
which is a little faster Change-Id: Id086b67eba3ec00dc86a48a0fdec1a467b600d1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134268 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-13tdf#121740 reduce cost of mathml parsingNoel Grandin5-26/+24
by re-using OUString instances instead of allocating new ones for each SmToken Change-Id: Ia897427d6c1ffeb0e741dea90fde1f4d56a70175 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134264 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-11cache the PropertySetInfo in lcl_createModelPropertyInfoNoel Grandin1-2/+3
we only need one of them Change-Id: I2f6f2c75da96f76d4bf9cb31ef31bf597a3f5e6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134159 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-11reserve vector space in SmSymbolManager::GetSymbolsNoel Grandin1-0/+1
Change-Id: I9101e07fa54e35f1cec9797deaf1647763c9ebfe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134158 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-06tdf#148962 starmath's UnicodeNotationToggle (alt+x) getting called twiceCaolán McNamara1-1/+3
Change-Id: Ib150e4825c547c19a30c7b66d3f33904b814a917 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133942 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-05loplugin:unusedvariableplusNoel Grandin1-1/+0
Change-Id: Id93086be1224b6f6bf0bdaa1d50b4f289099027e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133876 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-04Just use Any ctor instead of makeAny in starmathStephan Bergmann4-12/+12
Change-Id: I8264c2330837fbd46ea372a8e370bb43ca1fb7b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133775 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-03add o3tl::equalsAsciiNoel Grandin3-7/+8
Change-Id: I042b8dcadbf7581de325c161763fe35aecde5ca2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133694 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-01ofz#47162 Integer-overflowCaolán McNamara1-0/+6
Change-Id: I4d910a1844100415f95c89bda83843ddffdc3df0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133663 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-01use more string_view in variousNoel Grandin1-2/+3
found by examining uses of OUString::copy() for likely places Change-Id: I6ff20e7b273ad6005410b82719183c1122f8c018 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133617 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-30split comphelper::string::strip functions into String and view versionNoel Grandin2-2/+2
which is more obvious, from the perspective of the caller, and lets us avoid creating a new String if nothing needs to be stripped Change-Id: I66a980eaf4aa818251bec49bdb16c2dddb0745e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-27tdf#148819: let the scroller know the custom widget's line sizeMike Kaganski1-0/+2
Change-Id: Ie30cd1db182aad5fbbf7e89498bd0ae9ce98c0f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133518 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-04-27Clean up includesMike Kaganski1-2/+0
Change-Id: Ied9a75953875e809e4284fdff03aab6add6800ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133511 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-04-27tdf#125931: add Properties panel to Math's Properties deckMike Kaganski3-1/+145
For now, it only contains buttons opening the dialogs accessible from Format menu. This is enough for the initial implementation, and should later be changed to individual controls allowing to set the formula properties directly. Change-Id: Ia0e52915198ddb2648d13d577d55b367f178b1ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133508 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-04-26tdf#125931: Add Elements deck and Elements panel to Math's sidebarMike Kaganski3-0/+295
Change-Id: Ie04a5dc48de38f318f0ddb42efc42cea022dc62c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133393 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-04-26tdf#125931: Enable sidebar in MathMike Kaganski2-0/+39
No panels yet, only one default deck (PropertyDeck). It is needed to have the uniform default deck like in all other modules (see commit c09f59eb6173a4a53a2d40ed80aebed18e3882ac); the panels for formula properties might appear later. Change-Id: If1785dc780111fe496638418f43e7b90a250ffce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133334 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-04-13loplugin:stringviewparam whitelist some more functionsNoel Grandin1-6/+7
for which we have o3tl:: equivalents Change-Id: I4670fd8b703ac47214be213f41e88d1c6ede7032 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132913 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-10loplugin:stringview check for getToken and trimNoel Grandin3-3/+6
since we now have o3tl versions of those that work on string_view. Also improve those o3tl functions to support both string_view and u16string_view Change-Id: Iacab2996becec62aa78a5597c52d983bb784749a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132755 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-02loplugin:stringviewparam convert methods using indexOfNoel Grandin1-2/+2
.. and lastIndexOf, which convert to find and rfind Change-Id: I6c4156cf904774c0d867f85a4c2785dba7593f62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132445 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-24loplugin:constantparamNoel Grandin2-4/+4
Change-Id: I86592be0717c062a918108bf4437074b0f70b372 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132029 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-12Related: tdf#128610 drop obsolete encoding attribute replacementMike Kaganski1-10/+0
It was needed once, when we used expat; now libxml2 does its own detection (in its xmlDetectCharEncoding) after the strange dance in our XMLFile2UTFConverter::readAndConvert (which does nothing useful for UTF-16 case). The original problem in tdf#128610 was addressed in commit c964700d16d99d1569373a1eb9a1352fb3512915. This one just drops the obsolete replacement. Change-Id: I2e6b28212619dd0f6cb90ae8234277092a37e7a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131409 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-11Related: tdf#128610 Avoid use-after-freeMike Kaganski1-17/+4
Creating SvMemoryStream from string makes it non-owning, i.e. pointing to the string's memory. So the string must outlive the stream. Since commit 64bc8b45b5c23efc5fe57585a69aa4263aaf4e83 Date Wed Jul 08 12:31:43 2015 +0000 i#107734 Support for Math Input Panel in Windows 7 Was only working by chance, when destructor didn't clean the memory (e.g., in optimized release builds) and the released memory hasn't been reused yet. Change-Id: I2e0c195de7bd2aff2889a94ef0f2eb084411933f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131373 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-03-06Fix tdf#147755 by copying the vector.Arnaud VERSINI1-4/+4
Revert partially 224953d896a3dba5d85992394525ab8b54d8c314 Change-Id: Ic12d3b0a080ad3af69fa5c4e8c9b4d331305a663 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131066 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-01use SfxItemSet::GetItemIfSet in starmathNoel Grandin2-30/+29
Change-Id: Iaef2a2c507acfdabc6280e6cc8179319ea9d8a94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130735 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>