summaryrefslogtreecommitdiff
path: root/oox
AgeCommit message (Collapse)Author
2021-12-02PPTX export: handle theme colors from the doc model for shape textMiklos Vajna
As a start, do this only in case there are no effects used. If there is no theme color or there are effects, fall back to the old code. Also move parseExportStream() from SdModelTestBaseXML up to MacrosTest, so oox/ test code can use it as well. Change-Id: Ia76581dcef110341f6c3e60f22c34818ed0dcabc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126215 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-12-01Fix --disable-avmedia for DESKTOP buildJan-Marek Glogowski
Probably additional bits can be removed, but this now passes. Change-Id: I366bec43cfd6fb02e914c85c711b3b19586d534d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126161 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-12-01tdf#140912 Better handling of the picture placeholders.gulsahkose
To see icon and placeholder text at the center of picture placeholder shape, we set the TextContourFrame and GraphicCrop properties. Change-Id: I49e3d08c9020e593232c60c97af3f45fb620075e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126165 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-11-29tdf#118045 PPTX export: fix proportional line spacingTibor Nagy
If line spacing differs from the default 100%, export it as direct paragraph formatting (similar to the other paragraph style properties). Change-Id: Id5db9ae36018c8a20b832470685bdfbba19d80f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125438 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-11-26loplugin:stringliteraldefine in l10ntools..ooxNoel Grandin
Change-Id: Ia19d247f3cf439405c05a53c4cf2c9d0e7344560 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125811 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-24tdf#124781 PPTX export: fix superscript and subscript positionsTibor Nagy
"Raise/lower by" character settings were saved incorrectly when the automatic checkbox is checked. Change-Id: Ia7260504cde85e14867936c83eaf8735142e2c53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125302 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-11-24PPTX import: implement native handling of a color's luminance offsetMiklos Vajna
This was already handled in oox/ at import-time: this adds it to the doc model, including UNO API and PPTX import. This is a dependency PPTX export and UI, and also the last transform which is easy to generate from the PowerPoint UI and we didn't import to the doc model. Change-Id: Ica4e738d8dc8e0409160ceab941a82f2475ddc68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125749 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
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-23PPTX import: implement native handling of a color's luminance modulationMiklos Vajna
This was already handled in oox/ at import-time: this adds it to the doc model, including UNO API and PPTX import. This is a dependency PPTX export and UI. Change-Id: I5d875b53d715beb10c13ef616d06cf958d43f70f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125684 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-11-23tdf#138223 oox: don't set highlight color if it is transparentJustin Luth
Probably when this was first implemented in 6.4, it should have set a transparency threshold of when to accept the color as the background (perhaps at 50%). But since this has already been running for a while, I only cancel it if it is fully transparent. No existing unit tests matched this scenario. I'm not making a unit test because the color really ought to be set - it should just be transparent. LO doesn't seem to have a character highlight transparency capability, so this needs to be emulated. Change-Id: I7b295894e529f8345cadc9b30bc43598a9a02e2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125670 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2021-11-22Use less DegreeN::get()Mike Kaganski
Change-Id: I97b8d6282c72307cc29a913af221d283523f2fae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125653 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-22PPTX: implement native handling of <a:clrScheme> childrenMiklos Vajna
This was already handled by converting them to raw colors at import time. This commit imports the color scheme contents (the 12 colors) into the doc model. This is a dependency to export them back to PPTX and to be able to update these colors on the UI by picking a different theme. Change-Id: I177de4f15d5f0e628669998d1cda7db24220b2eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125651 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-11-20tdf#118776 drawingml: treat XML_nofill as (mostly) transparentJustin Luth
100% transparent typically ends up as COL_AUTO which certainly doesn't do what is intended. So set as 99% transparent to get effectively the same invisible effect. Adapted patch and re-used unit test from an earlier commit authored by Xisco. This depends on tdf#137438 not spamming the text properties with outline props. Only one existing unit test that matched this condition: -export-tests-ooxml1.cxx customxml.pptx -empty textbox - text entered here SHOULD be invisible. Change-Id: I077b748e500713188421f0eeefdfd85c46555e84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125301 Tested-by: Jenkins Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Justin Luth <jluth@mail.com>
2021-11-19Use more basegfx::deg2rad<N> and basegfx::rad2deg<N>Mike Kaganski
Change-Id: I9dc57628b98f67994d546f6887e96389be1efe62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125568 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-19Drop F_PI1800/F_PI18000, and unify deg2rad/rad2deg conversionsMike Kaganski
Change-Id: Ib89b00c3dc8cd440e8a88906eea133becd1cef64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125509 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2021-11-19PPTX import: handle <a:clrScheme name="...">Miklos Vajna
We had doc model for this, but the UNO API and the PPTX import was missing. Change-Id: I199e9cc235a783d91700ce74f17d442f41d3c3f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125532 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-11-19tdf#137438 drawingml: separate outline from text importJustin Luth
By ignoring the a:ln group, the contents in that group (like transparency) were being applied to the text. Well, it should only apply to a line around the text, which LO isn't doing. [Well, LO can do this as Fontwork, but perhaps that doesn't match so well with text in shapes generally?] At any rate, don't allow one group's settings to override the others. Keep them separate and then apply a bit of merging logic to try to achieve the best look. So emulate a little bit. If the outline is not very transparent (less transparent than the main text) then it may (if thick or opaque enough) dominate the text. For simplicity (and because there is no right answer overall) I just compared transparency and used the more opaque colour. Unit tests potentially affected: -export-tests-ooxml1.cxx: tdf100348_FontworkBitmapFill.odp -> PPTX -now imports black instead of yellow (MSO sees gradient colors) -so previously completely wrong, and now perhaps even more wrong? -export-tests-ooxml3.cxx: tdf114848.pptx -shows blue text regardless - defined by area. -can't see where this is set in MSO2016. Perhaps illegal? - : tdf125573_FontWorkScaleX.pptx -no visual difference. Same as tdf100348, but with black outline. - : tdf119087.pptx -should be green, not purple. [Added test for that.] - : tdf143315-WordartWithoutBullet.ppt -no visual difference (COL_AUTO outline?) -import-tests2.cxx: tdf129686.pptx -poor test usage (but also weird transparent default). -no visual change. -ooxmlimport2.cx: tdf143476_lockedCanvas_position.docx -no visual difference. Irrelevant since we can't RT Change-Id: Iff0d95506dd64825444a99e62a6c2bd5e1dc122f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125300 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-11-18import pptx color schemes as color setsSarper Akdemir
initial import work for color sets. Themes (which we get the color schemes from) in MSO can be different for each master - will need to support that too. [ Miklos: actually added that per-master-page support. ] (cherry picked from commit 3b21d166f585dcdf8d576d166aeff3cfd4694aab, from the feature/themesupport2 branch) Change-Id: Ia06d2645018e6bfa70817bbddba2374641ae13dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125477 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-11-18implement color tint or shade import for pptxSarper Akdemir
[ Miklos: althought the PowerPoint UI doesn't seem to have a way to generate this markup. ] (cherry picked from commit de40c940c3a94588d44a3d1f6d8cd4191cca4f73) Change-Id: Ibf98ba335b10859e4d6d702263f09e6ba2033bff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125426 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-11-17rename getSchemeName getSchemeIndex to remove ambiguitySarper Akdemir
[ Miklos: i.e. index could be a theme index or an index into a color set, this one is the later case. ] (cherry picked from commit aef22c3bbf1b4bb8ab9ba2bccb7005e0d0c75cb3, from the feature/themesupport2 branch) Conflicts: oox/source/drawingml/shape.cxx oox/source/drawingml/shape3dproperties.cxx Change-Id: I495e4b39975f1483607972ccbcc9348021710519 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125414 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-11-17implement initial pptx theme color importSarper Akdemir
[ Miklos: this only handles colors as-is, without any effects. ] (cherry picked from commit ec68ca0b5fb6773f42600f6a5825b4794cdb0990, from the feature/themesupport2 branch) Change-Id: I89890cf7ba6ec758698011752b63d7a60872bef2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125404 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-11-16rtl::Static->thread-safe static in ooxNoel Grandin
Change-Id: I4436188aa52766a07dadc1accb52c524666ae2f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125258 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-15Avoid some -Werror,-Wdeprecated-copy-with-user-provided-dtorStephan Bergmann
...after e6968f0485cfb2f6c941d11c438386e14a47095d "PPTX import: fix handling of theme overrides in the chart import" introduced a use of std::make_shared<Theme> Change-Id: I5f6384b81e02034b6b2fdf3a3bad0148de4eb584 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125228 Tested-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2021-11-15PPTX import: fix handling of theme overrides in the chart importMiklos Vajna
A problem since commit 08818d8a45e034ad825c7fafbb76766f106f1d1d (bnc#882383: Do not ignore themeOverride for charts in .pptx, 2014-07-04), an override for one chart should not affect later drawingML objects. Change-Id: I22b70c8c82e8e8520179c628f566d7f6663c887f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125218 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-11-13rtl::Static->thread-safe staticNoel Grandin
Change-Id: I3010494a750eee70ffe9c24c10417d0a3730dbd6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125120 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-13rtl::Static->thread-safe static in StaticNamespaceMapNoel Grandin
Change-Id: Iea6f7f96685e332407288af7ada36527acc83a8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125119 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-08Drop code that modified type for no good reasonMike Kaganski
The code was there at least since 3381981e76873304b171f7df900561dac681d2af. Alteady there it was wrong, relying on the order of the properties in the aGeoPropSeq: if "Type" appeared prior to "AdjustmentValues", the type name was changed by this code; otherwise, "AdjustmentValues" was modified, and the sequence set as xPropSet's "CustomShapeGeometry" value. Also the code relied on the detail discussed in fb3c04bd1930eedacd406874e1a285d62bbf27d9, and the "Type" was not updated when appeared after "AdjustmentValues" only because of accidental use of non-const operator[] in another place. Then in commits starting from 226ff96a88876d34f7fa30148150b6aa5a7f5a7c, a new code for presets, including their types, was introduced before the loop (see GetConnectorShapeType and maPresetDataMap uses). This presumably has obsoleted this code setting "Type" completely. This change drops this obsoleted code. It reverts part of commit fb3c04bd1930eedacd406874e1a285d62bbf27d9 in oox/source/drawingml/customshapeproperties.cxx. It is possible that we should write "ooxml-CustomShape" type in some cases when there's no type yet - but that should be done when the conditions for that are clear. Another possible TODO is to move the code defining "AdjustmentValues" up, set in in aPropertyMap before writing it into aPropSet. Change-Id: Ib22a838ca8008b181b3eee2dabdbbc14861a0f71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124749 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.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-08rtl::Instance->thread-safe static in PropertyNameVectorNoel Grandin
Change-Id: I3f595585b78c9e5ac32d9fc345c55a4eb14101c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124824 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-07return XShape from SdrObject::getUnoShapeNoel Grandin
instead of XInterface, to make it obvious what the reality of the requirement is Change-Id: Icdd4113f2a0ece930305f4d8ba010b81d24f43c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124802 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-05Simplify oox::PropertyNameVector ctorMike Kaganski
Change-Id: I800da7546a88e173e1b68041ce967795a4a3c9d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124699 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-05Drop code that modifies unused variableMike Kaganski
aPropertyMap is not used after line 154 Change-Id: Id593d44c327d30e3074dee3430eb551160ad18fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124697 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-05Drop non-const Sequence::operator[] in internal codeMike Kaganski
This makes all non-const operations on Sequence explicit, to avoid repeated COW checks in loops. Generally it would be desirable to replace uses of Sequence with general-purpose containers wherever possible, and only use Sequence for UNO API calls. This change uncovered a very serious pre-existing problem inherent to the Sequences used e.g. in range-based loops in our code: taking a non-const reference to elements of a sequence, and then modifying them at some later stage, brings a danger to also modify copies of the Sequence, that were created between the points of taking the reference and modifying it. This caused the change to oox/source/drawingml/customshapeproperties.cxx, where CustomShapeProperties::pushToPropSet took begin()/end() non-const iterators to aGeoPropSeq at the start of the loop, and then in the loop modified its elements and copied the Sequence passing it to XPropertySet::setPropertyValue. This was the same also prior to 2484de6728bd11bb7949003d112f1ece2223c7a1, and only happened to not cause problems because of *accidental* use of non-const operator[] on the copy of the Sequence inside SdrCustomShapeGeometryItem ctor, which *inadvertently* triggered COW, detaching the two copies one from another. This only emphasizes that we should minimize use of Sequences in the codebase. I anticipate other similar problems uncovered by this change, that happened to not break existing unit tests. Change-Id: Id691d994a06eb14297c487ebb84d8e062e29fd47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123725 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-04tdf#144918 PPTX import: fix internal hyperlink on shapesTibor Nagy
Slide names in internal hyperlinks of shapes could be replaced with the placeholder name 'Slide n', resulting non-functioning hyperlink during the slideshow. Follow-up to commit 83d92437e05a9ec872d9303953fa408dd4dcbcde "tdf#144616 PPTX import: fix hyperlinks on shapes". Change-Id: I733ddcdcdf92b32c4e6272d3cf48da872a63cd47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124135 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-11-03tdf#144914 PPTX export: fix interactions and hyperlinks on shapesTibor Nagy
Follow-up to commit 83d92437e05a9ec872d9303953fa408dd4dcbcde "tdf#144616 PPTX import: fix hyperlinks on shapes" Change-Id: I56538da8d97e052af03c78e8d7eaa16c5c2fde1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123748 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
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-30Prepare for removal of non-const operator[] from Sequence in ooxMike Kaganski
Change-Id: Iee1e16c516547e8f23631b33c928ac6637050f68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124376 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-26Drop ContainerHelper::vectorToSequence and use comphelper::containerToSequenceMike Kaganski
Change-Id: I987c56feab147cdbeb4ad58bd5ebb23dce6dbbca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124215 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-25Missing test dependencyStephan Bergmann
> oox/qa/unit/drawingml.cxx:162:testPresetAdjustValue::TestBody > equality assertion failed > - Expected: 1 > - Actual : 0 Change-Id: I3ff0707db485dce1e43c14b8d1a5828da8e14923 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124139 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
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-20tdf#144917 PPTX import: fix hyperlinks on grouped shapesTibor Nagy
Hyperlinks on the shapes of a group shape weren't imported. Now all of them are imported correctly. Change-Id: Ic42892650a3492958600232bd7038585f9aa6ae1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123127 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-10-18tdf#125582 use TextVerticalAlign_BOTTOM for textCircleRegina Henschel
PowerPoint aligns the bottom of the text to the path for prstTxWarp 'textCircle'. That preset type is mapped to 'fontwork-circle-curve' on import with additional attribute ScaleX=true. Currently the property TextVerticalAlign is only evaluated in case ScaleX=true. Therefore I have written the condition similar as the already existing with 'fontwork-arch-up-curve'. If it will be necessary later, all those conditions can be changed to use rPresetType instead of rClass. The rendering is slightly different compared to PowerPoint, because descenders and paragraphs line-spacing are handled differently. The rendering has still the problem, that in PowerPoint the letters are placed without gap, but in LO they have additional distances from each other. The needed ODF attribute draw:text-path-mode is not yet implemented in LO. Its value 'normal' would be needed here. Change-Id: I1f03d4845312885eff9ee8dbe1d51ddd437ed8e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123726 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2021-10-16Simplify vector initialization in ooxJulien Nabet
Change-Id: I1d7cfd157d56a501be4497e6f4e94f3f33429139 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123689 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-15Value stored to 'accent_val' during its initialization is never readCaolán McNamara
Change-Id: I780ffee680e52c240a1bd212f34c9c019c8b5e59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123625 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-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-13tdf#144642 XLSX import: round down row height to 0.75 ptAttila Szűcs
like table layout of MSO does, e.g. 20 pt to 19.5 pt. Changing table row height is only for interoperability. To avoid of regressions, apply this workaround only for documents created in MSO. Note: likely this is an old adjustment for low-resolution monitors, where 0.75 is the factor between 96 ppi of Windows resolution and (originally) 72 ppi of monitor resolutions. Co-authored-by: Tibor Nagy (NISZ) Change-Id: Ie1e2c781d21174a877b18cd3250eb445222bd1c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122428 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-10-13tdf#124232 PPTX export: fix interactions and hyperlinks on imagesTibor Nagy
Follow-up to commit 9bb91441b46d677860530d8bf9597c96561a1b0a "tdf#141704 PPTX import: fix hyperlinks on images" Change-Id: If29241ea06253e503dae27f8dc762574a5a634de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122717 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-10-13tdf#144943 PPTX import: fix permission for editingTünde Tóth
The passwords for editing in PPTX documents created with PowerPoint weren't asked and verified. Change-Id: I62eb4fd68aac6422c1221a639f4815459ab556c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123130 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-10-08Clean up a bit iterator management in oox/vmldrawingJulien Nabet
Change-Id: Icd4f4980332edc3fd9027cc4cace2b4a0d0c1315 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123234 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>