summaryrefslogtreecommitdiff
path: root/xmloff
AgeCommit message (Collapse)Author
2024-06-11tdf#161327 Interpret angle units in dr3d:end-angle ..Regina Henschel
.. and draw:rotation in <draw:hatch> element. ODF 1.1 has not specified the syntax of datatype 'angle'. Since ODF 1.2 it is specified as double with unit "deg", "grad" or "rad", or without unit. The unit-less value is specified to be in degrees. But OOo, AOO and all LO versions had written the value unit-less in 1/10th of a degree in some cases. To fix it, LibreOffic will be enabled to read units. When then the active versions are able to read units, starting with the then actual version, LibreOffice will write angles with unit 'deg'. This has already be done for gradients, see tdf#89475. This patch starts the first step to make LibreOffice able to read units for dr3d:end-angle (UNO D3DEndAngle) and for draw:rotation (UNO FillHatch.Angle). I have not found further cases of writing 1/10deg. The patch still writes unit-less 1/10th of a degree for export to ODF 1.3 and earlier. When it is time to write unit degree or when LibreOffice supports the next ODF versions, some places need to be adapted. They are marked. The converter convertAngle is renamed to convert10thDegAngle() to indicate, that it is special. The parts, which were specific to gradients are moved to the gradients, so that it is now usable for dr3d:angle and draw:rotation too. I intend to write next a patch that enables LibreOffice to read angle units for cases where LibreOffice already writes unit-less values in degree. That is not so urgent, but to bring LibreOffice nearer to ODF, reading angle units should be implemented nevertheless. The file xmlbahdl.hxx is moved from xmloff/source/style to xmloff/inc to have access to it from xmloff/source/draw. Change-Id: I8ffc2735f8bcfefb86efa80eb05f900c32403f31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168336 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2024-06-10tdf#161488: allow failed image loading in repair modeMike Kaganski
Change-Id: I19a68f2f016b5ab95565c7fbcc4c435cf13c6b48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168596 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-06-05reduce some SAL_WARN spamNoel Grandin
Change-Id: I175677bc41c4113e030094afbc45d57ace773b90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168450 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-31tdf#160564 Treat xlink:type for embedded chartLaurent Balland
xlink:type is a valid attribute for chart:chart according to ODF [1] As this attribute is not yet used, this change just avoids the warning message [1] https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part3-schema/OpenDocument-v1.3-os-part3-schema.html#__RefHeading__1419428_253892949 Change-Id: I836c8ff4a284bafa8e0c8049ae6ae60c9fbe7a4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165853 Reviewed-by: Laurent Balland <laurent.balland@mailo.fr> Tested-by: Jenkins
2024-05-22Related: tdf#145972 sw images: fix rounding error in relative size calculationMiklos Vajna
Open the bugdoc, see that the image is roughly half of the page width, right click, properties, UI shows that the width of the image is 5% of the width of the entire page. This only happens if tools -> options -> writer -> general sets the UI units to points, the default cm case is fine. This went wrong with commit 9e8712ed6f9fb5dbd971e352a5709bd45fadc74f (sw image dialog: fix fallback width/height for images with relative sizes, 2022-03-17), because the layout size started to matter more after that commit. This lead to the nWidth != m_xWidthED->get_value(FieldUnit::TWIP) check in SwFramePage::Init() to be true, because 11906 * 0.48 is 5714.88, so you got 5714 in the layout, but got 5715 with rounding in SwFramePage::Reset() (which tries to calc the page width based on the 48% and the fly width). And once we had that mismatch, we went down the wrong path. Fix the problem by using rtl::math::round() in SwFlyFrame::CalcRel(), so the relative width twips value is 5715 everywhere: once we have consisteny, the UI value is correct, too. Note that the original bugdoc needs more fixing, this just fixes the bugdoc where KeepRatio is false. Change-Id: I1e8782c95a0cf9d97375c36d41134735c01f3e46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167916 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-05-16Drop unneeded 'using' instancesGabor Kelemen
found with bin/find-unused-using.sh Change-Id: I647f493ee313e79e7a9967960ea089b729de59a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167637 Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Tested-by: Jenkins
2024-05-15loplugin:ostr in xmloffNoel Grandin
Change-Id: I24f5626e57e03217e4bcf77289c785e255b9f904 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167667 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-05-14tdf#161054: drop support of last empty span as paragraph mark formatMike Kaganski
Commits 6249858a8972aef077e0249bd93cfe8f01bce4d6 (sw: ODT import/export of DOCX's paragraph marker formatting, 2022-12-19) and 209dce614c43f63f63f5b42a746665c0ec1cbfe3 (sw: fix ODT import of paragraph marker formatting, 2022-12-20) introduced support for paragraph marker formatting in ODF, using an empty trailing span. Later, commit 1a88efa8e02a6d765dab13c7110443bb9e6acecf (tdf#155238: Reimplement how ListAutoFormat is stored to ODF, 2023-05-11) changed how the data was stored in ODF. Then, in commit 69ed893087f89d176a5ec4b263ce8d75774be72b (tdf#160253: fix list identifier export decision code, 2024-04-24), some remnants of the older "trailing empty spans" were removed, but a code was added in XMLParaContext::endFastElement, to keep backward compatible with documents created in the frame between December 2022 and May 2023. The said compatibility code brings own problems, requiring new hacks like commit 2ca93eb5df7ddb8641ff7d884a109261c9700aca (tdf#161023: Empty spans may only define paragraph marks in text documents, 2024-05-13), and keeping the code would need more hacks on top, e.g. to fix the case in ODT documents. Instead, let's bite the bullet, and drop the compatibility with this initial implementation, because it was only a brief period during which the documents could be created, which can be affected by this drop. This makes the code simpler. A testdoc for testNumberPortionFormat was edited to use the new markup for the paragraph marks formatting. Change-Id: I053e72dd1cc2ead83baa6ce7d24c8522b494c8fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167583 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-05-13createFromAscii -> OUString literals in XMLIndexTOCContextNoel Grandin
Change-Id: I93aaf16d75a883b733ebedecfe5625e10bbdc753 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167560 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-13createFromAscii -> OUString literals in AnimationsExporterNoel Grandin
Change-Id: I20c35e06fb98df5ffb9d9fd521459e267e4a2fa0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-13tdf#161023: Empty spans may only define paragraph marks in text documentsMike Kaganski
Change-Id: I40607652a0fd8e31c609732daa54bb796e3fffa0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167557 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-05-07tdf#132599 sw schema xmloff: add hyphenation-keep-type='always'László Németh
Add new hyphenation option to limit hyphenation of the last full line of the hyphenated paragraph. Move also loext:hyphenation-keep-type to paragraph-properties, following the associated hyphenation-keep. Note: value "always" is defined by CSS 4 hyphenate-limit-last, see https://www.w3.org/TR/css-text-4/#hyphenate-line-limits. Follow-up to commit 6e8819f29b6051a0e551d77512830539913ec277 "tdf#132599 cui offapi sw xmloff: add hyphenation-keep-type". Change-Id: I2121269205fc89fb5367dccdca00195aac68f3e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167232 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2024-05-06replace createFromAscii with OUString literals in XMLTransformerOASISEventMapNoel Grandin
Change-Id: I48e04ebfac7898747b3481d4359f3ed4dd4c351d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167169 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-06replace createFromAscii with OUString literals in xformsNoel Grandin
Change-Id: I30e56eb11635227616a5cf2dee2c166bdd383498 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167170 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-06replace createFromAscii with OUString literals in SdXMLNumberFormatImportNoel Grandin
Change-Id: I17c9bad132b55b120a3b67cdda39d5a603baeae4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167154 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-05-06replace createFromAscii with OUString literals in XMLBibliographyFieldNoel Grandin
Change-Id: I17ba2bce9bd94b8054211d4ea689166ad1227ce8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167168 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-06replace createFromAscii with OUString literals in MultiPropertySetHelperNoel Grandin
Change-Id: I4b4cef2d7afac3963ab9b3f2fda10d11b754fd00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167165 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-05-06replace createFromAscii with OUString literals in XMLSectionExportNoel Grandin
Change-Id: Ia9c4c7ad04bb17e24b017bef074e5636f3a960a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167167 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-06replace createFromAscii with OUString literals in XMLIndexTemplateContextNoel Grandin
Change-Id: I9ebc4835c2cc1e525360e89a19514be48b5a77dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167166 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-05replace createFromAscii with OUString literals in OElementImportNoel Grandin
Change-Id: Ic6e93f47b903b69f1d8a15fc62be138c13b7b01a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167156 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-05-05replace createFromAscii with OUString literals in SdXMLNumberStylesNoel Grandin
Change-Id: Ice3a35bcaa9ea0005fb97fef5bbcc2c3e2259f39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167155 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-05-05replace createFromAscii with OUString literals in EnhancedCustomShapeTokenNoel Grandin
Change-Id: I1d7f6a22891b40c540cff0cee4150c95e52ba728 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167152 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-03makefile simplification: replace $(call gb_CustomTarget_get_workdir,foo)Christian Lohmaier
…by a simple/static $(gb_CustomTarget_workdir)/foo The build system has a lot of overly complicated leftovers from when it was introduced and had not only deal with split repositories but also had to coexist with another buildsystem. Along with lots of copy'n'paste along the years the makefiles became hard to grasp for newcomers with all our calls and evals. As a first step to streamline that, the macros from TargetLocations that simply prefix a static path to the argument (and similar of the same kind) are a natural pick before simplifying the rules themselves/getting rid of a bunch of eval statements. Change-Id: Ia06dbbcd5d1994755a2ff05b84f72ccbc4e3cab5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167005 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2024-05-03tdf#160915: make own OLE objects obey AddReplacementImages settingMike Kaganski
Change-Id: I25ce3c920dc8ba25d0ac14310ff9cba8a4c23c6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167026 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-05-02use more OUString compile time literals in xmloffNoel Grandin
Change-Id: Iddf9d40ca63f2f3ce7d48aaf881a3abb10f88bbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166975 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-02use more OUString literals in XMLEventNoel Grandin
Change-Id: I77f9b7fc731be3c3f7cd0c642f9b210e28fdf545 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166974 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-04-27Fix dc:date export for midnight timeMike Kaganski
Change-Id: I2fc40055e8949348925159a7e10f231a2573950c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166757 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-26Make sure that collecting redline autostyles succeedsMike Kaganski
This step was called separately in SwXMLExport::ExportAutoStyles_, after collectAutoStyles. collectTextAutoStylesAndNodeExportOrder (which is called from collectAutoStyles) sets mbCollected to true, and then all the code checking mbCollected/isAutoStylesCollected stops collecting autostyles. This moves exportTrackedChanges call to the place where all auto- styles are collected. Change-Id: I3f4bd0e0ff906a35b69c052e34adb6d66ef80d48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166735 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-04-26tdf#114287 tdf#159366 xmloff: ODF import: revert text:list overrideMichael Stahl
This reverts commit ade0a153f453500f15343380ac937252992733e0 "tdf#114287 xmloff: ODF import: fix text:list override of list style" and subsequent commits 7cf5faec6fdbc27dd77d2d36fb2ff205322cba0d and 1b2a6b98291cf8b7022951be19b915fe2a9e18e6. It turns out that there is actually a paragraph in ODF 1.2 and later that gives paragraph's indent priority over the list style's, which i unfortunately missed when investigating the above issues: 17.20 <style:list-level-label-alignment> ... The fo:text-indent and fo:margin-left attributes are evaluated only for paragraphs inside list items whose paragraph styles do not specify them. If one of the two properties, or both, are specified by the paragraph style, the text indent and/or left margin are taken from the paragraph style. In this case the paragraph style's properties are used to determine the indent and margin for the text lines and thus also the alignment position. This is usually interpreted as "on the same level", so applying a list-style at a paragraph style overrides the indents inherited from a parent paragraph style, but if the style then specifies its own indents that overrides the list style's indents. Furthermore it turns out that Google Docs now imports this bugdoc the same way as LO 7.5 does; unclear if that changed recently (it shows it like Word does in the preview, but like LO 7.5 does after opening it). This means the way MS Word imports the bugdoc, which remains unchanged, now looks like a bug and we should not change LO to be compatible with it (when the same structure is created in Word, storing to ODF and loading again, it looks different too). Change-Id: I0c65bde38de9e6fcbccec55899c60c3245adb5ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166309 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins
2024-04-26This block seems obsolete now, try to drop itMike Kaganski
... and see if something breaks. Unit tests pass. Likely obsoleted by commit 69ed893087f89d176a5ec4b263ce8d75774be72b (tdf#160253: fix list identifier export decision code, 2024-04-24). Change-Id: I4fde19e1047104686df22053c9b140819ea72963 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166651 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-26Make sure to export autostyles from inside frames anchored to pageMike Kaganski
These frames need to export content when collecting autostyles, too. Regression after commit 69ed893087f89d176a5ec4b263ce8d75774be72b (tdf#160253: fix list identifier export decision code, 2024-04-24). Change-Id: If036cab9327e33d32f494fc765bae8e2d685907c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166650 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-25Fix UBSan failure: omission from 69ed893087f89d176a5ec4b263ce8d75774be72bMike Kaganski
This failure was seen: /xmloff/source/text/txtparai.cxx:1816:37: runtime error: downcast of address 0x604000d86710 which does not point to an object of type 'XMLStyleHint_Impl' 0x604000d86710: note: object is of type 'XMLTextFrameHint_Impl' 00 00 00 00 00 4b 83 40 b3 7f 00 00 70 bf 22 00 b0 60 00 00 70 bf 22 00 b0 60 00 00 06 00 00 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'XMLTextFrameHint_Impl' #0 0x7fb33f2d224d in XMLParaContext::endFastElement(int) /xmloff/source/text/txtparai.cxx:1816:37 #1 0x7fb33dc76333 in SvXMLImport::endFastElement(int) /xmloff/source/core/xmlimp.cxx:885:15 #2 0x7fb36ee0bfca in (anonymous namespace)::Entity::endElement() /sax/source/fastparser/fastparser.cxx:514:27 #3 0x7fb36ee0b998 in sax_fastparser::FastSaxParserImpl::callbackEndElement() /sax/source/fastparser/fastparser.cxx:1331:17 #4 0x7fb36edfb444 in (anonymous namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char const*, unsigned char const*) /sax/source/fastparser/fastparser.cxx:338:18 #5 0x7fb3bacb8eaa in xmlParseEndTag2 /workdir/UnpackedTarball/libxml2/parser.c:10089:2 #6 0x7fb3bac5fa45 in xmlParseTryOrFinish /workdir/UnpackedTarball/libxml2/parser.c:11867:14 #7 0x7fb3bac533c4 in xmlParseChunk /workdir/UnpackedTarball/libxml2/parser.c:12150:5 #8 0x7fb36edf6231 in sax_fastparser::FastSaxParserImpl::parse() /sax/source/fastparser/fastparser.cxx:1085:21 #9 0x7fb36edefd18 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:890:9 #10 0x7fb36ee11950 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:1470:13 #11 0x7fb33dc60551 in SvXMLImport::parseStream(com::sun::star::xml::sax::InputSource const&) /xmloff/source/core/xmlimp.cxx:528:15 #12 0x7fb31916b4f1 in (anonymous namespace)::ReadThroughComponent(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, char const*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, rtl::OUString const&, bool, bool) /sw/source/filter/xml/swxml.cxx:181:26 #13 0x7fb3191609f1 in (anonymous namespace)::ReadThroughComponent(com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&, com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, char const*, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, char const*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, rtl::OUString const&, bool) /sw/source/filter/xml/swxml.cxx:323:16 #14 0x7fb319159e4c in XMLReader::Read(SwDoc&, rtl::OUString const&, SwPaM&, rtl::OUString const&) /sw/source/filter/xml/swxml.cxx:833:16 #15 0x7fb3187eda73 in SwReader::Read(Reader const&) /sw/source/filter/basflt/shellio.cxx:203:22 #16 0x7fb3195ecd45 in SwDocShell::Load(SfxMedium&) /sw/source/uibase/app/docshini.cxx:533:37 #17 0x7fb382833c33 in SfxObjectShell::LoadOwnFormat(SfxMedium&) /sfx2/source/doc/objstor.cxx:3619:20 #18 0x7fb38283a353 in SfxObjectShell::DoLoad(SfxMedium*) /sfx2/source/doc/objstor.cxx:705:40 #19 0x7fb382aca503 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/sfxbasemodel.cxx:1980:36 #20 0x7fb38333d8c9 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) /sfx2/source/view/frmload.cxx:720:28 #21 0x7fb371713419 in framework::LoadEnv::impl_loadContent() /framework/source/loadenv/loadenv.cxx:1176:37 #22 0x7fb37170a43b in framework::LoadEnv::start() /framework/source/loadenv/loadenv.cxx:412:20 #23 0x7fb371702a79 in framework::LoadEnv::startLoading(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, rtl::OUString const&, int, LoadEnvFeatures) /framework/source/loadenv/loadenv.cxx:308:5 #24 0x7fb3716fe207 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/loadenv/loadenv.cxx:168:14 #25 0x7fb3717d23fd in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/desktop.cxx:591:16 #26 0x7fb3717d2626 in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/desktop.cxx #27 0x7fb3869f5afa in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /unotest/source/cpp/macros_test.cxx:71:62 #28 0x7fb38762dc56 in UnoApiTest::loadWithParams(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /test/source/unoapi_test.cxx:126:19 #29 0x7fb38762cef8 in UnoApiTest::load(rtl::OUString const&, char const*) /test/source/unoapi_test.cxx:108:5 #30 0x7fb38762e254 in UnoApiTest::loadFromFile(std::basic_string_view<char16_t, std::char_traits<char16_t> >, char const*) /test/source/unoapi_test.cxx:132:5 #31 0x7fb38858966e in testPreserveJpg::TestBody() /filter/qa/unit/svg.cxx:52:5 ... See https://ci.libreoffice.org/job/lo_ubsan/3150/consoleFull#1179512796d893063f-7f3d-4b7e-b56f-4e0f225817cd Change-Id: I1984ae555fada39fb6db6cadd326e5c8b9421b90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166613 Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2024-04-24tdf#160253: fix list identifier export decision codeMike Kaganski
Commits 8f48f91009caa86d896f247059874242ed18bf39 (ODT export: omit unreferenced <text:list xml:id="...">, 2022-03-10) and 82bbf63582bdf28e7918e58ebf6657a9144bc9f3 (tdf#155823: Improve the check if the list id is not required, 2023-06-14) tried to improve deterministic ODF output, by omitting the list identifiers in case when those identifiers were unreferenced. The latter of these used document model node numbers to check if other lists appeared after the last occurrence of the list that is continuing in the current node. But it turned out, that this isn't robust. Consider this ODF: <text:list xml:id="list1" text:style-name="L1"> <text:list-item> <text:p>a</text:p> </text:list-item> </text:list> <text:p>b<text:note text:id="ftn1" text:note-class="endnote"><text:note-citation>i</text:note-citation><text:note-body> <text:list text:style-name="L2"> <text:list-item> <text:p>x</text:p> </text:list-item> </text:list></text:note-body></text:note></text:p> <text:list text:continue-list="list1" text:style-name="L1"> <text:list-item> <text:p>c</text:p> </text:list-item> </text:list> The paragraphs a, b, and c are all in the main document body, and have sequential document model node numbers (say, 15, 16, 17). If these numbers are checked, there is no node between node 15 ("a") and node 17 ("c") with a different list (both 15 and 17 belong to a list with style "L1" and identifier "list1", and node 16 doesn't belong to any lists). That suggests that the list identifier isn't needed in this case. Bug when the actual output of node 16 is done, it includes a node from an endnote ("x"), which is located in a different place in the document model, and has a node number like 7 (so not between 15 and 17). The paragraph "x" belongs to another list with style "L2", and is output to ODF between paragraphs "a" and "c". Here, we must refer from paragraph "c" to the list of the paragraph "a" using the list id, but this is not obvious when only considering node numbers, and requires the prior knowledge of the actual order of appearance of lists in the ODF. Unless we build a DOM, this is only possible, if we do a two-pass output, and collect the nodes order in the first pass. The output already does that in a "collect autostyles" pass. The problem here is that the "collect autostyles" pass used an optimized function, XMLTextParagraphExport::collectTextAutoStylesOptimized, introduced in commit 8195d7061ed52ebb98f46d35fe5929762c71e4b3 (INTEGRATION: CWS swautomatic01 (1.126.4); FILE MERGED, 2006-12-01) for #i65476# and which used style::XAutoStylesSupplier for optimization to get the autostyles. This drops XMLTextParagraphExport::collectTextAutoStylesOptimized, and reverts to use of collectTextAutoStyles, which handles nodes in the same order as when writing to ODF. There, we build a vector of the node numbers sequence, used later to sort DocumentListNodes. This uncovered an omission from the work on paragraph mark (commit 1a88efa8e02a6d765dab13c7110443bb9e6acecf tdf#155238: Reimplement how ListAutoFormat is stored to ODF, 2023-05-11). Turns out, that the code in SwTextFormatter::NewNumberPortion introduced in commit cb0e1b52d68aa6d5b505f91cb4ce577f7f3b2a8f (sw, numbering portion format: consider full-para char formats as well, 2022-10-20) was left behind when re-implementing paragraph marks to use dedicated property; empty trailing spans still affected how the lists were rendered, and that allowed to overlook import defects, where the paragraph mark properties weren't properly set. In ODF import (XMLParaContext::endFastElement), for compatibility, this treats empty trailing spans as defining paragraph mark (when the paragraph mark wasn't set explicitly). This way, the trailing spans get converted to the paragraph mark. In WW8 import, last cell paragraphs didn't call the code handling the paragraph marks. This is also fixed now. The changes result in slightly different numbering of autostyles in the ODF. It seems, that the new numbering more closely follows the order of appearance of the autostyles in the output; and some cases of autostyles that were written, but unreferenced, are now eliminated. The unit tests were updated accordingly. I hope that the performance impact on the export time would not be too large. It is unclear why outline numbering exports a list element at all. Fixing that to not emit the list element is a separate task / TODO. Change-Id: I5c99f8d48be77c4454ffac6ffa9f5babfe0d4909 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166572 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-22use more OUString literalNoel Grandin
convert some functions which merely create an OUString on the fly from a char literal to 'constexpr OUString' literals Change-Id: I617490baf2d976291b324cc991b59cd18f4b242c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166392 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-04-22Use designated initializers for clarityMike Kaganski
Change-Id: Ie10e657e07981e6fd0f0804371fd30f2b3f143b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166430 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-19Fix typoAndrea Gelmini
Change-Id: Ia0262b3424eb6f05020e48dd0a497e27cfd10ad8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166282 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-04-19Fix typoAndrea Gelmini
Change-Id: Icff58bb1e1c0f409003cb3a97a10182fa4ded41a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166283 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-04-19Fix typoAndrea Gelmini
Change-Id: I0f745fa74b0de96df7d2b887fca460d32faf77e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166281 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-04-19tdf#159903 xmloff: ODF import: fix bug in margin compatibility overrideMichael Stahl
The check for the property being set was wrong: the state in a parent style may be DIRECT_VALUE but a derived style may have a list style set, which effectively overrides the ParaLeftMargin and ParaFirstLineIndent. Fix this so that the compatibility override only happens when required. (regression from commit 7cf5faec6fdbc27dd77d2d36fb2ff205322cba0d) Change-Id: I6c8ca493df946afcb48a63c01c132620bcd7b390 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166257 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-04-18tdf#160517 - chart odf: import/export formatted chart titlesBalazs Varga
(main, sub, axis titles) texts properly to/from odf format. Fix odf export of formatted chart titles. The exported data structure will look like: <chart:title svg:x="3.304cm" svg:y="0.285cm" chart:style-name="ch2"> <text:p> <text:span text:style-name="T1">This</text:span> <text:span text:style-name="T2"> is</text:span> . . . <text:span text:style-name="T3">3</text:span> <text:span text:style-name="T2"> a </text:span> </text:p> </chart:title> Fix import of formatted chart titles. Put the properties and related texts into the chart2::XFormattedString2 uno objects. Follow-up commit of: 55e9a27afd2d6a13cf76b39641bf121c3ec4b45c Related: tdf#39052 - chart ooxml: export formatted chart titles 4f994cec388377cc5c2bddb804bd92eb4cd7dc8d tdf#39052 - Chart: make characters formatable in editable chart textshapes -- TODO: chart data point / dataseries labels are handled differently since those are not editable objects, but that is a completily different issue. -- Change-Id: I1842f2c69c132bdf578bb2d354f451cc9d49c63c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166122 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2024-04-17Drop FRound, and use generalized basegfx::froundMike Kaganski
Change-Id: I7447e649dc3ef4e51242f69c7486a3e84e103d2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166159 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-12crashtesting: assert seen on importing forum-mso-en4-62805.xlsxCaolán McNamara
Change-Id: I1d1ab4539775c8c2fce591ca32fc15c3c0dd6060 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166024 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-04-11tdf#132599 cui offapi sw xmloff: add hyphenation-keep-typeLászló Németh
Support XSL attribute "column" and CSS 4 attribute "spread", stored in loext:hyphenation-keep-type, to give better control over hyphenation-keep. E.g. spread: both parts of a hyphenated word shall lie within a single spread, i.e. when the next page is not visible at the same time (e.g. the next page is not a right page of a book). – css::style::ParaHyphenationKeep is a boolean property now, importing hyphenation-keep = "page" as true. – type of ParaHyphenationKeep, including the new non-ODF types is stored in the new ParagraphProperties::ParaHyphenationKeepType. – default value of ParaHyphenationKeepType is COLUMN for interoperability. – Add checkboxes to Text Flow -> Hyphenation Across in paragraph dialog: * Column (previously: Hyphenate across column and page) * Page * Spread – enabling/disabling them follows XSL/CSS 4/loext, i.e. possible combinations: * No Hyphenation across (hyphenation-keep = "page" and loext:hyphenation-keep-type = "column") * Hyphenation across [x] Column (hyphenation-keep = "page" and loext:hyphenation-keep-type = "page") * Hyphenation across [x] Column [x] Page (hyphenation-keep = "page" and loext:hyphenation-keep-type = "spread") * Hyphenation across [x] Column [x] Page [x] Spread (hyphenation-keep = "auto") – Add ODF import/export – Update DOCX import – Add ODF unit tests Note: recent implementation depends on widow settings: disabling widow handling allows hyphenation across columns and pages not only in table cells. Note: RTF import-only, but not used bPageEnd has been renamed to bKeep. Depending on the RTF test results, likely it will need to disable the layout change, e.g. GetKeepType()=ParagraphHyphenationKeepType::AUTO, if PageEnd uses obsolete hyphenation rule, i.e. shifting only the hyphenated word to the next page, not the full line. More information: – COLUMN (standard XSL value, defined in https://www.w3.org/TR/2001/REC-xsl-20011015/slice7.html#hyphenation-keep) – SPREAD and ALWAYS (CSS 4 values of hyphenate-limit-last, equivalent of hyphenation-keep, defined in https://www.w3.org/TR/css-text-4/#hyphenate-line-limits). Follow-up to commit 9574a62add8e4901405e12117e75c86c2d2c2f21 "tdf#132599 cui offapi sw xmloff: implement hyphenate-keep" and commit c8ee0e8f581b8a6e41b1a6b8aa4d40b442c1d463 "tdf160518 DOCX: import hyphenation-keep to fix layout". Change-Id: I3ac6d9e86d0ed1646f105de8607c0e8ebc534eaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165954 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2024-04-09Revert "Fix typo"Taichi Haradaguchi
This reverts commit 659051b7aa7eb9a142d044693409631cfa319b40. Reason for revert: "fo" is the "formatting objects" namespace in ODF, not a typo for "for". Change-Id: If2bef82b9aacb32a125728f548db4d85bee3ed56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165838 Tested-by: Jenkins Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
2024-04-06flatten for readabilityCaolán McNamara
no logic change intended Change-Id: I27b17634c86bb99d018e2c5991bbc909319e3b4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165856 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-04-06ofz#67867 Null-dereference READCaolán McNamara
Change-Id: Ia4d9097d05c250fffe938b283a3ca623f60b4b7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165855 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-04-06Fix typoAndrea Gelmini
Change-Id: I92c1b5f2ff3ba1e39b204a5b23f9bbc71e2b05f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165742 Tested-by: Taichi Haradaguchi <20001722@ymail.ne.jp> Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
2024-04-05Silence strange -Wmaybe-uninitialized with recent GCC 14Stephan Bergmann
...seen at least with some (--enable-dbgutil --enable-otpimized etc.) configuration and a recent GCC 14 trunk, > In file included from ~/gcc/inst/include/c++/14.0.1/map:62, > from xmloff/inc/txtflde.hxx:32, > from xmloff/source/text/txtflde.cxx:26: > In member function ‘std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_mbegin() const [with _Key = com::sun::star::uno::Reference<com::sun::star::text::XText>; _Val = std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> >; _KeyOfValue = std::_Select1st<std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> > >; _Compare = std::less<com::sun::star::uno::Reference<com::sun::star::text::XText> >; _Alloc = std::allocator<std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> > >]’, > inlined from ‘std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_begin() [with _Key = com::sun::star::uno::Reference<com::sun::star::text::XText>; _Val = std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> >; _KeyOfValue = std::_Select1st<std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> > >; _Compare = std::less<com::sun::star::uno::Reference<com::sun::star::text::XText> >; _Alloc = std::allocator<std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> > >]’ at ~/gcc/inst/include/c++/14.0.1/bits/stl_tree.h:737:25, > inlined from ‘std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::~_Rb_tree() [with _Key = com::sun::star::uno::Reference<com::sun::star::text::XText>; _Val = std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> >; _KeyOfValue = std::_Select1st<std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> > >; _Compare = std::less<com::sun::star::uno::Reference<com::sun::star::text::XText> >; _Alloc = std::allocator<std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> > >]’ at ~/gcc/inst/include/c++/14.0.1/bits/stl_tree.h:982:17, > inlined from ‘std::__cxx1998::map<_Key, _Tp, _Compare, _Alloc>::~map() [with _Key = com::sun::star::uno::Reference<com::sun::star::text::XText>; _Tp = std::__debug::set<rtl::OUString>; _Compare = std::less<com::sun::star::uno::Reference<com::sun::star::text::XText> >; _Alloc = std::allocator<std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> > >]’ at ~/gcc/inst/include/c++/14.0.1/bits/stl_map.h:314:7, > inlined from ‘std::__debug::map<_Key, _Tp, _Cmp, _Allocator>::~map() [with _Key = com::sun::star::uno::Reference<com::sun::star::text::XText>; _Tp = std::__debug::set<rtl::OUString>; _Compare = std::less<com::sun::star::uno::Reference<com::sun::star::text::XText> >; _Allocator = std::allocator<std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> > >]’ at ~/gcc/inst/include/c++/14.0.1/debug/map.h:136:7, > inlined from ‘constexpr void std::_Optional_payload_base<_Tp>::_M_destroy() [with _Tp = std::__debug::map<com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> >]’ at ~/gcc/inst/include/c++/14.0.1/optional:283:35, > inlined from ‘constexpr void std::_Optional_payload_base<_Tp>::_M_reset() [with _Tp = std::__debug::map<com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> >]’ at ~/gcc/inst/include/c++/14.0.1/optional:314:14, > inlined from ‘constexpr void std::_Optional_base_impl<_Tp, _Dp>::_M_reset() [with _Tp = std::__debug::map<com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> >; _Dp = std::_Optional_base<std::__debug::map<com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> >, false, false>]’ at ~/gcc/inst/include/c++/14.0.1/optional:466:53, > inlined from ‘constexpr std::enable_if_t<((bool)is_constructible_v<_Tp, _Args ...>), _Tp&> std::optional<_Tp>::emplace(_Args&& ...) [with _Args = {}; _Tp = std::__debug::map<com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> >]’ at ~/gcc/inst/include/c++/14.0.1/optional:915:18, > inlined from ‘void XMLTextFieldExport::SetExportOnlyUsedFieldDeclarations(bool)’ at xmloff/source/text/txtflde.cxx:2250:30: > ~/gcc/inst/include/c++/14.0.1/bits/stl_tree.h:733:73: error: ‘*(const std::_Rb_tree<com::sun::star::uno::Reference<com::sun::star::text::XText>, std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString, std::less<rtl::OUString>, std::allocator<rtl::OUString> > >, std::_Select1st<std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString, std::less<rtl::OUString>, std::allocator<rtl::OUString> > > >, std::less<com::sun::star::uno::Reference<com::sun::star::text::XText> >, std::allocator<std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString, std::less<rtl::OUString>, std::allocator<rtl::OUString> > > > >*)((char*)this + 32).std::_Rb_tree<com::sun::star::uno::Reference<com::sun::star::text::XText>, std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> >, std::_Select1st<std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> > >, std::less<com::sun::star::uno::Reference<com::sun::star::text::XText> >, std::allocator<std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> > > >::_M_impl.std::_Rb_tree<com::sun::star::uno::Reference<com::sun::star::text::XText>, std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> >, std::_Select1st<std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> > >, std::less<com::sun::star::uno::Reference<com::sun::star::text::XText> >, std::allocator<std::pair<const com::sun::star::uno::Reference<com::sun::star::text::XText>, std::__debug::set<rtl::OUString> > > >::_Rb_tree_impl<std::less<com::sun::star::uno::Reference<com::sun::star::text::XText> >, true>::std::_Rb_tree_header.std::_Rb_tree_header::_M_header.std::_Rb_tree_node_base::_M_parent’ may be used uninitialized [-Werror=maybe-uninitialized] > 733 | { return static_cast<_Link_type>(this->_M_impl._M_header._M_parent); } > | ^ Change-Id: I827e5a1de31006fbedd7857fd21fc5a9cb652172 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165822 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-04-03Fix typoAndrea Gelmini
Change-Id: I2271e31d2a57206954e166e71b16af092c11aab8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165741 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-04-02Related: tdf#39052 - chart ooxml: export formatted chart titlesBalazs Varga
texts properly to ooxml. Also adding "FormattedStrings" property for title objects to simplify the working of character formattings in editable chart shapes. TODO: odf import/export Change-Id: Ie27b4dee72c24fa6a2a4e2a7db8da7fa50eb8937 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165583 Tested-by: Jenkins Tested-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>