summaryrefslogtreecommitdiff
path: root/sw/qa/core
AgeCommit message (Collapse)AuthorFilesLines
2018-02-28Fix some IWYU warningsMiklos Vajna1-0/+1
Change-Id: I5aa3744ee7f26dfefecbe9b9fa6aef700049ff32 Reviewed-on: https://gerrit.libreoffice.org/50469 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-02-26forcepoint #10 pop empty stackCaolán McNamara1-0/+193
Change-Id: I96452a86187a6b03251614625445d1b18a5ee218 Reviewed-on: https://gerrit.libreoffice.org/50357 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-05ofz#5909 Null-dereference READCaolán McNamara1-0/+1
Change-Id: I830d3e8bda517e7681cea7481c32457486ced693 Reviewed-on: https://gerrit.libreoffice.org/49218 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-31ofz#5855 revert fix mem leakCaolán McNamara1-0/+1
commit 5ceea51947b99f27eb3401bd3c9b8a7cf6ee9c96 Author: Caolán McNamara <caolanm@redhat.com> Date: Fri Dec 8 14:13:22 2017 +0000 ofz: fix mem leak Change-Id: I295e52723297b257dcfe532108471702631ca5f5 Reviewed-on: https://gerrit.libreoffice.org/46093 Change-Id: I98c2dc7e32c6dfc725a5763077bceb527cb31db2
2018-01-24Fix some IWYU warningsMiklos Vajna2-0/+3
Change-Id: I4b6e799c1afc2a762a3729ee89f3226c59a6eef8 Reviewed-on: https://gerrit.libreoffice.org/48462 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2018-01-23new loplugin: pointerboolNoel Grandin1-1/+1
look for possibly bogus implicit conversions to bool when passing (normally pointer) args to bool params. this plugin comes in the wake of a couple of bugs caused by refactoring, where some of the call sites were not currently updated. Of the changes, the following are real bugs: desktop/../dp_persmap.cxx StartInputFieldDlg in sw/../fldmgr.cxx which occurred as a result of commit 39d719a80d8c87856c84e3ecd569d45fa6f8a30e Date: Tue May 3 11:39:37 2016 +0200 tdf#99529 sw: don't pop up input field dialog before inserting field CSerializationURLEncoded::encode_and_append in forms/../serialization_urlencoded.cxx XclExpCFImpl::XclExpCFImpl in sc/../xecontent.cxx I have no idea how to properly fix this, just made a guess. SwDocTest::test64kPageDescs in sw/qa/core/uwriter.cxx which looks like a simple copy/paste error. Change-Id: I795ebd5ef485a1d36863dc27fe13832989f5a441 Reviewed-on: https://gerrit.libreoffice.org/48291 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-22ofz#5535 max decimal places for rtl_math_round is 20Caolán McNamara1-0/+1
Change-Id: I636e086c51ceb70bdac72acfbabe99ad29003cdb Reviewed-on: https://gerrit.libreoffice.org/48268 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-20ofz#5253 restore some sort of valid state on missing RestoreCaolán McNamara1-0/+1
Change-Id: Ic12e1567f5a3370d1580d8c471ee38d3069568ce Reviewed-on: https://gerrit.libreoffice.org/48217 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-15convert a<b?a:b to std::min(a,b)Noel Grandin1-1/+1
with something like git grep -nP '(.*)\s*<\s*(.*)\s*\?\s*\g1\s*:\s*\g2' -- *.?xx Change-Id: Id5078b35961847feb78a66204fdb7598ee63fd23 Note: we also convert a>b?b:a Reviewed-on: https://gerrit.libreoffice.org/47736 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-12More loplugin:cstylecast: swStephan Bergmann1-18/+18
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I0f49d21dfdf82742f11b27709f74294feb1e419e
2017-12-29ofz#4825 Bad-castCaolán McNamara1-0/+0
Change-Id: I57f180c9e28d5f2439efcc1f2726d8fabc108bc9 Reviewed-on: https://gerrit.libreoffice.org/47176 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-12-13tools: remove unused #include from solar.hMichael Stahl1-0/+1
Change-Id: I214e13add371380701ae39403d90a574a63e495d
2017-11-27rhbz#1517407 Capitalize every word doesn't work after bracketsCaolán McNamara1-0/+6
Change-Id: Iab2da3f74f6116bb1b9855044df2a2ece977bb95 Reviewed-on: https://gerrit.libreoffice.org/45335 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-27loplugin:countusersofdefaultparams in sw (2)Noel Grandin1-1/+1
Change-Id: Ibb045a0b7750cf6807d6f5caba86a9e6e59828ae Reviewed-on: https://gerrit.libreoffice.org/45237 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-23ofz#3301 add bugdocMichael Stahl1-0/+0
Change-Id: I9a6425f5c0ed519ef7cb90e66b0d4c8e0fe700d4
2017-10-23loplugin:includeform: swStephan Bergmann6-45/+45
Change-Id: Ifc3c4c31a31ee7189eeab6f1af30b94d64f2f92a
2017-10-21loplugin:redundantcast handle dynamic_castNoel Grandin1-2/+2
Change-Id: I7855c76e820efce96778b1c19ec71dffcc4b4abb Reviewed-on: https://gerrit.libreoffice.org/43621 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-09-27tdf#112679 sw: fix copying of fieldmarksMichael Stahl2-5/+10
Aha, now we know that the reason for the defensive programming in lcl_AssureFieldMarksSet() was that there are actually 2 different use-cases for it: usually a new mark is inserted, so there are no dummy characters and they must be inserted. However when copying text, the dummy characters are copied too, so they must not be inserted, or we get duplicate fieldmarks. This also reverts commit d4036d3a89b65a4912f62e3930eb1a31cd90a16b which fixed the problem only for CHECKBOX_FIELDMARK in a different way. (regression from bb069fe7b8b6a24f9ff4df4c7052961e17ea3a8c) Change-Id: I3c99b8c6d720951655198e682018794337859373
2017-09-26Better way to detect Apple Xcode 9 ClangStephan Bergmann1-2/+4
...without also accidentally affecting any upstream Clang 9.0 Change-Id: Ie52413e2e53a2ce01f55b97677fe9878d498b076 Reviewed-on: https://gerrit.libreoffice.org/42809 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-09-26Blind fix for Xcode 9Stephan Bergmann1-1/+4
...which started to run into the same undefined reference issue as 5a55bef38b047b9c60d1b219c572287938265610 "Temporary fix for Clang on F26". (Unfortunately, Apple's Xcode Clang uses version numbers that can be confused with upstream Clang version numbers, so this patch will also affect users of upstream Clang 9.0 on macOS, when that eventually gets released.) Change-Id: I721f01f76d93c044fdbc02e68002b60b17b5e9fb
2017-09-15convert SvxCellVerJustify to scoped enumNoel Grandin1-1/+1
Change-Id: I9d1cdb4ddfee43b7a0990624d7d16e06679343c4 Reviewed-on: https://gerrit.libreoffice.org/42276 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-11loplugin:unusedvariablecheckTor Lillqvist1-1/+1
Change-Id: Iaeed1da4ec76075271b48147e3f9372d966e6f99
2017-09-05tdf#112164 add test documentDinh Le1-0/+0
Change-Id: Iacf2bec62a8eff3c9b4e6a5971ee8e63ae00567e
2017-09-05tdf#112164 sax: handle errors on last call to XML_Parse()Michael Stahl1-0/+0
If XML_Parse() is called with isFinal=1 and there are open tags, that is an error (XML_ERROR_NO_ELEMENTS) that must be converted to an exception. This reveals that we already had an incomplete input document, which needs to be moved to "fail" now. Change-Id: I7ce3b51bd87923b5edde621508cf38d7ebbc2b14
2017-08-31Resolves: tdf#112122 Use EndElement instead of dtor to call throwing methodsCaolán McNamara1-0/+0
Change-Id: I1cc3b9af4089f1e657c5c63e0911aac8bdce04f3 Reviewed-on: https://gerrit.libreoffice.org/41756 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-08-31Resolves: tdf#112123 check m_xAutoStyles like in similar methodsCaolán McNamara1-0/+0
Change-Id: I099da789a0e64fd862d09bb462ccb699e1dc8b9f Reviewed-on: https://gerrit.libreoffice.org/41751 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-08-30Resolves tdf#112101 crash on particular file with office:event-listenersCaolán McNamara1-0/+0
Change-Id: I99a007543f90f4024666d296e9a775f8cee15086 Reviewed-on: https://gerrit.libreoffice.org/41723 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-08-30loplugin:constparam in variousNoel Grandin3-3/+3
Change-Id: I6821a3946f2e8fabf26558a84370c16ac8827fed Reviewed-on: https://gerrit.libreoffice.org/41721 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-29Resolves: tdf#112017 crash on particular odtCaolán McNamara1-0/+0
Change-Id: I6ba2e73562a16afecb6abdfe4f1a40b1e316379e Reviewed-on: https://gerrit.libreoffice.org/41685 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-08-29Resolves: tdf#112018 number-columns-repeated has the data type positiveIntegerCaolán McNamara1-0/+0
Change-Id: I534885fe7a36a8e3ad891a3f5ed50b589f36e3b9 Reviewed-on: https://gerrit.libreoffice.org/41692 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-08-24tdf#111934: add document for filters-testsMichael Stahl1-0/+0
Thanks to infostud91@gmail.com for the document; unfortunately git tells me that i can't set the commit author to just an email address. Change-Id: I844e725d06cfa2a56adcd93aaa0a222fbb14028f
2017-08-21Temporary fix for Clang on F26Tor Lillqvist1-0/+2
I get a mysterious linking error: sw/qa/core/uwriter.cxx:1416: undefined reference to `SfxEnumItem<SvxRotateMode>::operator==(SfxPoolItem const&) const' Change-Id: I2363ebf84784d17b8aea2f37cece191f48a1b717
2017-07-21migrate to boost::gettextCaolán McNamara1-1/+1
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-07-20Added Test to check TableAutoFormat Style after Save/LoadVarun Dhall1-0/+306
Change-Id: I466d5c5536d4c4310356f38569f7a91e0f36ba1d Reviewed-on: https://gerrit.libreoffice.org/40104 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-07-02loplugin:casttovoid: swStephan Bergmann2-77/+4
Change-Id: I224e9995962901e8740bfaed06d57f7c0389236c
2017-06-27loplugin:oncevar in swNoel Grandin4-28/+25
Change-Id: Ia96172489eec09607113d388a5b683bb6e0d2dec Reviewed-on: https://gerrit.libreoffice.org/39290 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-21loplugin:unusedfields in sfx2 part1Noel Grandin2-2/+2
and fix a memory leak in NotebookbarTabControl where it was not freeing it's m_pListener field Change-Id: Ib9970c9084982d532fa38d1bc3c44180ab2c3c39 Reviewed-on: https://gerrit.libreoffice.org/39036 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-16Make SfxItemSet ranges correct by constructionStephan Bergmann1-1/+1
This is a follow-up to 45a7f5b62d0b1b21763c1c94255ef2309ea4280b "Keep WID ranges sorted, and join adjacent ones". While SfxItemSet::MergeRange relies on the m_pWhichRanges being sorted (and, under DBG_UTIL, asserts if they are not), the various SfxItemSet constructors curiously only check (via assert or DBG_ASSERT) that each individual range has an upper bound not smaller than its lower bound. Arguably, all SfxItemSet instances should fulfill the stronger guarantees required and checked by MergeRange. And in many cases the ranges are statically known, so that the checking can happen at compile time. Therefore, replace the two SfxItemSet ctors taking explicit ranges with two other ctors that actually do proper checking. The (templated) overload taking an svl::Items struct should be used in all cases where the range values are statically known at compile time, while the overload taking a std::initializer_list<Pair> is for the remaining cases (that can only do runtime checking via assert). Most of those latter cases are simple cases with a single range covering a single item, but a few are more complex. (At least some of the uses of the existing SfxItemSet overload taking a const sal_uInt16* pWhichPairTable can probably also be strengthened, but that is left for another day.) This commit is the first in a series of two. Apart from the manual changes to compilerplugins/clang/store/sfxitemsetrewrite.cxx, include/svl/itemset.hxx, and svl/source/items/itemset.cxx, it only consists of automatic rewriting of the relevant SfxItemSet ctor calls (plus a few required manual fixes, see next). But it does not yet check that the individual ranges are properly sorted (see the TODO in svl::detail::validGap). That check will be enabled, and the ensuing manual fixes will be made in a follow-up commit, to reduce the likelyhood of accidents. There were three cases of necessary manual intervention: * sw/source/core/unocore/unostyle.cxx uses eAtr of enum type RES_FRMATR in braced-init-list syntax now, so needs explicit narrowing conversion to sal_uInt16. * In sw/source/uibase/uiview/formatclipboard.cxx, the trailiing comma in the definition of macro FORMAT_PAINTBRUSH_FRAME_IDS needed to be removed manually. * In svx/source/svdraw/svdoashp.cxx, svx/source/svdraw/svdotext.cxx, sw/source/uibase/app/docstyle.cxx, sw/source/uibase/shells/frmsh.cxx, sw/source/uibase/shells/grfsh.cxx, and sw/source/uibase/shells/textsh1.cxx, some comments had to be put back (see "TODO: the replaced range can contain relevant comments" in compilerplugins/clang/store/sfxitemsetrewrite.cxx). A few uses of the variadic form erroneously used nullptr instead of 0 for termination. But this should have been harmless even if promoted std::nullptr_t is larger than promoted sal_uInt16, assuming that the part of the nullptr value that was interpreted as sal_uInt16/promoted int was all-zero bits. Similarly, some uses made the harmless error of using 0L instead of 0. Change-Id: I2afea97282803cb311b9321a99bb627520ef5e35 Reviewed-on: https://gerrit.libreoffice.org/38861 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-06-12cleanup unused css/frame/* includesJochen Nitschke2-4/+0
Change-Id: I173a29fd1ee889127369d2bc2fce8e010b89ca65 Reviewed-on: https://gerrit.libreoffice.org/38633 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-09use comphelper::InitPropertySequence in more placesNoel Grandin1-6/+7
Change-Id: I72d7b13a23ce306b752b39187a0e9fbb7028643a Reviewed-on: https://gerrit.libreoffice.org/38606 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-28remove unnecessary use of OString::getStrNoel Grandin1-1/+1
Change-Id: I0490efedf459190521f4339854b3394d57765fdb Reviewed-on: https://gerrit.libreoffice.org/38058 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-10sw: fix build (how did that build for me?)Michael Stahl1-1/+1
Change-Id: I919cd38d6d63a73fd3152f5541589d0ec1a45207
2017-05-04Replace all OUString("") with OUString()Arnaud Versini1-2/+2
Change-Id: Ie14c4d76cb61cfbe0410103adfc1afc8ade0f3e0 Reviewed-on: https://gerrit.libreoffice.org/37146 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-28loplugin:cppunitassertequals: swStephan Bergmann1-10/+10
Change-Id: I9e2dcf0e2f5ed9c542b9807683878c654edc21fb
2017-04-21add CVE-2017-0199 testcaseCaolán McNamara1-0/+0
Change-Id: I07cac2ffac85093761dbdd7c50c52483bfbb5754
2017-04-12add SAL_WARN_UNUSED to sw::Ring and friendsNoel Grandin1-1/+0
Change-Id: Ic90e4357089c1f487dd5738f9c14862ce95d611d Reviewed-on: https://gerrit.libreoffice.org/36408 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-25Fix typosAndrea Gelmini1-1/+1
Change-Id: Ia87318cb323d403cdff947da0b70e0d2aabaacd4 Reviewed-on: https://gerrit.libreoffice.org/35657 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-20convert RndStdIds to scoped enumNoel Grandin1-2/+2
Change-Id: I029ad67dfcbc40f3953adf485957efcbd97f23d0 Reviewed-on: https://gerrit.libreoffice.org/35328 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-07convert RES_FIELDS to scoped enumNoel Grandin1-1/+1
and rename to SwFieldIds Change-Id: I50d2b7550f68b4b020ffc1603f931c671c8e1de6 Reviewed-on: https://gerrit.libreoffice.org/34924 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2017-03-01Use consistent integer types in the SwRedlineTable interfaceStephan Bergmann1-1/+1
ddd84d08c9bb6e00fbd9a73bd52a28688a8c1ba7 "Convert SV_DECL_PTRARR_SORT_DEL(_SwRedlineTbl) to o3tl::sorted_vector" had introduced size and operator[] operating on underlying vector's size_type, but had left the other functions at sal_uInt16. Keep everything at sal_uInt16 for now until fixing everything to use that underlying vector size_type instead. Change-Id: I92570dcb8ab5fa88b52e2b24899b833829693a88