summaryrefslogtreecommitdiff
path: root/desktop
AgeCommit message (Collapse)Author
2022-01-04Always use <poll.h>, no modern system needs <sys/poll.h>Ismael Luceno
This was standardized in IEEE 1003.1-2001, so more than 20 years old. Verified following systems using online resources: - FreeBSD 3.0 (1998) - NetBSD 1.3 (1998) - OpenBSD 2.0 (1996) - CentOS 5.0 (2007) - Debian 4.0 (2007) - IRIX 6.5.30 (2006) - SunOS 4.1.3 (1992) - SUSE 10.2 (2008) - Red Hat 5.0 (1998) So the check used for BSDs on vcl/unx/generic/dtrans/X11_selection.cxx was never correct. On GNU/Linux specifically, <poll.h> is provided since glibc 2.0 (1997). musl libc produces the following warning if the non-standard header is included: /usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp] Change-Id: Ia8f4b9e1ee069f86abe03140c18a77d17336d09c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127666 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit 4242c7b91887236375e08e2b6b24de0cecbf1626) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127586 Reviewed-by: Ismael Luceno <ismael@iodev.co.uk> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-11-25loplugin:stringliteraldefine in desktopNoel Grandin
Change-Id: I36025f17dc6c47710d6cd299f0349b5be227c21d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125760 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-25lok: add pdf version option for exportGabriel Masei
Change-Id: I02c1edecd291309bf028e6e5a0f04a578ac1b639 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125255 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2021-11-12make it explicit whether to ignore the result of getLOKPayload()Luboš Luňák
Returning an empty string to signify 'ignore' was a poor design, as some messages types actually may have valid empty messages. Change-Id: Ia82d3d97d150bc5ef412a1bd4b1091d9b2d84385 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124979 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-12rtl::Static to thread-safe staticNoel Grandin
Change-Id: I6390d1811bad59c09a074039c635710d25a660d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124886 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-11Impress- Correct commands mentioning Page instead of SlideNnamani Ezinne
Replaced UNO commands that have similar implementation but their labels bear Page instead of Slide Change-Id: I5fb24493478b0a8fdd4e324066d8112497fc9eb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124888 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125047 Tested-by: Jenkins
2021-11-11Use o3tl::convertMike Kaganski
Change-Id: Ia64ae3445a4aea3be3044e2345e432e839d9a0f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125027 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-10new loplugin:stringliteraldefineNoel Grandin
look for #define FOO "foo" that can be converted into OUStringLiteral. This is the first pass of this plugin, only doing those #define which are local to a single compilation unit. Change-Id: Ic8610e29ec42c36d03db5014a93c244315d5bbea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124962 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-08use more OUStringLiteral in MediaDescriptorNoel Grandin
Change-Id: I0567d103db8db401c737fed98483912a39352929 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124835 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-03loplugin:constparamsNoel Grandin
Change-Id: Iebeb531fad5cc819b536788925cf8508737198b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124599 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-30Prepare for removal of non-const operator[] from Sequence in desktopMike Kaganski
Change-Id: I76959f62d46e12d984fe4c7be74e5857399e9126 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124358 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-26use boost flat_map for faster mapLuboš Luňák
setUpdatedTypePerViewId() gets called so often that even unordered_map lookup and allocations show up in profiling. It seems that flat_map can do better. Change-Id: Id2e4f0c40d6973b51e557f84a08bf12feb58b3ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124210 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-25use pull model also for LOK text selectionLuboš Luňák
Make LOK_CALLBACK_TEXT_SELECTION, LOK_CALLBACK_TEXT_SELECTION_START, LOK_CALLBACK_TEXT_SELECTION_END and LOK_CALLBACK_TEXT_VIEW_SELECTION also use pull model, i.e. LO core will only set a flag and when CallbackFlushHandler needs the actual data it'll use getLOKPayload(). This again avoids a large number of messages passed to CallbackFlushHandler only for them to be sooner or later discarded. Change-Id: Ia7528039be996a6e9e8491b4eba3f4133582fa56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124146 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-24change some LOK internal updates to be pull model instead of pushLuboš Luňák
Some LOK messages may get called very often, such as updates about cursor position. And since only the last one matters, they get generated every time, which costs some time, and then later except for one they get all discard again from CallbackFlushHandler queue, which again costs time. Change the model to instead only set an 'updated' flag, and CallbackFlushHandler will request the actual message payload only before flushing. This commit changes LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR and LOK_CALLBACK_INVALIDATE_VIEW_CURSOR to work this way. Change-Id: I376be63176c0b4b5cb492fbf529c21ed01b35481 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124083 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-23Fix typosAndrea Gelmini
Change-Id: Iaba882b1bd000a068cfaa207c743be038d5db434 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124087 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-22LOK: maintain blocked command list per viewPranam Lashkari
Conflicts: include/LibreOfficeKit/LibreOfficeKitEnums.h include/sfx2/viewsh.hxx libreofficekit/source/gtk/lokdocview.cxx sfx2/source/view/viewsh.cxx Change-Id: I7c621accd84f49447ab3e08a4bb662a9b91b834a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124049 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-10-22LOK: unify freemium APIs and uno command restriction APIsPranam Lashkari
Conflicts: include/LibreOfficeKit/LibreOfficeKit.hxx sfx2/source/control/unoctitm.cxx Change-Id: I3badb038822331ab5cb30df6a66ce9a0640cf340 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124047 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-10-22better name for a function overloadLuboš Luňák
It's better to add to the name what the overload does rather than just have a "mysterious" extra int. Change-Id: Iff89679c4a978a4596ac662ef74e934cdefefc9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124001 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-22LOK: introduce way to restrict uno commandsPranam Lashkari
With this new API we can define which uno commands to restrict their functionality Conflicts: desktop/qa/desktop_lib/test_desktop_lib.cxx include/LibreOfficeKit/LibreOfficeKit.h include/LibreOfficeKit/LibreOfficeKit.hxx include/sfx2/viewsh.hxx Change-Id: I9f3fd659d373e56542c5323922a53564f1cfb27b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124046 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-10-19Improve an error messageStephan Bergmann
This was useful in tracking down d425cd604cb4d30862640851b11a31e742d81336 "Revert incompatible ScriptEditor change". Change-Id: Ifc9e262b5860663dd64e5558534170ea0a8c5562 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123825 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-18Related: tdf#145173 Ensure known supported system and default document localeEike Rathke
For an unsupported locale like {en-IL} that could had ended up as language-only {en} if the aImplIsoLangEntries map contains such entry as obtained through MsLangId::convertUnxByteStringToLanguage() and Conversion::convertIsoNamesToLanguage(). For the system locale in SvtSysLocale a proper fallback is used but the default document language was propagated as is Other places evaluating MsLangId::getSystemLanguage() are affected as well, those probably will have to be replaced by a call to MsLangId::getRealLanguage(LANGUAGE_SYSTEM) or a newly to be introduced MsLangId::getConfiguredSystemLanguage() and MsLangId::getSystemLanguage() be made private or accessible only by LanguageTag. Change-Id: I87eb9456d5b4ea8d64b0c41fec6bd2739256fb56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123756 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-10-16Simplify vector initialization in desktopJulien Nabet
Change-Id: Ia7c99cb9c0e8be7299bc664b80cc8932d2766469 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123683 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-15ScriptForge - new SFWidgets library, new PopupMenu serviceJean-Pierre Ledure
The SFWidgets library is intended to host the Toolbar, ToolbarControl (both future) and PopupMenu services. A popup menu is usually triggered by a mouse action (typically a right-click) on a dialog, a form, or one of their controls. In these cases the menu will be displayed below the clicked area. When triggered by other events, including in the normal flow of a user script, the script should provide the coordinates of the topleft edge of the menu versus the actual component. The menu is described from top to bottom with next methods: AddItem() AddCheckBox() AddRadioButton() Example: .AddCheckBox("View>Toolbars>Dialog") .AddCheckBox("View>Toolbars>Find", Status := True) .AddCheckBox("View>Status Bar", Status := True) .AddItem("View>Full Screen", Name := "FULLSCREEN") The SubmenuCharacter (Default = ">") is modifiable. Each menu item receives a numeric and a string identifier. The execute() method returns the item selected by the user. The service is available both from Basic and Python user scripts. The commit includes the review of build files to include the new library and the new modules. Change-Id: I2940be25313cc8fff7b337766edd348b04a20584 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123654 Tested-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
2021-10-15delay, collect and compress LOK invalidations for Writer viewsLuboš Luňák
Due the to way views are updated on any document change, invalidations are at least O(n^2), and since LOK may use a number of views and for each view the entire document is considered to be the view area, this can lead to a huge number of invalidations that are mostly the same repeated rectangles. Change-Id: I63682958d2fc388344641dcd19fa1d2b39054b51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123617 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-10-15do not use text-based LOK callback internallyLuboš Luňák
CallbackFlushHandler post-processes LOK messages, but for things like dropping useless invalidations it needs to know the rectangle or the view id, and since the only data it gets are string messages, it needs to convert those back to binary form. Which is slow with large numbers of messages. Add internal LOK callback variant that allows also passing specific data in the original binary form. And then use directly the binary data in CallbackFlushHandler. Change-Id: I8dd30d2ff9c09feadebc31a44d8e6a8ccc306504 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123589 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2021-10-15Remove non-const Sequence::begin()/end() in internal codeMike Kaganski
... to avoid hidden cost of multiple COW checks, because they call getArray() internally. This obsoletes [loplugin:sequenceloop]. Also rename toNonConstRange to asNonConstRange, to reflect that the result is a view of the sequence, not an independent object. TODO: also drop non-const operator[], but introduce operator[] in SequenceRange. Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-15lok: Fix graphicselection INPLACE msg is filtered outMert Tumer
INPLACE message is not at the beginning, search it instead Signed-off-by: Mert Tumer <mert.tumer@collabora.com> Change-Id: I2a09ac5a664c1ff26790aa776d871ac34c3d99dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122919 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123522 Tested-by: Jenkins
2021-10-14tdf#33749 - revised merge and unmerge cells UI controlsRoss Johnson
Revert the two changes made under this issue tdf#33749: 1) Cell context menu back to 7.2 2) Format - Merge Cells menu back to 7.2 3) Help pages to reflect this Moving forward with the following changes: 1) Rename "Split Cells" to "Unmerge Cells" (Calc only) which more accurately describes it's function in Calc (and for consistency with alternative office software). 2) Add "Merge Cells" and "Unmerge Cells" to Formatting toolbar alongside "Merge and Center Cells", including other available user interface schemes where possible. 3) Change the Format - Merge Cells menu icon to the "Merge Cells" icon as less confusing than the current "Merge and Center Cells" icon. Re-label the Format - Merge Cells menu to Format - Merge and Unmerge Cells. 4) Add TooltipLabel to .uno:ToggleMergeCells to clarify dual action. 5) Add Split Cells to Table context menu in Impress (as it is in Writer). 6) Help pages to reflect changes. 7) Remove two duplicate entries in the sUnoCommands array in init.cxx (one was ".uno:MergeCells" related to this change). This is untested but relates to status updates sent to the headless LOK clients. I assume duplicate entries would generate duplicate updates, which may be harmless but is probably not desirable. Change-Id: I3063f871707a7286d95108d3a34a5287401baa6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122811 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2021-10-14Fix memory leakMike Kaganski
Change-Id: Ib9d98fa2cb14bb8feaf53941c5b7b18e21c33c13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123516 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-14Avoid COW overhead using css::uno::SequenceMike Kaganski
The scenarios are: 1. Calling sequence's begin() and end() in pairs to pass to algorithms (both calls use getArray(), which does the COW checks) 2. In addition to #1, calling end() again when checking result of find algorithms, and/or begin() to calculate result's distance 3. Using non-const sequences in range-based for loops, which internally do #1 4. Assigning sequence to another sequence variable, and then modifying one of them In many cases, the sequences could be made const, or treated as const for the purposes of the algorithms (using std::as_const, std::cbegin, and std::cend). Where algorithm modifies the sequence, it was changed to only call getArray() once. For that, css::uno::toNonConstRange was introduced, which returns a struct (sublclass of std::pair) with two iterators [begin, end], that are calculated using one call to begin() and one call to getLength(). To handle #4, css::uno::Sequence::swap was introduced, that swaps the internal pointer to uno_Sequence. So when a local Sequence variable should be assigned to another variable, and the latter will be modified further, it's now possible to use swap instead, so the two sequences are kept independent. The modified places were found by temporarily removing non-const end(). Change-Id: I8fe2787f200eecb70744e8b77fbdf7a49653f628 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123542 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-13Unify JsonWriter::put and putRaw a bitMike Kaganski
In the process, it turned out that there was unnecessary conversion of OStringBuffer to OString and back to OStringBuffer when using putRaw, which is avoided now. Change-Id: I1e3ee685679df0b025bee8f4430624ee5bc9ccb3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123547 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-12loplugin:unusedmethodsNoel Grandin
Change-Id: Ifd3a1ccef68ebc4cd4e7785357e6a476f6669eb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123456 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-11loplugin:moveparam in desktopNoel Grandin
Change-Id: Ie96a3887876bf9a0bb13ae4a69d1685186a4e9b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123384 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-11In O[U]StringBuffer, make string_view params replacements for OUString onesStephan Bergmann
...for LIBO_INTERNAL_ONLY, instead of having them as additional overloads. That way, loplugin:bufferadd and loplugin:stringviewparam found many further opportunities for simplification (all addressed here). Some notes: * There is no longer an implicit conversion from O[U]String to O[U]StringBuffer (as that goes via user-defined conversions through string_view now), which was most noticeable in copy initializations like OStringBuffer buf = someStr; that had to be changed to direct initialization, OStringBuffer buf(someStr); But then again, it wasn't too many places that were affected and I think we can live with that. * I made the O[U]StringBuffer ctors taking string_view non-explicit, mainly to get them in line with their counterparts taking O[U]String. * I added an OUStringBuffer::lastIndexOf string_view overload that was missing (relative to OUStringBuffer::indexOf). * loplugin:stringconstant needed some addition to keep the compilerplugins/clang/test/stringconstant.cxx checks related to OStringBuffer::append and OStringBuffer::insert working. * loplugin:stringviewparam no longer needs the special O[U]StringBuffer-related code that had been introduced in 1250aecd71fabde4dba990bfceb61bbe8e06b8ea "loplugin:stringviewparam extend to new.." Change-Id: Ib1bb8c4632d99b744e742605a9fef6eae959fd72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122904 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-10loplugin:moveparam in xmlscriptNoel Grandin
Change-Id: I8c33291dae8a4f90c02f47d823b127ca4e383d61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123338 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-06loplugin:moveparam in connectivityNoel Grandin
Change-Id: Iaf3a64effb69fd82c6303d8fa75723ccc5ced543 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123183 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-06Deduplicate reference marks and cell auto fill messagesSzymon Kłos
We use only the last value Change-Id: If3536b5b4bc67755cb7bb73850a590d37675e6a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114547 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122106 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123131 Tested-by: Jenkins
2021-10-03A more lightweight O[U]StringConcatenationStephan Bergmann
...compared to a full-blown O[U]String, for temporary objects holding an O[U]StringConcat result that can then be used as a std::[u16]string_view. It's instructive to see how some invocations of operator ==, operator !=, and O[U]StringBuffer::insert with an O[U]StringConcat argument required implicit materialization of an O[U]String temporary, and how that expensive operation has now been made explicit with the explicit O[U]StringConcatenation ctor. (The additional operator == and operator != overloads are necessary because the overloads taking two std::[u16]string_view parameters wouldn't even be found here with ADL. And the OUString-related ones would cause ambiguities in at least sal/qa/rtl/strings/test_oustring_stringliterals.cxx built with RTL_STRING_UNITTEST, so have simply been disabled for that special test-code case.) Change-Id: Id29799fa8da21a09ff9794cbc7cc9b366e6803b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-10-03drop 'using namespace std' in desktop, e*, f*Julien Nabet
Change-Id: I277dc957798093001f9a3935f97db8ac0314e6a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123022 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-09-28gives names to all the Idles and TasksNoel Grandin
enforce it by making the constructor parameter non-default. Change-Id: I321543e4dcf15ea0a43ad8cce91d2f8dc22df6ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122766 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-28add extra timeout with higher priority to LOK flushingLuboš Luňák
The normal idle has TaskPriority::POST_PAINT, which means that if we get too busy, the idle won't be called for a long time, meaning the queue will get longer and longer, making its processing slower, and client interactivity will be very poor, with updates possibly coming only when everything becomes idle. The second timeout will flush the queue after a reasonable timeout. I don't think there's an optimal value, so let's choose 100ms for now. Change-Id: Ia1312a690aefd2c8628c82e0f42b2993802d8b1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122728 Tested-by: Luboš Luňák <l.lunak@collabora.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-09-28do not use std::find_if() if std::find() does the jobLuboš Luňák
Change-Id: I94fe697e18442c1bce5e09abf82e8fe4b89cd0dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122675 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-09-28do not check a const variable in every lambda invocationLuboš Luňák
If the variable is false, then every call to the lambda will be false as well, so the entire block may be skipped. Change-Id: I8b61133d246fcfa721145f9d28c55e9afdb06e5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122678 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-09-28optimize removing from the LOK flush queueLuboš Luňák
All the lambdas check for event type, so it makes sense to first separately check the type and only then possibly call the lambda. Especially since 3b3e4ee97af23f21 separated the types for better searching. Change-Id: I144c88f5319ac2141336e1aa3c4ffd7b38265af9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122673 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-09-28vcl: rename OutDevState to StackChris Sherlock
I have moved the header file to include/vcl/rendercontext as this will eventually be part of the RenderContext split from OutputDevice. State and associated enums have also been moved to the vcl namespace. I have also moved ComplexTextLayoutFlags into the vcl::text namespace. Change-Id: I0abbf560e75b45a272854b267e948c240cd69091 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121524 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-09-26use SfxItemSetFixed in variousNoel Grandin
Change-Id: Ie2472959dbab93ead20948245fca9644de834422 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122653 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-23Extend loplugin:stringviewparam to starts/endsWith: desktopStephan Bergmann
Change-Id: I42fa4d25eca6b2c5d14212eca3a6ebc7146cce5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122500 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-23Fix typosAndrea Gelmini
Change-Id: I01c46b864e296d4094f0a1579fdc64066eacc386 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122496 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-09-22lok-desktop: unit tests for LOK_CALLBACK_TABLE_SELECTEDDennis Francis
Conflicts: desktop/qa/desktop_lib/test_desktop_lib.cxx Change-Id: I4e07ffc6f8eebbbee284d19cd9c77df13dddff3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118945 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Dennis Francis <dennis.francis@collabora.com> (cherry picked from commit 56795f50abad3de960f23e85b2ccfa1ba0181370) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122415 Tested-by: Jenkins
2021-09-21vcl: remove OutputDevice's GetDevFontSizeCount() and GetDevFontSize()Chris Sherlock
The OutputDevice::GetDevFontSize() function is only used for non-scalable (bitmap) fonts. We have stopped supporting bitmap fonts since LO 5.3, see tdf#103514: Support for bitmap-only fonts on Windows has been removed (Khaled Hosny) I found the following when removing PhysicalFontFace::SetBitmapSize(): 1. as mnHeight and mnWidth and not set by anyone, I realized I could remove them, which meant removing GetHeight() and GetWidth() 2. PhysicalFontFamily::GetFontHeights() populates heights from the collection of font faces into a sorted vector of font heights taken from PhysicalFontFace. As this no longer exists this function serves no purpose, it has been removed. 3. PhysicalFontFamily::GetDeviceFontSizeList() calls upon PhysicalFontFace::GetFontHeights(). This function takes this sorted list of font heights, and then populates and returns a new list of sizes (or rather, heights). As the heights aren't available any more, this function is also unneeded, so it has been removed. 4. OutputDevice::GetDevFontSizeCount() calls upon PhysicalFontFamily::GetDeviceFontSizeList(). This function has the side effect of initializing the list of fonts. 5. When I checked what calls on GetDevFontSizeCount(), there is only one caller - FontList::GetSizeAry() in svtools. The function returns a standard font size list if the family name is empty, or there are no font sizes (via OutputDevice::GetDevFontSizeCount()). As this will *always* be empty (see chain above) then this function just needs to always return a standard font size list. Thus OutputDevice::GetDevFontSizeCount() and GetFontSizeList() are no longer called upon by anything, so they can be removed. 6. svtool's FontList::GetSizeAry() no longer uses the FontMetric parameter, so this has been removed from the function signature, and cleanup done of the function that calls upon it in svtools, framework, editeng, and desktop. A number of variables that were no longer used due to this change were also removed. 7. This change removed the need for the mpSizeAry unique_ptr in FontList. ImplFontListFontMetric::GetDevice() and mpDevice could also be removed as it was no longer used anywhere. 8. After simplifying GetSizeAry(), it turns out it was the same as GetStdSizeAry(), so removed FontList::GetSizeAry() and used FontList::GetStdSizeAry() in its place. 9. Changing to use GetStdSizeAry() revealed that FontSizeBox::Fill() no longer used the pFontMetric paramter, so this was removed, and call sites updated. 10. Due to change to Fill(): a. SvxFontSizeBox_Base::UpdateFont() no longer uses the const css::awt::FontDescriptor& rCurrentFont parameter, so removed this. This also removed the member variable m_aCurrentFont b. SvxCharNamePage::FillSizeBox_Impl() had a number of newly unused variables removed. c. SwStdFontTabPage::Reset() and SwStdFontTabPage::LoseFocusHdl() had a number of newly unused variables removed. Change-Id: If840e240155c36ed351c63e3136b5b44bb058697 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121932 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>