summaryrefslogtreecommitdiff
path: root/framework
AgeCommit message (Collapse)Author
2021-12-17tdf#146219: don't try to detect if a recent file is a directoryMike Kaganski
This avoids accessing (possibly unavailable) remote URLs, when we already know that MRU items are files. Change-Id: I97e07f007d4129b93b4939311c67cf95de6ff836 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126943 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127004
2021-11-23O[U]String::replaceAt overloads that take string_viewNoel Grandin
which results in lots of nice string_view improvements picked up by the plugins Change-Id: Ib0ec3887816b3d4436d003b739d9814f83e244b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125657 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-22osl::Mutex->std::mutex in WindowCommandDispatchNoel Grandin
Change-Id: Ia89f4a7b1f444a031e8f58f644ba9129f8c48942 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125622 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-22osl::Mutex->std::mutex in XFrameImpl::windowShownNoel Grandin
Change-Id: I1e56d0931a6e814cb9a4faa6a06e70b3740cb728 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125628 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-22osl::Mutex->std::mutex in GlobalSettings_AccessNoel Grandin
Change-Id: I5162a157fd07870bf768947b32e8afe8f1fb0a02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125629 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-21osl::Mutex->std::mutex in ActionLockGuardNoel Grandin
Change-Id: I8081d017f8a03be94b60011fcd4eb34eba786aa9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125623 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-21osl::Mutex->std::mutex in ConfigurationAccess_FactoryManagerNoel Grandin
Change-Id: I0e7a6eb4700e1108b31dfdf8681e8f4743ab7c5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125618 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-21osl::Mutex->std::mutex in ConfigurationAccess_ControllerFactoryNoel Grandin
Change-Id: I2e526ff2dc9f02850bd9fc510c63b5d9db24af58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125619 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-21osl::Mutex->std::mutex in framework::ConfigAccessNoel Grandin
Change-Id: I44d41db2498ea39fca309785278c1fe50d7ae8b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125617 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-21osl::Mutex->std::mutex in StatusIndicatorFactoryNoel Grandin
Change-Id: I2365e172ef8d631f30cfffdb650ebcb3035f77f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125620 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-17tdf#143971 Removes pop-up dialog for read-only documentsMatt K
No longer does the user get a pop-up dialog when opening documents that are read-only, asking whether they want to be notified when the document becomes editable. The change removes some of the functionality introduced in commit 95eb088802562b75f8b299908160145c7e88d763 "tdf#47065 Add new file open UI options and implement a new thread". Change-Id: Ic25e8e293e7224fb5086249a9d4814914fa961d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125340 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-12introduce OUStringConstExprNoel Grandin
so we can declare compile-time constant arrays and structs containing OUStringLiteral Change-Id: I51fd743f2e461a36bb4a0a17c6ff107f86096895 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125045 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-11Handle UNO command aliases in ToolBoxesSzymon Kłos
This allows to use ".uno:InsertSlide" which is an alias for ".uno:InsertPage" in the notebookbar. Change-Id: Ia52488b65e308a62b686e77b38cba3675deece73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124952 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125046 Tested-by: Jenkins
2021-11-10Fix typosAndrea Gelmini
Change-Id: I697591f867fee5332913ee534b9f0ba754239e58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124943 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
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-05flatten PopupMenuDispatcher::queryDispatchNoel Grandin
Change-Id: I8dce031913a4ed40faa8d7994b1da8990d684091 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124732 Tested-by: Jenkins Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-05[-Werror=nonnull] ‘this’ pointer is nullNoel Grandin
gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0 is now complaining about a double-unlock Which has been there ever since commit fb6c93aed8d3d7468e4c9b412e432633c36e68fc Date: Wed Dec 13 14:05:51 2006 +0000 INTEGRATION: CWS fwk54 (1.1.2); FILE ADDED 2006/11/10 12:54:27 cd 1.1.2.1: #i65187# Protocol handler for vnd.sun.star.popup URLs to support dispatch by popup menu controller Change-Id: I87206bb7313b69babb16859808868ffa00707faa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124731 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-04elide unnecessary UNO_QUERY_THROW callsNoel Grandin
Change-Id: I0d0fc57f352e9717e721416c8941cfcf48af24c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124650 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-30Prepare for removal of non-const operator[] from Sequence in frameworkMike Kaganski
Change-Id: Ied2683a0b8a1bab1a7594da1e9bdbd3cb753552c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124370 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-29simplify framework::TitleHelperNoel Grandin
Every callsite (bar one) calls setOwner and connectWithUntitledNumbers after construction, so just pass them in the constructor. And for that lone callsite we can just nullptr as an argument. Change-Id: If838e068bb59a407225d853a0f67983be400f2f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124426 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-22return weld::Builder by unique_ptrNoel Grandin
Change-Id: Ifa4f5951d200eaad6c8aebd3f29eed053c927ff0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124051 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-21loplugin:flattenNoel Grandin
Change-Id: I3b4226a9d089ec9aedab95d96e50a068f57a76c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123991 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-20framework: allow tests to run with read-only $SRCDIRMichael Stahl
SfxMedium constructor will call QuietInteraction::handle() which invokes abort(), so can't load any documents. (regression from commit 95eb088802562b75f8b299908160145c7e88d763) Change-Id: I7958ad30a06ffea299d70a9a8132eb9ffcf33f43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123834 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-10-19can reduce scope a littleCaolán McNamara
Change-Id: I19f5422ad7c72b5fcd11b507e7a2e22e34dde4c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123797 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-19Following 3abbb1486f09b377084c3232a921772302ab34ecJulien Nabet
Not need to use Sequences here Change-Id: I2507566f5939dbdcb5d2ab420f16a55d4cc403b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123765 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-18Fix nb of tokens in XCUBasedAcceleratorConfiguration::reloadChangedJulien Nabet
and use 4 like XCUBasedAcceleratorConfiguration::impl_ts_load Indeed, there can be: - SHIFT - MOD1 - MOD2 - MOD3 Change-Id: I1e206a6cb74761165b60887e768fa9b057c4b242 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123722 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-10-18Simplify Sequences init + remove dup block + typos in frameworkJulien Nabet
Change-Id: Ife80915c402ff25aa4752a5e1b68337eca3dd85f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123721 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
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-14use std::vector::insert instead of push_backNoel Grandin
because it will pre-allocate space and often is optimised to memcpy Change-Id: I03ed7915f2762d3d27e378638052a47a28bbf096 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123588 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-12Fix typoAndrea Gelmini
Change-Id: I95bd5418d45ec4a0d0ff403244b7727e37b7d075 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123443 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-12loplugin:unusedfieldsNoel Grandin
Change-Id: I5e9bb4417cf6f8e3c1de1c8570e0635fdf6364bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123453 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-11loplugin:moveparam in frameworkNoel Grandin
Change-Id: I423fa6a4f4fea5a27ec69f65dac952eff42d3d99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123418 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-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-10-01tdf#127543 add saveacopy to Save dropdown menuJustin Luth
Why not? It usually doesn't exist in a nearby shortcut. Change-Id: I3f9f0070c05bb1ce05795cabe8db0f95593ab5cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122606 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-10-01else branch doesn't make sense, dereferences nullCaolán McNamara
if xModel.is() is false then xModel->getCurrentController() is just going to crash. like this since it was introduced in commit eafba820349005ea5426cab58911f9ff99969966 Date: Tue Jan 5 22:32:38 2010 +0100 autorecovery: define a new css.document.XDocumentRecovery interface, implement it in both SFX and DBACCESS, and use it in the autorecovery Change-Id: I8ea43a0679d43cb9b865ecae5260129d17b6a386 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122898 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
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-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-23Extend loplugin:stringviewparam to starts/endsWith: frameworkStephan Bergmann
Change-Id: Idc92058e7d2ff63d55e97e6b2fee83314fc0334c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122498 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-21Remove some "Attention" comments of little valueStephan Bergmann
...and rather add sal/config.h includes, while at it Change-Id: I0ea917b101d89f16228bea6b3102b630c8202e07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122369 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
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>
2021-09-20clean up ambiguous confusing rectangle APIs like IsInside()Luboš Luňák
Reading 'rectA.IsInside( rectB )' kind of suggests that the code checks whether 'rectA is inside rectB', but it's actually the other way around. Rename IsInside() -> Contains(), IsOver() -> Overlaps(), which should make it clear which way the logic goes. Change-Id: I9347450fe7dc34c96df6d636a4e3e660de1801ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122271 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Jenkins
2021-09-20Add sal/config.h in preparation for patchChris Sherlock
The convention is that we need to add sal/config.h to the start of files. I have a patch queued to be able to create a FontMetric from a PhysicalFontFace. Submitting this patch so I can hopefully one day land this patch. Change-Id: I5817acd6e194da576f2c8a13539d38954a4f4e15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122172 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-18vcl: create FontMetric from PhysicalFontFaceChris Sherlock
A FontMetric can be created from a PhysicalFontFace, so setup a constructor that takes a PhysicalFontFace object to instantiate the FontMetric. The OutputDevice functions GetDevFont() and GetDevFontCount() don't necessarily make much sense, so have changed GetDevFont() to GetFontMetricFromCollection() and GetDevFontCount() to GetFontFaceCollectionCount(). Change-Id: I1577679b949a49a7cf1248838786d0f5e84a5245 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121796 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-15Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 5Mike Kaganski
- Revise uses of getSomething to use getFromUnoTunnel Where that is impossible, use getSomething_cast to unify casting, and minimize number of places doing low-level transformations. The change keeps the existing tunnel references that last for the duration of the pointers' life, because sometimes destroying such reference may destroy the pointed object, and result in use after free. Change-Id: I291c33223582c34cd2c763aa8aacf0ae899ca4c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122101 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-15Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 4Mike Kaganski
- Change implementations of getSomething to use getSomethingImpl Or where that's impossible, use getSomething_cast to unify this and reduce number of places where we reinterpret_cast. All static methods getting tunnel ids were renamed to getUnoTunnelId, to comply with the convention used in <comphelper/servicehelper.hxx>. TODO (in separate commits): - Revise uses of getSomething to use getFromUnoTunnel Change-Id: Ifde9e214b52e5df678de71fcc32d2199c82e85cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122100 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-15Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 1Mike Kaganski
The header got some changes: 1. Move UnoTunnelIdInit and isUnoTunnelId into 'comphelper' namespace 2. Rename UnoTunnelIdInit to UnoIdInit, as a precondition to replace of uses of OImplementationId with it, including in XTypeProvider 3. Introduce convenience functions 'getSomething_cast' to cast between sal_Int64 and object pointers uniformly. 4. Rename getUnoTunnelImplementation to getFromUnoTunnel, both to make it a bit shorter, and to reflect its function better. Templatize it to take also css::uno::Any for convenience. 5. Introduce getSomethingImpl, inspired by sw::UnoTunnelImpl; allow it handle cases both with and without fallback to parent. 6. Adjust UNO3_GETIMPLEMENTATION_* macros TODO (in separate commits): - Drop sw::UnoTunnelImpl and sw::UnoTunnelGetImplementation - Replace all uses of OImplementationId in core with UnoIdInit - Deprecate OImplementationId in <cppuhelper/typeprovider.hxx> - Change implementations of getSomething to use getSomethingImpl - Revise uses of getSomething to use getFromUnoTunnel Change-Id: If4a3cb024130f1f552f988f0479589da1cd066e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122022 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-11clang:optin.performance.PaddingNoel Grandin
Excessive padding in 'struct ValueSetItem' (8 padding bytes, where 0 is optimal). Excessive padding in 'struct framework::CommandInfo' (12 padding bytes, where 4 is optimal). Optimal fields order: aIds, nId, nImageInfo, consider reordering the fields or adding explicit padding members [optin.performance.Padding] Excessive padding in 'class drawinglayer::attribute::ImpFillGradientAttribute' (10 padding bytes, where 2 is optimal). Excessive padding in 'class drawinglayer::attribute::ImpSdrLineAttribute' (8 padding bytes, where 0 is optimal). Change-Id: I606f2bfc2c0c51b386182b900401dd15b5404451 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121938 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>