summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)Author
2018-09-17New loplugin:externalStephan Bergmann
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-13loplugin:constfields in writerfilterNoel Grandin
Change-Id: Ibe380e1fb35d9defc478d459a988f9f6df13bf35 Reviewed-on: https://gerrit.libreoffice.org/60427 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-13loplugin:simplifyconstruct in writerfilter..xmlsecurityNoel Grandin
Change-Id: Ic2d901ca0dbc2d6fa96611d260c1572da8a783c0 Reviewed-on: https://gerrit.libreoffice.org/60398 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-12~revert tdf#103961: delay merge of default props until exportJustin Luth
partial revert to fix tdf#119589 Although it was working fine for DOC/DOCX formats, ODT doesn't save the working document's defaults to the file. Instead it just writes the application's built-in docdefaults, and just throws away the current working state. Unbelievable. But changing this results in invalid ODF syntax, so not trivial. So, it wasn't working to change the format from DOCX to ODT. Since this patch was just "future-looking" and didn't immediately solve a particular problem, I'm just reverting part of it, so that parentless styles once again copy the default settings. This means that table-style settings cannot override system defaults since it cannot know whether the style specified that value, or if it just got a copy of the defaults. (Just becuase the style matches the docDefaults doesn't necessarily mean that it inherited them - unless it is parentless...) Change-Id: I61dd7866b42f79d91645ee65ff84b734ed2a53cf Reviewed-on: https://gerrit.libreoffice.org/60366 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-09-11ofz#10228 Integer-overflowCaolán McNamara
Change-Id: Ifb7e6ad6f5ffe71c3c5bb7cca9cb3b27bff7943a Reviewed-on: https://gerrit.libreoffice.org/60308 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-11clang-tidy bugprone-copy-constructor-initNoel Grandin
Change-Id: Idd435b3a4d081f6d3af26ff8add69ad4af50db57 warning: calling a base constructor other than the copy constructor Reviewed-on: https://gerrit.libreoffice.org/60239 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-06ofz#10228 Integer-overflowCaolán McNamara
Change-Id: I09cb2e8f4af7d34c32accf2590695799d0613d62 Reviewed-on: https://gerrit.libreoffice.org/60070 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-06WaE: -Wmaybe-uninitializedCaolán McNamara
Change-Id: I41c965512085cc56c06fb735d8ef86aaf3ecdbe9 Reviewed-on: https://gerrit.libreoffice.org/60071 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-05tdf#90906 writerfilter: Allow COL_AUTO to override non-autoJustin Luth
If the inherited properties define a non-auto color, then a specified COL_AUTO needs to be returned in order to override the inherited color. This affects three areas. Character fill, Paragraph fill, and table cell fill. The unit tests cover all three areas. This patch depends on the commits for tdf#91292 Change-Id: I1a043d2224b164c6c411ce2e46d899212f2b7f3d Reviewed-on: https://gerrit.libreoffice.org/59313 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-09-05clang-tidy performance-inefficient-vector-operationNoel Grandin
Change-Id: Iebcaea7b08c5284946d83b6b6b9ed26b218025d4 Reviewed-on: https://gerrit.libreoffice.org/59992 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-03tdf#82177 ooxmlimport: ignore direct insideV/H cell bordersJustin Luth
17.4.25 insideV (Table Cell Inside Vertical Edges Border) This element specifies the border which shall be displayed on all interior vertical edges of the current group of table cells. [Note: Although individual table cells have no concept of n internal edge, which would render this property useless in most cases, it is used to determine the cell borders to apply to a specific group of cells as part of table conditional formatting in a table style, for example, the inside vertical edges on the set of cells in the header row. end note] So, I interpret this as insideV/H having meaning only within table styles, and not when directly applied to a cell. The only documents I've seen with insideV/H directly applied to a cell seem to have been created by LO - which dumps them everywhere, redundantly. Change-Id: Ie76e9af6845cc87b0b847050b031e57d95b1a31b Reviewed-on: https://gerrit.libreoffice.org/59674 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-03tdf#104354 writerfilter: not FirstParaInSection if InFootOrEndnoteJustin Luth
or InComment. The first footnote does not get special treatment in autospacing either, so no exception needs to be made for it like in autospacing, unlike many other "firsts". The unit test is simply preventative. I'm a bit surprised, but the section isn't even marked as "IsFirstSection" until after the comment and footnote paragraphs are finished. That seems a bit odd to me, since they are in the FirstSection after all. Change-Id: Ib0107c969bf624e44f0c78b936bf9531fd25bfc2 Reviewed-on: https://gerrit.libreoffice.org/59858 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2018-09-02tdf#104354 writerfilter: rewrite AutospacingJustin Luth
which also resolves a regression from tdf#113258. The previous code segments were being spread out all over the place. It all consolidates nicely in finishParagraph, and the code is much easier to read using the new GetAnyProperty function. Plus there were regressions creeping in. The mere presense of the Autospacing property normally, but not necessarily means that it is on. Verify that it is enabled, and update grabbag if autoSpacing changes. Additionally, support was added for a zero top margin for the first paragraph of the document. This will be too hard to backport since it depends on 150c12fc0fba2c2f4b08b4298678ee49676ebae0 from tdf#72560 and the many code fixes related to GetPropertyFromStyleSheets. Change-Id: Iaf1600fffea54e9800e215e89cad40006d5bcdda Reviewed-on: https://gerrit.libreoffice.org/59705 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2018-09-02tdf#119188 DOCX import: fix zero margins of numbered lines in cellsLászló Németh
regression from 5c6bce38a01b21403a603acd3148cf3bbb4c685f (tdf#104354 DOCX import: fix paragraph auto spacing in tables). Change-Id: I486d155eb4463599ab922837fd2f4347b48e0851 Reviewed-on: https://gerrit.libreoffice.org/58818 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2018-09-01remove single-value variable: nCellJustin Luth
pulled in from OOo project as a single call being passed nCell = 0. Change-Id: I90899e9b5270d809dbdc37915a5ec31fc43f1f22 Reviewed-on: https://gerrit.libreoffice.org/59673 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-08-29Replace find_if with proper quantifier algorithmsArkadiy Illarionov
Change-Id: Icc820a47ac891c358883f9c01224f676c58fdd11 Reviewed-on: https://gerrit.libreoffice.org/59744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-28writerfilter: not FirstParaInSection if IsInShapeJustin Luth
Since anchored objects can contain paragraphs, considering all of them to be "firstParagraphs" would generally be considered an incorrect result. Browsing through the existing uses of IsFirstPara.*InSection I didn't see any that looked like it should be considered true if IsInShape. Since this is the kind of gotcha that that the programmer should be aware of, add it directly into the function instead of requiring each use to have an additional qualification. The following ooxml unit tests match these conditions, but only one was fixed - the rest were unaffected since they just avoided adding/removing dummy paragraphs. fdo79540.docx - 5 tblppr-shape.docx - 5 ooo47778-3.odt- 5 ooo47778-4.odt- 5 textbox-rounded-corners.docx - 7 n780563.docx - 8 missing-path.docx - 10 floating-tables-anchor.docx - 10 tdf117805.odt - 11 (fixed - prevented extra section paragraphs) Change-Id: I841475e214c194a673321c1229d9254dd07205f8 Reviewed-on: https://gerrit.libreoffice.org/59659 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2018-08-27tdf#119143: introduce tentative directional embedding import supportMike Kaganski
ECMA-376-1:2016 states that w:dir is functionally equivalent to LRE/RLE+PDF pair around the enclosed runs. So this patch does just that. Change-Id: Ibf9775338cc38a3bbc38a42a33fc64ae787b478f Reviewed-on: https://gerrit.libreoffice.org/59643 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-08-27writerfilter: build-time test for unexpected data typesMiklos Vajna
So next time I write <data type="ST_Foo"> instead of <ref name="ST_FOO">, I get an error quickly. Change-Id: Ida91b8ebe68915e22c62addffafe418ab29b1158 Reviewed-on: https://gerrit.libreoffice.org/59661 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-27SW_DEBUG_WRITERFILTER: Use configured TEMP path instead of hardcoded /tmpMike Kaganski
This allows using the logger on Windows with default settings (not having TAGLOGGERTMP variable set). Change-Id: Ic2be0ae90b2278b8c605aaa9f16f71fa16e7fcfe Reviewed-on: https://gerrit.libreoffice.org/59657 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-27Resolves: tdf#118382 crash on paste of rtfCaolán McNamara
into an existing document since.... commit deaa16bd24fba4a3a6b072ab2b94542a7dbd41c6 Author: Serge Krot <Serge.Krot@cib.de> Date: Mon Jan 29 12:17:06 2018 +0100 tdf#72942 Do not overwrite styles from the inserted doc During inserting of the text from the external document we should not change original default styles in currently opened document. because missing styles aren't created, so there's exceptons thrown on their use. I see that the m_bIsNewDoc flag is already checked for since... commit 5ebe826caf75e8d00656b3333385bf0bbc05cb27 Author: Miklos Vajna <vmiklos@collabora.co.uk> Date: Fri Oct 4 11:02:59 2013 +0200 fdo#69384 fix impress -> writer copy&paste Regression from 2ade07126971b79c92f729fae5709f2e2e2b495c (fdo#62044 RTF import: don't overwrite existing styles when pasting, 2013-06-04), during paste, if existing style was found, then the intention was to skip that style, but instead we tried to create one. in the body of the following loop, which should mean that existing styles are left alone and only missing styles created if we remove this hunk of the tdf#72942 commit Change-Id: Ia4aedb5e309c991490656061aa20d11ff24f4f9e Reviewed-on: https://gerrit.libreoffice.org/59519 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-25ofz#10056 Null derefCaolán McNamara
Change-Id: I9ea0f272d0a8b13fb51fec55ac57adca47cafc77 Reviewed-on: https://gerrit.libreoffice.org/59596 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-24ofz#10045 Null derefCaolán McNamara
Change-Id: If9c8edd94b02240510325d6c9c0fc7584ba89b5f Reviewed-on: https://gerrit.libreoffice.org/59571 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-21tdf#57589 writerfilter: support hash-encoded colorsJustin Luth
Previously, a hash-encoded value would simply fail to zero and thus the color would be dark black. The unit test covers two conditions. Paragraph 1 has a valid encoding, and pararaph 2 has an invalid coding (which is ignored and fails to COL_AUTO). Change-Id: I68940f5c4b0975a87feb6cab8fb3572b7546a077 Reviewed-on: https://gerrit.libreoffice.org/59295 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-08-17ofz#9934 null derefCaolán McNamara
Change-Id: I6833ad8a556b561a37e468da8845914cabfac4c5 Reviewed-on: https://gerrit.libreoffice.org/59246 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-16tdf#113608 DOCX import: don't use numbering of removed paragraphsLászló Németh
to avoid direct numbering of the unnumbered paragraphs later using numbering of the removed w:r-less paragraph incorrectly. Test file and clean up by Justin Luth. Change-Id: I821eed11f96e56e945aa88da03cc84e29322195a Reviewed-on: https://gerrit.libreoffice.org/59117 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2018-08-16tdf#106572 writerfilter: don't write to dummy paragraphJustin Luth
I found a few existing unit tests that this fixes, and a few unit tests that already worked without this. So something else is at play here, but it doesn't appear to be hurt by this fix since each one still starts with "First Page" style. Change-Id: Idc61279fc5fddc9df62b6ab7a9bcd3822d52cbbb Reviewed-on: https://gerrit.libreoffice.org/59033 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org>
2018-08-15RTF picture sizes are 32-bit signedStephan Bergmann
...not 16-bit unsigned. Word2007RTFSpec9.docx states "A small number of control words take values in the range −2,147,483,648 to 2,147,483,647 (32-bit signed integer)." and for \picwN, \pichN, \picwgoalN, and \pichgoalN it states "The N argument is a long integer." This was found with Clang's new -fsanitize=implicit-conversion during CppunitTest_writerfilter_rtftok, where writerfilter/qa/cppunittests/rtftok/data/pass/TCI-TN65GP-DDRHDLL-partial.rtf contains "\pich81306": > Testing file:///home/sbergman/lo/core/writerfilter/qa/cppunittests/rtftok/data/pass/TCI-TN65GP-DDRHDLL-partial.rtf: [...] > writerfilter/source/rtftok/rtfdispatchvalue.cxx:770:48: runtime error: implicit conversion from type 'int' of value 81306 (32-bit, signed) to type 'sal_uInt16' (aka 'unsigned short') changed the value to 15770 (16-bit, unsigned) > #0 in writerfilter::rtftok::RTFDocumentImpl::dispatchValue(writerfilter::rtftok::RTFKeyword, int) at writerfilter/source/rtftok/rtfdispatchvalue.cxx:770:48 (instdir/program/libwriterfilterlo.so +0xb96f2f) > #1 in writerfilter::rtftok::RTFTokenizer::dispatchKeyword(rtl::OString const&, bool, int) at writerfilter/source/rtftok/rtftokenizer.cxx:311:29 (instdir/program/libwriterfilterlo.so +0xd86c93) > #2 in writerfilter::rtftok::RTFTokenizer::resolveKeyword() at writerfilter/source/rtftok/rtftokenizer.cxx:243:12 (instdir/program/libwriterfilterlo.so +0xd84b06) > #3 in writerfilter::rtftok::RTFTokenizer::resolveParse() at writerfilter/source/rtftok/rtftokenizer.cxx:123:27 (instdir/program/libwriterfilterlo.so +0xd8299a) > #4 in writerfilter::rtftok::RTFDocumentImpl::resolve(writerfilter::Stream&) at writerfilter/source/rtftok/rtfdocumentimpl.cxx:786:27 (instdir/program/libwriterfilterlo.so +0xbf03bd) > #5 in RtfFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at writerfilter/source/filter/RtfFilter.cxx:144:20 (instdir/program/libwriterfilterlo.so +0x132d911) > #6 in RtfTest::load(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int) at writerfilter/qa/cppunittests/rtftok/testrtftok.cxx:58:27 (workdir/LinkTarget/CppunitTest/libtest_writerfilter_rtftok.so +0x15c6e) > #7 in test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) at unotest/source/cpp/filters-test.cxx:130:20 (workdir/LinkTarget/CppunitTest/../Library/libunotest.so +0x5724c) > #8 in test::FiltersTest::testDir(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) at unotest/source/cpp/filters-test.cxx:155:5 (workdir/LinkTarget/CppunitTest/../Library/libunotest.so +0x57ec9) > #9 in RtfTest::test() at writerfilter/qa/cppunittests/rtftok/testrtftok.cxx:78:5 (workdir/LinkTarget/CppunitTest/libtest_writerfilter_rtftok.so +0x16214) (Needs to add o3tl::clamp as a compatibility wrapper for C++17 std::clamp.) Change-Id: I515e70a435c2585777062fd5a27d1de8ddbe1b74 Reviewed-on: https://gerrit.libreoffice.org/59038 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins
2018-08-14create appendCopy method in OUStringBufferNoel Grandin
so we can avoid temporary copies when appending a substring of an OUString to the buffer. I would have preferred to call the method just "append" but that results in ambiguous method errors when the callsite is something like sal_Int32 n; OUStringBuffer s; s.append(n, 10); I'm not sure why Change-Id: I6b5b6641fcb5b26ce2269f89ef06e03c0b6aa76f Reviewed-on: https://gerrit.libreoffice.org/58666 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-13ofz#9870 check sequence length before useCaolán McNamara
Change-Id: I137a9de49c5a73eb5f277dc1519e5e036abba31c Reviewed-on: https://gerrit.libreoffice.org/58945 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-13cleanup tdf#72560 writerfilter: set in defaults, not stylesJustin Luth
These "unspecified" defaults are best set in document defaults, not in the style itself. Otherwise things like table styles don't know whether they can override that property. Most of the existing logic was no longer necessary, since a more generic fix ensured that all parentless styles inherited all docDefaults. Change-Id: I0ae0ccc4d69c784611fd762b5aed6e924196caf1 Reviewed-on: https://gerrit.libreoffice.org/58829 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-11writerfilter: ensure bidi has expected valueJustin Luth
In case the document has an unexpectedly high positive value for bidi, don't let that mess up the logic. Change-Id: I133dbec738a7503dff49b2af6d1a35b2f7754a9d Reviewed-on: https://gerrit.libreoffice.org/58827 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-08-10cleanup tdf#106062 writerfilter: use new GetAnyProperty functionJustin Luth
Change-Id: I88945bbaaf07e3b068c63f17c654c5f7fee9d20a Reviewed-on: https://gerrit.libreoffice.org/58828 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-08-08tdf#103961: delay merge of default props until exportJustin Luth
Until now, during docx import the pPrDefault properties have been directly added to the parentless styles. However, things like table styles are supposed to over-ride these document defaults, but not style defaults. Since the docDefaults are merged into the style, table-styles were unable detect if they could override them. Exporting doesn't export pPrDefaults well, so the properties still need to be merged into the style when round-tripping. Almost every existing unit test document is a proof test. It effectively ought to act as a non-functional change. Plus, this basically reverts 7f697ec27b1175ed94228155935d9ccd3cd5606c so that unit test still covers bug 103961. Change-Id: I4948299ddd610c07d828f2bd57c58734f1b94c49 Reviewed-on: https://gerrit.libreoffice.org/58203 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-08tdf#119136 GetPropertyFromStyleSheet infinite loopJustin Luth
So, apparently we accept a style that has no styleId and define it as such. Due to some reworkings, this function was called instead. Since we can "find" a style without a name, now every parentless style thought it inherited from this nameless style. Change-Id: I47b4119abd37ece94a39e636ddb7798b809ccb04 Reviewed-on: https://gerrit.libreoffice.org/58705 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-08-06related tdf#103961 writerfilter: DocDefaults -> defaultsJustin Luth
Effectively should be an NonFunctional Change. Both LO and .docx format have an ability to specify document-wide properties. However, on import the defaults are being directly applied to the styles, and no internal defaults were being set. This patch changes it so that the style:default-style for the paragraph family gets the DocDefaults. Now "Standard" is treated just like any other style. This just opens up more possibilities for the future. Currently, the lack of export support hinders doing anything further. Thus the defaults are still being directly applied to the styles. Change-Id: Ibd1225c5a2dd021b4ce2e57241f0ee99969a0c68 Reviewed-on: https://gerrit.libreoffice.org/57932 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-08-03Move angle normalization code from various places to toolsMike Kaganski
Also rename svx angle normalization functions in include/svx/svdtrans.hxx, that deal with 100ths of degree, to avoid confusion: NormAngle180 -> NormAngle18000; NormAngle360 -> NormAngle36000. Some places were fixed that previously returned inclusive ranges (i.e., both 0 and 360), see changes in these files: chart2/source/view/main/PlottingPositionHelper.cxx chart2/source/view/main/PolarLabelPositionHelper.cxx chart2/source/view/main/ShapeFactory.cxx filter/source/graphicfilter/idxf/dxf2mtf.cxx sw/source/core/graphic/grfatr.cxx (the latter now matches the comment in the function). Change-Id: I9f274bbb4168360d60dceff02aeba6332c519a59 Reviewed-on: https://gerrit.libreoffice.org/58556 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-08-02[API CHANGE] add some more asserts to the string functionsNoel Grandin
rtl_[u]String_alloc now requires that the length be >= 0. Since this function is only @since Libreoffice 4.1, it is unlikely to be widely used externally. Removed some unit tests that were testing invalid or out of range paramers, which are already not allowed according to the documented contract of those functions. The change in writerfilter is because the new asserts triggered when running testFdo74745 The change in SwTextNode::EraseText is because testFdo60842 triggered the assert in replaceAt. The change in SwFieldSlot::SwFieldSlot is because testMoveRange::Import_Export_Import triggered the assert in replaceAt. The changes in SwFieldSlot::SwFieldSlot and TabControl::ImplGetItemSize are due to failures in the uitests. Change-Id: Ib317261067649b0de96df12873ce31360cd24681 Reviewed-on: https://gerrit.libreoffice.org/58390 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-01tdf#118949 don't set zero auto top margin in every first paragraphLászló Németh
of sections, only in table cells. Partially revert of the commit 0307a62790b33ee0c02c2323a8f759e53e2035a4. Change-Id: I1daf1bc49ce1acf42a55857c1b6b92c7cbcb8e00 Reviewed-on: https://gerrit.libreoffice.org/58431 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2018-08-01forcepoint#62 null derefCaolán McNamara
Change-Id: I255aeb96c3763aa106128d3463e4fd55395ef8b8 Reviewed-on: https://gerrit.libreoffice.org/58408 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-01forcepoint#56 null derefCaolán McNamara
Change-Id: Iaa9c4d6901a340145412fa46eaf5c292c3fb62e8 Reviewed-on: https://gerrit.libreoffice.org/58385 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-01forcepoint#58 null derefCaolán McNamara
Change-Id: I826890ec85a16bc05fc1e4cd068079b0f8734d07 Reviewed-on: https://gerrit.libreoffice.org/58393 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-01tdf#118521 writerfilter: ContextMargin grouped with Top/BottomJustin Luth
fixes tdf#104348, but tagging with the bug# of the initial fixes. Internally, EditEng holds Top/Bottom/Context settings in one object, so if only one piece is set, the cloned object starts with docDefaults, so the un-initialized parts also need to be specified with the values they inherit from their style. So this patch makes two corrections. The first is grouping ContextMargin with top/bottom. The second correction is to check the entire style-chain instead of only the direct style for the inherited property. Change-Id: Ie1d4c9538aefece4ff8b7287242c7f4d33319b3b Reviewed-on: https://gerrit.libreoffice.org/57914 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2018-07-31writerfilter: create StyleSheetEntry::GetMergedInheritedPropertiesJustin Luth
This is a useful function. Make it more widely available. Change-Id: I729c908eaf26e17c16198d14dcb89069ec6ca70c Reviewed-on: https://gerrit.libreoffice.org/58261 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-07-30related tdf#72560 writerfilter: also check rPrDefaultsJustin Luth
So far I've been fixated on paragraph properties, but styles (both character and paragraph) also inherit the rPrDefaults. One enhancement could be to check the styleType and skip the paragraph stuff for character styles, but that doesn't seem necessary or valuable at this point. The unit test is pre-emptive. Change-Id: I4e898f5fa573b62be4dc70512b02cdeb7b21e7c6 Reviewed-on: https://gerrit.libreoffice.org/58257 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org>
2018-07-29loplugin:stringloop in variousNoel Grandin
Change-Id: Ic2436c6d94729211cd5bc72fee18af228381e4a3 Reviewed-on: https://gerrit.libreoffice.org/58250 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-28writerfilter: unit test that no w:default still uses "Normal"Justin Luth
Note: the unit test does NOT test the changes in GetCurrentParaStyleName. That is just a logical change and this unit test asserts the validity of the intention. Word 2013 was used to confirm that Normal is used for styleless paragraphs even if it is not marked as "default". Change-Id: I405591b40ed9028b292e99ba2833c25a24e089ac Reviewed-on: https://gerrit.libreoffice.org/58161 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2018-07-27writerfilter python: 2 blank lines after class/function definitionMiklos Vajna
To be in sync with PEP8. Change-Id: If712dc4eac675abb011543f2ea54a2de085e6ad8 Reviewed-on: https://gerrit.libreoffice.org/58163 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins
2018-07-27tdf#117988 writerfilter: IgnoreTabsAndBlanksForLineCalculationJustin Luth
Introduced in LO 4.0 in a mass copy of compat settings in commit 355d25eac764713f4d52eac801ade6e2ff1deab0 Change-Id: I0d95941ff2815a43e571be1a6a0dbab1d12185d6 Reviewed-on: https://gerrit.libreoffice.org/57991 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-26writerfilter: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)Stephan Bergmann
...by explicitly defaulting the copy/move functions (and, where needed in turn, also a default ctor) for classes that have a user-declared dtor that does nothing other than an implicitly-defined one would do, but needs to be user- declared because it is virtual and potentially serves as a key function to emit the vtable, or is non-public, etc.; and by removing explicitly user- provided functions that do the same as their implicitly-defined counterparts, but may prevent implicitly declared copy functions from being defined as non- deleted in the future. (Even if such a user-provided function was declared non-inline in an include file, the apparently-used implicitly-defined copy functions are already include, so why bother with non-inline functions.) Change-Id: I08632dcf7ccac1ab7efa0d5e8f4985d74cd31eac Reviewed-on: https://gerrit.libreoffice.org/58077 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>