summaryrefslogtreecommitdiff
path: root/starmath
AgeCommit message (Collapse)Author
2022-03-06Fix tdf#147755 by copying the vector.Arnaud VERSINI
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 Grandin
Change-Id: Iaef2a2c507acfdabc6280e6cc8179319ea9d8a94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130735 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-01Recheck modules s[f-t]* with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: I1f520aad1b1c942ad5616d96851016fc366ac58f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130203 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-02-27cid#1500496: Uninitialized pointer readJulien Nabet
Values retrieved from SmMlAttribute::setDefaultAttributeValue in case SmMlAttributeValueType::MlMaxsize see https://opengrok.libreoffice.org/xref/core/starmath/source/mathml/attribute.cxx?r=ffaaec23#94 Change-Id: Ie36254157da7ce85223ca71e2070fbd075b52699 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130620 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2022-02-27Typo: attributte->attributeJulien Nabet
Change-Id: Ic90047599effeea7d4959f9d44360361d87b98c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130619 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-02-26cid#1500654 Using a moved objectCaolán McNamara
Change-Id: Ia4b74cdeeae7f0c03e7e050be30714f948c67106 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130567 Tested-by: Jenkins 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
2022-02-04add toId/fromId to tidy up some ugly castingCaolán McNamara
Change-Id: I70f34ac5e9b5d2f2d6c0375e823908eaa2e540b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129487 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-02lok: find active SmViewShell reliablyMike Kaganski
... even after SfxViewShell::Current() had been set to parent document frame's viewshell (e.g., see LOKPostAsyncEvent grabbing focus, which replaces current frame and its associated viewshell). Change-Id: If63087f4c7f3f878ada93d93cc0af6c20a6c0a62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129323 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-01-27no need to call GetWhich on these SID_ valuesNoel Grandin
none of them are remapped (via the SfxItemEntryInfo stuff in the pool) Change-Id: Ic7b5f2c3cc75a65bdf9c45f9522cc53954b4ba38 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129040 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-27add some more TypeWhichId annotationsNoel Grandin
and update the idl compiler to cope with namespaced class names Change-Id: I7b5242f872e358bc3c5584f543767719172aac83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129026 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-25lok: enable in-place editing of math equationsMike Kaganski
Change-Id: Ic4d187d1e2ee92eab74a6bb43e47bb4f3d47ebd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128506 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-01-22Add missing test dependencyStephan Bergmann
> starmath/qa/cppunit/test_starmath.cxx:153:(anonymous namespace)::Test::testSmTmpDeviceRestoreFont > assertion failed > - Expression: pPrinter->IsFontAvailable(aFontName) Change-Id: Ia704559c3e29f38b281a05f2308888e1ec0e57eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128706 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-01-18Drop useless indirectionMike Kaganski
Change-Id: I87f26e2a2cf10d3000b0955a6ba2d877ee92bdf1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128547 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-01-17Drop unused declarationMike Kaganski
Change-Id: I17cd0d144b64fc6bfc8ce10f1de2db3ce4565ac3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128444 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-01-10Move HAVE_MORE_FONTS into an extra config headerJan-Marek Glogowski
No need to recompile most of LibreOffice, because the --with-fonts configure flag changed. This preprocessor define is just used by unit tests anyway. Change-Id: Ia2eae7d0c74e59e034fdd8513504a34e51ab428e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128197 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-12-24tdf#140726 Change func func(<?>) to func <?>(<?>) in MathJeff Huang
Change-Id: I9b28097c0043c7c6daffb047683b6af1f0202223 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127393 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-17Fix typosAndrea Gelmini
Change-Id: I7f1636226c4fbe29d9d2ef850318a9d57f1b5450 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127009 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-12-10Generally determine Rdb content from gb_*_set_componentfile callsStephan Bergmann
...instead of by listing the content somewhat redundantly in the Rdb_*.mk files, to avoid duplication of logic for components that are only built conditionally (and thus should only be included conditionally in the corresponding Rdb). To achieve that, add an "rdb" parameter to gb_ComponentTarget_ComponentTarget (and to the gb_*_set_componentfile macros that internally call gb_ComponentTarget_ComponentTarget), which is used to make the appropriate gb_Rdb_add_component call internally from within gb_ComponentTarget_ComponentTarget. (As a special case, gb_CppunitTest_set_componentfile shall not call gb_Rdb_add_component, as that has already been done by the corresponding gb_Library_set_componentfile call, so allow the gb_ComponentTarget_ComponentTarget "rdb" parameter to be empty to support that special case.) Most Rdb_*.mk files are thus mostly empty now. One exception is i18npool/Rdb_saxparser.mk, which duplicates some of the Rdb_services content as needed during the build in CustomTarget_i18npool/localedata. 1c9a40299d328c78c035ca63ccdf22c5c669a03b "gbuild: create services.rdb from built components" had already tried to do something similar (in addition to other things) under a new --enable-services-rdb-from-build option. However, that approach had four drawbacks that this approach here addresses (and which thus partly reverts 1c9a40299d328c78c035ca63ccdf22c5c669a03b): 1 Rdb_services shall not contain the component files of all libraries that are built. While that commit filtered out the component files that go into Rdb_ure/services (ure/Rdb_ure.mk), it failed to filter out the component files that go into others like Rdb_postgresql-sdbc (connectivity/Rdb_postgresql-sdbc.mk). 2 The code added by that commit to Makefile.gbuild codified the knowledge that there is an Rdb_services, which is brittle. 3 The code added by that commit to solenv/gbuild/Rdb.mk codified the knowledge (for gb_Rdb__URECOMPONENTS) that there is an Rdb_ure/services, which is brittle. 4 Introducing an --enable-services-rdb-from-build option needlessly provided two different ways how the content of Rdb_services is assembled. The changes done here would leave --enable-services-rdb-from-build as a misnomer, as it no longer controls how Rdb_services is assembled. I thus renamed it to --enable-customtarget-components, as that is apparently what it still does now. Change-Id: Ia5e8df4b640146c77421fcec6daa11a9cd260265 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126577 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-12-06loplugin:stringliteraldefine in starmathNoel Grandin
Change-Id: I539dbb8eaa21604401709d3b6e19433474056902 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126406 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-12-04Related tdf#132145: fix Print/Size NoSuchElementExceptionJulien Nabet
warn:unotools.config:1167538:1167538:unotools/source/config/configitem.cxx:423: ignoring XHierarchicalNameAccess Print/Size: com.sun.star.container.NoSuchElementException message: Print/Size: /home/julien/lo/libreoffice/configmgr/source/access.cxx:437 Regression from a5808c6446f6de536c44cf5bfba6566ad398fb8c tdf#132145: Synchronize SmMathConfig with configuration Change-Id: I472bd3dc2d4bf76700c2b9e1df9148737dfaa1f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126335 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-12-03Resolves: tdf#145959 menu pos should be relative to SmCmdBoxWindowCaolán McNamara
Change-Id: Ie8da9bbb4385b3315fd62e6f2dc8ab394ea3709f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126263 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-11-30tdf#132145: Synchronize SmMathConfig with configurationMike Kaganski
Change-Id: I690aa2f47afcd45eda3fb74ecead970b9e1513c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126095 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-23O[U]String::replaceAt overloads that take string_viewNoel Grandin
which results in lots of nice string_view improvements picked up by the plugins Change-Id: Ib0ec3887816b3d4436d003b739d9814f83e244b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-12Fix (mis-)uses of temporary O[U]StringLiteralStephan Bergmann
...as sub-expressions of ternary operators, which happened to keep compiling after 4b9e440c51be3e40326bc90c33ae69885bfb51e4 "Turn OStringLiteral into a consteval'ed, static-refcound rtl_String" and e6dfaf9f44f9939abc338c83b3024108431d0f69 "Turn OUStringLiteral into a consteval'ed, static-refcound rtl_uString" because both branches are of the same type O[U]StringLiteral<N>, and which didn't cause any issues because no dangling pointers to those temporary objects escaped the surrounding full expressions. This was found with an experimental build with VS 2022 with --enable-latest-c++, which would support HAVE_CPP_CONSTEVAL after some linking fix in the configure.ac detection code (which is forthcoming in a later commit) and flagged all these uses in ternary operators as error C7595 "call to immediate function is not a constant expression". That error looks bogus (and it also caused a false > sd/source/ui/unoidl/unoobj.cxx(742): error C7595: 'Color::Color': call to immediate function is not a constant expression so HAVE_CPP_CONSTEVAL will need to remain undefined for VS 2022 until that compiler bug is fixed), but it nicely found all these cases that should arguably be cleaned up. Change-Id: I81de94e8af5a6c50e5fe7dfa1a4b253e0c2a68f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125082 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-11-08use more OUStringLiteral in MediaDescriptorNoel Grandin
Change-Id: I0567d103db8db401c737fed98483912a39352929 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124835 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-03loplugin:finalclassesNoel Grandin
Change-Id: I10ff73f89c965beb3cfb5fc3a40dd959d8f77aaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124600 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-31Prepare for removal of non-const operator[] from Sequence in starmathMike Kaganski
Change-Id: I0ac241a5849a5c7d2726ceb0084612a7a1070b18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124392 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-30tools::Long->sal_Int32 in the DX arraysNoel Grandin
Change-Id: I36ddc11b39763dc77086591fe9bb756195b4294f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124459 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-22Typo: aFontHeigt->aFontHeight (starmath/smediteng.cxx)Julien Nabet
Change-Id: I8ae578350e911c69eeabbb3af41aaf9801b4ffee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124073 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-21loplugin:flattenNoel Grandin
Change-Id: I3b4226a9d089ec9aedab95d96e50a068f57a76c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123991 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-20combine these contiguous rangesCaolán McNamara
Change-Id: I5f2b4ae72599fb16d567b3500fd1a77811e708a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123881 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-20assert in math, file, printer settings, optionsCaolán McNamara
probably since... commit 1a0fd1c1342969e5b4d08d13764483cd8bada589 Date: Fri May 14 13:46:41 2021 +0200 tdf#130654 editable smeditwindow zoom UI Change-Id: Iead2fd9b5332a9cfead8d4e0d909746d6ed50db8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123879 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-20gtk4: make starmath edit and math widgets visibleCaolán McNamara
[GtkBox's expand child property] can be replaced by setting GtkWidget:hexpand or GtkWidget:vexpand on the child widgets. To match the old behavior of the GtkBox‘s expand child property, you need to set hexpand on the child widgets of a horizontal GtkBox and vexpand on the child widgets of a vertical GtkBox. Change-Id: I72ebb77cbd92001842abee77a23dcdf6aa1b7a2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123842 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-15Remove non-const Sequence::begin()/end() in internal codeMike Kaganski
... to avoid hidden cost of multiple COW checks, because they call getArray() internally. This obsoletes [loplugin:sequenceloop]. Also rename toNonConstRange to asNonConstRange, to reflect that the result is a view of the sequence, not an independent object. TODO: also drop non-const operator[], but introduce operator[] in SequenceRange. Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14use std::vector::insert instead of push_backNoel Grandin
because it will pre-allocate space and often is optimised to memcpy Change-Id: I03ed7915f2762d3d27e378638052a47a28bbf096 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123588 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-14Avoid COW overhead using css::uno::SequenceMike Kaganski
The scenarios are: 1. Calling sequence's begin() and end() in pairs to pass to algorithms (both calls use getArray(), which does the COW checks) 2. In addition to #1, calling end() again when checking result of find algorithms, and/or begin() to calculate result's distance 3. Using non-const sequences in range-based for loops, which internally do #1 4. Assigning sequence to another sequence variable, and then modifying one of them In many cases, the sequences could be made const, or treated as const for the purposes of the algorithms (using std::as_const, std::cbegin, and std::cend). Where algorithm modifies the sequence, it was changed to only call getArray() once. For that, css::uno::toNonConstRange was introduced, which returns a struct (sublclass of std::pair) with two iterators [begin, end], that are calculated using one call to begin() and one call to getLength(). To handle #4, css::uno::Sequence::swap was introduced, that swaps the internal pointer to uno_Sequence. So when a local Sequence variable should be assigned to another variable, and the latter will be modified further, it's now possible to use swap instead, so the two sequences are kept independent. The modified places were found by temporarily removing non-const end(). Change-Id: I8fe2787f200eecb70744e8b77fbdf7a49653f628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123542 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-12loplugin:moveparam in variousNoel Grandin
Change-Id: Ifa7c8ff2b21f63d234c29c28303d0bacd376c1e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123434 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-11In O[U]StringBuffer, make string_view params replacements for OUString onesStephan Bergmann
...for LIBO_INTERNAL_ONLY, instead of having them as additional overloads. That way, loplugin:bufferadd and loplugin:stringviewparam found many further opportunities for simplification (all addressed here). Some notes: * There is no longer an implicit conversion from O[U]String to O[U]StringBuffer (as that goes via user-defined conversions through string_view now), which was most noticeable in copy initializations like OStringBuffer buf = someStr; that had to be changed to direct initialization, OStringBuffer buf(someStr); But then again, it wasn't too many places that were affected and I think we can live with that. * I made the O[U]StringBuffer ctors taking string_view non-explicit, mainly to get them in line with their counterparts taking O[U]String. * I added an OUStringBuffer::lastIndexOf string_view overload that was missing (relative to OUStringBuffer::indexOf). * loplugin:stringconstant needed some addition to keep the compilerplugins/clang/test/stringconstant.cxx checks related to OStringBuffer::append and OStringBuffer::insert working. * loplugin:stringviewparam no longer needs the special O[U]StringBuffer-related code that had been introduced in 1250aecd71fabde4dba990bfceb61bbe8e06b8ea "loplugin:stringviewparam extend to new.." Change-Id: Ib1bb8c4632d99b744e742605a9fef6eae959fd72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122904 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-08use more SfxItemSetFixedNoel Grandin
Change-Id: I18784bac5f7ad1d109f8a81e96084cd6e9548231 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123240 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-28gives names to all the Idles and TasksNoel Grandin
enforce it by making the constructor parameter non-default. Change-Id: I321543e4dcf15ea0a43ad8cce91d2f8dc22df6ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122766 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-20clean up ambiguous confusing rectangle APIs like IsInside()Luboš Luňák
Reading 'rectA.IsInside( rectB )' kind of suggests that the code checks whether 'rectA is inside rectB', but it's actually the other way around. Rename IsInside() -> Contains(), IsOver() -> Overlaps(), which should make it clear which way the logic goes. Change-Id: I9347450fe7dc34c96df6d636a4e3e660de1801ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122271 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Jenkins
2021-09-20Add sal/config.h in preparation for patchChris Sherlock
The convention is that we need to add sal/config.h to the start of files. I have a patch queued to be able to create a FontMetric from a PhysicalFontFace. Submitting this patch so I can hopefully one day land this patch. Change-Id: I5817acd6e194da576f2c8a13539d38954a4f4e15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122172 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-19Some more string_view use, add o3tl::starts/ends_withStephan Bergmann
...until those C++20 string_view member functions are generally available (the fallback implementations are taken directly from the C++20 spec). (In ParseMathMLAttributeLengthValue in starmath/source/mathml/mathmlattr.cxx, returning nIdx + 2 instead of nIdx + 1 for the single-character u'%' case was presumably a typo, but which was harmless as the return value was only checked for <= 0, and has now been turned into a bool.) Change-Id: Ib441e474c515f016a4d81bb39f7821dfe0356499 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122322 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-18vcl: create FontMetric from PhysicalFontFaceChris Sherlock
A FontMetric can be created from a PhysicalFontFace, so setup a constructor that takes a PhysicalFontFace object to instantiate the FontMetric. The OutputDevice functions GetDevFont() and GetDevFontCount() don't necessarily make much sense, so have changed GetDevFont() to GetFontMetricFromCollection() and GetDevFontCount() to GetFontFaceCollectionCount(). Change-Id: I1577679b949a49a7cf1248838786d0f5e84a5245 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121796 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-17remove GetCharClassPtr from SvtSysLocaleNoel Grandin
we already have GetCharClass and we never return a nullptr Change-Id: I3cb79bc60be614c0474ecfdaad17991f2ecb6368 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122208 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-16Increase accuracy of ParseMathMLUnsignedNumber Fraction resultStephan Bergmann
The new test from d5e55d204b71710eb5eb5d2c683dd6698626df3c "tdf#144319: sw_odfexport: Add unittest" started to cause UBSan failure during CppunitTest_sw_odfexport (<https://ci.libreoffice.org/job/lo_ubsan/2136/>), > /workdir/UnpackedTarball/boost/boost/rational.hpp:605:22: runtime error: signed integer overflow: 1073741824 * 2 cannot be represented in type 'int' > #0 0x2b450983594f in boost::rational<int>::operator/=(boost::rational<int> const&) /workdir/UnpackedTarball/boost/boost/rational.hpp:605:22 > #1 0x2b450982e216 in Fraction::operator/=(Fraction const&) /tools/source/generic/fract.cxx:224:7 > #2 0x2b45098312d3 in operator/(Fraction const&, Fraction const&) /tools/source/generic/fract.cxx:320:10 > #3 0x2b46066963d5 in (anonymous namespace)::lcl_CountBlanks(MathMLAttributeLengthValue const&, int*, int*) /starmath/source/mathml/mathmlimport.cxx:1497:30 > #4 0x2b46066943eb in (anonymous namespace)::SmXMLSpaceContext_Impl::startFastElement(int, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&) /starmath/source/mathml/mathmlimport.cxx:1526:25 [...] Formula-14/content.xml in sw/qa/extras/odfexport/data/tdf144319.odt contains width="0.444em", which resulted in the inaccurate Fraction 476741369/1073741824 since 67d83e40e2c4f3862c50e6abeabfc24a75119fc8 "speedup rational_FromDouble" (which computes dVal=4.76741e+08 and nDen=1073741824; where before that speedup it computed dVal=4.44e+08 and nDen=1000000000, which would have resulted in the accurate Fraction 111/250). The excessively large denominator (1073741824 = std::numeric_limits<sal_Int32>::max()/2 + 1) then caused overflow later on, as shown above. Change-Id: I221549528e4fa155e10697d218ec76bf678e8b2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122186 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-15loplugin:finalclassesNoel Grandin
Change-Id: I88831f290e1923db6fb5a733746bfa3bc7fbc7e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122148 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-15Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 4Mike Kaganski
- Change implementations of getSomething to use getSomethingImpl Or where that's impossible, use getSomething_cast to unify this and reduce number of places where we reinterpret_cast. All static methods getting tunnel ids were renamed to getUnoTunnelId, to comply with the convention used in <comphelper/servicehelper.hxx>. TODO (in separate commits): - Revise uses of getSomething to use getFromUnoTunnel Change-Id: Ifde9e214b52e5df678de71fcc32d2199c82e85cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122100 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>