summaryrefslogtreecommitdiff
path: root/editeng
AgeCommit message (Collapse)Author
2018-02-12cppcheck useInitializationListJochen Nitschke
unique_ptr don't need explicit nullptr initialization, same goes for VclPtr in ImpEditEngine. Change-Id: Id8f3163c2719bee6ee2724cae98449d564be5535 Reviewed-on: https://gerrit.libreoffice.org/49559 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-10coverity#1401328 Uncaught exceptionCaolán McNamara
Change-Id: Idc2363f80026370953f5c48a9d0eeb396a43362c Reviewed-on: https://gerrit.libreoffice.org/49526 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-06loplugin:useuniqueptr in TextRangerNoel Grandin
Change-Id: I176da69a399eab0169c5fdddd454912672a92fba Reviewed-on: https://gerrit.libreoffice.org/49267 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-05loplugin:useuniqueptr in SvxAutoCorrectLanguageListsNoel Grandin
and cleanup horrendous weirdity in the interaction between LoadXXX and SetXXX methods Change-Id: I1253579a27e835f6f79c39acf72eac85278275d6 Reviewed-on: https://gerrit.libreoffice.org/49184 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-05loplugin:useuniqueptr in ImpEditEngineNoel Grandin
Change-Id: I5afc846c803f5191bb5e04590923059e88434b76 Reviewed-on: https://gerrit.libreoffice.org/49176 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-05loplugin:useuniqueptr in OFlowChainedTextNoel Grandin
Change-Id: I63f6242a41eddd36b9ebbef470faf9e5111b19f1 Reviewed-on: https://gerrit.libreoffice.org/49149 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-05loplugin:useuniqueptr in SvxRTFParserNoel Grandin
Change-Id: I0d01e8612ff4e8eb1eb53a817c8fb586b61aa5bb Reviewed-on: https://gerrit.libreoffice.org/49150 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-05loplugin:useuniqueptr in SvxUnoTextRangeBaseNoel Grandin
Change-Id: I2f416e415ec388d1fac334b997f25427f6c1750f Reviewed-on: https://gerrit.libreoffice.org/49175 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-05loplugin:useuniqueptr in OutlinerNoel Grandin
Change-Id: I68568dd61ef6ba99fcb0ac386170bfe67ab2bbd7 Reviewed-on: https://gerrit.libreoffice.org/49174 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-05loplugin:useuniqueptr in SvxRTFItemStackTypeNoel Grandin
Change-Id: I1677915d91fb151997d4bef18473f33ab2f09648 Reviewed-on: https://gerrit.libreoffice.org/49173 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-05loplugin:useuniqueptr in SvxNumRuleNoel Grandin
Change-Id: I778f62edbddfa2ca10eefa396272e7b011025513 Reviewed-on: https://gerrit.libreoffice.org/49172 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-05loplugin:useuniqueptr in SvxNumberFormatNoel Grandin
Change-Id: I0433349e6f4108297e0f4cab65c1e859424bd282 Reviewed-on: https://gerrit.libreoffice.org/49148 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-05loplugin:useuniqueptr in ImpEditViewNoel Grandin
Change-Id: I9bda92e4a096b73394d579da94eeeb4448134618 Reviewed-on: https://gerrit.libreoffice.org/49147 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-02editeng: remove dead codeChris Sherlock
Change-Id: I2ce15bc2c6b9663b479ae98bb1d5e0900716adcf Reviewed-on: https://gerrit.libreoffice.org/47492 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2018-02-01tdf#42949 Remove unneeded helpids.h headers (1/3)Gabor Kelemen
A side effect of the .ui migration is that we use a lot less HIDs in the code. A lot of files still contain helpids.h includes even if no actual HID is referenced. This cleans up directories b* - e*. Found with: git grep helpids.h | cut -d : -f 1 | xargs grep -c HID_ | grep :0$ Change-Id: I221d22f68584115d71660a97c4f108595625d12c Reviewed-on: https://gerrit.libreoffice.org/46868 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-02-01split out SFX_METRIC_ITEM into separate fieldNoel Grandin
instead of overloading the nMemberId field and thus fix various places that were effectively setting the METRIC flag and causing a warning in SvxUnoConvertToMM And fix bug in sw/source/core/unocore/unomap.cxx where the PropertyAttribute::READONLY was in the wrong place, ever since commit 84a3db80b4fd66c6854b3135b5f69b61fd828e62 Date: Mon Sep 18 23:08:29 2000 +0000 initial import Change-Id: Ifc2bf56709f19aea75300b2fda62ce551efc26af Reviewed-on: https://gerrit.libreoffice.org/48950 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-31Fix typosAndrea Gelmini
Complete commit 8310642c6c404ea501b8be5ae4d12860e1562ac9 It passed "make check" Change-Id: If599bf7b66c972f225f88802d10c70bea4783a38 Reviewed-on: https://gerrit.libreoffice.org/48998 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-31SvxNumberFormat::SetAbsLSpace takes shortStephan Bergmann
...so there appears to be no good reason to cast from sal_Int32 to sal_uInt16 first Change-Id: I67384bc736685269acb6c2033b2c4edffd27a510 Reviewed-on: https://gerrit.libreoffice.org/48953 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-29Values need not be bounded by sal_uInt16, it appearsStephan Bergmann
since ESelection's nStart/EndPos have been changed to sal_Int32 with 3cbfcee36dd16e451d76c561eaaaee0ff29b01a5 "xub_StrLen and tools/string.hxx final straw". Change-Id: Icc96355ff71d07cac5d6037c81b2523156384077 Reviewed-on: https://gerrit.libreoffice.org/48773 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-29inline SvxBulletItem::SetDefaultFont_Impl and SetDefaults_ImplJochen Nitschke
use initializer lists in constructors Change-Id: Ib3b836ba96046a5f3bca12ea7702247afe8eac3b Reviewed-on: https://gerrit.libreoffice.org/48803 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-28Remove various more obsolete sal_uInt16 restrictionsStephan Bergmann
...similar to bf7ea94632d33eb3ed3eae26bca36906eda15257 "SvxAccessibleTextIndex::mnEEIndex need not be bounded sal_uInt16" Change-Id: I88d107ae1eb16c8fc3322f1c6318df62c079cf23 Reviewed-on: https://gerrit.libreoffice.org/48775 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-28USHRT_MAX -> SAL_MAX_UINT16Stephan Bergmann
Change-Id: I9909d8e125a16f9494ce431b62baf5d2507ad80d Reviewed-on: https://gerrit.libreoffice.org/48774 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-28Remove useless checks against SAL_MAX_INT32Stephan Bergmann
...changed from checks against USHRT_MAX in 2af1f5691e8d64afd5246d245d7876b5a2cd5cd8 "resolved fdo#35756 import more than 64k HTML table cells" Change-Id: I32c0e1216d5ba6b1a899540dddade06b17ad0103 Reviewed-on: https://gerrit.libreoffice.org/48772 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-28AccessibleImageBullet::GetParagraphCount no longer restricted to sal_uIn16,Stephan Bergmann
after 2af1f5691e8d64afd5246d245d7876b5a2cd5cd8 "resolved fdo#35756 import more than 64k HTML table cells" Change-Id: Ie8fa2810c27ba36a032c6b5e125dc2aeddd63b44 Reviewed-on: https://gerrit.libreoffice.org/48771 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-28AccessibleEditableTextPara::GetParagraphCount no longer restrictedStephan Bergmann
...to sal_uInt16, after 2af1f5691e8d64afd5246d245d7876b5a2cd5cd8 "resolved fdo#35756 import more than 64k HTML table cells". Some checks against USHRT_MAX had not been removed at all, while others had been changed to useless checks against SAL_MAX_INT32. Change-Id: If21d10426ee392ba3f0586dde766e3f7da99d214 Reviewed-on: https://gerrit.libreoffice.org/48769 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-28Remove useless check against SAL_MAX_INT32Stephan Bergmann
...changed from a check against USHRT_MAX in 3cbfcee36dd16e451d76c561eaaaee0ff29b01a5 "xub_StrLen and tools/string.hxx final straw" Change-Id: I8311803f9b5d1a78d8039d4810b0ae3cfdd27c53 Reviewed-on: https://gerrit.libreoffice.org/48770 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-28nStart/EndEEIndex nned not be bounded by sal_uInt16Stephan Bergmann
...it appears, since ESelection's nStart/EndPos have been changed to sal_Int32 with 3cbfcee36dd16e451d76c561eaaaee0ff29b01a5 "xub_StrLen and tools/string.hxx final straw". Change-Id: I3f3d77d6efeabef9f05b3a5233e0e5590b1ed365 Reviewed-on: https://gerrit.libreoffice.org/48767 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-28SvxAccessibleTextIndex::mnEEIndex need not be bounded sal_uInt16Stephan Bergmann
It was originally introduced with type USHORT (a909acb7009acadffa53e74ea05ddb88803490f1 "#98735# Refactored unoedit/unoedacc.cxx"), then shortly after changed to sal_Int32 (a0089a21f047ce8b5378b45f1535269e3600d681 "#98735# Fixed various off-by-one mistakes"), presumably because it needed to hold values slightly larger than USHRT_MAX. But at least since the surrounding code has been changed to use sal_Int32 throughout (e.g., structs like EPosition and ESeleciton in include/editeng/editdata.hxx with 3cbfcee36dd16e451d76c561eaaaee0ff29b01a5 "xub_StrLen and tools/string.hxx final straw"), there appears to be no more reason to effectively restrict mnEEIndex to sal_uInt16 values. Change-Id: I78f02be1f2736a626a836ac992230a74cc669fd3 Reviewed-on: https://gerrit.libreoffice.org/48766 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-27Fix typosAndrea Gelmini
Change-Id: I78025acb7e17d894252b19b351eeae7a27fc5e97 Reviewed-on: https://gerrit.libreoffice.org/48685 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-01-25loplugin:datamembershadow in SvxUnoTextRangeBaseNoel Grandin
make the superclass member private Change-Id: I665d87bfdfc3d7804cd4cac6108f9bc65b9ca2b5 Reviewed-on: https://gerrit.libreoffice.org/48552 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-24Avoid upcoming GCC 8 -Werror=class-memaccess on css::util::DateTimeStephan Bergmann
...whose ctor already zero-initializes all members, so the first two memsets are unnecessary. And spell the third memset as explicit assignments. Change-Id: Ie5079711b152bac7f0a8d52d7889879157a35b5d Reviewed-on: https://gerrit.libreoffice.org/48390 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-24loplugin:useuniqueptr in SvxBoxItemNoel Grandin
Change-Id: I0702a25c765fc8781b65320f44c0e0c3c56269a7 Reviewed-on: https://gerrit.libreoffice.org/48408 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-24loplugin:unused-returns in drawinglayer..svxNoel Grandin
Change-Id: I033a78cc7fe7d8e5086f1c855c4aa371cc98dc7c Reviewed-on: https://gerrit.libreoffice.org/48400 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-24loplugin:unused-returns in vclNoel Grandin
Change-Id: I507320900a47f604d17ed7d402d531a7cbdf744e Reviewed-on: https://gerrit.libreoffice.org/48331 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-23new loplugin: pointerboolNoel Grandin
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-23OutputDevice::GetCaretPositions takes sal_Int32 nIndex parameterStephan Bergmann
...since 16b446937e026ff5edd097e99b8d9be6ba314562 "Use OUString / sal_Int32 in vcl(outdev3.cxx,textlayout.cxx)" Change-Id: I9e77bf801c6d79e1993ac6ddecf740b3362aeafe Reviewed-on: https://gerrit.libreoffice.org/48364 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-20loplugin:unusedmethodsNoel Grandin
Change-Id: If00b0e659e1818c29ae39b89f8b4f7ea29d14986 Reviewed-on: https://gerrit.libreoffice.org/48185 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-19ofz#5477 if the para is already oversize, nums would go negativeCaolán McNamara
Change-Id: I183e1377747f662da1204e90a24fb4f8f2268699 Reviewed-on: https://gerrit.libreoffice.org/48156 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-01-15Fix typoAndrea Gelmini
Change-Id: I51c97356c9c2939f2d94d6388c829a179ca00daa Reviewed-on: https://gerrit.libreoffice.org/47853 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-01-15More loplugin:cstylecast: editengStephan Bergmann
Change-Id: I58978e5376ff1b91fa6dddbd308c923b3f3ab0ec
2018-01-15convert a<b?a:b to std::min(a,b)Noel Grandin
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: editengStephan Bergmann
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: I09a4d688e6f3c1ecbe05a7d27ebd955e8ba1eb65
2018-01-11loplugin:redundantcast: editengStephan Bergmann
(after a to-be-committed improved loplugin:cstylecast would have rewritten the C-style casts into static_casts) Change-Id: I44210b93101c128a7f931816e4d2c71335117df3
2018-01-11convert (a>b?a:b) to std::max(a,b)Noel Grandin
with something like: git grep -nP '(.*)\s*>\s*(.*)\s*\?\s*\g1\s*:\s*\g2' Change-Id: I60b9a3a2a09162bc0de4c13fdde2c209696e5413 Reviewed-on: https://gerrit.libreoffice.org/47602 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-10tdf#96099 Removed some trivial typedefs related to UnOrderedMap and size_t.ekuiitr
Change-Id: I59d3d0b2c1097b5ca96505dc99a4a104b4f8ab48 Reviewed-on: https://gerrit.libreoffice.org/47082 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2018-01-09tdf#99524 - allow backward connect paragraph to undo.Mark Hung
When pressing backspace, two paragaphs connected. The first paragraph get the style of the second paragraph. However the ParaAttribsChanged() doesn't update Outliner's nDepth because it is not in undo. So it create incorrect undo information when user press enter later. And during undo, the nDepth isn't updated because there is a check to compare the number of paragraphs, so SetParaAttribs needs to be called after ParagraphInserted. Change-Id: I6a860514042240035cde95d64bdd1f374e05a94e Reviewed-on: https://gerrit.libreoffice.org/47226 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-01-07tdf#114628 unit test for line spacingSzymon Kłos
* two cases 60% and 150% line spacing Change-Id: I2ce66cd19f459b738243052b5c12da0bbb883ebe Reviewed-on: https://gerrit.libreoffice.org/47303 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2018-01-05Revert "GetTrueSlotId is dead"Noel Grandin
This reverts commit 4f11182566b02f9f1c1821985a94b4b4de363fbb. Turns out I was wrong, there are tons of place defining slotid<->whichid mappings. Change-Id: I2a124ecba02c45f14ee917727adb993c39994881 Reviewed-on: https://gerrit.libreoffice.org/47454 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-04GetTrueSlotId is deadNoel Grandin
The only place is is used is ConvertAndPutItems. Which only loops over EE_PARA* which ids. But the only things which define slotid<->whichid mappings are XATTR*, SDATTR*, SCHATTR*. Which means that this code ConvertAndPutItems is dead, and that is the last place using GetTrueSlotId. Change-Id: I3037c25c2c15087572abacc9642970936824678d Reviewed-on: https://gerrit.libreoffice.org/47377 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-04tdf#114664 allow the splitted paragraph attributes to recover.Mark Hung
Calling the SetParaAttribs to the splitted paragraph is effective only after ParagraphInserted is invoked. Change-Id: I1c2a58bc40e2a84d7bed4d85918e1d0ecdbe267f Reviewed-on: https://gerrit.libreoffice.org/47174 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>