summaryrefslogtreecommitdiff
path: root/vcl
AgeCommit message (Collapse)Author
2023-06-07Partial fix tdf#155376 use NSAccessibilityElement instead of NSViewPatrick Luby
On macOS, accessibility is implemented by creating a native NSView for each C++ accessible element. The problem with using an NSView for each element is that NSViews are very slow to add to or remove from an NSWindow once the number of NSViews is more than a thousand or so. Fortunately, Apple added a protocol that allows adding a native accessible element using the lightweight NSAccessiblityElement class. The topmost NSAccessiblityElement elements are connected to the single SalFrameView in each NSWindow but since NSAccessiblityElements are not NSViews, they are not connected to any of NSWindow's event or draw dispatching. This makes NSAccessiblityElements significantly faster to add to or remove from an NSWindow with no apparent loss in functionality. Note: this change is a subset of the LibreOffice 4.4 code changes that I wrote for NeoOffice. Change-Id: I408108d57217db407512dfa3457fe26d2ab455de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152717 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Patrick Luby <plubius@neooffice.org>
2023-06-07tdf#155376 partially convert SvCTLOptions to officecfgNoel Grandin
When accessibility is enabled, Calc will add tens of thousands of listeners. We then spend a significant chunk of time creating SvCTLOptions objects (attached to ImpEditEngine) and adding and removing those objects from the related listener lists. But the required information is already globally cached by the officecfg module, so we can avoid that overhead and just fetch it directly from officecfg. Change-Id: I7ff55fd7c4926866eb7086812275ba8bd6e84c75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152645 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-06perf: we don't need to 'really' insert a preview when providing jsonCaolán McNamara
if we have intercepting 'image' when generating the json, then we don't need to really insert the image into the server side TreeView at all, we just need to provide it in the client json payload. so we generate each bitmap once, and its base64 png representation once. Change-Id: I1b6916b036a0b84ef4346ebf2141240c4ae5b706 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152675 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-06perf: cache the generated json for an iconview imageCaolán McNamara
before: |--13.95%--JSDialogNotifyIdle::Invoke | | | |--13.01%--JSDialogNotifyIdle::generateWidgetUpdate | | | | | |--11.03%--IconView::DumpAsPropertyTree | | | lcl_DumpEntryAndSiblings (inlined) | | | | | | | |--10.94%--extractPngString (inlined) after: |--4.86%--JSDialogNotifyIdle::Invoke ... | |--2.90%--JSDialogNotifyIdle::generateWidgetUpdate | | | | | |--0.76%--IconView::DumpAsPropertyTree | | | IconView::DumpEntryAndSiblings | | | Link<std::tuple<tools::JsonWriter&, rtl::OUString const&, std::basic_string_view<char, std::char_traits<char> > > const&, bool>::Call (inlined) | | | StylesPreviewWindow_Base::DoJsonProperty | | | | | | | |--0.55%--StylesPreviewWindow_Base::GetCachedPreviewJson Change-Id: Id234a84e36710794822945584be3adf028808625 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152630 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-05Revert "tdf#155676: Use colon in FontsUseWinMetrics config key"خالد حسني
This reverts commit a38e1537cd06367783a43cc8d3b0e8d674b6e142. Change-Id: Ic72f1acb7e38209e9b87a8fe80a39acb1eeacfe4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152547 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-06-05tdf#155676: Use colon in FontsUseWinMetrics config keyKhaled Hosny
The use of comma breaks editing in Expert Configuration dialog, so users effectively can’t use this. After editing <it>Celticmd,1571,-567,1571,-547,2126,559</it> becomes <it>Celticmd</it><it>1571</it><it>-567</it><it>1571</it><it>-547</it><it>2126</it><it>559</it> Using colon instead of comma seems to fix this. Change-Id: I4bba26fe9d94a33e62a0d34c3324daae0845c30b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152597 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-06-05gtk3 a11y: Consolidate reporting accessible nameColomban Wendling
Just like in I61c4d8d4713b2b82ebb40d9de2a8a773405591ba, avoid the any assumption on what the parent would do in its own implementation, and return ourselves when we mean to. The case of AtkObjectWrapper::get_name() is actually currently fine, because AtkObject::get_name() does what we think it does, and GtkWidgetAccessible doesn't override it, but it's safer not to rely on those assumptions. Change-Id: Ib500d8efa8501206da66c3cca4f6b93bd426cb7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152457 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-06-05gtk3 a11y: Fix reporting accessible descriptionColomban Wendling
AtkObjectWrapper::get_description() sets the AtkObject::description field and chains up to its parent, expecting it to return that member to the caller. This is a questionable assumption, but that's what AtkObject does. However, since f3b0a95f9c2f85604808c21485e46e43aebbbfed which fixed tdf#150496, the direct parent is GtkWidgetAccessible, not AtkObject. And the assumption about returning AtkObject::description doesn't hold then, because GtkWidgetAccessible short-circuits the call if it can't find the associate GtkWidget, which doesn't exist. To fix this, return the member directly when we set it, but leave it to the parent if we don't have anything better in case it could actually do something useful, and because it's customary. Change-Id: I61c4d8d4713b2b82ebb40d9de2a8a773405591ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152456 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-06-03perf: use lighter weight png generation for iconviewCaolán McNamara
before: |--9.50%--JSDialogNotifyIdle::Invoke | | | |--9.33%--JSDialogNotifyIdle::generateWidgetUpdate | | IconView::DumpAsPropertyTree | | lcl_DumpEntryAndSiblings (inlined) | | | | | |--8.99%--extractPngString (inlined) | | | | | | | |--8.21%--GraphicConverter::Export | | | | Link<ConvertData&, bool>::Call (inlined) | | | | GraphicFilter::FilterCallback | | | | GraphicFilter::ExportGraphic after: |--7.50%--JSDialogNotifyIdle::Invoke | JSDialogNotifyIdle::generateWidgetUpdate | IconView::DumpAsPropertyTree | lcl_DumpEntryAndSiblings (inlined) | | | |--7.16%--extractPngString (inlined) | | | | | |--6.84%--vcl::pngWrite Change-Id: Iae34c8bde3e0bbd075252de356f64557fd80c9ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152578 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-02Cannot self-append OUStringBuffer via concatenationStephan Bergmann
a5084d15e1b72e303e1628fbff84432036b014a9 "loplugin:stringadd in vcl" had dropped the intermediary sTemp, but which caused JunitTest_forms_unoapi_1 to fail for me once with > ==2657124==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [0x50c00086ca58,0x50c00086ca6a) and [0x50c00086ca48, 0x50c00086ca5a) overlap > #0 in __asan_memcpy at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3 > #1 in char16_t* rtl::addDataHelper<char16_t>(char16_t*, char16_t const*, unsigned long) at include/rtl/stringconcat.hxx:80:9 > #2 in rtl::ToStringHelper<rtl::OUStringBuffer>::operator()(char16_t*, rtl::OUStringBuffer const&) const at include/rtl/ustrbuf.hxx:1765:14 > #3 in rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, char const [3], rtl::OUString, 0>, char const [3], 0>, rtl::OUStringBuffer, 0>::addData(char16_t*) const at include/rtl/stringconcat.hxx:195:64 > #4 in rtl::ToStringHelper<rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, char const [3], rtl::OUString, 0>, char const [3], 0>, rtl::OUStringBuffer, 0>>::operator()(char16_t*, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, char const [3], rtl::OUString, 0>, char const [3], 0>, rtl::OUStringBuffer, 0> const&) const at include/rtl/stringconcat.hxx:207:101 > #5 in rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, char const [3], rtl::OUString, 0>, char const [3], 0>, rtl::OUStringBuffer, 0>, char const [4], 0>::addData(char16_t*) const at include/rtl/stringconcat.hxx:195:88 > #6 in rtl::ToStringHelper<rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, char const [3], rtl::OUString, 0>, char const [3], 0>, rtl::OUStringBuffer, 0>, char const [4], 0>>::operator()(char16_t*, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, char const [3], rtl::OUString, 0>, char const [3], 0>, rtl::OUStringBuffer, 0>, char const [4], 0> const&) const at include/rtl/stringconcat.hxx:207:101 > #7 in rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, char const [3], rtl::OUString, 0>, char const [3], 0>, rtl::OUStringBuffer, 0>, char const [4], 0>, rtl::OUString, 0>::addData(char16_t*) const at include/rtl/stringconcat.hxx:195:88 > #8 in rtl::ToStringHelper<rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, char const [3], rtl::OUString, 0>, char const [3], 0>, rtl::OUStringBuffer, 0>, char const [4], 0>, rtl::OUString, 0>>::operator()(char16_t*, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, char const [3], rtl::OUString, 0>, char const [3], 0>, rtl::OUStringBuffer, 0>, char const [4], 0>, rtl::OUString, 0> const&) const at include/rtl/stringconcat.hxx:207:101 > #9 in rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, char const [3], rtl::OUString, 0>, char const [3], 0>, rtl::OUStringBuffer, 0>, char const [4], 0>, rtl::OUString, 0>, char const [4], 0>::addData(char16_t*) const at include/rtl/stringconcat.hxx:195:88 > #10 in rtl::ToStringHelper<rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, char const [3], rtl::OUString, 0>, char const [3], 0>, rtl::OUStringBuffer, 0>, char const [4], 0>, rtl::OUString, 0>, char const [4], 0>>::operator()(char16_t*, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, char const [3], rtl::OUString, 0>, char const [3], 0>, rtl::OUStringBuffer, 0>, char const [4], 0>, rtl::OUString, 0>, char const [4], 0> const&) const at include/rtl/stringconcat.hxx:207:101 > #11 in rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, char const [3], rtl::OUString, 0>, char const [3], 0>, rtl::OUStringBuffer, 0>, char const [4], 0>, rtl::OUString, 0>, char const [4], 0>, rtl::OUStringBuffer, 0>::addData(char16_t*) const at include/rtl/stringconcat.hxx:195:88 > #12 in rtl::OUStringBuffer& rtl::OUStringBuffer::operator=<rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, char const [3], rtl::OUString, 0>, char const [3], 0>, rtl::OUStringBuffer, 0>, char const [4], 0>, rtl::OUString, 0>, char const [4], 0>, rtl::OUStringBuffer>(rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, rtl::StringConcat<char16_t, char const [3], rtl::OUString, 0>, char const [3], 0>, rtl::OUStringBuffer, 0>, char const [4], 0>, rtl::OUString, 0>, char const [4], 0>, rtl::OUStringBuffer, 0>&&) at include/rtl/ustrbuf.hxx:378:17 > #13 in DoubleCurrencyField::UpdateCurrencyFormat() at vcl/source/control/fmtfield.cxx:1120:20 and e.g. > OUStringBuffer b("a"); > b = "b" + b; > CPPUNIT_ASSERT_EQUAL(OUString("ba"), b.makeStringAndClear()); would indeed easily fail with > equality assertion failed > - Expected: ba > - Actual : bb Change-Id: I3108c18b7c941953a73b5731d9973914b7ba1fbe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152495 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-06-02reduce memory overhead of AquaA11yWrapperNoel Grandin
we can allocate this internally, which reduces the number of heap allocations we need to do Change-Id: Id5298e70b6816cd65d8285ceea846dc8e9e4b39d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152489 Reviewed-by: Patrick Luby <plubius@neooffice.org> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-01Related: tdf#155425 use preferred_size instead of allocated_widthCaolán McNamara
the scrollbar might not actually be visible so has no real allocated width yet Change-Id: Id15af9e481b9971bf79f16da16581f820f8303d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152506 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-01tdf#155623: Revert "tdf#155557: Fix drawing mixed direction underlined text"Khaled Hosny
This reverts commit 99d22fd79c5532fd6c1b167996e1c27216b92469. Lets revert and figure out a less radical fix for the original issue. Change-Id: If3025d32019e953b7946ebe4209daf74efc5e15a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152490 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-06-01tdf#153440: Fix font fallback for surrogate pairs in RTL textKhaled Hosny
When checking for a font that supports the surrogate pair, code was appending code units one by one to string buffer and in RTL case this was happening in reverse order leading to invalid text and consequently failing to find any font that supports it. We now iterate over runs not individual positions, so the text of each individual run maintains its correct order regardless of the direction. Change-Id: Icf2e2aed56512bf907dc6b3c36f387a9e3ad497a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152481 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-06-01WaE: WhitespaceToSpace() spurious -Werror=maybe-uninitializedCaolán McNamara
vcl/source/helper/strhelper.cxx:366:9: error: ‘pBuffer[-1]’ may be used uninitialized [-Werror=maybe-uninitialized] I see this with gcc 13 too Change-Id: I3ddc5fadb9177827e6cd49f5b6366a79204e95c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152469 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-06-01tdf#155557: Fix drawing mixed direction underlined textKhaled Hosny
The code here first unsets the underline style, draws the text, then measures the text size, change the text to two blank spaces, sets the measured width back and tries to guess how much space was added by justification, sets the underline style back and then draws again. I have no idea why it is doing it in this highly convoluted way, but this code goes all way back to the initial import. However, it currently fails to account for Arabic justification when the Arabic text does not have any space characters. Instead of trying to guess more how much width the Arabic justification adds, I’m removing this code altogether to let the normal drawing code handle the underline drawing. Lets see what will break. Update text expectation because we now do one-less drawing. Change-Id: I8158bd15370005a78b866c8192414e4b46af2727 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152452 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-05-31vcl: one more nullptr check in Window::GetOutDev()Miklos Vajna
As it was pointed out at <https://gerrit.libreoffice.org/c/core/+/151857/2#message-ced4ba9ebaf5725ec06853682c146211824af158>, it makes little sense to have the nullptr check in the non-const version of Window::GetOutDev() but not have it in the const version, fix this. Change-Id: I2f97938a4015d3ce27e35b9971b65090f7289c11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152429 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-05-30Related: tdf#155542 drop workaround for "XB Roya" issueCaolán McNamara
Change-Id: I8323ae631c13da80cc3f4b8b8826cb9b23e788f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152384 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-05-30tdf#155542: Fix crashtesting assertKhaled Hosny
When cloning an RTL glyph range, we might end up cutting in the middle of a cluster e.g. between a base character and a combining mark since both with have the same charPos() after: commit 09c076c3f29c28497f162d3a5b7baab040725d56 Author: Khaled Hosny <khaled@aliftype.com> Date: Wed Oct 5 21:00:46 2022 +0200 tdf#151350: Fix extraneous gaps before marks (which changed how HarfBuzz sets up clusters back to the default where marks form clusters with their bases, before that a mark formed its own cluster). This leads to the cloned glyph range to include the glyph for the combining marks, while it is not included in the text string. Change-Id: I83031e0e0ffc7c5932101649a9cc2bf953a6347d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152380 Tested-by: Jenkins Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-05-30merge expwrap into sax libraryNoel Grandin
there is no need for 2 shared libs for such a small module Change-Id: Id28c9038f3e16931bfb8af3532eca172998da1aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152374 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-29tdf#149297: Fix Y position of vertical glyphs on macOSKhaled Hosny
Remove the Y position offset that became redundant and now double shifts the glyphs after: commit dd0d0b44fd1c6c0292d7b2eb3f5cf2baa21e4481 Author: Mark Hung <marklh9@gmail.com> Date: Sun May 2 15:12:46 2021 +0800 vcl: adjust LayoutText() for vertical writing. Change-Id: Iac7abfa69acfe75860d05800f446c25ed622bb95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152366 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-05-29cppunit/timer: Use a range based loop and cleanupDr. David Alan Gilbert
Use a range based loop in testDurations re tdf#145538 which also nails a SAL_N_ELEMENTS tdf#147021 and takes out a sal_uLong tdf#114441 while here, clean out the rest of the sal_uLong's in that file to be sal_uInt64 to match timer.hxx which was changed by 9c7016b5b5 way back in 2015. Change-Id: Ie065885939a340d9a73af797fb4d7d6f76530242 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152250 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-29tdf#155515 tdf#155528 crash on exitNoel Grandin
regression from commit 3b7db802731826b6cc3b55100470b0c61c1f2dfa Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Thu May 4 10:06:14 2023 +0200 tdf#105404 [API CHANGE] add index to accessiblity change event Fix a handful of things related to accessibility objects being destructed later than they should and consequently trying at access other stuff that has already been destructed. (1) AccessibleControlShape::disposing check the window still exists (2) DocumentFocusListener::notifyEvent, handle INVALIDATE_ALL_CHILDREN (3) hold DocumentFocusListener by weak reference in GtkSalData, so that it dies when the related UI widgets die Change-Id: I38bf68a748b37e6abc4a8cfcc961436728e081bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152365 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-29Related tdf#tdf155376 fix minor memory leaksPatrick Luby
Change-Id: I9cdc5fb38ffba113e3d069d9d766dbe1a82c492d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152352 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org> (cherry picked from commit 7ae89a2ad89c9e7702fbd2b31269ee4c61fe5bcb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152316
2023-05-29Partial fix tdf#146626 Catch uncaught DisposedExceptionPatrick Luby
Fix crash due to an uncaught DisposedException thrown by SwAccessibleParagraph::getTextRange() by using the same try/catch block in -[A11yWrapper accessibilityAttributeValue:] in -[A11yWrapper accessibilityAttributeValue:forParameter]. Change-Id: Ifcaec3eb2d76f32bddc56a1242f6d86f8b90f782 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152361 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org> (cherry picked from commit f8cc6f960e8aeb37547d447fed2b2c6e6ddc02e3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152317
2023-05-28Use getXWeak in vclMike Kaganski
Change-Id: I665c9dc8c4f9cc4a996d9bf990cbfa33822bd07f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150885 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-26tdf#155190 svx,sw: PDF export: don't tag SwNoTextFrame as ArtifactMichael Stahl
The problem is that inside of the Figure tag, in SwNoTextFrame::ImplPaintPictureGraphic(), ViewContactOfSwNoTextFrame and ViewObjectContactOfSwNoTextFrame are used to create and process another primitive sequence. ViewObjectContactOfSwNoTextFrame does not have access to a SdrObject, because that was already processed by the outer layer of code that called the SwFlyFrame painting code. Avoid running the code that assumes anything without an SdrObject is an artifact by disabling PDF tags altogether in ViewObjectContactOfSwNoTextFrame. (regression from commit 81ef84648515965bf67afaced946227d0f63a71e) Change-Id: I9fabe7f7e5296f8d850448ac44865f87cd164591 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152335 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-05-26vcl: PDF export: stop adding pointless circular RoleMap entriesMichael Stahl
... for standard roles; no idea what these are supposed to be good for. Change-Id: Ie2ccf394631a2bccb496b2f93e26a571ba84d58d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152334 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-05-26replace find_if by none_ofDr. David Alan Gilbert
A set of cases where find_if is used just to test if there are no matches; use none_of as per tdf#153109 Change-Id: I6c705ab7a8289914743199722a444ee40d11d746 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152200 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-25tdf#152048: Fix underline width for Kashida-justified textKhaled Hosny
Fix GenericSalLayout::GetTextWidth() again, this time doing away with using linearPos as it is wrong, the glyph’s position is not directly related to how much it contributes to the text width (for example, combining marks have zero advance width yet their position is different from the base glyph they apply too). This is a followup to: commit ce7c1c608fa99c86c8f2380cd8b82d02123f514e Author: Khaled Hosny <khaled@aliftype.com> Date: Wed Aug 31 07:07:54 2022 +0200 vcl: Fix GenericSalLayout::GetTextWidth() Additionally, inserted Kashida should have its origWidth and newWidth both set to zero, since it does not add to the text width, all additional width is already added to the glyph the Kashida is applied to. With both fixes, the text width of Kashida-justified lines is correctly calculated and the underline no longer extends beyond the text line. Fix test expectation now we are reporting the real text width. Change-Id: I0de93f955929cf3030cf420cb4f4e94df974fb79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152267 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-05-24tdf#141684 tdf#147740 notebookbar: fix disappearing icons in groupbar #2Justin Luth
AFAICS, the code was non-sensical before. Hopefully now it is logical. Apparently returning the correct width doesn't mean much, but that is the only thing that should be changing in this patch. I would assume that returning an accurate width is the proper thing to do for this function... Change-Id: Iab26ac7fd8cd00127d2646f792fa552ec148dc74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152126 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-05-24speedup drawing toolbars, cache min-widthNoel Grandin
doing the style lookup for the minWidth is really very slow in gtk Change-Id: Ic7c44edada8d7205586fe569f30d92d4243642a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152182 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-23perf: surprising to see getenv on a profile.Michael Meeks
Change-Id: Id97c77d4c836e4f3c5a9eff6da07eb52d29248c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152105 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2023-05-23perf: surprising to see PDF being vsprintf'd during JSDialog rendering.Michael Meeks
Avoid some hundreds of these: _cairo_pdf_surface_show_page ... cairo_surface_destroy CairoTextRender::CairoTextRender via. SvpCairoTextRender: :SvpCairoTextRender(SvpSalGraphics&) SvpSalGraphics: :SvpSalGraphics() Change-Id: Ieefb65138f7e685f09dbf4c36a2fccd39b4b05cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152173 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-05-23gtk a11y: Return 0xFFFFFFFF for invalid charactersColomban Wendling
Make get_character_at_offset() return 0xFFFFFFFF if fetching the character fails, including when querying an unpaired surrogate. https://docs.gtk.org/atspi2/method.Text.get_character_at_offset.html Change-Id: If5e2e3b6bbd4cbc86b2b8524f305f8f0d843019d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151591 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-05-23tdf#140557 notebookbar: be smarter about hidden window sizeJustin Luth
This fixes a 7.1 regression from 53d73d532281b6734a7d4614bb74fc6cc15510f0 where notebookbar controls were being hidden (and then shown after a refresh of the toolbar), leaving big empty gaps. I don't know anything about vcl or window layout idiosyncracies, so I just read through this code looking for some way to fix the problem of the notebookbar not using all of its available space. The problem was that GetOutputSizePixel was returning zero. Why that would be I don't know. Perhaps because it had never actually been displayed on screen yet? (This was occurring on simply loading Calc.) Substituting a small DUMMY_WIDTH didn't give a very accurate reduction, so there was no space to add back in any items later on. When adding it back, it adds using a legitimate-seeming width, with an (unused this time) fallback to DUMMY_WIDTH. So, unless getLayoutRequisition cannot be depended upon for returning an accurate size, this should be a nice fix. It will no longer hide too many controls from the notebookbar. Change-Id: I1c39fe3532dad501c16f53612f8e26835b72638a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152125 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-05-23Avoid -Werror=unused-function when building against older GTK4Stephan Bergmann
...as reported in the comment at <https://gerrit.libreoffice.org/c/core/+/151866/2#message-daf995784c18439280d3280877cfcf73d0bb5e9b> "Silence loplugin:external and lopluign:unreffun in (WIP?) a11y.cxx for now", > In file included from /home/michi/development/git/libreoffice/vcl/unx/gtk4/a11y.cxx:17: > /home/michi/development/git/libreoffice/vcl/unx/gtk4/a11y.hxx:19:24: error: ‘void* lo_accessible_get_instance_private(LoAccessible*)’ declared ‘static’ but never defined [-Werror=unused-function] > 19 | static inline gpointer lo_accessible_get_instance_private(LoAccessible*); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /home/michi/development/git/libreoffice/vcl/unx/gtk4/a11y.hxx:21:24: error: ‘void* ooo_fixed_get_instance_private(OOoFixed*)’ declared ‘static’ but never defined [-Werror=unused-function] > 21 | static inline gpointer ooo_fixed_get_instance_private(OOoFixed*); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I40811235a66e429e2472b50bcbaa3e6fefa6a593 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152147 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-05-23tdf#155235 workaround gtk3 accessiblibility crashes on closeNoel Grandin
we are still working around the problem here, which is that various bit are not firing accessibility events when their children change. So clear the static map in comphelper on shutdown, to prevent crashes resulting from objects being kept alive after vcl has shutdown Change-Id: I3ae216b345a1bb4cb4e3fde3527e4d4aa5968f76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152161 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-23Resolves tdf#145080 - Use accent color for focused cellHeiko Tietze
Accent color added but effectively working only on macOS See inline comments for gtk, qt, and win Change-Id: I1e4a729331735683921f94b27bb2bb02555c0165 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151887 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2023-05-21Revert "tdf#63130 when getting the size, do not do a full paint"Caolán McNamara
because it is triggering many CppunitTest_toolkit_a11y failures This reverts commit 67c3b3becab2aa2b9522e3a092d46bfe507c3101. ImplCallResize is not called on the same Window after that commit than it was originally called on. Change-Id: I0c3721d2674067ac7f0bf765e0fe1097b1d67dbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152026 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-05-21Simplify a bitMike Kaganski
Change-Id: I4be66ff1ea2a15d3345134f4131bd0fabb5de9ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152028 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-05-20loplugin:unusedmethodsNoel Grandin
Change-Id: Ief95f111350808f010539bb733a553007d30a9df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152006 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-20loplugin:unusedfieldsNoel Grandin
Change-Id: I5036b484055e516fd808428238a044e12d34e089 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152005 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-19loplugin:unnecessaryvirtualNoel Grandin
Change-Id: I3a3d4debd83f1a6452721ce704b6b88622b38109 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152004 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-18CppunitTest_vcl_filters_test: just pass the file name as parameterXisco Fauli
Otherwise these files would be flagged as unused Change-Id: I3203ef7820a6e5b31d48578d9184b5822836f27c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151940 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-05-18tdf#63130 reduce large memory copies when reading from BinaryDataContainerNoel Grandin
rather than writing a bunch more code, extract the common part from comphelper::SequenceInputStream into a new base class Change-Id: I0d3561e3ca2e748b904128e3b5955e27196d7170 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151943 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-18Fix typoAndrea Gelmini
Change-Id: I89d8b370cf95d43de33c35b788fc955adfb85a0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151948 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-18tdf#63130 reduce duplicated work when pixel snappingNoel Grandin
Cache the calculations so we don't repeat work unnecessarily. Shaves 5% off load time. Change-Id: Iffbdd08768fea5b25ac83926b812067f52cba3a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151883 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-17vcl: fix crash in Window::GetOutDev()Miklos Vajna
Crashreport signature: program/libmergedlo.so rtl::Reference<vcl::WindowOutputDevice>::get() const include/rtl/ref.hxx:208 program/libmergedlo.so vcl::Window::GetOutDev() vcl/source/window/window.cxx:574 program/libswlo.so SwViewShell::ImplEndAction(bool) sw/source/core/view/viewsh.cxx:294 program/libswlo.so SwViewShell::EndAction(bool) sw/inc/viewsh.hxx:611 i.e. GetOutDev() is called on a disposed vcl::Window. Change-Id: I5b17225fced85c6804fc93fd12021c92966d3aa7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151857 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-05-17tdf#63130 when getting the size, do not do a full paintNoel Grandin
otherwise we end up doing double work when called from ImplWindowFrameProc, which is the main driver of painting on the screen This reduces the load time by 10% Change-Id: I9eb82a180344875f707fbf3d8128351a35def6a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151879 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>