summaryrefslogtreecommitdiff
path: root/starmath/source/node.cxx
AgeCommit message (Collapse)Author
2024-09-28tdf#114441 change width,height to tools::Long in starmathDeepanshu Sharma
Change-Id: I69e0968643c5c30fbe7f67dfb392d176ab796fa4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174000 Reviewed-by: Hossein <hossein@libreoffice.org> Tested-by: Jenkins
2024-07-18make some single-arg constructors in starmath explicitNoel Grandin
Change-Id: I4b9a010a2cf42076b02c80732c8e35686482f9e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170684 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-06-26tdf#161786: fix Math crash when typing "oper"Julien Nabet
Change-Id: I8332e87e703f9138b8d13985b8697ad4b9f2191e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169539 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2024-05-14loplugin:ostr in starmathNoel Grandin
Change-Id: Ied15eb71ae3ae2d80ba839a6c99ea3cf620ca52f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167598 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2023-09-30Fix typoAndrea Gelmini
Change-Id: I906deadf53e1c564c786e5b5f8184e706c4dbdec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157425 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-09-28starmath: Arabic text should always be uprightKhaled Hosny
Change-Id: Ibe9f3092432ae4ffd81903df8672daf90947000c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157349 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-09-28starmath: Arabic symbols from Symbols Catalogue should not be italicKhaled Hosny
Arabic math symbols are not set in italic, so we need to unset the italic style if set. Change-Id: Id6db51a944236722a9724ad0d128ff6435a6bac0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157346 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-09-21tdf#62174: Fix saving of localized iGreek symbolsKhaled Hosny
When saving symbols we use the non-localized name, but iGreek symbols are a bit of a hack since they are added at runtime and don’t have localizations of there own but use the Greek symbols names with an “i” prefix. Instead of looking directly for localized names, we now go through the symbol manager that already knows about iGreek and use the export name of the symbol. We have to also make sure the iGreek symbols has non-localized export name. Change-Id: Ia3e38579abba56ae12ade126f564f8c6f9c3229a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157137 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-09-19starmath: Get the font from current format for special symbolsKhaled Hosny
We want to use the current format when using the symbol in a document, and fallback for stabdard format when rendering the symbol in symbols dialog. Fixup for the following two commits: commit f28b043b4eb40e90b330721fc43d19ae6c06951e Author: Khaled Hosny <khaled@libreoffice.org> Date: Mon Sep 18 19:00:02 2023 +0300 starmath: Fix editing symbols in the Symbols Catalogue commit 32d2e001bb056e7d98aa143b222f2721967337dc Author: Khaled Hosny <khaled@libreoffice.org> Date: Tue Sep 12 18:35:46 2023 +0300 tdf#101174: Don’t hard-code OpenSymbol font for predefined special symbols Change-Id: Id3730749a49015120ecf9719027f932fd90c605a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157043 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-09-15starmath: Improve root rendering for fonts other than OpenSymbolKhaled Hosny
The radical glyph in OpenSymbol is aligned to the font ascender, which is not essentially true for other fonts, so we now use the bounding rectangle of the glyph to get accurate positioning. Change-Id: I83c21cd21de25f23f96f819e168f43aa9ab22351 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156926 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-09-13tdf#101174: Don’t hard-code OpenSymbol font for predefined special symbolsKhaled Hosny
Leave the format empty and use the variables font instead. Change-Id: I3e3cdf40dc285dee7375054e85b4a2bed352eb66 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156855 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-06-03Remove unused SmStructureNode::SetSubNodesBinMo with plain pointers (starmath)Julien Nabet
and keep the remaining one which uses unique_ptr Change-Id: I0e4e4aff5c202897a27dfef97750c14c3c5736bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152581 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-12-16ofz#54365 Integer-overflowCaolán McNamara
Change-Id: Id7202e35bd381e36aa8d36a4ae2c9b987f8e9e79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144293 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-11-04lok: use twips in MathMike Kaganski
Change-Id: I11acd281da64b0023d74b3bc02e0f54864b94da9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142275 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-11-04Use o3tl::convert in MathMike Kaganski
... and use our standard definition of pt. Change-Id: I5a162b137360210335b84de33606dc7404cfc2de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142204 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-09-30use more string_view in starmathNoel Grandin
Change-Id: I3569d8dd41bf1c2db6a1fd379ca5596342922e45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140786 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-05clang-tidy modernize-pass-by-value in starmathNoel Grandin
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-05-01ofz#47162 Integer-overflowCaolán McNamara
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-02-15tdf#145759 Using M_PI from cmath instead of magic constants.pragat-pandya
Replace the instances of Pi's value as magic number by M_PI Use M_PI_2 and 2_M_PI instead of calculating these values in code. Use basegfx functions to convert angle units. Change-Id: I6cca7cc93704a70ccf3a0571a56a789bc9df51ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129479 Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com> Reviewed-by: Hossein <hossein@libreoffice.org> Tested-by: Jenkins
2021-09-28vcl: rename OutDevState to StackChris Sherlock
I have moved the header file to include/vcl/rendercontext as this will eventually be part of the RenderContext split from OutputDevice. State and associated enums have also been moved to the vcl namespace. I have also moved ComplexTextLayoutFlags into the vcl::text namespace. Change-Id: I0abbf560e75b45a272854b267e948c240cd69091 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121524 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-09-02clang-tidy:readability-redundant-member-initNoel Grandin
Change-Id: I39b9ac81d65f4a269293824642c1b2ec593c0584 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121490 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-18Use ESelection to locate code on node instead of SmTokendante
Will allow to use different input sources besides starmath code. Also, for adopting mathml standar the purpose is to make smnodes separate from the starmath code. Change-Id: Iefab5943cf59a8d2e31f5d59406c253fbe680ead Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112477 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-15Provide node type with more analysis capabilitiesdante
Change-Id: I3b3b866a9fdf0b5d0b9f40c0ce9bddbaf2c0b1ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112235 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-01Starmath cleanup unused includesdante
Change-Id: I294c5bbeadb718e35c0c5e56332b4df71433555a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111687 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-16SetSubnodesBinMo fix node order for diagonal operatorsdante
Change-Id: I72a95f91e9bed9aeb6da5f9621f2ba334f63f17c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110977 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-14Reorganize starmath color data flowdante
This will make possible to edit structure nodes with graphic UI. Change-Id: I37500958dbd684d239d615fc1d8df562a0c5b486 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110490 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-06Use multichar operatorsdante
There are no functional changes, only type change. This patch unlocks other possibilities like: - Syntax highlight for errors - Visual editor for structure nodes - Implement some mathml features Change-Id: I76a1b62126ae5fcb6a7285b07b24e9defa63fd44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110481 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-04Fix typo in codeAndrea Gelmini
Here it passed "make build-nocheck" on Linux Change-Id: I1f6ea440e54f87a90abb1b6e9983443764516e06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110373 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Dante DM <dante19031999@gmail.com> Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net> Tested-by: Jenkins
2021-02-02Support patch for starmath syntax hightlightdante
Starmath syntax hightlight has dependences on node classes. But those classes are whidely used. So for avoiding future merge conflicts it should be merged separetely because syntax hightlight won't be merged soon. Change-Id: Ifaf33cd67c9ea0d5cfffaad787ce5fabc1447a65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110325 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-31Increase node parser mathematical abstractiondante
The purpose is go to a simple parser in wich nodes are loaded by priorities. For that purpose we shall first increase the parser abstraction and simplify to maximum node releted operations. For that purpose: - Can set as subnodes unique_ptr and pointers alike. - Binary operators node->setsubnodes() will automatically adjust data order in base to data type. Change-Id: I050360cad34616709549e7461add0811dc26edc6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108944 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-16make the Color constructors explicitly specify transparencyNoel
to reduce the churn, we leave the existing constructor in place, and add a clang plugin to detect when the value passed to the existing constructor may contain transparency/alpha data. i.e. we leave expressions like Color(0xffffff) alone, but warn about any non-constant expression, and any expression like Color(0xff000000) Change-Id: Id2ce58e08882d9b7bd0b9f88eca97359dcdbcc8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109362 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-01tdf#42949 Fix new IWYU warnings in directories s*Gabor Kelemen
Except recently checked sc, sd, svx, sw Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ice1b86628e4f22a39f307b9c5fa567b6ab9d5acb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106917 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-22Some few more corrections over starmath color stuff.dante
Change-Id: If00138f35b79754d4bb3db1b37c87816bd89479a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106340 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-16Instead of labs, use overloaded absStephan Bergmann
...more likely to pick an appropriate version for the involved integer types, esp. after the recent long -> tools::Long changes Change-Id: Ia91259ca35aaf74b0e907de6831fc926f30057f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105949 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-12Revert "remove Fraction::operator tools::Long()"Noel Grandin
This reverts commit 48b667a7e7d25f835f95df89162a7849d6972531. Reason for revert: some discussion required Change-Id: Ia0990d280837fb68b7ddc9f472ec78b1467b4311 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105540 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-12remove Fraction::operator tools::Long()Noel
which was added in commit 331e2e5ed3bf4e0b2c1fab3b7bca836170317827 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Thu Sep 14 08:49:52 2017 +0200 long->sal_Int32 in Fraction presumably to make the change impact less code. Instead, update the call sites to reflect the actual bitwidth of the data we will be receiving. Change-Id: If2a678b1cf534f39cb8cb249757462be53658309 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105607 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-11Improved starmath colordante
Color.hxx has now documentation ( even if it is quite obvious if you know RGB standar ). Color.hxx has been reordered in more coherent order, but kept format. Some changes on Color.hxx dynamics. Color.hxx starmath colors list Now colors are managed by starmathdatabse. The path is open for simple addition of colors, there are no more infinite switches with color tokens here and there. To add a color, just put it in Color.hxx and register it in starmathdatabse.cxx. Do not forget to change array size in starmathdatabase.hxx. Now mathml supports RGB colors in #RRGGBB format ( import and export ). New colors have been added. Only the HTML Css1 are available via UI. New colors will be added. I intend to finish Css2 and dvipsnames ( latex colors ) on posterior patches. RGBA command has been unlocked for compatibility reasons. However will be displayed as RGB. Added color #RRGGBB. Improved qa color test on mathml to test RGB on mathml. TODO for someone on the UI team: - Add a color picker. - If it is a color with name: - It will add in the code "color " + starmathdatabase::Identify_Color_DVIPSNAMES( colorvalue ).pIdent +" " - If not: - It will add in the code "color " + starmathdatabase::Identify_Color_DVIPSNAMES( colorvalue ).pIdent +" "+ colorvalue.getRed() +" "+ colorvalue.getGreen() +" "+ colorvalue.getBlue() +" " - Note that those will habe eType with value TRGB or TRGBA. Change-Id: I47af37bd191b3099e8e6e08e7a5fb1a8a227bbf2 Change-Id: If971473ddcc34739439818dba9a62ca3494a4473 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-03Added hexadecimal number and color support for starmath.Dante DM
Adds hidden command on guy hex number wich allows to use numbers of base 16 and also 0-9-A-Z. Added support for custom RGB colors on hexadecimal on starmath via command color hex colornumber. Improved RGB color handle on starmath. Changed the way the color is handled on starmath. Colors keywords won't give errors. They have been moved to an independent tokens list so starmath will load tokens faster. Changed the way the font size is handeled on starmath. This won't change anything, just related with the structural change. Implemented premature support for rgba colors on math. This change only adds the possibility on the parser, node and node visitors. For now end-user can not access it since in a future there'll be work to do on the renderer to add full support. Added hex entrie on the docking window. Changes made on Color.hxx, will save some nanoseconds on build. If you are interested on allowing rgba and do the job on the renderer (and all the other stuff than there are a lot of .GetRGBColor()), you may find usefull color hex colnum. Since transparency setting is ignored, the hexadecimal color has hidden support for it since did not instore the max value (255 + 255*256 + 255*256*256) and everything is loaded into the sal_uInt32. Change-Id: Iafb38b142fffa329ca468e3d62643154fcdd2bbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104630 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-28convert some more long -> tools::LongNoel
grepping for stuff in template params this time Change-Id: Ia37bfd85480b3a72c3c465489581d56ad8dde851 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104855 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-22tdf#38885 Remove createTextFromNodedante
Change-Id: I85df73e498d61b976ddb908ab1b9c5e368d178cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98795 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-24tdf#40436 tdf#47914 RGB personalized color for math and laplace symbol 2dante
Change-Id: Id0791609ada5b9f5460e46b20cfc7ce600cd3043 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-30loplugin:simplifybool extend to expression like !(a < b || c > d)Noel Grandin
mostly to catch stuff from the flatten work, but I think this looks good in general Change-Id: I7be5b7bcf1f3d9f980c748ba20793965cef957e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92493 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-22tdf#42949 Simplify use of rtl::math::approxEqual in include/basegfx/Gabor Kelemen
Turns out we can save about 500Mb of preprocessor input if we use rtl_math_approxEqual from rtl/math.h instead of its C++ wrapper rtl::math::approxEqual from rtl/math.hxx and manage the fallout accordingly. Before: bin/includebloat.awk | head sum total bytes included (excluding system headers): 19017296671 After: $ bin/includebloat.awk | head sum total bytes included (excluding system headers): 18535432672 Change-Id: I1691171f3a309405a7099882ad9989d147f59118 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92508 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-16loplugin:buriedassign in starmath..svlNoel Grandin
Change-Id: I979faf4c476a7de91a0b6e06dd8717cee25525f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92313 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-28tdf#96505: Get rid of cargo cult long integer literalsOnur Yilmaz
I checked return values. Long variables didn't affect the calculation. Change-Id: I05fe807e34beb962e3867a708939e557d56e5549 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87491 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17Rename OUStringLiteral1 to OUStringCharStephan Bergmann
It started out as a wrapper around character literals, but has by now become a wrapper around arbitrary single characters. Besides updating the documentation, this change is a mechanical for i in $(git grep -Fl OUStringLiteral1); do sed -i -e s/OUStringLiteral1/OUStringChar/g "$i"; done Change-Id: I1b9eaa4b3fbc9025ce4a4bffea3db1c16188b76f Reviewed-on: https://gerrit.libreoffice.org/80892 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-13tdf#120047 Support attribute harpoon/wideharpoon in MathTakeshi Abe
... for an alternative style of vectors. They are vec/widevec analogs but with COMBINING RIGHT HARPOON ABOVE (U+20D1). The new attribute names are deliberately long in order to make fewer accidental collisions with variable names in formulae of exising documents. This also adds a glyph uni20D1 to OpenSymbol. Change-Id: I31666e57808aa0e0327500916d3b862549891886 Reviewed-on: https://gerrit.libreoffice.org/72987 Tested-by: Jenkins Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
2019-05-08crashtesting: many asserts in SmTextNode::PrepareCaolán McNamara
e.g fdo58094-1.mml since... commit 13894996601daf10d133f4a71eb0b26794d782bc Date: Sat May 4 21:46:31 2019 +0200 handle empty Rectangle better in starmath Change-Id: I01d11352b8bc9f6dcf6d6565fa41b84d549f620f Reviewed-on: https://gerrit.libreoffice.org/71963 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-05handle empty Rectangle better in starmathNoel Grandin
which required fixing a unit test to call Prepare, otherwise the nodes are not ready for layout Change-Id: I763c1b05d4dfafa73ebaee55d080876848de94f6 Reviewed-on: https://gerrit.libreoffice.org/71800 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>