summaryrefslogtreecommitdiff
path: root/vcl/source/edit
AgeCommit message (Collapse)Author
2018-10-04use unique_ptr in TextCharAttribList::InsertAttribNoel Grandin
Change-Id: Ie6818586e9dbbcbf79f0bb8e1031fc0a0b13763a Reviewed-on: https://gerrit.libreoffice.org/61308 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-03no need to call empty() before clear()Noel Grandin
found with git grep -A2 -nP '!.*\.empty()' | grep -B1 -w clear Change-Id: I87013eab9c6988048b891d20577e1f7efbce1b6c Reviewed-on: https://gerrit.libreoffice.org/61295 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-14loplugin:constfields in vclNoel Grandin
Change-Id: I1072642be4fdfa720e61f2d7bad3c2701eb81610 Reviewed-on: https://gerrit.libreoffice.org/60430 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-12loplugin:simplifyconstruct in ucbhelper..vclNoel Grandin
Change-Id: Id435bb3289dcfd9a7aeca6a661e249085958cb7c Reviewed-on: https://gerrit.libreoffice.org/60392 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-20Simplify containers iterations, tdf#96099 follow-upArkadiy Illarionov
Use range-based loop or replace with std::any_of, std::find and std::find_if where applicable. Change-Id: I2f80788c49d56094c29b102eb96a7a7c079567c6 Reviewed-on: https://gerrit.libreoffice.org/59143 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-07-31Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directory vcl Change-Id: I205fe0f4e80a66cd9c3b19f7e9716411da1d1cf5 Reviewed-on: https://gerrit.libreoffice.org/58221 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-27loplugin:returnconstant in vclNoel Grandin
Change-Id: I597ef6d75d1c21cdc15a91bf7f549bc14c851506 Reviewed-on: https://gerrit.libreoffice.org/58086 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-27loplugin:stringloop in vclNoel Grandin
Change-Id: I086a809b6541041b627daa93f9a08be2a9218550 Reviewed-on: https://gerrit.libreoffice.org/58117 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-16cppcheck: useInitializationList in vclJochen Nitschke
reorder members of GIFLZWDecompressor to ease initialization. use rtl_allocateZeroMemory in ImplVectMap to avoid memset in ctor. Change-Id: Icfcfe73ec7e52988036995d8dbc604361aee893b Reviewed-on: https://gerrit.libreoffice.org/57481 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2018-07-13merge IUndoManager into SfxUndoManagerNoel Grandin
SfxUndoManager is the only implementation of the IUnderManager "interface", and it lives in the same header. Plus this way we can get rid of some covariant parameters, which will make using std::unique_ptr easier. Change-Id: I6661b9876b18da830bead78794d237886cd3c5c9 Reviewed-on: https://gerrit.libreoffice.org/57317 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-03Fix tdf#100937: LO Freezed when I insert a very long text in...Matteo Casalin
... the Description box The issue was triggered by ImpVclMEdit::Resize initially calling TextEngine::SetMaxTextWidth() with a negative width (due to an initial empty area, further "reduced" to take into account a vertical scroll bar) and then with positive values in following iterations. I preferred to consider such negative widths a no-op instead of extending them to the "maximum" possible width. Change-Id: I756652a30c23ebe6674e481e7d8d6e0d8ba45e75
2018-05-08tdf#117491 Base crash when editing text in SQL query editorNoel Grandin
regression from commit 148b84160667ed3ec74c8767f6e62567479488f9 loplugin:useuniqueptr in TETextPortionList Change-Id: I464a56c26876a9153278d2f99931ca4e3cc3e01f Reviewed-on: https://gerrit.libreoffice.org/53959 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-26loplugin:useuniqueptr in TextDocNoel Grandin
Change-Id: I14b90100f0a7d2a97a1648ffc02da51658ffca63 Reviewed-on: https://gerrit.libreoffice.org/53344 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-24loplugin:useuniqueptr in TextWindowNoel Grandin
Change-Id: I66c966f79d56be5dfc1422fa3de52d9bf4411ff2 Reviewed-on: https://gerrit.libreoffice.org/53348 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-24loplugin:useuniqueptr in TETextPortionListNoel Grandin
Change-Id: Ia4ba670cc524a0103dbab0880931279bafd0925e Reviewed-on: https://gerrit.libreoffice.org/53347 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-16loplugin:useuniqueptr in VclMultiLineEditNoel Grandin
Change-Id: I386aa427e12cc97bd116102b1cc75fd7c0d56d61 Reviewed-on: https://gerrit.libreoffice.org/52889 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-13make TextAttrib::Clone return by std::unique_ptrNoel Grandin
Change-Id: I8e3941c4c8507e7a898f5f2e0fb13543e5c129cd Reviewed-on: https://gerrit.libreoffice.org/52748 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-08loplugin:unusedfieldsNoel Grandin
Change-Id: Id332557cbe7fb42d3d794612f26aa3ac161548d9 Reviewed-on: https://gerrit.libreoffice.org/50902 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-02drop old tools/gen methods in vclNoel Grandin
Change-Id: I863ce5ae46ae90f06780261fa17b087a7153c807 Reviewed-on: https://gerrit.libreoffice.org/50445 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-27replace Color(COL_*) with COL_*Noel Grandin
using git grep -lwP "Color\s*\(\s*(COL_\w+)\s*\)" | xargs perl -pi -e "s/Color\s*\(\s*(COL_\w+)\s*\)//g" and then some manual fixup where the resulting expression no longer compiled Change-Id: I0e268d78611c3be40bba9f60ecfdc087a36c0df4 Reviewed-on: https://gerrit.libreoffice.org/50372 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-22weld native message dialogsCaolán McNamara
just the straight-forward MessageDialog cases first a) remove border_width from message dialog .ui so as to take the default border width b) retain 12 as default message dialog border for vcl widget case c) remove layour_style from message dialog button boxes so as to take the default mode (a no-op for vcl widget case) d) use gtk response ids (vcl builder will converts to vcl ones) Change-Id: I7de281093a1b64f92f71ca11e7cbba42bb658154 Reviewed-on: https://gerrit.libreoffice.org/50143 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-02-22loplugin:changetoolsgen in vclNoel Grandin
Change-Id: I0fc68cf51fb23ed9bb86a5087e8247c81b024494 Reviewed-on: https://gerrit.libreoffice.org/50107 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-02loplugin:useuniqueptr in TEParaPortionsNoel Grandin
Change-Id: I530c432176ea6bd338387d2f8855f9f477e8ca75 Reviewed-on: https://gerrit.libreoffice.org/49093 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-30Typ-o negativIlmari Lauhakangas
Fixed some typos and translated a couple of German words Change-Id: I24ae28dd537ba283a9480413659f85bd6711acad Reviewed-on: https://gerrit.libreoffice.org/48892 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-01-29Modernize a bit vcl (part2)Julien Nabet
by using for-range loops + use returned iterator by erase method + avoid some iterators calculus by using plain loop Change-Id: I196a52c3c7d0e2705d5ab0e3ea06bd4a4b83bb67 Reviewed-on: https://gerrit.libreoffice.org/48805 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
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-22improve RTL detection in TextEngineNoel Grandin
the ubidi_getLogicalRun call returns a direction bool in bit 0, so the old code would only have been correct for embedding level 0. found by an up and coming loplugin. Change-Id: I56658981fbd32caf0d961d47d76b668f1dd1b680 Reviewed-on: https://gerrit.libreoffice.org/48261 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-19new loplugin:emptyifNoel Grandin
Change-Id: I1092115a0ceb3a5e6680a4b724b129f98a892c42 Reviewed-on: https://gerrit.libreoffice.org/48128 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-17loplugin:useuniqueptr in TextEngineNoel Grandin
Change-Id: Iff5d10c4e962994823ec4ce6a765f4456c677352
2018-01-15More loplugin:cstylecast: vclStephan Bergmann
Change-Id: I74d1555b461fd8ea316380423fcde2d167714170
2018-01-12More loplugin:cstylecast: vclStephan 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: I363c01a1ae9e863fca4fb4589829492d7280d711
2018-01-07uitest: add support for GtkTextView/VclMultiLineEditMarkus Mohrhard
Change-Id: If1f22ee562b73a54042985254e0b9cd127025b55 Reviewed-on: https://gerrit.libreoffice.org/47529 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-12-24loplugin:passstuffbyref even more return improvementsNoel Grandin
Change-Id: I2a752025cd429e4d271626402dce5d8a8b0c76d2 Reviewed-on: https://gerrit.libreoffice.org/47021 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-06Remove unused #include <vcl/metaact.hxx> from vcl/outdev.hxxStephan Bergmann
...and fix the fallout Change-Id: Ie514bd95d5a9f990a887566619031e9844c40b92 Reviewed-on: https://gerrit.libreoffice.org/45195 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-30silence various coverity warningsCaolán McNamara
Change-Id: I9ac4c179c30efa9d5950aa2106639d3781dd0308 Reviewed-on: https://gerrit.libreoffice.org/45583 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-30loplugin:unnecessaryparen: signed numeric literalsStephan Bergmann
Change-Id: I75c8224452ca9c3711a2ccaca9ecf549fa59cb64 Reviewed-on: https://gerrit.libreoffice.org/45549 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-15loplugin:flatten in vclNoel Grandin
Change-Id: I3527477277a9ae96eaf9fd068232f672da7c28c3 Reviewed-on: https://gerrit.libreoffice.org/44753 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-31tdf#113519: fix crash by releasing returned unique_ptrJulien Nabet
Regression from https://cgit.freedesktop.org/libreoffice/core/commit/?id=19910c461230f70bb9e98ad44db3525f0d755724 tdf#112658: fix leak when calling TextEngine::SetAttrib Change-Id: Iee82196ca10d82e898d8806a11874c3bedc28895 Reviewed-on: https://gerrit.libreoffice.org/44077 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-10-25tdf#113400: fix crash by destroying returned unique_ptrJulien Nabet
Regression from https://cgit.freedesktop.org/libreoffice/core/commit/?id=19910c461230f70bb9e98ad44db3525f0d755724 tdf#112658: fix leak when calling TextEngine::SetAttrib Change-Id: I4f1edf41e11f3cdfda6071b30a84372db68cd59d Reviewed-on: https://gerrit.libreoffice.org/43795 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-10-23loplugin:includeform: vclStephan Bergmann
Change-Id: Id7dea3917740aaf4db8dada5e2bea6e117d714ea
2017-10-05loplugin:finalclasses in vclNoel Grandin
Change-Id: I7de9cd6c5569217aa8d379c6d112cd1874bca8e2 Reviewed-on: https://gerrit.libreoffice.org/43151 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-28tdf#112658: fix leak when calling TextEngine::SetAttribJulien Nabet
TextCharAttribList::RemoveAttrib lets a dangling pointer when release unique_ptr obj maAttribs[n] So retrieve a unique_ptr from the different layers until SentenceEditWindow_Impl::ChangeMarkedWord (SpellDialog.cxx). Change-Id: I734909dce86ec28d69c09b2a8c0fc4a6941f422a Reviewed-on: https://gerrit.libreoffice.org/42881 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-09-25Translate German comments and debug strings (leftovers)Johnny_M
Additionally: - A few grammatical fixes Change-Id: I15ba3809f6b4746be5a691ec2adc0ea17730fa4a Reviewed-on: https://gerrit.libreoffice.org/42690 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-09-15Fix BASIC storage that stored an HTML <P> elementEike Rathke
&lt;P STYLE=&quot;margin-bottom: 0cm&quot;&gt; ended up in the XML stream, Regression from commit 2e0a25ce2b87d3a4bbf944025fc3720933fb391d Date: Fri Sep 8 08:31:42 2017 +0200 loplugin:constantparam that removed/kept the wrong path of !bHTML/bHTML Change-Id: I29ad9c4e7dff7a2d5537f5e52e7316aff7347c7a
2017-09-14clang-tidy modernize-use-emplace in vclNoel Grandin
Change-Id: Ie0a6d105b0167431275e628935df4f4c1a36d070 Reviewed-on: https://gerrit.libreoffice.org/42259 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-11Translate German comments/debug strings (leftovers in dirs vbahelper and vcl)Johnny_M
Translates leftovers found using a custom regex. Additionally: - Translated the "SGV Fonts for StarView" INI file parameter group in vcl/source/filter/sgf.ini and .../sgvtext.cxx Change-Id: I1360aac1a2f3fa825f86d77ac1b05e2de9ffb007 Reviewed-on: https://gerrit.libreoffice.org/42145 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2017-09-08tdf#108722 vcl: fix bugs in TextEngine with TEXTATTR_PROTECTEDMichael Stahl
1. If the cursor is at the end of the paragraph, attributes ending at that position are skipped in TextEngine::FindCharAttrib(). 2. If a TEXTATTR_PROTECTED is found, TextView::KeyInput() retains the selection that was extended to cover the attribute after deleting the text, because it compares to the initial selection. Why delete/backspace keys only work with the "gtk" vcl-plug but not "gtk3", "gen" or "kde4" is a mystery to me. Change-Id: Id7a6f298332f5a99454c793dd2dd6d424a975ad4
2017-09-08loplugin:constantparamNoel Grandin
Change-Id: Ic87f0cc863490858b7cc7e74a7f90ec31992dd53 Reviewed-on: https://gerrit.libreoffice.org/42089 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-04loplugin:unnecessaryparen include c++ castsNoel Grandin
Change-Id: I132d3c66f0562e2c37a02eaf4c168d06c2b473eb Reviewed-on: https://gerrit.libreoffice.org/41874 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>