summaryrefslogtreecommitdiff
path: root/xmloff
AgeCommit message (Collapse)AuthorFilesLines
15 hourstdf#160253: fix list identifier export decision codeMike Kaganski2-136/+88
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>
3 daysuse more OUString literalNoel Grandin1-16/+10
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>
3 daysUse designated initializers for clarityMike Kaganski1-2/+3
Change-Id: Ie10e657e07981e6fd0f0804371fd30f2b3f143b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166430 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
6 daysFix typoAndrea Gelmini1-1/+1
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>
6 daysFix typoAndrea Gelmini1-1/+1
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>
6 daysFix typoAndrea Gelmini1-1/+1
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>
6 daystdf#159903 xmloff: ODF import: fix bug in margin compatibility overrideMichael Stahl1-0/+8
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>
6 daystdf#160517 - chart odf: import/export formatted chart titlesBalazs Varga9-83/+334
(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>
8 daysDrop FRound, and use generalized basegfx::froundMike Kaganski1-7/+10
Change-Id: I7447e649dc3ef4e51242f69c7486a3e84e103d2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166159 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
12 dayscrashtesting: assert seen on importing forum-mso-en4-62805.xlsxCaolán McNamara1-1/+1
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>
14 daystdf#132599 cui offapi sw xmloff: add hyphenation-keep-typeLászló Németh5-5/+14
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 Haradaguchi1-1/+1
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 McNamara1-62/+61
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 McNamara1-12/+15
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 Gelmini1-1/+1
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 Bergmann1-0/+7
...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 Gelmini1-2/+2
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 Varga3-0/+6
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>
2024-03-29tdf#146619 Recheck xmloff/*cxx with IWYUGabor Kelemen16-17/+0
after cleaning up unused 'using namespace' clauses Change-Id: I9e4cd3790408ae6b0379819a8275feaf67e860cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164941 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-03-27add notify for script useCaolán McNamara1-0/+3
Change-Id: I84af197cec7755f6803a578e1e21c03966ad5f3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165403 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-25xmloff : no need to use OUString literal for comparisonArnaud VERSINI3-6/+6
Change-Id: I2b8f75ec56d93003d8c9c14b3cad1e3978cc6a39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165227 Tested-by: Jenkins Reviewed-by: Arnaud Versini <arnaud.versini@pm.me>
2024-03-23tdf#158067 Replace OUStringLiteral with _ustrRMZeroFour5-53/+23
As part of the efforts in #158067 to replace static constexpr OUStringLiteral variables with string literals of the form u""_ustr, this commit performs the replacements in some files of the xmloff module. Change-Id: Icce2ed7f9a69ef023aaff498975d6afabf161d4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165200 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-03-22Related: tdf#160056 refactor SvNumberFormatterCaolán McNamara1-1/+1
to split it into two constituent parts SvNFFormatData which is the data store for number formats it generally operates on. SvNFLanguageData for data around the current language in use. and then a SvNFEngine which implements the interaction between those parts SvNFEngine has two policies, the typical RW mode and a new RO mode where the SvNFFormatData doesn't change, all formats needed in this mode must already exist. Change-Id: I56b070ccd2e556a0cb1fe609a2fae28e18277c8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165146 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-21Related: tdf#160056 this can be staticCaolán McNamara2-2/+2
Change-Id: I1172854a1bf00e74adbe350c54e4e98ea38b0b35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165072 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-03-20tdf#158885 cui offapi sw xmloff: fix hyphenation at stem boundaryLászló Németh4-1/+6
Add new hyphenation option "Compound characters at line end", equivalent of libhyphen's COMPOUNDLEFTHYPHENMIN, to limit bad pattern based hyphenation of compound words using morphological analysis of Hunspell. * Add checkbox to Text Flow in paragraph formatting dialog window * Store property in paragraph model: css::style::ParagraphProperties::ParaHyphenationCompoundMinLeadingChars * Add ODF import/export (loext:hyphenation-compound-remain-char-count) * Add ODF unit tests Note: slower Hunspell based hyphenation is used only if ParaHyphenationCompoundMinLeadingChars >= 3 (we assume that libhyphen hyphenation patterns cover the smaller distances correctly). Hunpell based hyphenation doesn't introduce new hyphenation breaks, only detects the stem boundaries from the libhyphen based hyphenation breaks. Follow-up to commit c899d3608d30f3ab4c2bc193c1fcd765221614a4 "tdf#158885 sw: don't hyphenate right after a stem boundary", replacing hyphenation zone dependence with the new "Compound characters at line end". Note: preset COMPOUNDLEFTHYPHENMIN values aren't loaded yet from hyphenation dictionaries. Note: the suffix of the last stem of the compound is always hyphenated, i.e. the distance limits only hyphenation inside the stem, not inside its suffix or at the end of the stem before the suffix. Change-Id: I46a0288929a66f7453e3ff97fbc5a0c6a01f038f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164983 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2024-03-19Remove unused namespaces from xmloffGabor Kelemen40-57/+0
Change-Id: Id46c9512b8024c9dc50edfb200599b1901fbf3c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164940 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-03-18Clamp extrusion light level to allowed range for ODFRegina Henschel3-0/+17
With import of shapes in 3D-mode from pptx files, the internal values for light level might be outside the range 0..100 and thus not allowed in ODF. These high levels are needed to get a similar rendering to MS Office. The export to ODF clamps them now to the allowed range. I do not intend to change the export to loext namespace, because the extrusion mode of custom shapes needs a totally new handling. But that will not be possible timely for version 24.8. Change-Id: I839903cbaf1b304c1e0c4374080963bc70352e61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164948 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2024-03-18tdf#50934: Add a pie-with-remainder-as-another-pie chart typeKurt Nordback7-2/+45
Implement ODF import/export for bar-of-pie and pie-of-pie types, and add simple tests for this capability. The associated ODF tags are implemented in the loext namespace. This also required changing the schema. Change-Id: Ib55ae1c5818ad810f7b962d807a9163a3d02ba17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164436 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-03-14tdf#141908 - CppUnittests: replace usage of sal_Int32 with colorsRafał Dobrakowski1-4/+4
Conversion of hex/dec colour notation (example entry Color( 255, 255, 255), Color(0xFFFFFF) - COL_WHITE) For the other available colour definitions. Change-Id: I9eed0cd64adcbc8d25e1c22143a000906a457586 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163729 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-03-13tdf#141908 - CppUnittests: replace usage of sal_Int32 with colorsRafał Dobrakowski1-1/+2
Conversion of only one colour, Color(0, 0, 0), Color(0x000000) - COL_BLACK Change-Id: I4ba2412929522532d32304734b0269c70d75e5ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163460 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-03-12tdf#146619 Recheck xmloff/*cxx with IWYUGabor Kelemen155-304/+205
Change-Id: I6e39a223fd567d70254998e55de5110db87ab4fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164486 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-03-04tdf#132599 cui offapi sw xmloff: implement hyphenate-keepLászló Németh3-0/+15
Both parts of a hyphenated word shall lie within a single page with ODF paragraph setting fo:hyphenation-keep="page". The implementation follows the default page layout of MSO 2016 and newer by shifting the bottom hyphenated line to the next page (and to the next column, see last note). Note: this is a MSO DOCX interoperability feature, used also in DTP software, XSL and CSS. * Add checkbox/combobox to Text Flow in paragraph dialog * Store property in paragraph model (com::sun::star::style::ParagraphProperties::ParaHyphenationKeep) * Add ODF import/export * Add ODF unit tests New constants of com::sun::star::text::ParagraphHyphenationKeepType, containing ODF AUTO and PAGE (borrowed from XSL), and for the planned extension ParaHyphenationKeepType of ParagraphProperties: – 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). Note: the implementation truncates only a single hyphenated line, like MSO does: the pages can end in hyphenated lines (i.e. in the case of consecutive hyphenated lines), but less often, than before. Clean-up hyphenation dialog by collecting "Don't hyphenate" options at the end of the hyphenation settings, and negating them (similar to MSO and DTP), adding also the new option "Hyphenate across column and page": [x] Hyphenate words in CAPS [x] Hyphenate last word [x] Hyphenate across column and page Note: ODF fo:hyphenation-keep has got only "auto" and "page" attributes, while XSL defines also "column". Because of the interoperability with MSO and DTP, fo:hyphenation-keep="page" is interpreted as XSL "column", avoiding hyphenation at the end of column, not only at the end of page. Change-Id: I5c6b7adc0671a5a790568e7bf1d33256e607f85f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164158 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2024-03-01tdf#146356 insert new paragraph before table of contentsOliver Specht1-0/+6
Alt+Enter inserts the new paragraph before the content section of a table of contents. At the same time protected indexes now also have the header protected. Change-Id: Iff267691d96796158c1593c4269b76226840c952 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164050 Tested-by: Jenkins Tested-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-02-28tdf#159874: Inspection of 3D object in Dev Tools crashes LO (take 2)Julien Nabet1-5/+6
To not trigger tdf#159911 (FILEOPEN: 3D object is displayed as black/white) Let's initialize Svx3DTextureKindItem to 2 which corresponds to COLOR in TextureKind2.idl (see https://opengrok.libreoffice.org/xref/core/offapi/com/sun/star/drawing/TextureKind2.idl?r=5687eba4) but now to avoid the crash, we must replace all uses of TextureKind by TextureKind2 Anyway, TextureKind has been deprecated since 2000 (see https://cgit.freedesktop.org/libreoffice/core/commit/?id=4f9e6d84feb36ab3072dafbab0ba4ae46d264f9b "#80594# added a new TextureKind2 enum because of missing value in TextureKind") + use css::drawing::TextureKind2_LUMINANCE + css::drawing::TextureKind2_COLOR instead of wrong numbers Change-Id: I969bd9ba1c6752111a6e6f5cd2c6c608568e43e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163998 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2024-02-26tdf#143148 Use pragma once instead of include guards in vcl and xmloffanish.deshpande1-4/+2
Change-Id: I317da0a6f626e8ddb3f090099347b130e99ff2a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163856 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-02-19tdf#50934: OfPie inport from OOXML, plus initial work for exportKurt Nordback1-0/+1
Change-Id: Ie17b583af28d274b3e7817c646dd4f5873e03fef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160733 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-02-17Generalize search algorithms in sorted_vectorMike Kaganski2-6/+8
This allows to simplify the code somewhat, and also to relax requirements to the arguments, e.g. allowing to pass const objects to search in vector containing non-const objects. Change-Id: Id34911a8694bbdec275d22b51ca4a0845c9fa4c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163519 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-02-14tdf#141908 replace usage of sal_Int32 with colors in xmloffIlmari Lauhakangas1-6/+6
Change-Id: Ia2661fa0f6864d6553e5cca7469e1d351bb06d17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163305 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-02-12use more UNLESS_MERGELIBSNoel Grandin1-1/+2
Change-Id: I351a9127fb26369d8f598b6d6519d7e490fa476b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163190 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-01-27Drop std::as_const from css::uno::Sequence iterationsMike Kaganski18-34/+34
Obsoleted by commit 2484de6728bd11bb7949003d112f1ece2223c7a1 (Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and commit fb3c04bd1930eedacd406874e1a285d62bbf27d9 (Drop non-const Sequence::operator[] in internal code, 2021-11-05). Change-Id: Idbafef5d34c0d4771cbbf75b9db9712e504164cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162640 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-26Don't export printer name & config in privacy modeSamuel Mehrbrodt1-0/+10
Don't export printer name & printer config when RemovePersonalInfoOnSaving is enabled, as it might contain sensitive data such as printer location. Add an option to export printer settings even when RemovePersonalInfoOnSaving is enabled. Change-Id: I3d2ca91ad2032050c919d382c11c9ceabf331770 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162577 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2024-01-25Don't export personal metadata when user wishes not toSamuel Mehrbrodt1-18/+22
Currently the metadata is only reset to default when the option to remove personal metadata is active. And some metadata was still exported which might contain personal data. Now the following elements won't be exported anymore when the RemovePersonalInfoOnSaving option is set to true: * meta:initial-creator * meta:creation-date * dc:date * dc:creator * meta:printed-by * meta:print-date * meta:editing-duration * meta:editing-cycles * meta:template Change-Id: Ibad57fdbff04bf285881826820ec3ddb01ffbb36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162553 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2024-01-22tdf#146619 Recheck xmloff/*hxx with IWYUGabor Kelemen34-77/+27
Change-Id: I09676a038370ca76ad4d4ef54dae14fbd3bd287f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162319 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-01-19tdf#106733 sw: implement CharNoHyphenationLászló Németh1-1/+1
Implement CharNoHyphenation character property to disable automatic hyphenation of words in paragraphs with enabled hyphenation. Fix also fo:hyphenate mapping to CharNoHyphenation using automatic inversion of their boolean values defined by xmloff's XML_TYPE_NBOOL, as suggested by Michael Stahl. Update also the test for tdf#159102 to check the available hyphenation dictionary (also custom hyphenation patterns work only with supported locales of the hyphenator). Note: patch of thints.cxx contains also partial revert of commit 53b289eabb3d265b47bc7fb6cc430291c97f0c0b "use more TypedWhichId". Follow-up to commit 73bd04a71e741788a2f2f3b26cc46ddb6a361372 "tdf#106733 xmloff: keep fo:hyphenate in character formatting". Change-Id: If99b94ddcd44a5c2426e646be149078a3b9773b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162300 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2024-01-19tdf#106733 xmloff: keep fo:hyphenate in character formattingLászló Németh2-2/+3
In the case of character formatting, map fo:hyphenate to the unused CharNoHyphenation character property to keep it during ODF import/export instead of losing it completely. This is the first step to disable hyphenation for single words or text spans in paragraphs with automatic hyphenation. Note: using fo:hyphenate as character property is part of the ODF standard. Note: the old workaround to disable hyphenation, changing the language of the text to None had got some serious fallbacks: losing spell checking and losing language-dependent text layout (supported by both OpenType and Graphite font engines in LibreOffice). Change-Id: I9565c3efbbb6e6d970fb03710e8c932ad72ab57e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162257 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2024-01-09xmloff: ODF export: if there's no checksum, don't generate chaffMichael Stahl1-2/+14
Change-Id: I2e1bb6ed33df327ebd797edeca7ee82b75c524b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161800 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-01-08cid#1560054 use RVOCaolán McNamara1-7/+5
Change-Id: I04644c9ca78930d42289368b9a596f44a14b7012 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161746 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-03UnoApiTest::loadFromURL -> UnoApiTest::loadFromFileMike Kaganski4-52/+52
The old name was misleading (it doesn't take an URL, but a filename); also, now it's easier to grep for it - doesn't get mixed with vcl::graphic::loadFromURL. Change-Id: Ib88d2194200a6a54d2326971e0306ba39f0c7025 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161578 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-02ofz#65464 Timeout with text:anchor-page-number="28031970720"Caolán McNamara2-2/+6
text:anchor-page-number is problematic, possibly more so since commit 23eadd873de2e56d1e5f866fefae25c648f302f9 Date: Wed Jun 28 17:19:02 2023 +0200 tdf#156077 sw: layout: call AssertFlyPages() in Init() in that missing pages are added to get to the page the object claims to be anchored to, to a max of 32767 Limit this to 100 like: commit e4ee999d6d9c10ee10d6778eca9354d8fbaa720f Date: Sun Jul 23 21:34:23 2023 +0100 ofz#60533 Timeout with fo:font-size="842pt" when fuzzing to get reasonable performance Change-Id: Ic7568fe9535bdd07557434c8b51c1532415822a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161542 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-30cid#1545421 COPY_INSTEAD_OF_MOVECaolán McNamara1-2/+1
and cid#1545403 COPY_INSTEAD_OF_MOVE cid#1545397 COPY_INSTEAD_OF_MOVE cid#1545376 COPY_INSTEAD_OF_MOVE cid#1545339 COPY_INSTEAD_OF_MOVE cid#1545288 COPY_INSTEAD_OF_MOVE Change-Id: I0e24a3fc7148d0b7ff8126debe3cddbb4fbdd713 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161453 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>