summaryrefslogtreecommitdiff
path: root/vcl
AgeCommit message (Collapse)Author
2023-07-26tdf#156354 - Fix UI Basic dialog contents not visible in preview modeBalazs Varga
with scrollbars enabled. Basic dialog elemets appear under groupbox in case of the dialog have scrollbar. cherry-pick from commit: 99e6e4dd273752ee671d1ade00b381786800a508 Change-Id: I07b26c4a4f733cb08b3432ee41d829552ec5e08d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154876 Tested-by: Jenkins Tested-by: Gabor Kelemen <kelemeng@ubuntu.com> Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154900 Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-06-13tdf#155794 vcl: handle WM_GETOBJECT without SolarMutexMichael Stahl
SalFrameWndProc() handles WM_GETOBJECT by acquiring SolarMutex and calling ImplHandleGetObject(), which again acquires the SolarMutex inside Application::SetSettings(). This was introduced with commit db214684057e3ff2fa32d57c00507309dd6c24d6 due to thread-safety crashes but it turns out that it can be problematic. When loading a document on a non-main thread, WinSalFrame::SetTitle() calls SetWindowTextW which is equivalent to SendMessage(WM_SETTEXT), while holding SolarMutex, and if the main thread doesn't finish processing it then that's a deadlock. Typically Desktop::Main() has already created the mxAccessBridge, so ImplHandleGetObject() most likely doesn't need to do it, so just skip the Settings code there in case the SolarMutex is locked by another thread. In case the SolarMutex is locked by another thread, do an unsafe read of ImplGetSVData()->mxAccessBridge - this should work until ImplSVData is deleted, by which time no Windows should exist anymore that could be receiving messages. This fixes part of the problem, winaccessibility also needs to stop using SolarMutex. Change-Id: I62b027ad06d2c3eb06a5f64b052a4acd0908f79c
2022-11-24tdf#140813: Use GetUpdatedClipboardFormats to enumerate clipboard formatsMike Kaganski
We really don't have to provide plain text formats other than Unicode, so we may avoid checking CF_LOCALE data when initializing flavor list. Let's pretend that any textual format in the clipboard is Unicode, and ensure that we only actually access system clipboard when we paste. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112044 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 7b6c0e63e64eb2ad1e83bd744a0d20f78c7a6b84) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112971 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Change-Id: Ife30f57605a42d59233bfcb97f8bc297b3ace463 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143176 Tested-by: Gabor Kelemen <kelemeng@ubuntu.com> Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2022-11-24WIN merge CWinClipbImpl into CWinClipboardJan-Marek Glogowski
Get rid of the already minimal pImpl. Change-Id: Ida6fedab6e779b649e546bae2cda5f14fd4090d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103211 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143175 Tested-by: Balazs Varga <balazs.varga.extern@allotropia.de> Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2022-11-24WIN move dtrans code into vcl/win/dtransJan-Marek Glogowski
There is nothing abstract about either the clipboard or data transfer code in that directory and it's just used on Windows. All other backends implement this code in VCL, so this moves almost all code, except for the common MimeContentTypeFactory, into the vcl Windows backend / vclplug_win. This also drops four DLLs: sysdtrans, dnd, dtrans and ftransl. Change-Id: I7018f50768bf221447b40487cc1f8a8586da33c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103209 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143174 Tested-by: Balazs Varga <balazs.varga.extern@allotropia.de> Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2022-11-24loplugin:simplifypointertobool (clang-cl)Stephan Bergmann
Change-Id: I6512e6e4217ef9084c74e46e3b4f1e8defbd1bec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100108 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143151 Tested-by: Balazs Varga <balazs.varga.extern@allotropia.de> Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2022-10-06tdf#151385 Only trigger mnemonics in dialogs when alt key is pressedSamuel Mehrbrodt
Change-Id: I884afad38c64bd53fe4917418ed627f9c0674554
2022-09-22ofz: Use-of-uninitialized-valueCaolán McNamara
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133717 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit f248b99b6f7f93b5170b4c50d7827fa0dd23421e) Change-Id: I9ca24a135494a49449aec63615b2d945a93e8b27
2022-09-01Fix dropdown mispositionedSamuel Mehrbrodt
Only skip the relative positioning when the window is indeed a dialog. Follow up fix for a49245e04d45735aa76ad7720657c83530ba9ed8 Change-Id: Idbd8327a943c512f0a617cb0ca72e9caeb2e61e3
2022-08-29Don't position dialogs relative to other dialogsSamuel Mehrbrodt
When calling setPosSize on a dialog, and there are other dialogs on top of it, the dialog was positioned relative to its parent dialog. Fix this, so that dialogs are always positioned relative to the main window (if there is one). Revert of/Follow up to 8750c812c9b808ee980f7e0ce0e6ce91e75e1424 Change-Id: I69f189865b118f9bc20077d48591fbd9e83b014f
2022-08-22Fix mispositioning when only quickstarter is activeSamuel Mehrbrodt
When positioning a dialog via external UNO connection, and no LibreOffice window is visible (only quickstarter is running), the window was mispositioned. The ClientToScreen call changes the requested position, so skip that for dialogs too. Change-Id: I7656ec66b6aeccdc1fa306f5e05cf72b3cb87214 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138135 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> (cherry picked from commit 8750c812c9b808ee980f7e0ce0e6ce91e75e1424)
2022-08-19tdf#150017 vcl,sw: add UITestMichael Stahl
Unfortunately i couldn't figure out how to send keyboard input to the Edit widget in the SvTreeListBox; it's created by SvTreeListBox::EditText() and shows up when calling dumpHierarchy() on the DialogUIObject as a child of the SvTreeListBox/"19LclHeaderTabListBox" but the execute() doesn't send it events, neither when called on DialogUIObject nor on TreeListUIObject. So forward explicitly in TreeListUIObject::execute() - probably not the best way to do this? When using the UI, events arrive like this: 0 SvInplaceEdit2::KeyInput(KeyEvent const&) at vcl/source/treelist/treelistbox.cxx:202 1 (anonymous namespace)::MyEdit_Impl::KeyInput(KeyEvent const&) at vcl/source/treelist/treelistbox.cxx:117 2 ImplHandleKey(vcl::Window*, MouseNotifyEvent, sal_uInt16, sal_uInt16, sal_uInt16, bool) (pWindow=0x6dc4bc0, nSVEvent=MouseNotifyEvent::KEYINPUT, nKeyCode=1026, nCharCode=0, nRepeat=0, bForward=true) at vcl/source/window/winproc.cxx:1209 3 ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) at vcl/source/window/winproc.cxx:2672 4 SalFrame::CallCallback(SalEvent, void const*) const (this=0x8a19fb0, nEvent=SalEvent::KeyInput, pEvent=0x7ffc7f3639a0) at vcl/inc/salframe.hxx:306 5 X11SalFrame::HandleKeyEvent(XKeyEvent*) at vcl/unx/generic/window/salframe.cxx:3190 Change-Id: I0be42330aeef98ef09e21297acef6cf616b7f2d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137459 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit a89b221afe2d2d8aa670236fce6e95022ffa1cd9)
2022-08-19tdf#150181 vcl: first column is editable by default in SvTabListBoxMichael Stahl
(regression from commit fe38553aef2121f358fb58e450ec69314aad851e) Change-Id: I58e1afb228dfd87b7d642ccf1b58277960f01e14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137561 Tested-by: Jenkins Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 0dcebde891619b4dcb4c0d170b3b5919ac6750c8)
2022-08-19vcl: allow editing a column other than the first one in SvTabListBoxMichael Stahl
There are 2 members mvTabList and aTabs in SvTabListBox and SvTreeListBox, and only aTabs is evaluated to determine which column should be edited when calling start_editing(). This solution is probably not ideal; it would be better to have a parameter to select the column because one might want multiple editable columns with multiple buttons... Also, the native GTK implementation has the same bug (but there double-clicking the column works). Change-Id: I727792e635d3b610a2132ee5f4155e3ee610aaf2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137362 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit fe38553aef2121f358fb58e450ec69314aad851e)
2022-08-19vcl: allow editing a column other than the first one in GtkInstanceTreeViewMichael Stahl
This is basically commit fe38553aef2121f358fb58e450ec69314aad851e for the native GTK widgets, so the "Edit Text" button in Insert->Bookmarks dialog works. Change-Id: Ifcd115de60ecee2c4e4c19535ce55156aa84ff79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137563 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-08-19gtk: honour disabled columns from set_column_editable for start_editingCaolán McNamara
Change-Id: I3b49254b9bdaee1e10e82cc2cff0c4cbf52f74fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137363 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-19adjust internal/external index for signal_toggledCaolán McNamara
g-lo-CellIndex is the internal view, adjust that for signal_toggled Conflicts: vcl/unx/gtk3/gtk3gtkinst.cxx Change-Id: I9ad0cf2e63c2bb03463650a84a9145cf3760ae4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95621 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit db9a737c6bec181a259d6bdba2a70b8342b7bdd6)
2022-08-19document the mapping to CellRenderersCaolán McNamara
and clarify that g-lo-CellIndex is the index from the external pov Change-Id: Id747acaeabab50755188732637a72c1fce8a97dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95519 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 36f57d5aebe448701ffe3bbc529f29d2112dec94)
2022-08-19clarify and simplify the mapping of the sort column to modelCaolán McNamara
Change-Id: I3361b0c35965133747c502c5bd81359915507ebd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95518 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit c11350e44e39eec2d992836200b90be5c9ab35eb)
2022-08-19make [g|s]et_sort_indicator column argument requiredCaolán McNamara
which all users already do, and drop unused auto-pick of default text column if not set Change-Id: Ibf8d8fb8295ebd10d89b2096b85dd08314aff3f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95503 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 43c7f1944b47ca06234f1b37a24fe0f9ec659111)
2022-08-19weld WatchWindow panel [only set_column_editables]Caolán McNamara
Change-Id: Idb43d7bd168ce37fce8694946be6c7de7ca5a2c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88930 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 4e07b178f58b1dabbb48bc9f26155b8270a4a72d)
2022-08-19[CIBO] Use new branding internally in file associations as wellGabor Kelemen
ispired by commit e32e0124f8da122af300210e637362832298ba96 Change-Id: Iad03dc9ab40c655853bec64598a8df8202eef118
2022-06-21Fix crash when no valid EntryDescriptor foundSamuel Mehrbrodt
When opening macro run dlg, the last selected entry is displayed again. When no entry was found, a crash occured in some situations (GetLastEntryDescriptor() returned garbage). Initialize m_aLastEntryDesc properly, and make sure the method returns when no last selected macro was found. Also fix some nullptr crashes which occurred during UITests Backport note: Part of this was already backported in 8abd6a27f0d80730596a20e8d234df9dec530571 Change-Id: I7bd1a0b8824725f9935876ae26d8222410a3bc25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136140 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2022-06-16Revert "vcl: add some WinSalGraphics debug logging"Samuel Mehrbrodt
This reverts commit 89612b363f3f11248beea6fa98071c80e8ea7a9c.
2022-06-15Make sure pEntry is not nullSamuel Mehrbrodt
Crash seen: > mergedlo.dll!SvTreeList::GetDepth(const SvTreeListEntry * pEntry) line 106 mergedlo.dll!SalInstanceTreeView::get_iter_depth(const weld::TreeIter & rIter) line 4230 basctllo.dll!basctl::SbTreeListBox::FindVariable(const weld::TreeIter * pEntry) line 271 basctllo.dll!basctl::SbTreeListBox::FindModule(const weld::TreeIter * pEntry) line 695 basctllo.dll!basctl::MacroChooser::BasicSelectHdl(weld::TreeView & __formal) line 473 basctllo.dll!basctl::MacroChooser::RestoreMacroDescription() line 158 basctllo.dll!basctl::MacroChooser::run() line 178 Change-Id: Ic85758c0bbee952d0a23b1d52e8bbdd231e8de26
2022-06-07Silence MSVC warning C4189 "local variable is initialized but not referenced"Stephan Bergmann
Change-Id: I346cf6cf148cd3b4ac851f8c441d54c858f55935 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107674 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 4376820074abc4d70765675ef5a4adae8f58effe) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135315 Tested-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2022-06-07Silence warning C4189: local variable is initialized but not referencedStephan Bergmann
Change-Id: Ie36d7c4dfee5115b5909ed58a0b16b367e05866d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107734 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 14372e301f0198067e4965ac1a234d9f9d21e3b2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135314 Tested-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2022-06-07Reuse pInstStephan Bergmann
Change-Id: I91e5a469344ab951225e61237b462ed58ed796be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107733 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit c8f61430b5760c7baabebff9c3159092975d4a88) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135313 Tested-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2022-05-31vcl: add some WinSalGraphics debug loggingMichael Stahl
Change-Id: I70f96bef0db4d40b70e08426779435f75b0241fa
2022-05-23vcl: avoid accessing null member on unloading viewsAshod Nakashian
Change-Id: If4e416c7257c861b9e13352b3329d9719b159e61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87830 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Aron Budea <aron.budea@collabora.com> (cherry picked from commit 9ec3d637c1c99c729da67eafc375efce1cc7f026)
2022-05-23vcl: don't use null window in FloatingWindow HitTestAshod Nakashian
Change-Id: I551f31cf30c7a58642becebe0256684055d0703a Reviewed-on: https://gerrit.libreoffice.org/85383 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com> (cherry picked from commit 65685bac09a4320602f4dda5151d247c5a83a75c)
2022-05-23Avoid crash on closing docking windowSzymon Kłos
Change-Id: I9f5ac4fae9e37e3eece8ad8bd2d6505514517d9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107215 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2022-05-23vcl: avoid native widget pieces for disposed BorderWindow.Michael Meeks
Fixes crash around help windows: vcl::Window::IsCompoundControl() const vcl/source/window/window2.cxx:1200 vcl::Window::Show(bool, ShowFlags) vcl/source/window/window.cxx:2243 (discriminator 3) vcl::Window::Show(bool, ShowFlags) vcl/source/window/window.cxx:2298 HelpTextWindow::ImplShow() vcl/source/app/help.cxx:371 Scheduler::ProcessTaskScheduling() vcl/source/app/scheduler.cxx:495 Change-Id: Ia0205813f3e9d306314577d59d6cdd1bdfa0ee71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119881 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-23Check mpWindowImpl before use in Window::EndTrackingSzymon Kłos
Change-Id: I0a4ddd1b61f5919f346bb2f3a1e2ca9fbad958bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120860 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2022-05-23Crash around help-windows.Michael Meeks
Seems a popular way to crash: vcl::Window::ImplCallMove() vcl/source/window/event.cxx:555 vcl::Window::Show(bool, ShowFlags) [clone .localalias] /usr/include/c++/10/bits/unique_ptr.h:173 vcl::Window::Show(bool, ShowFlags) vcl/source/window/window.cxx:2345 HelpTextWindow::ImplShow() vcl/source/app/help.cxx:371 Scheduler::ProcessTaskScheduling() vcl/source/app/scheduler.cxx:495 Change-Id: I33ca0059844395c41f4d76619cca22aec81df207 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125702 Tested-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2022-05-23tdf#138901 Refresh button tooltip in sidebar created by extensionIlhan Yesil
The button's tooltip is refreshed after setting the button's text. Change-Id: I08f272c43c3312d462981d46ab961ef925eeccbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107718 Tested-by: Jenkins Reviewed-by: Ilhan Yesil <ilhanyesil@gmx.de> (cherry picked from commit f1d9648b5196eacac080a2a4db42c06829554107) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114292 Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-05-23WIN add bootstrap var to re-enable foreground hackJan-Marek Glogowski
We already found a regressed installation from commit 518c0265efebf39ab6d1e90c4ec4e7cf52b701c6 ("WIN prevent deadlock in SetForegroundWindow"). Finding a real fix might be impossible, so this just adds the bootstrap.ini boolean variable Win32.EnableAttachThreadInputHack to re-enable the previous AttachThreadInput hack on demand. Change-Id: I3b6d770b060b5dee60e02a5aa85efb8a51518c82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90235 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2022-05-18tdf#144952 VCL fix the Printer graphics releasecib-6.4-8Jan-Marek Glogowski
Regression from commit 1b7c53db87bb67eeb2591fbb186f7ac20eb00c68 ("WIN lazy init WinSalInfoPrinter graphics"), which removed the // HACK to fix an urgent P1 printing issue fast SalPrinter::StartPage returns a SalGraphics to the VCL Printer object. On Windows SalPrinter::EndPage deletes the SalPrinter's SalGraphics. MacOS keeps a single SalGraphics for the whole SalPrinter lifetime. PspSalPrinter stores it in a unique_ptr and always resets it in StartPage. But in any case the VCL Printer's SalGraphics reference must be freed before calling a function, which might delete it. Change-Id: Ice528b2bbc89eaadff576420bf210ea4ec1e58d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123199 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit 354706e3f5c05294af6e0000d5b9f814cfe01741)
2022-05-18tdf#144754 WIN de-assert ReleaseFonts / setFontJan-Marek Glogowski
DeInitGraphics might already have reset the default HDC font, while the WinSalGraphics still has a font fallback stack. Not sure why this didn't trigger the existing assert before. Quite probably there was an existing lifecycle bug. Regression from commit 42f9d4335bfa4b7299224801fd7ccdd97ae92fbf ("WIN always (de-)init WinSalGraphics") Change-Id: Ie5826e632310a0d69e8f9617cf6f3629bc31f152 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122726 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit 3476106890ea2a00e6f949c918f6c05e17c66a36) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134516 Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-05-18WIN lazy init WinSalInfoPrinter graphicsJan-Marek Glogowski
... and while at it make stuff private and add _ to the newly private member variables. The new assert revealed a bug in the SalGraphics refcounting, because the virtual ReleaseGraphics is called from the destructor, which was probably also the reason for the HACK and comment in Printer::ImplReleaseFonts. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122371 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit 1b7c53db87bb67eeb2591fbb186f7ac20eb00c68) Conflicts: vcl/win/gdi/salprn.cxx Change-Id: I7af0bda19be6810dd8c0ea5b74604381e2047407 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134515 Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-05-18WIN always (de-)init WinSalGraphicsJan-Marek Glogowski
Originally I thought the whole (de-)initialization was some kind of lazy SalGraphics init stuff. But reading the existing code proved me wrong and every InitGraphics came a few lines after a setHDC call and DeInitGraphics before deletion or setHDC(nullptr). $ git grep -n "delete.*pGraph\|setHDC\|InitGraphics" vcl/win/ So just make (De-)Init part of setHDC and drop all the other calls to (De-)InitGraphics, adding a setHDC(nullptr) to the destructor. I've also added some questionable asserts, like assert(pPrinter->mpGraphics->getHDC() == pPrinter->mhDC); As I read the code, you can have a printer object initialized with a DC but without graphics, which will be initialized on demand. But AFAIK it's invalid to have a printer DC != graphics DC. Then there was the hDC check in WinSalPrinter::EndPage, which is IMHO not needed. AFAIK there is no way the graphics DC might be "magically" invalidated, so restoring the old DC values should always work. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122157 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit 42f9d4335bfa4b7299224801fd7ccdd97ae92fbf) Conflicts: vcl/inc/win/salgdi.h vcl/win/gdi/salprn.cxx Change-Id: I1b961cfa733263ce773575a728bcce5c7d3e97ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134514 Tested-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-05-09ofz#46905 Null-dereferenceCaolán McNamara
Change-Id: I26427ee1e010ce79e40c550459d9f53598570a7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133291 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 5f1d341779b9a773e3147542f6b80d4b3547bb43)
2022-05-09forcepoint#85 Conditional jump or move depends on uninitialised valueCaolán McNamara
==398461== by 0xCDC7960: (anonymous namespace)::CopyUntil(char16_t*&, char16_t const*&, char16_t, bool) (strhelper.cxx:88) ==398461== by 0xCDC839F: psp::WhitespaceToSpace(rtl::OUString const&, bool) (strhelper.cxx:294) ==398461== by 0xCB54980: vcl::PDFWriterImpl::setOutlineItemText(int, rtl::OUString const&) (pdfwriter_impl.cxx:9875) ==398461== by 0xCB547FF: vcl::PDFWriterImpl::createOutlineItem(int, rtl::OUString const&, int) (pdfwriter_impl.cxx:9851) ==398461== by 0xCAF39B0: vcl::PDFWriter::CreateOutlineItem(int, rtl::OUString const&, int) (pdfwriter.cxx:383) ==398461== by 0xCABD7C8: vcl::GlobalSyncData::PlayGlobalActions(vcl::PDFWriter&) (pdfextoutdevdata.cxx:250) ==398461== by 0xCAC0628: vcl::PDFExtOutDevData::PlayGlobalActions(vcl::PDFWriter&) (pdfextoutdevdata.cxx:616) ==398461== by 0x3D06EA0F: PDFExport::Export(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (pdfexport.cxx:1004) Change-Id: I6bc086997851ee06531a4a9ae263e2b26edfba84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132036 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit 9d5703aa0b7d11db3568a2e0aaa462fe2dd98867)
2022-03-11ofz: Too many hatch pointsCaolán McNamara
Change-Id: I08cb9d09a9bb48ab31763f50bc2fa23cf723330f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131014 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit bee0950a4c5bd996a8df0185b03c0f98e7a3de9c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131370 Tested-by: Michael Stahl <michael.stahl@allotropia.de>
2022-03-11clamp and add some logging like SvmReaderCaolán McNamara
LIBREOFFICE-OWMTGGWJ Change-Id: I8f744e1ab2684a0f0995abcc3e753a684a3b970a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130982 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 19add15932e579c931480eed42eeea52d0551897) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131369 Tested-by: Michael Stahl <michael.stahl@allotropia.de>
2022-03-04ofz: glyph data must be at least 10 bytes long to be usefulCaolán McNamara
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130767 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins (cherry picked from commit b228045cf3fb50128fd40a8f26376443ad22f874) Change-Id: I312c33c598013feced15c6f2dbcc66e493b703e6
2022-03-04ofz: measure maximum possible contoursCaolán McNamara
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130774 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 26abdb564dad2011a298fc1253279232cb8b59cf) Change-Id: Ie039abd835fef06514edde12b99e17360f5481a5
2022-03-04lastPoint might be 0xFFFFCaolán McNamara
LIBREOFFICE-KYYAZMB9 Change-Id: Ic0d95bd39a01dc1e5e0fec83dcc2c40b3f23b747 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130462 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit 21ea1eacd214dbaac8d0ce7f437580d535871415)
2022-03-04ofz#45081 check font lengthCaolán McNamara
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130635 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 568753f4d867c4681b762b63f9b1254f56865da4) Change-Id: Ib8cea70652ae90403db3546c07d24a517b1ec93e
2021-11-17crashtesting: crash on reexport of tdf118346-1.odg to odgCaolán McNamara
make a copy of m_pImpGraphicList because if we swap out a svg, the svg filter may create more temp Graphics which are auto-added to m_pImpGraphicList invalidating a loop over m_pImpGraphicList #0 0x00007ffff0d25ae5 in vcl::graphic::Manager::reduceGraphicMemory() (this=0x7ffff1bc4760 <vcl::graphic::Manager::get()::gStaticManager>) at vcl/source/graphic/Manager.cxx:88 #1 0x00007ffff0d25ee9 in vcl::graphic::Manager::registerGraphic(std::shared_ptr<ImpGraphic> const&, rtl::OUString const&) (this=0x7ffff1bc4760 <vcl::graphic::Manager::get()::gStaticManager>, pImpGraphic=std::shared_ptr<ImpGraphic> (use count 1, weak count 0) = {...}) at vcl/source/graphic/Manager.cxx:139 #2 0x00007ffff0d26406 in vcl::graphic::Manager::newInstance() (this=0x7ffff1bc4760 <vcl::graphic::Manager::get()::gStaticManager>) at vcl/source/graphic/Manager.cxx:184 #3 0x00007ffff0b6735c in Graphic::Graphic() (this=0x7fffffff84f0) at vcl/source/gdi/graph.cxx:182 #4 0x00007fffdc526600 in svgio::svgreader::SvgImageNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer&, bool) const (this=0x555556817940, rTarget=...) at svgio/source/svgreader/svgimagenode.cxx:219 #5 0x00007fffdc52e75d in svgio::svgreader::SvgNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer&, bool) const (this=0x55555a6a93d0, rTarget=..., bReferenced=false) at svgio/source/svgreader/svgnode.cxx:529 #6 0x00007fffdc522339 in svgio::svgreader::SvgGNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer&, bool) const (this=0x55555a6a93d0, rTarget=..., bReferenced=false) at svgio/source/svgreader/svggnode.cxx:106 #7 0x00007fffdc52e75d in svgio::svgreader::SvgNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer&, bool) const (this=0x55555a6a9070, rTarget=..., bReferenced=false) at svgio/source/svgreader/svgnode.cxx:529 #8 0x00007fffdc522339 in svgio::svgreader::SvgGNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer&, bool) const (this=0x55555a6a9070, rTarget=..., bReferenced=false) at svgio/source/svgreader/svggnode.cxx:106 #9 0x00007fffdc52e75d in svgio::svgreader::SvgNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer&, bool) const (this=0x55555a5f9150, rTarget=..., bReferenced=false) at svgio/source/svgreader/svgnode.cxx:529 #10 0x00007fffdc54d19f in svgio::svgreader::SvgSvgNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer&, bool) const (this=0x55555a5f9150, rTarget=..., bReferenced=false) at svgio/source/svgreader/svgsvgnode.cxx:304 #11 0x00007fffdc571373 in svgio::svgreader::(anonymous namespace)::XSvgParser::getDecomposition(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) (this=0x55555a69c6d0, xSVGStream=uno::Reference to (comphelper::SequenceInputStream *) 0x555557480668, aAbsolutePath="") at svgio/source/svguno/xsvgparser.cxx:160 #12 0x00007ffff0cf849b in VectorGraphicData::ensureSequenceAndRange() (this=0x555556ea7540) at vcl/source/gdi/vectorgraphicdata.cxx:196 #13 0x00007ffff0cf9124 in VectorGraphicData::getRange() const (this=0x555556ea7540) at vcl/source/gdi/vectorgraphicdata.cxx:323 #14 0x00007ffff0b74da7 in ImpGraphic::ImplGetPrefSize() const (this=0x5555588b00f0) at vcl/source/gdi/impgraph.cxx:778 #15 0x00007ffff0b76623 in ImpGraphic::ImplWriteEmbedded(SvStream&) (this=0x5555588b00f0, rOStm=...) at vcl/source/gdi/impgraph.cxx:1235 #16 0x00007ffff0b770a1 in ImpGraphic::ImplSwapOut(SvStream*) (this=0x5555588b00f0, xOStm=0x55555826b7d0) at vcl/source/gdi/impgraph.cxx:1377 #17 0x00007ffff0b76bdb in ImpGraphic::ImplSwapOut() (this=0x5555588b00f0) at vcl/source/gdi/impgraph.cxx:1328 #18 0x00007ffff0d25c88 in vcl::graphic::Manager::reduceGraphicMemory() (this=0x7ffff1bc4760 <vcl::graphic::Manager::get()::gStaticManager>) at vcl/source/graphic/Manager.cxx:107 #19 0x00007ffff0d25ee9 in vcl::graphic::Manager::registerGraphic(std::shared_ptr<ImpGraphic> const&, rtl::OUString const&) (this=0x7ffff1bc4760 <vcl::graphic::Manager::get()::gStaticManager>, pImpGraphic=std::shared_ptr<ImpGraphic> (use count 1, weak count 0) = {...}) at vcl/source/graphic/Manager.cxx:139 #20 0x00007ffff0d26406 in vcl::graphic::Manager::newInstance() (this=0x7ffff1bc4760 <vcl::graphic::Manager::get()::gStaticManager>) at vcl/source/graphic/Manager.cxx:184 #21 0x00007ffff0b6735c in Graphic::Graphic() (this=0x555556d5ea68) at vcl/source/gdi/graph.cxx:182 Change-Id: I4e1ffcb12ead0d53b7ca2f369154e9c753af77d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91650 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 6fa2891da4852716fe62d925ffdbeeb380a2ed66)