summaryrefslogtreecommitdiff
path: root/xmloff
AgeCommit message (Collapse)AuthorFilesLines
2016-11-21ODF: do not write an empty style:text-position="" attribute for CharEscapementEike Rathke1-1/+1
... and CharEscapementHeight if the Any is void. This was a real error complained about in the officeotron validation https://bugs.documentfoundation.org/attachment.cgi?id=128411 https://bugs.documentfoundation.org/show_bug.cgi?id=103493 Also showed up as console warning warn:legacy.osl:3269:1:xmloff/source/core/xmlerror.cxx:178: An error or a warning has occurred during XML import/export! Error-Id: 0x20040003 Flags: 2 ERROR Class: 4 API Number: 3 Parameters: 0: CharEscapement Exception-Message: UNKNOWN_PROPERTY Position: Public Identifier: System Identifier: file:///.../103493-LotroPlan%203.8.ods Row, Column: 2,1850164 Change-Id: Ifc634cc6b3d5d6dfa43741005ef0c9a1f7ff71fe (cherry picked from commit 8aec9057a169acfda6f2d986af93edca54677fd2) Reviewed-on: https://gerrit.libreoffice.org/30939 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-10-13catch the exception to prevent broken charts, tdf#98690Markus Mohrhard1-2/+9
Change-Id: I5958c87ca793c19d5c78dc829eb0ff0a1e04dffa (cherry picked from commit 0ab45be62bc1ffcbdd13aca7375fdcd1bbccb79a) Reviewed-on: https://gerrit.libreoffice.org/29682 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-09-09Resolves: tdf#101963 loading zh-TW ROC calendar use EE|E instead of YYYY|YYEike Rathke1-2/+8
This still (unnecessarily) prefixes with [~ROC] but preserves the intended "no leading zero" semantics. Change-Id: I154be0978a8147ceddefcb546c257d44f770b5de (cherry picked from commit 95c91f098e8974c41c8d403a351fe53db6822165) Reviewed-on: https://gerrit.libreoffice.org/28732 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-01Resolves: tdf#100182 index entries lost on saveCaolán McNamara1-0/+1
regression from... commit 3e6ba91e2d6d362f4af91566e740f5dbc310e026 Date: Wed Nov 25 10:53:40 2015 +0200 loplugin:unusedfields in include/xmloff Change-Id: I979743671e9a2e868d815f917427588b7b0320ba which removed ctor for sDocumentIndexMark and sDocumentIndex when it should have just removed sDocumentIndeb Change-Id: I5ed5a2d30a3f76c6b45bbf74a3720420d0fcf676 (cherry picked from commit 9292ca07dd3f9ee9dedd765ba7696a626bc25476) Reviewed-on: https://gerrit.libreoffice.org/28588 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2016-08-16XML number format: do not enquote space followed by minus, tdf#97837 follow-upEike Rathke1-7/+9
Which with [$kr.-406] #.##0,00;[RED][$kr.-406] -#.##0,00 saved and reloaded gave [$kr.-406] #.##0,00;[RED][$kr.-406]" -"#.##0,00 and thus an almost identical duplicated format with the built-in format. Change-Id: Ie39b97576842bc29ac301d2fe64f7331f6c57fc4 (cherry picked from commit 4d993ae8f267e35f7c030861a92226c940bb46cc) Reviewed-on: https://gerrit.libreoffice.org/28038 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-08-09xmloff: forms import: convert relative xlink:href to absoluteMichael Stahl1-1/+10
There is currently only one place in the forms directory that converts relative hyperlinks to absolute on import, in OURLReferenceImport::handleAttribute(), but there are other elements that have xlink:href attribute as well, such as form:form. The export of form:form xlink:href does convert absolute to relative, in exportTargetLocationAttribute(), but if the model URL is actually already relative it will be converted to absolute instead, oddly enough. This leads to different absolute href attributes, depending on the directory where the file is exported, as can be observed with e.g. ooo95698-1.odt and fdo40634-2.odt. Let's apply a big hammer and make all "href" attributes absolute on import. Change-Id: I39d05707f3a8a899c7bbde8d9c0e2bc006c39e12 (cherry picked from commit c49b87ac140f3f2c79c8211f38cd86118022bdce) Reviewed-on: https://gerrit.libreoffice.org/27901 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-06-16tdf#97837 Detect delimiter only for date, time, currencyLaurent Balland-Poirier1-8/+12
Other formats do not require delimiter Except for minus sign Change-Id: Ica5a62c175345062383247760fe5e2a061aeebe8 Reviewed-on: https://gerrit.libreoffice.org/24902 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit bd4ef2734b60d2188874178f173c9163ced09ce7) Reviewed-on: https://gerrit.libreoffice.org/26350
2016-05-30prevent out of bounds string accessEike Rathke1-2/+3
Yet another reminiscence of String to OUString conversion.. where the terminating NULL-character was obtained and SvNumberformat::InsertBlanks() effectively did nothing. Could be triggered already by entering an '_' underscore character as number format code, which is a place holder for blanks of the same width as the following character, which there isn't then yet. Change-Id: I0534e1417d4bd35e9e7ed4bd0170b9ea3b5fb575 (cherry picked from commit c75ce37560c05271ba56c9dd0d98c5001e83cc2f) Reviewed-on: https://gerrit.libreoffice.org/25692 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-05-30tdf#100134 xmloff: only update the progressbar twice for every percentMiklos Vajna1-3/+8
This restores the state before commit e1b78d36008d1fd188ca8dc154ad069d3476520c (#95181#; call the setValue method of the XStatusIndicator as often as possible to enable reschedule, 2001-11-26), which doesn't seem to be necessary anymore, perhaps due to the current scheduler that has priorities. Rather than a plain revert, still allow the progressbar to jump back, as that seems to be used relatively frequently. So just filter out the calls that would increment the value, but only with a small difference, compared to the shown value. Reviewed-on: https://gerrit.libreoffice.org/25654 Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 20ad9893d5d3be13d8aa17764e483afaa083b5c0) Change-Id: I7136b20f1c64e267b0b4a35bbe2564e5163d9468 Reviewed-on: https://gerrit.libreoffice.org/25664 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2016-05-30Choose ODF version for min-decimal-place and force-exponent-signLaurent Balland-Poirier2-12/+30
Change-Id: I873dbf53bbb865577fd51ee70142c1b45ea54ce2 Reviewed-on: https://gerrit.libreoffice.org/25588 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit e0c8c5b711e4cacb3f666a939f285289479d3d20) Reviewed-on: https://gerrit.libreoffice.org/25660 Tested-by: Eike Rathke <erack@redhat.com>
2016-05-25Resolves: tdf#97879 loop in style hierarchy on odt loopCaolán McNamara1-1/+7
Change-Id: I0098c434b89b6a57e8b888a4d4f643e4d0865d29
2016-05-25Convert XMLTextParagraphExport::FrameType to scoped enumNoel Grandin1-9/+9
Change-Id: I9e36f6566310e960a2b49f5a57f4b4491d32bb9a Reviewed-on: https://gerrit.libreoffice.org/25366 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-24Revert "remove some manual ref-counting"Noel Grandin1-3/+11
until I have a better understanding of the UNO reference counting. This reverts commit 111de438ea3e512a541281dc0716cc728ea8d152.
2016-05-24Convert XMLTextType to scoped enumNoel Grandin8-36/+36
Change-Id: Iac147e57784e11d29f2b34e60dc3c624d6090c8b Reviewed-on: https://gerrit.libreoffice.org/25367 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-24remove some manual ref-countingNoel Grandin1-11/+3
triggered when I noticed a class doing acquire() in the constructor and then release() in the destructor. found mostly by git grep -n -B5 -e '->release()' Change-Id: Ie1abeaed75c1f861df185e3bde680272dbadc97f Reviewed-on: https://gerrit.libreoffice.org/25363 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-20clang-tidy misc-assign-operator-signatureNoel Grandin1-1/+2
Change-Id: I2953a88d9e2f5923732865ef17615d5928ac5f5f Reviewed-on: https://gerrit.libreoffice.org/25154 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-19loplugin:unusedmethods in writerfilter to xmloffNoel Grandin7-69/+1
Change-Id: If95890eff0f785111e8b511ac1d5481c6910f099 Reviewed-on: https://gerrit.libreoffice.org/25148 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-19clang-tidy modernize-make-uniqueNoel Grandin1-4/+4
Change-Id: I550bb69ddcef69906027516ccde62cf8e87c295b Reviewed-on: https://gerrit.libreoffice.org/25138 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-18clang-tidy modernize-make-sharedNoel Grandin3-4/+4
Change-Id: I3fa866bfb3093fc876474a9d9db29fe05dc2af3a Reviewed-on: https://gerrit.libreoffice.org/25056 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-16Fix typosAndrea Gelmini1-1/+1
Change-Id: If7262e114b5b4cd40e9c0a8929940199ea747595 Reviewed-on: https://gerrit.libreoffice.org/25025 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-05-13clang-tidy modernize-loop-convert in writerfilter to xmlsecurityNoel Grandin10-46/+37
Change-Id: I334411c6b57c028ffb41b5deb72002f9d54038c3 Reviewed-on: https://gerrit.libreoffice.org/24923 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-12Convert SCA flags to scoped enumNoel Grandin6-123/+131
Change-Id: I761022dd78f6c1d19cf4f2650a5ac7b2212c11c3
2016-05-12Convert EA flags to scoped enumNoel Grandin3-22/+27
Change-Id: I7fbd4cea13fc311624804f7acd9dd66955b860d3
2016-05-12Convert BA flags to scoped enumNoel Grandin5-45/+52
Change-Id: I22a6f41091d69ad4ed91a745e9b7cbcebd9fad55
2016-05-12Fix bitmaskStephan Bergmann1-1/+1
...from e82fe5f00afe0364fbcbfea3e91e10b85faae34c "Convert BOOL_ATTR to scoped enum" Change-Id: I78500163391eae2927ea96d3f14bf4ea5535b0f6
2016-05-12Convert DA flags to scoped enumNoel Grandin6-63/+69
Change-Id: Iabbf4b32a1b5b47e6cfe791a15f111918d5bd3a9
2016-05-12convert CCA flags to scoped enumNoel Grandin8-215/+222
Change-Id: Ic52872ac60845e92cc3774c693fdd7918efefe89
2016-05-12Convert BOOL_ATTR to scoped enumNoel Grandin3-18/+23
Change-Id: I7991c6d05503dcbc1e5fd45d07227b766c409f65
2016-05-10Fix typosAndrea Gelmini1-2/+2
Change-Id: I1c1894fcf533291b34a662b6efb96dcfa75b92b3 Reviewed-on: https://gerrit.libreoffice.org/24760 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-05-10Add SAL_FALLTHROUGH, where apparently appropriateStephan Bergmann4-0/+10
Change-Id: I646abf83b4dce8c92a3ba1c136d968bb9291dd83
2016-05-10Replace fallthrough comments with new SAL_FALLTHROUGH macroStephan Bergmann15-28/+33
...which (in LIBO_INTERNAL_ONLY) for Clang expands to [[clang::fallthrough]] in preparation of enabling -Wimplicit-fallthrough. (This is only relevant for C++11, as neither C nor old C++ has a way to annotate intended fallthroughs.) Could use BOOST_FALLTHROUGH instead of introducing our own SAL_FALLTHROUGH, but that would require adding back in dependencies on boost_headers to many libraries where we carefully removed any remaining Boost dependencies only recently. (At least make SAL_FALLTHROUGH strictly LIBO_INTERNAL_ONLY, so its future evolution will not have any impact on the stable URE interface.) C++17 will have a proper [[fallthroug]], eventually removing the need for a macro altogether. Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
2016-05-09tdf#38097 min numerator/denominator at least 1Laurent Balland-Poirier1-3/+3
In <number:fraction> attributes min-denominator-digits and min-numerator-digits should be at least 1. Gnumeric can create file with 0 values Change-Id: I08ef51c23ce686136f51277671bf630807353484 Reviewed-on: https://gerrit.libreoffice.org/24670 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-05-09tdf#88657 calculate denominator lengthLaurent Balland-Poirier1-2/+4
Get length of denominator which could be different from numerator length Change-Id: I9f5c10917185eb029d52efbc0f20be5f81c74d10 Reviewed-on: https://gerrit.libreoffice.org/24712 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-05-09convert SfxStyleFamily to scoped enumNoel Grandin1-2/+2
and update the RSC compiler to accept such In the process fix some confusion in SD where it was confusing SfxStyleFamily and the index of the relevant family (which other parts of the code in SVL use) Change-Id: I1efc9f85fbed8ab76eafe8f6e1ada411753ae5f9
2016-05-06xmloff: C++ is an imperative language, so let's write imperative loopsMichael Stahl3-40/+15
... instead of some over-engineered pseudo-functional boostified monstrosity. What the hell was the original author thinking? Change-Id: I64581b3f78792933373ed8f74ebbb38a8a27f1f8
2016-05-04fix export crash test due to assert hit, tdf#61996 follow-upEike Rathke1-1/+8
Fallout of 88a79589843efc24f8af99bd511a1fff0f7bebef Cause was a crappy number format that now is parsed differently and results in UNDEFINED type, hence XMLTokenEnum was XML_TOKEN_INVALID which later made assert(XML_TOKEN_INVALID < eToken) in xmloff/source/core/xmltoken.cxx GetXMLToken() bail out. Handle that during export and map to number-style. An example of fdo82933-1.ods that triggered this is [>0]" $"\"#"٬##0٫"00"٬"\";[<0]" $("\"#"٬##0٫"00);" $-"\"#"٬"\";@ Already import massively complained about xmloff/source/style/xmlnumfi.cxx:1710: invalid number format but not only for this format, the document contains a pile of crappy stuff. Possibly number format code scanning could be improved to type that NUMBER instead, which it could be as only the #...00 and #...00) are actually digit related, everything else are string constants. However, that likely was not the intention of the document author.. Change-Id: I7c2b202b0b87e1a7fa7a9f56862a6bb7618ad9ff
2016-05-04use Any constructor instead of temporariesNoel Grandin51-746/+278
Change-Id: Iffb82a2cee1a28d89eeea2b905aaa14086ee475a
2016-05-04While at it, delete Any functions on sal_Bool*Stephan Bergmann3-18/+16
(at least for LIBO_INTERNAL_ONLY), to help further reduce the occurrences of sal_Bool across the code base Change-Id: I70654a0cb56655984c717b7b894f26c9ab47536e
2016-05-03Prevent Any::setValue from reinterpreting bool* as sal_Bool*Stephan Bergmann1-4/+2
...which only happens ot work in environments where sizeof (bool) == 1. The simpler alternative is to use the operator <<= template without passing explicit UNO type information, anyway. The std::nullptr_t overloads are needed to disambiguate calls with a nullptr argument. (Which can at least be meaningful for VOID, but for other types what it happens to do is store a default value of the given type.) As std::nullptr_t is only C++11, this all needs to be LIBO_INTERNAL_ONLY. Change-Id: Iff06a6ba94250bd4ae4afc937c2a2bfa75f0888f
2016-05-03tdf#31449 Correctly test if fraction has no integer partLaurent Balland-Poirier1-2/+2
Test if fraction format has no integer part is modified to take into account all cases: ??/?? or ##/## and do not detect false positive like ? ??/?? Change-Id: Ia8677a5ad496e5df56ce6bf1290323555e46ba0a Reviewed-on: https://gerrit.libreoffice.org/24540 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-05-03Remove unnecessary setBOOL, makeBoolAnyStephan Bergmann1-1/+1
Change-Id: Id82c3f352fcc2d4dafad877517098cb6f5d046d4
2016-05-03-Werror=maybe-uninitializedStephan Bergmann1-2/+2
Change-Id: I137814b80790b2cb4c8a2a2b78048024db0b4f86
2016-05-03use Any constructor for bool values, instead of temporary varsNoel Grandin21-240/+103
mostly found with: git grep -n 'setValue.*cppu.*UnoType.*bool.*get' Change-Id: Ie8e5aa6402d25dbe90b0f492031a245bb222c1a5 Reviewed-on: https://gerrit.libreoffice.org/24464 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-01Fix typos in codeAndrea Gelmini2-16/+16
Change-Id: I408f630732a10567a3352e0c96f1289a1cf6ca81 Reviewed-on: https://gerrit.libreoffice.org/24534 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-04-30Fix typosAndrea Gelmini2-3/+3
Change-Id: Id81b16ff26283611f0b84929d831c827f847ab73 Reviewed-on: https://gerrit.libreoffice.org/24317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-04-28teach stylepolice plugin about ref-counted-pointer namingNoel Grandin8-93/+93
Change-Id: I6e91d22fc1826038c05ddb6fc065563c6a250752 Reviewed-on: https://gerrit.libreoffice.org/24459 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-26simplifyStephan Bergmann1-4/+2
Change-Id: Iecb9ea0106cf57ef3c873d3a62407a3da5706d92
2016-04-26loplugin:salboolStephan Bergmann1-1/+1
Change-Id: I079d12c7d3406e371c434214f4ad66f6decab954
2016-04-26tdf#98163 Flush ressources at CustomShapes during importArmin Le Grand2-23/+23
During ODF import using API for CustomShapes Outliners and VirtualDevioces get created and not destroyed due to referencing. This makes the ressources blow up, even under 64bit windows. Also see tdf#93994 where this was already fixed on page base, but this is not sufficient for this case. Change-Id: If9b37d341fcfa4e65485c54054d47964ee2fff5f Reviewed-on: https://gerrit.libreoffice.org/24305 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2016-04-25Kill comphelper::MakeMapStephan Bergmann1-38/+25
Change-Id: I97e9e79ef51e3d78f01b831dd3eee91218058823 Reviewed-on: https://gerrit.libreoffice.org/24344 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>