summaryrefslogtreecommitdiff
path: root/vcl/source
AgeCommit message (Collapse)Author
2024-10-13vcl: add font effects to mtf dumpThorsten Behrens
Change-Id: Ieb9a5b2e09e5d1d3c7c481b4eeb42e15fa2996d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174871 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-10-12tdf#130857 VclBuilder: Move internal child visible logic to baseMichael Weghorn
Move the special handling for internal children in .ui files from VclBuilder to the base class and set the "visible" property to true for them, instead of directly calling vcl::Window::Show. This allows to have this special logic that internal children are visible by default, even if the "visible" property is not explicitly set in one place, and thus reuse it for QtBuilder as well. Change-Id: Ic7a932556e02f47ee6007b5167f82bef152e1ef0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174833 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-10-12tdf#130857 VclBuilder: Make extractVisible a static helperMichael Weghorn
... in the base class BuilderBase, in order to reuse it in QtBuilder in an upcoming commit. Change-Id: I61e73f98be9e4f0e0fd15f92d6d16c4e6e617c0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174832 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-10-09vcl: Use fabs() for double argumentRico Tzschichholz
Change-Id: I959786e42dc576cb72411bacccf1b9bd32fbe21d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173626 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-10-08PDFDocument::ReadWithPossibleFixup: clear before reading fixupJustin Luth
Ensure that a read of the pdfdocument does not use info from failed previous reads. The result in the problematic documents was that GetCatalog failed because it was looking for an m_aTrailerOffset[0] from the failed read, and thus only empty pages were exported. I failed to create a clean-room document, and the single existing unit test that needs a fixup has the trailer at the same GetPosition, which replaced the m_aTrailerOffset instead of creating a second entry. Change-Id: I470b922323a2b2ebb6d4bbaa58c98f5cc492b750 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174652 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2024-10-08avoid PDF export crash when ReadWithPossibleFixup falls back to PdfiumJustin Luth
Unfortunately, I failed to create a clean-room example, even when I pasted some binary garbage at the end of the file. Somehow I was getting a sanitized version from getAsStream. In any case, this prevents crashing with the two examples I have, although there are still significant problems somewhere because the export just results in empty pages... The problem is that reading again with the Pdfium-fixed version gets mixed in with the original read results, and things get pretty garbled. Probably m_rElements and everything needs to be cleared before tokenizing the fixup-version. Change-Id: I01daefa23b8f92e2849d71bca269ba2b476199da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174648 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-10-07vcl: use correct var prefixes in BitmapScaleConvolutionFilterChris Sherlock
Change-Id: Idca191a21ef63a707d9c5230dad8c97552757c06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173206 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-06cid#1608598 silence Overflowed constantCaolán McNamara
and cid#1607946 Overflowed constant cid#1608526 Overflowed integer argument cid#1608611 Overflowed integer argument Change-Id: Iec21df2f3d7dc8fba3872c6a70466ae12026a49d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174557 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-10-05cid#1607727 silence Overflowed constantCaolán McNamara
Change-Id: I0bbd29231158379c9c7986033ce052b7f149ddc6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174536 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-10-05cid#1620556: UNINIT_CTOR in textviewJulien Nabet
Change-Id: I0e13c8c189211a97161c1eef5a0ad12e48817564 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174533 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2024-10-05tdf#130857 VclBuilder: Extract setMnemonicWidget helper + call from baseMichael Weghorn
Instead of iterating over the map of mnemonic widgets in the VclBuilder ctor, split the logic: Add a new purely virtual WidgetBuilder::setMnemonicWidget method to the base class that passes the IDs of a single pair of label + the corresponding mnemonic widget as params, and let WidgetBuilder::processUIFile call the method once for every pair in the map. Implement that for VclBuilder (by moving the remaining logic for that previously in the ctor) to the new override VclBuilder::setMnemonicWidget and add a dummy implementation for QtBuilder that only triggers a warning for now. Change-Id: I32c922f91e5e1d06c003e6d26a4342cbb98942e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174509 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-05tdf#130857 VclBuilder: Move mnemonic-widget bookkeeping to base classMichael Weghorn
Move the `m_aMnemonicWidgetMaps` member and related struct and typedef from VclBuilder's `m_pVclParserState` to the base class BuilderBase's `m_pParserState` and also move the VclBuilder::extractMnemonicWidget method to the base class, so the logic can later be reused by QtBuilder. Add a new getter BuilderBase::getMnemonicWidgetMaps to get access and use that in VclBuilder instead. At least for now, VclBuilder::extractMnemonicWidget still explicitly needs to be called by VclBuilder (and other subclasses) when encountering a "GtkLabel" object for the mnemonic widget relationship to be added to the map in the base class. Change-Id: I878eec7be5e82fac3e1b944d7fed7bf6711744ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174508 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-04vcl: Merge ImpTextView into TextViewMichael Weghorn
The only thing that ImpTextView had were the class members, and then all access to these was done from TextView using `mpImpl->`. Move the class members from ImpTextView directly into TextView and drop ImpTextView. Change-Id: I9fd6ebbdc497b87e2440d3d6a810b7c24488430b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174461 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-10-04tdf#163225 vcl: Erase listbox bg when redrawing on mouse moveMichael Weghorn
Somehow, moving the listbox invalidation code from ImplWin::PreNotify to ListBox::PreNotify in commit fd7cb42f7d17d03e4fac6d8c5f1d6c7c49a36fc6 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Tue Feb 14 16:16:30 2023 +0100 tdf#153520 vcl: Align listbox invalidation with mouseover check triggered rendering artifacts for the tdf#163225 listbox example. It seems that the previous rendering operation apparently seems a pixel or so off from the current one and as the InvalidateFlags::NoErase flag gets passed, what was drawn previously is not erased. Don't pass that flag any more to ensure that the background is properly erased, which fixes the rendering artifacts. The flag's docmentation says: /** The invalidated area is painted with the background color/pattern. */ NoErase = 0x0004, Dropping the flag doesn't negatively affect drawing a listbox that has an explicit background color set in my tests, s. modified sample document attachment 196871 in tdf#163225 . Stop passing that flag in ListBox::StateChanged, too. Change-Id: Ibcacbed01888449db062f84b4782feb9de69851c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174438 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-10-03Revert "tdf#163213: do not show OpenType features if the font has "morx" table"Julien Nabet
Reason: regression See https://bugs.documentfoundation.org/show_bug.cgi?id=163213#c14 This reverts commit 0679a5cee16ae96c0d11e7d4fc1e59fb0f9cc591. Change-Id: Ib1392e2ad44577f69e6197bad8ae79791f072086 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174435 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2024-10-03cid#1608220 Data race conditionNoel Grandin
Change-Id: I7ff30128d663ca3524dc95ef99ef8c64dd158643 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174429 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-03cid#1606585 Data race conditionNoel Grandin
and cid#1606993 Data race condition Change-Id: I291829f0b59fc228ad3f305f280f7f58aae0d40b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174428 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-10-03tdf#163047 sc: fix more pages on a single sheet printing functionTibor Nagy
issue caused by commit I5e494a0714e398221bee00744d7e25c419a41df7 "tdf#155218 sc: fix different page orientation in print dialog". Change-Id: I0b6f645dc77af83b132a415570e5dfca4a5abddf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174404 Reviewed-by: Nagy Tibor <tibor.nagy.extern@allotropia.de> Tested-by: Jenkins
2024-10-01tdf#160202 - Don't extend selection over two wordsAndreas Heinisch
Don't extend the selection over two separate string in the BASIC editor. Probably, the BreakIteratorImpl::nextWord needs to be corrected which could lead to unwanted side effects. Change-Id: I0e980006cca672fb63216dc860c12a7004bfd759 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173900 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de> Tested-by: Jenkins
2024-10-01loplugin:constantparamNoel Grandin
Change-Id: I81c9647ec7166ba429f6f58e3bd86b3a5ee4848f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174302 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-01loplugin:singlevalfieldsNoel Grandin
Change-Id: I8f844c40dcb48737d95a3004cd7e8c730656d955 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174299 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-10-01loplugin:unusedmethodsNoel Grandin
Change-Id: I121a0e1323df7b6669f496ad63d771df8f76b429 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174297 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-09-30tdf#163213: do not show OpenType features if the font has "morx" tableJulien Nabet
Change-Id: I589419f7ffe3db01848e711021c2efd1de07692b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174294 Reviewed-by: خالد حسني <khaled@libreoffice.org> Tested-by: Jenkins
2024-09-30cid#1608502 Overflowed constantCaolán McNamara
and cid#1607222 Overflowed constant Change-Id: If145bae8d05470173d1af6e7f540f8f40d7ab8b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174208 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins
2024-09-30vcl: flatten BitmapReadAccess functionsChris Sherlock
Change-Id: Ib18aeca38270192364a12b6496223b0cce476b16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173205 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-09-30vcl: flatten BitmapPopArtFilter::execute()Chris Sherlock
Change-Id: Icfbf2e625fb01f336c0c5eec8553b24922376680 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173204 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-09-28cid#1607692 Overflowed constantNoel Grandin
use less convoluted logic here Change-Id: I786d7f857c7104358559782247c4272914299314 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174112 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-09-28tdf#160837 SalFrame: Replace direct uses of maGeometry memberMichael Weghorn
Call `GetUnmirroredGeometry()` instead of directly using the `maGeometry` member in order to get the current SalFrameGeometry. This is in preparation of allowing to override `SalFrame::GetUnmirroredGeometry` in subclasses in an upcoming commit. No change in behavior intended (yet). Change-Id: I72b44052ba5e8ed61a1c54130ea088f1bb0b3941 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173995 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-09-27null-deref seen in testingCaolán McNamara
#2 0x0000000000ac8c3e in std::__glibcxx_assert_fail(char const*, int, char const*, char const*) () #3 0x00007fa92f2fa26f in std::unique_ptr<WindowImpl, std::default_delete<WindowImpl> >::operator* (this=<optimized out>) at /opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:443 #4 std::unique_ptr<WindowImpl, std::default_delete<WindowImpl> >::operator* (this=<optimized out>) at /opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:443 #5 vcl::Window::CallEventListeners (this=this@entry=0x34eb4f40, nEvent=nEvent@entry=VclEventId::ObjectDying, pData=pData@entry=0x0) at libreoffice/vcl/source/window/event.cxx:272 #6 0x00007fa92f38277a in vcl::Window::dispose (this=0x34eb4f40) at libreoffice/vcl/source/window/window.cxx:159 #7 0x00007fa92f678064 in VclPtr<HelpTextWindow>::disposeAndClear (this=<synthetic pointer>) at libreoffice/include/rtl/ref.hxx:88 #8 ImplDestroyHelpWindow (rHelpData=..., bUpdateHideTime=<optimized out>) at libreoffice/vcl/source/app/help.cxx:576 #9 0x00007fa92f6780f8 in ImplDestroyHelpWindow (bUpdateHideTime=<optimized out>) at libreoffice/vcl/source/app/help.cxx:565 #10 0x00007fa92f679125 in ImplShowHelpWindow (pParent=0x334cfb90, nHelpWinStyle=<optimized out>, nStyle=QuickHelpFlags::NONE, rHelpText="Chart Area", rScreenPos=Point = {...}, rHelpArea=...) at libreoffice/vcl/source/app/help.cxx:532 #11 0x00007fa92f679544 in Help::ShowQuickHelp (pParent=pParent@entry=0x334cfb90, rScreenRect=..., rHelpText="Chart Area", nStyle=nStyle@entry=QuickHelpFlags::NONE) at libreoffice/vcl/source/app/help.cxx:189 #12 0x00007fa91ae862e0 in chart::ChartWindow::RequestHelp (this=0x334cfb90, rHEvt=...) at libreoffice/chart2/source/controller/main/ChartWindow.cxx:227 #13 0x00007fa92e2e88a0 in (anonymous namespace)::LOKPostAsyncEvent (pEv=0x35b4a320) at libreoffice/sfx2/source/view/lokhelper.cxx:1103 #14 0x00007fa92e2e076a in LokChartHelper::postMouseEvent (this=this@entry=0x7ffd226dd650, nType=nType@entry=2, nX=nX@entry=15405, nY=nY@entry=4089, nCount=nCount@entry=1, nButtons=nButtons@entry=0, nModifier=0, fScaleX=fScaleX@entry=0.10000000000000001, fScaleY=fScaleY@entry=0.10000000000000001) at libreoffice/sfx2/source/view/lokcharthelper.cxx:294 #15 0x00007fa92e2e5b80 in SfxLokHelper::testInPlaceComponentMouseEventHit (pViewShell=pViewShell@entry=0x337e52a0, nType=nType@entry=2, nX=nX@entry=15405, nY=nY@entry=4089, nCount=nCount@entry=1, nButtons=nButtons@entry=0, nModifier=0, fScaleX=0.10000000000000001, fScaleY=0.10000000000000001, bNegativeX=false) at libreoffice/include/rtl/ref.hxx:69 #16 0x00007fa91dba1e0e in ScModelObj::postMouseEvent (this=0x4593d10, nType=2, nX=15405, nY=4089, nCount=1, nButtons=0, nModifier=0) at libreoffice/sc/source/ui/unoobj/docuno.cxx:799 #17 0x00007fa92e39567f in doc_postMouseEvent (pThis=0x334b8290, nType=2, nX=15405, nY=4089, nCount=1, nButtons=0, nModifier=0) at libreoffice/desktop/source/lib/init.cxx:5597 #18 0x0000000000578631 in lok::Document::postMouseEvent (nModifier=0, nButtons=0, nCount=1, nY=<optimized out>, nX=<optimized out>, nType=<optimized out>, this=<optimized out>) at libreoffice/include/LibreOfficeKit/LibreOfficeKit.hxx:297 #19 ChildSession::mouseEvent (this=this@entry=0x317e3cf0, tokens=..., target=target@entry=LokEventTargetEnum::Document) at kit/ChildSession.cpp:1906 #20 0x0000000000588485 in ChildSession::_handleInput (this=<optimized out>, buffer=<optimized out>, length=<optimized out>) at kit/ChildSession.cpp:634 Change-Id: Ic67c8b7c4553853d0ab36dd448642564b6b6fb69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173922 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-09-27vcl: flatten BitmapMosaicFilter::execute()Chris Sherlock
Change-Id: I9e56c285cffe14374a66204ef8126a20f0e7c07c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173203 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-09-26tdf#163105 Use HB data while selecting kashida insertion positionsJonathan Clark
Previously, Writer and Edit Engine would skip inserting kashida in words if the highest-priority candidate position is marked as invalid by HarfBuzz. This would happen even if the word contained multiple lower-ranked valid candidate positions. This change updates Writer and Edit Engine to pass HarfBuzz kashida position data to the selection algorithm. The algorithm has been updated to return the highest-priority valid position, if any. The algorithm has also been updated to use raw positions marked as valid by HarfBuzz as a fallback, if no better positions could be found. Change-Id: I40c6432c4607aee197e8767e5667db504469956a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173963 Tested-by: Jenkins Reviewed-by: Jonathan Clark <jonathan@libreoffice.org>
2024-09-26Related tdf#146906 - Remove hard-coded access to split windowHeiko Tietze
* Calc users can customize .uno:SplitWindow * Help modification in I00f75b4481a5795674a3a18eea7ca8701dc542fc Change-Id: I9d3692640d7bfb6283445cf7f103986cf72581af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173122 Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Jenkins
2024-09-26Fix build: move CrashReporter code to vcl/source/window/builder.cxxMike Kaganski
This problem appeared after commit 1a1bf2b78d689a570cc71b7bcb3e0100947a2fb1 (tdf#130857 VclBuilder: Extract helper to start parsing UI file, 2024-09-26): [LNK] Library/libvclplug_qt5lo.so /home/mk/core/include/vcl/widgetbuilder.hxx:55: error: undefined reference to 'CrashReporter::addKeyValue(rtl::OUString const&, rtl::OUString const&, CrashReporter::tAddKeyHandling)' collect2: error: ld returned 1 exit status make[1]: *** [/home/mk/core/vcl/Library_vclplug_qt5.mk:20: /home/mk/build/instdir/program/libvclplug_qt5lo.so] Error 1 Change-Id: I212aa3cbc381770de8fec07ea6454ab209edefc6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173977 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-09-26vcl: move variables closer to first use in BitmapFilterStackBlur functionsChris Sherlock
Change-Id: I7ce550928cf3aadf55006d43dc6aff6d109ec826 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173202 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-09-26vcl: flatten functions in BitmapEx.cxxChris Sherlock
Change-Id: I62a876ae2d517e47efc0d8abccaece3f6059b4fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173200 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-09-26cid#1607525 silence Overflowed constantCaolán McNamara
and cid#1607982 Overflowed constant Change-Id: Ib7be7f8e17deb6184e25e543eab68dd704673eba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173968 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-09-26tdf#160837 vcl: Use getter to get frame geometryMichael Weghorn
Instead of directly accessing the (currently still public) class member SalFrame::maGeometry, use the getter that returns a const reference to it. Change-Id: Iac7dd70b82160acba06d8016d94a1ac4380e779e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173955 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-09-26tdf#160837 vcl: Use existing SalFrame::GetWidthMichael Weghorn
Call `SalFrame::GetWidth` instead of directly accessing `SalFrame::maGeometry` and calling its `width()` method to simplify and abstract a bit from the implementation details in the callers. Change-Id: I06f960c4984e57a728c301e10fc62a28a8af6199 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173954 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-09-25fix Printer::EmulateDrawTransparentNoel Grandin
after commit 9153a36b59f2efc2bfb2c9256c39eb5687808deb Author: Chris Sherlock <chris.sherlock79@gmail.com> Date: Fri Mar 28 23:30:02 2014 +1100 fdo#74702 Refactor OutputDevice::DrawTransparent() where it looks like a copy/paste error resulted in the metafile and mpAlphaVDev being restored too early. Change-Id: Ib2989927166bc2da7c8da6274f295a73218386fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173935 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-09-25tdf#130857: Move .ui -> VCL respone code mapping to handleActionWidgetMichael Weghorn
Move mapping the (GTK) response code set in the .ui file to the VCL equivalent from VclBuilder::set_response to BuilderBase::handleActionWidget. As VCL response codes are used by all implementations, this is not specific to the vcl::Window implementation and also allows an upcoming QtBuilder::set_response_code implementation to use the passed value as is. Change-Id: I5b6d262a657932038c423c0c2cdcf1fd32c8b6be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173930 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-09-25tdf#130857 VclBuilder: Use existing VclBuilder::getMichael Weghorn
... instead of reimplementing the logic in VclBuilder::set_response. Change-Id: I634d918a356caddc79419b94dda7bd0657fa8c20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173929 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-09-25tdf#130857 Use std::u16string_view for VclBuilder::get paramMichael Weghorn
This prepares for reusing the method elsewhere in `VclBuilder`. Only the `SAL_WARN_IF` (a no-op in release builds without `--enable-sal-log`) previously needed a `OUString`. Call `OUStringToOString` for that one explicitly, which is what previously happened implicitly by template< typename charT, typename traits > inline std::basic_ostream<charT, traits> & operator <<( std::basic_ostream<charT, traits> & stream, OUString const & rString) defined in include/rtl/ustring.hxx. Change-Id: I57ebac8c2189afeca33bfa483b8d5d5c7866d904 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173928 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-09-25tdf#130857 Consolidate to one VclBuilder::get methodMichael Weghorn
Convert the single caller of the other variant to use the same as all other places, and drop the now unused method. Change-Id: Icde971b50f39cb8c8f32d1a6ddf4d0cc84f90440 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173927 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-09-25tdf#130857 VclBuilder: Extract helper to start parsing UI fileMichael Weghorn
Extract logic to start parsing/processing the VclBuilder's .ui file from the VclBuilder ctor to a new helper method in the base class, WidgetBuilder::processUIFile. This will allow to reuse it in the upcoming QtBuilder. Change-Id: Ia7d31563e5aeef0786b0db34abb1a32a3a479947 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173902 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-09-25tdf#130857 VclBuilder: Pass UI dir/root to BuilderBaseMichael Weghorn
Pass the UI file root down to `BuilderBase`, and add a new getter `BuilderBase::getUIFileUrl` to get the URL composed of the UI dir and the UI file passed to the ctor. This is in preparation of moving the `XmlReader` creation out of the `VclBuilder` ctor, so the code can be reused by the upcoming `QtBuilder`. Change the UI directory param from `const OUString&` to `std::u16_string_view` as suggested by the clang plugin. Change-Id: I3f7719e30e55bae3c774da704e642e4227165a76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173827 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-09-25tdf#130857 Move VclBuilder::handleObject to WidgetBuilder baseMichael Weghorn
Move `VclBuilder::handleObject` to the template base class `WidgetBuilder` introduced in previous commit Change-Id: I2d81cc6dd54d796b549357a4444b95627661c623 Author: OmkarAcharekar <omkaracharekar12@gmail.com> Date: Fri Sep 20 13:33:01 2024 +0200 tdf#130857 refactor VclBuilder: Extract template base class Add new virtual methods to that base class to override in the subclasses. These are currently the ones that `VclBuilder` already implements for `vcl::Window`. More refactoring - in particular for those methods that currently still do XML parsing themselves is planned for the future once the relevant functionality will be implemented in other subclasses. For now, those methods that do XML parsing themseslves trigger an assert in the base class implementation and remain unchanged in the `VclBuilder` implementation. One aspect to be aware of is that `WidgetPtr` should explicitly be initialized to `nullptr` if not assigned a different value: While `VclPtr` that gets used for `VclBuilder` has a default ctor that takes care of proper initialization, that's not the case for the upcoming `QtBuilder` [1] that just uses `QObject*` for `WidgetPtr`. [1] https://gerrit.libreoffice.org/c/core/+/161831 Change-Id: I5c1b7201c82ca2c0c2d7389642aee407ebea16ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173737 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2024-09-25tdf#130857 refactor VclBuilder: Extract template base classOmkarAcharekar
Refactor `VclBuilder` by extracting the `handleChild` method and moving it into a new template base class `WidgetBuilder`, so both `VclBuilder` and an upcoming `QtBuilder` (see [1]) can share the common logic to parse the .ui file and override the virtual methods like `applyPackingProperties`, `tweakInsertedChild` etc. to handle toolkit specific cases, as mentioned as one potential approach in Caolán's email [2]. The new class has 2 template parameters `Widget` and `WidgetPtr` to account for the fact that `VclBuilder` doesn't just use `vcl::Window*`, but there's a specific class, `VclPtr`. As the inline comments say, more refactoring will be needed to abstract the current `VclBuilder` implementations of various methods from the `vcl::Window` specifics and make them reusable for other subclasses as well, but this commit is a start. The idea is to allow for incrementally refactoring aspects relevant for specific .ui files/features rather than having to refactor everything and implement support for all widget types at once, see also commit 9b3a2996e710fee11145dcbbe38a6f1e6f646ec8 Author: OmkarAcharekar <omkaracharekar12@gmail.com> Date: Wed Sep 18 09:35:09 2024 +0200 tdf#130857 qt weld: Add QtInstanceBuilder skeleton which adds an initially empty list of .ui files that should be handled by the upcoming Qt-based implementation. [1] https://gerrit.libreoffice.org/c/core/+/161831 [2] https://lists.freedesktop.org/archives/libreoffice/2023-December/091288.html Co-authored-by: Michael Weghorn <m.weghorn@posteo.de> Change-Id: I2d81cc6dd54d796b549357a4444b95627661c623 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163103 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-09-23vcl: mask scale regression in BitmapFastScaleFilterChris Sherlock
Masks are not scaled in the fast scaling filter. The issue occured when migrating to the BitmapFastScaleFilter class - maSize was never set. The size is now calculated in execute() locally. Regression from: commit d246aa574571409046619254292698184c2545a3 date Sun Apr 15 10:14:10 2018 +1000 author Chris Sherlock <chris.sherlock79@gmail.com> vcl: move Bitmap::ImplScaleFast() and Bitmap::ImplScaleInterpolate() Change-Id: I9cc36f609059ae2db9c4cdb169bd5110382cfb21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173766 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-09-23vcl builder : no need to use OUString hereArnaud VERSINI
Change-Id: I82219272ae06db45968f2aecf2583c0b7196e3b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173768 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-09-22remove some dead code in DrawDeviceBitmapExNoel Grandin
ever since we added the call to DrawDeviceAlphaBitmap Change-Id: Ia329e355839ffc27c88135513898e7ea460242fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173772 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins