[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/outdev.hxx| 23 -- include/vcl/window.hxx|2 vcl/inc/textlayout.hxx| 26 ++ vcl/source/gdi/pdfwriter_impl.cxx |2 vcl/source/gdi/textlayout.cxx | 396 ++- vcl/source/outdev/text.cxx| 427 +- vcl/source/window/window3.cxx |2 7 files changed, 442 insertions(+), 436 deletions(-) New commits: commit 41e00b105f004b75451e24043dc85af703c91dd3 Author: Chris Sherlock AuthorDate: Mon Sep 25 00:24:32 2023 +1000 Commit: Tomaž Vajngerl CommitDate: Mon Oct 23 09:42:11 2023 +0200 vcl: migrate text layout functions out of OutputDevice OutputDevice is not where text layout should be done. There are a number of text layout functions that are used across the text layout classes, so I have moved them into TextLayoutHelper and made the text layout classes rely on this. I have made TextLayoutHelper implement the ITextLayout interface because this is still useful to new classes that need to implement new text layout functionality. Change-Id: Ic137a938576e7a6a64db0e5780bbbdd8342ef421 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157362 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 4a6d217c2cb6..bea1e00d9b7f 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -102,7 +102,7 @@ class SalLayoutGlyphs; namespace vcl { class ExtOutDevData; -class ITextLayout; +class TextLayoutCommon; struct FontCapabilities; class Window; class WindowOutputDevice; @@ -869,11 +869,11 @@ public: voidDrawText( const tools::Rectangle& rRect, const OUString& rStr, DrawTextFlags nStyle = DrawTextFlags::NONE, std::vector< tools::Rectangle >* pVector = nullptr, OUString* pDisplayText = nullptr, - vcl::ITextLayout* _pTextLayout = nullptr ); + vcl::TextLayoutCommon* _pTextLayout = nullptr ); static void ImplDrawText( OutputDevice& rTargetDevice, const tools::Rectangle& rRect, const OUString& rOrigStr, DrawTextFlags nStyle, - std::vector< tools::Rectangle >* pVector, OUString* pDisplayText, vcl::ITextLayout& _rLayout ); + std::vector< tools::Rectangle >* pVector, OUString* pDisplayText, vcl::TextLayoutCommon& _rLayout ); voidImplDrawText( SalLayout& ); @@ -904,7 +904,7 @@ public: tools::Rectangle GetTextRect( const tools::Rectangle& rRect, const OUString& rStr, DrawTextFlags nStyle = DrawTextFlags::WordBreak, TextRectInfo* pInfo = nullptr, - const vcl::ITextLayout* _pTextLayout = nullptr ) const; + const vcl::TextLayoutCommon* _pTextLayout = nullptr ) const; /** Return the exact bounding rectangle of rStr. @@ -1073,17 +1073,6 @@ public: protected: SAL_DLLPRIVATE void ImplInitTextLineSize(); SAL_DLLPRIVATE void ImplInitAboveTextLineSize(); -static -SAL_DLLPRIVATE tools::Long ImplGetTextLines( const tools::Rectangle& rRect, tools::Long nTextHeight, ImplMultiTextLineInfo& rLineInfo, tools::Long nWidth, const OUString& rStr, DrawTextFlags nStyle, const vcl::ITextLayout& _rLayout ); -static -SAL_DLLPRIVATE sal_Int32ImplBreakLinesWithIterator(const tools::Long nWidth, const OUString& rStr, const vcl::ITextLayout& _rLayout, -const css::uno::Reference& xHyph, -const css::uno::Reference& xBI, -const bool bHyphenate, -const sal_Int32 nPos, sal_Int32 nBreakPos); -static -SAL_DLLPRIVATE sal_Int32ImplBreakLinesSimple( const tools::Long nWidth, const OUString& rStr, -const vcl::ITextLayout& _rLayout, const sal_Int32 nPos, sal_Int32 nBreakPos, tools::Long& nLineWidth ); SAL_DLLPRIVATE floatapproximate_char_width() const; virtual bool shouldDrawWavePixelAsRect(tools::Long nLineWidth) const; @@ -1200,10 +1189,6 @@ private: SAL_DLLPRIVATE static void ImplUpdateFontDataForAllFrames( FontUpdateHandler_t pHdl, bool bNewFontLists ); -static -SAL_DLLPRIVATE OUString ImplGetEllipsisString( const OUString& rStr, - tools::Long nMaxWidth, DrawTextFlags nStyle, const vcl::ITextLayout& _rLayout ); -
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/toolkit/menubtn.hxx |2 ++ vcl/inc/managedmenubutton.hxx|3 ++- vcl/source/control/managedmenubutton.cxx |4 ++-- vcl/source/control/menubtn.cxx |4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) New commits: commit f075fa01cb4f74185f13eb0a8d7f84cf1f47af49 Author: Michael Weghorn AuthorDate: Tue Aug 22 10:26:32 2023 +0200 Commit: Michael Weghorn CommitDate: Tue Aug 22 12:48:41 2023 +0200 tdf#141101 tdf#101886 a11y: Restore previous focus on col/line popup close Don't request focus for the color window before the menu button popup opens. Doing so would prevent properly restoring focus to the menu button itself after the popup closes again. Without this change in place, the call to `MenuButton::Activate` in `MenuButton::ExecuteMenu (s. frame 14/15 in below backtrace) would already set focus to the "Automatic" button in the color window: 1 PushButton::GetFocus button.cxx 1490 0x7f4acfdc83b6 2 vcl::Window::CompatGetFocuswindow.cxx 3888 0x7f4acfd9d26d 3 vcl::Window::ImplGrabFocus mouse.cxx 384 0x7f4acfcd5215 4 vcl::Window::GrabFocus window.cxx 2979 0x7f4acfd988e9 5 SalInstanceWidget::grab_focus salvtables.cxx 390 0x7f4ad046f505 6 ColorWindow::GrabFocus tbcontrl.cxx 2127 0x7f4ad3f21af1 7 ColorListBox::ToggleHdltbcontrl.cxx 4291 0x7f4ad3f313d6 8 ColorListBox::LinkStubToggleHdltbcontrl.cxx 4285 0x7f4ad3f31369 9 Link::Calllink.hxx 111 0x7f4ad04aec71 10 weld::Toggleable::signal_toggled weld.hxx 1539 0x7f4ad04a77a3 11 SalInstanceMenuButton::ActivateHdl salvtables.cxx 3075 0x7f4ad0483086 12 SalInstanceMenuButton::LinkStubActivateHdl salvtables.cxx 3071 0x7f4ad0483043 13 Link::Call link.hxx 111 0x7f4acfe9e9c1 14 MenuButton::Activate menubtn.cxx237 0x7f4acfe9e136 15 MenuButton::ExecuteMenumenubtn.cxx61 0x7f4acfe9cca1 16 MenuButton::KeyInput menubtn.cxx226 0x7f4acfe9e092 17 ImplHandleKey winproc.cxx1211 0x7f4acfdb0962 18 ImplWindowFrameProcwinproc.cxx2724 0x7f4acfdb6fcf 19 SalFrame::CallCallback salframe.hxx 310 0x7f4ac5aa3dfa 20 QtFrame::CallCallback QtFrame.hxx229 0x7f4ac5aa5336 ... As a consequence, this "Automatic" button inside of the color window would be the UI element remembered as the the one to which focus focus should be restored when closing the popup, see the mxPrevFocusWin = Window::SaveFocus(); in `FloatingWindow::StartPopupMode`, which gets called like this: 1 FloatingWindow::StartPopupMode floatwin.cxx 824 0x7f4acfc61a61 2 ImplDockingWindowWrapper::StartPopupMode dockmgr.cxx 846 0x7f4acfc43bd3 3 DockingManager::StartPopupMode dockmgr.cxx 341 0x7f4acfc412c3 4 MenuButton::ExecuteMenu menubtn.cxx 94 0x7f4acfe9cfa9 5 MenuButton::KeyInput menubtn.cxx 226 0x7f4acfe9e092 6 ImplHandleKeywinproc.cxx 1211 0x7f4acfdb0962 7 ImplWindowFrameProc winproc.cxx 2724 0x7f4acfdb6fcf 8 SalFrame::CallCallback salframe.hxx 310 0x7f4ac5aa3dfa 9 QtFrame::CallCallbackQtFrame.hxx 229 0x7f4ac5aa5336 10 QtWidget::handleKeyEvent QtWidget.cxx 671 0x7f4ac5af9f38 11 QtWidget::handleEventQtWidget.cxx 707 0x7f4ac5afa094 12 QtWidget::event QtWidget.cxx 730 0x7f4ac5afa1f7 13 QApplicationPrivate::notify_helper qapplication.cpp 3287 0x7f4ac37a2414 14 QApplication::notify qapplication.cpp 2715 0x7f4ac379fd5b 15 QCoreApplication::notifyInternal2qcoreapplication.cpp 1123 0x7f4ac51a3c34 16 QCoreApplication::forwardEvent qcoreapplication.cpp 1138 0x7f4ac51a3cac 17 QWidgetWindow::handleKeyEventqwidgetwindow.cpp669 0x7f4ac38567b1 18 QWidgetWindow::event qwidgetwindow.cpp234 0x7f4ac3854924 19 QApplicationPrivate::notify_helper qapplication.cpp 3287 0x7f4ac37a2414 20 QApplication::notify qapplication.cpp 3238 0x7f4ac37a2224 ... and then properly restoring focus fails in `FloatingWindow::EndPopupMode`. Move the call to `Activate` to after showing the popup instead. This makes sure that the actual widget that had focus *before* the popup opened is
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/bitmap.hxx | 12 + vcl/inc/bitmap/BitmapWriteAccess.hxx |7 +++ vcl/source/bitmap/bitmappaint.cxx| 75 +++ vcl/source/filter/egif/egif.cxx |6 ++ 4 files changed, 99 insertions(+), 1 deletion(-) New commits: commit f76acf9bd97e65ba50303b6e5a25e5877996ebe1 Author: Noel Grandin AuthorDate: Wed Aug 2 15:26:06 2023 +0200 Commit: Noel Grandin CommitDate: Wed Aug 2 18:22:28 2023 +0200 tdf#156525 Save as > HTML loses drawing object as invalid gif regression from commit 1c7cbd685633d44eac554629572f3401c450f855 Author: Noel Grandin Date: Sun May 7 16:56:21 2023 +0200 use AlphaMask for variables when calling GetAlphaMask where after my change, the code is now calling Bitmap::Replace(AlphaMask,...) instead of Bitmap::Replace(Bitmap,...) and those two methods do quite different things. However, we have to (*) restore Bitmap::Replace(Bitmap,...) which was removed in commit 8270eb5d5600cc84dbf5f0e339f90c4519ef88bb Author: Noel Grandin Date: Fri May 19 13:35:31 2023 +0200 loplugin:unusedmethods (*) restore BitmapWriteAccess::SetPaletteEntryCount which was removed in commit 74cd0d0b281f8df75612bfb600df2eae62c4d21d Author: Noel Grandin Date: Thu Jun 29 13:53:30 2023 +0200 loplugin:unusedmethods (*) Invert the mask/alpha layer, since after commit 81994cb2b8b32453a92bcb011830fcb884f22ff3 Author: Noel Grandin Date: Fri Apr 16 20:33:10 2021 +0200 Convert internal vcl bitmap formats transparency->alpha (II) we are dealing with real alpha, and not transparency. Also add an assert in GIFWriter::WriteAccess, since it is a logic error to get here and have the image in the wrong format. Change-Id: I0e09b3ca82af0bd5b58d80e0a6eac4c7bdf7c48e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155254 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index bc0d628179ca..1c5f7bcc7ec6 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -430,6 +430,18 @@ public: */ boolReplace( const AlphaMask& rAlpha, const Color& rMergeColor ); +/** Replace all pixel where the given mask/alpha layer is on with the specified color + +@param rMask +Mask specifying which pixel should be replaced + +@param rReplaceColor +Color to be placed in all changed pixel + +@return true, if the operation was completed successfully. + */ +boolReplaceMask( const AlphaMask& rMask, const Color& rReplaceColor ); + /** Replace all pixel having the search color with the specified color @param rSearchColor diff --git a/vcl/inc/bitmap/BitmapWriteAccess.hxx b/vcl/inc/bitmap/BitmapWriteAccess.hxx index 216eb16806e4..bc903769d679 100644 --- a/vcl/inc/bitmap/BitmapWriteAccess.hxx +++ b/vcl/inc/bitmap/BitmapWriteAccess.hxx @@ -39,6 +39,13 @@ public: mpBuffer->maPalette = rPalette; } +void SetPaletteEntryCount(sal_uInt16 nCount) +{ +assert(mpBuffer && "Access is not valid!"); + +mpBuffer->maPalette.SetEntryCount(nCount); +} + void SetPaletteColor(sal_uInt16 nColor, const BitmapColor& rBitmapColor) { assert(mpBuffer && "Access is not valid!"); diff --git a/vcl/source/bitmap/bitmappaint.cxx b/vcl/source/bitmap/bitmappaint.cxx index 487e6d1a6ad6..91a43b951748 100644 --- a/vcl/source/bitmap/bitmappaint.cxx +++ b/vcl/source/bitmap/bitmappaint.cxx @@ -884,6 +884,81 @@ vcl::Region Bitmap::CreateRegion(const Color& rColor, const tools::Rectangle& rR return aRegion; } +bool Bitmap::ReplaceMask(const AlphaMask& rMask, const Color& rReplaceColor) +{ +ScopedReadAccess pMaskAcc(const_cast(rMask)); +BitmapScopedWriteAccess pAcc(*this); + +if (!pMaskAcc || !pAcc) +return false; + +const tools::Long nWidth = std::min(pMaskAcc->Width(), pAcc->Width()); +const tools::Long nHeight = std::min(pMaskAcc->Height(), pAcc->Height()); +const BitmapColor aMaskWhite(pMaskAcc->GetBestMatchingColor(COL_WHITE)); +BitmapColor aReplace; + +if (pAcc->HasPalette()) +{ +const sal_uInt16 nActColors = pAcc->GetPaletteEntryCount(); +const sal_uInt16 nMaxColors = 1 << pAcc->GetBitCount(); + +// default to the nearest color +aReplace = pAcc->GetBestMatchingColor(rReplaceColor); + +// for paletted images without a matching palette entry +// look for an unused palette entry (NOTE: expensive!) +if (pAcc->GetPaletteColor(aReplace.GetIndex()) != BitmapColor(rReplaceColor)) +{ +// if the palette has empty entries use the last one +if (nActColors < nMaxColors) +{ +
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/win
include/vcl/salnativewidgets.hxx | 18 vcl/inc/menubarvalue.hxx | 49 ++ vcl/source/outdev/nativecontrols.cxx |1 vcl/source/window/menubarwindow.cxx |1 vcl/win/gdi/salnativewidgets-luna.cxx |1 5 files changed, 52 insertions(+), 18 deletions(-) New commits: commit 35845a056e332c1d78d536b613aeb3183af09a91 Author: anfanite396 AuthorDate: Fri Mar 17 21:00:19 2023 +0530 Commit: Hossein CommitDate: Thu May 11 10:35:53 2023 +0200 tdf#97228 Move MenubarValue class to separate include file Change-Id: I5da4bb1765f91d1f9d78e27221d243d5c2ef92e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149076 Tested-by: Jenkins Reviewed-by: Hossein diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx index 21c852b6acbd..907c3b618f88 100644 --- a/include/vcl/salnativewidgets.hxx +++ b/include/vcl/salnativewidgets.hxx @@ -446,24 +446,6 @@ class SAL_DLLPUBLIC_RTTI SpinbuttonValue final : public ImplControlValue SpinbuttonValue & operator =(SpinbuttonValue &&) = delete; // due to ImplControlValue }; -/* MenubarValue: - * - * Value container for menubars specifying height of adjacent docking area - */ -class MenubarValue final : public ImplControlValue -{ -public: -MenubarValue() : ImplControlValue( ControlType::Menubar, 0 ) -{ maTopDockingAreaHeight=0; } -virtual ~MenubarValue() override; -virtual MenubarValue* clone() const override; -MenubarValue(MenubarValue const &) = default; -MenubarValue(MenubarValue &&) = default; -MenubarValue & operator =(MenubarValue const &) = delete; // due to ImplControlValue -MenubarValue & operator =(MenubarValue &&) = delete; // due to ImplControlValue -int maTopDockingAreaHeight; -}; - /* MenupopupValue: * * Value container for menu items; specifies the rectangle for the whole item which diff --git a/vcl/inc/menubarvalue.hxx b/vcl/inc/menubarvalue.hxx new file mode 100644 index ..0185037ba326 --- /dev/null +++ b/vcl/inc/menubarvalue.hxx @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_VCL_INC_MENUBARVALUE_HXX +#define INCLUDED_VCL_INC_MENUBARVALUE_HXX + +#include +#include + +/* MenubarValue: + * + * Value container for menubars specifying height of adjacent docking area + */ +class MenubarValue final : public ImplControlValue +{ +public: +MenubarValue() +: ImplControlValue(ControlType::Menubar, 0) +{ +maTopDockingAreaHeight = 0; +} +virtual ~MenubarValue() override; +virtual MenubarValue* clone() const override; +MenubarValue(MenubarValue const&) = default; +MenubarValue(MenubarValue&&) = default; +MenubarValue& operator=(MenubarValue const&) = delete; // due to ImplControlValue +MenubarValue& operator=(MenubarValue&&) = delete; // due to ImplControlValue +int maTopDockingAreaHeight; +}; + +#endif // INCLUDED_VCL_INC_MENUBARVALUE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/outdev/nativecontrols.cxx b/vcl/source/outdev/nativecontrols.cxx index cee9408d6cfb..1b035c72bd2d 100644 --- a/vcl/source/outdev/nativecontrols.cxx +++ b/vcl/source/outdev/nativecontrols.cxx @@ -26,6 +26,7 @@ #include #include +#include #include diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index 0109bb559503..89e6b9246148 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -33,6 +33,7 @@ #include #include #include "bufferdevice.hxx" +#include // document closing button #define IID_DOCUMENTCLOSE 1 diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx index c837cb7a1c82..0dd5b2dd7442 100644 --- a/vcl/win/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/gdi/salnativewidgets-luna.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/BinaryDataContainer.hxx|6 -- vcl/inc/pdf/ExternalPDFStreams.hxx |4 ++-- vcl/source/filter/graphicfilter.cxx|8 vcl/source/graphic/BinaryDataContainer.cxx | 23 +-- 4 files changed, 31 insertions(+), 10 deletions(-) New commits: commit c55d5586304f23f9d8acbaffefba68a3a11c6175 Author: Michael Meeks AuthorDate: Sat Apr 1 16:10:33 2023 +0100 Commit: Michael Meeks CommitDate: Thu Apr 13 22:24:18 2023 +0200 BinaryDataContainer: hand out shared_ptr's to SvStreams. Hide the SvMemoryStream implementation detail better - this could be served from a file in future. Also couple lifecycle of the SvMemoryStream to the vector backing it. Change-Id: Ia9b28b57b8df4ce57286effd4d1753bf345fc10e Signed-off-by: Michael Meeks Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149917 Tested-by: Jenkins diff --git a/include/vcl/BinaryDataContainer.hxx b/include/vcl/BinaryDataContainer.hxx index 2e2e5d4b6264..e9e46a04e667 100644 --- a/include/vcl/BinaryDataContainer.hxx +++ b/include/vcl/BinaryDataContainer.hxx @@ -47,8 +47,10 @@ public: const sal_uInt8* getData() const; css::uno::Sequence getCopyAsByteSequence() const; -// Returns the data as a stream open for reading -SvMemoryStream getMemoryStream(); +// Returns the data as a readonly stream open for reading +std::shared_ptr getAsStream(); + +/// writes the contents to the given stream std::size_t writeToStream(SvStream& rStream) const; size_t calculateHash() const; diff --git a/vcl/inc/pdf/ExternalPDFStreams.hxx b/vcl/inc/pdf/ExternalPDFStreams.hxx index e2ddd58b91a5..b2936f01a898 100644 --- a/vcl/inc/pdf/ExternalPDFStreams.hxx +++ b/vcl/inc/pdf/ExternalPDFStreams.hxx @@ -38,9 +38,9 @@ struct VCL_DLLPUBLIC ExternalPDFStream { if (!mpPDFDocument) { -SvMemoryStream aPDFStream = maDataContainer.getMemoryStream(); +std::shared_ptr aPDFStream = maDataContainer.getAsStream(); auto pPDFDocument = std::make_shared(); -if (!pPDFDocument->ReadWithPossibleFixup(aPDFStream)) +if (!pPDFDocument->ReadWithPossibleFixup(*aPDFStream)) { SAL_WARN("vcl.pdfwriter", "PDFWriterImpl::writeReferenceXObject: reading the PDF document failed"); diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 53071f6dea76..e51b027be701 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -914,8 +914,8 @@ Graphic GraphicFilter::ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 size Size aLogicSize; if (eLinkType == GfxLinkType::NativeGif) { -SvMemoryStream aMemoryStream(aGraphicContent.getMemoryStream()); -bAnimated = IsGIFAnimated(aMemoryStream, aLogicSize); +std::shared_ptr pMemoryStream = aGraphicContent.getAsStream(); +bAnimated = IsGIFAnimated(*pMemoryStream, aLogicSize); if (!pSizeHint && aLogicSize.getWidth() && aLogicSize.getHeight()) { pSizeHint = @@ -954,8 +954,8 @@ ErrCode GraphicFilter::readPNG(SvStream & rStream, Graphic & rGraphic, GfxLinkTy if (auto aMSGifChunk = vcl::PngImageReader::getMicrosoftGifChunk(rStream); !aMSGifChunk.isEmpty()) { -SvMemoryStream aIStrm(aMSGifChunk.getMemoryStream()); -ImportGIF(aIStrm, rGraphic); +std::shared_ptr pIStrm(aMSGifChunk.getAsStream()); +ImportGIF(*pIStrm, rGraphic); rLinkType = GfxLinkType::NativeGif; rpGraphicContent = aMSGifChunk; return aReturnCode; diff --git a/vcl/source/graphic/BinaryDataContainer.cxx b/vcl/source/graphic/BinaryDataContainer.cxx index deb676a553f9..72d9bac27940 100644 --- a/vcl/source/graphic/BinaryDataContainer.cxx +++ b/vcl/source/graphic/BinaryDataContainer.cxx @@ -42,9 +42,28 @@ css::uno::Sequence BinaryDataContainer::getCopyAsByteSequence() const return aData; } -SvMemoryStream BinaryDataContainer::getMemoryStream() +namespace { -return SvMemoryStream(mpData ? mpData->data() : nullptr, getSize(), StreamMode::READ); +/* + * Hold a reference on the internal state in case we swap out + * and free the vector while someone holds an SvStream pointer. + */ +class ReferencedMemoryStream : public SvMemoryStream +{ +std::shared_ptr> mpData; + +public: +ReferencedMemoryStream(const std::shared_ptr>& rData) +: SvMemoryStream(rData ? rData->data() : nullptr, rData->size(), StreamMode::READ) +, mpData(rData) +{ +} +}; +} + +std::shared_ptr BinaryDataContainer::getAsStream() +{ +return std::make_shared(mpData); } std::size_t BinaryDataContainer::writeToStream(SvStream& rStream) const
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |9 ++-- vcl/inc/salvtables.hxx|5 vcl/source/app/salvtables.cxx | 26 + vcl/unx/gtk3/gtkinst.cxx | 43 +++--- 4 files changed, 62 insertions(+), 21 deletions(-) New commits: commit dffde8403e0bb81d7eb3b7853cece187e1d36c62 Author: Caolán McNamara AuthorDate: Thu Mar 16 09:50:19 2023 + Commit: Caolán McNamara CommitDate: Thu Mar 16 14:02:44 2023 + allow more than DrawingArea to report style updates Change-Id: I791e4ad45daeeb77ca25e36ae6520168b2ece044 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148980 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index e352c2e357f7..4acece25f052 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -87,6 +87,7 @@ protected: Link m_aFocusInHdl; Link m_aFocusOutHdl; Link m_aMnemonicActivateHdl; +Link m_aStyleUpdatedHdl; Link m_aSizeAllocateHdl; Link m_aKeyPressHdl; Link m_aKeyReleaseHdl; @@ -279,6 +280,12 @@ public: m_aMouseReleaseHdl = rLink; } +virtual void connect_style_updated(const Link& rLink) +{ +assert(!m_aStyleUpdatedHdl.IsSet() || !rLink.IsSet()); +m_aStyleUpdatedHdl = rLink; +} + virtual void grab_add() = 0; virtual bool has_grab() const = 0; virtual void grab_remove() = 0; @@ -2274,7 +2281,6 @@ public: protected: Link m_aDrawHdl; -Link m_aStyleUpdatedHdl; Link m_aCommandHdl; Link m_aGetFocusRectHdl; Link m_aQueryTooltipHdl; @@ -2304,7 +2310,6 @@ protected: public: void connect_draw(const Link& rLink) { m_aDrawHdl = rLink; } -void connect_style_updated(const Link& rLink) { m_aStyleUpdatedHdl = rLink; } void connect_command(const Link& rLink) { m_aCommandHdl = rLink; } void connect_focus_rect(const Link& rLink) { diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 19f6b0adf91d..1bbf37b4f7fb 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -188,6 +188,7 @@ private: DECL_LINK(EventListener, VclWindowEvent&, void); DECL_LINK(KeyEventListener, VclWindowEvent&, bool); DECL_LINK(MouseEventListener, VclWindowEvent&, void); +DECL_LINK(SettingsChangedHdl, VclWindowEvent&, void); DECL_LINK(MnemonicActivateHdl, vcl::Window&, bool); static void DoRecursivePaint(vcl::Window* pWindow, const Point& rPos, OutputDevice& rOutput); @@ -333,6 +334,8 @@ public: virtual void connect_key_release(const Link& rLink) override; +virtual void connect_style_updated(const Link& rLink) override; + virtual bool get_extents_relative_to(const Widget& rRelative, int& x, int& y, int& width, int& height) const override; @@ -1311,6 +1314,8 @@ public: virtual void connect_key_release(const Link& rLink) override; +virtual void connect_style_updated(const Link& rLink) override; + virtual void set_cursor(PointerStyle ePointerStyle) override; virtual Point get_pointer_position() const override; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index f9a6cfc75dc2..61fa56dd3223 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -580,6 +580,25 @@ void SalInstanceWidget::connect_key_release(const Link& r weld::Widget::connect_key_release(rLink); } +IMPL_LINK(SalInstanceWidget, SettingsChangedHdl, VclWindowEvent&, rEvent, void) +{ +if (rEvent.GetId() != VclEventId::WindowDataChanged) +return; + +DataChangedEvent* pData = static_cast(rEvent.GetData()); +if (pData->GetType() == DataChangedEventType::SETTINGS) +m_aStyleUpdatedHdl.Call(*this); +} + +void SalInstanceWidget::connect_style_updated(const Link& rLink) +{ +if (m_aStyleUpdatedHdl.IsSet()) +m_xWidget->RemoveEventListener(LINK(this, SalInstanceWidget, SettingsChangedHdl)); +weld::Widget::connect_style_updated(rLink); +if (m_aStyleUpdatedHdl.IsSet()) +m_xWidget->AddEventListener(LINK(this, SalInstanceWidget, SettingsChangedHdl)); +} + bool SalInstanceWidget::get_extents_relative_to(const Widget& rRelative, int& x, int& y, int& width, int& height) const { @@ -633,6 +652,8 @@ void SalInstanceWidget::queue_resize() { m_xWidget->queue_resize(); } SalInstanceWidget::~SalInstanceWidget() { +if (m_aStyleUpdatedHdl.IsSet()) +m_xWidget->RemoveEventListener(LINK(this, SalInstanceWidget, SettingsChangedHdl)); if (m_aMnemonicActivateHdl.IsSet()) m_xWidget->SetMnemonicActivateHdl(Link()); if (m_bMouseEventListener) @@ -6233,6 +6254,11 @@ void SalInstanceDrawingArea::connect_key_release(const Link& rLink) +{ +weld::Widget::connect_style_updated(rLink); +} + void SalInstanceDrawingArea::set_cursor(PointerStyle
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/filter/pdfdocument.hxx|2 include/vcl/filter/pdfobjectcontainer.hxx |9 vcl/inc/pdf/pdfwriter_impl.hxx|2 vcl/source/filter/ipdf/pdfdocument.cxx|2 vcl/source/gdi/pdfobjectcopier.cxx|8 vcl/source/gdi/pdfwriter_impl.cxx | 321 ++ vcl/source/gdi/pdfwriter_impl2.cxx|6 7 files changed, 176 insertions(+), 174 deletions(-) New commits: commit 67127e9a1340076d0c8f818b41cc6c44ddd575da Author: Noel Grandin AuthorDate: Tue Mar 14 10:45:54 2023 +0200 Commit: Noel Grandin CommitDate: Tue Mar 14 09:45:54 2023 + use more string_view in vcl::PDFObjectContainer which makes the call sites much less verbose Change-Id: I94eef7569e419f134ce574ecd9fb2ce8f50184b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148839 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/vcl/filter/pdfdocument.hxx b/include/vcl/filter/pdfdocument.hxx index fbe0be89cdc6..7e9d6dd8045a 100644 --- a/include/vcl/filter/pdfdocument.hxx +++ b/include/vcl/filter/pdfdocument.hxx @@ -596,7 +596,7 @@ public: /// See vcl::PDFObjectContainer::updateObject(). bool updateObject(sal_Int32 n) override; /// See vcl::PDFObjectContainer::writeBuffer(). -bool writeBuffer(const void* pBuffer, sal_uInt64 nBytes) override; +bool writeBufferBytes(const void* pBuffer, sal_uInt64 nBytes) override; void checkAndEnableStreamEncryption(sal_Int32 /*nObject*/) override {} void disableStreamEncryption() override {} }; diff --git a/include/vcl/filter/pdfobjectcontainer.hxx b/include/vcl/filter/pdfobjectcontainer.hxx index f6614f09ea3d..308ec65cae83 100644 --- a/include/vcl/filter/pdfobjectcontainer.hxx +++ b/include/vcl/filter/pdfobjectcontainer.hxx @@ -10,6 +10,7 @@ #pragma once #include +#include namespace vcl { @@ -26,7 +27,13 @@ public: virtual bool updateObject(sal_Int32 n) = 0; // Write pBuffer to the end of the output. -virtual bool writeBuffer(const void* pBuffer, sal_uInt64 nBytes) = 0; +virtual bool writeBufferBytes(const void* pBuffer, sal_uInt64 nBytes) = 0; + +// Utility method, reduces verbosity at call sites +bool writeBuffer(std::string_view aBuffer) +{ +return writeBufferBytes(aBuffer.data(), aBuffer.size()); +} virtual void checkAndEnableStreamEncryption(sal_Int32 nObject) = 0; diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx index a16d57404207..4157aeda446a 100644 --- a/vcl/inc/pdf/pdfwriter_impl.hxx +++ b/vcl/inc/pdf/pdfwriter_impl.hxx @@ -1044,7 +1044,7 @@ i12626 bool updateObject( sal_Int32 n ) override; /// See vcl::PDFObjectContainer::writeBuffer(). -bool writeBuffer( const void* pBuffer, sal_uInt64 nBytes ) override; +bool writeBufferBytes( const void* pBuffer, sal_uInt64 nBytes ) override; void beginCompression(); void endCompression(); void beginRedirect( SvStream* pStream, const tools::Rectangle& ); diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx index 5ff50d3b55ac..568b1980ab5d 100644 --- a/vcl/source/filter/ipdf/pdfdocument.cxx +++ b/vcl/source/filter/ipdf/pdfdocument.cxx @@ -89,7 +89,7 @@ bool PDFDocument::updateObject(sal_Int32 nObject) return true; } -bool PDFDocument::writeBuffer(const void* pBuffer, sal_uInt64 nBytes) +bool PDFDocument::writeBufferBytes(const void* pBuffer, sal_uInt64 nBytes) { std::size_t nWritten = m_aEditBuffer.WriteBytes(pBuffer, nBytes); return nWritten == nBytes; diff --git a/vcl/source/gdi/pdfobjectcopier.cxx b/vcl/source/gdi/pdfobjectcopier.cxx index 2f32cdc27ce1..4c9228235cd3 100644 --- a/vcl/source/gdi/pdfobjectcopier.cxx +++ b/vcl/source/gdi/pdfobjectcopier.cxx @@ -147,7 +147,7 @@ sal_Int32 PDFObjectCopier::copyExternalResource(SvMemoryStream& rDocBuffer, // We have the whole object, now write it to the output. if (!m_rContainer.updateObject(nObject)) return -1; -if (!m_rContainer.writeBuffer(aLine.getStr(), aLine.getLength())) +if (!m_rContainer.writeBuffer(aLine)) return -1; aLine.setLength(0); @@ -156,19 +156,19 @@ sal_Int32 PDFObjectCopier::copyExternalResource(SvMemoryStream& rDocBuffer, SvMemoryStream& rStream = pStream->GetMemory(); m_rContainer.checkAndEnableStreamEncryption(nObject); aLine.append(static_cast(rStream.GetData()), rStream.GetSize()); -if (!m_rContainer.writeBuffer(aLine.getStr(), aLine.getLength())) +if (!m_rContainer.writeBuffer(aLine)) return -1; aLine.setLength(0); m_rContainer.disableStreamEncryption(); aLine.append("\nendstream\n"); -if (!m_rContainer.writeBuffer(aLine.getStr(), aLine.getLength())) +if (!m_rContainer.writeBuffer(aLine)) return -1; aLine.setLength(0); } aLine.append("endobj\n\n"); -
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/toolkit/dialog.hxx |2 vcl/inc/wizdlg.hxx |2 vcl/source/control/roadmapwizard.cxx | 72 +++ 3 files changed, 75 insertions(+), 1 deletion(-) New commits: commit a5e2201643392d0509cb970faf1c1e7038d14f4e Author: Szymon Kłos AuthorDate: Fri Mar 3 08:13:58 2023 +0100 Commit: Szymon Kłos CommitDate: Sat Mar 4 07:07:50 2023 + jsdialog: correct structure for RoadmapWizard Signed-off-by: Szymon Kłos Change-Id: Id9837c208653311608bf39d6066cbf1345efc565 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148214 Tested-by: Jenkins diff --git a/include/vcl/toolkit/dialog.hxx b/include/vcl/toolkit/dialog.hxx index 31326106cbd5..679c0232ea30 100644 --- a/include/vcl/toolkit/dialog.hxx +++ b/include/vcl/toolkit/dialog.hxx @@ -101,6 +101,7 @@ protected: friend class SalInstanceBuilder; void set_action_area(VclButtonBox* pBox); void set_content_area(VclBox* pBox); +vcl::Window*GetFirstControlForFocus(); public: explicitDialog( vcl::Window* pParent, WinBits nStyle = WB_STDDIALOG, InitFlag eFlag = InitFlag::Default ); @@ -132,7 +133,6 @@ private: static void ImplEndExecuteModal(); voidImplSetModalInputMode(bool bModal); -vcl::Window*GetFirstControlForFocus(); public: /// Commence execution of a modal dialog, disposes owner on failure diff --git a/vcl/inc/wizdlg.hxx b/vcl/inc/wizdlg.hxx index 04f6e88c4acd..1fd0f9bad41e 100644 --- a/vcl/inc/wizdlg.hxx +++ b/vcl/inc/wizdlg.hxx @@ -255,6 +255,8 @@ namespace vcl DECL_LINK(OnFinish, Button*, void); void implConstruct( const WizardButtonFlags _nButtonFlags ); + +virtual void DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) override; }; /// helper class to temporarily suspend any traveling in the wizard diff --git a/vcl/source/control/roadmapwizard.cxx b/vcl/source/control/roadmapwizard.cxx index 49c28de9bfe9..0aef0d00527e 100644 --- a/vcl/source/control/roadmapwizard.cxx +++ b/vcl/source/control/roadmapwizard.cxx @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -798,6 +799,77 @@ namespace vcl return RoadmapWizardUIObject::create; } +namespace +{ +bool isButton(WindowType eType) +{ +return eType == WindowType::PUSHBUTTON || eType == WindowType::OKBUTTON +|| eType == WindowType::CANCELBUTTON || eType == WindowType::HELPBUTTON; +} +} + +void RoadmapWizard::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) +{ +rJsonWriter.put("id", get_id()); +rJsonWriter.put("type", "dialog"); +rJsonWriter.put("title", GetText()); + +OUString sDialogId = OStringToOUString(GetHelpId(), RTL_TEXTENCODING_ASCII_US); +sal_Int32 nStartPos = sDialogId.lastIndexOf('/'); +nStartPos = nStartPos >= 0 ? nStartPos + 1 : 0; +rJsonWriter.put("dialogid", sDialogId.copy(nStartPos)); + +vcl::Window* pFocusControl = GetFirstControlForFocus(); +if (pFocusControl) +rJsonWriter.put("init_focus_id", pFocusControl->get_id()); + +{ +auto childrenNode = rJsonWriter.startArray("children"); + +auto containerNode = rJsonWriter.startStruct(); +rJsonWriter.put("id", "container"); +rJsonWriter.put("type", "container"); +rJsonWriter.put("vertical", true); + +{ +auto containerChildrenNode = rJsonWriter.startArray("children"); + +// tabpages +for (int i = 0; i < GetChildCount(); i++) +{ +vcl::Window* pChild = GetChild(i); + +if (!isButton(pChild->GetType()) && pChild != mpViewWindow) +{ +auto childNode = rJsonWriter.startStruct(); +pChild->DumpAsPropertyTree(rJsonWriter); +} +} + +// buttons +{ +auto buttonsNode = rJsonWriter.startStruct(); +rJsonWriter.put("id", "buttons"); +rJsonWriter.put("type", "buttonbox"); +rJsonWriter.put("layoutstyle", "end"); +{ +auto buttonsChildrenNode = rJsonWriter.startArray("children"); +for (int i = 0; i < GetChildCount(); i++) +{ +vcl::Window* pChild = GetChild(i); + +if (isButton(pChild->GetType())) +{ +auto childNode = rJsonWriter.startStruct(); +pChild->DumpAsPropertyTree(rJsonWriter); +} +} +} +} +} +}
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/graph.hxx |2 -- vcl/inc/graphic/UnoGraphic.hxx|7 ++- vcl/source/gdi/graph.cxx |8 ++-- vcl/source/graphic/UnoGraphic.cxx |8 vcl/source/graphic/UnoGraphicProvider.cxx |3 ++- 5 files changed, 6 insertions(+), 22 deletions(-) New commits: commit 0da2d347a8de0e7480aba900961a1464c753c087 Author: Noel Grandin AuthorDate: Mon Jan 23 09:51:14 2023 +0200 Commit: Noel Grandin CommitDate: Mon Jan 23 11:46:09 2023 + XUnoTunnel->dynamic_cast in vcl::Graphic Change-Id: Iecbae3570851784f0da75fd2899daf620c8e4c06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145994 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx index c97ee23d41c1..e662987b67e3 100644 --- a/include/vcl/graph.hxx +++ b/include/vcl/graph.hxx @@ -188,8 +188,6 @@ public: /// Get the page number of the multi-page source this Graphic is rendered from. sal_Int32 getPageNumber() const; - -static const css::uno::Sequence & getUnoTunnelId(); }; namespace std { diff --git a/vcl/inc/graphic/UnoGraphic.hxx b/vcl/inc/graphic/UnoGraphic.hxx index 0e2f2af7b1b0..ce060c98f40c 100644 --- a/vcl/inc/graphic/UnoGraphic.hxx +++ b/vcl/inc/graphic/UnoGraphic.hxx @@ -21,7 +21,6 @@ #define INCLUDED_VCL_SOURCE_GRAPHIC_GRAPHIC_HXX #include -#include #include #include @@ -33,7 +32,6 @@ namespace unographic { class Graphic final : public css::graphic::XGraphic, public css::awt::XBitmap, -public css::lang::XUnoTunnel, public css::graphic::XGraphicTransformer, public ::unographic::GraphicDescriptor { @@ -44,6 +42,8 @@ public: using ::unographic::GraphicDescriptor::init; void init(const ::Graphic& rGraphic); +const ::Graphic& GetGraphic() const { return maGraphic; } + // XInterface virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; virtual void SAL_CALL acquire() noexcept override; @@ -66,9 +66,6 @@ private: virtual css::uno::Sequence< ::sal_Int8 > SAL_CALL getDIB( ) override; virtual css::uno::Sequence< ::sal_Int8 > SAL_CALL getMaskDIB( ) override; -// XUnoTunnel -virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rId ) override; - // XGraphicTransformer virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL colorChange( const css::uno::Reference< css::graphic::XGraphic >& rGraphic, diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index 2407744820f8..4c0efa56beba 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -219,7 +219,8 @@ Graphic::Graphic(const GDIMetaFile& rMtf) Graphic::Graphic( const css::uno::Reference< css::graphic::XGraphic >& rxGraphic ) { -const ::Graphic* pGraphic = comphelper::getFromUnoTunnel<::Graphic>(rxGraphic); +const ::unographic::Graphic* pUnoGraphic = dynamic_cast<::unographic::Graphic*>(rxGraphic.get()); +const ::Graphic* pGraphic = pUnoGraphic ? >GetGraphic() : nullptr; if( pGraphic ) { @@ -556,9 +557,4 @@ OString Graphic::getUniqueID() const return aUniqueString; } -const css::uno::Sequence & Graphic::getUnoTunnelId() { -static const comphelper::UnoIdInit gId; -return gId.getSeq(); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/graphic/UnoGraphic.cxx b/vcl/source/graphic/UnoGraphic.cxx index f26640563862..d1b7fd0238df 100644 --- a/vcl/source/graphic/UnoGraphic.cxx +++ b/vcl/source/graphic/UnoGraphic.cxx @@ -57,8 +57,6 @@ uno::Any SAL_CALL Graphic::queryInterface( const uno::Type & rType ) aAny <<= uno::Reference< graphic::XGraphic >( this ); else if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< awt::XBitmap >( this ); -else if( rType == cppu::UnoType::get()) -aAny <<= uno::Reference< lang::XUnoTunnel >(this); else if( rType == cppu::UnoType::get()) aAny <<= uno::Reference< graphic::XGraphicTransformer >(this); else @@ -176,12 +174,6 @@ uno::Sequence SAL_CALL Graphic::getMaskDIB() } } -sal_Int64 SAL_CALL Graphic::getSomething( const uno::Sequence< sal_Int8 >& rId ) -{ -return comphelper::getSomethingImpl(rId, ); -} - - // XGraphicTransformer uno::Reference< graphic::XGraphic > SAL_CALL Graphic::colorChange( const uno::Reference< graphic::XGraphic >& rxGraphic, sal_Int32 nColorFrom, sal_Int8 nTolerance, sal_Int32 nColorTo, sal_Int8 nAlphaTo ) diff --git a/vcl/source/graphic/UnoGraphicProvider.cxx b/vcl/source/graphic/UnoGraphicProvider.cxx index f0e0d12e7895..bceb9fbabed1 100644 --- a/vcl/source/graphic/UnoGraphicProvider.cxx +++ b/vcl/source/graphic/UnoGraphicProvider.cxx @@ -796,7 +796,8 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG { const
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/font/Feature.hxx |9 +++- vcl/inc/font/OpenTypeFeatureDefinitionList.hxx|3 - vcl/source/font/OpenTypeFeatureDefinitionList.cxx | 43 +++--- 3 files changed, 13 insertions(+), 42 deletions(-) New commits: commit fcba85d2ebb54692e0730610026b9b51feb67716 Author: Khaled Hosny AuthorDate: Sat Dec 3 16:29:46 2022 +0200 Commit: خالد حسني CommitDate: Sun Dec 4 08:21:38 2022 + Check for trailing numeric part in isCharacterVariant/isStylisticSet We want to mach features like “ss01” but not, say, “ssty”. Change-Id: Idc4fdf78c577afe66cf76d7f722dc2009863654e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143614 Tested-by: خالد حسني Reviewed-by: خالد حسني diff --git a/include/vcl/font/Feature.hxx b/include/vcl/font/Feature.hxx index c5bd497532e8..0c3c159dbc11 100644 --- a/include/vcl/font/Feature.hxx +++ b/include/vcl/font/Feature.hxx @@ -11,6 +11,7 @@ #define INCLUDED_VCL_FONT_FEATURE_HXX #include +#include #include #include #include @@ -92,12 +93,16 @@ struct Feature bool isCharacterVariant() const { -return ((m_nCode >> 24) & 0xFF) == 'c' && ((m_nCode >> 16) & 0xFF) == 'v'; +return ((m_nCode >> 24) & 0xFF) == 'c' && ((m_nCode >> 16) & 0xFF) == 'v' + && rtl::isAsciiDigit((m_nCode >> 8) & 0xFF) + && rtl::isAsciiDigit((m_nCode >> 0) & 0xFF); } bool isStylisticSet() const { -return ((m_nCode >> 24) & 0xFF) == 's' && ((m_nCode >> 16) & 0xFF) == 's'; +return ((m_nCode >> 24) & 0xFF) == 's' && ((m_nCode >> 16) & 0xFF) == 's' + && rtl::isAsciiDigit((m_nCode >> 8) & 0xFF) + && rtl::isAsciiDigit((m_nCode >> 0) & 0xFF); } uint32_t m_nCode; diff --git a/vcl/inc/font/OpenTypeFeatureDefinitionList.hxx b/vcl/inc/font/OpenTypeFeatureDefinitionList.hxx index c8fb6f7a449d..1ae634deabe8 100644 --- a/vcl/inc/font/OpenTypeFeatureDefinitionList.hxx +++ b/vcl/inc/font/OpenTypeFeatureDefinitionList.hxx @@ -25,9 +25,6 @@ private: void init(); -static bool isSpecialFeature(vcl::font::Feature& rFeature); -static FeatureDefinition handleSpecialFeature(vcl::font::Feature& rFeature); - public: OpenTypeFeatureDefinitionListPrivate(); FeatureDefinition getDefinition(vcl::font::Feature& rFeature); diff --git a/vcl/source/font/OpenTypeFeatureDefinitionList.cxx b/vcl/source/font/OpenTypeFeatureDefinitionList.cxx index 4cc370cec3c7..0400833937af 100644 --- a/vcl/source/font/OpenTypeFeatureDefinitionList.cxx +++ b/vcl/source/font/OpenTypeFeatureDefinitionList.cxx @@ -125,49 +125,18 @@ void OpenTypeFeatureDefinitionListPrivate::init() }); } -namespace -{ -OUString getNumericLowerPart(vcl::font::Feature& rFeature) -{ -auto nFeatureCode = rFeature.m_nCode; -char cChar1((sal_uInt32(nFeatureCode) >> 8) & 0xFF); -char cChar2((sal_uInt32(nFeatureCode) >> 0) & 0xFF); - -if (rtl::isAsciiDigit(static_cast(cChar1)) -&& rtl::isAsciiDigit(static_cast(cChar2))) -{ -return OUStringChar(cChar1) + OUStringChar(cChar2); -} -return OUString(); -} - -} // end anonymous namespace - -bool OpenTypeFeatureDefinitionListPrivate::isSpecialFeature(vcl::font::Feature& rFeature) -{ -return rFeature.isCharacterVariant() || rFeature.isStylisticSet(); -} - -FeatureDefinition -OpenTypeFeatureDefinitionListPrivate::handleSpecialFeature(vcl::font::Feature& rFeature) +FeatureDefinition OpenTypeFeatureDefinitionListPrivate::getDefinition(vcl::font::Feature& rFeature) { -FeatureDefinition aFeatureDefinition; -OUString sNumericPart = getNumericLowerPart(rFeature); -if (!sNumericPart.isEmpty()) +if (rFeature.isCharacterVariant() || rFeature.isStylisticSet()) { +FeatureDefinition aFeatureDefinition; +OUString sNumericPart = OUStringChar(char((rFeature.m_nCode >> 8) & 0xFF)) ++ OUStringChar(char((rFeature.m_nCode >> 0) & 0xFF)); if (rFeature.isCharacterVariant()) aFeatureDefinition = { rFeature.m_nCode, STR_FONT_FEATURE_ID_CVXX, sNumericPart }; else if (rFeature.isStylisticSet()) aFeatureDefinition = { rFeature.m_nCode, STR_FONT_FEATURE_ID_SSXX, sNumericPart }; -} -return aFeatureDefinition; -} - -FeatureDefinition OpenTypeFeatureDefinitionListPrivate::getDefinition(vcl::font::Feature& rFeature) -{ -if (isSpecialFeature(rFeature)) -{ -return handleSpecialFeature(rFeature); +return aFeatureDefinition; } auto nFeatureCode = rFeature.m_nCode;
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/fontcharmap.hxx |6 +++--- vcl/inc/impfontcharmap.hxx | 10 +- vcl/inc/sft.hxx |6 +++--- vcl/source/font/PhysicalFontFace.cxx|2 +- vcl/source/font/fontcharmap.cxx | 22 +++--- vcl/source/fontsubset/sft.cxx |8 vcl/unx/generic/fontmanager/fontmanager.cxx |2 +- 7 files changed, 28 insertions(+), 28 deletions(-) New commits: commit 2adaac8bf01a6caffd0eedb9f456eeadc43f1759 Author: Caolán McNamara AuthorDate: Sun Nov 20 20:49:26 2022 + Commit: Caolán McNamara CommitDate: Mon Nov 21 11:36:53 2022 +0100 be more specific on what "Symbol" is Change-Id: Icd08628848cce74407552f57660d75b1ac9816bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143009 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/fontcharmap.hxx b/include/vcl/fontcharmap.hxx index fc9acd061078..7bfd074f3c8b 100644 --- a/include/vcl/fontcharmap.hxx +++ b/include/vcl/fontcharmap.hxx @@ -42,7 +42,7 @@ public: /** A new FontCharMap is created based on passed arguments. */ -FontCharMap(bool bSymbolic, std::vector aRangeCodes); +FontCharMap(bool bMicrosoftSymbolMap, std::vector aRangeCodes); virtual ~FontCharMap() override; @@ -50,7 +50,7 @@ public: @returns the default font character map. */ -static FontCharMapRef GetDefaultMap( bool bSymbols ); +static FontCharMapRef GetDefaultMap(bool bMicrosoftSymbolMap); /** Determines if the font character map is the "default". The default map includes all codepoints in the Unicode BMP range, including surrogates. @@ -136,7 +136,7 @@ public: */ sal_UCS4GetCharFromIndex( int nCharIndex ) const; -bool isSymbolic() const; +bool isMicrosoftSymbolMap() const; private: ImplFontCharMapRef mpImplFontCharMap; diff --git a/vcl/inc/impfontcharmap.hxx b/vcl/inc/impfontcharmap.hxx index 552cb736020f..59f9f3baa001 100644 --- a/vcl/inc/impfontcharmap.hxx +++ b/vcl/inc/impfontcharmap.hxx @@ -30,8 +30,8 @@ typedef tools::SvRef ImplFontCharMapRef; class ImplFontCharMap final : public SvRefBase { public: -explicitImplFontCharMap( bool bSymbolic, - std::vector aRangeCodes); +explicitImplFontCharMap(bool bMicrosoftSymbolMap, +std::vector aRangeCodes); virtual ~ImplFontCharMap() override; private: @@ -40,16 +40,16 @@ private: ImplFontCharMap( const ImplFontCharMap& ) = delete; voidoperator=( const ImplFontCharMap& ) = delete; -static ImplFontCharMapRef const & getDefaultMap( bool bSymbols=false); +static ImplFontCharMapRef const & getDefaultMap(bool bMicrosoftSymbolMap = false); boolisDefaultMap() const; private: std::vector maRangeCodes; // pairs of StartCode/(EndCode+1) int mnCharCount; // covered codepoints -const bool m_bSymbolic; +const bool m_bMicrosoftSymbolMap; }; -bool VCL_DLLPUBLIC HasSymbolCmap(const unsigned char* pRawData, int nRawLength); +bool VCL_DLLPUBLIC HasMicrosoftSymbolCmap(const unsigned char* pRawData, int nRawLength); #endif // INCLUDED_VCL_INC_IMPFONTCHARMAP_HXX diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx index 4814c0e87245..29f282a04ec4 100644 --- a/vcl/inc/sft.hxx +++ b/vcl/inc/sft.hxx @@ -171,7 +171,7 @@ namespace vcl int typoLineGap = 0;/**< OS/2 portable typographic line gap */ int winAscent = 0; /**< ascender metric for Windows */ int winDescent = 0; /**< descender metric for Windows */ -bool symbolEncoded = false; /**< true: MS symbol encoded */ +bool microsoftSymbolEncoded = false; /**< true: MS symbol encoded */ sal_uInt8 panose[10] = {}; /**< PANOSE classification number */ sal_uInt32 typeFlags = 0; /**< type flags (copyright bits) */ sal_uInt16 fsSelection = 0; /**< OS/2 fsSelection */ @@ -707,7 +707,7 @@ class VCL_DLLPUBLIC AbstractTrueTypeFont sal_uInt32 m_nUnitsPerEm; std::vector m_aGlyphOffsets; FontCharMapRef m_xCharMap; -bool m_bIsSymbolFont; +bool m_bMicrosoftSymbolEncoded; protected: SFErrCodes indexGlyphData(); @@ -724,7 +724,7 @@ public: sal_uInt32 horzMetricCount() const { return m_nHorzMetrics; } sal_uInt32 vertMetricCount() const { return m_nVertMetrics; } sal_uInt32 unitsPerEm() const { return m_nUnitsPerEm; } -bool IsSymbolFont() const { return m_bIsSymbolFont; } +bool IsMicrosoftSymbolEncoded() const { return m_bMicrosoftSymbolEncoded; } virtual bool
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/ImageTree.hxx |7 +++ vcl/inc/implimagetree.hxx |7 +++ vcl/source/image/ImageTree.cxx |5 ++ vcl/source/image/ImplImageTree.cxx | 12 +- vcl/unx/gtk3/gtkinst.cxx | 67 ++--- 5 files changed, 92 insertions(+), 6 deletions(-) New commits: commit 397f5daa850e59f0f4d3881cb99d110b50e34e3d Author: Caolán McNamara AuthorDate: Wed Nov 9 21:30:34 2022 + Commit: Caolán McNamara CommitDate: Thu Nov 10 09:40:47 2022 +0100 tdf#151898 if svgs are used in hidpi get a high quality GtkImage this gets nice sidebar icons in this case as far as I can see only gtk_image_new_from_file (or gtk_image_new_from_resource) can support the use of a scaleable input format to create a hidpi GtkImage, rather than an upscaled lodpi one so forced to go via a file here Change-Id: I665cd5be2c87f6fe8e264640be228263cdfc1fba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142504 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/ImageTree.hxx b/include/vcl/ImageTree.hxx index 85f05d774cd5..4de20d74e935 100644 --- a/include/vcl/ImageTree.hxx +++ b/include/vcl/ImageTree.hxx @@ -43,6 +43,10 @@ namespace com::sun::star::container { class XNameAccess; } +namespace com::sun::star::io { +class XInputStream; +} + class ImplImageTree; class BitmapEx; class SvMemoryStream; @@ -63,6 +67,9 @@ public: VCL_DLLPUBLIC std::shared_ptr getImageStream( OUString const & rName, OUString const & rStyle, OUString const & rLang); +VCL_DLLPUBLIC css::uno::Reference getImageXInputStream(OUString const & rName, +OUString const & rStyle, OUString const & rLang); + VCL_DLLPUBLIC bool loadImage( OUString const & name, OUString const & style, BitmapEx & bitmap, bool localized, diff --git a/vcl/inc/implimagetree.hxx b/vcl/inc/implimagetree.hxx index d02e5652971f..beecb233e1d9 100644 --- a/vcl/inc/implimagetree.hxx +++ b/vcl/inc/implimagetree.hxx @@ -37,6 +37,10 @@ namespace com::sun::star::container { class XNameAccess; } +namespace com::sun::star::io { +class XInputStream; +} + struct ImageRequestParameters { OUString msName; @@ -71,6 +75,9 @@ public: OUString getImageUrl( OUString const & name, OUString const & style, OUString const & lang); +css::uno::Reference getImageXInputStream(OUString const & rName, +OUString const & rStyle, OUString const & rLang); + std::shared_ptr getImageStream( OUString const & rName, OUString const & rStyle, OUString const & rLang); diff --git a/vcl/source/image/ImageTree.cxx b/vcl/source/image/ImageTree.cxx index 83e2962cbf8e..fdc47cbfe700 100644 --- a/vcl/source/image/ImageTree.cxx +++ b/vcl/source/image/ImageTree.cxx @@ -34,6 +34,11 @@ std::shared_ptr ImageTree::getImageStream(OUString const & rName return mpImplImageTree->getImageStream(rName, rStyle, rLang); } +css::uno::Reference ImageTree::getImageXInputStream(OUString const & rName, OUString const & rStyle, OUString const & rLang) +{ +return mpImplImageTree->getImageXInputStream(rName, rStyle, rLang); +} + bool ImageTree::loadImage(OUString const & rName, OUString const & rStyle, BitmapEx & rBitmap, bool bLocalized, sal_Int32 nScalePercentage, diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx index 7294d82e74e2..549d0739139b 100644 --- a/vcl/source/image/ImplImageTree.cxx +++ b/vcl/source/image/ImplImageTree.cxx @@ -275,7 +275,7 @@ OUString ImplImageTree::getImageUrl(OUString const & rName, OUString const & rSt return OUString(); } -std::shared_ptr ImplImageTree::getImageStream(OUString const & rName, OUString const & rStyle, OUString const & rLang) +uno::Reference ImplImageTree::getImageXInputStream(OUString const & rName, OUString const & rStyle, OUString const & rLang) { OUString aStyle(rStyle); @@ -300,7 +300,7 @@ std::shared_ptr ImplImageTree::getImageStream(OUString const & r bool ok = rNameAccess->getByName(rPath) >>= aStream; assert(ok); (void)ok; // prevent unused warning in release build -return wrapStream(aStream); +return aStream; } } } @@ -312,6 +312,14 @@ std::shared_ptr ImplImageTree::getImageStream(OUString const & r aStyle = fallbackStyle(aStyle); } +return nullptr; +} + +std::shared_ptr ImplImageTree::getImageStream(OUString const & rName, OUString const & rStyle, OUString const & rLang) +{ +uno::Reference xStream = getImageXInputStream(rName, rStyle, rLang); +if (xStream) +return wrapStream(xStream); return std::shared_ptr(); } diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/outdev.hxx|2 - include/vcl/vcllayout.hxx |2 - vcl/inc/pdf/pdfwriter_impl.hxx|6 ++--- vcl/inc/sallayout.hxx |2 - vcl/source/gdi/pdfwriter_impl.cxx | 43 +- vcl/source/gdi/sallayout.cxx | 10 vcl/source/outdev/map.cxx | 16 +- 7 files changed, 30 insertions(+), 51 deletions(-) New commits: commit e5d59895ef3897141e5df304a8f98776aa70f021 Author: Caolán McNamara AuthorDate: Mon Oct 3 11:14:08 2022 +0100 Commit: Caolán McNamara CommitDate: Mon Oct 3 21:31:44 2022 +0200 tdf#151262 drop subpixel->logic pos asserts which have served their bootstrapping purpose Change-Id: I04b832fde21e4932ed191d972737bee97510f53a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140903 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 928f49c3d614..b1b47d60c1a0 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1709,7 +1709,7 @@ public: SAL_DLLPRIVATE tools::Long ImplLogicHeightToDevicePixel( tools::Long nHeight ) const; SAL_DLLPRIVATE double ImplLogicHeightToDeviceSubPixel(tools::Long nHeight) const; -SAL_DLLPRIVATE Point SubPixelToLogic(const DevicePoint& rDevicePt, bool bCheck) const; +SAL_DLLPRIVATE Point SubPixelToLogic(const DevicePoint& rDevicePt) const; /** Convert device pixels to a width in logical units. diff --git a/include/vcl/vcllayout.hxx b/include/vcl/vcllayout.hxx index 07918325c1a6..b76c789fb16b 100644 --- a/include/vcl/vcllayout.hxx +++ b/include/vcl/vcllayout.hxx @@ -108,8 +108,6 @@ public: virtual SalLayoutGlyphs GetGlyphs() const; -virtual bool IsMultiSalLayout() const; - protected: // used by layout engines SalLayout(); diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx index 9f099f58b6a4..f415475e5441 100644 --- a/vcl/inc/pdf/pdfwriter_impl.hxx +++ b/vcl/inc/pdf/pdfwriter_impl.hxx @@ -855,9 +855,9 @@ i12626 /* emits a text object according to the passed layout */ /* TODO: remove rText as soon as SalLayout will change so that rText is not necessary anymore */ -void drawVerticalGlyphs( const std::vector& rGlyphs, OStringBuffer& rLine, const Point& rAlignOffset, const Matrix3& rRotScale, double fAngle, double fXScale, double fSkew, sal_Int32 nFontHeight, bool bCheck ); -void drawHorizontalGlyphs( const std::vector& rGlyphs, OStringBuffer& rLine, const Point& rAlignOffset, bool bFirst, double fAngle, double fXScale, double fSkew, sal_Int32 nFontHeight, sal_Int32 nPixelFontHeight, bool bCheck ); -void drawLayout( SalLayout& rLayout, const OUString& rText, bool bTextLines, bool bCheckSubPixelToLogic ); +void drawVerticalGlyphs( const std::vector& rGlyphs, OStringBuffer& rLine, const Point& rAlignOffset, const Matrix3& rRotScale, double fAngle, double fXScale, double fSkew, sal_Int32 nFontHeight ); +void drawHorizontalGlyphs( const std::vector& rGlyphs, OStringBuffer& rLine, const Point& rAlignOffset, bool bFirst, double fAngle, double fXScale, double fSkew, sal_Int32 nFontHeight, sal_Int32 nPixelFontHeight ); +void drawLayout( SalLayout& rLayout, const OUString& rText, bool bTextLines ); void drawRelief( SalLayout& rLayout, const OUString& rText, bool bTextLines ); void drawShadow( SalLayout& rLayout, const OUString& rText, bool bTextLines ); diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index 2569ff2d5b62..54b486b36afd 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -85,8 +85,6 @@ public: vcl::text::ImplLayoutArgs& rMultiArgs, const double* pMultiDXArray); -virtual boolIsMultiSalLayout() const override; - virtual ~MultiSalLayout() override; private: diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 2082056940f9..cf5ee9dca0f7 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -6226,7 +6226,7 @@ void PDFWriterImpl::drawRelief( SalLayout& rLayout, const OUString& rText, bool rLayout.DrawOffset() += Point( nOff, nOff ); updateGraphicsState(); -drawLayout( rLayout, rText, bTextLines, false ); +drawLayout( rLayout, rText, bTextLines ); rLayout.DrawOffset() -= Point( nOff, nOff ); setTextLineColor( aTextLineColor ); @@ -6234,7 +6234,7 @@ void PDFWriterImpl::drawRelief( SalLayout& rLayout, const OUString& rText, bool aSetFont.SetColor( aTextColor ); setFont( aSetFont ); updateGraphicsState(); -drawLayout( rLayout, rText, bTextLines, true ); +drawLayout( rLayout, rText, bTextLines ); // clean up the mess pop(); @@ -6262,7 +6262,7 @@ void PDFWriterImpl::drawShadow(
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/vcllayout.hxx |3 +-- vcl/inc/sallayout.hxx |6 ++ vcl/source/gdi/pdfwriter_impl.cxx | 11 +-- vcl/source/gdi/sallayout.cxx |9 ++--- 4 files changed, 10 insertions(+), 19 deletions(-) New commits: commit e6a46b235997c309a926bb0573de625a89b29b8c Author: Khaled Hosny AuthorDate: Fri Sep 30 09:55:52 2022 +0200 Commit: خالد حسني CommitDate: Fri Sep 30 12:37:57 2022 +0200 vcl: No need to get font face from GetNextGlyphs() We can take it from the font instance. Change-Id: I54c507d498c58e271c479b0a615b165345a1c33b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140788 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/include/vcl/vcllayout.hxx b/include/vcl/vcllayout.hxx index 5030ccadb2b4..07918325c1a6 100644 --- a/include/vcl/vcllayout.hxx +++ b/include/vcl/vcllayout.hxx @@ -102,8 +102,7 @@ public: // methods using glyph indexing virtual boolGetNextGlyph(const GlyphItem** pGlyph, DevicePoint& rPos, int& nStart, - const LogicalFontInstance** ppGlyphFont = nullptr, - const vcl::font::PhysicalFontFace** pFallbackFont = nullptr) const = 0; + const LogicalFontInstance** ppGlyphFont = nullptr) const = 0; virtual bool GetOutline(basegfx::B2DPolyPolygonVector&) const; bool GetBoundRect(tools::Rectangle&) const; diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index 970fc6e3b98b..2569ff2d5b62 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -65,8 +65,7 @@ public: DeviceCoordinate FillDXArray(std::vector* pDXArray, const OUString& rStr) const override; voidGetCaretPositions(int nArraySize, sal_Int32* pCaretXArray) const override; boolGetNextGlyph(const GlyphItem** pGlyph, DevicePoint& rPos, int& nStart, - const LogicalFontInstance** ppGlyphFont = nullptr, - const vcl::font::PhysicalFontFace** pFallbackFont = nullptr) const override; + const LogicalFontInstance** ppGlyphFont = nullptr) const override; boolGetOutline(basegfx::B2DPolyPolygonVector&) const override; boolIsKashidaPosValid(int nCharPos, int nNextCharPos) const override; SalLayoutGlyphs GetGlyphs() const final override; @@ -129,8 +128,7 @@ public: { return *m_GlyphItems.GetFont(); } boolGetNextGlyph(const GlyphItem** pGlyph, DevicePoint& rPos, int& nStart, - const LogicalFontInstance** ppGlyphFont = nullptr, - const vcl::font::PhysicalFontFace** pFallbackFont = nullptr) const override; + const LogicalFontInstance** ppGlyphFont = nullptr) const override; const SalLayoutGlyphsImpl& GlyphsImpl() const { return m_GlyphItems; } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index b42cf4a74840..eb63f9cab38f 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -6580,7 +6580,6 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool FontMetric aRefDevFontMetric = GetFontMetric(); const vcl::font::PhysicalFontFace* pDevFont = GetFontInstance()->GetFontFace(); const GlyphItem* pGlyph = nullptr; -const vcl::font::PhysicalFontFace* pFallbackFont = nullptr; const LogicalFontInstance* pGlyphFont = nullptr; // collect the glyphs into a single array @@ -6588,9 +6587,9 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool aGlyphs.reserve( nMaxGlyphs ); // first get all the glyphs and register them; coordinates still in Pixel DevicePoint aPos; -while (rLayout.GetNextGlyph(, aPos, nIndex, , )) +while (rLayout.GetNextGlyph(, aPos, nIndex, )) { -const auto* pFont = pFallbackFont ? pFallbackFont : pDevFont; +const auto* pFace = pGlyphFont->GetFontFace(); aCodeUnits.clear(); @@ -6633,7 +6632,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool // instead. if (!aCodeUnits.empty() && !bUseActualText) { -for (const auto& rSubset : m_aSubsets[pFont].m_aSubsets) +for (const auto& rSubset : m_aSubsets[pFace].m_aSubsets) { const auto& it = rSubset.m_aMapping.find(nGlyphId); if (it != rSubset.m_aMapping.cend() && it->second.codes() != aCodeUnits) @@ -6650,7 +6649,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool sal_uInt8 nMappedGlyph; sal_Int32 nMappedFontObject; -registerGlyph(nGlyphId, pFont, aCodeUnits, nGlyphWidth, nMappedGlyph, nMappedFontObject, pDevFont->IsColorFont()); +
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/vcllayout.hxx |2 ++ vcl/inc/pdf/pdfwriter_impl.hxx|4 ++-- vcl/inc/sallayout.hxx |2 ++ vcl/source/gdi/pdfwriter_impl.cxx | 16 +--- vcl/source/gdi/sallayout.cxx |9 + 5 files changed, 24 insertions(+), 9 deletions(-) New commits: commit 8361df4cf3728ef5e98b6c95a06a4bc829c8fd44 Author: Caolán McNamara AuthorDate: Tue Sep 27 09:02:22 2022 +0100 Commit: Caolán McNamara CommitDate: Tue Sep 27 22:14:35 2022 +0200 tdf#151187 don't check glyph substitute positions to see if they can be perfectly round tripped back to original application provided positions. This may have already served its purpose that there aren't unexpected gotchas and could be retired. Change-Id: Id30d00d0c1649c5d80d43b57887a6e6cfa8fb5be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140673 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/vcllayout.hxx b/include/vcl/vcllayout.hxx index cb88760cd98e..5030ccadb2b4 100644 --- a/include/vcl/vcllayout.hxx +++ b/include/vcl/vcllayout.hxx @@ -109,6 +109,8 @@ public: virtual SalLayoutGlyphs GetGlyphs() const; +virtual bool IsMultiSalLayout() const; + protected: // used by layout engines SalLayout(); diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx index afb80c2aa403..500fd6e89d64 100644 --- a/vcl/inc/pdf/pdfwriter_impl.hxx +++ b/vcl/inc/pdf/pdfwriter_impl.hxx @@ -854,8 +854,8 @@ i12626 /* emits a text object according to the passed layout */ /* TODO: remove rText as soon as SalLayout will change so that rText is not necessary anymore */ -void drawVerticalGlyphs( const std::vector& rGlyphs, OStringBuffer& rLine, const Point& rAlignOffset, const Matrix3& rRotScale, double fAngle, double fXScale, double fSkew, sal_Int32 nFontHeight ); -void drawHorizontalGlyphs( const std::vector& rGlyphs, OStringBuffer& rLine, const Point& rAlignOffset, bool bFirst, double fAngle, double fXScale, double fSkew, sal_Int32 nFontHeight, sal_Int32 nPixelFontHeight ); +void drawVerticalGlyphs( const std::vector& rGlyphs, OStringBuffer& rLine, const Point& rAlignOffset, const Matrix3& rRotScale, double fAngle, double fXScale, double fSkew, sal_Int32 nFontHeight, bool bCheck ); +void drawHorizontalGlyphs( const std::vector& rGlyphs, OStringBuffer& rLine, const Point& rAlignOffset, bool bFirst, double fAngle, double fXScale, double fSkew, sal_Int32 nFontHeight, sal_Int32 nPixelFontHeight, bool bCheck ); void drawLayout( SalLayout& rLayout, const OUString& rText, bool bTextLines, bool bCheckSubPixelToLogic ); void drawRelief( SalLayout& rLayout, const OUString& rText, bool bTextLines ); void drawShadow( SalLayout& rLayout, const OUString& rText, bool bTextLines ); diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index 0ceb8dfa719f..970fc6e3b98b 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -86,6 +86,8 @@ public: vcl::text::ImplLayoutArgs& rMultiArgs, const double* pMultiDXArray); +virtual boolIsMultiSalLayout() const override; + virtual ~MultiSalLayout() override; private: diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 9c3c8a0ab589..b42cf4a74840 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -6281,10 +6281,11 @@ void PDFWriterImpl::drawVerticalGlyphs( double fAngle, double fXScale, double fSkew, -sal_Int32 nFontHeight ) +sal_Int32 nFontHeight, +bool bCheck ) { double nXOffset = 0; -Point aCurPos(SubPixelToLogic(rGlyphs[0].m_aPos, fAngle == 0.0)); +Point aCurPos(SubPixelToLogic(rGlyphs[0].m_aPos, bCheck && fAngle == 0.0)); aCurPos += rAlignOffset; for( size_t i = 0; i < rGlyphs.size(); i++ ) { @@ -6304,7 +6305,7 @@ void PDFWriterImpl::drawVerticalGlyphs( fSkewA = -fSkewB; fSkewB = 0.0; } -aDeltaPos += SubPixelToLogic(DevicePoint(nXOffset / fXScale, 0), false) - SubPixelToLogic(DevicePoint(), true); +aDeltaPos += SubPixelToLogic(DevicePoint(nXOffset / fXScale, 0), false) - SubPixelToLogic(DevicePoint(), bCheck); if( i < rGlyphs.size()-1 ) // #i120627# the text on the Y axis is reversed when export ppt file to PDF format { @@ -6348,7 +6349,8 @@ void PDFWriterImpl::drawHorizontalGlyphs( double fXScale, double fSkew, sal_Int32 nFontHeight, -sal_Int32 nPixelFontHeight +sal_Int32 nPixelFontHeight, +bool bCheck ) { // horizontal (= normal) case @@ -6374,7 +6376,7 @@ void PDFWriterImpl::drawHorizontalGlyphs( for( size_t nRun = 0; nRun < aRunEnds.size(); nRun++ ) { // setup text matrix back
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/fontcharmap.hxx |3 - vcl/inc/impfontcharmap.hxx |7 +- vcl/source/font/PhysicalFontFace.cxx | 14 + vcl/source/font/fontcharmap.cxx | 82 ++- 4 files changed, 44 insertions(+), 62 deletions(-) New commits: commit f4bd06f9928fc01762f9e52c5bebcb3137b39665 Author: Khaled Hosny AuthorDate: Thu Sep 8 17:13:25 2022 +0200 Commit: خالد حسني CommitDate: Sat Sep 10 07:54:29 2022 +0200 vcl: Use vector instead of array for FontCharMap ranges Change-Id: I8846c89d51cc33022f90c3a9c03bc1560497e651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139701 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/include/vcl/fontcharmap.hxx b/include/vcl/fontcharmap.hxx index f7bea49f0f7a..de41b4925683 100644 --- a/include/vcl/fontcharmap.hxx +++ b/include/vcl/fontcharmap.hxx @@ -23,6 +23,7 @@ #include #include #include +#include class ImplFontCharMap; class FontCharMap; @@ -41,7 +42,7 @@ public: /** A new FontCharMap is created based on passed arguments. */ -FontCharMap(bool bSymbolic, const sal_UCS4* pRangeCodes, int nRangeCount); +FontCharMap(bool bSymbolic, std::vector aRangeCodes); virtual ~FontCharMap() override; diff --git a/vcl/inc/impfontcharmap.hxx b/vcl/inc/impfontcharmap.hxx index 1334dc76b262..552cb736020f 100644 --- a/vcl/inc/impfontcharmap.hxx +++ b/vcl/inc/impfontcharmap.hxx @@ -22,6 +22,7 @@ #include #include +#include class ImplFontCharMap; typedef tools::SvRef ImplFontCharMapRef; @@ -30,8 +31,7 @@ class ImplFontCharMap final : public SvRefBase { public: explicitImplFontCharMap( bool bSymbolic, - const sal_uInt32* pRangeCodes, - int nRangeCount); + std::vector aRangeCodes); virtual ~ImplFontCharMap() override; private: @@ -44,8 +44,7 @@ private: boolisDefaultMap() const; private: -const sal_uInt32* mpRangeCodes; // pairs of StartCode/(EndCode+1) -int mnRangeCount; +std::vector maRangeCodes; // pairs of StartCode/(EndCode+1) int mnCharCount; // covered codepoints const bool m_bSymbolic; }; diff --git a/vcl/source/font/PhysicalFontFace.cxx b/vcl/source/font/PhysicalFontFace.cxx index e3a4638b3139..88670f6e0ff6 100644 --- a/vcl/source/font/PhysicalFontFace.cxx +++ b/vcl/source/font/PhysicalFontFace.cxx @@ -249,21 +249,15 @@ FontCharMapRef PhysicalFontFace::GetFontCharMap() const if (hb_set_get_population(pUnicodes)) { // Convert HarfBuzz set to code ranges. -int nRangeCount = 0; +std::vector aRangeCodes; hb_codepoint_t nFirst, nLast = HB_SET_VALUE_INVALID; -while (hb_set_next_range(pUnicodes, , )) -nRangeCount++; - -nLast = HB_SET_VALUE_INVALID; -auto* pRangeCodes(new sal_UCS4[nRangeCount * 2]); -auto* pCP = pRangeCodes; while (hb_set_next_range(pUnicodes, , )) { -*(pCP++) = nFirst; -*(pCP++) = nLast + 1; +aRangeCodes.push_back(nFirst); +aRangeCodes.push_back(nLast + 1); } -mxCharMap = new FontCharMap(bSymbol, pRangeCodes, nRangeCount); +mxCharMap = new FontCharMap(bSymbol, std::move(aRangeCodes)); } hb_set_destroy(pUnicodes); diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx index 70fb51375580..0a7148a663c0 100644 --- a/vcl/source/font/fontcharmap.cxx +++ b/vcl/source/font/fontcharmap.cxx @@ -24,50 +24,36 @@ #include static ImplFontCharMapRef g_pDefaultImplFontCharMap; -const sal_UCS4 aDefaultUnicodeRanges[] = {0x0020,0xD800, 0xE000,0xFFF0}; -const sal_UCS4 aDefaultSymbolRanges[] = {0x0020,0x0100, 0xF020,0xF100}; +const std::vector aDefaultUnicodeRanges = { 0x0020, 0xD800, 0xE000, 0xFFF0 }; +const std::vector aDefaultSymbolRanges = { 0x0020, 0x0100, 0xF020, 0xF100 }; ImplFontCharMap::~ImplFontCharMap() { -if( !isDefaultMap() ) -{ -delete[] mpRangeCodes; -} } -ImplFontCharMap::ImplFontCharMap(bool bSymbolic, const sal_UCS4* pRangeCodes, int nRangeCount) -: mpRangeCodes(pRangeCodes) -, mnRangeCount(nRangeCount) +ImplFontCharMap::ImplFontCharMap(bool bSymbolic, std::vector aRangeCodes) +: maRangeCodes(std::move(aRangeCodes)) , mnCharCount( 0 ) , m_bSymbolic(bSymbolic) { -const sal_UCS4* pRangePtr = mpRangeCodes; -for( int i = mnRangeCount; --i >= 0; pRangePtr += 2 ) +for (size_t i = 0; i < maRangeCodes.size(); i += 2) { -sal_UCS4 cFirst = pRangePtr[0]; -sal_UCS4 cLast = pRangePtr[1]; +sal_UCS4 cFirst = maRangeCodes[i]; +sal_UCS4 cLast = maRangeCodes[i + 1]; mnCharCount += cLast - cFirst; } } ImplFontCharMapRef const & ImplFontCharMap::getDefaultMap( bool
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/fontcharmap.hxx | 17 ++--- vcl/inc/impfontcharmap.hxx |6 +++--- vcl/source/font/PhysicalFontFace.cxx |5 ++--- vcl/source/font/fontcharmap.cxx | 22 +++--- 4 files changed, 14 insertions(+), 36 deletions(-) New commits: commit 88d7aa8ab79b1197191b5eb24a3b67d313797026 Author: Khaled Hosny AuthorDate: Thu Sep 8 16:57:03 2022 +0200 Commit: خالد حسني CommitDate: Thu Sep 8 22:15:25 2022 +0200 vcl: Drop CmapResult indirection Change-Id: I3b1beb5e976a255ef8ecdf8670b1e59547ec5ea4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139700 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/include/vcl/fontcharmap.hxx b/include/vcl/fontcharmap.hxx index d79ffce7be92..f7bea49f0f7a 100644 --- a/include/vcl/fontcharmap.hxx +++ b/include/vcl/fontcharmap.hxx @@ -25,7 +25,6 @@ #include class ImplFontCharMap; -class CmapResult; class FontCharMap; class OutputDevice; @@ -40,9 +39,9 @@ public: **/ FontCharMap(); -/** A new FontCharMap is created based on the CmapResult +/** A new FontCharMap is created based on passed arguments. */ -FontCharMap( const CmapResult& rCR ); +FontCharMap(bool bSymbolic, const sal_UCS4* pRangeCodes, int nRangeCount); virtual ~FontCharMap() override; @@ -154,18 +153,6 @@ private: voidoperator=( const FontCharMap& ) = delete; }; -// CmapResult is a normalized version of the many CMAP formats -class VCL_PLUGIN_PUBLIC CmapResult -{ -public: -explicitCmapResult( bool bSymbolic = false, -const sal_UCS4* pRangeCodes = nullptr, int nRangeCount = 0 ); - -const sal_UCS4* mpRangeCodes; -int mnRangeCount; -boolmbSymbolic; -}; - #endif // INCLUDED_FONTCHARMAP_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/impfontcharmap.hxx b/vcl/inc/impfontcharmap.hxx index 36809cdd986b..b2d47dc9f2b7 100644 --- a/vcl/inc/impfontcharmap.hxx +++ b/vcl/inc/impfontcharmap.hxx @@ -26,12 +26,12 @@ class ImplFontCharMap; typedef tools::SvRef ImplFontCharMapRef; -class CmapResult; - class ImplFontCharMap final : public SvRefBase { public: -explicitImplFontCharMap( const CmapResult& ); +explicitImplFontCharMap( bool bSymbolic, + const sal_uInt32* pRangeCodes, + int nRangeCount); virtual ~ImplFontCharMap() override; private: diff --git a/vcl/source/font/PhysicalFontFace.cxx b/vcl/source/font/PhysicalFontFace.cxx index 1133b0d6a131..9c1a1b586423 100644 --- a/vcl/source/font/PhysicalFontFace.cxx +++ b/vcl/source/font/PhysicalFontFace.cxx @@ -248,7 +248,7 @@ FontCharMapRef PhysicalFontFace::GetFontCharMap() const if (hb_set_get_population(pUnicodes)) { -// Convert HarfBuzz set to CmapResult ranges. +// Convert HarfBuzz set to code ranges. int nRangeCount = 0; hb_codepoint_t nFirst, nLast = HB_SET_VALUE_INVALID; while (hb_set_next_range(pUnicodes, , )) @@ -263,8 +263,7 @@ FontCharMapRef PhysicalFontFace::GetFontCharMap() const *(pCP++) = nLast + 1; } -CmapResult aCmapResult(bSymbol, pRangeCodes, nRangeCount); -mxCharMap = new FontCharMap(aCmapResult); +mxCharMap = new FontCharMap(bSymbol, pRangeCodes, nRangeCount); } hb_set_destroy(pUnicodes); diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx index 5896e786eca0..450521cc6008 100644 --- a/vcl/source/font/fontcharmap.cxx +++ b/vcl/source/font/fontcharmap.cxx @@ -23,13 +23,6 @@ #include #include -CmapResult::CmapResult( bool bSymbolic, -const sal_UCS4* pRangeCodes, int nRangeCount ) -: mpRangeCodes( pRangeCodes) -, mnRangeCount( nRangeCount) -, mbSymbolic( bSymbolic) -{} - static ImplFontCharMapRef g_pDefaultImplFontCharMap; const sal_UCS4 aDefaultUnicodeRanges[] = {0x0020,0xD800, 0xE000,0xFFF0}; const sal_UCS4 aDefaultSymbolRanges[] = {0x0020,0x0100, 0xF020,0xF100}; @@ -42,11 +35,11 @@ ImplFontCharMap::~ImplFontCharMap() } } -ImplFontCharMap::ImplFontCharMap( const CmapResult& rCR ) -: mpRangeCodes( rCR.mpRangeCodes ) -, mnRangeCount( rCR.mnRangeCount ) +ImplFontCharMap::ImplFontCharMap(bool bSymbolic, const sal_UCS4* pRangeCodes, int nRangeCount) +: mpRangeCodes(pRangeCodes) +, mnRangeCount(nRangeCount) , mnCharCount( 0 ) -, m_bSymbolic(rCR.mbSymbolic) +, m_bSymbolic(bSymbolic) { const sal_UCS4* pRangePtr = mpRangeCodes; for( int i = mnRangeCount; --i >= 0; pRangePtr += 2 ) @@ -67,8 +60,7 @@ ImplFontCharMapRef const & ImplFontCharMap::getDefaultMap( bool bSymbols ) nCodesCount = std::size(aDefaultSymbolRanges); } -CmapResult aDefaultCR( bSymbols, pRangeCodes, nCodesCount/2 ); -g_pDefaultImplFontCharMap =
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/fontcharmap.hxx |1 vcl/inc/impfontcharmap.hxx |1 vcl/source/font/fontcharmap.cxx | 284 3 files changed, 286 deletions(-) New commits: commit b59d13a7835b18f4676c3a11e9d70dfa9cb934b5 Author: Khaled Hosny AuthorDate: Thu Sep 8 02:24:36 2022 +0200 Commit: خالد حسني CommitDate: Thu Sep 8 16:32:20 2022 +0200 vcl: Drop now unused ParseCMAP() Change-Id: I2140b7b48ee4cc46a4a6e8e4719f3ce78a600829 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139624 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/include/vcl/fontcharmap.hxx b/include/vcl/fontcharmap.hxx index 4b21142509da..d79ffce7be92 100644 --- a/include/vcl/fontcharmap.hxx +++ b/include/vcl/fontcharmap.hxx @@ -164,7 +164,6 @@ public: const sal_UCS4* mpRangeCodes; int mnRangeCount; boolmbSymbolic; -boolmbRecoded; }; #endif // INCLUDED_FONTCHARMAP_HXX diff --git a/vcl/inc/impfontcharmap.hxx b/vcl/inc/impfontcharmap.hxx index 8a0b0c413d56..36809cdd986b 100644 --- a/vcl/inc/impfontcharmap.hxx +++ b/vcl/inc/impfontcharmap.hxx @@ -51,7 +51,6 @@ private: }; bool VCL_DLLPUBLIC HasSymbolCmap(const char* pRawData, int nRawLength); -bool VCL_DLLPUBLIC ParseCMAP( const unsigned char* pRawData, int nRawLength, CmapResult& ); #endif // INCLUDED_VCL_INC_IMPFONTCHARMAP_HXX diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx index 24f1903f7165..5896e786eca0 100644 --- a/vcl/source/font/fontcharmap.cxx +++ b/vcl/source/font/fontcharmap.cxx @@ -18,20 +18,16 @@ #include #include #include -#include -#include #include #include #include -#include CmapResult::CmapResult( bool bSymbolic, const sal_UCS4* pRangeCodes, int nRangeCount ) : mpRangeCodes( pRangeCodes) , mnRangeCount( nRangeCount) , mbSymbolic( bSymbolic) -, mbRecoded( false) {} static ImplFontCharMapRef g_pDefaultImplFontCharMap; @@ -109,286 +105,6 @@ bool HasSymbolCmap(const char* pCmap, int nLength) return false; } -static unsigned GetUInt( const unsigned char* p ) { return((p[0]<<24)+(p[1]<<16)+(p[2]<<8)+p[3]);} -static unsigned GetUShort( const unsigned char* p ){ return((p[0]<<8) | p[1]);} - -// TODO: move CMAP parsing directly into the ImplFontCharMap class -bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult ) -{ -rResult.mpRangeCodes = nullptr; -rResult.mnRangeCount = 0; -rResult.mbRecoded= false; -rResult.mbSymbolic = false; - -// parse the table header and check for validity -if( !pCmap || (nLength < 24) ) -return false; - -if( GetUShort( pCmap ) != 0x ) // simple check for CMAP corruption -return false; - -int nSubTables = GetUShort( pCmap + 2 ); -if( (nSubTables <= 0) || (nSubTables > (nLength - 24) / 8) ) -return false; - -// find the most interesting subtable in the CMAP -rtl_TextEncoding eRecodeFrom = RTL_TEXTENCODING_UNICODE; -int nOffset = 0; -int nFormat = -1; -int nBestVal = 0; -for( const unsigned char* p = pCmap + 4; --nSubTables >= 0; p += 8 ) -{ -int nPlatform = GetUShort( p ); -int nEncoding = GetUShort( p+2 ); -int nPlatformEncoding = (nPlatform << 8) + nEncoding; - -int nValue; -rtl_TextEncoding eTmpEncoding = RTL_TEXTENCODING_UNICODE; -switch( nPlatformEncoding ) -{ -case 0x000: nValue = 20; break; // Unicode 1.0 -case 0x001: nValue = 21; break; // Unicode 1.1 -case 0x002: nValue = 22; break; // iso10646_1993 -case 0x003: nValue = 23; break; // UCS-2 -case 0x004: nValue = 24; break; // UCS-4 -case 0x100: nValue = 22; break; // Mac Unicode<2.0 -case 0x103: nValue = 23; break; // Mac Unicode>2.0 -case 0x300: nValue = 5; rResult.mbSymbolic = true; break; // Win Symbol -case 0x301: nValue = 28; break; // Win UCS-2 -case 0x30A: nValue = 29; break; // Win-UCS-4 -case 0x302: nValue = 11; eTmpEncoding = RTL_TEXTENCODING_SHIFT_JIS; break; -case 0x303: nValue = 12; eTmpEncoding = RTL_TEXTENCODING_GB_18030; break; -case 0x304: nValue = 11; eTmpEncoding = RTL_TEXTENCODING_BIG5; break; -case 0x305: nValue = 11; eTmpEncoding = RTL_TEXTENCODING_MS_949; break; -case 0x306: nValue = 11; eTmpEncoding = RTL_TEXTENCODING_MS_1361; break; -default:nValue = 0; break; -} - -if( nValue <= 0 ) // ignore unknown encodings -continue; - -int nTmpOffset = GetUInt( p+4 ); - -
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/fontcharmap.hxx |2 vcl/inc/impfontcharmap.hxx |2 vcl/source/font/fontcharmap.cxx | 121 +--- 3 files changed, 4 insertions(+), 121 deletions(-) New commits: commit 10ac07e03276889a68ebc9abc9bd14e88b49a27c Author: Khaled Hosny AuthorDate: Wed Sep 7 17:07:52 2022 +0200 Commit: خالد حسني CommitDate: Thu Sep 8 03:35:25 2022 +0200 vcl: Drop now unused FontCharMap::GetGlyphIndex() Change-Id: Icf687d09c2d25a3d578faf7ae574b3e655b8540f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139600 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/include/vcl/fontcharmap.hxx b/include/vcl/fontcharmap.hxx index ae4735376e14..4b21142509da 100644 --- a/include/vcl/fontcharmap.hxx +++ b/include/vcl/fontcharmap.hxx @@ -162,8 +162,6 @@ public: const sal_UCS4* pRangeCodes = nullptr, int nRangeCount = 0 ); const sal_UCS4* mpRangeCodes; -const int* mpStartGlyphs; -const sal_uInt16* mpGlyphIds; int mnRangeCount; boolmbSymbolic; boolmbRecoded; diff --git a/vcl/inc/impfontcharmap.hxx b/vcl/inc/impfontcharmap.hxx index 6ca04b9f3111..8a8428d7e34e 100644 --- a/vcl/inc/impfontcharmap.hxx +++ b/vcl/inc/impfontcharmap.hxx @@ -45,8 +45,6 @@ private: private: const sal_uInt32* mpRangeCodes; // pairs of StartCode/(EndCode+1) -const int* mpStartGlyphs;// range-specific mapper to glyphs -const sal_uInt16* mpGlyphIds; // individual glyphid mappings int mnRangeCount; int mnCharCount; // covered codepoints const bool m_bSymbolic; diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx index d1d022c26eed..cb42e3b9620c 100644 --- a/vcl/source/font/fontcharmap.cxx +++ b/vcl/source/font/fontcharmap.cxx @@ -29,8 +29,6 @@ CmapResult::CmapResult( bool bSymbolic, const sal_UCS4* pRangeCodes, int nRangeCount ) : mpRangeCodes( pRangeCodes) -, mpStartGlyphs( nullptr) -, mpGlyphIds( nullptr) , mnRangeCount( nRangeCount) , mbSymbolic( bSymbolic) , mbRecoded( false) @@ -45,15 +43,11 @@ ImplFontCharMap::~ImplFontCharMap() if( !isDefaultMap() ) { delete[] mpRangeCodes; -delete[] mpStartGlyphs; -delete[] mpGlyphIds; } } ImplFontCharMap::ImplFontCharMap( const CmapResult& rCR ) : mpRangeCodes( rCR.mpRangeCodes ) -, mpStartGlyphs( rCR.mpStartGlyphs ) -, mpGlyphIds( rCR.mpGlyphIds ) , mnRangeCount( rCR.mnRangeCount ) , mnCharCount( 0 ) , m_bSymbolic(rCR.mbSymbolic) @@ -91,14 +85,11 @@ bool ImplFontCharMap::isDefaultMap() const static unsigned GetUInt( const unsigned char* p ) { return((p[0]<<24)+(p[1]<<16)+(p[2]<<8)+p[3]);} static unsigned GetUShort( const unsigned char* p ){ return((p[0]<<8) | p[1]);} -static int GetSShort( const unsigned char* p ){ return static_cast((p[0]<<8)|p[1]);} // TODO: move CMAP parsing directly into the ImplFontCharMap class bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult ) { rResult.mpRangeCodes = nullptr; -rResult.mpStartGlyphs= nullptr; -rResult.mpGlyphIds = nullptr; rResult.mnRangeCount = 0; rResult.mbRecoded= false; rResult.mbSymbolic = false; @@ -114,8 +105,6 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult ) if( (nSubTables <= 0) || (nSubTables > (nLength - 24) / 8) ) return false; -const unsigned char* pEndValidArea = pCmap + nLength; - // find the most interesting subtable in the CMAP rtl_TextEncoding eRecodeFrom = RTL_TEXTENCODING_UNICODE; int nOffset = 0; @@ -175,11 +164,6 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult ) // parse the best CMAP subtable int nRangeCount = 0; sal_UCS4* pCodePairs = nullptr; -int* pStartGlyphs = nullptr; - -std::vector aGlyphIdArray; -aGlyphIdArray.reserve( 0x1000 ); -aGlyphIdArray.push_back( 0 ); // format 4, the most common 16bit char mapping table if( (nFormat == 4) && ((nOffset+16) < nLength) ) @@ -207,15 +191,12 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult ) } pCodePairs = new sal_UCS4[ nRangeCount * 2 ]; -pStartGlyphs = new int[ nRangeCount ]; sal_UCS4* pCP = pCodePairs; for( int i = 0; i < nRangeCount; ++i ) { const sal_UCS4 cMinChar = GetUShort( pBeginBase + 2*i ); const sal_UCS4 cMaxChar = GetUShort( pLimitBase + 2*i ); -const int nGlyphDelta = GetSShort( pDeltaBase + 2*i ); -const int nRangeOffset = GetUShort( pOffsetBase + 2*i ); if( cMinChar > cMaxChar ) { // no sane font should trigger this SAL_WARN("vcl.gdi", "Min char should never be more than the max char!");
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/vcllayout.hxx |2 vcl/inc/sallayout.hxx |4 - vcl/source/gdi/CommonSalLayout.cxx | 82 +++-- vcl/source/gdi/sallayout.cxx |9 ++-- vcl/source/outdev/font.cxx | 26 +-- 5 files changed, 54 insertions(+), 69 deletions(-) New commits: commit 5e2b7a656024b621bdeeb6efd977331191b66d9d Author: Khaled Hosny AuthorDate: Fri Aug 12 02:12:04 2022 +0200 Commit: Caolán McNamara CommitDate: Sun Aug 14 21:11:52 2022 +0200 Streamline Kashida validation logic We are asked to validate the position *after* which Kashida will be inserted, but HarfBuzz will tell us which glyph we can insert Kashida *before*. So align both by passing down the position before and after and make the loop iterating over glyph items a lot simpler. As a bonus, the new code allow Kashida insertion across layout change in both sides, old code allowed it only at the start of the layout. Change-Id: I9f632610b92c0f4c512e50456bf7d207175f17ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138168 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/vcllayout.hxx b/include/vcl/vcllayout.hxx index 87d9345f4b9b..cbadb47ee0ba 100644 --- a/include/vcl/vcllayout.hxx +++ b/include/vcl/vcllayout.hxx @@ -92,7 +92,7 @@ public: virtual DeviceCoordinate FillDXArray( std::vector* pDXArray ) const = 0; virtual DeviceCoordinate GetTextWidth() const { return FillDXArray( nullptr ); } virtual voidGetCaretPositions( int nArraySize, sal_Int32* pCaretXArray ) const = 0; -virtual boolIsKashidaPosValid ( int /*nCharPos*/ ) const { return true; } // i60594 +virtual boolIsKashidaPosValid ( int /*nCharPos*/, int /*nNextCharPos*/ ) const = 0; // i60594 // methods using glyph indexing virtual boolGetNextGlyph(const GlyphItem** pGlyph, DevicePoint& rPos, int& nStart, diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index 885de2446db7..b49c1c663ee4 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -68,7 +68,7 @@ public: const LogicalFontInstance** ppGlyphFont = nullptr, const vcl::font::PhysicalFontFace** pFallbackFont = nullptr) const override; boolGetOutline(basegfx::B2DPolyPolygonVector&) const override; -boolIsKashidaPosValid(int nCharPos) const override; +boolIsKashidaPosValid(int nCharPos, int nNextCharPos) const override; SalLayoutGlyphs GetGlyphs() const final override; // used only by OutputDevice::ImplLayout, TODO: make friend @@ -115,7 +115,7 @@ public: voidDrawText(SalGraphics&) const final override; SalLayoutGlyphs GetGlyphs() const final override; -boolIsKashidaPosValid(int nCharPos) const final override; +boolIsKashidaPosValid(int nCharPos, int nNextCharPos) const final override; // used by upper layers DeviceCoordinate GetTextWidth() const final override; diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index da7334352858..b3d63dac30a0 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -719,22 +719,19 @@ void GenericSalLayout::ApplyDXArray(const DC* pDXArray, const sal_Bool* pKashida m_GlyphItems[i].addNewWidth(nDiff); m_GlyphItems[i].adjustLinearPosX(nDelta + nDiff); -// Adjust the X position of the rest of the glyphs in the cluster. size_t j = i; while (j > 0) { --j; -if (!m_GlyphItems[j].IsInCluster()) +if (!(m_GlyphItems[j].IsDiacritic() || m_GlyphItems[j].IsInCluster())) break; -m_GlyphItems[j].adjustLinearPosX(nDelta + nDiff); -} -// Move any non-spacing marks to keep attached to this cluster. -while (j > 0) -{ -if (!m_GlyphItems[j].IsDiacritic()) -break; -m_GlyphItems[j--].adjustLinearPosX(nDiff); +if (m_GlyphItems[j].IsInCluster()) +// Adjust X position of the remainder of the cluster. +m_GlyphItems[j].adjustLinearPosX(nDelta + nDiff); +else +// Move non-spacing marks to keep attached to this cluster. +m_GlyphItems[j].adjustLinearPosX(nDiff); } // This is a Kashida insertion position, mark it. Kashida glyphs @@ -807,56 +804,27 @@ void GenericSalLayout::ApplyDXArray(const DC* pDXArray, const sal_Bool* pKashida } } -bool GenericSalLayout::IsKashidaPosValid(int nCharPos) const +// Kashida will be inserted between nCharPos and nNextCharPos. +bool GenericSalLayout::IsKashidaPosValid(int nCharPos, int
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/toolkit/treelistbox.hxx |6 +++- vcl/inc/salvtables.hxx |4 +-- vcl/source/app/salvtables.cxx | 46 vcl/source/treelist/iconview.cxx|3 ++ vcl/source/treelist/treelistbox.cxx | 18 -- 5 files changed, 36 insertions(+), 41 deletions(-) New commits: commit 0b92cf674cd44bdd2c2cdf8a5d597d4407e34002 Author: Mike Kaganski AuthorDate: Wed Aug 10 13:05:45 2022 +0300 Commit: Mike Kaganski CommitDate: Thu Aug 11 10:43:42 2022 +0200 jsdialog: dump tooltips for IconView entries This required to move the code calling Help::ShowQuickHelp from weld objects into SvTreeListBox::RequestHelp, and have it only request the tooltip text from those objects. Change-Id: I25c97360bbaac4705830a13aa06e0992b68f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138084 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/include/vcl/toolkit/treelistbox.hxx b/include/vcl/toolkit/treelistbox.hxx index 62bee8ea976e..6ef40eb8d826 100644 --- a/include/vcl/toolkit/treelistbox.hxx +++ b/include/vcl/toolkit/treelistbox.hxx @@ -194,7 +194,7 @@ class VCL_DLLPUBLIC SvTreeListBox Link aSelectHdl; Link aDeselectHdl; Link aPopupMenuHdl; -Link aTooltipHdl; +Link aTooltipHdl; Link aCustomRenderHdl; Link aCustomMeasureHdl; @@ -392,6 +392,8 @@ public: SvViewDataItem* GetViewDataItem(SvTreeListEntry const *, SvLBoxItem const *); const SvViewDataItem* GetViewDataItem(const SvTreeListEntry*, const SvLBoxItem*) const; +OUString GetEntryTooltip(SvTreeListEntry* pEntry) const { return aTooltipHdl.Call(pEntry); } + VclPtr GetEditWidget() const; // for UITest bool IsInplaceEditingEnabled() const { return bool(nImpFlags & SvTreeListBoxFlags::EDT_ENABLED); } bool IsEditingActive() const { return bool(nImpFlags & SvTreeListBoxFlags::IN_EDT); } @@ -407,7 +409,7 @@ public: voidSetExpandingHdl(const Link& rNewHdl){aExpandingHdl=rNewHdl;} voidSetExpandedHdl(const Link& rNewHdl){aExpandedHdl=rNewHdl;} void SetPopupMenuHdl(const Link& rLink) { aPopupMenuHdl = rLink; } -void SetTooltipHdl(const Link& rLink) { aTooltipHdl = rLink; } +void SetTooltipHdl(const Link& rLink) { aTooltipHdl = rLink; } void SetCustomRenderHdl(const Link& rLink) { aCustomRenderHdl = rLink; } void SetCustomMeasureHdl(const Link& rLink) { aCustomMeasureHdl = rLink; } diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 17084200955a..642eabd49990 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1396,7 +1396,7 @@ protected: DECL_LINK(VisibleRangeChangedHdl, SvTreeListBox*, void); DECL_LINK(CompareHdl, const SvSortData&, sal_Int32); DECL_LINK(PopupMenuHdl, const CommandEvent&, bool); -DECL_LINK(TooltipHdl, const HelpEvent&, bool); +DECL_LINK(TooltipHdl, SvTreeListEntry*, OUString); DECL_LINK(CustomRenderHdl, svtree_render_args, void); DECL_LINK(CustomMeasureHdl, svtree_measure_args, Size); @@ -1769,7 +1769,7 @@ private: DECL_LINK(DeSelectHdl, SvTreeListBox*, void); DECL_LINK(DoubleClickHdl, SvTreeListBox*, bool); DECL_LINK(CommandHdl, const CommandEvent&, bool); -DECL_LINK(TooltipHdl, const HelpEvent&, bool); +DECL_LINK(TooltipHdl, SvTreeListEntry*, OUString); DECL_LINK(EntryAccessibleDescriptionHdl, SvTreeListEntry*, OUString); public: diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 39713700bd20..3874e76ab79d 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -5214,29 +5214,17 @@ SalInstanceTreeView::~SalInstanceTreeView() m_xTreeView->SetSelectHdl(Link()); m_xTreeView->SetDeselectHdl(Link()); m_xTreeView->SetScrolledHdl(Link()); -m_xTreeView->SetTooltipHdl(Link()); +m_xTreeView->SetTooltipHdl({}); m_xTreeView->SetCustomRenderHdl(Link()); m_xTreeView->SetCustomMeasureHdl(Link()); } -IMPL_LINK(SalInstanceTreeView, TooltipHdl, const HelpEvent&, rHEvt, bool) +IMPL_LINK(SalInstanceTreeView, TooltipHdl, SvTreeListEntry*, pEntry, OUString) { -if (notify_events_disabled()) -return false; -Point aPos(m_xTreeView->ScreenToOutputPixel(rHEvt.GetMousePosPixel())); -SvTreeListEntry* pEntry = m_xTreeView->GetEntry(aPos); -if (pEntry) -{ -SalInstanceTreeIter aIter(pEntry); -OUString aTooltip = signal_query_tooltip(aIter); -if (aTooltip.isEmpty()) -return false; -Size aSize(m_xTreeView->GetOutputSizePixel().Width(), m_xTreeView->GetEntryHeight()); -tools::Rectangle aScreenRect( - m_xTreeView->OutputToScreenPixel(m_xTreeView->GetEntryPosition(pEntry)), aSize); -Help::ShowQuickHelp(m_xTreeView, aScreenRect, aTooltip); -} -return true; +if (pEntry && !notify_events_disabled()) +return
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx | 26 + vcl/inc/salvtables.hxx|2 vcl/source/app/salvtables.cxx | 79 +++ vcl/unx/gtk3/gtkinst.cxx | 119 ++ 4 files changed, 226 insertions(+) New commits: commit cadd2a9ea61464c8da3536b262a09ab50691f8d6 Author: Caolán McNamara AuthorDate: Tue Aug 2 16:44:44 2022 +0100 Commit: Caolán McNamara CommitDate: Wed Aug 3 12:44:59 2022 +0200 allow welding scrollbars individually typically a full ScrolledWindow is probably preferable, but allow individual scrollbars to be used Change-Id: Iab290b387421d7d97d3604e31f528769d822155a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137709 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 11ecec27ee9a..2f5a76cb8bdb 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -2493,6 +2493,31 @@ public: void connect_menu_toggled(const Link& rLink) { m_aToggleMenuHdl = rLink; } }; +class VCL_DLLPUBLIC Scrollbar : virtual public Widget +{ +protected: +Link m_aChangeHdl; + +void signal_adjustment_changed() { m_aChangeHdl.Call(*this); } + +public: +virtual void adjustment_configure(int value, int lower, int upper, int step_increment, + int page_increment, int page_size) += 0; +virtual int adjustment_get_value() const = 0; +virtual void adjustment_set_value(int value) = 0; +virtual int adjustment_get_upper() const = 0; +virtual void adjustment_set_upper(int upper) = 0; +virtual int adjustment_get_page_size() const = 0; +virtual void adjustment_set_page_size(int size) = 0; +virtual void adjustment_set_page_increment(int size) = 0; +virtual void adjustment_set_step_increment(int size) = 0; +virtual int adjustment_get_lower() const = 0; +virtual void adjustment_set_lower(int upper) = 0; + +void connect_adjustment_changed(const Link& rLink) { m_aChangeHdl = rLink; } +}; + class VCL_DLLPUBLIC SizeGroup { public: @@ -2555,6 +2580,7 @@ public: virtual std::unique_ptr weld_menu(const OString& id) = 0; virtual std::unique_ptr weld_popover(const OString& id) = 0; virtual std::unique_ptr weld_toolbar(const OString& id) = 0; +virtual std::unique_ptr weld_scrollbar(const OString& id) = 0; virtual std::unique_ptr create_size_group() = 0; /* return a Dialog suitable to take a screenshot of containing the contents of the .ui file. diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 1fca22d1702b..17084200955a 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -126,6 +126,8 @@ public: virtual std::unique_ptr weld_toolbar(const OString& id) override; +virtual std::unique_ptr weld_scrollbar(const OString& id) override; + virtual std::unique_ptr create_size_group() override; OString get_current_page_help_id() const; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index f3c7f8e8a7a3..2f5d542b0fc5 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2488,6 +2488,79 @@ IMPL_LINK_NOARG(SalInstanceScrolledWindow, HscrollHdl, ScrollBar*, void) m_aOrigHScrollHdl.Call(_xScrolledWindow->getHorzScrollBar()); } +namespace +{ +class SalInstanceScrollbar : public SalInstanceWidget, public virtual weld::Scrollbar +{ +private: +VclPtr m_xScrollBar; +Link m_aOrigScrollHdl; + +DECL_LINK(ScrollHdl, ScrollBar*, void); + +public: +SalInstanceScrollbar(ScrollBar* pScrollbar, SalInstanceBuilder* pBuilder, bool bTakeOwnership) +: SalInstanceWidget(pScrollbar, pBuilder, bTakeOwnership) +, m_xScrollBar(pScrollbar) +{ +m_aOrigScrollHdl = m_xScrollBar->GetScrollHdl(); +m_xScrollBar->SetScrollHdl(LINK(this, SalInstanceScrollbar, ScrollHdl)); +} + +virtual void adjustment_configure(int value, int lower, int upper, int step_increment, + int page_increment, int page_size) override +{ +m_xScrollBar->SetRangeMin(lower); +m_xScrollBar->SetRangeMax(upper); +m_xScrollBar->SetLineSize(step_increment); +m_xScrollBar->SetPageSize(page_increment); +m_xScrollBar->SetThumbPos(value); +m_xScrollBar->SetVisibleSize(page_size); +} + +virtual int adjustment_get_value() const override { return m_xScrollBar->GetThumbPos(); } + +virtual void adjustment_set_value(int value) override +{ +m_xScrollBar->SetThumbPos(value); +m_aOrigScrollHdl.Call(m_xScrollBar.get()); +} + +virtual int adjustment_get_upper() const override { return m_xScrollBar->GetRangeMax(); } + +virtual void adjustment_set_upper(int upper) override { m_xScrollBar->SetRangeMax(upper); } + +virtual int adjustment_get_lower() const override { return
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/metaact.hxx|2 +- vcl/inc/pdf/pdfwriter_impl.hxx |2 +- vcl/source/gdi/metaact.cxx |4 ++-- vcl/source/gdi/pdfwriter_impl.cxx |5 ++--- vcl/unx/generic/print/prtsetup.cxx |5 ++--- vcl/unx/generic/print/prtsetup.hxx |2 +- 6 files changed, 9 insertions(+), 11 deletions(-) New commits: commit 278e97ab0272e9c1975bd7780697067f0b91bd46 Author: Caolán McNamara AuthorDate: Mon Jul 18 09:13:21 2022 +0100 Commit: Caolán McNamara CommitDate: Mon Jul 18 20:19:15 2022 +0200 cid#1507357 Big parameter passed by value and cid#1507358 Big parameter passed by value cid#1507359 Big parameter passed by value Change-Id: I7adb0497e4e8b90683ee644790c4657b8ac75fef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137167 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx index 1719fca6ff6d..37c3db3d9273 100644 --- a/include/vcl/metaact.hxx +++ b/include/vcl/metaact.hxx @@ -1096,7 +1096,7 @@ public: virtual rtl::Reference Clone() const override; MetaWallpaperAction( const tools::Rectangle& rRect, - Wallpaper aPaper ); + const Wallpaper& rPaper ); virtual voidMove( tools::Long nHorzMove, tools::Long nVertMove ) override; virtual voidScale( double fScaleX, double fScaleY ) override; diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx index b72e497446d6..228df387fb6d 100644 --- a/vcl/inc/pdf/pdfwriter_impl.hxx +++ b/vcl/inc/pdf/pdfwriter_impl.hxx @@ -1067,7 +1067,7 @@ i12626 void appendStrokingColor( const Color& rColor, OStringBuffer& rBuffer ); void appendNonStrokingColor( const Color& rColor, OStringBuffer& rBuffer ); public: -PDFWriterImpl( PDFWriter::PDFWriterContext aContext, const css::uno::Reference< css::beans::XMaterialHolder >&, PDFWriter& ); +PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, const css::uno::Reference< css::beans::XMaterialHolder >&, PDFWriter& ); ~PDFWriterImpl() override; void dispose() override; diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index f9d698b420e4..4d6705e39115 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -1289,10 +1289,10 @@ MetaWallpaperAction::~MetaWallpaperAction() {} MetaWallpaperAction::MetaWallpaperAction( const tools::Rectangle& rRect, - Wallpaper aPaper ) : + const Wallpaper& rPaper ) : MetaAction ( MetaActionType::WALLPAPER ), maRect ( rRect ), -maWallpaper (std::move( aPaper )) +maWallpaper ( rPaper ) {} void MetaWallpaperAction::Execute( OutputDevice* pOut ) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 514b0506ac68..ae78eda251e5 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include @@ -1192,7 +1191,7 @@ double PDFPage::getHeight() const return fRet; } -PDFWriterImpl::PDFWriterImpl( PDFWriter::PDFWriterContext aContext, +PDFWriterImpl::PDFWriterImpl( const PDFWriter::PDFWriterContext& rContext, const css::uno::Reference< css::beans::XMaterialHolder >& xEnc, PDFWriter& i_rOuterFace) : VirtualDevice(Application::GetDefaultDevice(), DeviceFormat::DEFAULT, DeviceFormat::NONE, OUTDEV_PDF), @@ -1209,7 +1208,7 @@ PDFWriterImpl::PDFWriterImpl( PDFWriter::PDFWriterContext aContext, m_nSignatureLastByteRangeNoOffset( 0 ), m_nResourceDict( -1 ), m_nFontDictObject( -1 ), -m_aContext(std::move(aContext)), +m_aContext(rContext), m_aFile(m_aContext.URL), m_bOpen(false), m_DocDigest(::comphelper::HashType::MD5), diff --git a/vcl/unx/generic/print/prtsetup.cxx b/vcl/unx/generic/print/prtsetup.cxx index 0ff7366fab6c..56ee475e701e 100644 --- a/vcl/unx/generic/print/prtsetup.cxx +++ b/vcl/unx/generic/print/prtsetup.cxx @@ -22,7 +22,6 @@ #include #include -#include using namespace psp; @@ -68,9 +67,9 @@ void RTSDialog::insertAllPPDValues(weld::ComboBox& rBox, const PPDParser* pParse * RTSDialog */ -RTSDialog::RTSDialog(PrinterInfo aJobData, weld::Window* pParent) +RTSDialog::RTSDialog(const PrinterInfo& rJobData, weld::Window* pParent) : GenericDialogController(pParent, "vcl/ui/printerpropertiesdialog.ui", "PrinterPropertiesDialog") -, m_aJobData(std::move(aJobData)) +, m_aJobData(rJobData) , m_bDataModified(false) , m_xTabControl(m_xBuilder->weld_notebook("tabcontrol")) , m_xOKButton(m_xBuilder->weld_button("ok")) diff --git a/vcl/unx/generic/print/prtsetup.hxx
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/windowstate.hxx |1 + vcl/inc/window.h |2 -- vcl/source/window/syswin.cxx |8 +++- vcl/unx/gtk3/gtkinst.cxx |4 +--- 4 files changed, 5 insertions(+), 10 deletions(-) New commits: commit 2e509b886f1d77ef158579385b55f1f94cfbc710 Author: Jan-Marek Glogowski AuthorDate: Sun Jun 12 17:42:05 2022 +0200 Commit: Jan-Marek Glogowski CommitDate: Fri Jun 17 19:14:05 2022 +0200 Convert ImplWindowStateFromStr to WindowData(str) To have a constructor as the counterpart of the toStr() function. Better then some unrelated independant function. Change-Id: Iba4cb3d400a92704753db6b35d12f2189b23077e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135807 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski diff --git a/include/vcl/windowstate.hxx b/include/vcl/windowstate.hxx index b78162ddf52e..772d5c397f76 100644 --- a/include/vcl/windowstate.hxx +++ b/include/vcl/windowstate.hxx @@ -80,6 +80,7 @@ public: , mnMaximizedHeight(0) { } +WindowData(std::string_view rStr); // serialize values to a string (the original WindowState representation) OString toStr() const; diff --git a/vcl/inc/window.h b/vcl/inc/window.h index 18e1a3e1e417..3021e8bc7b6b 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -433,8 +433,6 @@ bool ImplLOKHandleMouseEvent( const VclPtr& xWindow, MouseNotifyEve void ImplHandleResize( vcl::Window* pWindow, tools::Long nNewWidth, tools::Long nNewHeight ); -VCL_DLLPUBLIC void ImplWindowStateFromStr(vcl::WindowData& rData, std::string_view rStr); - VCL_DLLPUBLIC css::uno::Reference FindFocusedEditableText(css::uno::Reference const&); diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 113b2da02689..5a5baf380e71 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -399,8 +399,9 @@ const Size& SystemWindow::GetMaxOutputSizePixel() const return mpImplData->maMaxOutSize; } -void ImplWindowStateFromStr(vcl::WindowData& rData, std::string_view rStr) +vcl::WindowData::WindowData(std::string_view rStr) { +vcl::WindowData& rData = *this; vcl::WindowDataMask nValidMask = vcl::WindowDataMask::NONE; sal_Int32 nIndex = 0; @@ -826,10 +827,7 @@ void SystemWindow::SetWindowState(std::string_view rStr) { if (rStr.empty()) return; - -vcl::WindowData aData; -ImplWindowStateFromStr( aData, rStr ); -SetWindowState( aData ); +SetWindowState(vcl::WindowData(rStr)); } OString SystemWindow::GetWindowState(vcl::WindowDataMask nMask) const diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index a49e32dc8cfa..6959f80698b0 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -6334,9 +6334,7 @@ public: virtual void set_window_state(const OString& rStr) override { -vcl::WindowData aData; -ImplWindowStateFromStr( aData, rStr ); - +const vcl::WindowData aData(rStr); const auto nMask = aData.mask(); const auto nState = aData.state() & vcl::WindowState::SystemMask;
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |2 +- vcl/inc/salvtables.hxx|2 ++ vcl/source/app/salvtables.cxx | 11 +++ vcl/unx/gtk3/gtkinst.cxx | 12 4 files changed, 26 insertions(+), 1 deletion(-) New commits: commit c8642c0ebe4ca16bc06b1b08f9419e4a1a94ba96 Author: Caolán McNamara AuthorDate: Fri Jun 3 11:10:45 2022 +0100 Commit: Caolán McNamara CommitDate: Fri Jun 3 14:53:34 2022 +0200 allow to dynamically show/hide notebook tabs Change-Id: I19681d9bfcd91e205e684674d1ec8f0058c1eb91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135350 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 528405643716..054b817975bd 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -477,11 +477,11 @@ public: } virtual void set_tab_label_text(const OString& rIdent, const OUString& rLabel) = 0; virtual OUString get_tab_label_text(const OString& rIdent) const = 0; +virtual void set_show_tabs(bool bShow) = 0; virtual int get_n_pages() const = 0; virtual weld::Container* get_page(const OString& rIdent) const = 0; void connect_leave_page(const Link& rLink) { m_aLeavePageHdl = rLink; } - void connect_enter_page(const Link& rLink) { m_aEnterPageHdl = rLink; } }; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 9628744fb087..e7c637e93b96 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1078,6 +1078,8 @@ public: virtual void set_tab_label_text(const OString& rIdent, const OUString& rText) override; +virtual void set_show_tabs(bool bShow) override; + virtual ~SalInstanceNotebook() override; }; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index ba759d0fa3d5..df7d70636ea8 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2569,6 +2569,11 @@ void SalInstanceNotebook::set_tab_label_text(const OString& rIdent, const OUStri return m_xNotebook->SetPageText(m_xNotebook->GetPageId(rIdent), rText); } +void SalInstanceNotebook::set_show_tabs(bool bShow) +{ +m_xNotebook->set_property("show-tabs", OUString::boolean(bShow)); +} + SalInstanceNotebook::~SalInstanceNotebook() { for (auto& rItem : m_aAddedPages) @@ -2692,6 +2697,12 @@ public: return m_xNotebook->GetPageText(rIdent); } +virtual void set_show_tabs(bool /*bShow*/) override +{ +// if someone needs this they will have to to implement it in VerticalTabControl +assert(false && "not implemented"); +} + virtual ~SalInstanceVerticalNotebook() override { m_xNotebook->SetActivatePageHdl(Link()); diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 6536a0b3ffea..efc6c290d02c 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -9101,6 +9101,18 @@ public: } } +virtual void set_show_tabs(bool bShow) override +{ +if (m_bOverFlowBoxActive) +{ +unsplit_notebooks(); +reset_split_data(); +} + +gtk_notebook_set_show_tabs(m_pNotebook, bShow); +gtk_notebook_set_show_tabs(m_pOverFlowNotebook, bShow); +} + virtual void disable_notify_events() override { g_signal_handler_block(m_pNotebook, m_nSwitchPageSignalId);
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/pdfwriter.hxx |2 - vcl/inc/pdf/pdfwriter_impl.hxx|4 +-- vcl/inc/strhelper.hxx |4 +-- vcl/inc/unx/printerjob.hxx|2 - vcl/source/gdi/pdfwriter.cxx |2 - vcl/source/gdi/pdfwriter_impl.cxx |4 +-- vcl/source/helper/strhelper.cxx | 36 +- vcl/unx/generic/print/common_gfx.cxx |5 ++-- vcl/unx/generic/print/printerjob.cxx |4 +-- vcl/unx/generic/printer/ppdparser.cxx |2 - 10 files changed, 34 insertions(+), 31 deletions(-) New commits: commit b90d3d316dd9c720c83180b31f6bbd7003fead78 Author: Noel Grandin AuthorDate: Fri Apr 29 15:30:44 2022 +0200 Commit: Noel Grandin CommitDate: Sun May 1 08:28:35 2022 +0200 use string_view in WhitespaceToSpace Change-Id: I64c63418ca51a09312083dab2432bcca0ea262a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133647 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx index 6e8d68cfcff9..3386086c732d 100644 --- a/include/vcl/pdfwriter.hxx +++ b/include/vcl/pdfwriter.hxx @@ -999,7 +999,7 @@ The following structure describes the permissions used in PDF security @returns the outline item id of the new item */ -sal_Int32 CreateOutlineItem( sal_Int32 nParent, const OUString& rText, sal_Int32 nDestID ); +sal_Int32 CreateOutlineItem( sal_Int32 nParent, std::u16string_view rText, sal_Int32 nDestID ); /** Create a new note on a page diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx index 29d1f598c68d..6326f83755e0 100644 --- a/vcl/inc/pdf/pdfwriter_impl.hxx +++ b/vcl/inc/pdf/pdfwriter_impl.hxx @@ -1240,9 +1240,9 @@ public: void setScreenStream(sal_Int32 nScreenId, const OUString& rURL); // outline -sal_Int32 createOutlineItem( sal_Int32 nParent, const OUString& rText, sal_Int32 nDestID ); +sal_Int32 createOutlineItem( sal_Int32 nParent, std::u16string_view rText, sal_Int32 nDestID ); void setOutlineItemParent( sal_Int32 nItem, sal_Int32 nNewParent ); -void setOutlineItemText( sal_Int32 nItem, const OUString& rText ); +void setOutlineItemText( sal_Int32 nItem, std::u16string_view rText ); void setOutlineItemDest( sal_Int32 nItem, sal_Int32 nDestID ); // notes diff --git a/vcl/inc/strhelper.hxx b/vcl/inc/strhelper.hxx index e5141db475a9..c0cff31afc4f 100644 --- a/vcl/inc/strhelper.hxx +++ b/vcl/inc/strhelper.hxx @@ -35,8 +35,8 @@ namespace psp int GetCommandLineTokenCount(const OUString&); // returns number of tokens (zero if empty or whitespace only) -OUString WhitespaceToSpace( const OUString&, bool bProtect = true ); -OString WhitespaceToSpace(const OString&); +OUString WhitespaceToSpace( std::u16string_view, bool bProtect = true ); +OString WhitespaceToSpace(std::string_view); // returns a string with multiple adjacent occurrences of whitespace // converted to a single space. if bProtect is sal_True (nonzero), then // doublequote, singlequote and singleleftquote protect their respective diff --git a/vcl/inc/unx/printerjob.hxx b/vcl/inc/unx/printerjob.hxx index 4fd99b17b638..47d1c0ac9c96 100644 --- a/vcl/inc/unx/printerjob.hxx +++ b/vcl/inc/unx/printerjob.hxx @@ -111,7 +111,7 @@ public: boolStartJob (const OUString& rFileName, int nMode, const OUString& rJobName, - const OUString& rAppName, + std::u16string_view rAppName, const JobData& rSetupData, PrinterGfx* pGraphics, bool bIsQuickJob diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx index f26f6c31705b..1a8d407c7247 100644 --- a/vcl/source/gdi/pdfwriter.cxx +++ b/vcl/source/gdi/pdfwriter.cxx @@ -378,7 +378,7 @@ void PDFWriter::SetLinkPropertyID( sal_Int32 nLinkId, sal_Int32 nPropertyId ) xImplementation->setLinkPropertyId( nLinkId, nPropertyId ); } -sal_Int32 PDFWriter::CreateOutlineItem( sal_Int32 nParent, const OUString& rText, sal_Int32 nDestID ) +sal_Int32 PDFWriter::CreateOutlineItem( sal_Int32 nParent, std::u16string_view rText, sal_Int32 nDestID ) { return xImplementation->createOutlineItem( nParent, rText, nDestID ); } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index c80e5e1c4e81..e6c73d6b2c39 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -9844,7 +9844,7 @@ void PDFWriterImpl::setLinkPropertyId( sal_Int32 nLinkId, sal_Int32 nPropertyId m_aLinkPropertyMap[ nPropertyId ] = nLinkId; } -sal_Int32 PDFWriterImpl::createOutlineItem( sal_Int32 nParent, const OUString& rText, sal_Int32 nDestID ) +sal_Int32 PDFWriterImpl::createOutlineItem(
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/font.hxx|4 ++ vcl/inc/impfont.hxx |3 ++ vcl/source/font/font.cxx| 54 vcl/source/gdi/impglyphitem.cxx |4 -- 4 files changed, 62 insertions(+), 3 deletions(-) New commits: commit 6d36d7185b025c77db9dcccea1861d37dd6bcc1b Author: Luboš Luňák AuthorDate: Wed Apr 27 11:57:29 2022 +0200 Commit: Luboš Luňák CommitDate: Wed Apr 27 22:45:33 2022 +0200 provide explicit function for hashing vcl::Font It's cleaner than streaming the font and then hashing the result, and it's also faster. Change-Id: I6262e45362d386c21482f1e71be51912f123ee45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133500 Tested-by: Jenkins Reviewed-by: Luboš Luňák diff --git a/include/vcl/font.hxx b/include/vcl/font.hxx index 0f641100eecb..9f910688de1a 100644 --- a/include/vcl/font.hxx +++ b/include/vcl/font.hxx @@ -161,6 +161,10 @@ public: boolIsSameInstance( const Font& ) const; boolEqualIgnoreColor( const Font& ) const; +// Compute value usable as hash. +size_t GetHashValue() const; +size_t GetHashValueIgnoreColor() const; + friend VCL_DLLPUBLIC SvStream& ::ReadFont( SvStream& rIStm, vcl::Font& ); friend VCL_DLLPUBLIC SvStream& ::WriteFont( SvStream& rOStm, const vcl::Font& ); diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx index 2c8ce660ea91..a63e2a27d1c2 100644 --- a/vcl/inc/impfont.hxx +++ b/vcl/inc/impfont.hxx @@ -94,6 +94,9 @@ public: booloperator==( const ImplFont& ) const; boolEqualIgnoreColor( const ImplFont& ) const; +size_t GetHashValue() const; +size_t GetHashValueIgnoreColor() const; + private: friend class vcl::Font; friend SvStream&ReadImplFont( SvStream& rIStm, ImplFont&, tools::Long& ); diff --git a/vcl/source/font/font.cxx b/vcl/source/font/font.cxx index 3387dd196f1f..fe610aac576a 100644 --- a/vcl/source/font/font.cxx +++ b/vcl/source/font/font.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -332,6 +333,16 @@ bool Font::EqualIgnoreColor( const vcl::Font& rFont ) const return mpImplFont->EqualIgnoreColor( *rFont.mpImplFont ); } +size_t Font::GetHashValue() const +{ +return mpImplFont->GetHashValue(); +} + +size_t Font::GetHashValueIgnoreColor() const +{ +return mpImplFont->GetHashValueIgnoreColor(); +} + void Font::Merge( const vcl::Font& rFont ) { if ( !rFont.GetFamilyName().isEmpty() ) @@ -1015,6 +1026,49 @@ bool ImplFont::EqualIgnoreColor( const ImplFont& rOther ) const return true; } +size_t ImplFont::GetHashValue() const +{ +size_t hash = GetHashValueIgnoreColor(); +o3tl::hash_combine( hash, static_cast( maColor )); +o3tl::hash_combine( hash, static_cast( maFillColor )); +return hash; +} + +size_t ImplFont::GetHashValueIgnoreColor() const +{ +size_t hash = 0; + +o3tl::hash_combine( hash, meWeight ); +o3tl::hash_combine( hash, meItalic ); +o3tl::hash_combine( hash, meFamily ); +o3tl::hash_combine( hash, mePitch ); + +o3tl::hash_combine( hash, meCharSet ); +o3tl::hash_combine( hash, maLanguageTag.getLanguageType( false ).get()); +o3tl::hash_combine( hash, maCJKLanguageTag.getLanguageType( false ).get()); +o3tl::hash_combine( hash, meAlign ); + +o3tl::hash_combine( hash, maAverageFontSize.GetHashValue()); +o3tl::hash_combine( hash, mnOrientation.get()); +o3tl::hash_combine( hash, mbVertical ); + +o3tl::hash_combine( hash, maFamilyName ); +o3tl::hash_combine( hash, maStyleName ); + +o3tl::hash_combine( hash, meUnderline ); +o3tl::hash_combine( hash, meOverline ); +o3tl::hash_combine( hash, meStrikeout ); +o3tl::hash_combine( hash, meRelief ); +o3tl::hash_combine( hash, meEmphasisMark ); +o3tl::hash_combine( hash, mbWordLine ); +o3tl::hash_combine( hash, mbOutline ); +o3tl::hash_combine( hash, mbShadow ); +o3tl::hash_combine( hash, meKerning ); +o3tl::hash_combine( hash, mbTransparent ); + +return hash; +} + void ImplFont::AskConfig() { if( mbConfigLookup ) diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx index 0268eb3861c0..83c044ce176c 100644 --- a/vcl/source/gdi/impglyphitem.cxx +++ b/vcl/source/gdi/impglyphitem.cxx @@ -310,9 +310,7 @@ SalLayoutGlyphsCache::CachedGlyphsKey::CachedGlyphsKey(const VclPtr(stream.GetData()), stream.GetSize()); +o3tl::hash_combine(hashValue, font.GetHashValueIgnoreColor()); o3tl::hash_combine(hashValue, mapMode.GetHashValue()); o3tl::hash_combine(hashValue, rtl); o3tl::hash_combine(hashValue, layoutMode);
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/win
include/vcl/salnativewidgets.hxx | 22 -- vcl/inc/toolbarvalue.hxx | 52 ++ vcl/source/gdi/salgdilayout.cxx |1 vcl/source/outdev/nativecontrols.cxx |1 vcl/source/window/dockingarea.cxx |1 vcl/source/window/toolbox.cxx |1 vcl/win/gdi/salnativewidgets-luna.cxx |1 7 files changed, 57 insertions(+), 22 deletions(-) New commits: commit ed007423eb4b6d1560d81317b20f291d81bced28 Author: VaibhavMalik4187 AuthorDate: Wed Apr 20 00:10:15 2022 +0200 Commit: Hossein CommitDate: Wed Apr 20 01:36:42 2022 +0200 tdf#97228 Move ToolbarValue class to separate include file The ToolbarValue class defined in include/vcl/salnativewidgets.hxx was used only by vcl. Therefore, it is now moved to a seperate include file named toolbarvalue.hxx which is inside vcl/inc folder. This header file only contains the definition of the the ToolbarValue class. All the files that references the ToolbarValue class now include toolbarvalue.hxx. Change-Id: I78fe3ceb09892c5d3f720ee3d66111bdcdf48db2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131321 Tested-by: Jenkins Reviewed-by: Hossein diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx index 75c25d3f0fe0..057e05aac151 100644 --- a/include/vcl/salnativewidgets.hxx +++ b/include/vcl/salnativewidgets.hxx @@ -446,28 +446,6 @@ class SAL_DLLPUBLIC_RTTI SpinbuttonValue final : public ImplControlValue SpinbuttonValue & operator =(SpinbuttonValue &&) = delete; // due to ImplControlValue }; -/* Toolbarvalue: - * - * Value container for toolbars detailing the grip position - */ -class ToolbarValue final : public ImplControlValue -{ -public: -ToolbarValue() : ImplControlValue( ControlType::Toolbar, 0 ) -{ mbIsTopDockingArea = false; } -virtual ~ToolbarValue() override; -virtual ToolbarValue* clone() const override; - -ToolbarValue(ToolbarValue const &) = default; -ToolbarValue(ToolbarValue &&) = default; -ToolbarValue & operator =(ToolbarValue const &) = delete; // due to ImplControlValue -ToolbarValue & operator =(ToolbarValue &&) = delete; // due to ImplControlValue - -tools::Rectangle maGripRect; -boolmbIsTopDockingArea; // indicates that this is the top aligned dockingarea -// adjacent to the menubar, only used on Windows -}; - /* MenubarValue: * * Value container for menubars specifying height of adjacent docking area diff --git a/vcl/inc/toolbarvalue.hxx b/vcl/inc/toolbarvalue.hxx new file mode 100644 index ..b2c2d6dcb162 --- /dev/null +++ b/vcl/inc/toolbarvalue.hxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_VCL_INC_TOOLBARVALUE_HXX +#define INCLUDED_VCL_INC_TOOLBARVALUE_HXX + +#include +#include + +/* Toolbarvalue: + * + * Value container for toolbars detailing the grip position + */ +class ToolbarValue final : public ImplControlValue +{ +public: +ToolbarValue() +: ImplControlValue(ControlType::Toolbar, 0) +{ +mbIsTopDockingArea = false; +} +virtual ~ToolbarValue() override; +virtual ToolbarValue* clone() const override; +ToolbarValue(ToolbarValue const&) = default; +ToolbarValue(ToolbarValue&&) = default; +ToolbarValue& operator=(ToolbarValue const&) = delete; // due to ImplControlValue +ToolbarValue& operator=(ToolbarValue&&) = delete; // due to ImplControlValue +tools::Rectangle maGripRect; +// indicates that this is the top aligned dockingarea +// adjacent to the menubar, only used on Windows +bool mbIsTopDockingArea; +}; + +#endif // INCLUDED_VCL_INC_TOOLBARVALUE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 34f54a8ce870..89f9d0321daf 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -32,6 +32,7 @@ #include #include #include
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/glyphitemcache.hxx | 24 -- vcl/inc/impglyphitem.hxx | 33 ++-- vcl/source/gdi/CommonSalLayout.cxx | 12 ++- vcl/source/gdi/impglyphitem.cxx| 144 ++--- vcl/source/gdi/pdfwriter_impl.cxx |2 5 files changed, 190 insertions(+), 25 deletions(-) New commits: commit 6c8dffc19e2a570d5665344dcba6afedd3dc2e15 Author: Luboš Luňák AuthorDate: Fri Apr 8 21:17:58 2022 +0200 Commit: Luboš Luňák CommitDate: Thu Apr 14 08:34:20 2022 +0200 compute subset of glyphs in SalLayoutGlyphsCache (tdf#139604) When OutputDevice::ImplLayout() computes glyphs, the result is always the same for the same string (and font etc.), and if the function is asked to work on just a subset of the string, the returned glyphs are often also a subset of glyphs for the full string. Since e.g. EditEngine breaks text into lines by first laying out a full string and then repeatedly calls the same function for a subset of the string with increasing starting index. So if the full result is cached, it's faster to just make a subset of that, adjust it as necessary and return that, instead of doing a layout again. This requires support from harfbuzz to tell us if it's safe to break at a given position, and HB_GLYPH_FLAG_UNSAFE_TO_BREAK is that (https://harfbuzz.github.io/harfbuzz-hb-buffer.html#hb-glyph-flags-t). I'm keeping the optimization for tdf#144515, as avoiding the extra layout altogether is still useful. Change-Id: I33f70f9af89be79056e464908eac0861f58d274a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132753 Tested-by: Jenkins Reviewed-by: Luboš Luňák diff --git a/include/vcl/glyphitemcache.hxx b/include/vcl/glyphitemcache.hxx index e0ab8aaf1013..ab9ad877059a 100644 --- a/include/vcl/glyphitemcache.hxx +++ b/include/vcl/glyphitemcache.hxx @@ -30,6 +30,8 @@ #include #include +#include + /** A cache for SalLayoutGlyphs objects. @@ -40,16 +42,18 @@ If something more changes, call clear(). class VCL_DLLPUBLIC SalLayoutGlyphsCache final { public: -const SalLayoutGlyphs* -GetLayoutGlyphs(VclPtr outputDevice, const OUString& text, -const vcl::text::TextLayoutCache* layoutCache = nullptr) const +// NOTE: The lifetime of the returned value is guaranteed only until the next call +// to any function in this class. +const SalLayoutGlyphs* GetLayoutGlyphs(VclPtr outputDevice, + const OUString& text, + const vcl::text::TextLayoutCache* layoutCache = nullptr) { return GetLayoutGlyphs(outputDevice, text, 0, text.getLength(), 0, layoutCache); } -const SalLayoutGlyphs* -GetLayoutGlyphs(VclPtr outputDevice, const OUString& text, sal_Int32 nIndex, -sal_Int32 nLen, tools::Long nLogicWidth = 0, -const vcl::text::TextLayoutCache* layoutCache = nullptr) const; +const SalLayoutGlyphs* GetLayoutGlyphs(VclPtr outputDevice, + const OUString& text, sal_Int32 nIndex, sal_Int32 nLen, + tools::Long nLogicWidth = 0, + const vcl::text::TextLayoutCache* layoutCache = nullptr); void clear() { mCachedGlyphs.clear(); } static SalLayoutGlyphsCache* self(); @@ -80,7 +84,11 @@ private: { size_t operator()(const CachedGlyphsKey& key) const { return key.hashValue; } }; -mutable o3tl::lru_map mCachedGlyphs; +typedef o3tl::lru_map GlyphsCache; +GlyphsCache mCachedGlyphs; +// Last temporary glyphs returned (pointer is returned, so the object needs to be kept somewhere). +std::optional mLastTemporaryKey; +SalLayoutGlyphs mLastTemporaryGlyphs; SalLayoutGlyphsCache(const SalLayoutGlyphsCache&) = delete; SalLayoutGlyphsCache& operator=(const SalLayoutGlyphsCache&) = delete; diff --git a/vcl/inc/impglyphitem.hxx b/vcl/inc/impglyphitem.hxx index 7228911a3ed7..e86c2652100a 100644 --- a/vcl/inc/impglyphitem.hxx +++ b/vcl/inc/impglyphitem.hxx @@ -29,7 +29,7 @@ #include "fontinstance.hxx" #include "glyphid.hxx" -enum class GlyphItemFlags : sal_uInt8 +enum class GlyphItemFlags : sal_uInt16 { NONE = 0, IS_IN_CLUSTER = 0x01, @@ -39,11 +39,12 @@ enum class GlyphItemFlags : sal_uInt8 IS_SPACING = 0x10, ALLOW_KASHIDA = 0x20, IS_DROPPED = 0x40, -IS_CLUSTER_START = 0x80 +IS_CLUSTER_START = 0x80, +IS_UNSAFE_TO_BREAK = 0x100 // HB_GLYPH_FLAG_UNSAFE_TO_BREAK from harfbuzz }; namespace o3tl { -template <> struct typed_flags : is_typed_flags +template <> struct typed_flags : is_typed_flags { }; }; @@ -54,22 +55,24 @@ class VCL_DLLPUBLIC GlyphItem sal_Int32 m_nOrigWidth; // original glyph width sal_Int32 m_nCharPos; // index in string
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/font.hxx|1 + vcl/inc/impfont.hxx |1 + vcl/source/font/font.cxx| 21 + vcl/source/gdi/impglyphitem.cxx |7 +-- 4 files changed, 24 insertions(+), 6 deletions(-) New commits: commit 33fe4909e29654faeef7f665f31ff31776ecfeec Author: Luboš Luňák AuthorDate: Fri Apr 8 20:53:07 2022 +0200 Commit: Luboš Luňák CommitDate: Sat Apr 9 16:11:35 2022 +0200 add vcl::Font::EqualIgnoreColor() The color values in vcl::Font are obsolete, and the underlying font is the same regardless of the color. Change-Id: I66801a07092bc189f43bf2b28bc54ead6d20f70e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132747 Tested-by: Jenkins Reviewed-by: Luboš Luňák diff --git a/include/vcl/font.hxx b/include/vcl/font.hxx index ddc98c0223b9..0f641100eecb 100644 --- a/include/vcl/font.hxx +++ b/include/vcl/font.hxx @@ -159,6 +159,7 @@ public: booloperator!=( const Font& rFont ) const { return !(Font::operator==( rFont )); } boolIsSameInstance( const Font& ) const; +boolEqualIgnoreColor( const Font& ) const; friend VCL_DLLPUBLIC SvStream& ::ReadFont( SvStream& rIStm, vcl::Font& ); friend VCL_DLLPUBLIC SvStream& ::WriteFont( SvStream& rOStm, const vcl::Font& ); diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx index dc90f6d48bd5..2c8ce660ea91 100644 --- a/vcl/inc/impfont.hxx +++ b/vcl/inc/impfont.hxx @@ -92,6 +92,7 @@ public: voidSetCalculatedAverageFontWidth(tools::Long nNew) { mnCalculatedAverageFontWidth = nNew; } booloperator==( const ImplFont& ) const; +boolEqualIgnoreColor( const ImplFont& ) const; private: friend class vcl::Font; diff --git a/vcl/source/font/font.cxx b/vcl/source/font/font.cxx index 16678dd61ac7..3387dd196f1f 100644 --- a/vcl/source/font/font.cxx +++ b/vcl/source/font/font.cxx @@ -327,6 +327,11 @@ bool Font::operator==( const vcl::Font& rFont ) const return mpImplFont == rFont.mpImplFont; } +bool Font::EqualIgnoreColor( const vcl::Font& rFont ) const +{ +return mpImplFont->EqualIgnoreColor( *rFont.mpImplFont ); +} + void Font::Merge( const vcl::Font& rFont ) { if ( !rFont.GetFamilyName().isEmpty() ) @@ -960,6 +965,18 @@ ImplFont::ImplFont( const ImplFont& rImplFont ) : {} bool ImplFont::operator==( const ImplFont& rOther ) const +{ +if(!EqualIgnoreColor( rOther )) +return false; + +if( (maColor!= rOther.maColor) +|| (maFillColor!= rOther.maFillColor) ) +return false; + +return true; +} + +bool ImplFont::EqualIgnoreColor( const ImplFont& rOther ) const { // equality tests split up for easier debugging if( (meWeight != rOther.meWeight) @@ -983,10 +1000,6 @@ bool ImplFont::operator==( const ImplFont& rOther ) const || (maStyleName!= rOther.maStyleName) ) return false; -if( (maColor!= rOther.maColor) -|| (maFillColor!= rOther.maFillColor) ) -return false; - if( (meUnderline!= rOther.meUnderline) || (meOverline != rOther.meOverline) || (meStrikeout!= rOther.meStrikeout) diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx index e78d23b68676..130039ed88ee 100644 --- a/vcl/source/gdi/impglyphitem.cxx +++ b/vcl/source/gdi/impglyphitem.cxx @@ -188,8 +188,11 @@ inline bool SalLayoutGlyphsCache::CachedGlyphsKey::operator==(const CachedGlyphs && logicWidth == other.logicWidth && outputDevice == other.outputDevice && rtl == other.rtl && layoutMode == other.layoutMode && digitLanguage == other.digitLanguage - // slower things here - && font == other.font && vcl::text::FastStringCompareEqual()(text, other.text); + // Need to use EqualIgnoreColor, because sometimes the color changes, but it's irrelevant + // for text layout (and also obsolete in vcl::Font). + && font.EqualIgnoreColor(other.font) + && vcl::text::FastStringCompareEqual()(text, other.text); +// Slower things last in the comparison. } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/window.hxx|2 vcl/inc/window.h |2 vcl/source/window/window.cxx |2 vcl/source/window/window2.cxx | 88 +++--- vcl/source/window/winproc.cxx | 16 ++- 5 files changed, 78 insertions(+), 32 deletions(-) New commits: commit 7e7ae7ef1dd4d9c9c84ee0b96cb96f456c8da48e Author: Henry Castro AuthorDate: Thu Jun 24 07:30:15 2021 -0400 Commit: Henry Castro CommitDate: Thu Feb 10 13:04:47 2022 +0100 lok: introduce local mouse tracking Add the term local mouse tracking per frame window (per user) instead of global mouse tracking in the desktop case. Change-Id: I3f8c55fc770b4ac7dea167385586d8639ac4d93b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118856 Tested-by: Szymon Kłos Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/11 Tested-by: Jenkins Reviewed-by: Henry Castro diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index fb87796bdcd3..ac0bfa54ad0a 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1096,6 +1096,8 @@ public: voidSetComponentInterface( css::uno::Reference< css::awt::XWindowPeer > const & xIFace ); +voidSetUseFrameData(bool bUseFrameData); + /// Interface to register for dialog / window tunneling. voidSetLOKNotifier(const vcl::ILibreOfficeKitNotifier* pNotifier, bool bParent = false); const vcl::ILibreOfficeKitNotifier* GetLOKNotifier() const; diff --git a/vcl/inc/window.h b/vcl/inc/window.h index 1c3e2e1c41f9..c932a4d09d51 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -136,6 +136,7 @@ struct ImplFrameData VclPtr mpFocusWin; //< focus window (is also set, when frame doesn't have the focus) VclPtr mpMouseMoveWin; //< last window, where MouseMove() called VclPtr mpMouseDownWin; //< last window, where MouseButtonDown() called +VclPtr mpTrackWin; //< window, that is in tracking mode std::vector > maOwnerDrawList;//< List of system windows with owner draw decoration std::shared_ptr mxFontCollection; //< Font-List for this frame std::shared_ptr mxFontCache; //< Font-Cache for this frame @@ -393,6 +394,7 @@ public: const vcl::ILibreOfficeKitNotifier* mpLOKNotifier; ///< To emit the LOK callbacks eg. for dialog tunneling. vcl::LOKWindowId mnLOKWindowId; ///< ID of this specific window. bool mbLOKParentNotifier; +bool mbUseFrameData; }; namespace vcl diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index bfab65f2fa8a..2072de7e0ed0 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -736,6 +736,7 @@ WindowImpl::WindowImpl( vcl::Window& rWindow, WindowType nType ) mpLOKNotifier = nullptr; mnLOKWindowId = 0; mbLOKParentNotifier = false; +mbUseFrameData = false; } WindowImpl::~WindowImpl() @@ -772,6 +773,7 @@ ImplFrameData::ImplFrameData( vcl::Window *pWindow ) mpFocusWin = nullptr; mpMouseMoveWin = nullptr; mpMouseDownWin = nullptr; +mpTrackWin = nullptr; mxFontCollection = pSVData->maGDIData.mxScreenFontList; mxFontCache= pSVData->maGDIData.mxScreenFontCache; mnFocusId = nullptr; diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 1383bad0888f..bf8973114185 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -241,17 +241,30 @@ IMPL_LINK( Window, ImplTrackTimerHdl, Timer*, pTimer, void ) Tracking( aTEvt ); } +void Window::SetUseFrameData(bool bUseFrameData) +{ +if (mpWindowImpl) +mpWindowImpl->mbUseFrameData = bUseFrameData; +} + void Window::StartTracking( StartTrackingFlags nFlags ) { +if (!mpWindowImpl) +return; + ImplSVData* pSVData = ImplGetSVData(); +VclPtr pTrackWin = mpWindowImpl->mbUseFrameData ? +mpWindowImpl->mpFrameData->mpTrackWin : +pSVData->mpWinData->mpTrackWin; -if ( pSVData->mpWinData->mpTrackWin.get() != this ) +if ( pTrackWin.get() != this ) { -if ( pSVData->mpWinData->mpTrackWin ) -pSVData->mpWinData->mpTrackWin->EndTracking( TrackingEventFlags::Cancel ); +if ( pTrackWin ) +pTrackWin->EndTracking( TrackingEventFlags::Cancel ); } -if ( nFlags & (StartTrackingFlags::ScrollRepeat | StartTrackingFlags::ButtonRepeat) ) +if ( !mpWindowImpl->mbUseFrameData && + (nFlags & (StartTrackingFlags::ScrollRepeat | StartTrackingFlags::ButtonRepeat)) ) { pSVData->mpWinData->mpTrackTimer = new AutoTimer("vcl::Window pSVData->mpWinData->mpTrackTimer"); @@ -263,55 +276,70 @@ void Window::StartTracking(
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/svapp.hxx |3 + vcl/inc/window.h |5 +++ vcl/source/app/svapp.cxx | 68 ++ vcl/source/window/winproc.cxx |4 +- 4 files changed, 78 insertions(+), 2 deletions(-) New commits: commit 2f7a0b81f21f7e383808c2e5f5d532cb50b84376 Author: Henry Castro AuthorDate: Wed Jun 23 08:37:34 2021 -0400 Commit: Henry Castro CommitDate: Tue Feb 8 21:40:04 2022 +0100 lok: introduce Application::LOKHandleMouseEvent Entry point to call the ImplLOKHandleMouseEvent function mainly to process mouse events. Change-Id: I17513643733bf5990d41ab8cf47cdc322ed526ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118846 Tested-by: Szymon Kłos Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117711 Tested-by: Jenkins Reviewed-by: Henry Castro diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 137177bbfbb0..22164ed78d4c 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -741,6 +741,9 @@ public: */ static ImplSVEvent *PostKeyEvent( VclEventId nEvent, vcl::Window *pWin, KeyEvent const * pKeyEvent ); + +static bool LOKHandleMouseEvent( VclEventId nEvent, vcl::Window *pWin, const MouseEvent* pEvent ); + /** Send mouse event @param nEvent Event ID for mouse event diff --git a/vcl/inc/window.h b/vcl/inc/window.h index 050c0558eb7c..1c3e2e1c41f9 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -31,6 +31,7 @@ #include #include #include "windowdev.hxx" +#include "salwtype.hxx" #include #include @@ -93,6 +94,10 @@ bool isEnabledInLayout(const vcl::Window *pWindow); bool ImplWindowFrameProc( vcl::Window* pInst, SalEvent nEvent, const void* pEvent ); +MouseEventModifiers ImplGetMouseMoveMode( SalMouseEvent const * pEvent ); + +MouseEventModifiers ImplGetMouseButtonMode( SalMouseEvent const * pEvent ); + struct ImplWinData { std::optional diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index cc046decdad5..d63b8d34bd82 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -925,6 +925,74 @@ ImplSVEvent* Application::PostGestureEvent(VclEventId nEvent, vcl::Window* pWin, return nEventId; } +bool Application::LOKHandleMouseEvent(VclEventId nEvent, vcl::Window* pWindow, const MouseEvent* pEvent) +{ +bool bSuccess = false; +SalMouseEvent aMouseEvent; + +if (!pWindow) +return false; + +if (!pEvent) +return false; + +aMouseEvent.mnTime = tools::Time::GetSystemTicks(); +aMouseEvent.mnX = pEvent->GetPosPixel().X(); +aMouseEvent.mnY = pEvent->GetPosPixel().Y(); +aMouseEvent.mnCode = pEvent->GetButtons() | pEvent->GetModifier(); + +switch (nEvent) +{ +case VclEventId::WindowMouseMove: +aMouseEvent.mnButton = 0; +bSuccess = ImplLOKHandleMouseEvent(pWindow, MouseNotifyEvent::MOUSEMOVE, false, + aMouseEvent.mnX, aMouseEvent.mnY, + aMouseEvent.mnTime, aMouseEvent.mnCode, + ImplGetMouseMoveMode(), + pEvent->GetClicks()); +break; + +case VclEventId::WindowMouseButtonDown: +aMouseEvent.mnButton = pEvent->GetButtons(); +bSuccess = ImplLOKHandleMouseEvent(pWindow, MouseNotifyEvent::MOUSEBUTTONDOWN, false, + aMouseEvent.mnX, aMouseEvent.mnY, + aMouseEvent.mnTime, +#ifdef MACOSX + aMouseEvent.mnButton | + (aMouseEvent.mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3)), +#else + aMouseEvent.mnButton | + (aMouseEvent.mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)), +#endif + ImplGetMouseButtonMode(), + pEvent->GetClicks()); +break; + +case VclEventId::WindowMouseButtonUp: +aMouseEvent.mnButton = pEvent->GetButtons(); +bSuccess = ImplLOKHandleMouseEvent(pWindow, MouseNotifyEvent::MOUSEBUTTONUP, false, + aMouseEvent.mnX, aMouseEvent.mnY, + aMouseEvent.mnTime, +#ifdef MACOSX + aMouseEvent.mnButton | + (aMouseEvent.mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3)), +#else + aMouseEvent.mnButton | + (aMouseEvent.mnCode &
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/print.hxx |4 --- vcl/inc/printdlg.hxx |3 -- vcl/source/gdi/print3.cxx | 51 - vcl/source/window/printdlg.cxx | 37 - 4 files changed, 39 insertions(+), 56 deletions(-) New commits: commit ddaebfb270c4b52ddebaf678a9352312c75247fa Author: Luboš Luňák AuthorDate: Mon Jan 31 20:27:54 2022 +0100 Commit: Luboš Luňák CommitDate: Tue Feb 1 11:16:43 2022 +0100 fix the orientation combobox in the print dialog Changing the orientation value to anything else than 'Automatic' didn't do anything by default. This was because by default neither isPaperSizeFromUser() nor getPapersizeFromSetup() were set, so PrintDialog::setPaperOrientation() did nothing. It looks to me like 8cbdc6a068ad88fc43a98bd0f88 that introduced it was rather broken (not just this bug, but also e.g. the ugly modifying of the paper sizes by non-const reference from a const function). In fact this whole stuff still looks broken to me, why does it change paper size instead of just setting the orientation? It seems like the orientation gets reset, or maybe the setting was just a band-aid. I don't know how to fix that all though. Change-Id: If5fdf4c47e06f2b0797d27126d21b3451b8334cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129239 Tested-by: Jenkins Reviewed-by: Luboš Luňák diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx index 918c205af65b..e919b8ee234b 100644 --- a/include/vcl/print.hxx +++ b/include/vcl/print.hxx @@ -468,10 +468,8 @@ public: VCL_DLLPRIVATEvoid setReversePrint( bool i_bReverse ); VCL_DLLPRIVATEvoid setPapersizeFromSetup( bool i_bPapersizeFromSetup ); VCL_DLLPRIVATEbool getPapersizeFromSetup() const; -VCL_DLLPRIVATESize& getPaperSizeSetup() const; VCL_DLLPRIVATEvoid setPaperSizeFromUser( Size i_aUserSize ); -VCL_DLLPRIVATESize& getPaperSizeFromUser() const; -VCL_DLLPRIVATEbool isPaperSizeFromUser() const; +VCL_DLLPRIVATEvoid setOrientationFromUser( Orientation eOrientation, bool set ); void setPrinterModified( bool i_bPapersizeFromSetup ); bool getPrinterModified() const; VCL_DLLPRIVATEvoid pushPropertiesToPrinter(); diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx index 21aab3667d4e..5b96417476e0 100644 --- a/vcl/inc/printdlg.hxx +++ b/vcl/inc/printdlg.hxx @@ -231,10 +231,9 @@ namespace vcl void setupPaperSidesBox(); void storeToSettings(); void readFromSettings(); -void setPaperOrientation( Orientation eOrientation ); +void setPaperOrientation( Orientation eOrientation, bool fromUser ); void updateOrientationBox( bool bAutomatic = true ); bool hasOrientationChanged() const; -void checkPaperSize( Size& rPaperSize ); void setPreviewText(); void updatePrinterText(); void checkControlDependencies(); diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index f33d59820caa..aecc43e15e33 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -158,6 +158,7 @@ public: bool mbReversePageOrder; bool mbPapersizeFromSetup; bool mbPapersizeFromUser; +bool mbOrientationFromUser; bool mbPrinterModified; css::view::PrintableState meJobState; @@ -171,6 +172,8 @@ public: Size maDefaultPageSize; // set by user through print dialog SizemaUserPageSize; +// set by user through print dialog +Orientation meUserOrientation; // set by user through printer properties subdialog of printer settings dialog sal_Int32 mnDefaultPaperBin; // Set by user through printer properties subdialog of print dialog. @@ -197,6 +200,7 @@ public: mbReversePageOrder( false ), mbPapersizeFromSetup( false ), mbPapersizeFromUser( false ), +mbOrientationFromUser( false ), mbPrinterModified( false ), meJobState( css::view::PrintableState_JOB_STARTED ), mnDefaultPaperBin( -1 ), @@ -212,15 +216,27 @@ public: } } -const Size& getRealPaperSize( const Size& i_rPageSize, bool bNoNUP ) const +Size
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/outdev.hxx |1 vcl/inc/ImplLayoutArgs.hxx |4 ++- vcl/inc/sallayout.hxx |3 +- vcl/source/gdi/CommonSalLayout.cxx | 14 ++- vcl/source/outdev/map.cxx |8 ++ vcl/source/outdev/text.cxx | 47 ++--- vcl/source/text/ImplLayoutArgs.cxx |6 7 files changed, 62 insertions(+), 21 deletions(-) New commits: commit bb830461f0c22f7efe10de799a6a39b56cc5b4a5 Author: Caolán McNamara AuthorDate: Thu Jan 13 12:12:51 2022 + Commit: Caolán McNamara CommitDate: Thu Jan 13 18:32:28 2022 +0100 keep scaled ResolutionIndependentLayout glyph positions as floating point When rendering in ResolutionIndependentLayout mode keep the scaled glyph positions as floating point all the way down to the renderer Change-Id: I02415f18c26737a886751972f472b499a25c776b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128379 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index ddeafe9f8599..0282ea8458b5 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1699,6 +1699,7 @@ public: SAL_DLLPRIVATE tools::Long ImplLogicWidthToDevicePixel( tools::Long nWidth ) const; SAL_DLLPRIVATE DeviceCoordinate LogicWidthToDeviceCoordinate( tools::Long nWidth ) const; +SAL_DLLPRIVATE double LogicWidthToDeviceFontCoordinate( tools::Long nWidth ) const; /** Convert a logical X coordinate to a device pixel's X coordinate. diff --git a/vcl/inc/ImplLayoutArgs.hxx b/vcl/inc/ImplLayoutArgs.hxx index 865470b7897a..fa5e8005ba00 100644 --- a/vcl/inc/ImplLayoutArgs.hxx +++ b/vcl/inc/ImplLayoutArgs.hxx @@ -35,7 +35,8 @@ public: vcl::text::TextLayoutCache const* m_pTextLayoutCache; // positioning related inputs -const DeviceCoordinate* mpDXArray; // in pixel units +const DeviceCoordinate* mpDXArray; // in integer pixel units +const double* mpAltNaturalDXArray; // in floating point pixel units DeviceCoordinate mnLayoutWidth; // in pixel units Degree10 mnOrientation; // in 0-3600 system @@ -48,6 +49,7 @@ public: void SetLayoutWidth(DeviceCoordinate nWidth); void SetDXArray(const DeviceCoordinate* pDXArray); +void SetAltNaturalDXArray(const double* pDXArray); void SetOrientation(Degree10 nOrientation); void ResetPos(); diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index acd49edfda30..f5ffd0f2e587 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -136,7 +136,8 @@ private: GenericSalLayout( const GenericSalLayout& ) = delete; GenericSalLayout& operator=( const GenericSalLayout& ) = delete; -voidApplyDXArray(const DeviceCoordinate*, SalLayoutFlags nLayoutFlags); +template +voidApplyDXArray(const DC*, SalLayoutFlags nLayoutFlags); voidJustify(DeviceCoordinate nNewWidth); voidApplyAsianKerning(const OUString& rStr); diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index f1cbb149dd33..811849309d67 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -197,7 +197,9 @@ void GenericSalLayout::AdjustLayout(vcl::text::ImplLayoutArgs& rArgs) { SalLayout::AdjustLayout(rArgs); -if (rArgs.mpDXArray) +if (rArgs.mpAltNaturalDXArray) // Used when "TextRenderModeForResolutionIndependentLayout" is set +ApplyDXArray(rArgs.mpAltNaturalDXArray, rArgs.mnFlags); +else if (rArgs.mpDXArray) // Normal case ApplyDXArray(rArgs.mpDXArray, rArgs.mnFlags); else if (rArgs.mnLayoutWidth) Justify(rArgs.mnLayoutWidth); @@ -635,12 +637,12 @@ void GenericSalLayout::GetCharWidths(std::vector& rCharWidths) // * Check the above flag to decide whether to insert Kashidas or not. // * For any RTL glyph that has DX adjustment, insert enough Kashidas to // fill in the added space. - -void GenericSalLayout::ApplyDXArray(const DeviceCoordinate* pDXArray, SalLayoutFlags nLayoutFlags) +template +void GenericSalLayout::ApplyDXArray(const DC* pDXArray, SalLayoutFlags nLayoutFlags) { int nCharCount = mnEndCharPos - mnMinCharPos; std::vector aOldCharWidths; -std::unique_ptr const pNewCharWidths(new DeviceCoordinate[nCharCount]); +std::unique_ptr const pNewCharWidths(new DC[nCharCount]); // Get the natural character widths (i.e. before applying DX adjustments). GetCharWidths(aOldCharWidths); @@ -671,7 +673,7 @@ void GenericSalLayout::ApplyDXArray(const DeviceCoordinate* pDXArray, SalLayoutF std::map pKashidas; // The accumulated difference in X position. -DeviceCoordinate nDelta = 0; +DC nDelta = 0; // Apply the DX adjustments to glyph positions and widths. size_t i = 0; @@ -680,7 +682,7 @@ void
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |2 ++ vcl/inc/salvtables.hxx|2 ++ vcl/source/app/salvtables.cxx | 25 ++--- vcl/unx/gtk3/gtkinst.cxx |5 + 4 files changed, 31 insertions(+), 3 deletions(-) New commits: commit 0f17661e045e3e3732cec6e493cd20ac65dbe451 Author: Caolán McNamara AuthorDate: Fri Dec 10 11:32:23 2021 + Commit: Caolán McNamara CommitDate: Fri Dec 10 14:48:47 2021 +0100 add resize_to_request to popover Change-Id: I4bd549efd934946f355f06645ed816acd370a51d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126634 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index d296f1bbdd4a..40c2fbd86b49 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -2367,6 +2367,8 @@ public: = 0; virtual void popdown() = 0; +virtual void resize_to_request() = 0; + void connect_closed(const Link& rLink) { m_aCloseHdl = rLink; } }; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 37c5930e4933..2340169b193b 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1911,6 +1911,8 @@ public: weld::Placement ePlace = weld::Placement::Under) override; virtual void popdown() override; + +virtual void resize_to_request() override; }; class SalInstanceBox : public SalInstanceContainer, public virtual weld::Box diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index f0a2f9f7a6f4..a35c90fef9a1 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1441,20 +1441,25 @@ css::uno::Reference SalInstanceWindow::GetXWindow() return xWindow; } -void SalInstanceWindow::resize_to_request() +namespace +{ +void resize_to_request(vcl::Window* pWindow) { -if (SystemWindow* pSysWin = dynamic_cast(m_xWindow.get())) +if (SystemWindow* pSysWin = dynamic_cast(pWindow)) { pSysWin->setOptimalLayoutSize(); return; } -if (DockingWindow* pDockWin = dynamic_cast(m_xWindow.get())) +if (DockingWindow* pDockWin = dynamic_cast(pWindow)) { pDockWin->setOptimalLayoutSize(); return; } assert(false && "must be system or docking window"); } +} + +void SalInstanceWindow::resize_to_request() { ::resize_to_request(m_xWindow.get()); } void SalInstanceWindow::set_modal(bool bModal) { m_xWindow->ImplGetFrame()->SetModal(bModal); } @@ -6742,6 +6747,20 @@ void SalInstancePopover::ImplPopDown() void SalInstancePopover::popdown() { ImplPopDown(); } +void SalInstancePopover::resize_to_request() +{ +::resize_to_request(m_xPopover.get()); + +DockingManager* pDockingManager = vcl::Window::GetDockingManager(); +if (pDockingManager->IsInPopupMode(m_xPopover.get())) +{ +Size aSize = m_xPopover->get_preferred_size(); +tools::Rectangle aRect = pDockingManager->GetPosSizePixel(m_xPopover.get()); +pDockingManager->SetPosSizePixel(m_xPopover.get(), aRect.Left(), aRect.Top(), aSize.Width(), + aSize.Height(), PosSizeFlags::Size); +} +} + IMPL_LINK_NOARG(SalInstancePopover, PopupModeEndHdl, FloatingWindow*, void) { signal_closed(); } SalInstanceBuilder::SalInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 1e227e87e1b5..3f554e77c9d2 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -22230,6 +22230,11 @@ public: } } +virtual void resize_to_request() override +{ +// resizing to request is what gtk does automatically +} + virtual ~GtkInstancePopover() override { PopdownAndFlushClosedSignal();
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |4 - vcl/inc/salvtables.hxx|3 vcl/source/app/salvtables.cxx | 11 ++ vcl/unx/gtk3/gtkinst.cxx | 158 +++--- 4 files changed, 130 insertions(+), 46 deletions(-) New commits: commit 04c5aef876dc4dbeff96f772254b6a7edb6d8433 Author: Caolán McNamara AuthorDate: Fri Nov 19 11:45:50 2021 + Commit: Caolán McNamara CommitDate: Fri Nov 19 21:47:54 2021 +0100 add placement to Popover popup_at_rect Change-Id: Iaa12a48f62037dd985d526993a07762b10bd0cee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125474 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index b25e9abe5383..561b256b 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -2358,7 +2358,9 @@ protected: void signal_closed() { m_aCloseHdl.Call(*this); } public: -virtual void popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect) = 0; +virtual void popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect, + Placement ePlace = Placement::Under) += 0; virtual void popdown() = 0; void connect_closed(const Link& rLink) { m_aCloseHdl = rLink; } diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index c97b39df575d..f26950fb42a6 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1903,7 +1903,8 @@ public: ~SalInstancePopover(); -virtual void popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect) override; +virtual void popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect, + weld::Placement ePlace = weld::Placement::Under) override; virtual void popdown() override; }; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 987a9ffe2aeb..e8f51950b04f 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -6698,7 +6698,8 @@ SalInstancePopover::SalInstancePopover(DockingWindow* pPopover, SalInstanceBuild SalInstancePopover::~SalInstancePopover() { signal_closed(); } -void SalInstancePopover::popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect) +void SalInstancePopover::popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect, + weld::Placement ePlace) { SalInstanceWidget* pVclWidget = dynamic_cast(pParent); assert(pVclWidget); @@ -6712,8 +6713,12 @@ void SalInstancePopover::popup_at_rect(weld::Widget* pParent, const tools::Recta aRect.SetRight(aPt.X()); aRect.SetBottom(aPt.Y()); -FloatWinPopupFlags nFlags = FloatWinPopupFlags::Down | FloatWinPopupFlags::GrabFocus -| FloatWinPopupFlags::NoMouseUpClose; +FloatWinPopupFlags nFlags = FloatWinPopupFlags::GrabFocus | FloatWinPopupFlags::NoMouseUpClose; +if (ePlace == weld::Placement::Under) +nFlags = nFlags | FloatWinPopupFlags::Down; +else +nFlags = nFlags | FloatWinPopupFlags::Right; + m_xPopover->EnableDocking(); DockingManager* pDockingManager = vcl::Window::GetDockingManager(); pDockingManager->SetPopupModeEndHdl(m_xPopover, diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 6853ca6728f4..3acdbbd8276e 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -9639,7 +9639,7 @@ void do_ungrab(GtkWidget* pWidget) gdk_seat_ungrab(pSeat); } -GtkPositionType show_menu_older_gtk(GtkWidget* pMenuButton, GtkWindow* pMenu, const GdkRectangle& rAnchor) +GtkPositionType show_menu_older_gtk(GtkWidget* pMenuButton, GtkWindow* pMenu, const GdkRectangle& rAnchor, weld::Placement ePlace) { //place the toplevel just below its launcher button GtkWidget* pToplevel = widget_get_toplevel(pMenuButton); @@ -9652,7 +9652,11 @@ GtkPositionType show_menu_older_gtk(GtkWidget* pMenuButton, GtkWindow* pMenu, co y += absy; gint nButtonHeight = rAnchor.height; -y += nButtonHeight; +gint nButtonWidth = rAnchor.width; +if (ePlace == weld::Placement::Under) +y += nButtonHeight; +else +x += nButtonWidth; gtk_window_group_add_window(gtk_window_get_group(GTK_WINDOW(pToplevel)), pMenu); gtk_window_set_transient_for(pMenu, GTK_WINDOW(pToplevel)); @@ -9673,8 +9677,10 @@ GtkPositionType show_menu_older_gtk(GtkWidget* pMenuButton, GtkWindow* pMenu, co bool bSwapForRTL = SwapForRTL(pMenuButton); if (bSwapForRTL) { -gint nButtonWidth = rAnchor.width; -x += nButtonWidth; +if (ePlace == weld::Placement::Under) +x += nButtonWidth; +else +x -= nButtonWidth; x -= nMenuWidth; } @@ -9684,36 +9690,76 @@ GtkPositionType show_menu_older_gtk(GtkWidget* pMenuButton, GtkWindow* pMenu, co // long menu to know the menu is fully on screen
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/graphicfilter.hxx | 24 +- vcl/inc/bitmaps.hlst | 330 +++--- vcl/inc/graphic/UnoGraphicDescriptor.hxx |2 vcl/source/graphic/UnoGraphicProvider.cxx | 44 ++-- vcl/unx/generic/dtrans/X11_clipboard.hxx |2 vcl/unx/generic/window/salframe.cxx | 96 6 files changed, 249 insertions(+), 249 deletions(-) New commits: commit 31ed4c70b027848710a3dc911ff5a7ac18a97047 Author: Noel Grandin AuthorDate: Fri Nov 19 12:47:56 2021 +0200 Commit: Noel Grandin CommitDate: Fri Nov 19 13:34:45 2021 +0100 loplugin:stringliteraldefine in vcl Change-Id: Id14cc8613fdfb67790efd6c33ee243f6bdb522f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125546 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx index 824c6ae33c3e..b1eba2b141ed 100644 --- a/include/vcl/graphicfilter.hxx +++ b/include/vcl/graphicfilter.hxx @@ -103,18 +103,18 @@ namespace o3tl #define EXP_GIF "SVEGIF" -#define BMP_SHORTNAME u"BMP" -#define GIF_SHORTNAME u"GIF" -#define JPG_SHORTNAME u"JPG" -#define MET_SHORTNAME u"MET" -#define PCT_SHORTNAME u"PCT" -#define PNG_SHORTNAME u"PNG" -#define SVM_SHORTNAME u"SVM" -#define TIF_SHORTNAME u"TIF" -#define WMF_SHORTNAME u"WMF" -#define EMF_SHORTNAME u"EMF" -#define SVG_SHORTNAME u"SVG" -#define PDF_SHORTNAME u"PDF" +inline constexpr OUStringLiteral BMP_SHORTNAME = u"BMP"; +inline constexpr OUStringLiteral GIF_SHORTNAME = u"GIF"; +inline constexpr OUStringLiteral JPG_SHORTNAME = u"JPG"; +inline constexpr OUStringLiteral MET_SHORTNAME = u"MET"; +inline constexpr OUStringLiteral PCT_SHORTNAME = u"PCT"; +inline constexpr OUStringLiteral PNG_SHORTNAME = u"PNG"; +inline constexpr OUStringLiteral SVM_SHORTNAME = u"SVM"; +inline constexpr OUStringLiteral TIF_SHORTNAME = u"TIF"; +inline constexpr OUStringLiteral WMF_SHORTNAME = u"WMF"; +inline constexpr OUStringLiteral EMF_SHORTNAME = u"EMF"; +inline constexpr OUStringLiteral SVG_SHORTNAME = u"SVG"; +inline constexpr OUStringLiteral PDF_SHORTNAME = u"PDF"; // Info class for all supported file formats diff --git a/vcl/inc/bitmaps.hlst b/vcl/inc/bitmaps.hlst index 16daf18fef89..e720456b0688 100644 --- a/vcl/inc/bitmaps.hlst +++ b/vcl/inc/bitmaps.hlst @@ -10,91 +10,91 @@ #ifndef INCLUDED_VCL_INC_BITMAPS_HRC #define INCLUDED_VCL_INC_BITMAPS_HRC -#define SV_RESID_BITMAP_CHECK1 "vcl/res/check1.png" -#define SV_RESID_BITMAP_CHECK2 "vcl/res/check2.png" -#define SV_RESID_BITMAP_CHECK3 "vcl/res/check3.png" -#define SV_RESID_BITMAP_CHECK4 "vcl/res/check4.png" -#define SV_RESID_BITMAP_CHECK5 "vcl/res/check5.png" -#define SV_RESID_BITMAP_CHECK6 "vcl/res/check6.png" -#define SV_RESID_BITMAP_CHECK7 "vcl/res/check7.png" -#define SV_RESID_BITMAP_CHECK8 "vcl/res/check8.png" -#define SV_RESID_BITMAP_CHECK9 "vcl/res/check9.png" -#define SV_RESID_BITMAP_CHECKMONO1 "vcl/res/checkmono1.png" -#define SV_RESID_BITMAP_CHECKMONO2 "vcl/res/checkmono2.png" -#define SV_RESID_BITMAP_CHECKMONO3 "vcl/res/checkmono3.png" -#define SV_RESID_BITMAP_CHECKMONO4 "vcl/res/checkmono4.png" -#define SV_RESID_BITMAP_CHECKMONO5 "vcl/res/checkmono5.png" -#define SV_RESID_BITMAP_CHECKMONO6 "vcl/res/checkmono6.png" -#define SV_RESID_BITMAP_CHECKMONO7 "vcl/res/checkmono7.png" -#define SV_RESID_BITMAP_CHECKMONO8 "vcl/res/checkmono8.png" -#define SV_RESID_BITMAP_CHECKMONO9 "vcl/res/checkmono9.png" -#define SV_RESID_BITMAP_RADIO1 "vcl/res/radio1.png" -#define SV_RESID_BITMAP_RADIO2 "vcl/res/radio2.png" -#define SV_RESID_BITMAP_RADIO3 "vcl/res/radio3.png" -#define SV_RESID_BITMAP_RADIO4 "vcl/res/radio4.png" -#define SV_RESID_BITMAP_RADIO5 "vcl/res/radio5.png" -#define SV_RESID_BITMAP_RADIO6 "vcl/res/radio6.png" -#define SV_RESID_BITMAP_RADIOMONO1 "vcl/res/radiomono1.png" -#define SV_RESID_BITMAP_RADIOMONO2 "vcl/res/radiomono2.png" -#define SV_RESID_BITMAP_RADIOMONO3 "vcl/res/radiomono3.png" -#define SV_RESID_BITMAP_RADIOMONO4 "vcl/res/radiomono4.png" -#define SV_RESID_BITMAP_RADIOMONO5 "vcl/res/radiomono5.png" -#define SV_RESID_BITMAP_RADIOMONO6 "vcl/res/radiomono6.png" - -#define SV_RESID_BITMAP_ERRORBOX "vcl/res/errorbox.png" -#define SV_RESID_BITMAP_QUERYBOX
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx | 10 +- vcl/inc/salvtables.hxx|3 ++- vcl/source/app/salvtables.cxx | 11 --- vcl/unx/gtk3/gtkinst.cxx | 21 +++-- 4 files changed, 38 insertions(+), 7 deletions(-) New commits: commit 6b4b82626a30418c2d566c4fc1ecfe559557bf2b Author: Caolán McNamara AuthorDate: Wed Nov 17 17:00:58 2021 + Commit: Caolán McNamara CommitDate: Wed Nov 17 20:49:22 2021 +0100 allow menu placement either under or at end Change-Id: Id76cbe69464f439eec900bf9b80b0c63d99b6597 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125416 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index df036c8fde1a..b25e9abe5383 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -2277,6 +2277,12 @@ private: virtual void click(const Point& rPos) = 0; }; +enum class Placement +{ +Under, +End +}; + class VCL_DLLPUBLIC Menu { protected: @@ -2285,7 +2291,9 @@ protected: void signal_activate(const OString& rIdent) { m_aActivateHdl.Call(rIdent); } public: -virtual OString popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect) = 0; +virtual OString popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect, + Placement ePlace = Placement::Under) += 0; void connect_activate(const Link& rLink) { m_aActivateHdl = rLink; } diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 57f6149ff7bc..c97b39df575d 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -145,7 +145,8 @@ private: public: SalInstanceMenu(PopupMenu* pMenu, bool bTakeOwnership); -virtual OString popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect) override; +virtual OString popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect, + weld::Placement ePlace = weld::Placement::Under) override; virtual void set_sensitive(const OString& rIdent, bool bSensitive) override; virtual bool get_sensitive(const OString& rIdent) const override; virtual void set_active(const OString& rIdent, bool bActive) override; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 792534a92517..987a9ffe2aeb 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -772,12 +772,17 @@ SalInstanceMenu::SalInstanceMenu(PopupMenu* pMenu, bool bTakeOwnership) m_nLastId = nCount ? pMenu->GetItemId(nCount - 1) : 0; m_xMenu->SetSelectHdl(LINK(this, SalInstanceMenu, SelectMenuHdl)); } -OString SalInstanceMenu::popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect) +OString SalInstanceMenu::popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect, + weld::Placement ePlace) { SalInstanceWidget* pVclWidget = dynamic_cast(pParent); assert(pVclWidget); -m_xMenu->Execute(pVclWidget->getWidget(), rRect, - PopupMenuFlags::ExecuteDown | PopupMenuFlags::NoMouseUpClose); +PopupMenuFlags eFlags = PopupMenuFlags::NoMouseUpClose; +if (ePlace == weld::Placement::Under) +eFlags = eFlags | PopupMenuFlags::ExecuteDown; +else +eFlags = eFlags | PopupMenuFlags::ExecuteRight; +m_xMenu->Execute(pVclWidget->getWidget(), rRect, eFlags); return m_xMenu->GetCurItemIdent(); } void SalInstanceMenu::set_sensitive(const OString& rIdent, bool bSensitive) diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 93035fd27cbb..6ce18a346ac4 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -10718,7 +10718,7 @@ public: #endif } -virtual OString popup_at_rect(weld::Widget* pParent, const tools::Rectangle ) override +virtual OString popup_at_rect(weld::Widget* pParent, const tools::Rectangle , weld::Placement ePlace) override { m_sActivated.clear(); @@ -10743,6 +10743,15 @@ public: GtkWidget* pOrigParent = gtk_widget_get_parent(GTK_WIDGET(m_pMenu)); gtk_widget_set_parent(GTK_WIDGET(m_pMenu), pWidget); gtk_popover_set_pointing_to(GTK_POPOVER(m_pMenu), ); +if (ePlace == weld::Placement::Under) +gtk_popover_set_position(GTK_POPOVER(m_pMenu), GTK_POS_BOTTOM); +else +{ +if (SwapForRTL(pWidget)) +gtk_popover_set_position(GTK_POPOVER(m_pMenu), GTK_POS_LEFT); +else +gtk_popover_set_position(GTK_POPOVER(m_pMenu), GTK_POS_RIGHT); +} gtk_popover_popup(GTK_POPOVER(m_pMenu)); #else gulong nSignalId = g_signal_connect_swapped(G_OBJECT(m_pMenu), "deactivate", G_CALLBACK(g_main_loop_quit), pLoop); @@ -10765,7 +10774,15 @@ public: if (!pTriggerEvent) pTriggerEvent = pKeyEvent; -gtk_menu_popup_at_rect(m_pMenu,
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/outdev.hxx |2 -- vcl/inc/PhysicalFontCollection.hxx |1 - vcl/inc/outdev.h | 13 - vcl/source/gdi/print.cxx |4 vcl/source/gdi/virdev.cxx |1 - vcl/source/outdev/font.cxx |2 -- vcl/source/outdev/outdev.cxx |2 -- 7 files changed, 25 deletions(-) New commits: commit 564e12518632d937cf9e510679f33399851d8a9c Author: Chris Sherlock AuthorDate: Wed Oct 6 16:02:20 2021 +1100 Commit: Mike Kaganski CommitDate: Wed Oct 6 10:11:13 2021 +0200 vcl: remove unused class ImplDeviceFontSizeList mpDeviceFontSizeList is no longer used in OutputDevice, so remove this member variable, and then remove ImplDeviceFontSizeList. Change-Id: I93353909485a9243ae02d44c2adc1c9c4a769cef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123125 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index eb74ae2f248e..f44a9d5e3b70 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -70,7 +70,6 @@ class LogicalFontInstance; struct SystemGraphicsData; class ImplFontCache; class PhysicalFontCollection; -class ImplDeviceFontSizeList; class ImplMultiTextLineInfo; class SalGraphics; class Gradient; @@ -184,7 +183,6 @@ private: GDIMetaFile*mpMetaFile; mutable rtl::Reference mpFontInstance; mutable std::unique_ptr mpFontFaceCollection; -mutable std::unique_ptr mpDeviceFontSizeList; std::vectormaOutDevStateStack; std::unique_ptr mpOutDevData; std::vector< VCLXGraphics* >* mpUnoGraphicsList; diff --git a/vcl/inc/PhysicalFontCollection.hxx b/vcl/inc/PhysicalFontCollection.hxx index ee1fdad285c9..b35d3d1c6f99 100644 --- a/vcl/inc/PhysicalFontCollection.hxx +++ b/vcl/inc/PhysicalFontCollection.hxx @@ -29,7 +29,6 @@ #define MAX_GLYPHFALLBACK 16 -class ImplDeviceFontSizeList; class ImplGlyphFallbackFontSubstitution; class ImplPreMatchFontSubstitution; diff --git a/vcl/inc/outdev.h b/vcl/inc/outdev.h index c9185bcc23fb..c6cf81369ee2 100644 --- a/vcl/inc/outdev.h +++ b/vcl/inc/outdev.h @@ -36,19 +36,6 @@ class VirtualDevice; class PhysicalFontCollection; enum class AddFontSubstituteFlags; -class ImplDeviceFontSizeList -{ -private: -std::vectormaSizeList; - -public: -ImplDeviceFontSizeList() -{ maSizeList.reserve( 32 ); } -voidAdd( int nHeight ) { maSizeList.push_back( nHeight ); } -int Count() const { return maSizeList.size(); } -int Get( int nIndex ) const { return maSizeList[ nIndex ]; } -}; - // nowadays these substitutions are needed for backward compatibility and tight platform integration: // - substitutions from configuration entries (Tools->Options->FontReplacement and/or fontconfig) // - device specific substitutions (e.g. for PS printer builtin fonts) diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index a4d020008f30..981dd6ec76b6 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -556,7 +556,6 @@ void Printer::ImplReleaseFonts() mpFontInstance.clear(); mpFontFaceCollection.reset(); -mpDeviceFontSizeList.reset(); } void Printer::ImplReleaseGraphics(bool bRelease) @@ -923,7 +922,6 @@ void Printer::dispose() // TODO: consolidate duplicate cleanup by Printer and OutputDevice mpFontInstance.clear(); mpFontFaceCollection.reset(); -mpDeviceFontSizeList.reset(); mxFontCache.reset(); // font list deleted by OutputDevice dtor } @@ -1070,7 +1068,6 @@ bool Printer::SetPrinterProps( const Printer* pPrinter ) pSVData->mpDefInst->DestroyInfoPrinter( mpInfoPrinter ); mpFontInstance.clear(); mpFontFaceCollection.reset(); -mpDeviceFontSizeList.reset(); // clean up font list mxFontCache.reset(); mxFontCollection.reset(); @@ -1099,7 +1096,6 @@ bool Printer::SetPrinterProps( const Printer* pPrinter ) mpFontInstance.clear(); mpFontFaceCollection.reset(); -mpDeviceFontSizeList.reset(); mxFontCache.reset(); mxFontCollection.reset(); mbInitFont = true; diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx index fb4f52625c09..9a40f04e2725 100644 --- a/vcl/source/gdi/virdev.cxx +++ b/vcl/source/gdi/virdev.cxx @@ -472,7 +472,6 @@ void VirtualDevice::ImplSetReferenceDevice( RefDevMode i_eRefDevMode, sal_Int32 // => clean up the original font lists before getting new ones mpFontInstance.clear(); mpFontFaceCollection.reset(); -mpDeviceFontSizeList.reset(); // preserve global font lists ImplSVData* pSVData = ImplGetSVData(); diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/win
include/vcl/print.hxx|1 vcl/inc/win/salprn.h | 13 +++ vcl/source/gdi/print.cxx | 15 +--- vcl/win/gdi/salprn.cxx | 55 --- 4 files changed, 46 insertions(+), 38 deletions(-) New commits: commit 1b7c53db87bb67eeb2591fbb186f7ac20eb00c68 Author: Jan-Marek Glogowski AuthorDate: Mon Sep 20 17:55:37 2021 +0200 Commit: Jan-Marek Glogowski CommitDate: Mon Sep 27 11:46:18 2021 +0200 WIN lazy init WinSalInfoPrinter graphics ... 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. Change-Id: I7af0bda19be6810dd8c0ea5b74604381e2047407 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122371 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx index e487e8aa82b5..b6ea7000436c 100644 --- a/include/vcl/print.hxx +++ b/include/vcl/print.hxx @@ -124,6 +124,7 @@ public: protected: virtual boolAcquireGraphics() const override; virtual voidReleaseGraphics( bool bRelease = true ) override; +void ImplReleaseGraphics(bool bRelease = true); virtual voidImplReleaseFonts() override; virtual tools::LongGetGradientStepCount( tools::Long nMinRect ) override; diff --git a/vcl/inc/win/salprn.h b/vcl/inc/win/salprn.h index 209f064fd157..43eaa520c23d 100644 --- a/vcl/inc/win/salprn.h +++ b/vcl/inc/win/salprn.h @@ -40,19 +40,24 @@ struct SalDriverData class WinSalGraphics; -class WinSalInfoPrinter : public SalInfoPrinter +class WinSalInfoPrinter final : public SalInfoPrinter { public: -WinSalGraphics*mpGraphics; // current Printer graphics OUString maDriverName; // printer driver name OUString maDeviceName; // printer device name OUString maPortName; // printer port name -HDCmhDC; // printer hdc -bool mbGraphics; // is Graphics used + +private: +HDC m_hDC;///< printer hdc +WinSalGraphics* m_pGraphics; ///< current Printer graphics +bool m_bGraphics; ///< is Graphics used + public: WinSalInfoPrinter(); virtual ~WinSalInfoPrinter() override; +void setHDC(HDC); + virtual SalGraphics*AcquireGraphics() override; virtual voidReleaseGraphics( SalGraphics* pGraphics ) override; virtual boolSetup( weld::Window* pFrame, ImplJobSetup* pSetupData ) override; diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 36aa93f6ec37..df685efbcb13 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -550,13 +550,7 @@ bool Printer::AcquireGraphics() const void Printer::ImplReleaseFonts() { -#ifdef UNX -// HACK to fix an urgent P1 printing issue fast -// WinSalPrinter does not respect GetGraphics/ReleaseGraphics conventions -// so Printer::mpGraphics often points to a dead WinSalGraphics -// TODO: fix WinSalPrinter's GetGraphics/ReleaseGraphics handling mpGraphics->ReleaseFonts(); -#endif mbNewFont = true; mbInitFont = true; @@ -565,7 +559,7 @@ void Printer::ImplReleaseFonts() mpDeviceFontSizeList.reset(); } -void Printer::ReleaseGraphics( bool bRelease ) +void Printer::ImplReleaseGraphics(bool bRelease) { DBG_TESTSOLARMUTEX(); @@ -618,6 +612,11 @@ void Printer::ReleaseGraphics( bool bRelease ) mpNextGraphics = nullptr; } +void Printer::ReleaseGraphics(bool bRelease) +{ +ImplReleaseGraphics(bRelease); +} + void Printer::ImplInit( SalPrinterQueueInfo* pInfo ) { ImplSVData* pSVData = ImplGetSVData(); @@ -912,7 +911,7 @@ void Printer::dispose() mpPrinterOptions.reset(); -ReleaseGraphics(); +ImplReleaseGraphics(); if ( mpInfoPrinter ) ImplGetSVData()->mpDefInst->DestroyInfoPrinter( mpInfoPrinter ); if ( mpDisplayDev ) diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx index 19e61d08ed03..21e779eb6156 100644 --- a/vcl/win/gdi/salprn.cxx +++ b/vcl/win/gdi/salprn.cxx @@ -1041,16 +1041,7 @@ static bool ImplUpdateSalPrnIC( WinSalInfoPrinter* pPrinter, const ImplJobSetup* if ( !hNewDC ) return false; -if ( pPrinter->mpGraphics ) -{ -assert(pPrinter->mpGraphics->getHDC() == pPrinter->mhDC); -delete pPrinter->mpGraphics; -DeleteDC(pPrinter->mhDC); -} - -pPrinter->mpGraphics = ImplCreateSalPrnGraphics( hNewDC ); -pPrinter->mhDC = hNewDC; - +pPrinter->setHDC(hNewDC); return true;
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/GraphicObject.hxx |3 ++- vcl/inc/unx/gtk/gtkdata.hxx |3 ++- vcl/source/graphic/GraphicObject.cxx |5 +++-- vcl/source/graphic/UnoGraphicProvider.cxx | 28 +++- vcl/source/window/layout.cxx |9 +++-- vcl/source/window/toolbox.cxx | 12 +++- vcl/unx/gtk3/gtkdata.cxx |5 +++-- 7 files changed, 39 insertions(+), 26 deletions(-) New commits: commit c638bcc78cfa3974b7461096b6ac521dfc5e927c Author: Stephan Bergmann AuthorDate: Wed Sep 22 17:15:04 2021 +0200 Commit: Stephan Bergmann CommitDate: Wed Sep 22 18:55:18 2021 +0200 Extend loplugin:stringviewparam to starts/endsWith: vcl Change-Id: Ic208697fd985da223819d203e67325b03028fca5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122469 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/include/vcl/GraphicObject.hxx b/include/vcl/GraphicObject.hxx index 27b50455864a..980f686f6ba9 100644 --- a/include/vcl/GraphicObject.hxx +++ b/include/vcl/GraphicObject.hxx @@ -20,6 +20,7 @@ #pragma once #include +#include #include #include #include @@ -268,7 +269,7 @@ public: voidStopAnimation( const OutputDevice* pOut = nullptr, tools::Long nExtraData = 0 ); -static bool isGraphicObjectUniqueIdURL(OUString const & rURL); +static bool isGraphicObjectUniqueIdURL(std::u16string_view rURL); // create CropScaling information // fWidth, fHeight: object size diff --git a/vcl/inc/unx/gtk/gtkdata.hxx b/vcl/inc/unx/gtk/gtkdata.hxx index 5ca53c368104..185a000e0398 100644 --- a/vcl/inc/unx/gtk/gtkdata.hxx +++ b/vcl/inc/unx/gtk/gtkdata.hxx @@ -39,6 +39,7 @@ #include #include +#include #include namespace com::sun::star::accessibility { class XAccessibleEventListener; } @@ -195,7 +196,7 @@ inline GdkGLContext* surface_create_gl_context(GdkSurface* pSurface) typedef GtkClipboard GdkClipboard; #endif -int getButtonPriority(const OString ); +int getButtonPriority(std::string_view rType); class GtkSalTimer final : public SalTimer { diff --git a/vcl/source/graphic/GraphicObject.cxx b/vcl/source/graphic/GraphicObject.cxx index d6c0963b6c61..96f69b3c37df 100644 --- a/vcl/source/graphic/GraphicObject.cxx +++ b/vcl/source/graphic/GraphicObject.cxx @@ -21,6 +21,7 @@ #include +#include #include #include #include @@ -884,9 +885,9 @@ Graphic GraphicObject::GetTransformedGraphic( const GraphicAttr* pAttr ) const return aGraphic; } -bool GraphicObject::isGraphicObjectUniqueIdURL(OUString const & rURL) +bool GraphicObject::isGraphicObjectUniqueIdURL(std::u16string_view rURL) { -return rURL.startsWith("vnd.sun.star.GraphicObject:"); +return o3tl::starts_with(rURL, u"vnd.sun.star.GraphicObject:"); } // calculate scalings between real image size and logic object size. This diff --git a/vcl/source/graphic/UnoGraphicProvider.cxx b/vcl/source/graphic/UnoGraphicProvider.cxx index c4c77e43064b..058f72830041 100644 --- a/vcl/source/graphic/UnoGraphicProvider.cxx +++ b/vcl/source/graphic/UnoGraphicProvider.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include #include #include #include @@ -45,6 +46,7 @@ #include #include #include +#include #include @@ -81,9 +83,9 @@ protected: private: static css::uno::Reference< css::graphic::XGraphic > implLoadMemory( const OUString& rResourceURL ); -static css::uno::Reference< css::graphic::XGraphic > implLoadRepositoryImage( const OUString& rResourceURL ); +static css::uno::Reference< css::graphic::XGraphic > implLoadRepositoryImage( std::u16string_view rResourceURL ); static css::uno::Reference< css::graphic::XGraphic > implLoadBitmap( const css::uno::Reference< css::awt::XBitmap >& rBitmap ); -static css::uno::Reference< css::graphic::XGraphic > implLoadStandardImage( const OUString& rResourceURL ); +static css::uno::Reference< css::graphic::XGraphic > implLoadStandardImage( std::u16string_view rResourceURL ); }; GraphicProvider::GraphicProvider() @@ -142,15 +144,15 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadMemory( const OUS } -uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadRepositoryImage( const OUString& rResourceURL ) +uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadRepositoryImage( std::u16string_view rResourceURL ) { uno::Reference< ::graphic::XGraphic > xRet; -OUString sPathName; -if( rResourceURL.startsWith("private:graphicrepository/", ) ) +std::u16string_view sPathName; +if( o3tl::starts_with(rResourceURL, u"private:graphicrepository/", ) ) { BitmapEx aBitmap; -if ( vcl::ImageRepository::loadImage( sPathName, aBitmap ) ) +if ( vcl::ImageRepository::loadImage( OUString(sPathName), aBitmap ) ) { xRet =
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/win
include/vcl/outdev.hxx |2 ++ vcl/inc/PhysicalFontCollection.hxx |2 ++ vcl/inc/PhysicalFontFamily.hxx |2 ++ vcl/source/font/PhysicalFontCollection.cxx |2 ++ vcl/source/font/PhysicalFontFamily.cxx |2 ++ vcl/source/gdi/embeddedfontshelper.cxx |2 ++ vcl/source/gdi/print.cxx |2 ++ vcl/source/gdi/virdev.cxx |2 ++ vcl/source/outdev/font.cxx |2 ++ vcl/win/gdi/salfont.cxx|2 ++ 10 files changed, 20 insertions(+) New commits: commit 363d0e7e2875d0f99cf0442353202c96c097f5e2 Author: Chris Sherlock AuthorDate: Thu Sep 16 12:52:07 2021 +1000 Commit: Mike Kaganski CommitDate: Sat Sep 18 05:52:05 2021 +0200 vcl: add sal/config.h in preparation for patch The convention is that we need to add sal/config.h to the start of files. mikekaganski do you want me to add sal/config.h to cxx files as well as headers? chris_wot: rather ask sberg :) <@sberg> chris_wot, always, always as first include, by convention thanks, I'll make sure I do this on any files I touch - if that's OK I have a patch queued to rename ImplDeviceFontList to PhysicalFontFaceCollection, which I am adding a test to. Submitting this patch so I can hopefully one day land this patch. Change-Id: I9d74f850745760774a9f8050023f584cf52dc070 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122167 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 0890da948a0b..b70ad6664038 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -19,6 +19,8 @@ #pragma once +#include + #include #include #include diff --git a/vcl/inc/PhysicalFontCollection.hxx b/vcl/inc/PhysicalFontCollection.hxx index 89d6fdf222e8..38e591600467 100644 --- a/vcl/inc/PhysicalFontCollection.hxx +++ b/vcl/inc/PhysicalFontCollection.hxx @@ -19,6 +19,8 @@ #pragma once +#include + #include #include "fontinstance.hxx" diff --git a/vcl/inc/PhysicalFontFamily.hxx b/vcl/inc/PhysicalFontFamily.hxx index f883d383be54..0137aca3b7c4 100644 --- a/vcl/inc/PhysicalFontFamily.hxx +++ b/vcl/inc/PhysicalFontFamily.hxx @@ -19,6 +19,8 @@ #pragma once +#include + #include #include diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx index f6a693068d34..7161e5b35c49 100644 --- a/vcl/source/font/PhysicalFontCollection.cxx +++ b/vcl/source/font/PhysicalFontCollection.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + #include #include diff --git a/vcl/source/font/PhysicalFontFamily.cxx b/vcl/source/font/PhysicalFontFamily.cxx index d5ab2415b338..cd8634aeb0ed 100644 --- a/vcl/source/font/PhysicalFontFamily.cxx +++ b/vcl/source/font/PhysicalFontFamily.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + #include #include diff --git a/vcl/source/gdi/embeddedfontshelper.cxx b/vcl/source/gdi/embeddedfontshelper.cxx index 1a67603da911..cbe4ceed3454 100644 --- a/vcl/source/gdi/embeddedfontshelper.cxx +++ b/vcl/source/gdi/embeddedfontshelper.cxx @@ -7,6 +7,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include + #include #include #include diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 91e516b67c86..f46d6ed03ec5 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + #include #include #include diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx index bc9f9ffe5838..8f5a1d96f329 100644 --- a/vcl/source/gdi/virdev.cxx +++ b/vcl/source/gdi/virdev.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + #include #include diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 53727e3378cc..4161ea8ce236 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + #include #include #include diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index b65ea0ae69cf..e07680c87dec 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + #include #include
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/win
include/vcl/outdev.hxx |2 +- vcl/inc/PhysicalFontCollection.hxx |2 +- vcl/inc/PhysicalFontFamily.hxx |2 +- vcl/inc/outdev.h |2 +- vcl/source/font/PhysicalFontCollection.cxx |3 +-- vcl/source/gdi/embeddedfontshelper.cxx |2 +- vcl/source/gdi/print.cxx |2 +- vcl/source/gdi/virdev.cxx |2 +- vcl/source/outdev/font.cxx |2 +- vcl/source/outdev/outdev.cxx |2 +- vcl/win/gdi/salfont.cxx|2 +- 11 files changed, 11 insertions(+), 12 deletions(-) New commits: commit fec9c3d6f272d45a73dd4dad390a69e444ffc9e2 Author: Chris Sherlock AuthorDate: Thu Sep 16 12:41:19 2021 +1000 Commit: Mike Kaganski CommitDate: Fri Sep 17 14:10:54 2021 +0200 vcl: update vim modelines in preparation for new change I have a patch queued to rename ImplDeviceFontList to PhysicalFontFaceCollection, which I am adding a test to. Submitting patch to update the modelines in the files that I will change in that patch. Change-Id: I3b0b022cbfa7b05dbfbb5c2d03f6d68128c0598f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122232 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 2839e5c98da5..6e357b077a14 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1909,4 +1909,4 @@ protected: #endif // INCLUDED_VCL_OUTDEV_HXX -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/inc/PhysicalFontCollection.hxx b/vcl/inc/PhysicalFontCollection.hxx index 87b94fe2ce3b..8af07e2883cf 100644 --- a/vcl/inc/PhysicalFontCollection.hxx +++ b/vcl/inc/PhysicalFontCollection.hxx @@ -93,4 +93,4 @@ private: #endif // INCLUDED_VCL_INC_PHYSICALFONTCOLLECTION_HXX -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/inc/PhysicalFontFamily.hxx b/vcl/inc/PhysicalFontFamily.hxx index cd9f3f08e8d1..5c2ae12f24c8 100644 --- a/vcl/inc/PhysicalFontFamily.hxx +++ b/vcl/inc/PhysicalFontFamily.hxx @@ -98,4 +98,4 @@ private: #endif // INCLUDED_VCL_INC_PHYSICALFONTFAMILY_HXX -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/inc/outdev.h b/vcl/inc/outdev.h index df4c2f205182..8746d790eb62 100644 --- a/vcl/inc/outdev.h +++ b/vcl/inc/outdev.h @@ -141,4 +141,4 @@ void ImplFontSubstitute( OUString& rFontName ); #endif // INCLUDED_VCL_INC_OUTDEV_H -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx index 1d047781de4d..f6a693068d34 100644 --- a/vcl/source/font/PhysicalFontCollection.cxx +++ b/vcl/source/font/PhysicalFontCollection.cxx @@ -1263,5 +1263,4 @@ PhysicalFontFamily* PhysicalFontCollection::FindFontFamily( FontSelectPattern& r return pFoundData; } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ - +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/source/gdi/embeddedfontshelper.cxx b/vcl/source/gdi/embeddedfontshelper.cxx index 5664857d3474..1a67603da911 100644 --- a/vcl/source/gdi/embeddedfontshelper.cxx +++ b/vcl/source/gdi/embeddedfontshelper.cxx @@ -329,4 +329,4 @@ OUString EmbeddedFontsHelper::fontFileUrl( std::u16string_view familyName, FontF return ok ? url : ""; } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index ea3d70053978..91e516b67c86 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -1683,4 +1683,4 @@ void Printer::SetSystemTextColor(SystemTextColorFlags, bool) SetTextColor(COL_BLACK); } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx index 5520ce93c073..bc9f9ffe5838 100644 --- a/vcl/source/gdi/virdev.cxx +++ b/vcl/source/gdi/virdev.cxx @@ -510,4 +510,4 @@ tools::Long VirtualDevice::GetFontExtLeading() const return mpFontInstance->mxFontMetric->GetExternalLeading(); } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 06c339dd795c..53727e3378cc 100644 --- a/vcl/source/outdev/font.cxx +++
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/BitmapBuffer.hxx | 12 ++-- include/vcl/GraphicAttributes.hxx | 12 ++-- vcl/inc/accel.hxx |4 ++-- vcl/inc/salwtype.hxx | 12 ++-- vcl/source/app/svapp.cxx | 16 vcl/source/edit/textdat2.hxx |6 +++--- vcl/source/gdi/mapmod.cxx |2 +- 7 files changed, 32 insertions(+), 32 deletions(-) New commits: commit 349e1a7ce141d11432dda730ab8d34ab123117c5 Author: Noel Grandin AuthorDate: Fri Sep 10 20:20:05 2021 +0200 Commit: Noel Grandin CommitDate: Sat Sep 11 12:45:01 2021 +0200 clang:optin.performance.Padding in vcl Excessive padding in 'class ImplAccelEntry' (13 padding bytes, where 5 is optimal). Excessive padding in 'struct SalQueryCharPositionEvent' (14 padding bytes, where 6 is optimal). Excessive padding in 'struct SalFrameState' (8 padding bytes, where 0 is optimal). Excessive padding in 'struct BitmapBuffer' (10 padding bytes, where 2 is optimal). Excessive padding in 'class GraphicAttr' (10 padding bytes, where 2 is optimal). Excessive padding in 'struct ImplPostEventData' (12 padding bytes, where 4 is optimal). Excessive padding in 'class TETextPortion' (10 padding bytes, where 2 is optimal). Excessive padding in 'struct MapMode::ImplMapMode' (11 padding bytes, where 3 is optimal). Change-Id: I41801e0fd676981cc9f386d814fe2f0ea670a673 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121925 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/vcl/BitmapBuffer.hxx b/include/vcl/BitmapBuffer.hxx index d67e42ac6cad..54efeea5e1bc 100644 --- a/include/vcl/BitmapBuffer.hxx +++ b/include/vcl/BitmapBuffer.hxx @@ -35,14 +35,14 @@ struct SalTwoRect; struct VCL_DLLPUBLIC BitmapBuffer { -ScanlineFormat mnFormat; -tools::LongmnWidth; -tools::LongmnHeight; -tools::LongmnScanlineSize; -sal_uInt16 mnBitCount; -ColorMask maColorMask; +tools::Long mnWidth; +tools::Long mnHeight; +tools::Long mnScanlineSize; BitmapPalette maPalette; sal_uInt8* mpBits; +ScanlineFormat mnFormat; +ColorMask maColorMask; +sal_uInt16 mnBitCount; }; VCL_DLLPUBLIC std::unique_ptr StretchAndConvert( diff --git a/include/vcl/GraphicAttributes.hxx b/include/vcl/GraphicAttributes.hxx index b5e73625c467..442158cda2e9 100644 --- a/include/vcl/GraphicAttributes.hxx +++ b/include/vcl/GraphicAttributes.hxx @@ -35,38 +35,38 @@ class VCL_DLLPUBLIC GraphicAttr { private: double mfGamma; -BmpMirrorFlags mnMirrFlags; tools::Long mnLeftCrop; tools::Long mnTopCrop; tools::Long mnRightCrop; tools::Long mnBottomCrop; +BmpMirrorFlags mnMirrFlags; +GraphicDrawMode meDrawMode; Degree10 mnRotate10; short mnContPercent; short mnLumPercent; short mnRPercent; short mnGPercent; short mnBPercent; -bool mbInvert; sal_uInt8 mcAlpha; -GraphicDrawMode meDrawMode; +bool mbInvert; public: GraphicAttr() : mfGamma(1.0) -, mnMirrFlags(BmpMirrorFlags::NONE) , mnLeftCrop(0) , mnTopCrop(0) , mnRightCrop(0) , mnBottomCrop(0) +, mnMirrFlags(BmpMirrorFlags::NONE) +, meDrawMode(GraphicDrawMode::Standard) , mnRotate10(0) , mnContPercent(0) , mnLumPercent(0) , mnRPercent(0) , mnGPercent(0) , mnBPercent(0) -, mbInvert(false) , mcAlpha(255) -, meDrawMode(GraphicDrawMode::Standard) +, mbInvert(false) { } diff --git a/vcl/inc/accel.hxx b/vcl/inc/accel.hxx index 9d597f76fd47..b00950b30095 100644 --- a/vcl/inc/accel.hxx +++ b/vcl/inc/accel.hxx @@ -35,10 +35,10 @@ class Accelerator; class ImplAccelEntry { public: -sal_uInt16 mnId; -vcl::KeyCodemaKeyCode; Accelerator*mpAccel; Accelerator*mpAutoAccel; +vcl::KeyCodemaKeyCode; +sal_uInt16 mnId; boolmbEnabled; }; diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx index 2b07854271ef..c9f50cd63982 100644 --- a/vcl/inc/salwtype.hxx +++ b/vcl/inc/salwtype.hxx @@ -214,13 +214,13 @@ struct SalSurroundingTextSelectionChangeEvent struct SalQueryCharPositionEvent { -boolmbValid;// The data is valid or not. sal_uLong mnCharPos; // The index of character in a composition. +tools::Long mnCursorBoundX; // The cursor bounds corresponding to the character specified by mnCharPos - X +tools::Long mnCursorBoundY; // The cursor bounds corresponding to the character specified by mnCharPos - Y +tools::Long mnCursorBoundWidth; // The cursor bounds corresponding to the character specified by mnCharPos - Width +tools::Long
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/vcllayout.hxx |2 ++ vcl/inc/impglyphitem.hxx | 22 ++ vcl/inc/sallayout.hxx |2 ++ vcl/source/gdi/CommonSalLayout.cxx |4 ++-- vcl/source/gdi/pdfwriter_impl.cxx |5 ++--- vcl/source/gdi/sallayout.cxx | 16 +++- vcl/source/outdev/font.cxx |5 +++-- 7 files changed, 32 insertions(+), 24 deletions(-) New commits: commit 1bfcb00aeb23efddf500e6623d36c0f816f4d2e1 Author: Noel Grandin AuthorDate: Fri Sep 3 14:44:22 2021 +0200 Commit: Noel Grandin CommitDate: Fri Sep 3 21:44:11 2021 +0200 pull duplicate field out of GlyphItem we already store it in SalLayoutGlyphsImpl Change-Id: I772c08966572e42789bcede1a148b2b7710f29d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121602 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/vcl/vcllayout.hxx b/include/vcl/vcllayout.hxx index e09e54f59d65..b6744ce8a118 100644 --- a/include/vcl/vcllayout.hxx +++ b/include/vcl/vcllayout.hxx @@ -27,6 +27,7 @@ #include #include +class LogicalFontInstance; class ImplLayoutArgs; class PhysicalFontFace; class SalGraphics; @@ -90,6 +91,7 @@ public: // methods using glyph indexing virtual boolGetNextGlyph(const GlyphItem** pGlyph, Point& rPos, int& nStart, + const LogicalFontInstance** ppGlyphFont = nullptr, const PhysicalFontFace** pFallbackFont = nullptr) const = 0; virtual bool GetOutline(basegfx::B2DPolyPolygonVector&) const; bool GetBoundRect(tools::Rectangle&) const; diff --git a/vcl/inc/impglyphitem.hxx b/vcl/inc/impglyphitem.hxx index 913a33c1f421..1942b9d159d5 100644 --- a/vcl/inc/impglyphitem.hxx +++ b/vcl/inc/impglyphitem.hxx @@ -50,7 +50,6 @@ template <> struct typed_flags : is_typed_flagsGetGlyphBoundRect(m_aGlyphId, rRect, IsVertical()); +return pFontInstance->GetGlyphBoundRect(m_aGlyphId, rRect, IsVertical()); } -VCL_DLLPUBLIC bool GlyphItem::GetGlyphOutline(basegfx::B2DPolyPolygon& rPoly) const +VCL_DLLPUBLIC bool GlyphItem::GetGlyphOutline(const LogicalFontInstance* pFontInstance, + basegfx::B2DPolyPolygon& rPoly) const { -return m_pFontInstance->GetGlyphOutline(m_aGlyphId, rPoly, IsVertical()); +return pFontInstance->GetGlyphOutline(m_aGlyphId, rPoly, IsVertical()); } void GlyphItem::dropGlyph() diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index 2608044d592f..9d37b71d1a3e 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -131,6 +131,7 @@ public: DeviceCoordinate FillDXArray(DeviceCoordinate* pDXArray) const override; voidGetCaretPositions(int nArraySize, tools::Long* pCaretXArray) const override; boolGetNextGlyph(const GlyphItem** pGlyph, Point& rPos, int& nStart, + const LogicalFontInstance** ppGlyphFont = nullptr, const PhysicalFontFace** pFallbackFont = nullptr) const override; boolGetOutline(basegfx::B2DPolyPolygonVector&) const override; boolIsKashidaPosValid(int nCharPos) const override; @@ -187,6 +188,7 @@ public: { return *m_GlyphItems.GetFont(); } boolGetNextGlyph(const GlyphItem** pGlyph, Point& rPos, int& nStart, + const LogicalFontInstance** ppGlyphFont = nullptr, const PhysicalFontFace** pFallbackFont = nullptr) const override; const SalLayoutGlyphsImpl& GlyphsImpl() const { return m_GlyphItems; } diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 5f0c9637a7d2..4aa527c91d39 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -583,7 +583,7 @@ bool GenericSalLayout::LayoutText(ImplLayoutArgs& rArgs, const SalLayoutGlyphsIm Point aNewPos(aCurrPos.X() + nXOffset, aCurrPos.Y() + nYOffset); const GlyphItem aGI(nCharPos, nCharCount, nGlyphIndex, aNewPos, nGlyphFlags, -nAdvance, nXOffset, ()); +nAdvance, nXOffset); m_GlyphItems.push_back(aGI); aCurrPos.AdjustX(nAdvance ); @@ -781,7 +781,7 @@ void GenericSalLayout::ApplyDXArray(const DeviceCoordinate* pDXArray, SalLayoutF GlyphItemFlags const nFlags = GlyphItemFlags::IS_IN_CLUSTER | GlyphItemFlags::IS_RTL_GLYPH; while (nCopies--) { -GlyphItem aKashida(nCharPos, 0, nKashidaIndex, aPos, nFlags, nKashidaWidth, 0, ()); +GlyphItem aKashida(nCharPos, 0, nKashidaIndex, aPos, nFlags, nKashidaWidth, 0); pGlyphIter = m_GlyphItems.insert(pGlyphIter, aKashida); aPos.AdjustX(nKashidaWidth ); aPos.AdjustX( -nOverlap ); diff --git
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/accel.hxx |2 -- vcl/inc/svdata.hxx|1 + vcl/source/window/dialog.cxx |2 +- vcl/source/window/dockwin.cxx |2 +- vcl/source/window/syswin.cxx |2 +- vcl/source/window/tabpage.cxx |4 ++-- 6 files changed, 6 insertions(+), 7 deletions(-) New commits: commit 41f1d389d4b513a7f616542d00fd58268ab5ea07 Author: Caolán McNamara AuthorDate: Wed Aug 4 19:45:25 2021 +0100 Commit: Caolán McNamara CommitDate: Wed Aug 4 21:49:45 2021 +0200 GenerateAutoMnemonicsOnHierarchy is no longer used outside vcl This effectively reverts commit 76be678e7478e4863a8360e26425a39afa5af4fb. "rename ImplWindowAutoMnemonic and expose" Change-Id: Ibeeeda68d96286e74113a7567ef12dae3a80cf48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120012 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/accel.hxx b/include/vcl/accel.hxx index 2aa951b47293..f48c05c21ba8 100644 --- a/include/vcl/accel.hxx +++ b/include/vcl/accel.hxx @@ -77,8 +77,6 @@ public: voidSetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; } Accelerator&operator=( const Accelerator& rAccel ); - -static void GenerateAutoMnemonicsOnHierarchy(const vcl::Window* pWindow); }; #endif // INCLUDED_VCL_ACCEL_HXX diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index 2f962291725b..06515c5ccbb2 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -433,6 +433,7 @@ const std::locale& ImplGetResLocale(); VCL_PLUGIN_PUBLIC OUString VclResId(TranslateId sContextAndId); DockingManager* ImplGetDockingManager(); BlendFrameCache*ImplGetBlendFrameCache(); +void GenerateAutoMnemonicsOnHierarchy(const vcl::Window* pWindow); VCL_PLUGIN_PUBLIC ImplSVHelpData& ImplGetSVHelpData(); diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index f9c6e3b1b503..9cb7fb142c5f 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -201,7 +201,7 @@ vcl::Window * lastLogicalChildOfParent(const vcl::Window *pTopLevel) return const_cast(pChild); } -void Accelerator::GenerateAutoMnemonicsOnHierarchy(const vcl::Window* pWindow) +void GenerateAutoMnemonicsOnHierarchy(const vcl::Window* pWindow) { MnemonicGenerator aMnemonicGenerator; vcl::Window* pGetChild; diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 25890e6627a2..619d8fbb6093 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -643,7 +643,7 @@ void DockingWindow::Resizing( Size& ) void DockingWindow::DoInitialLayout() { if (GetSettings().GetStyleSettings().GetAutoMnemonic()) - Accelerator::GenerateAutoMnemonicsOnHierarchy(this); + GenerateAutoMnemonicsOnHierarchy(this); if (isLayoutEnabled()) { diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index ef0f7c0af90d..3d8a2dd18a06 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -1097,7 +1097,7 @@ void SystemWindow::setOptimalLayoutSize() void SystemWindow::DoInitialLayout() { if (GetSettings().GetStyleSettings().GetAutoMnemonic()) - Accelerator::GenerateAutoMnemonicsOnHierarchy(this); + GenerateAutoMnemonicsOnHierarchy(this); if (isLayoutEnabled()) { diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx index f3acc5998ec3..784c2366bf48 100644 --- a/vcl/source/window/tabpage.cxx +++ b/vcl/source/window/tabpage.cxx @@ -17,13 +17,13 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include #include #include #include #include #include #include +#include void TabPage::ImplInit( vcl::Window* pParent, WinBits nStyle ) { @@ -119,7 +119,7 @@ void TabPage::StateChanged( StateChangedType nType ) if ( nType == StateChangedType::InitShow ) { if (GetSettings().GetStyleSettings().GetAutoMnemonic()) -Accelerator::GenerateAutoMnemonicsOnHierarchy(this); +GenerateAutoMnemonicsOnHierarchy(this); // FIXME: no layouting, workaround some clipping issues ImplAdjustNWFSizes(); }
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/ctrl.hxx |6 +- include/vcl/toolkit/controllayout.hxx |2 vcl/inc/controldata.hxx | 38 -- vcl/inc/pch/precompiled_vcl.hxx |1 vcl/source/control/button.cxx |8 +- vcl/source/control/combobox.cxx |4 - vcl/source/control/ctrl.cxx | 91 -- vcl/source/control/edit.cxx |4 - vcl/source/control/fixed.cxx | 12 ++-- vcl/source/control/imp_listbox.cxx| 10 +-- vcl/source/control/listbox.cxx|4 - vcl/source/control/spinfld.cxx|4 - vcl/source/control/tabctrl.cxx| 11 +--- vcl/source/toolkit/group.cxx |9 +-- 14 files changed, 80 insertions(+), 124 deletions(-) New commits: commit 942dcd6d8684ffdbc9bc67030c502e9db1965eb5 Author: Noel Grandin AuthorDate: Thu Jul 29 19:54:05 2021 +0200 Commit: Noel Grandin CommitDate: Fri Jul 30 20:35:46 2021 +0200 flatten vcl::ImplControlData the struct is already visible in the headers, so it's not a pimpl pattern, and it's only two pointers, so no point in allocating separately. The tdf#91081 bug comment I removed is no longer relevant, this general class of problem was solved with the introduction of VclPtr. Change-Id: Ie5d896baf0167273f8936930dd65891919c5bf7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119679 Tested-by: Noel Grandin Reviewed-by: Noel Grandin diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx index 90fd8b7684b8..cde59c6f9e0f 100644 --- a/include/vcl/ctrl.hxx +++ b/include/vcl/ctrl.hxx @@ -26,14 +26,14 @@ #include // forward -namespace vcl { struct ImplControlData; } class StyleSettings; - +namespace vcl { struct ControlLayoutData; } class VCL_DLLPUBLIC Control : public vcl::Window { protected: -std::unique_ptr mpControlData; +mutable std::unique_ptr mpLayoutData; +VclPtrmpReferenceDevice; private: boolmbHasControlFocus; diff --git a/include/vcl/toolkit/controllayout.hxx b/include/vcl/toolkit/controllayout.hxx index d47514460fe9..44b721c17dab 100644 --- a/include/vcl/toolkit/controllayout.hxx +++ b/include/vcl/toolkit/controllayout.hxx @@ -29,6 +29,8 @@ #include #include +class Control; + namespace vcl { diff --git a/vcl/inc/controldata.hxx b/vcl/inc/controldata.hxx deleted file mode 100644 index ed6e3a368967.. --- a/vcl/inc/controldata.hxx +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_INC_CONTROLDATA_HXX -#define INCLUDED_VCL_INC_CONTROLDATA_HXX - -#include -#include - -namespace vcl -{ -struct ImplControlData -{ -mutable std::unique_ptr mpLayoutData; -VclPtrmpReferenceDevice; -}; - -} // namespace vcl - -#endif // INCLUDED_VCL_INC_CONTROLDATA_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx index ea6ad604224d..a7ef0ce02759 100644 --- a/vcl/inc/pch/precompiled_vcl.hxx +++ b/vcl/inc/pch/precompiled_vcl.hxx @@ -254,7 +254,6 @@ #include #include #include -#include #include #include #include diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index ac867a292533..68b368b56c0e 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -39,7 +40,6 @@ #include #include #include -#include #include #include @@ -1340,7 +1340,7 @@ void PushButton::KeyUp( const KeyEvent& rKEvt ) void PushButton::FillLayoutData() const { -mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData ); +mpLayoutData.reset( new vcl::ControlLayoutData ); const_cast(this)->Invalidate(); } @@ -2435,7 +2435,7 @@ void RadioButton::KeyUp( const KeyEvent& rKEvt ) void RadioButton::FillLayoutData() const { -mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData ); +
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |2 +- vcl/inc/salvtables.hxx|2 +- vcl/source/app/salvtables.cxx |2 +- vcl/unx/gtk3/gtkinst.cxx | 12 4 files changed, 7 insertions(+), 11 deletions(-) New commits: commit 82b08515fafea688001ec3b77e0874ee87e44ac2 Author: Caolán McNamara AuthorDate: Sat May 15 16:35:21 2021 +0100 Commit: Caolán McNamara CommitDate: Sat May 15 21:42:54 2021 +0200 inherit Button from Widget instead of Container Change-Id: Ic4f444d615e732f5d87ccde0cf10484d2ab679d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115661 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 327649375992..b0801ec0ad1d 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1365,7 +1365,7 @@ public: bool get_value_changed_from_saved() const { return m_sSavedValue != get_selected_text(); } }; -class VCL_DLLPUBLIC Button : virtual public Container +class VCL_DLLPUBLIC Button : virtual public Widget { friend class ::LOKTrigger; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 4defda33a327..8b415b998b4b 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1002,7 +1002,7 @@ public: virtual ~SalInstanceComboBoxWithEdit() override; }; -class SalInstanceButton : public SalInstanceContainer, public virtual weld::Button +class SalInstanceButton : public SalInstanceWidget, public virtual weld::Button { private: VclPtr<::Button> m_xButton; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 81f46a4d446b..771517062a1e 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2567,7 +2567,7 @@ IMPL_LINK_NOARG(SalInstanceVerticalNotebook, ActivatePageHdl, VerticalTabControl SalInstanceButton::SalInstanceButton(::Button* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership) -: SalInstanceContainer(pButton, pBuilder, bTakeOwnership) +: SalInstanceWidget(pButton, pBuilder, bTakeOwnership) , m_xButton(pButton) , m_aOldClickHdl(pButton->GetClickHdl()) { diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index ea2e3539..523cc5cef594 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -7575,7 +7575,7 @@ void set_font(GtkLabel* pLabel, const vcl::Font& rFont) } #if !GTK_CHECK_VERSION(4, 0, 0) -class GtkInstanceButton : public GtkInstanceContainer, public virtual weld::Button +class GtkInstanceButton : public GtkInstanceWidget, public virtual weld::Button { private: GtkButton* m_pButton; @@ -7676,11 +7676,7 @@ protected: public: GtkInstanceButton(GtkButton* pButton, GtkInstanceBuilder* pBuilder, bool bTakeOwnership) -#if !GTK_CHECK_VERSION(4, 0, 0) -: GtkInstanceContainer(GTK_CONTAINER(pButton), pBuilder, bTakeOwnership) -#else -: GtkInstanceContainer(GTK_WIDGET(pButton), pBuilder, bTakeOwnership) -#endif +: GtkInstanceWidget(GTK_WIDGET(pButton), pBuilder, bTakeOwnership) , m_pButton(pButton) , m_pCustomCssProvider(nullptr) , m_nSignalId(g_signal_connect(pButton, "clicked", G_CALLBACK(signalClicked), this)) @@ -7775,12 +7771,12 @@ public: virtual void disable_notify_events() override { g_signal_handler_block(m_pButton, m_nSignalId); -GtkInstanceContainer::disable_notify_events(); +GtkInstanceWidget::disable_notify_events(); } virtual void enable_notify_events() override { -GtkInstanceContainer::enable_notify_events(); +GtkInstanceWidget::enable_notify_events(); g_signal_handler_unblock(m_pButton, m_nSignalId); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |6 +++--- vcl/inc/salvtables.hxx|6 +++--- vcl/source/app/salvtables.cxx | 12 ++-- vcl/unx/gtk3/gtkinst.cxx | 28 ++-- 4 files changed, 26 insertions(+), 26 deletions(-) New commits: commit 65d6dc999c3e453498a007273cea26290c720f4c Author: Caolán McNamara AuthorDate: Sat May 15 14:33:55 2021 +0100 Commit: Caolán McNamara CommitDate: Sat May 15 17:08:15 2021 +0200 inherit Expander from Widget instead of Container likewise TreeView and IconView Change-Id: Ic51b88ba9a63706443e8a34a971168702ddce418 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115659 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index e818c96ed16f..327649375992 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -851,7 +851,7 @@ public: button column when enable_toggle_buttons is used). Column index -1 is reserved to access those columns. */ -class VCL_DLLPUBLIC TreeView : virtual public Container +class VCL_DLLPUBLIC TreeView : virtual public Widget { friend class ::LOKTrigger; @@ -1280,7 +1280,7 @@ public: using Widget::set_sensitive; }; -class VCL_DLLPUBLIC IconView : virtual public Container +class VCL_DLLPUBLIC IconView : virtual public Widget { friend class ::LOKTrigger; @@ -2136,7 +2136,7 @@ public: void connect_vadjustment_changed(const Link& rLink) { m_aVChangeHdl = rLink; } }; -class VCL_DLLPUBLIC Expander : virtual public Container +class VCL_DLLPUBLIC Expander : virtual public Widget { protected: Link m_aExpandedHdl; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index eb41bc4eb63e..4defda33a327 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1341,7 +1341,7 @@ struct SalInstanceTreeIter : public weld::TreeIter SvTreeListEntry* iter; }; -class SalInstanceTreeView : public SalInstanceContainer, public virtual weld::TreeView +class SalInstanceTreeView : public SalInstanceWidget, public virtual weld::TreeView { protected: // owner for UserData @@ -1701,7 +1701,7 @@ public: virtual ~SalInstanceTreeView() override; }; -class SalInstanceExpander : public SalInstanceContainer, public virtual weld::Expander +class SalInstanceExpander : public SalInstanceWidget, public virtual weld::Expander { private: VclPtr m_xExpander; @@ -1726,7 +1726,7 @@ public: virtual ~SalInstanceExpander() override; }; -class SalInstanceIconView : public SalInstanceContainer, public virtual weld::IconView +class SalInstanceIconView : public SalInstanceWidget, public virtual weld::IconView { private: // owner for UserData diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 1eda39158975..81f46a4d446b 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -3655,7 +3655,7 @@ void SalInstanceTreeView::set_header_item_width(const std::vector& rWidths) SalInstanceTreeView::SalInstanceTreeView(SvTabListBox* pTreeView, SalInstanceBuilder* pBuilder, bool bTakeOwnership) -: SalInstanceContainer(pTreeView, pBuilder, bTakeOwnership) +: SalInstanceWidget(pTreeView, pBuilder, bTakeOwnership) , m_xTreeView(pTreeView) , m_aCheckButtonData(pTreeView, false) , m_aRadioButtonData(pTreeView, true) @@ -3823,14 +3823,14 @@ void SalInstanceTreeView::show() { if (LclHeaderTabListBox* pHeaderBox = dynamic_cast(m_xTreeView.get())) pHeaderBox->GetParent()->Show(); -SalInstanceContainer::show(); +SalInstanceWidget::show(); } void SalInstanceTreeView::hide() { if (LclHeaderTabListBox* pHeaderBox = dynamic_cast(m_xTreeView.get())) pHeaderBox->GetParent()->Hide(); -SalInstanceContainer::hide(); +SalInstanceWidget::hide(); } void SalInstanceTreeView::insert(const weld::TreeIter* pParent, int pos, const OUString* pStr, @@ -5169,7 +5169,7 @@ IMPL_LINK(SalInstanceTreeView, EditedEntryHdl, IterString, rIterString, bool) SalInstanceIconView::SalInstanceIconView(::IconView* pIconView, SalInstanceBuilder* pBuilder, bool bTakeOwnership) -: SalInstanceContainer(pIconView, pBuilder, bTakeOwnership) +: SalInstanceWidget(pIconView, pBuilder, bTakeOwnership) , m_xIconView(pIconView) { m_xIconView->SetSelectHdl(LINK(this, SalInstanceIconView, SelectHdl)); @@ -5876,7 +5876,7 @@ IMPL_LINK(SalInstanceTextView, CursorListener, VclWindowEvent&, rEvent, void) SalInstanceExpander::SalInstanceExpander(VclExpander* pExpander, SalInstanceBuilder* pBuilder, bool bTakeOwnership) -: SalInstanceContainer(pExpander, pBuilder, bTakeOwnership) +: SalInstanceWidget(pExpander, pBuilder, bTakeOwnership) , m_xExpander(pExpander) { m_xExpander->SetExpandedHdl(LINK(this,
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |2 +- vcl/inc/salvtables.hxx|2 +- vcl/source/app/salvtables.cxx |2 +- vcl/unx/gtk3/gtkinst.cxx |8 4 files changed, 7 insertions(+), 7 deletions(-) New commits: commit 5b0deaba0067143b20948b8efe0eea5937aaa3df Author: Caolán McNamara AuthorDate: Fri May 14 21:10:53 2021 +0100 Commit: Caolán McNamara CommitDate: Sat May 15 15:26:29 2021 +0200 inherit TextView from Widget instead of Container Change-Id: Ic8ad23beaa6a3c2de74cb554f9b9c5aea6a78639 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115637 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 03ec14dc1a8a..e818c96ed16f 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -2062,7 +2062,7 @@ public: virtual void set_font_color(const Color& rColor) = 0; }; -class VCL_DLLPUBLIC TextView : virtual public Container +class VCL_DLLPUBLIC TextView : virtual public Widget { friend class ::LOKTrigger; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index dc48a8d66695..eb41bc4eb63e 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1263,7 +1263,7 @@ public: virtual ~SalInstanceToolbar() override; }; -class SalInstanceTextView : public SalInstanceContainer, public virtual weld::TextView +class SalInstanceTextView : public SalInstanceWidget, public virtual weld::TextView { private: VclPtr m_xTextView; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 4d4a418408c1..1eda39158975 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -5714,7 +5714,7 @@ std::unique_ptr SalInstanceFrame::weld_label_widget() const SalInstanceTextView::SalInstanceTextView(VclMultiLineEdit* pTextView, SalInstanceBuilder* pBuilder, bool bTakeOwnership) -: SalInstanceContainer(pTextView, pBuilder, bTakeOwnership) +: SalInstanceWidget(pTextView, pBuilder, bTakeOwnership) , m_xTextView(pTextView) { m_xTextView->SetModifyHdl(LINK(this, SalInstanceTextView, ChangeHdl)); diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 2af11bbf477b..83ad682ca9ec 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -14150,7 +14150,7 @@ std::unique_ptr GtkInstanceFrame::weld_label_widget() const namespace { -class GtkInstanceTextView : public GtkInstanceContainer, public virtual weld::TextView +class GtkInstanceTextView : public GtkInstanceWidget, public virtual weld::TextView { private: GtkTextView* m_pTextView; @@ -14241,7 +14241,7 @@ private: public: GtkInstanceTextView(GtkTextView* pTextView, GtkInstanceBuilder* pBuilder, bool bTakeOwnership) -: GtkInstanceContainer(GTK_CONTAINER(pTextView), pBuilder, bTakeOwnership) +: GtkInstanceWidget(GTK_WIDGET(pTextView), pBuilder, bTakeOwnership) , m_pTextView(pTextView) , m_pTextBuffer(gtk_text_view_get_buffer(pTextView)) , m_pVAdjustment(gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(pTextView))) @@ -14363,12 +14363,12 @@ public: g_signal_handler_block(m_pVAdjustment, m_nVAdjustChangedSignalId); g_signal_handler_block(m_pTextBuffer, m_nCursorPosSignalId); g_signal_handler_block(m_pTextBuffer, m_nChangedSignalId); -GtkInstanceContainer::disable_notify_events(); +GtkInstanceWidget::disable_notify_events(); } virtual void enable_notify_events() override { -GtkInstanceContainer::enable_notify_events(); +GtkInstanceWidget::enable_notify_events(); g_signal_handler_unblock(m_pTextBuffer, m_nChangedSignalId); g_signal_handler_unblock(m_pTextBuffer, m_nCursorPosSignalId); g_signal_handler_unblock(m_pVAdjustment, m_nVAdjustChangedSignalId); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |5 + vcl/inc/salvtables.hxx|2 ++ vcl/source/app/salvtables.cxx |6 ++ vcl/unx/gtk3/gtk3gtkinst.cxx |7 +++ 4 files changed, 20 insertions(+) New commits: commit 1ff996e5e720d77ce32b8c44d4c29569ddbc113a Author: Caolán McNamara AuthorDate: Thu May 6 10:03:21 2021 +0100 Commit: Caolán McNamara CommitDate: Thu May 6 15:49:45 2021 +0200 add get_clipboard to widget Change-Id: I9a623e558bc18286af773e0aa3120185a30baa52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115172 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 9821005fb9e6..03ec14dc1a8a 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -34,6 +34,10 @@ namespace com::sun::star::awt { class XWindow; } +namespace com::sun::star::datatransfer::clipboard +{ +class XClipboard; +} namespace com::sun::star::datatransfer::dnd { class XDropTarget; @@ -333,6 +337,7 @@ public: virtual void set_background(const Color& rBackColor) = 0; virtual css::uno::Reference get_drop_target() = 0; +virtual css::uno::Reference get_clipboard() const = 0; virtual void connect_get_property_tree(const Link& rLink) = 0; virtual void get_property_tree(tools::JsonWriter& rJsonWriter) = 0; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index c274b4bd234c..dc48a8d66695 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -367,6 +367,8 @@ public: virtual VclPtr create_virtual_device() const override; virtual css::uno::Reference get_drop_target() override; +virtual css::uno::Reference +get_clipboard() const override; virtual void connect_get_property_tree(const Link& rLink) override; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index a74e14120058..4a19030397c7 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -553,6 +553,12 @@ css::uno::Reference SalInstanceWidget::get_ return m_xWidget->GetDropTarget(); } +css::uno::Reference +SalInstanceWidget::get_clipboard() const +{ +return m_xWidget->GetClipboard(); +} + void SalInstanceWidget::connect_get_property_tree(const Link& rLink) { m_xWidget->SetDumpAsPropertyTreeHdl(rLink); diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index afb3aeba724e..b4ad243c0422 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -3064,6 +3064,13 @@ public: return m_xDropTarget; } +virtual css::uno::Reference get_clipboard() const override +{ +// the gen backend can have per-frame clipboards which is (presumably) useful for LibreOffice Online +// but normal usage is the shared system clipboard +return GetSystemClipboard(); +} + virtual void connect_get_property_tree(const Link& /*rLink*/) override { //not implemented for the gtk variant ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/bitmap.hxx |3 +-- include/vcl/bitmapex.hxx|5 +++-- include/vcl/gdimtf.hxx |1 + vcl/inc/bitmap/Octree.hxx |1 + vcl/source/bitmap/BitmapEx.cxx |6 +++--- vcl/source/bitmap/BitmapWriteAccess.cxx |2 +- vcl/source/bitmap/bitmap.cxx|2 +- 7 files changed, 11 insertions(+), 9 deletions(-) New commits: commit 53e720708b9d027a7df9908c75b1b82c8aca3c6a Author: Noel Grandin AuthorDate: Tue May 4 18:55:25 2021 +0200 Commit: Noel Grandin CommitDate: Wed May 5 08:31:32 2021 +0200 sal_uLong->sal_Int32 in Bitmap Change-Id: I267fbdb8946d307440cb675f6ff985bf58db5e4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115108 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index f3bc3e1cdfe7..f9e116c56d3b 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -20,7 +20,6 @@ #ifndef INCLUDED_VCL_BITMAP_HXX #define INCLUDED_VCL_BITMAP_HXX -#include #include #include #include @@ -205,7 +204,7 @@ public: nothing had to be done, e.g. because nDX and nDY were zero. */ boolExpand( -sal_uLong nDX, sal_uLong nDY, +sal_Int32 nDX, sal_Int32 nDY, const Color* pInitColor = nullptr ); /** Copy a rectangular area from another bitmap diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx index 7225a5fe7385..f623fe86dd18 100644 --- a/include/vcl/bitmapex.hxx +++ b/include/vcl/bitmapex.hxx @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -83,7 +84,7 @@ public: return maBitmap.getPixelFormat(); } -sal_uLong GetSizeBytes() const; +sal_Int64 GetSizeBytes() const; BitmapChecksum GetChecksum() const; /** Convert bitmap format @@ -123,7 +124,7 @@ public: Whether to expand the transparency color or not. */ voidExpand( -sal_uLong nDX, sal_uLong nDY, +sal_Int32 nDX, sal_Int32 nDY, bool bExpandTransparent = false ); /** Copy a rectangular area from another bitmap diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx index 202480faa818..363f15f10842 100644 --- a/include/vcl/gdimtf.hxx +++ b/include/vcl/gdimtf.hxx @@ -22,6 +22,7 @@ #include #include +#include #include #include #include diff --git a/vcl/inc/bitmap/Octree.hxx b/vcl/inc/bitmap/Octree.hxx index f1d6e2a583c0..216f2fdd1875 100644 --- a/vcl/inc/bitmap/Octree.hxx +++ b/vcl/inc/bitmap/Octree.hxx @@ -22,6 +22,7 @@ #include #include +#include struct OctreeNode { diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx index 90c0ca8a47b5..2c56ab44b6a0 100644 --- a/vcl/source/bitmap/BitmapEx.cxx +++ b/vcl/source/bitmap/BitmapEx.cxx @@ -217,9 +217,9 @@ AlphaMask BitmapEx::GetAlpha() const return AlphaMask(maAlphaMask); } -sal_uLong BitmapEx::GetSizeBytes() const +sal_Int64 BitmapEx::GetSizeBytes() const { -sal_uLong nSizeBytes = maBitmap.GetSizeBytes(); +sal_Int64 nSizeBytes = maBitmap.GetSizeBytes(); if( !maAlphaMask.IsEmpty() ) nSizeBytes += maAlphaMask.GetSizeBytes(); @@ -376,7 +376,7 @@ bool BitmapEx::Convert( BmpConversion eConversion ) return !maBitmap.IsEmpty() && maBitmap.Convert( eConversion ); } -void BitmapEx::Expand( sal_uLong nDX, sal_uLong nDY, bool bExpandTransparent ) +void BitmapEx::Expand( sal_Int32 nDX, sal_Int32 nDY, bool bExpandTransparent ) { bool bRet = false; diff --git a/vcl/source/bitmap/BitmapWriteAccess.cxx b/vcl/source/bitmap/BitmapWriteAccess.cxx index d30477b9f257..c7fb31cc1406 100644 --- a/vcl/source/bitmap/BitmapWriteAccess.cxx +++ b/vcl/source/bitmap/BitmapWriteAccess.cxx @@ -67,7 +67,7 @@ void BitmapWriteAccess::CopyScanline(tools::Long nY, ConstScanline aSrcScanline, || (!HasPalette() && nFormat > ScanlineFormat::N8BitPal), "No copying possible between palette and non palette scanlines!"); -const sal_uLong nCount = std::min(GetScanlineSize(), nSrcScanlineSize); +const sal_uInt32 nCount = std::min(GetScanlineSize(), nSrcScanlineSize); if (!nCount) return; diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx index 99b8d10e9ef7..e093e0afabb5 100644 --- a/vcl/source/bitmap/bitmap.cxx +++ b/vcl/source/bitmap/bitmap.cxx @@ -850,7 +850,7 @@ bool Bitmap::CopyPixel_AlphaOptimized( const tools::Rectangle& rRectDst, const t } -bool Bitmap::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor ) +bool Bitmap::Expand( sal_Int32 nDX, sal_Int32 nDY, const Color* pInitColor ) { bool bRet = false; ___ Libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/wall.hxx| 25 ++-- vcl/inc/wall2.hxx | 50 - vcl/source/control/combobox.cxx |2 vcl/source/gdi/wall.cxx | 204 +++- 4 files changed, 73 insertions(+), 208 deletions(-) New commits: commit 25b0f8787946b1627ea6ac0324d871a70cc5d9dd Author: Noel Grandin AuthorDate: Fri Apr 30 15:32:32 2021 +0200 Commit: Noel Grandin CommitDate: Fri Apr 30 21:42:31 2021 +0200 simplify Wallpaper All of it's member fields are already COW types, so it doesn't need the complication Change-Id: I44e402e8e80fe96462fc4e1aa06b9ec6815e3cd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114933 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/vcl/wall.hxx b/include/vcl/wall.hxx index 6a8c179d2e01..53c8efb7080c 100644 --- a/include/vcl/wall.hxx +++ b/include/vcl/wall.hxx @@ -22,8 +22,10 @@ #include #include +#include +#include #include -#include +#include class Gradient; class BitmapEx; @@ -50,15 +52,11 @@ enum class WallpaperStyle class VCL_DLLPUBLIC Wallpaper { public: -typedef o3tl::cow_wrapper ImplType; - SAL_DLLPRIVATE void ImplSetCachedBitmap( BitmapEx& rBmp ) const; SAL_DLLPRIVATE const BitmapEx* ImplGetCachedBitmap() const; SAL_DLLPRIVATE void ImplReleaseCachedBitmap() const; private: -ImplType mpImplWallpaper; - SAL_DLLPRIVATE static Gradient ImplGetApplicationGradient(); public: @@ -70,21 +68,21 @@ public: ~Wallpaper(); voidSetColor( const Color& rColor ); -const Color&GetColor() const; +const Color&GetColor() const { return maColor; } voidSetStyle( WallpaperStyle eStyle ); -WallpaperStyle GetStyle() const; +WallpaperStyle GetStyle() const { return meStyle; } voidSetBitmap( const BitmapEx& rBitmap ); -BitmapExGetBitmap() const; +const BitmapEx & GetBitmap() const; boolIsBitmap() const; voidSetGradient( const Gradient& rGradient ); GradientGetGradient() const; boolIsGradient() const; -voidSetRect( const tools::Rectangle& rRect ); -tools::Rectangle GetRect() const; +voidSetRect( const tools::Rectangle& rRect ) { maRect = rRect; } +const tools::Rectangle & GetRect() const { return maRect; } boolIsRect() const; boolIsFixed() const; @@ -105,6 +103,13 @@ public: friend SvStream& ReadWallpaper( SvStream& rIStm, Wallpaper& rWallpaper ); friend SvStream& WriteWallpaper( SvStream& rOStm, const Wallpaper& rWallpaper ); +private: +tools::RectanglemaRect; +BitmapExmaBitmap; +mutable BitmapExmaCache; +std::optional mpGradient; +Color maColor; +WallpaperStyle meStyle; }; #endif // INCLUDED_VCL_WALL_HXX diff --git a/vcl/inc/wall2.hxx b/vcl/inc/wall2.hxx deleted file mode 100644 index 401593b3ff8b.. --- a/vcl/inc/wall2.hxx +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_INC_WALL2_HXX -#define INCLUDED_VCL_INC_WALL2_HXX - -#include - -class ImplWallpaper -{ -friend class Wallpaper; - -private: -std::optional mpRect; -std::unique_ptr mpBitmap; -std::unique_ptr mpGradient; -std::unique_ptr mpCache; -Color maColor; -WallpaperStyle meStyle; - -public: -ImplWallpaper(); -ImplWallpaper( const ImplWallpaper& rImplWallpaper ); -~ImplWallpaper(); - -bool operator==( const ImplWallpaper& rImplWallpaper ) const = delete; - -friend SvStream& ReadImplWallpaper( SvStream& rIStm, ImplWallpaper& rImplWallpaper ); -friend SvStream& WriteImplWallpaper( SvStream& rOStm, const ImplWallpaper& rImplWallpaper ); -}; - -#endif // INCLUDED_VCL_INC_WALL2_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx | 12 vcl/inc/salvtables.hxx|4 + vcl/source/app/salvtables.cxx | 39 --- vcl/unx/gtk3/gtk3gtkinst.cxx | 105 ++ 4 files changed, 113 insertions(+), 47 deletions(-) New commits: commit 5753386c2353ad4866e7c5dd9e8751ccaa58e93c Author: Caolán McNamara AuthorDate: Sat Apr 24 19:15:47 2021 +0100 Commit: Caolán McNamara CommitDate: Thu Apr 29 10:56:41 2021 +0200 allow push/pop multiple levels of freeze/thaw so can freely protect a block with freeze/thaw regardless of current freeze/thaw state Change-Id: I1bd60bfc02fe784e36ae371a737f4fdfb15a0888 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114615 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index c055ee0e87b3..9821005fb9e6 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -284,7 +284,19 @@ public: virtual bool get_direction() const = 0; virtual void set_direction(bool bRTL) = 0; +/* Increases the freeze count on widget. + + If the freeze count is non-zero, emission of the widget's notifications + is stopped. The notifications are queued until the freeze count is + decreased to zero. Duplicate notifications may be squashed together. +*/ virtual void freeze() = 0; + +/* Reverts the effect of a previous call to freeze. + + The freeze count is decreased on the widget and when it reaches zero, + queued notifications are emitted. +*/ virtual void thaw() = 0; /* push/pop busy mouse cursor state diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index f71ce7a055b2..c274b4bd234c 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -185,6 +185,7 @@ private: bool m_bKeyEventListener; bool m_bMouseEventListener; int m_nBlockNotify; +int m_nFreezeCount; protected: void ensure_event_listener(); @@ -198,6 +199,9 @@ protected: // so use this variant, we will need to filter them later void ensure_mouse_listener(); +bool IsFirstFreeze() const { return m_nFreezeCount == 0; } +bool IsLastThaw() const { return m_nFreezeCount == 1; } + virtual void HandleEventListener(VclWindowEvent& rEvent); virtual bool HandleKeyEventListener(VclWindowEvent& rEvent); virtual void HandleMouseEventListener(VclSimpleEvent& rEvent); diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 585fbebda541..f482d4ee7145 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -249,6 +249,7 @@ SalInstanceWidget::SalInstanceWidget(vcl::Window* pWidget, SalInstanceBuilder* p , m_bKeyEventListener(false) , m_bMouseEventListener(false) , m_nBlockNotify(0) +, m_nFreezeCount(0) { } @@ -484,9 +485,19 @@ bool SalInstanceWidget::get_direction() const { return m_xWidget->IsRTLEnabled() void SalInstanceWidget::set_direction(bool bRTL) { m_xWidget->EnableRTL(bRTL); } -void SalInstanceWidget::freeze() { m_xWidget->SetUpdateMode(false); } +void SalInstanceWidget::freeze() +{ +if (m_nFreezeCount == 0) +m_xWidget->SetUpdateMode(false); +++m_nFreezeCount; +} -void SalInstanceWidget::thaw() { m_xWidget->SetUpdateMode(true); } +void SalInstanceWidget::thaw() +{ +--m_nFreezeCount; +if (m_nFreezeCount == 0) +m_xWidget->SetUpdateMode(true); +} void SalInstanceWidget::set_busy_cursor(bool bBusy) { @@ -3704,15 +3715,23 @@ void SalInstanceTreeView::columns_autosize() void SalInstanceTreeView::freeze() { +bool bIsFirstFreeze = IsFirstFreeze(); SalInstanceWidget::freeze(); -m_xTreeView->SetUpdateMode(false); -m_xTreeView->GetModel()->EnableInvalidate(false); +if (bIsFirstFreeze) +{ +m_xTreeView->SetUpdateMode(false); +m_xTreeView->GetModel()->EnableInvalidate(false); +} } void SalInstanceTreeView::thaw() { -m_xTreeView->GetModel()->EnableInvalidate(true); -m_xTreeView->SetUpdateMode(true); +bool bIsLastThaw = IsLastThaw(); +if (bIsLastThaw) +{ +m_xTreeView->GetModel()->EnableInvalidate(true); +m_xTreeView->SetUpdateMode(true); +} SalInstanceWidget::thaw(); } @@ -5144,13 +5163,17 @@ SalInstanceIconView::SalInstanceIconView(::IconView* pIconView, SalInstanceBuild void SalInstanceIconView::freeze() { +bool bIsFirstFreeze = IsFirstFreeze(); SalInstanceWidget::freeze(); -m_xIconView->SetUpdateMode(false); +if (bIsFirstFreeze) +m_xIconView->SetUpdateMode(false); } void SalInstanceIconView::thaw() { -m_xIconView->SetUpdateMode(true); +bool bIsLastThaw = IsLastThaw(); +if (bIsLastThaw) +m_xIconView->SetUpdateMode(true); SalInstanceWidget::thaw(); } diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 43189617bf63..af252ea05bfa 100644 ---
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/toolkit/combobox.hxx |4 vcl/inc/salvtables.hxx |8 +--- vcl/source/control/combobox.cxx | 35 --- 3 files changed, 29 insertions(+), 18 deletions(-) New commits: commit 88cca903a88902e51c24853f1d10aeae39b39cdd Author: Caolán McNamara AuthorDate: Mon Apr 5 21:05:23 2021 +0100 Commit: Caolán McNamara CommitDate: Tue Apr 6 10:53:12 2021 +0200 be more explicit in setting the parent of the buttons in the style dropdown set their parent explicitly to the desired combobo dropdown area instead of knowing that parent is available as GetWindow in UserDrawEvent Change-Id: I22210d242ab2b847fdba8bcc9dacee393905e872 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113624 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/toolkit/combobox.hxx b/include/vcl/toolkit/combobox.hxx index 97e5ef18dad7..105c5dcb0c95 100644 --- a/include/vcl/toolkit/combobox.hxx +++ b/include/vcl/toolkit/combobox.hxx @@ -31,6 +31,7 @@ #define COMBOBOX_ENTRY_NOTFOUND (SAL_MAX_INT32) #define COMBOBOX_MAX_ENTRIES(SAL_MAX_INT32 - 1) +class ImplListBoxWindow; class UserDrawEvent; /// A widget used to choose from a list of items and which has an entry. @@ -183,6 +184,9 @@ public: tools::Long GetDropDownEntryHeight() const; +// the drop down window container +ImplListBoxWindow* GetMainWindow() const; + virtual bool set_property(const OString , const OUString ) override; virtual FactoryFunction GetUITestFactory() const override; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 88bda40618b6..1afffdfe280d 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -23,11 +23,12 @@ #include #include #include -#include "messagedialog.hxx" #include #include #include #include "iconview.hxx" +#include "listbox.hxx" +#include "messagedialog.hxx" class SalInstanceBuilder : public weld::Builder { @@ -811,8 +812,9 @@ public: if (m_xMenuButton && m_xMenuButton->IsVisible() && m_sMenuButtonRow == sId) { -if (m_xMenuButton->GetParent() != pEvent->GetWindow()) -m_xMenuButton->SetParent(pEvent->GetWindow()); +vcl::Window* pEventWindow = m_xComboBox->GetMainWindow(); +if (m_xMenuButton->GetParent() != pEventWindow) +m_xMenuButton->SetParent(pEventWindow); int nButtonWidth = get_menu_button_width(); m_xMenuButton->SetSizePixel(Size(nButtonWidth, rRect.GetHeight())); m_xMenuButton->SetPosPixel(Point(rRect.GetWidth() - nButtonWidth, rRect.getY())); diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index acf3a0c26d36..6ba717abab5a 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -245,7 +245,7 @@ void ComboBox::ImplInit( vcl::Window* pParent, WinBits nStyle ) if (m_pImpl->m_pFloatWin) m_pImpl->m_pFloatWin->SetImplListBox( m_pImpl->m_pImplLB ); else -m_pImpl->m_pImplLB->GetMainWindow()->AllowGrabFocus( true ); +GetMainWindow()->AllowGrabFocus( true ); ImplCalcEditHeight(); @@ -610,7 +610,7 @@ void ComboBox::FillLayoutData() const mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData ); AppendLayoutData( *m_pImpl->m_pSubEdit ); m_pImpl->m_pSubEdit->SetLayoutDataParent( this ); -ImplListBoxWindow* rMainWindow = m_pImpl->m_pImplLB->GetMainWindow(); +ImplListBoxWindow* rMainWindow = GetMainWindow(); if (m_pImpl->m_pFloatWin) { // dropdown mode @@ -676,7 +676,7 @@ void ComboBox::StateChanged( StateChangedType nType ) else if ( nType == StateChangedType::Style ) { SetStyle( ImplInitStyle( GetStyle() ) ); -m_pImpl->m_pImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) != 0 ); +GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) != 0 ); } else if( nType == StateChangedType::Mirroring ) { @@ -794,7 +794,7 @@ bool ComboBox::EventNotify( NotifyEvent& rNEvt ) } } else if ((rNEvt.GetType() == MouseNotifyEvent::MOUSEBUTTONDOWN) -&& (rNEvt.GetWindow() == m_pImpl->m_pImplLB->GetMainWindow())) +&& (rNEvt.GetWindow() == GetMainWindow())) { m_pImpl->m_pSubEdit->GrabFocus(); } @@ -1136,7 +1136,7 @@ void ComboBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines tools::Long nCharWidth = GetTextWidth(OUString(u'x')); if ( !IsDropDownBox() ) { -Size aOutSz = m_pImpl->m_pImplLB->GetMainWindow()->GetOutputSizePixel(); +Size aOutSz = GetMainWindow()->GetOutputSizePixel(); rnCols = (nCharWidth > 0) ? static_cast(aOutSz.Width()/nCharWidth) : 1; rnLines = static_cast(aOutSz.Height()/GetDropDownEntryHeight()); } @@ -1150,11 +1150,11 @@ void ComboBox::GetMaxVisColumnsAndLines(
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |2 ++ vcl/inc/salvtables.hxx|1 + vcl/source/app/salvtables.cxx |9 + vcl/unx/gtk3/gtk3gtkinst.cxx | 34 ++ 4 files changed, 42 insertions(+), 4 deletions(-) New commits: commit 5aef0085cadb03c5c6b64747cf0ea76657a3a2ca Author: Caolán McNamara AuthorDate: Tue Mar 16 12:56:42 2021 + Commit: Caolán McNamara CommitDate: Tue Mar 16 21:38:23 2021 +0100 enable grabbing focus to an unspecified container child Change-Id: I269f76a3e71832ef2e8961952d9362838bd49cfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112577 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 1fc18c85fb65..46ae951f3b94 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -346,6 +346,8 @@ public: { m_aContainerFocusChangedHdl = rLink; } +// causes a child of the container to have the keyboard focus +virtual void child_grab_focus() = 0; }; class VCL_DLLPUBLIC Box : virtual public Container diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index efec58258868..88bda40618b6 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -419,6 +419,7 @@ public: bool bTakeOwnership); virtual void HandleEventListener(VclWindowEvent& rEvent) override; virtual void connect_container_focus_changed(const Link& rLink) override; +virtual void child_grab_focus() override; virtual void move(weld::Widget* pWidget, weld::Container* pNewParent) override; virtual void recursively_unset_default_buttons() override; virtual css::uno::Reference CreateChildFrame() override; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 2a0009446132..7d309a7ebe13 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1189,6 +1189,15 @@ void SalInstanceContainer::move(weld::Widget* pWidget, weld::Container* pNewPare pVclWidget->getWidget()->SetParentToDefaultWindow(); } +void SalInstanceContainer::child_grab_focus() +{ +disable_notify_events(); +m_xContainer->GrabFocus(); +if (vcl::Window* pFirstChild = m_xContainer->ImplGetDlgWindow(0, GetDlgWindowType::First)) +pFirstChild->ImplControlFocus(); +enable_notify_events(); +} + void SalInstanceContainer::recursively_unset_default_buttons() { implResetDefault(m_xContainer.get()); diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index d15ee5d5a7e8..fc958c780f18 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -3817,6 +3817,27 @@ public: GtkContainer* getContainer() { return m_pContainer; } +virtual void child_grab_focus() override +{ +disable_notify_events(); +gtk_widget_grab_focus(m_pWidget); +bool bHasFocusChild = gtk_container_get_focus_child(m_pContainer); +if (!bHasFocusChild) +{ +GList* pChildren = gtk_container_get_children(m_pContainer); +for (GList* pChild = g_list_first(pChildren); pChild; pChild = g_list_next(pChild)) +{ +gtk_container_set_focus_child(m_pContainer, static_cast(pChild->data)); +bHasFocusChild = true; +break; +} +g_list_free(pChildren); +} +if (bHasFocusChild) + gtk_widget_child_focus(gtk_container_get_focus_child(GTK_CONTAINER(m_pWidget)), GTK_DIR_TAB_FORWARD); +enable_notify_events(); +} + virtual void move(weld::Widget* pWidget, weld::Container* pNewParent) override { GtkInstanceWidget* pGtkWidget = dynamic_cast(pWidget); @@ -8897,12 +8918,17 @@ public: { disable_notify_events(); gtk_widget_grab_focus(m_pWidget); -if (!gtk_container_get_focus_child(GTK_CONTAINER(m_pWidget))) +bool bHasFocusChild = gtk_container_get_focus_child(GTK_CONTAINER(m_pWidget)); +if (!bHasFocusChild) { -GtkToolItem* pItem = gtk_toolbar_get_nth_item(m_pToolbar, 0); -gtk_container_set_focus_child(GTK_CONTAINER(m_pWidget), GTK_WIDGET(pItem)); +if (GtkToolItem* pItem = gtk_toolbar_get_nth_item(m_pToolbar, 0)) +{ +gtk_container_set_focus_child(GTK_CONTAINER(m_pWidget), GTK_WIDGET(pItem)); +bHasFocusChild = true; +} } - gtk_widget_child_focus(gtk_container_get_focus_child(GTK_CONTAINER(m_pWidget)), GTK_DIR_TAB_FORWARD); +if (bHasFocusChild) + gtk_widget_child_focus(gtk_container_get_focus_child(GTK_CONTAINER(m_pWidget)), GTK_DIR_TAB_FORWARD); enable_notify_events(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |1 + vcl/inc/salvtables.hxx|2 ++ vcl/source/app/salvtables.cxx |5 + vcl/unx/gtk3/gtk3gtkinst.cxx |5 + 4 files changed, 13 insertions(+) New commits: commit 90f25a4ff279aa4561861c313c7c18b9d42777a8 Author: Caolán McNamara AuthorDate: Tue Mar 16 11:30:07 2021 + Commit: Caolán McNamara CommitDate: Tue Mar 16 14:39:17 2021 +0100 add access to DumpAsPropertyTree for sidebar::Deck Change-Id: I9df780ba3a6701275256fff585f4a969178aaff2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112574 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 0b995277cd31..1fc18c85fb65 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -317,6 +317,7 @@ public: virtual css::uno::Reference get_drop_target() = 0; virtual void connect_get_property_tree(const Link& rLink) = 0; +virtual void get_property_tree(tools::JsonWriter& rJsonWriter) = 0; // render the widget to an output device virtual void draw(OutputDevice& rOutput, const Point& rPos, const Size& rSizePixel) = 0; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 340c546f6f40..efec58258868 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -365,6 +365,8 @@ public: virtual void connect_get_property_tree(const Link& rLink) override; +virtual void get_property_tree(tools::JsonWriter& rJsonWriter) override; + virtual void set_stack_background() override; virtual void set_title_background() override; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 083f571d858b..2a0009446132 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -539,6 +539,11 @@ void SalInstanceWidget::connect_get_property_tree(const LinkSetDumpAsPropertyTreeHdl(rLink); } +void SalInstanceWidget::get_property_tree(tools::JsonWriter& rJsonWriter) +{ +m_xWidget->DumpAsPropertyTree(rJsonWriter); +} + void SalInstanceWidget::set_stack_background() { set_background(m_xWidget->GetSettings().GetStyleSettings().GetWindowColor()); diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 882a6f0210e5..d15ee5d5a7e8 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -3049,6 +3049,11 @@ public: //not implemented for the gtk variant } +virtual void get_property_tree(tools::JsonWriter& /*rJsonWriter*/) override +{ +//not implemented for the gtk variant +} + virtual void set_stack_background() override { do_set_background(Application::GetSettings().GetStyleSettings().GetWindowColor()); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |3 ++- vcl/inc/salvtables.hxx|4 ++-- vcl/source/app/salvtables.cxx |4 ++-- vcl/unx/gtk3/gtk3gtkinst.cxx | 10 +- 4 files changed, 11 insertions(+), 10 deletions(-) New commits: commit 6d7a7845ae9f774daf8da6ac528d970d29fa2b1d Author: Caolán McNamara AuthorDate: Sun Mar 7 16:08:43 2021 + Commit: Caolán McNamara CommitDate: Sun Mar 7 20:26:07 2021 +0100 move queue_resize to baseclass Change-Id: I7f34037fc2c48168a56918c83ac7323febfe7486 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112139 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index a5590b73f6ae..0b995277cd31 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -289,6 +289,8 @@ public: virtual void set_busy_cursor(bool bBusy) = 0; +virtual void queue_resize() = 0; + virtual std::unique_ptr weld_parent() const = 0; //iterate upwards through the hierarchy starting at this widgets parent, @@ -2181,7 +2183,6 @@ public: } virtual void queue_draw() = 0; virtual void queue_draw_area(int x, int y, int width, int height) = 0; -virtual void queue_resize() = 0; virtual void enable_drag_source(rtl::Reference& rTransferrable, sal_uInt8 eDNDConstants) diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 02213a60f18e..1a0563307e0d 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -353,6 +353,8 @@ public: void enable_notify_events(); +virtual void queue_resize() override; + virtual void help_hierarchy_foreach(const std::function& func) override; virtual OUString strip_mnemonic(const OUString& rLabel) const override; @@ -1138,8 +1140,6 @@ public: virtual void queue_draw_area(int x, int y, int width, int height) override; -virtual void queue_resize() override; - virtual void connect_size_allocate(const Link& rLink) override; virtual void connect_key_press(const Link& rLink) override; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 18789ee73a77..781381aff7b2 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -493,6 +493,8 @@ void SalInstanceWidget::set_busy_cursor(bool bBusy) m_xWidget->LeaveWait(); } +void SalInstanceWidget::queue_resize() { m_xWidget->queue_resize(); } + SalInstanceWidget::~SalInstanceWidget() { if (m_aMnemonicActivateHdl.IsSet()) @@ -5897,8 +5899,6 @@ void SalInstanceDrawingArea::queue_draw_area(int x, int y, int width, int height m_xDrawingArea->Invalidate(tools::Rectangle(Point(x, y), Size(width, height))); } -void SalInstanceDrawingArea::queue_resize() { m_xDrawingArea->queue_resize(); } - void SalInstanceDrawingArea::connect_size_allocate(const Link& rLink) { weld::Widget::connect_size_allocate(rLink); diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 0a37e8175d86..f1e99eccca07 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -3021,6 +3021,11 @@ public: set_cursor(m_pWidget, bBusy ? "progress" : nullptr); } +virtual void queue_resize() override +{ +gtk_widget_queue_resize(m_pWidget); +} + virtual css::uno::Reference get_drop_target() override { if (!m_xDropTarget) @@ -13933,11 +13938,6 @@ public: gtk_widget_queue_draw_area(GTK_WIDGET(m_pDrawingArea), aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight()); } -virtual void queue_resize() override -{ -gtk_widget_queue_resize(GTK_WIDGET(m_pDrawingArea)); -} - virtual a11yref get_accessible_parent() override { //get_accessible_parent should only be needed for the vcl implementation, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
vcl/inc/DropdownBox.hxx |2 +- vcl/inc/PriorityMergedHBox.hxx|2 +- vcl/source/control/NotebookbarPopup.cxx |2 +- vcl/source/control/PriorityMergedHBox.cxx |2 +- 4 files changed, 4 insertions(+), 4 deletions(-) New commits: commit 17e253a5de94ccce31300247fa53e05d9d499ff5 Author: Caolán McNamara AuthorDate: Sun Feb 28 20:54:08 2021 + Commit: Caolán McNamara CommitDate: Mon Mar 1 10:11:41 2021 +0100 NotebookbarPopup.hxx can move into private headers Change-Id: I5c887863ded85e68003ed935cb64c4540ce13117 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111721 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/inc/DropdownBox.hxx b/vcl/inc/DropdownBox.hxx index 3aa55b5ef367..4f60cd4f67e1 100644 --- a/vcl/inc/DropdownBox.hxx +++ b/vcl/inc/DropdownBox.hxx @@ -21,8 +21,8 @@ #define INCLUDED_SFX2_NOTEBOOKBAR_DROPDOWNBOX_HXX #include -#include #include +#include "NotebookbarPopup.hxx" class DropdownBox : public VclHBox, public vcl::IPrioritable { diff --git a/include/vcl/notebookbar/NotebookbarPopup.hxx b/vcl/inc/NotebookbarPopup.hxx similarity index 100% rename from include/vcl/notebookbar/NotebookbarPopup.hxx rename to vcl/inc/NotebookbarPopup.hxx diff --git a/vcl/inc/PriorityMergedHBox.hxx b/vcl/inc/PriorityMergedHBox.hxx index 15972d2d7531..548243c06f7c 100644 --- a/vcl/inc/PriorityMergedHBox.hxx +++ b/vcl/inc/PriorityMergedHBox.hxx @@ -19,8 +19,8 @@ #include #include +#include "NotebookbarPopup.hxx" #include "PriorityHBox.hxx" -#include class PriorityMergedHBox : public PriorityHBox { diff --git a/vcl/source/control/NotebookbarPopup.cxx b/vcl/source/control/NotebookbarPopup.cxx index 7a8aaadc0dd8..48368776da87 100644 --- a/vcl/source/control/NotebookbarPopup.cxx +++ b/vcl/source/control/NotebookbarPopup.cxx @@ -7,11 +7,11 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include #include #include #include #include +#include NotebookbarPopup::NotebookbarPopup(const VclPtr& pParent) : FloatingWindow(pParent, "Popup", "sfx/ui/notebookbarpopup.ui") diff --git a/vcl/source/control/PriorityMergedHBox.cxx b/vcl/source/control/PriorityMergedHBox.cxx index b2f16db25276..43b13b5175f8 100644 --- a/vcl/source/control/PriorityMergedHBox.cxx +++ b/vcl/source/control/PriorityMergedHBox.cxx @@ -20,9 +20,9 @@ #include #include #include +#include #include #include -#include #include #define DUMMY_WIDTH 50 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/window.hxx|2 + vcl/inc/salvtables.hxx|2 + vcl/source/app/salvtables.cxx | 54 -- 3 files changed, 46 insertions(+), 12 deletions(-) New commits: commit 73b590484023d59300e795e52f80da3f4de448f2 Author: Caolán McNamara AuthorDate: Thu Feb 4 20:48:41 2021 + Commit: Caolán McNamara CommitDate: Fri Feb 5 15:54:44 2021 +0100 improve SalInstanceWidget::draw Change-Id: I9acb8dfceee586b343feb184e0788491d66d24a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110427 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 4decec615469..d2129d2b0163 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -432,6 +432,7 @@ class FloatingWindow; class GroupBox; class PushButton; class RadioButton; +class SalInstanceWidget; class SystemChildWindow; class ImplDockingWindowWrapper; class ImplPopupFloatWin; @@ -493,6 +494,7 @@ class VCL_DLLPUBLIC Window : public ::OutputDevice friend class ::GroupBox; friend class ::PushButton; friend class ::RadioButton; +friend class ::SalInstanceWidget; friend class ::SystemChildWindow; friend class ::ImplBorderWindow; friend class ::PaintHelper; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 6f3fccc87005..8f431002359d 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -174,6 +174,8 @@ private: DECL_LINK(MouseEventListener, VclSimpleEvent&, void); DECL_LINK(MnemonicActivateHdl, vcl::Window&, bool); +static void DoRecursivePaint(vcl::Window* pWindow, const Point& rPos, OutputDevice& rOutput); + const bool m_bTakeOwnership; bool m_bEventListener; bool m_bKeyEventListener; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index c1ac2432ff7c..f983237dafed 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1172,39 +1172,69 @@ std::unique_ptr SalInstanceWidget::weld_parent() const return std::make_unique(pParent, m_pBuilder, false); } -namespace -{ -void DoRecursivePaint(vcl::Window* pWindow, const Point& rPos, OutputDevice& rOutput) +void SalInstanceWidget::DoRecursivePaint(vcl::Window* pWindow, const Point& rRenderLogicPos, + OutputDevice& rOutput) { -Size aSize = pWindow->GetSizePixel(); +pWindow->Push(); +bool bOldMapModeEnabled = pWindow->IsMapModeEnabled(); + +if (pWindow->GetMapMode().GetMapUnit() != rOutput.GetMapMode().GetMapUnit()) +{ +// This is needed for e.g. the scrollbar in writer comments in margins that has its map unit in pixels +// as seen with bin/run gtktiledviewer --enable-tiled-annotations on a document containing a comment +// long enough to need a scrollbar +pWindow->EnableMapMode(); +MapMode aMapMode = pWindow->GetMapMode(); +aMapMode.SetMapUnit(rOutput.GetMapMode().GetMapUnit()); +aMapMode.SetScaleX(rOutput.GetMapMode().GetScaleX()); +aMapMode.SetScaleY(rOutput.GetMapMode().GetScaleY()); +pWindow->SetMapMode(aMapMode); +} VclPtr xOutput(VclPtr::Create(DeviceFormat::DEFAULT)); -xOutput->SetOutputSizePixel(aSize); -xOutput->DrawOutDev(Point(), aSize, rPos, aSize, rOutput); +Size aChildSizePixel(pWindow->GetSizePixel()); +xOutput->SetOutputSizePixel(aChildSizePixel); -//set ReallyVisible to match Visible, we restore the original -//state after Paint +MapMode aMapMode(xOutput->GetMapMode()); +aMapMode.SetMapUnit(rOutput.GetMapMode().GetMapUnit()); +aMapMode.SetScaleX(rOutput.GetMapMode().GetScaleX()); +aMapMode.SetScaleY(rOutput.GetMapMode().GetScaleY()); +xOutput->SetMapMode(aMapMode); + +Size aTempLogicSize(xOutput->PixelToLogic(aChildSizePixel)); +Size aRenderLogicSize(rOutput.PixelToLogic(aChildSizePixel)); + +xOutput->DrawOutDev(Point(), aTempLogicSize, rRenderLogicPos, aRenderLogicSize, rOutput); + +//set ReallyVisible to match Visible, we restore the original state after Paint WindowImpl* pImpl = pWindow->ImplGetWindowImpl(); bool bRVisible = pImpl->mbReallyVisible; pImpl->mbReallyVisible = pWindow->IsVisible(); -pWindow->Paint(*xOutput, tools::Rectangle(Point(), pWindow->PixelToLogic(aSize))); +pWindow->ApplySettings(*xOutput); +pWindow->Paint(*xOutput, tools::Rectangle(Point(), pWindow->PixelToLogic(aChildSizePixel))); pImpl->mbReallyVisible = bRVisible; -rOutput.DrawOutDev(rPos, aSize, Point(), aSize, *xOutput); +rOutput.DrawOutDev(rRenderLogicPos, aRenderLogicSize, Point(), aTempLogicSize, *xOutput); xOutput.disposeAndClear(); +pWindow->EnableMapMode(bOldMapModeEnabled); +pWindow->Pop(); + for (vcl::Window* pChild = pWindow->GetWindow(GetWindowType::FirstChild); pChild; pChild =
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |2 +- vcl/inc/salvtables.hxx |2 +- vcl/source/app/salvtables.cxx| 15 +-- vcl/source/control/InterimItemWindow.cxx |4 +--- vcl/unx/gtk3/gtk3gtkinst.cxx |8 5 files changed, 16 insertions(+), 15 deletions(-) New commits: commit 955fd7d8dc9da29717371c8fcb25d9954ff975bd Author: Caolán McNamara AuthorDate: Wed Feb 3 17:27:02 2021 + Commit: Caolán McNamara CommitDate: Thu Feb 4 21:49:22 2021 +0100 split rect arg into dest pos and source rect Change-Id: I622979fa54e54f1c6e00b5a16546fdbc12957422 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110383 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 70a340c85b30..18e0cd6abdbc 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -315,7 +315,7 @@ public: virtual void connect_get_property_tree(const Link& rLink) = 0; // render the widget to an output device -virtual void draw(OutputDevice& rOutput, const tools::Rectangle& rRect) = 0; +virtual void draw(OutputDevice& rOutput, const Point& rPos, const Size& rSizePixel) = 0; virtual ~Widget() {} }; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 8d8138690bf1..6f3fccc87005 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -366,7 +366,7 @@ public: virtual void set_background(const Color& rColor) override; -virtual void draw(OutputDevice& rOutput, const tools::Rectangle& rRect) override; +virtual void draw(OutputDevice& rOutput, const Point& rPos, const Size& rSizePixel) override; SystemWindow* getSystemWindow(); }; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index e9e675e1645b..c1ac2432ff7c 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1188,7 +1188,7 @@ void DoRecursivePaint(vcl::Window* pWindow, const Point& rPos, OutputDevice& rOu bool bRVisible = pImpl->mbReallyVisible; pImpl->mbReallyVisible = pWindow->IsVisible(); -pWindow->Paint(*xOutput, tools::Rectangle(Point(), aSize)); +pWindow->Paint(*xOutput, tools::Rectangle(Point(), pWindow->PixelToLogic(aSize))); pImpl->mbReallyVisible = bRVisible; @@ -1201,19 +1201,22 @@ void DoRecursivePaint(vcl::Window* pWindow, const Point& rPos, OutputDevice& rOu { if (!pChild->IsVisible()) continue; -DoRecursivePaint(pChild, rPos + pChild->GetPosPixel(), rOutput); +DoRecursivePaint(pChild, rPos + rOutput.PixelToLogic(pChild->GetPosPixel()), rOutput); } } } -void SalInstanceWidget::draw(OutputDevice& rOutput, const tools::Rectangle& rRect) +void SalInstanceWidget::draw(OutputDevice& rOutput, const Point& rPos, const Size& rSizePixel) { Size aOrigSize(m_xWidget->GetSizePixel()); +bool bChangeSize = aOrigSize != rSizePixel; +if (bChangeSize) +m_xWidget->SetSizePixel(rSizePixel); -m_xWidget->SetSizePixel(rRect.GetSize()); -DoRecursivePaint(m_xWidget, rRect.TopLeft(), rOutput); +DoRecursivePaint(m_xWidget, rPos, rOutput); -m_xWidget->SetSizePixel(aOrigSize); +if (bChangeSize) +m_xWidget->SetSizePixel(aOrigSize); } namespace diff --git a/vcl/source/control/InterimItemWindow.cxx b/vcl/source/control/InterimItemWindow.cxx index 97d64b617648..3817e01893f1 100644 --- a/vcl/source/control/InterimItemWindow.cxx +++ b/vcl/source/control/InterimItemWindow.cxx @@ -163,9 +163,7 @@ bool InterimItemWindow::ChildKeyInput(const KeyEvent& rKEvt) void InterimItemWindow::Draw(OutputDevice* pDevice, const Point& rPos, DrawFlags /*nFlags*/) { -if (!m_pWidget) -return; -m_pWidget->draw(*pDevice, tools::Rectangle(rPos, GetSizePixel())); +m_xContainer->draw(*pDevice, rPos, GetSizePixel()); } void InterimItemWindow::ImplPaintToDevice(::OutputDevice* pTargetOutDev, const Point& rPos) diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index cfd8eacabff4..967531bfc4d4 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -3152,7 +3152,7 @@ public: return xRet; } -virtual void draw(OutputDevice& rOutput, const tools::Rectangle& rRect) override +virtual void draw(OutputDevice& rOutput, const Point& rPos, const Size& rPixelSize) override { // detect if we have to manually setup its size bool bAlreadyRealized = gtk_widget_get_realized(m_pWidget); @@ -3177,7 +3177,7 @@ public: if (bAnimations) g_object_set(pSettings, "gtk-enable-animations", false, nullptr); -Size aSize(rRect.GetSize()); +Size aSize(rPixelSize); GtkAllocation aOrigAllocation; gtk_widget_get_allocation(m_pWidget, ); @@ -3193,7 +3193,7 @@ public: VclPtr xOutput(VclPtr::Create(DeviceFormat::DEFAULT));
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/graph.hxx |1 + vcl/inc/graphic/Manager.hxx|3 +++ vcl/inc/impgraph.hxx |1 + vcl/source/filter/ipdf/pdfread.cxx |6 +- vcl/source/gdi/graph.cxx |5 + vcl/source/gdi/impgraph.cxx| 17 + vcl/source/graphic/Manager.cxx |8 7 files changed, 36 insertions(+), 5 deletions(-) New commits: commit 3adff41ab14ab27ca07cffef0f38471ac5321ee2 Author: Tomaž Vajngerl AuthorDate: Sat Jan 2 00:12:25 2021 +0900 Commit: Tomaž Vajngerl CommitDate: Fri Jan 22 07:49:17 2021 +0100 vcl: support creating a Graphic with only GfxLink as swapped-out This adds support to create a Graphic with only a GfxLink and the Graphic is in a swapped-out state. This is similar to the prepared state, but the prepared state is a special state of the Graphic. In the future, all loading will probably be done in this way and prepared state will go away, but for now this is only supported for PDF and is used in PDFium import only. The main reason is to avoid that a multi-page PDF is immediately swapped out after loading, which just does unneeded work and freezes the application for a while. Change-Id: I409741d27a4ad309264cdf27b2ba03f2cf37ead9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109600 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx index 86d885a326ac..79083bb5a224 100644 --- a/include/vcl/graph.hxx +++ b/include/vcl/graph.hxx @@ -89,6 +89,7 @@ public: SAL_DLLPRIVATE ImpGraphic* ImplGetImpGraphic() const { return mxImpGraphic.get(); } Graphic(); +Graphic(std::shared_ptr const & rGfxLink, sal_Int32 nPageIndex = 0); Graphic( const GraphicExternalLink& rGraphicLink ); Graphic( const Graphic& rGraphic ); Graphic( Graphic&& rGraphic ) noexcept; diff --git a/vcl/inc/graphic/Manager.hxx b/vcl/inc/graphic/Manager.hxx index 098c8644ac61..4319620e21c4 100644 --- a/vcl/inc/graphic/Manager.hxx +++ b/vcl/inc/graphic/Manager.hxx @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -60,6 +61,8 @@ public: std::shared_ptr copy(std::shared_ptr const& pImpGraphic); std::shared_ptr newInstance(); std::shared_ptr newInstance(const BitmapEx& rBitmapEx); +std::shared_ptr newInstance(std::shared_ptr const& rLink, +sal_Int32 nPageIndex = 0); std::shared_ptr newInstance(const std::shared_ptr& rVectorGraphicDataPtr); std::shared_ptr newInstance(const Animation& rAnimation); diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index 2ee0e9ef61ec..6287be0df1b1 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -90,6 +90,7 @@ public: ImpGraphic( const ImpGraphic& rImpGraphic ); ImpGraphic( ImpGraphic&& rImpGraphic ) noexcept; ImpGraphic( const GraphicExternalLink& rExternalLink); +ImpGraphic(std::shared_ptr const& rGfxLink, sal_Int32 nPageIndex = 0); ImpGraphic( const BitmapEx& rBmpEx ); ImpGraphic(const std::shared_ptr& rVectorGraphicDataPtr); ImpGraphic( const Animation& rAnimation ); diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx index 7a7d1c75aa38..f2730dbfe811 100644 --- a/vcl/source/filter/ipdf/pdfread.cxx +++ b/vcl/source/filter/ipdf/pdfread.cxx @@ -474,14 +474,10 @@ size_t ImportPDFUnloaded(const OUString& rURL, std::vector& rG tools::Long nPageWidth = convertTwipToMm100(aPageSize.getX() * pointToTwipconversionRatio); tools::Long nPageHeight = convertTwipToMm100(aPageSize.getY() * pointToTwipconversionRatio); -auto aVectorGraphicDataPtr = std::make_shared( -aDataContainer, VectorGraphicDataType::Pdf, nPageIndex); - // Create the Graphic with the VectorGraphicDataPtr and link the original PDF stream. // We swap out this Graphic as soon as possible, and a later swap in // actually renders the correct Bitmap on demand. -Graphic aGraphic(aVectorGraphicDataPtr); -aGraphic.SetGfxLink(pGfxLink); +Graphic aGraphic(pGfxLink, nPageIndex); auto pPage = pPdfDocument->openPage(nPageIndex); diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index 033e5576ce20..74a61e871e78 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -177,6 +177,11 @@ Graphic::Graphic(Graphic&& rGraphic) noexcept { } +Graphic::Graphic(std::shared_ptr const & rGfxLink, sal_Int32 nPageIndex) +: mxImpGraphic(vcl::graphic::Manager::get().newInstance(rGfxLink, nPageIndex)) +{ +} + Graphic::Graphic(GraphicExternalLink const & rGraphicExternalLink) : mxImpGraphic(vcl::graphic::Manager::get().newInstance(rGraphicExternalLink)) { diff --git
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/toolkit/roadmap.hxx |2 +- vcl/inc/wizdlg.hxx |2 +- vcl/source/app/salvtables.cxx|2 +- vcl/source/control/roadmap.cxx |5 +++-- vcl/source/control/roadmapwizard.cxx |4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) New commits: commit a4c9b7f3722cb496c01ae72c5897f3243523658d Author: Caolán McNamara AuthorDate: Fri Jan 15 16:39:08 2021 + Commit: Caolán McNamara CommitDate: Sat Jan 16 16:03:19 2021 +0100 tdf#138829 don't grab focus to roadmap label when sync timer fires Change-Id: Icc8a03a2ce5d63f3a2c477671a9aa52aefd1df96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109385 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/toolkit/roadmap.hxx b/include/vcl/toolkit/roadmap.hxx index c2654c1fd56e..7cfd6d7bd290 100644 --- a/include/vcl/toolkit/roadmap.hxx +++ b/include/vcl/toolkit/roadmap.hxx @@ -73,7 +73,7 @@ public: voidDeleteRoadmapItem( ItemIndex _nIndex ); ItemId GetCurrentRoadmapItemID() const; -boolSelectRoadmapItemByID( ItemId _nItemID ); +boolSelectRoadmapItemByID(ItemId nItemID, bool bGrabFocus = true); voidSetItemSelectHdl( const Link& _rHdl ); Link const & GetItemSelectHdl( ) const; diff --git a/vcl/inc/wizdlg.hxx b/vcl/inc/wizdlg.hxx index 32a6401a6799..7c6af8636260 100644 --- a/vcl/inc/wizdlg.hxx +++ b/vcl/inc/wizdlg.hxx @@ -145,7 +145,7 @@ namespace vcl voidInsertRoadmapItem(int nIndex, const OUString& rLabel, int nId, bool bEnabled); voidDeleteRoadmapItems(); int GetCurrentRoadmapItemID() const; -voidSelectRoadmapItemByID(int nId); +voidSelectRoadmapItemByID(int nId, bool bGrabFocus = true); voidSetItemSelectHdl( const Link& _rHdl ); voidShowRoadmap(bool bShow); diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index cb806a5174bd..d10a2450d5c0 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1913,7 +1913,7 @@ IMPL_LINK_NOARG(SalInstanceAssistant, UpdateRoadmap_Hdl, Timer*, void) m_xWizard->InsertRoadmapItem(nPos++, rLabel, m_aIds[i], bSensitive); } -m_xWizard->SelectRoadmapItemByID(m_aIds[get_current_page()]); +m_xWizard->SelectRoadmapItemByID(m_aIds[get_current_page()], false); m_xWizard->ShowRoadmap(nPos != 0); diff --git a/vcl/source/control/roadmap.cxx b/vcl/source/control/roadmap.cxx index f1df11cff5bb..bc6a9c125de8 100644 --- a/vcl/source/control/roadmap.cxx +++ b/vcl/source/control/roadmap.cxx @@ -523,7 +523,7 @@ void ORoadmap::GetFocus() pCurHyperLabel->GrabFocus(); } -bool ORoadmap::SelectRoadmapItemByID( ItemId _nNewID ) +bool ORoadmap::SelectRoadmapItemByID(ItemId _nNewID, bool bGrabFocus) { DeselectOldRoadmapItems(); RoadmapItem* pItem = GetByID( _nNewID ); @@ -534,7 +534,8 @@ bool ORoadmap::SelectRoadmapItemByID( ItemId _nNewID ) const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); pItem->ToggleBackgroundColor( rStyleSettings.GetHighlightColor() ); //HighlightColor -pItem->GrabFocus(); +if (bGrabFocus) +pItem->GrabFocus(); m_pImpl->setCurItemID(_nNewID); Select(); diff --git a/vcl/source/control/roadmapwizard.cxx b/vcl/source/control/roadmapwizard.cxx index d73cc1a18a5b..1b24e39cc4fc 100644 --- a/vcl/source/control/roadmapwizard.cxx +++ b/vcl/source/control/roadmapwizard.cxx @@ -827,9 +827,9 @@ namespace vcl m_xRoadmapImpl->pRoadmap->InsertRoadmapItem(nItemIndex, rText, nItemId, bEnable); } -void RoadmapWizard::SelectRoadmapItemByID(int nItemId) +void RoadmapWizard::SelectRoadmapItemByID(int nItemId, bool bGrabFocus) { -m_xRoadmapImpl->pRoadmap->SelectRoadmapItemByID(nItemId); +m_xRoadmapImpl->pRoadmap->SelectRoadmapItemByID(nItemId, bGrabFocus); } void RoadmapWizard::DeleteRoadmapItems() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |1 + vcl/inc/salvtables.hxx|1 + vcl/source/app/salvtables.cxx |4 vcl/unx/gtk3/gtk3gtkinst.cxx | 10 ++ 4 files changed, 16 insertions(+) New commits: commit 853df3ce24d4daa113a15d4211be682ada1fa6f2 Author: Caolán McNamara AuthorDate: Thu Dec 17 16:16:09 2020 + Commit: Caolán McNamara CommitDate: Thu Dec 17 22:02:15 2020 +0100 add Menu::get_sensitive Change-Id: I242ace497d7f049d9908cc6461b7eefc6d4a2b87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107889 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index d3bdf2ff147f..1265bf774ec7 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -2186,6 +2186,7 @@ public: void connect_activate(const Link& rLink) { m_aActivateHdl = rLink; } virtual void set_sensitive(const OString& rIdent, bool bSensitive) = 0; +virtual bool get_sensitive(const OString& rIdent) const = 0; virtual void set_label(const OString& rIdent, const OUString& rLabel) = 0; virtual OUString get_label(const OString& rIdent) const = 0; virtual void set_active(const OString& rIdent, bool bActive) = 0; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 0a6cbad7038e..b68a2fdeba96 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -143,6 +143,7 @@ public: SalInstanceMenu(PopupMenu* pMenu, bool bTakeOwnership); virtual OString popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect) override; virtual void set_sensitive(const OString& rIdent, bool bSensitive) override; +virtual bool get_sensitive(const OString& rIdent) const override; virtual void set_active(const OString& rIdent, bool bActive) override; virtual bool get_active(const OString& rIdent) const override; virtual void set_label(const OString& rIdent, const OUString& rLabel) override; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 167ff5766084..0524244ed6d2 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -737,6 +737,10 @@ void SalInstanceMenu::set_sensitive(const OString& rIdent, bool bSensitive) { m_xMenu->EnableItem(rIdent, bSensitive); } +bool SalInstanceMenu::get_sensitive(const OString& rIdent) const +{ +return m_xMenu->IsItemEnabled(m_xMenu->GetItemId(rIdent)); +} void SalInstanceMenu::set_active(const OString& rIdent, bool bActive) { m_xMenu->CheckItem(rIdent, bActive); diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 602246395aaa..829a3a4ca58f 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -3593,6 +3593,11 @@ public: gtk_widget_set_sensitive(GTK_WIDGET(m_aMap[rIdent]), bSensitive); } +bool get_item_sensitive(const OString& rIdent) const +{ +return gtk_widget_get_sensitive(GTK_WIDGET(m_aMap.find(rIdent)->second)); +} + void set_item_active(const OString& rIdent, bool bActive) { disable_item_notify_events(); @@ -8199,6 +8204,11 @@ public: set_item_sensitive(rIdent, bSensitive); } +virtual bool get_sensitive(const OString& rIdent) const override +{ +return get_item_sensitive(rIdent); +} + virtual void set_active(const OString& rIdent, bool bActive) override { set_item_active(rIdent, bActive); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/scheduler.hxx |1 + vcl/inc/schedulerimpl.hxx | 19 +++ vcl/source/app/svapp.cxx |1 + 3 files changed, 21 insertions(+) New commits: commit 46f6b39c6d8acd064bafb2416feba757ba0d0fbc Author: Mike Kaganski AuthorDate: Fri Dec 4 15:13:13 2020 +0300 Commit: Mike Kaganski CommitDate: Fri Dec 4 16:02:11 2020 +0100 Unlock scheduler when calling ProcessEventsToIdle When processing the events, solar mutex will be temporarily released, and then it's possible that another thread will acquire solar mutex and try to lock scheduler. This will result in deadlock. Seen in CppunitTest_sw_core_undo that deadlocked locally on Windows frequently. Main thread call stack: win32u.dll!NtUserMsgWaitForMultipleObjectsEx() user32.dll!RealMsgWaitForMultipleObjectsEx() sal3.dll!osl_waitCondition(void * Condition, const TimeValue * pTimeout) Line 82 vclplug_winlo.dll!osl::Condition::wait(const TimeValue * pTimeout) Line 120 vclplug_winlo.dll!SalYieldMutex::doAcquire(unsigned long nLockCount) Line 159 comphelper.dll!comphelper::SolarMutex::acquire(unsigned long nLockCount) Line 87 vclplug_winlo.dll!ImplSalYieldMutexAcquireWithWait(unsigned long nCount) Line 204 vclplug_winlo.dll!WinSalTimer::ImplHandleElapsedTimer() Line 163 vclplug_winlo.dll!WinSalTimer::ImplHandle_WM_TIMER(unsigned __int64 aWPARAM) Line 197 vclplug_winlo.dll!SalComWndProc(HWND__ * __formal, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam, bool & rDef) Line 638 vclplug_winlo.dll!SalComWndProcW(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 665 user32.dll!UserCallWinProcCheckWow() user32.dll!DispatchMessageWorker() vclplug_winlo.dll!ImplSalDispatchMessage(const tagMSG * pMsg) Line 426 vclplug_winlo.dll!ImplSalYield(bool bWait, bool bHandleAllCurrentEvents) Line 457 vclplug_winlo.dll!WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) Line 528 vcllo.dll!ImplYield(bool i_bWait, bool i_bAllEvents) Line 447 vcllo.dll!Application::Reschedule(bool i_bAllEvents) Line 461 vcllo.dll!Scheduler::ProcessEventsToIdle() Line 466 vcllo.dll!Scheduler::ImplDeInitScheduler() Line 129 vcllo.dll!DeInitVCL() Line 483 vclbootstrapprotector.dll!`anonymous namespace'::Protector::~Protector() Line 34 vclbootstrapprotector.dll!`anonymous namespace'::Protector::`scalar deleting destructor'(unsigned int) cppunitd_dll.dll!CppUnit::ProtectorChain::pop() Line 56 cppunitd_dll.dll!CppUnit::TestResult::popProtector() Line 197 cppunittester.exe!`anonymous namespace'::ProtectedFixtureFunctor::run() Line 332 cppunittester.exe!sal_main() Line 473 cppunittester.exe!main(int argc, char * * argv) Line 380 cppunittester.exe!invoke_main() Line 79 cppunittester.exe!__scrt_common_main_seh() Line 288 cppunittester.exe!__scrt_common_main() Line 331 cppunittester.exe!mainCRTStartup() Line 17 kernel32.dll!BaseThreadInitThunk() ntdll.dll!RtlUserThreadStart() Clipboard thread call stack: ntdll.dll!NtWaitForAlertByThreadId() ntdll.dll!RtlpWaitOnAddressWithTimeout() ntdll.dll!RtlpWaitOnAddress() ntdll.dll!RtlpWaitOnCriticalSection() ntdll.dll!RtlpEnterCriticalSectionContended() ntdll.dll!RtlEnterCriticalSection() sal3.dll!osl_acquireMutex(_oslMutexImpl * Mutex) Line 66 vcllo.dll!osl::Mutex::acquire() Line 57 vcllo.dll!SchedulerMutex::acquire(unsigned long nLockCount) Line 213 vcllo.dll!Scheduler::Lock(unsigned long nLockCount) Line 237 vcllo.dll!SchedulerGuard::SchedulerGuard() Line 60 vcllo.dll!Task::~Task() Line 660 vcllo.dll!Timer::~Timer() Line 61 vcllo.dll!Idle::~Idle() svxcorelo.dll!SdrPaintView::~SdrPaintView() Line 189 svxcorelo.dll!SdrSnapView::~SdrSnapView() Line 200 svxcorelo.dll!SdrMarkView::~SdrMarkView() Line 193 svxcorelo.dll!SdrEditView::~SdrEditView() Line 125 svxcorelo.dll!SdrPolyEditView::~SdrPolyEditView() Line 58 svxcorelo.dll!SdrGlueEditView::~SdrGlueEditView() Line 40 svxcorelo.dll!SdrObjEditView::~SdrObjEditView() Line 95 svxcorelo.dll!SdrExchangeView::~SdrExchangeView() svxcorelo.dll!SdrDragView::~SdrDragView() Line 65 svxcorelo.dll!SdrCreateView::~SdrCreateView() Line 200 svxcorelo.dll!SdrView::~SdrView() Line 159 swlo.dll!SdrView::`scalar deleting destructor'(unsigned int) swlo.dll!std::default_delete::operator()(SdrView * _Ptr) Line 2537 swlo.dll!std::unique_ptr>::~unique_ptr>() Line 2649 swlo.dll!SwDrawFrameFormat::MakeGraphic(ImageMap * __formal) Line 7491 swlo.dll!OutHTML_FrameFormatAsImage(Writer &
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/button.hxx|4 +++ include/vcl/weld.hxx |9 vcl/inc/salvtables.hxx|2 + vcl/source/app/salvtables.cxx |9 vcl/source/control/button.cxx | 24 +- vcl/unx/gtk3/gtk3gtkinst.cxx | 44 ++ 6 files changed, 91 insertions(+), 1 deletion(-) New commits: commit 9b12f2fe15403ab0a82abd11ba14dae4a70774a6 Author: Caolán McNamara AuthorDate: Thu Dec 3 17:15:06 2020 + Commit: Caolán McNamara CommitDate: Thu Dec 3 21:29:46 2020 +0100 support completely styling a welded button Change-Id: I6e45c711b406a3836dd230ceaa738c5a250ff846 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107173 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx index 627c68192acc..58cb4c1f81fd 100644 --- a/include/vcl/button.hxx +++ b/include/vcl/button.hxx @@ -82,6 +82,10 @@ public: DrawButtonFlags GetButtonState() const; DrawButtonFlags&GetButtonState(); +/// Set an image to use as the complete render view of a custom button, +/// instead of the usual contents of a button +voidSetCustomButtonImage( const Image& rImage ); +Image const & GetCustomButtonImage() const; boolIsSmallSymbol() const; voidSetSmallSymbol(); diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index a4c07aeebede..98c012378060 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1296,6 +1296,15 @@ public: // font size is in points, not pixels, e.g. see Window::[G]etPointFont virtual void set_font(const vcl::Font& rFont) = 0; +/* Sometimes, a widget should behave like a button (activate on click, + accept keyboard focus, etc), but look entirely different. + + pDevice, the custom look to use, or nullptr to unset. + + Typically doing this is ill advised. Consider using + set_accessible_name if you do. */ +virtual void set_custom_button(VirtualDevice* pDevice) = 0; + void connect_clicked(const Link& rLink) { m_aClickHdl = rLink; } }; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 9fe7a6a5dac5..2fd7198a7b65 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1007,6 +1007,8 @@ public: virtual void set_font(const vcl::Font& rFont) override; +virtual void set_custom_button(VirtualDevice* pDevice) override; + virtual ~SalInstanceButton() override; }; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 0daf586ebb89..ccc3757e6718 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2488,6 +2488,15 @@ void SalInstanceButton::set_font(const vcl::Font& rFont) m_xButton->Invalidate(); } +void SalInstanceButton::set_custom_button(VirtualDevice* pDevice) +{ +if (pDevice) +m_xButton->SetCustomButtonImage(createImage(*pDevice)); +else +m_xButton->SetCustomButtonImage(Image()); +m_xButton->Invalidate(); +} + OUString SalInstanceButton::get_label() const { return m_xButton->GetText(); } SalInstanceButton::~SalInstanceButton() { m_xButton->SetClickHdl(Link<::Button*, void>()); } diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 66a399c15bbc..38b32d4f54af 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -83,12 +83,14 @@ public: ImageAlign meImageAlign; SymbolAlign meSymbolAlign; +Image maCustomContentImage; + /** StatusListener. Updates the button as the slot state changes */ rtl::Reference> mpStatusListener; }; ImplCommonButtonData::ImplCommonButtonData() : maFocusRect(), mnSeparatorX(0), mnButtonState(DrawButtonFlags::NONE), -mbSmallSymbol(false), maImage(), meImageAlign(ImageAlign::Top), meSymbolAlign(SymbolAlign::LEFT) +mbSmallSymbol(false), maImage(), meImageAlign(ImageAlign::Top), meSymbolAlign(SymbolAlign::LEFT), maCustomContentImage() { } @@ -158,6 +160,20 @@ ImageAlign Button::GetImageAlign() const return mpButtonData->meImageAlign; } +void Button::SetCustomButtonImage(const Image& rImage) +{ +if (rImage != mpButtonData->maCustomContentImage) +{ +mpButtonData->maCustomContentImage = rImage; +StateChanged( StateChangedType::Data ); +} +} + +Image const & Button::GetCustomButtonImage() const +{ +return mpButtonData->maCustomContentImage; +} + tools::Long Button::ImplGetSeparatorX() const { return mpButtonData->mnSeparatorX; @@ -1294,6 +1310,12 @@ void PushButton::FillLayoutData() const void PushButton::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) { +const Image& rCustomButtonImage = GetCustomButtonImage(); +if (!!rCustomButtonImage) +{ +rRenderContext.DrawImage(Point(0, 0), rCustomButtonImage); +return; +}
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/outdev.hxx |8 - include/vcl/window.hxx |4 vcl/inc/salgdi.hxx | 75 +- vcl/source/gdi/salgdilayout.cxx | 244 +-- vcl/source/gdi/virdev.cxx|2 vcl/source/outdev/bitmap.cxx | 14 +- vcl/source/outdev/clipping.cxx |2 vcl/source/outdev/curvedshapes.cxx | 14 +- vcl/source/outdev/hatch.cxx |2 vcl/source/outdev/line.cxx |8 - vcl/source/outdev/mask.cxx |4 vcl/source/outdev/nativecontrols.cxx |6 vcl/source/outdev/outdev.cxx | 33 ++-- vcl/source/outdev/pixel.cxx |6 vcl/source/outdev/polygon.cxx| 24 +-- vcl/source/outdev/polyline.cxx |8 - vcl/source/outdev/rect.cxx | 18 +- vcl/source/outdev/text.cxx |2 vcl/source/outdev/textline.cxx | 18 +- vcl/source/outdev/transparent.cxx|2 vcl/source/window/mouse.cxx |2 vcl/source/window/paint.cxx |2 vcl/source/window/window.cxx | 22 +-- vcl/source/window/window2.cxx| 12 - 24 files changed, 265 insertions(+), 267 deletions(-) New commits: commit 0820920e994cd2281cda34afa2235ee9aa1dd2c2 Author: Caolán McNamara AuthorDate: Fri Nov 27 12:47:27 2020 + Commit: Caolán McNamara CommitDate: Sat Nov 28 20:32:29 2020 +0100 drawOutDevDirect always passed a non-null OutputDevice* likewise: DrawOutDevDirectProcess ImplDrawWavePixel DrawOutDevDirectCheck and various members of SalGraphics dropping redundant nullptr checks Change-Id: Iaa1ab7c8a605361a7c9cce0aeee974eec9ff246e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106788 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 1b29dddf532b..c11d1abc1875 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -565,11 +565,11 @@ protected: virtual tools::RectangleGetBackgroundComponentBounds() const; -virtual const OutputDevice* DrawOutDevDirectCheck(const OutputDevice* pSrcDev) const; +virtual const OutputDevice* DrawOutDevDirectCheck(const OutputDevice& rSrcDev) const; -virtual voidDrawOutDevDirectProcess( const OutputDevice* pSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ); +virtual voidDrawOutDevDirectProcess(const OutputDevice& rSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics); -SAL_DLLPRIVATE void drawOutDevDirect ( const OutputDevice* pSrcDev, SalTwoRect& rPosAry ); +SAL_DLLPRIVATE void drawOutDevDirect(const OutputDevice& rSrcDev, SalTwoRect& rPosAry); SAL_DLLPRIVATE bool is_double_buffered_window() const; @@ -1206,7 +1206,7 @@ private: SAL_DLLPRIVATE void ImplDrawSpecialText( SalLayout& ); SAL_DLLPRIVATE void ImplDrawTextRect( tools::Long nBaseX, tools::Long nBaseY, tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ); -SAL_DLLPRIVATE static void ImplDrawWavePixel( tools::Long nOriginX, tools::Long nOriginY, tools::Long nCurX, tools::Long nCurY, Degree10 nOrientation, SalGraphics* pGraphics, OutputDevice const * pOutDev, +SAL_DLLPRIVATE static void ImplDrawWavePixel( tools::Long nOriginX, tools::Long nOriginY, tools::Long nCurX, tools::Long nCurY, Degree10 nOrientation, SalGraphics* pGraphics, const OutputDevice& rOutDev, bool bDrawPixAsRect, tools::Long nPixWidth, tools::Long nPixHeight ); SAL_DLLPRIVATE void ImplDrawWaveLine( tools::Long nBaseX, tools::Long nBaseY, tools::Long nStartX, tools::Long nStartY, tools::Long nWidth, tools::Long nHeight, tools::Long nLineWidth, Degree10 nOrientation, const Color& rColor ); SAL_DLLPRIVATE void ImplDrawWaveTextLine( tools::Long nBaseX, tools::Long nBaseY, tools::Long nX, tools::Long nY, tools::Long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove ); diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 0a378a11f65e..b88f565fcc88 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -760,8 +760,8 @@ protected: virtual voidImplAdjustNWFSizes(); virtual voidCopyDeviceArea( SalTwoRect& aPosAry, bool bWindowInvalidate) override; -virtual const OutputDevice* DrawOutDevDirectCheck(const OutputDevice* pSrcDev) const override; -virtual voidDrawOutDevDirectProcess( const OutputDevice* pSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) override; +virtual const OutputDevice* DrawOutDevDirectCheck(const OutputDevice& rSrcDev) const override; +virtual voidDrawOutDevDirectProcess(const OutputDevice& rSrcDev, SalTwoRect& rPosAry, SalGraphics*
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |2 ++ vcl/inc/salvtables.hxx|1 + vcl/source/app/salvtables.cxx |4 vcl/unx/gtk3/gtk3gtkinst.cxx | 10 ++ 4 files changed, 17 insertions(+) New commits: commit 8a92373a20dfce8112e45bd80f0f6c927224ff98 Author: Caolán McNamara AuthorDate: Sat Nov 14 20:01:52 2020 + Commit: Caolán McNamara CommitDate: Sun Nov 15 20:09:24 2020 +0100 add Menu::get_id Change-Id: I608db63f700312f7d7ffc6bfbd0e03971bfb00e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105845 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 7387db806350..28dd95818293 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -2174,6 +2174,8 @@ public: // return the number of toplevel nodes virtual int n_children() const = 0; +virtual OString get_id(int pos) const = 0; + virtual ~Menu() {} }; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 7eff04d56c7e..f3f4a585cecf 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -151,6 +151,7 @@ public: TriState eCheckRadioFalse) override; virtual void insert_separator(int pos, const OUString& rId) override; virtual void remove(const OString& rId) override; +virtual OString get_id(int pos) const override; virtual int n_children() const override; PopupMenu* getMenu() const; virtual ~SalInstanceMenu() override; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 585dd36325a3..82e742c62da9 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -763,6 +763,10 @@ void SalInstanceMenu::remove(const OString& rId) m_xMenu->RemoveItem(m_xMenu->GetItemPos(m_xMenu->GetItemId(rId))); } int SalInstanceMenu::n_children() const { return m_xMenu->GetItemCount(); } +OString SalInstanceMenu::get_id(int pos) const +{ +return m_xMenu->GetItemIdent(m_xMenu->GetItemId(pos)); +} PopupMenu* SalInstanceMenu::getMenu() const { return m_xMenu.get(); } SalInstanceMenu::~SalInstanceMenu() { diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index a74533faa787..1b53f714a6ec 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -8156,6 +8156,16 @@ public: gtk_menu_reorder_child(m_pMenu, pItem, pos); } +virtual OString get_id(int pos) const override +{ +GList* pChildren = gtk_container_get_children(GTK_CONTAINER(m_pMenu)); +gpointer pMenuItem = g_list_nth_data(pChildren, pos); +const gchar* pStr = gtk_buildable_get_name(GTK_BUILDABLE(pMenuItem)); +OString id(pStr, pStr ? strlen(pStr) : 0); +g_list_free(pChildren); +return id; +} + virtual int n_children() const override { GList* pChildren = gtk_container_get_children(GTK_CONTAINER(m_pMenu)); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |1 + vcl/inc/salvtables.hxx|2 ++ vcl/source/app/salvtables.cxx |5 + vcl/unx/gtk3/gtk3gtkinst.cxx |8 4 files changed, 16 insertions(+) New commits: commit 64c93c950e191d8c6ee7cf138ff60d085c9486de Author: Caolán McNamara AuthorDate: Fri Nov 13 09:24:19 2020 + Commit: Caolán McNamara CommitDate: Fri Nov 13 22:08:04 2020 +0100 add set_accessible_description Change-Id: I18aebc4a127ff92f5d2606490e4f120d4b98b4ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105796 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 51f2f9d44506..7387db806350 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -165,6 +165,7 @@ public: int& height) const = 0; virtual void set_accessible_name(const OUString& rName) = 0; +virtual void set_accessible_description(const OUString& rDescription) = 0; virtual OUString get_accessible_name() const = 0; virtual OUString get_accessible_description() const = 0; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 7717502833e8..7eff04d56c7e 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -275,6 +275,8 @@ public: virtual void set_accessible_name(const OUString& rName) override; +virtual void set_accessible_description(const OUString& rDescription) override; + virtual OUString get_accessible_name() const override; virtual OUString get_accessible_description() const override; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 1327e9d6e4f3..585dd36325a3 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -362,6 +362,11 @@ void SalInstanceWidget::set_accessible_name(const OUString& rName) m_xWidget->SetAccessibleName(rName); } +void SalInstanceWidget::set_accessible_description(const OUString& rDescription) +{ +m_xWidget->SetAccessibleDescription(rDescription); +} + OUString SalInstanceWidget::get_accessible_name() const { return m_xWidget->GetAccessibleName(); } OUString SalInstanceWidget::get_accessible_description() const diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 3105a4e3056b..a74533faa787 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -2731,6 +2731,14 @@ public: atk_object_set_name(pAtkObject, OUStringToOString(rName, RTL_TEXTENCODING_UTF8).getStr()); } +virtual void set_accessible_description(const OUString& rDescription) override +{ +AtkObject* pAtkObject = gtk_widget_get_accessible(m_pWidget); +if (!pAtkObject) +return; +atk_object_set_description(pAtkObject, OUStringToOString(rDescription, RTL_TEXTENCODING_UTF8).getStr()); +} + virtual OUString get_accessible_name() const override { AtkObject* pAtkObject = gtk_widget_get_accessible(m_pWidget); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/menubtn.hxx| 11 --- vcl/inc/menutogglebutton.hxx | 34 ++ vcl/source/app/salvtables.cxx |2 +- vcl/source/control/menubtn.cxx |1 + vcl/source/window/builder.cxx |1 + 5 files changed, 37 insertions(+), 12 deletions(-) New commits: commit 46dd214ab94181d3c552d86ec20b4a2c104fcc48 Author: Caolán McNamara AuthorDate: Sat Oct 17 21:09:15 2020 +0100 Commit: Caolán McNamara CommitDate: Thu Oct 22 21:07:28 2020 +0200 MenuToggleButton no longer needs to be in public headers Change-Id: Ifc190ddc0c9b5eb33555dcec5ed14fd9b36134e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104537 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/menubtn.hxx b/include/vcl/menubtn.hxx index fef1ad346805..f32270161b8d 100644 --- a/include/vcl/menubtn.hxx +++ b/include/vcl/menubtn.hxx @@ -91,17 +91,6 @@ public: }; - -class UNLESS_MERGELIBS(VCL_DLLPUBLIC) MenuToggleButton final : public MenuButton -{ -public: -explicitMenuToggleButton( vcl::Window* pParent, WinBits nStyle ); -virtual ~MenuToggleButton() override; - -voidSetActive( bool bSel ); -boolGetActive() const; -}; - #endif // INCLUDED_VCL_MENUBTN_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/menutogglebutton.hxx b/vcl/inc/menutogglebutton.hxx new file mode 100644 index ..e297926822d6 --- /dev/null +++ b/vcl/inc/menutogglebutton.hxx @@ -0,0 +1,34 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include + +class MenuToggleButton final : public MenuButton +{ +public: +explicit MenuToggleButton(vcl::Window* pParent, WinBits nStyle); +virtual ~MenuToggleButton() override; + +void SetActive(bool bSel); +bool GetActive() const; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 4ebf0bda3b55..26e382af0536 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -71,7 +71,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx index 643cf048b84b..a3c1cda1ce8b 100644 --- a/vcl/source/control/menubtn.cxx +++ b/vcl/source/control/menubtn.cxx @@ -27,6 +27,7 @@ #include #include #include +#include namespace { diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index bea4f8f42390..b708eba955b8 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -62,6 +62,7 @@ #include #include #include +#include #include #include #include ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |3 vcl/inc/salvtables.hxx|2 vcl/source/app/salvtables.cxx |6 + vcl/unx/gtk3/gtk3gtkinst.cxx | 207 +- 4 files changed, 139 insertions(+), 79 deletions(-) New commits: commit f9725762112ba543d57c6cfa26942b0a5b28b50e Author: Caolán McNamara AuthorDate: Fri Oct 16 15:34:03 2020 +0100 Commit: Caolán McNamara CommitDate: Fri Oct 16 21:20:46 2020 +0200 support set_font for weld::Button Change-Id: Ie56ba126bf7677e1605c0080064aa463f9277033 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104441 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 433322aae085..e463084da93b 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1280,6 +1280,9 @@ public: virtual void set_label_line_wrap(bool wrap) = 0; void clicked() { signal_clicked(); } +// font size is in points, not pixels, e.g. see Window::[G]etPointFont +virtual void set_font(const vcl::Font& rFont) = 0; + void connect_clicked(const Link& rLink) { m_aClickHdl = rLink; } }; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index b7dd10de3a69..7f925973bd92 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -994,6 +994,8 @@ public: virtual OUString get_label() const override; +virtual void set_font(const vcl::Font& rFont) override; + virtual ~SalInstanceButton() override; }; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index a1e533e2a2bd..19cd239d2848 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2477,6 +2477,12 @@ void SalInstanceButton::set_label_line_wrap(bool wrap) m_xButton->queue_resize(); } +void SalInstanceButton::set_font(const vcl::Font& rFont) +{ +m_xButton->SetPointFont(*m_xButton, rFont); +m_xButton->Invalidate(); +} + OUString SalInstanceButton::get_label() const { return m_xButton->GetText(); } SalInstanceButton::~SalInstanceButton() { m_xButton->SetClickHdl(Link<::Button*, void>()); } diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 9dcf0645c9d4..0a4b3a4911cf 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -6668,6 +6668,88 @@ public: } }; +PangoAttrList* create_attr_list(const vcl::Font& rFont) +{ +PangoAttrList* pAttrList = pango_attr_list_new(); +pango_attr_list_insert(pAttrList, pango_attr_family_new(OUStringToOString(rFont.GetFamilyName(), RTL_TEXTENCODING_UTF8).getStr())); +pango_attr_list_insert(pAttrList, pango_attr_size_new(rFont.GetFontSize().Height() * PANGO_SCALE)); +switch (rFont.GetItalic()) +{ +case ITALIC_NONE: +pango_attr_list_insert(pAttrList, pango_attr_style_new(PANGO_STYLE_NORMAL)); +break; +case ITALIC_NORMAL: +pango_attr_list_insert(pAttrList, pango_attr_style_new(PANGO_STYLE_ITALIC)); +break; +case ITALIC_OBLIQUE: +pango_attr_list_insert(pAttrList, pango_attr_style_new(PANGO_STYLE_OBLIQUE)); +break; +default: +break; +} +switch (rFont.GetWeight()) +{ +case WEIGHT_ULTRALIGHT: +pango_attr_list_insert(pAttrList, pango_attr_weight_new(PANGO_WEIGHT_ULTRALIGHT)); +break; +case WEIGHT_LIGHT: +pango_attr_list_insert(pAttrList, pango_attr_weight_new(PANGO_WEIGHT_LIGHT)); +break; +case WEIGHT_NORMAL: +pango_attr_list_insert(pAttrList, pango_attr_weight_new(PANGO_WEIGHT_NORMAL)); +break; +case WEIGHT_BOLD: +pango_attr_list_insert(pAttrList, pango_attr_weight_new(PANGO_WEIGHT_BOLD)); +break; +case WEIGHT_ULTRABOLD: +pango_attr_list_insert(pAttrList, pango_attr_weight_new(PANGO_WEIGHT_ULTRABOLD)); +break; +default: +break; +} +switch (rFont.GetWidthType()) +{ +case WIDTH_ULTRA_CONDENSED: +pango_attr_list_insert(pAttrList, pango_attr_stretch_new(PANGO_STRETCH_ULTRA_CONDENSED)); +break; +case WIDTH_EXTRA_CONDENSED: +pango_attr_list_insert(pAttrList, pango_attr_stretch_new(PANGO_STRETCH_EXTRA_CONDENSED)); +break; +case WIDTH_CONDENSED: +pango_attr_list_insert(pAttrList, pango_attr_stretch_new(PANGO_STRETCH_CONDENSED)); +break; +case WIDTH_SEMI_CONDENSED: +pango_attr_list_insert(pAttrList, pango_attr_stretch_new(PANGO_STRETCH_SEMI_CONDENSED)); +break; +case WIDTH_NORMAL: +pango_attr_list_insert(pAttrList, pango_attr_stretch_new(PANGO_STRETCH_NORMAL)); +break; +case WIDTH_SEMI_EXPANDED: +pango_attr_list_insert(pAttrList, pango_attr_stretch_new(PANGO_STRETCH_SEMI_EXPANDED)); +
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/fontcharmap.hxx |6 vcl/inc/impfontcharmap.hxx |1 vcl/inc/salgdi.hxx |4 vcl/inc/sft.hxx | 19 - vcl/source/font/fontcharmap.cxx |3 vcl/source/fontsubset/sft.cxx | 385 +--- vcl/source/gdi/salgdilayout.cxx |8 7 files changed, 24 insertions(+), 402 deletions(-) New commits: commit c7482bc2904401e7d975b5721ec861b8589253f9 Author: Jan-Marek Glogowski AuthorDate: Fri Sep 11 22:07:12 2020 +0200 Commit: Jan-Marek Glogowski CommitDate: Tue Sep 15 06:42:33 2020 +0200 Replace FindCmap with ParseCMAP This introduces a potential performance regression, because FindCmap works on the existing font tables and just sets up a lookup function, while ParseCMAP creates some optimized, in-memory lookup table, which needs a bit more work, but is faster in its usage, I think. At least the initial usage is faster the old way, as the CMAPs aren't decoded at all. As you can see, the old code is just used on Windows and MacOS / iOS. Deep in the bowels of the PrintFontManager, the CMAP is also decoded using ParseCMAP... So I'm not sure this potential regression really exists. Most fonts will already have a decoded CMAP, so my guess is this is actually faster in the end. No idea, how to measure. Change-Id: I52caac1264cd3ff11a2a3fa6e9c800f67f146a79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102685 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski diff --git a/include/vcl/fontcharmap.hxx b/include/vcl/fontcharmap.hxx index 2a4e1dd08ff1..f600c3e6849f 100644 --- a/include/vcl/fontcharmap.hxx +++ b/include/vcl/fontcharmap.hxx @@ -39,7 +39,11 @@ public: all codepoints in the Unicode BMP range, including surrogates. **/ FontCharMap(); + +/** A new FontCharMap is created based on the CmapResult + */ FontCharMap( const CmapResult& rCR ); + virtual ~FontCharMap() override; /** Get the default font character map @@ -134,6 +138,8 @@ public: int GetGlyphIndex( sal_UCS4 ) const; +bool isSymbolic() const; + private: ImplFontCharMapRef mpImplFontCharMap; diff --git a/vcl/inc/impfontcharmap.hxx b/vcl/inc/impfontcharmap.hxx index eaa99dbe2d4d..287b663b4820 100644 --- a/vcl/inc/impfontcharmap.hxx +++ b/vcl/inc/impfontcharmap.hxx @@ -49,6 +49,7 @@ private: const sal_uInt16* mpGlyphIds; // individual glyphid mappings int mnRangeCount; int mnCharCount; // covered codepoints +const bool m_bSymbolic; }; bool VCL_DLLPUBLIC ParseCMAP( const unsigned char* pRawData, int nRawLength, CmapResult& ); diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index 2e83e558a3c7..9d86421e4e10 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -619,11 +619,7 @@ protected: std::unique_ptr m_pWidgetDraw; vcl::WidgetDrawInterface* forWidget() { return m_pWidgetDraw ? m_pWidgetDraw.get() : this; } -#if defined(_WIN32) || defined(MACOSX) || defined(IOS) -static void GetGlyphWidths(const vcl::TrueTypeFont& rTTF, -#else static void GetGlyphWidths(const vcl::AbstractTrueTypeFont& rTTF, -#endif const PhysicalFontFace& rFontFace, bool bVertical, std::vector& rWidths, Ucs2UIntMap& rUnicodeEnc); }; diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx index 89853335db54..bcbf74b07aa1 100644 --- a/vcl/inc/sft.hxx +++ b/vcl/inc/sft.hxx @@ -42,6 +42,7 @@ #include #include +#include #include #include @@ -650,19 +651,6 @@ class TrueTypeFont; */ VCL_DLLPUBLIC std::unique_ptr GetTTSimpleGlyphMetrics(AbstractTrueTypeFont const *ttf, const sal_uInt16 *glyphArray, int nGlyphs, bool vertical); -#if defined(_WIN32) || defined(MACOSX) || defined(IOS) -/** - * Maps a Unicode (UCS-2) character to a glyph ID and returns it. Missing glyph has - * a glyphID of 0 so this function can be used to test if a character is encoded in the font. - * - * @param ttf pointer to the TrueTypeFont structure - * @param ch Unicode (UCS-2) character - * @return glyph ID, if the character is missing in the font, the return value is 0. - * @ingroup sft - */ -VCL_DLLPUBLIC sal_uInt16 MapChar(TrueTypeFont const *ttf, sal_uInt16 ch); -#endif - /** * Returns global font information about the TrueType font. * @see TTGlobalFontInfo @@ -734,6 +722,7 @@ class VCL_DLLPUBLIC AbstractTrueTypeFont sal_uInt32 m_nHorzMetrics; sal_uInt32 m_nVertMetrics; /* if not 0 => font has vertical metrics information */ sal_uInt32 m_nUnitsPerEm; +FontCharMapRef m_xCharMap; protected: SFErrCodes indexGlyphData(); @@ -748,6 +737,7 @@ public: sal_uInt32 horzMetricCount() const { return m_nHorzMetrics; } sal_uInt32 vertMetricCount() const { return m_nVertMetrics; } sal_uInt32 unitsPerEm()
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/window.hxx|5 - vcl/inc/window.h |1 - vcl/source/window/window.cxx |6 -- vcl/source/window/winproc.cxx |6 -- 4 files changed, 18 deletions(-) New commits: commit eac937de4267637d22d4c418a87e675c780e59a3 Author: Caolán McNamara AuthorDate: Tue Sep 1 14:47:08 2020 +0100 Commit: Caolán McNamara CommitDate: Wed Sep 2 09:35:58 2020 +0200 IsCallHandlersOnInputDisabled newly always return false Change-Id: I4abfab9a413e3e43e23839f2cf3b0c26dcdea3a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101853 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 458b225f26d8..f64a419b92af 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -983,11 +983,6 @@ public: */ voidAlwaysDisableInput( bool bAlways, bool bChild = true ); -/** get state of SetCallHandlersOnInputDisabled - -@returns whether handlers are called regardless of input enabled state -*/ -boolIsCallHandlersOnInputDisabled() const; /** A window is in modal mode if one of its children or subchildren is a running modal window (a modal dialog) diff --git a/vcl/inc/window.h b/vcl/inc/window.h index 81d93375d2e7..52993ffa930b 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -379,7 +379,6 @@ public: mbDrawSelectionBackground:1, mbIsInTaskPaneList:1, mbToolbarFloatingWindow:1, -mbCallHandlersDuringInputDisabled:1, mbHelpTextDynamic:1, mbFakeFocusSet:1, mbHexpand:1, diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index e06a8cf1e961..f581ce0850b4 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -725,7 +725,6 @@ WindowImpl::WindowImpl( WindowType nType ) mbDrawSelectionBackground = false; // true: draws transparent window background to indicate (toolbox) selection mbIsInTaskPaneList = false; // true: window was added to the taskpanelist in the topmost system window mnNativeBackground = ControlPart::NONE; // initialize later, depends on type -mbCallHandlersDuringInputDisabled = false; // true: call event handlers even if input is disabled mbHelpTextDynamic = false; // true: append help id in HELP_DEBUG case mbFakeFocusSet = false; // true: pretend as if the window has focus. mbHexpand = false; @@ -2484,11 +2483,6 @@ void Window::Enable( bool bEnable, bool bChild ) ImplGenerateMouseMove(); } -bool Window::IsCallHandlersOnInputDisabled() const -{ -return mpWindowImpl->mbCallHandlersDuringInputDisabled; -} - void Window::EnableInput( bool bEnable, bool bChild ) { if (!mpWindowImpl) diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index e0a4c16d18f7..eb2f917d0e50 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -389,12 +389,6 @@ bool ImplHandleMouseEvent( const VclPtr& xWindow, MouseNotifyEvent MouseEvent aMEvt( aChildPos, pWinFrameData->mnClickCount, nMode, nCode, nCode ); NotifyEvent aNEvt( nSVEvent, pChild, ); -if( pChild->IsCallHandlersOnInputDisabled() ) -{ -pWinFrameData->mpMouseMoveWin = pChild; -pChild->ImplNotifyKeyMouseCommandEventListeners( aNEvt ); -} - if ( nSVEvent == MouseNotifyEvent::MOUSEBUTTONDOWN ) return true; else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |3 +++ vcl/inc/salvtables.hxx|4 vcl/source/app/salvtables.cxx | 10 ++ vcl/unx/gtk3/gtk3gtkinst.cxx | 10 ++ 4 files changed, 27 insertions(+) New commits: commit b132a2868a248177de63142c6d09b0e68169c237 Author: Caolán McNamara AuthorDate: Tue Jul 21 20:01:26 2020 +0100 Commit: Caolán McNamara CommitDate: Wed Jul 22 10:45:02 2020 +0200 add get/set overwrite mode Change-Id: I9fa9030665702f517fa5fcb22f29e52d0eda8ff5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99173 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 1c40aea114c6..802e1ae7f138 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1489,6 +1489,9 @@ public: virtual void set_message_type(EntryMessageType eType) = 0; virtual void set_placeholder_text(const OUString& rText) = 0; +virtual void set_overwrite_mode(bool bOn) = 0; +virtual bool get_overwrite_mode() const = 0; + // font size is in points, not pixels, e.g. see Window::[G]etPointFont virtual void set_font(const vcl::Font& rFont) = 0; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index cd82c840694f..80c8640f77e3 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -585,6 +585,10 @@ public: virtual bool get_editable() const override; +virtual void set_overwrite_mode(bool bOn) override; + +virtual bool get_overwrite_mode() const override; + virtual void set_message_type(weld::EntryMessageType eType) override; virtual void set_font(const vcl::Font& rFont) override; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 3581b14a8afb..9765711e3869 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -3097,6 +3097,16 @@ bool SalInstanceEntry::get_editable() const return !m_xEntry->IsReadOnly(); } +void SalInstanceEntry::set_overwrite_mode(bool bOn) +{ +m_xEntry->SetInsertMode(!bOn); +} + +bool SalInstanceEntry::get_overwrite_mode() const +{ +return !m_xEntry->IsInsertMode(); +} + void SalInstanceEntry::set_message_type(weld::EntryMessageType eType) { if (eType == weld::EntryMessageType::Error) diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index f8fbcb1a9fee..faa07934e57e 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -8827,6 +8827,16 @@ public: return gtk_editable_get_editable(GTK_EDITABLE(m_pEntry)); } +virtual void set_overwrite_mode(bool bOn) override +{ +gtk_entry_set_overwrite_mode(m_pEntry, bOn); +} + +virtual bool get_overwrite_mode() const override +{ +return gtk_entry_get_overwrite_mode(m_pEntry); +} + virtual void set_message_type(weld::EntryMessageType eType) override { ::set_entry_message_type(m_pEntry, eType); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/GraphicLoader.hxx |5 + include/vcl/GraphicObject.hxx |6 ++ include/vcl/canvastools.hxx|6 ++ include/vcl/dndhelp.hxx| 18 -- include/vcl/edit.hxx |7 ++- include/vcl/font/Feature.hxx |8 ++-- include/vcl/font/FeatureParser.hxx |7 ++- include/vcl/i18nhelp.hxx |8 +--- include/vcl/lok.hxx|5 + include/vcl/svapp.hxx | 16 +--- include/vcl/texteng.hxx|7 ++- include/vcl/toolkit/unowrap.hxx| 15 +++ include/vcl/uitest/logger.hxx | 23 ++- include/vcl/unohelp.hxx| 20 +--- include/vcl/weld.hxx | 20 +++- vcl/inc/canvasbitmap.hxx |6 ++ vcl/inc/font/FeatureCollector.hxx |7 ++- vcl/inc/font/OpenTypeFeatureDefinitionList.hxx |7 ++- vcl/inc/graphic/Manager.hxx|6 ++ vcl/inc/opengl/VertexUtils.hxx |6 ++ vcl/inc/salinst.hxx|6 +- vcl/inc/svimpbox.hxx |8 +--- vcl/inc/test/outputdevice.hxx |5 ++--- vcl/inc/unx/gtk/gtkinst.hxx|8 +--- vcl/inc/unx/gtk/gtkprintwrapper.hxx|5 + vcl/inc/unx/salinst.h |5 + vcl/inc/window.h |1 - vcl/source/gdi/pdfbuildin_fonts.hxx|7 ++- 28 files changed, 56 insertions(+), 192 deletions(-) New commits: commit e06cb5853f735e523f740dec82954c54cbe47f48 Author: Noel Grandin AuthorDate: Sun Jul 19 18:45:58 2020 +0200 Commit: Noel Grandin CommitDate: Sun Jul 19 20:41:14 2020 +0200 compact namespace: vcl Change-Id: Ic861003f522e76431fffaadc408d0a153b12d0e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99003 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/vcl/GraphicLoader.hxx b/include/vcl/GraphicLoader.hxx index 5cca83a99d94..d99c54731354 100644 --- a/include/vcl/GraphicLoader.hxx +++ b/include/vcl/GraphicLoader.hxx @@ -17,12 +17,9 @@ namespace weld class Window; } -namespace vcl -{ -namespace graphic +namespace vcl::graphic { Graphic VCL_DLLPUBLIC loadFromURL(OUString const& rURL, weld::Window* pParentWin = nullptr); -} } // end vcl::graphic #endif // INCLUDED_VCL_GRAPHIC_TOOLS_HXX diff --git a/include/vcl/GraphicObject.hxx b/include/vcl/GraphicObject.hxx index 16735aac4b1f..7997fabcec67 100644 --- a/include/vcl/GraphicObject.hxx +++ b/include/vcl/GraphicObject.hxx @@ -285,9 +285,7 @@ public: double fBottomCrop) const; }; -namespace vcl -{ -namespace graphic +namespace vcl::graphic { // Will search an object ( e.g. a control ) for any 'ImageURL' or 'Graphic' @@ -300,7 +298,7 @@ namespace graphic VCL_DLLPUBLIC void SearchForGraphics(css::uno::Reference const & rxInterface, std::vector> & raGraphicList); -} + } // end namespace vcl::graphic /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/canvastools.hxx b/include/vcl/canvastools.hxx index 80a15cffdede..5a46886e59b4 100644 --- a/include/vcl/canvastools.hxx +++ b/include/vcl/canvastools.hxx @@ -58,10 +58,8 @@ namespace com::sun::star::rendering namespace com::sun::star::rendering { class XColorSpace; } -namespace vcl +namespace vcl::unotools { -namespace unotools -{ // Bitmap conversions @@ -161,7 +159,7 @@ namespace vcl tools::Rectangle VCL_DLLPUBLIC rectangleFromB2IRectangle( const basegfx::B2IRange& ); basegfx::B2IPoint VCL_DLLPUBLIC b2IPointFromPoint(const Point&); basegfx::B2IRectangle VCL_DLLPUBLIC b2IRectangleFromRectangle(const tools::Rectangle&); -} + } #endif // INCLUDED_VCL_CANVASTOOLS_HXX diff --git a/include/vcl/dndhelp.hxx b/include/vcl/dndhelp.hxx index b5a1d98c7491..902f67cf1036 100644 --- a/include/vcl/dndhelp.hxx +++ b/include/vcl/dndhelp.hxx @@ -26,12 +26,7 @@ #include #include -namespace com { -namespace sun { -namespace star { - -namespace datatransfer { -namespace dnd { +namespace com::sun::star::datatransfer::dnd { struct DragGestureEvent; struct DragSourceDragEvent; struct DragSourceDropEvent; @@ -40,14 +35,9 @@ namespace dnd { struct DropTargetDragEnterEvent; struct DropTargetDropEvent; struct DropTargetEvent; -}} - -}}} - -namespace vcl -{ +} -namespace unohelper +namespace vcl::unohelper { class VCL_DLLPUBLIC DragAndDropClient @@ -113,7 +103,7 @@ public: void SAL_CALL
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/ivctrl.hxx | 50 vcl/inc/verticaltabctrl.hxx | 83 vcl/source/app/salvtables.cxx |1 vcl/source/control/imivctl1.cxx |1 vcl/source/control/ivctrl.cxx |1 vcl/source/uitest/uiobject.cxx |1 vcl/source/window/builder.cxx |1 7 files changed, 88 insertions(+), 50 deletions(-) New commits: commit 2f04d2c4d9fdcc5871d536690a946c1d79df4eb6 Author: Caolán McNamara AuthorDate: Sun Jul 12 19:12:18 2020 +0100 Commit: Caolán McNamara CommitDate: Sun Jul 12 21:30:57 2020 +0200 VerticalTabControl can be in private header Change-Id: I95ee7a1477fb84eb9fcf2f70ab7d262b9eb47088 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98606 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/ivctrl.hxx b/include/vcl/ivctrl.hxx index 399079c69f9d..753b5ed4a6c2 100644 --- a/include/vcl/ivctrl.hxx +++ b/include/vcl/ivctrl.hxx @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -278,55 +277,6 @@ public: virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override; }; -struct VerticalTabPageData; - -class VerticalTabControl final : public VclHBox -{ -VclPtr m_xChooser; -VclPtr m_xBox; - -std::vector> maPageList; -OString m_sCurrentPageId; - -Link m_aActivateHdl; -Link m_aDeactivateHdl; - -DECL_LINK(ChosePageHdl_Impl, SvtIconChoiceCtrl*, void); - -void ActivatePage(); -bool DeactivatePage(); - -VerticalTabPageData* GetPageData(const OString& rId) const; -VerticalTabPageData* GetPageData(const SvxIconChoiceCtrlEntry* pEntry) const; - -public: -VerticalTabControl(vcl::Window* pParent); -virtual ~VerticalTabControl() override; -virtual void dispose() override; - -sal_uInt16 GetPageCount() const { return m_xChooser->GetEntryCount(); } - -OString GetCurPageId() const { return m_sCurrentPageId; } -void SetCurPageId(const OString& rId); - -sal_uInt16 GetPagePos(const OString& rPageId) const; -OString GetPageId(sal_uInt16 nIndex) const; -VclPtr GetPage(const OString& rPageId); - -void RemovePage(const OString& rPageId); -void InsertPage(const OString& rPageId, const OUString& rLabel, const Image& rImage, const OUString& rTooltip, VclPtr xPage, int nPos = -1); - -void SetActivatePageHdl( const Link& rLink ) { m_aActivateHdl = rLink; } -void SetDeactivatePageHdl( const Link& rLink ) { m_aDeactivateHdl = rLink; } - -OUString GetPageText(const OString& rPageId) const; -void SetPageText(const OString& rPageId, const OUString& rText); - -vcl::Window* GetPageParent() { return m_xBox.get(); } - -virtual FactoryFunction GetUITestFactory() const override; -}; - #endif // INCLUDED_VCL_IVCTRL_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/verticaltabctrl.hxx b/vcl/inc/verticaltabctrl.hxx new file mode 100644 index ..060777c65602 --- /dev/null +++ b/vcl/inc/verticaltabctrl.hxx @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include +#include +#include +#include + +struct VerticalTabPageData; + +class VerticalTabControl final : public VclHBox +{ +VclPtr m_xChooser; +VclPtr m_xBox; + +std::vector> maPageList; +OString m_sCurrentPageId; + +Link m_aActivateHdl; +Link m_aDeactivateHdl; + +DECL_LINK(ChosePageHdl_Impl, SvtIconChoiceCtrl*, void); + +void ActivatePage(); +bool DeactivatePage(); + +VerticalTabPageData* GetPageData(const OString& rId) const; +VerticalTabPageData* GetPageData(const SvxIconChoiceCtrlEntry* pEntry) const; + +public: +VerticalTabControl(vcl::Window* pParent); +virtual ~VerticalTabControl() override; +virtual void dispose() override; + +sal_uInt16 GetPageCount() const { return m_xChooser->GetEntryCount(); } + +OString GetCurPageId() const { return m_sCurrentPageId; } +void SetCurPageId(const OString& rId); + +sal_uInt16 GetPagePos(const OString&
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx | 10 ++ vcl/inc/salvtables.hxx|2 ++ vcl/source/app/salvtables.cxx |8 vcl/unx/gtk3/gtk3gtkinst.cxx | 20 4 files changed, 40 insertions(+) New commits: commit 4582ac7de8291a81c867492aad770206fbaca224 Author: Caolán McNamara AuthorDate: Thu Jul 2 15:54:18 2020 +0100 Commit: Caolán McNamara CommitDate: Thu Jul 2 20:21:46 2020 +0200 add ability to set Entry font color reluctantly, but the SvNumberformat color feature exists and it's expected to be possible to use that color in the currency fields Change-Id: I31834e5667fcad42021532957dee4f79621f58a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97774 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index db13a45a7731..8f2008598b80 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1496,6 +1496,16 @@ public: // font size is in points, not pixels, e.g. see Window::[G]etPointFont virtual void set_font(const vcl::Font& rFont) = 0; +/* + If you want to set a warning or error state, see set_message_type + instead where, if the toolkit supports it, a specific warning/error + indicator is shown. + + This explicit text color method exists to support rendering the + SvNumberformat color feature. +*/ +virtual void set_font_color(const Color& rColor) = 0; + void connect_changed(const Link& rLink) { m_aChangeHdl = rLink; } void connect_insert_text(const Link& rLink) { m_aInsertTextHdl = rLink; } // callback returns true to indicated no further processing of activate wanted diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index fb60a583e538..d76729b876c4 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -592,6 +592,8 @@ public: virtual void set_font(const vcl::Font& rFont) override; +virtual void set_font_color(const Color& rColor) override; + virtual void connect_cursor_position(const Link& rLink) override; virtual void set_placeholder_text(const OUString& rText) override; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 67f26faf9e59..656e82a43ea1 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -3138,6 +3138,14 @@ void SalInstanceEntry::set_font(const vcl::Font& rFont) m_xEntry->Invalidate(); } +void SalInstanceEntry::set_font_color(const Color& rColor) +{ +if (rColor == COL_AUTO) +m_xEntry->SetControlForeground(); +else +m_xEntry->SetControlForeground(rColor); +} + void SalInstanceEntry::connect_cursor_position(const Link& rLink) { assert(!m_aCursorPositionHdl.IsSet()); diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 1aa1af96882a..0959bb53421e 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -8638,6 +8638,11 @@ namespace gtk_entry_set_icon_from_icon_name(pEntry, GTK_ENTRY_ICON_SECONDARY, nullptr); } +gboolean filter_pango_attrs(PangoAttribute *attr, gpointer /*data*/) +{ +return attr->klass->type == PANGO_ATTR_FOREGROUND; +} + class GtkInstanceEntry : public GtkInstanceWidget, public virtual weld::Entry { private: @@ -8835,6 +8840,21 @@ public: return GtkInstanceWidget::get_font(); } +void set_font_color(const Color& rColor) override +{ +PangoAttrList* pOrigList = gtk_entry_get_attributes(m_pEntry); +if (rColor == COL_AUTO && !pOrigList) // nothing to do +return; + +PangoAttrList* pAttrList = pOrigList ? pango_attr_list_filter(pOrigList, filter_pango_attrs, nullptr) : pango_attr_list_new(); + +if (rColor != COL_AUTO) +pango_attr_list_insert(pAttrList, pango_attr_foreground_new(rColor.GetRed()/255.0, rColor.GetGreen()/255.0, rColor.GetBlue()/255.0)); + +gtk_entry_set_attributes(m_pEntry, pAttrList); +pango_attr_list_unref(pAttrList); +} + void fire_signal_changed() { signal_changed(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/texteng.hxx |3 +-- include/vcl/vclenum.hxx |7 +++ include/vcl/weld.hxx |2 ++ vcl/inc/salvtables.hxx|2 ++ vcl/source/app/salvtables.cxx | 20 vcl/unx/gtk3/gtk3gtkinst.cxx | 18 ++ 6 files changed, 50 insertions(+), 2 deletions(-) New commits: commit 011a4932aa35475a81917d5931e2a0f3a43c7336 Author: Caolán McNamara AuthorDate: Mon Jun 29 14:54:05 2020 +0100 Commit: Caolán McNamara CommitDate: Tue Jun 30 10:33:28 2020 +0200 add set_alignment to Entry Change-Id: I004fb0e19c1bb25bdb5d11ba5d5d5f39b137874c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97423 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/texteng.hxx b/include/vcl/texteng.hxx index ee0ae62e0294..251325d195a0 100644 --- a/include/vcl/texteng.hxx +++ b/include/vcl/texteng.hxx @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -66,8 +67,6 @@ namespace i18n { class LocaleDataWrapper; -enum class TxtAlign { Left, Center, Right }; - typedef std::vector TextViews; class VCL_DLLPUBLIC TextEngine : public SfxBroadcaster diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx index b5423b46e5de..3534fbd2815a 100644 --- a/include/vcl/vclenum.hxx +++ b/include/vcl/vclenum.hxx @@ -340,6 +340,13 @@ enum class DrawFrameStyle NWF = 0x0006, }; +enum class TxtAlign +{ +Left, +Center, +Right +}; + #endif // INCLUDED_VCL_VCLENUM_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 6d72135b21ee..db13a45a7731 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1509,6 +1509,8 @@ public: virtual void copy_clipboard() = 0; virtual void paste_clipboard() = 0; +virtual void set_alignment(TxtAlign eXAlign) = 0; + void save_value() { m_sSavedValue = get_text(); } OUString const& get_saved_value() const { return m_sSavedValue; } bool get_value_changed_from_saved() const { return m_sSavedValue != get_text(); } diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 527e3cd2b722..7e1e0dc9defa 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -607,6 +607,8 @@ public: virtual void paste_clipboard() override; +virtual void set_alignment(TxtAlign eXAlign) override; + virtual ~SalInstanceEntry() override; }; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index a6012f4ca6a5..e9f0fedc8c97 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -3175,6 +3175,26 @@ void SalInstanceEntry::paste_clipboard() m_xEntry->Paste(); } +void SalInstanceEntry::set_alignment(TxtAlign eXAlign) +{ +WinBits nAlign(0); +switch (eXAlign) +{ +case TxtAlign::Left: +nAlign = WB_LEFT; +break; +case TxtAlign::Center: +nAlign = WB_CENTER; +break; +case TxtAlign::Right: +nAlign = WB_RIGHT; +break; +} +WinBits nBits = m_xEntry->GetStyle(); +nBits &= ~(WB_LEFT | WB_CENTER | WB_RIGHT); +m_xEntry->SetStyle(nBits & nAlign); +} + SalInstanceEntry::~SalInstanceEntry() { if (m_aCursorPositionHdl.IsSet()) diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 620cc74b5fae..8e6ed420a381 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -8864,6 +8864,24 @@ public: enable_notify_events(); } +virtual void set_alignment(TxtAlign eXAlign) override +{ +gfloat xalign; +switch (eXAlign) +{ +case TxtAlign::Left: +xalign = 0.0; +break; +case TxtAlign::Center: +xalign = 0.5; +break; +case TxtAlign::Right: +xalign = 1.0; +break; +} +gtk_entry_set_alignment(m_pEntry, xalign); +} + virtual ~GtkInstanceEntry() override { g_signal_handler_disconnect(m_pEntry, m_nActivateSignalId); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
vcl/inc/jsdialog/jsdialogbuilder.hxx |2 +- vcl/inc/pch/precompiled_vcl.hxx |5 +++-- vcl/source/app/salvtables.cxx|2 +- 3 files changed, 5 insertions(+), 4 deletions(-) New commits: commit e2341bb8a43b9d6443a90e745b699f662550c64c Author: Caolán McNamara AuthorDate: Sat Jun 20 16:03:52 2020 +0100 Commit: Caolán McNamara CommitDate: Tue Jun 23 12:50:33 2020 +0200 salvtables.hxx not needed outside vcl Change-Id: I7193c511ec4695b70f482aedffcfc76ee4ded4b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96775 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index 5c7f5879af27..f5d0d098cb68 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx index c115104f821c..fca4ccecb24b 100644 --- a/vcl/inc/pch/precompiled_vcl.hxx +++ b/vcl/inc/pch/precompiled_vcl.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-05-07 20:21:38 using: + Generated on 2020-06-22 16:35:24 using: ./bin/update_pch vcl vcl --cutoff=6 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #endif // PCH_LEVEL >= 1 @@ -261,7 +262,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/vcl/salvtables.hxx b/vcl/inc/salvtables.hxx similarity index 100% rename from include/vcl/salvtables.hxx rename to vcl/inc/salvtables.hxx diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index ff441c6a5b18..0f4ba0ecc2b0 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -71,7 +71,7 @@ #include #include #include -#include +#include #include ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/lstbox.hxx |1 vcl/inc/listbox.hxx|7 -- vcl/source/control/imp_listbox.cxx | 114 +++-- vcl/source/control/listbox.cxx |7 -- 4 files changed, 14 insertions(+), 115 deletions(-) New commits: commit 35245a605f3889fb3edbdab6fbe9f9233912fc59 Author: Caolán McNamara AuthorDate: Wed Jun 17 19:40:23 2020 +0100 Commit: Caolán McNamara CommitDate: Thu Jun 18 20:37:12 2020 +0200 mbStackMode is always false now Change-Id: I3d6c9b0cc07b3750a3f24b4cfc5138b49e62d06d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96600 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/lstbox.hxx b/include/vcl/lstbox.hxx index 403d429f2605..b5c495aacfff 100644 --- a/include/vcl/lstbox.hxx +++ b/include/vcl/lstbox.hxx @@ -205,7 +205,6 @@ public: boolIsInDropDown() const; voidToggleDropDown(); -voidEnableMultiSelection( bool bMulti, bool bStackSelection ); voidEnableMultiSelection( bool bMulti ); boolIsMultiSelectionEnabled() const; diff --git a/vcl/inc/listbox.hxx b/vcl/inc/listbox.hxx index 65cd4d2089a5..0485001216b0 100644 --- a/vcl/inc/listbox.hxx +++ b/vcl/inc/listbox.hxx @@ -206,7 +206,6 @@ private: bool mbSort : 1; ///< ListBox sorted bool mbTrack : 1;///< Tracking bool mbMulti : 1;///< MultiListBox -bool mbStackMode : 1;///< StackSelection bool mbSimpleMode : 1; ///< SimpleMode for MultiListBox bool mbTravelSelect : 1; ///< TravelSelect bool mbTrackingSelect : 1; ///< Selected at a MouseMove @@ -327,13 +326,13 @@ public: voidEnableUserDraw( bool bUserDraw ) { mbUserDrawEnabled = bUserDraw; } boolIsUserDrawEnabled() const { return mbUserDrawEnabled; } -voidEnableMultiSelection( bool bMulti, bool bStackMode ) { mbMulti = bMulti; mbStackMode = bStackMode; } +voidEnableMultiSelection( bool bMulti ) { mbMulti = bMulti; } boolIsMultiSelectionEnabled() const { return mbMulti; } voidSetMultiSelectionSimpleMode( bool bSimple ) { mbSimpleMode = bSimple; } voidEnableMouseMoveSelect( bool bMouseMoveSelect ) { mbMouseMoveSelect = bMouseMoveSelect; } -boolIsMouseMoveSelect() const { return mbMouseMoveSelect||mbStackMode; } +boolIsMouseMoveSelect() const { return mbMouseMoveSelect; } SizeCalcSize(sal_Int32 nMaxLines) const; tools::Rectangle GetBoundingRectangle( sal_Int32 nItem ) const; @@ -459,7 +458,7 @@ public: boolIsTravelSelect() const { return maLBWindow->IsTravelSelect(); } boolIsTrackingSelect() const{ return maLBWindow->IsTrackingSelect(); } -voidEnableMultiSelection( bool bMulti, bool bStackMode ) { maLBWindow->EnableMultiSelection( bMulti, bStackMode ); } +voidEnableMultiSelection( bool bMulti ) { maLBWindow->EnableMultiSelection( bMulti ); } boolIsMultiSelectionEnabled() const { return maLBWindow->IsMultiSelectionEnabled(); } voidSetMultiSelectionSimpleMode( bool bSimple ) { maLBWindow->SetMultiSelectionSimpleMode( bSimple ); } diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index a1b704eec9b8..4ca534e1d7a3 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -457,7 +457,6 @@ ImplListBoxWindow::ImplListBoxWindow( vcl::Window* pParent, WinBits nWinStyle ) mbSelectionChanged = false; mbMouseMoveSelect = false; mbMulti = false; -mbStackMode = false; mbGrabFocus = false; mbUserDrawEnabled = false; mbInUserDraw= false; @@ -880,27 +879,7 @@ void ImplListBoxWindow::MouseButtonDown( const MouseEvent& rMEvt ) void ImplListBoxWindow::MouseMove( const MouseEvent& rMEvt ) { -if ( rMEvt.IsLeaveWindow() ) -{ -if ( mbStackMode && IsMouseMoveSelect() && IsReallyVisible() ) -{ -if ( rMEvt.GetPosPixel().Y() < 0 ) -{ -DeselectAll(); -mnCurrentPos = LISTBOX_ENTRY_NOTFOUND; -SetTopEntry( 0 ); -if ( mbStackMode ) -{ -mbTravelSelect = true; -mnSelectModifier = rMEvt.GetModifier(); -ImplCallSelect(); -mbTravelSelect = false; -} - -} -} -} -else if ( ( ( !mbMulti && IsMouseMoveSelect() ) || mbStackMode ) && mpEntryList->GetEntryCount() ) +if (!rMEvt.IsLeaveWindow() && !mbMulti && IsMouseMoveSelect() && mpEntryList->GetEntryCount()) { tools::Rectangle
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/filter/pdfdocument.hxx | 13 +++-- vcl/source/filter/ipdf/pdfdocument.cxx | 31 +++ vcl/source/gdi/pdfobjectcopier.cxx |3 +-- vcl/source/gdi/pdfwriter_impl.hxx |3 ++- 4 files changed, 45 insertions(+), 5 deletions(-) New commits: commit f9ac4ab61fa2ebcafa8ea8957db01104a927bff2 Author: Miklos Vajna AuthorDate: Thu Jun 18 14:44:53 2020 +0200 Commit: Miklos Vajna CommitDate: Thu Jun 18 16:51:59 2020 +0200 sd signature line: teach PDFDocument how to use PDFObjectCopier This will allow using the object copier in PDFDocument::WriteAppearanceObject(), so we can include the signature line pdf export result in a pdf signature of the original pdf. Change-Id: Iabc508081c5820f4ca997a2d264de9bdb06f82bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96607 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/vcl/filter/pdfdocument.hxx b/include/vcl/filter/pdfdocument.hxx index aaf64ae908fe..70ca731d1d19 100644 --- a/include/vcl/filter/pdfdocument.hxx +++ b/include/vcl/filter/pdfdocument.hxx @@ -16,9 +16,10 @@ #include #include - #include +#include + namespace com::sun::star::security { class XCertificate; @@ -325,7 +326,7 @@ public: * elements remember their source offset / length, and based on that it's * possible to modify the input file. */ -class VCL_DLLPUBLIC PDFDocument +class VCL_DLLPUBLIC PDFDocument : public PDFObjectContainer { /// This vector owns all elements. std::vector> m_aElements; @@ -372,6 +373,7 @@ class VCL_DLLPUBLIC PDFDocument public: PDFDocument(); +virtual ~PDFDocument(); PDFDocument& operator=(const PDFDocument&) = delete; PDFDocument(const PDFDocument&) = delete; /// @name Low-level functions, to be used by PDFElement subclasses. @@ -417,6 +419,13 @@ public: /// Remove the nth signature from read document in the edit buffer. bool RemoveSignature(size_t nPosition); //@} + +/// See vcl::PDFObjectContainer::createObject(). +sal_Int32 createObject() override; +/// See vcl::PDFObjectContainer::updateObject(). +bool updateObject(sal_Int32 n) override; +/// See vcl::PDFObjectContainer::writeBuffer(). +bool writeBuffer(const void* pBuffer, sal_uInt64 nBytes) override; }; } // namespace vcl::filter diff --git a/vcl/inc/pdf/objectcontainer.hxx b/include/vcl/filter/pdfobjectcontainer.hxx similarity index 100% rename from vcl/inc/pdf/objectcontainer.hxx rename to include/vcl/filter/pdfobjectcontainer.hxx diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx index ca6d8aa6e486..09439604996d 100644 --- a/vcl/source/filter/ipdf/pdfdocument.cxx +++ b/vcl/source/filter/ipdf/pdfdocument.cxx @@ -26,6 +26,7 @@ #include #include #include +#include using namespace com::sun::star; @@ -126,6 +127,8 @@ XRefEntry::XRefEntry() = default; PDFDocument::PDFDocument() = default; +PDFDocument::~PDFDocument() = default; + bool PDFDocument::RemoveSignature(size_t nPosition) { std::vector aSignatures = GetSignatureWidgets(); @@ -151,6 +154,34 @@ bool PDFDocument::RemoveSignature(size_t nPosition) return m_aEditBuffer.good(); } +sal_Int32 PDFDocument::createObject() +{ +sal_Int32 nObject = m_aXRef.size(); +m_aXRef[nObject] = XRefEntry(); +return nObject; +} + +bool PDFDocument::updateObject(sal_Int32 nObject) +{ +if (o3tl::make_unsigned(nObject) >= m_aXRef.size()) +{ +SAL_WARN("vcl.filter", "PDFDocument::updateObject: invalid nObject"); +return false; +} + +XRefEntry aEntry; +aEntry.SetOffset(m_aEditBuffer.Tell()); +aEntry.SetDirty(true); +m_aXRef[nObject] = aEntry; +return true; +} + +bool PDFDocument::writeBuffer(const void* pBuffer, sal_uInt64 nBytes) +{ +std::size_t nWritten = m_aEditBuffer.WriteBytes(pBuffer, nBytes); +return nWritten == nBytes; +} + void PDFDocument::SetSignatureLine(const std::vector& rSignatureLine) { m_aSignatureLine = rSignatureLine; diff --git a/vcl/source/gdi/pdfobjectcopier.cxx b/vcl/source/gdi/pdfobjectcopier.cxx index 4ba93b3a746d..c5ff2eecab19 100644 --- a/vcl/source/gdi/pdfobjectcopier.cxx +++ b/vcl/source/gdi/pdfobjectcopier.cxx @@ -14,8 +14,7 @@ #include #include #include - -#include +#include namespace vcl { diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index 4aaa6c873ce1..eb53db7d5877 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -51,7 +51,7 @@ #include #include -#include +#include #include "pdffontcache.hxx" #include "pdfbuildin_fonts.hxx" @@ -949,6 +949,7 @@ i12626 /// See vcl::PDFObjectContainer::updateObject(). bool updateObject( sal_Int32 n ) override; +/// See vcl::PDFObjectContainer::writeBuffer(). bool writeBuffer( const void* pBuffer, sal_uInt64 nBytes ) override;
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/treelistbox.hxx |4 vcl/inc/treeglue.hxx|2 +- vcl/source/treelist/treelistbox.cxx | 22 ++ 3 files changed, 27 insertions(+), 1 deletion(-) New commits: commit 8c74d9b30aacec2207dd6c7960c81280c79e2c31 Author: Caolán McNamara AuthorDate: Wed Jun 17 16:47:15 2020 +0100 Commit: Caolán McNamara CommitDate: Wed Jun 17 22:15:48 2020 +0200 ignore positions on top of scrollbars for GetTargetAtPoint Change-Id: I6d63ac3723b392e7c82836ea5d4455ebde8a8e08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96553 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/treelistbox.hxx b/include/vcl/treelistbox.hxx index ac24996221cc..1fe73c689610 100644 --- a/include/vcl/treelistbox.hxx +++ b/include/vcl/treelistbox.hxx @@ -557,6 +557,10 @@ protected: voidImplEditEntry( SvTreeListEntry* pEntry ); voidAdjustEntryHeightAndRecalc(); + +// true if rPos is over the SvTreeListBox body, i.e. not over a +// scrollbar +VCL_DLLPRIVATE bool PosOverBody(const Point& rPos) const; public: voidSetNoAutoCurEntry( bool b ); diff --git a/vcl/inc/treeglue.hxx b/vcl/inc/treeglue.hxx index 11c61944f5e1..ea643635faee 100644 --- a/vcl/inc/treeglue.hxx +++ b/vcl/inc/treeglue.hxx @@ -130,7 +130,7 @@ public: SvTreeListEntry* GetTargetAtPoint(const Point& rPos, bool bHighLightTarget) { SvTreeListEntry* pOldTargetEntry = pTargetEntry; -pTargetEntry = pImpl->GetEntry(rPos); +pTargetEntry = PosOverBody(rPos) ? pImpl->GetEntry(rPos) : nullptr; if (pOldTargetEntry != pTargetEntry) ImplShowTargetEmphasis(pOldTargetEntry, false); diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index e41a11d0f103..a31f86e81f45 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -1996,6 +1996,28 @@ void SvTreeListBox::ModelHasCleared() SvListView::ModelHasCleared(); } +bool SvTreeListBox::PosOverBody(const Point& rPos) const +{ +if (rPos.X() < 0 || rPos.Y() < 0) +return false; +Size aSize(GetSizePixel()); +if (rPos.X() > aSize.Width() || rPos.Y() > aSize.Height()) +return false; +if (pImpl->m_aVerSBar->IsVisible()) +{ +tools::Rectangle aRect(pImpl->m_aVerSBar->GetPosPixel(), pImpl->m_aVerSBar->GetSizePixel()); +if (aRect.IsInside(rPos)) +return false; +} +if (pImpl->m_aHorSBar->IsVisible()) +{ +tools::Rectangle aRect(pImpl->m_aHorSBar->GetPosPixel(), pImpl->m_aHorSBar->GetSizePixel()); +if (aRect.IsInside(rPos)) +return false; +} +return true; +} + void SvTreeListBox::ScrollOutputArea( short nDeltaEntries ) { if( !nDeltaEntries || !pImpl->m_aVerSBar->IsVisible() ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/treelistentry.hxx |4 - include/vcl/weld.hxx|3 vcl/inc/strings.hrc |2 vcl/source/app/salvtables.cxx | 121 vcl/source/treelist/svlbitm.cxx | 33 ++ vcl/unx/gtk3/gtk3gtkinst.cxx| 79 +++--- 6 files changed, 171 insertions(+), 71 deletions(-) New commits: commit 9b498e2b88ffae77717bab2f7a308b83d0a7ae80 Author: Caolán McNamara AuthorDate: Mon Jun 1 10:39:30 2020 +0100 Commit: Caolán McNamara CommitDate: Tue Jun 2 16:20:18 2020 +0200 add separators to TreeView Change-Id: I5e49913dfac82c1243d16ed0a0267a3647f51311 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95270 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/treelistentry.hxx b/include/vcl/treelistentry.hxx index 8cc808bb09c1..093fa1751d8e 100644 --- a/include/vcl/treelistentry.hxx +++ b/include/vcl/treelistentry.hxx @@ -39,13 +39,15 @@ enum class SvTLEntryFlags DISABLE_DROP= 0x0002, // is set if RequestingChildren has not set any children NO_NODEBMP = 0x0004, +// is set if this is a separator line +IS_SEPARATOR= 0x0008, // entry had or has children HAD_CHILDREN= 0x0010, SEMITRANSPARENT = 0x8000, // draw semi-transparent entry bitmaps }; namespace o3tl { -template<> struct typed_flags : is_typed_flags {}; +template<> struct typed_flags : is_typed_flags {}; } class VCL_DLLPUBLIC SvTreeListEntry diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 9d01a0fc7022..d8d6b1a0492d 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -888,6 +888,9 @@ public: insert(nullptr, -1, , , nullptr, , nullptr, false, nullptr); } +virtual void insert_separator(int pos, const OUString& rId) = 0; +void append_separator(const OUString& rId) { insert_separator(-1, rId); } + void connect_changed(const Link& rLink) { m_aChangeHdl = rLink; } /* A row is "activated" when the user double clicks a treeview row. It may diff --git a/vcl/inc/strings.hrc b/vcl/inc/strings.hrc index e378b54814bd..d97ef387d9f4 100644 --- a/vcl/inc/strings.hrc +++ b/vcl/inc/strings.hrc @@ -153,6 +153,8 @@ #define STR_WIZDLG_NEXT NC_("STR_WIZDLG_NEXT", "~Next >") #define STR_WIZDLG_PREVIOUS NC_("STR_WIZDLG_PREVIOUS", "< Bac~k") +#define STR_SEPARATORNC_("STR_SEPARATOR", "Separator") + #endif // INCLUDED_VCL_INC_STRINGS_HRC /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 1f0c05e292db..2b0e1c9c28cb 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -3258,6 +3258,71 @@ private: pEntry->AddItem(std::move(xCell)); } +void do_insert(const weld::TreeIter* pParent, int pos, const OUString* pStr, + const OUString* pId, const OUString* pIconName, + VirtualDevice* pImageSurface, const OUString* pExpanderName, + bool bChildrenOnDemand, weld::TreeIter* pRet, bool bIsSeparator) +{ +disable_notify_events(); +const SalInstanceTreeIter* pVclIter = static_cast(pParent); +SvTreeListEntry* iter = pVclIter ? pVclIter->iter : nullptr; +auto nInsertPos = pos == -1 ? TREELIST_APPEND : pos; +void* pUserData; +if (pId) +{ +m_aUserData.emplace_back(std::make_unique(*pId)); +pUserData = m_aUserData.back().get(); +} +else +pUserData = nullptr; + +SvTreeListEntry* pEntry = new SvTreeListEntry; +if (bIsSeparator) +pEntry->SetFlags(pEntry->GetFlags() | SvTLEntryFlags::IS_SEPARATOR); +if (pIconName || pImageSurface) +{ +Image aImage(pIconName ? createImage(*pIconName) : createImage(*pImageSurface)); +pEntry->AddItem(std::make_unique(aImage, aImage, false)); +} +else +{ +Image aDummy; +pEntry->AddItem(std::make_unique(aDummy, aDummy, false)); +} +if (pStr) +AddStringItem(pEntry, *pStr, 0); +pEntry->SetUserData(pUserData); +m_xTreeView->Insert(pEntry, iter, nInsertPos); + +if (pExpanderName) +{ +Image aImage(createImage(*pExpanderName)); +m_xTreeView->SetExpandedEntryBmp(pEntry, aImage); +m_xTreeView->SetCollapsedEntryBmp(pEntry, aImage); +} + +if (pRet) +{ +SalInstanceTreeIter* pVclRetIter = static_cast(pRet); +pVclRetIter->iter = pEntry; +} + +if (bChildrenOnDemand) +{ +SvTreeListEntry* pPlaceHolder = m_xTreeView->InsertEntry("", pEntry, false, 0, nullptr); +SvViewDataEntry* pViewData =
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |5 +++-- vcl/inc/salvtables.hxx|2 ++ vcl/source/app/salvtables.cxx |6 ++ vcl/unx/gtk3/gtk3gtkinst.cxx | 40 4 files changed, 51 insertions(+), 2 deletions(-) New commits: commit 208d931861be4d5cf571c404f517fb5c26499aa0 Author: Caolán McNamara AuthorDate: Thu May 21 12:48:34 2020 +0100 Commit: Caolán McNamara CommitDate: Fri May 22 20:39:36 2020 +0200 support rendering a widget snapshot to an OutputDevice Change-Id: I7beecd8f9579d5ae4b60a839f4a71c3238e0666d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94645 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index fd734309d6a9..a57f7f4321c3 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -272,6 +272,9 @@ public: virtual void connect_get_property_tree(const Link& rLink) = 0; +// render the widget to an output device +virtual void draw(VirtualDevice& rOutput) = 0; + virtual ~Widget() {} }; @@ -461,8 +464,6 @@ public: virtual void resize_to_request() = 0; -// render the dialog for a screenshot -virtual void draw(VirtualDevice& rOutput) = 0; // collect positions of widgets and their help ids for screenshot purposes virtual ScreenShotCollection collect_screenshot_data() = 0; }; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 6cc85731952e..86b9d0aec5bf 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -390,6 +390,8 @@ public: virtual void set_highlight_background() override; +virtual void draw(VirtualDevice& rOutput) override; + SystemWindow* getSystemWindow(); }; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index b3c9d2cfb77d..67cb4fad45e1 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1135,6 +1135,12 @@ std::unique_ptr SalInstanceWidget::weld_parent() const return std::make_unique(pParent, m_pBuilder, false); } +void SalInstanceWidget::draw(VirtualDevice& rOutput) +{ +rOutput.SetOutputSizePixel(m_xWidget->GetSizePixel()); +m_xWidget->PaintToDevice(, Point()); +} + namespace { class SalInstanceBox : public SalInstanceContainer, public virtual weld::Box diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 530a115bd96b..16b2a1ae1d7c 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -3065,6 +3065,46 @@ public: xRet->SetBackground(COL_TRANSPARENT); return xRet; } + +virtual void draw(VirtualDevice& rOutput) override +{ +// detect if we have to manually setup its size +bool bAlreadyRealized = gtk_widget_get_realized(m_pWidget); +// has to be visible for draw to work +bool bAlreadyVisible = gtk_widget_get_visible(m_pWidget); +// has to be mapped for draw to work +bool bAlreadyMapped = gtk_widget_get_mapped(m_pWidget); +if (!bAlreadyVisible) +gtk_widget_show(m_pWidget); + +GtkAllocation allocation; + +if (!bAlreadyRealized) +gtk_widget_realize(m_pWidget); + +if (!bAlreadyMapped) +gtk_widget_map(m_pWidget); + +if (GTK_IS_CONTAINER(m_pWidget)) +gtk_container_resize_children(GTK_CONTAINER(m_pWidget)); + +gtk_widget_get_allocation(m_pWidget, ); + +rOutput.SetOutputSizePixel(Size(allocation.width, allocation.height)); +cairo_surface_t* pSurface = get_underlying_cairo_surface(rOutput); +cairo_t* cr = cairo_create(pSurface); + +gtk_widget_draw(m_pWidget, cr); + +cairo_destroy(cr); + +if (!bAlreadyVisible) +gtk_widget_hide(m_pWidget); +if (!bAlreadyMapped) +gtk_widget_unmap(m_pWidget); +if (!bAlreadyRealized) +gtk_widget_unrealize(m_pWidget); +} }; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
vcl/inc/salvtables.hxx|2 +- vcl/source/app/salvtables.cxx |2 +- vcl/source/window/builder.cxx |2 +- vcl/source/window/dialog.cxx |2 +- vcl/source/window/layout.cxx |2 +- 5 files changed, 5 insertions(+), 5 deletions(-) New commits: commit abd31ac764ab722f37a18513e02025efb452f323 Author: Szymon Kłos AuthorDate: Fri May 22 09:33:25 2020 +0200 Commit: Szymon Kłos CommitDate: Fri May 22 11:52:43 2020 +0200 Revert "Move messagedialog header to shared include" This reverts commit 2c2af2ebf8b2bed78286df4b4ffcbac556223ca8. Change-Id: I287abf8fa7239e67d7764cd96a12ab77431b572e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94465 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/include/vcl/messagedialog.hxx b/vcl/inc/messagedialog.hxx similarity index 100% rename from include/vcl/messagedialog.hxx rename to vcl/inc/messagedialog.hxx diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index c7c8bcb60214..6cc85731952e 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include "messagedialog.hxx" class SalInstanceBuilder : public weld::Builder { diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 3713585d20e3..b3c9d2cfb77d 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 2a3578eab70e..9fc721ddb010 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -57,7 +57,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index b40fce405a6b..53f2a4e80778 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -58,7 +58,7 @@ #include #include #include -#include +#include #include #include diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 04e5aafdb125..9225c27b05a8 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
vcl/inc/salvtables.hxx|2 +- vcl/source/app/salvtables.cxx |2 +- vcl/source/window/builder.cxx |2 +- vcl/source/window/dialog.cxx |2 +- vcl/source/window/layout.cxx |2 +- 5 files changed, 5 insertions(+), 5 deletions(-) New commits: commit 2c2af2ebf8b2bed78286df4b4ffcbac556223ca8 Author: Szymon Kłos AuthorDate: Thu May 21 14:23:08 2020 +0200 Commit: Szymon Kłos CommitDate: Thu May 21 17:52:36 2020 +0200 Move messagedialog header to shared include Change-Id: Ice8d01d2bb62667667a4c5f0366120cdb7600472 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94635 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/vcl/inc/messagedialog.hxx b/include/vcl/messagedialog.hxx similarity index 100% rename from vcl/inc/messagedialog.hxx rename to include/vcl/messagedialog.hxx diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 6cc85731952e..c7c8bcb60214 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -22,7 +22,7 @@ #include #include #include -#include "messagedialog.hxx" +#include class SalInstanceBuilder : public weld::Builder { diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index b3c9d2cfb77d..3713585d20e3 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 9fc721ddb010..2a3578eab70e 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -57,7 +57,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 53f2a4e80778..b40fce405a6b 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -58,7 +58,7 @@ #include #include #include -#include +#include #include #include diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 9225c27b05a8..04e5aafdb125 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx |4 +++ vcl/inc/salvtables.hxx| 18 +- vcl/source/app/salvtables.cxx | 52 ++ vcl/unx/gtk3/gtk3gtkinst.cxx | 44 +++ 4 files changed, 117 insertions(+), 1 deletion(-) New commits: commit 1d6af937da9d24a0cc30f0324f8f23d0c1156ccd Author: Caolán McNamara AuthorDate: Wed May 13 13:58:57 2020 +0100 Commit: Caolán McNamara CommitDate: Wed May 13 20:30:42 2020 +0200 add access to entry cut/copy/paste Change-Id: I4f84ccdc4490ae6190d02aca206f87133497bff9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94122 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 79b0de0ae508..684c70885231 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -706,6 +706,10 @@ public: virtual bool get_entry_selection_bounds(int& rStartPos, int& rEndPos) = 0; virtual void set_entry_completion(bool bEnable, bool bCaseSensitive = false) = 0; virtual void set_entry_placeholder_text(const OUString& rText) = 0; +virtual void set_entry_editable(bool bEditable) = 0; +virtual void cut_entry_clipboard() = 0; +virtual void copy_entry_clipboard() = 0; +virtual void paste_entry_clipboard() = 0; // font size is in points, not pixels, e.g. see Window::[G]etPointFont virtual void set_entry_font(const vcl::Font& rFont) = 0; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 2321e9198b6a..f8347ca8cda0 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -900,6 +900,14 @@ public: virtual void set_entry_placeholder_text(const OUString&) override; +virtual void set_entry_editable(bool bEditable) override; + +virtual void cut_entry_clipboard() override; + +virtual void copy_entry_clipboard() override; + +virtual void paste_entry_clipboard() override; + virtual void set_entry_font(const vcl::Font&) override; virtual vcl::Font get_entry_font() override; @@ -958,6 +966,14 @@ public: virtual void set_entry_placeholder_text(const OUString& rText) override; +virtual void set_entry_editable(bool bEditable) override; + +virtual void cut_entry_clipboard() override; + +virtual void copy_entry_clipboard() override; + +virtual void paste_entry_clipboard() override; + virtual void select_entry_region(int nStartPos, int nEndPos) override; virtual bool get_entry_selection_bounds(int& rStartPos, int& rEndPos) override; @@ -1045,4 +1061,4 @@ public: virtual ~SalInstanceNotebook() override; }; -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index b9d8e2de83c9..7e683bb6d433 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -5739,6 +5739,14 @@ void SalInstanceComboBoxWithoutEdit::set_entry_completion(bool, bool) { assert(f void SalInstanceComboBoxWithoutEdit::set_entry_placeholder_text(const OUString&) { assert(false); } +void SalInstanceComboBoxWithoutEdit::set_entry_editable(bool /*bEditable*/) { assert(false); } + +void SalInstanceComboBoxWithoutEdit::cut_entry_clipboard() { assert(false); } + +void SalInstanceComboBoxWithoutEdit::copy_entry_clipboard() { assert(false); } + +void SalInstanceComboBoxWithoutEdit::paste_entry_clipboard() { assert(false); } + void SalInstanceComboBoxWithoutEdit::set_entry_font(const vcl::Font&) { assert(false); } vcl::Font SalInstanceComboBoxWithoutEdit::get_entry_font() { assert(false); return vcl::Font(); } @@ -5863,6 +5871,26 @@ void SalInstanceComboBoxWithEdit::set_entry_placeholder_text(const OUString& rTe m_xComboBox->SetPlaceholderText(rText); } +void SalInstanceComboBoxWithEdit::set_entry_editable(bool bEditable) +{ +m_xComboBox->SetReadOnly(!bEditable); +} + +void SalInstanceComboBoxWithEdit::cut_entry_clipboard() +{ +m_xComboBox->Cut(); +} + +void SalInstanceComboBoxWithEdit::copy_entry_clipboard() +{ +m_xComboBox->Copy(); +} + +void SalInstanceComboBoxWithEdit::paste_entry_clipboard() +{ +m_xComboBox->Paste(); +} + void SalInstanceComboBoxWithEdit::select_entry_region(int nStartPos, int nEndPos) { m_xComboBox->SetSelection(Selection(nStartPos, nEndPos < 0 ? SELECTION_MAX : nEndPos)); @@ -6028,6 +6056,30 @@ public: rEntry.SetPlaceholderText(rText); } +virtual void set_entry_editable(bool bEditable) override +{ +Edit& rEntry = m_pEntry->getEntry(); +rEntry.SetReadOnly(!bEditable); +} + +virtual void cut_entry_clipboard() override +{ +Edit& rEntry = m_pEntry->getEntry(); +rEntry.Cut(); +} + +virtual void copy_entry_clipboard() override +{ +
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/weld.hxx | 10 ++ vcl/inc/salvtables.hxx|5 - vcl/source/app/salvtables.cxx | 31 +++ vcl/unx/gtk3/gtk3gtkinst.cxx | 31 +++ 4 files changed, 76 insertions(+), 1 deletion(-) New commits: commit 7c902087c9cef04cd8eff4249755f527249b0300 Author: Caolán McNamara AuthorDate: Tue May 12 11:12:18 2020 +0100 Commit: Caolán McNamara CommitDate: Tue May 12 13:39:56 2020 +0200 add Paned access Change-Id: I5da0125a8f76d201e8dab2892b1f205c759599b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94045 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 63f774e3af06..79b0de0ae508 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -294,6 +294,15 @@ public: virtual void reorder_child(weld::Widget* pWidget, int position) = 0; }; +class VCL_DLLPUBLIC Paned : virtual public Container +{ +public: +// set pixel position of divider +virtual void set_position(int nPos) = 0; +// get pixel position of divider +virtual int get_position() const = 0; +}; + class VCL_DLLPUBLIC ScrolledWindow : virtual public Container { protected: @@ -2188,6 +2197,7 @@ public: bool bTakeOwnership = false) = 0; virtual std::unique_ptr weld_box(const OString& id, bool bTakeOwnership = false) = 0; +virtual std::unique_ptr weld_paned(const OString& id, bool bTakeOwnership = false) = 0; virtual std::unique_ptr weld_button(const OString& id, bool bTakeOwnership = false) = 0; virtual std::unique_ptr weld_menu_button(const OString& id, bool bTakeOwnership = false) diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 1553538ea932..78dfb91d23f4 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -42,6 +42,9 @@ public: virtual std::unique_ptr weld_box(const OString& id, bool bTakeOwnership = false) override; +virtual std::unique_ptr weld_paned(const OString& id, +bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_frame(const OString& id, bool bTakeOwnership = false) override; @@ -612,4 +615,4 @@ public: virtual ~SalInstanceSpinButton() override; }; -#endif \ No newline at end of file +#endif diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index f513a44c4d98..a5e027a5de1f 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1869,6 +1869,29 @@ public: virtual std::unique_ptr weld_label_widget() const override; }; +class SalInstancePaned : public SalInstanceContainer, public virtual weld::Paned +{ +private: +VclPtr m_xPaned; + +public: +SalInstancePaned(VclPaned* pPaned, SalInstanceBuilder* pBuilder, bool bTakeOwnership) +: SalInstanceContainer(pPaned, pBuilder, bTakeOwnership) +, m_xPaned(pPaned) +{ +} + +virtual void set_position(int nPos) override +{ +m_xPaned->set_position(nPos); +} + +virtual int get_position() const override +{ +return m_xPaned->get_position(); +} +}; + class SalInstanceScrolledWindow : public SalInstanceContainer, public virtual weld::ScrolledWindow { private: @@ -6511,6 +6534,14 @@ std::unique_ptr SalInstanceBuilder::weld_box(const OString& id, bool : nullptr; } +std::unique_ptr SalInstanceBuilder::weld_paned(const OString& id, +bool bTakeOwnership) +{ +VclPaned* pPaned = m_xBuilder->get(id); +return pPaned ? std::make_unique(pPaned, this, bTakeOwnership) + : nullptr; +} + std::unique_ptr SalInstanceBuilder::weld_frame(const OString& id, bool bTakeOwnership) { VclFrame* pFrame = m_xBuilder->get(id); diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 934d52f8f6f5..04fc440f50c6 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -5089,6 +5089,28 @@ public: virtual std::unique_ptr weld_label_widget() const override; }; +class GtkInstancePaned : public GtkInstanceContainer, public virtual weld::Paned +{ +private: +GtkPaned* m_pPaned; +public: +GtkInstancePaned(GtkPaned* pPaned, GtkInstanceBuilder* pBuilder, bool bTakeOwnership) +: GtkInstanceContainer(GTK_CONTAINER(pPaned), pBuilder, bTakeOwnership) +, m_pPaned(pPaned) +{ +} + +virtual void set_position(int nPos) override +{ +gtk_paned_set_position(m_pPaned, nPos); +} + +virtual int get_position() const override +{ +return gtk_paned_get_position(m_pPaned); +} +}; + } static
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/gfxlink.hxx |4 -- vcl/inc/TypeSerializer.hxx|4 ++ vcl/source/gdi/TypeSerializer.cxx | 71 ++ vcl/source/gdi/gfxlink.cxx| 71 -- vcl/source/gdi/impgraph.cxx |7 ++- vcl/source/gdi/metaact.cxx|4 +- 6 files changed, 82 insertions(+), 79 deletions(-) New commits: commit bdfd0feefe3785e1ea68bf1f1f987147c8fe9335 Author: Tomaž Vajngerl AuthorDate: Wed Mar 4 16:51:27 2020 +0100 Commit: Tomaž Vajngerl CommitDate: Thu Mar 5 08:38:40 2020 +0100 vcl: move read and write to/from GfxLink to TypeSerializer Change-Id: Ie99d00ea54296f5f3a909ade7115d9a9251f688e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89983 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/include/vcl/gfxlink.hxx b/include/vcl/gfxlink.hxx index 33f1321b6953..0376149f7025 100644 --- a/include/vcl/gfxlink.hxx +++ b/include/vcl/gfxlink.hxx @@ -103,10 +103,6 @@ public: boolExportNative( SvStream& rOStream ) const; boolIsEMF() const; // WMF & EMF stored under the same type (NativeWmf) -public: - -friend SvStream& WriteGfxLink( SvStream& rOStream, const GfxLink& rGfxLink ); -friend SvStream& ReadGfxLink( SvStream& rIStream, GfxLink& rGfxLink ); }; #endif diff --git a/vcl/inc/TypeSerializer.hxx b/vcl/inc/TypeSerializer.hxx index 861da5681178..76842aeee3d2 100644 --- a/vcl/inc/TypeSerializer.hxx +++ b/vcl/inc/TypeSerializer.hxx @@ -23,6 +23,7 @@ #include #include #include +#include class TypeSerializer : public tools::GenericTypeSerializer { @@ -31,6 +32,9 @@ public: void readGradient(Gradient& rGradient); void writeGradient(const Gradient& rGradient); + +void readGfxLink(GfxLink& rGfxLink); +void writeGfxLink(const GfxLink& rGfxLink); }; #endif diff --git a/vcl/source/gdi/TypeSerializer.cxx b/vcl/source/gdi/TypeSerializer.cxx index a54f3558c7ef..ad2f1400da85 100644 --- a/vcl/source/gdi/TypeSerializer.cxx +++ b/vcl/source/gdi/TypeSerializer.cxx @@ -19,6 +19,7 @@ #include #include +#include TypeSerializer::TypeSerializer(SvStream& rStream) : GenericTypeSerializer(rStream) @@ -78,3 +79,73 @@ void TypeSerializer::writeGradient(const Gradient& rGradient) mrStream.WriteUInt16(rGradient.GetEndIntensity()); mrStream.WriteUInt16(rGradient.GetSteps()); } + +void TypeSerializer::readGfxLink(GfxLink& rGfxLink) +{ +sal_uInt16 nType = 0; +sal_uInt32 nDataSize = 0; +sal_uInt32 nUserId = 0; + +Size aSize; +MapMode aMapMode; +bool bMapAndSizeValid = false; + +{ +VersionCompat aCompat(mrStream, StreamMode::READ); + +// Version 1 +mrStream.ReadUInt16(nType); +mrStream.ReadUInt32(nDataSize); +mrStream.ReadUInt32(nUserId); + +if (aCompat.GetVersion() >= 2) +{ +readSize(aSize); +ReadMapMode(mrStream, aMapMode); +bMapAndSizeValid = true; +} +} + +auto nRemainingData = mrStream.remainingSize(); +if (nDataSize > nRemainingData) +{ +SAL_WARN("vcl", "graphic link stream is smaller than requested size"); +nDataSize = nRemainingData; +} + +std::unique_ptr pBuffer(new sal_uInt8[nDataSize]); +mrStream.ReadBytes(pBuffer.get(), nDataSize); + +rGfxLink = GfxLink(std::move(pBuffer), nDataSize, static_cast(nType)); +rGfxLink.SetUserId(nUserId); + +if (bMapAndSizeValid) +{ +rGfxLink.SetPrefSize(aSize); +rGfxLink.SetPrefMapMode(aMapMode); +} +} + +void TypeSerializer::writeGfxLink(const GfxLink& rGfxLink) +{ +{ +VersionCompat aCompat(mrStream, StreamMode::WRITE, 2); + +// Version 1 +mrStream.WriteUInt16(sal_uInt16(rGfxLink.GetType())); +mrStream.WriteUInt32(rGfxLink.GetDataSize()); +mrStream.WriteUInt32(rGfxLink.GetUserId()); + +// Version 2 +writeSize(rGfxLink.GetPrefSize()); +WriteMapMode(mrStream, rGfxLink.GetPrefMapMode()); +} + +if (rGfxLink.GetDataSize()) +{ +if (rGfxLink.GetData()) +mrStream.WriteBytes(rGfxLink.GetData(), rGfxLink.GetDataSize()); +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx index 186961c2ac7d..785d86d3be7f 100644 --- a/vcl/source/gdi/gfxlink.cxx +++ b/vcl/source/gdi/gfxlink.cxx @@ -24,8 +24,6 @@ #include #include #include -#include - GfxLink::GfxLink() : meType(GfxLinkType::NONE) @@ -147,75 +145,6 @@ bool GfxLink::ExportNative( SvStream& rOStream ) const return ( rOStream.GetError() == ERRCODE_NONE ); } -SvStream& WriteGfxLink( SvStream& rOStream, const GfxLink& rGfxLink ) -{ -std::unique_ptr pCompat(new VersionCompat( rOStream, StreamMode::WRITE, 2 )); -TypeSerializer aSerializer(rOStream); - -// Version 1 -
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/graphicfilter.hxx |1 include/vcl/pngread.hxx |2 - vcl/inc/graphic/GraphicReader.hxx | 11 vcl/source/filter/graphicfilter.cxx | 32 +-- vcl/source/filter/jpeg/JpegReader.cxx |2 - vcl/source/filter/jpeg/jpeg.cxx |9 -- vcl/source/filter/jpeg/jpeg.h |2 - vcl/source/filter/jpeg/jpegc.cxx | 44 ++-- vcl/source/filter/png/pngread.cxx | 46 +- vcl/source/graphic/GraphicReader.cxx | 27 --- 10 files changed, 15 insertions(+), 161 deletions(-) New commits: commit 2876a0f79f94cdd139cc8fa40669acde9674bf8c Author: Tomaž Vajngerl AuthorDate: Tue Mar 3 22:01:37 2020 +0100 Commit: Tomaž Vajngerl CommitDate: Wed Mar 4 12:57:43 2020 +0100 graphic: remove preview when importing with GraphicFilter The property "PreviewSizeHint" and the enum value ForPreview in GraphicFilterImportFlags doesn't seem to be used from outside, so let's remove it as it simplifies the PNG and JPEG import filters. It is generally more recommended to load the bitmap file fully and only then resize it to a smaller (preview) size. Change-Id: I97f333686c25f7a7a4bdf6c6f0885154b515fd3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89932 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx index 45fe8e261f9e..8a59d2461a2a 100644 --- a/include/vcl/graphicfilter.hxx +++ b/include/vcl/graphicfilter.hxx @@ -55,7 +55,6 @@ enum class GraphicFilterImportFlags NONE = 0x000, SetLogsizeForJpeg = 0x001, DontSetLogsizeForJpeg = 0x002, -ForPreview = 0x004, /// Only create a bitmap, do not read pixel data. OnlyCreateBitmap = 0x020, /// Read pixel data into an existing bitmap. diff --git a/include/vcl/pngread.hxx b/include/vcl/pngread.hxx index 31592d9f17ac..0fda677e2817 100644 --- a/include/vcl/pngread.hxx +++ b/include/vcl/pngread.hxx @@ -43,7 +43,7 @@ public: /* an empty preview size hint (=default) will read the whole image */ -BitmapEx Read(const Size& i_rPreviewHint = Size()); +BitmapEx Read(); // retrieve every chunk that resides inside the PNG struct ChunkData diff --git a/vcl/inc/graphic/GraphicReader.hxx b/vcl/inc/graphic/GraphicReader.hxx index fe60ecf97b29..9576d42531d1 100644 --- a/vcl/inc/graphic/GraphicReader.hxx +++ b/vcl/inc/graphic/GraphicReader.hxx @@ -24,8 +24,6 @@ #include #include -class ReaderData; - class GraphicReader { public: @@ -33,19 +31,10 @@ public: const OUString& GetUpperFilterName() const { return maUpperName; } -// TODO: when incompatible changes are possible again -// the preview size hint should be redone -void DisablePreviewMode(); -void SetPreviewSize(const Size&); -Size GetPreviewSize() const; - protected: OUString maUpperName; GraphicReader(); - -private: -std::unique_ptr mpReaderData; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 5597fb760b56..21f70c42f352 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1410,7 +1410,7 @@ void GraphicFilter::preload() ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath, SvStream& rIStream, sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, GraphicFilterImportFlags nImportFlags, - const css::uno::Sequence< css::beans::PropertyValue >* pFilterData, + const css::uno::Sequence< css::beans::PropertyValue >* /*pFilterData*/, WmfExternal const *pExtHeader ) { OUString aFilterName; @@ -1420,32 +1420,11 @@ ErrCode GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath, GfxLinkTypeeLinkType = GfxLinkType::NONE; const bool bLinkSet = rGraphic.IsGfxLink(); -SizeaPreviewSizeHint( 0, 0 ); - std::unique_ptr pGraphicContent; sal_Int32 nGraphicContentSize = 0; ResetLastError(); -if ( pFilterData ) -{ -for ( const auto& rPropVal : *pFilterData ) -{ -if ( rPropVal.Name == "PreviewSizeHint" ) -{ -css::awt::Size aSize; -if ( rPropVal.Value >>= aSize ) -{ -aPreviewSizeHint = Size( aSize.Width, aSize.Height ); -if ( aSize.Width || aSize.Height ) -nImportFlags |= GraphicFilterImportFlags::ForPreview; -else -nImportFlags
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/syschild.hxx |1 + vcl/inc/salobj.hxx |2 ++ vcl/inc/unx/gtk/gtkobject.hxx |2 ++ vcl/source/window/syschild.cxx |7 +++ vcl/unx/gtk3/gtk3gtkobject.cxx | 16 5 files changed, 28 insertions(+) New commits: commit 0c764bfd7abf0b4f21ece732d79bf9b02d7a42d9 Author: Caolán McNamara AuthorDate: Tue Dec 17 17:25:57 2019 + Commit: Caolán McNamara CommitDate: Thu Dec 19 17:14:06 2019 +0100 add a SystemChildWindow::GetOptimalSize override Change-Id: I812d996e78a6d627fda6612307ca4cb2f111b6a9 Reviewed-on: https://gerrit.libreoffice.org/85325 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/vcl/syschild.hxx b/include/vcl/syschild.hxx index bdfd913fe929..11d85b029bf5 100644 --- a/include/vcl/syschild.hxx +++ b/include/vcl/syschild.hxx @@ -41,6 +41,7 @@ public: // create a SystemChildWindow using the given SystemWindowData explicitSystemChildWindow( vcl::Window* pParent, WinBits nStyle, SystemWindowData *pData, bool bShow = true ); virtual ~SystemChildWindow() override; +virtual SizeGetOptimalSize() const override; virtual voiddispose() override; virtual const SystemEnvData* GetSystemData() const override; diff --git a/vcl/inc/salobj.hxx b/vcl/inc/salobj.hxx index 83024fec339d..90ef3ae5e8d2 100644 --- a/vcl/inc/salobj.hxx +++ b/vcl/inc/salobj.hxx @@ -55,6 +55,8 @@ public: virtual const SystemEnvData*GetSystemData() const = 0; +virtual Size GetOptimalSize() const { return Size(); } + voidSetCallback( SystemChildWindow* pInst, SALOBJECTPROC pProc ) { m_pInst = pInst; m_pCallback = pProc; } voidCallCallback( SalObjEvent nEvent ) diff --git a/vcl/inc/unx/gtk/gtkobject.hxx b/vcl/inc/unx/gtk/gtkobject.hxx index 75dbe39e4b9e..7ff9e499815b 100644 --- a/vcl/inc/unx/gtk/gtkobject.hxx +++ b/vcl/inc/unx/gtk/gtkobject.hxx @@ -52,6 +52,8 @@ public: virtual voidSetForwardKey( bool bEnable ) override; virtual const SystemEnvData*GetSystemData() const override; + +virtual SizeGetOptimalSize() const override; }; #endif // INCLUDED_VCL_INC_UNX_GTK_GTKOBJECT_HXX diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index 2ba10a2bcc75..81cbc43abd11 100644 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -140,6 +140,13 @@ void SystemChildWindow::EnableEraseBackground( bool bEnable ) mpWindowImpl->mpSysObj->EnableEraseBackground( bEnable ); } +Size SystemChildWindow::GetOptimalSize() const +{ +if (mpWindowImpl->mpSysObj) +return mpWindowImpl->mpSysObj->GetOptimalSize(); +return vcl::Window::GetOptimalSize(); +} + void SystemChildWindow::SetLeaveEnterBackgrounds(const css::uno::Sequence& rLeaveArgs, const css::uno::Sequence& rEnterArgs) { if (mpWindowImpl->mpSysObj) diff --git a/vcl/unx/gtk3/gtk3gtkobject.cxx b/vcl/unx/gtk3/gtk3gtkobject.cxx index 833048611b14..3079fdbe03a4 100644 --- a/vcl/unx/gtk3/gtk3gtkobject.cxx +++ b/vcl/unx/gtk3/gtk3gtkobject.cxx @@ -156,6 +156,22 @@ void GtkSalObject::Show( bool bVisible ) } } +Size GtkSalObject::GetOptimalSize() const +{ +if (m_pSocket) +{ +bool bVisible = gtk_widget_get_visible(m_pSocket); +if (!bVisible) +gtk_widget_set_visible(m_pSocket, true); +GtkRequisition size; +gtk_widget_get_preferred_size(m_pSocket, nullptr, ); +if (!bVisible) +gtk_widget_set_visible(m_pSocket, false); +return Size(size.width, size.height); +} +return Size(); +} + const SystemEnvData* GtkSalObject::GetSystemData() const { return _aSystemData; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
vcl/source/app/salvtables.cxx |2 +- vcl/source/window/aboutdialog.cxx |2 +- vcl/source/window/builder.cxx |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) New commits: commit 2d63403fa3bf7fe6019b58ce4af5c49968e03a5b Author: Caolán McNamara AuthorDate: Tue Jul 23 21:31:26 2019 +0100 Commit: Caolán McNamara CommitDate: Wed Jul 24 14:24:55 2019 +0200 move aboutdialog header inside vcl Change-Id: I1906992759afec0176b723917662fa0644a03c1c Reviewed-on: https://gerrit.libreoffice.org/76221 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/vcl/aboutdialog.hxx b/vcl/inc/aboutdialog.hxx similarity index 100% rename from include/vcl/aboutdialog.hxx rename to vcl/inc/aboutdialog.hxx diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 5aab75be773d..6f8d11cb7886 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -65,6 +64,7 @@ #include #include #include +#include #include SalFrame::SalFrame() diff --git a/vcl/source/window/aboutdialog.cxx b/vcl/source/window/aboutdialog.cxx index b8a8aa595982..ba09f423ab05 100644 --- a/vcl/source/window/aboutdialog.cxx +++ b/vcl/source/window/aboutdialog.cxx @@ -12,11 +12,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 604d9950dece..0a4c66e0cbf1 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -61,6 +60,7 @@ #include #include #include +#include #include #include #include ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/metric.hxx | 46 - vcl/inc/impfontmetric.hxx | 70 - vcl/source/font/fontmetric.cxx | 135 +++-- vcl/source/outdev/font.cxx |2 4 files changed, 41 insertions(+), 212 deletions(-) New commits: commit 4b557c96597a9bbb51677fd83bac98a2edbb9db1 Author: Noel Grandin AuthorDate: Fri Jul 5 13:09:35 2019 +0200 Commit: Noel Grandin CommitDate: Fri Jul 5 15:11:12 2019 +0200 flatten and simplify FontMetric Change-Id: I9cce47c132345e40d3500ba69178e871d68bf764 Reviewed-on: https://gerrit.libreoffice.org/75130 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/vcl/metric.hxx b/include/vcl/metric.hxx index 55d26cede8fd..0eb584960c16 100644 --- a/include/vcl/metric.hxx +++ b/include/vcl/metric.hxx @@ -25,7 +25,6 @@ #include #include -class ImplFontMetric; class FontCharMap; typedef sal_uInt32 sal_UCS4; @@ -36,35 +35,44 @@ class VCL_DLLPUBLIC FontMetric : public vcl::Font public: explicitFontMetric(); FontMetric( const FontMetric& ); // TODO make this explicit -virtual ~FontMetric() override; +~FontMetric() override; -longGetAscent() const; -longGetDescent() const; -longGetInternalLeading() const; -longGetExternalLeading() const; -longGetLineHeight() const; -longGetSlant() const; -longGetBulletOffset() const; +longGetAscent() const { return mnAscent; } +longGetDescent() const { return mnDescent; } +longGetInternalLeading() const { return mnIntLeading; } +longGetExternalLeading() const { return mnExtLeading; } +longGetLineHeight() const { return mnLineHeight; } // TODO this is ascent + descnt +longGetSlant() const{ return mnSlant; } +longGetBulletOffset() const { return mnBulletOffset; } -voidSetAscent(long); -voidSetDescent(long); -voidSetExternalLeading(long); -voidSetInternalLeading(long); -voidSetLineHeight(long); -voidSetSlant(long); -voidSetBulletOffset(long); +voidSetAscent( long nAscent ) { mnAscent = nAscent; } +voidSetDescent( long nDescent ) { mnDescent = nDescent; } +voidSetExternalLeading( long nExtLeading ) { mnExtLeading = nExtLeading; } +voidSetInternalLeading( long nIntLeading ) { mnIntLeading = nIntLeading; } +voidSetLineHeight( long nHeight ) { mnLineHeight = nHeight; } // TODO this is ascent + descent +voidSetSlant( long nSlant ) { mnSlant = nSlant; } +voidSetBulletOffset( long nOffset ) { mnBulletOffset = nOffset; } -boolIsFullstopCentered() const; +boolIsFullstopCentered() const { return mbFullstopCentered; } -voidSetFullstopCenteredFlag(bool); +voidSetFullstopCenteredFlag( bool bCentered ) { mbFullstopCentered = bCentered; } +using Font::operator=; FontMetric& operator=( const FontMetric& rMetric ); FontMetric& operator=( FontMetric&& rMetric ); booloperator==( const FontMetric& rMetric ) const; booloperator!=( const FontMetric& rMetric ) const { return !operator==( rMetric ); } private: -tools::SvRef mxImplMetric;// Implementation +longmnAscent; // Ascent +longmnDescent; // Descent +longmnIntLeading; // Internal Leading +longmnExtLeading; // External Leading +longmnLineHeight; // Ascent+Descent+EmphasisMark +longmnSlant; // Slant +longmnBulletOffset;// Offset for non-printing character + +boolmbFullstopCentered; }; template< typename charT, typename traits > diff --git a/vcl/inc/impfontmetric.hxx b/vcl/inc/impfontmetric.hxx deleted file mode 100644 index 6267a30fddfd.. --- a/vcl/inc/impfontmetric.hxx +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/graph.hxx|7 +-- include/vcl/vectorgraphicdata.hxx|1 + vcl/inc/impgraph.hxx |2 ++ vcl/source/gdi/bitmapex.cxx |8 vcl/source/gdi/impgraph.cxx | 27 +++ vcl/source/gdi/vectorgraphicdata.cxx |6 ++ 6 files changed, 25 insertions(+), 26 deletions(-) New commits: commit 319c57d2af5d26d3910db4b02dca145d8881af44 Author: Noel Grandin AuthorDate: Mon May 20 19:08:19 2019 +0200 Commit: Noel Grandin CommitDate: Wed May 22 09:48:21 2019 +0200 tdf#120837 File saving at least 5 times slower The problem here is that we never actually hit the maExportGraphics cache in SvXMLGraphicHelper, even though we are passing the same image down repeatedly. There are two bugs here: (1) BitmapEx::operator== does not return true if we instantiate 2 Graphic objects from the same XGraphic, so change it to use the more expensive operator==. To mitigate the cost, move the expensive checks to the bottom of the method. (2) in order to use an object in std::unordered_map, the object must implement an equality function and a hash function. If two objects are equal THEY MUST have the same hash value. Using the Impl* as the hash value does not satisfy that condition, so rather use the checksum, which does. After these fixes, the save time drops to less than a second. Also make the checksum method look more like the operator== method, and add a checksum calculation method for SVG data that more accurately reflects the underlying SVG data. Change-Id: I4ca0c7bee60b2efa6fe42301e582c7b278022b46 Reviewed-on: https://gerrit.libreoffice.org/72615 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx index e8af0d2c06ce..d49a8a2ce512 100644 --- a/include/vcl/graph.hxx +++ b/include/vcl/graph.hxx @@ -195,11 +195,6 @@ public: BitmapChecksum GetChecksum() const; -SAL_DLLPRIVATE std::size_t getHash() const -{ -return reinterpret_cast(ImplGetImpGraphic()); -} - OUString getOriginURL() const; void setOriginURL(OUString const & rOriginURL); @@ -247,7 +242,7 @@ struct hash { std::size_t operator()(Graphic const & rGraphic) const { -return rGraphic.getHash(); +return static_cast(rGraphic.GetChecksum()); } }; diff --git a/include/vcl/vectorgraphicdata.hxx b/include/vcl/vectorgraphicdata.hxx index 113a733e296d..7a45533b8f6b 100644 --- a/include/vcl/vectorgraphicdata.hxx +++ b/include/vcl/vectorgraphicdata.hxx @@ -104,6 +104,7 @@ public: const basegfx::B2DRange& getRange() const; const std::deque< css::uno::Reference< css::graphic::XPrimitive2D > >& getPrimitive2DSequence() const; const BitmapEx& getReplacement() const; +BitmapChecksum GetChecksum() const; }; typedef std::shared_ptr< VectorGraphicData > VectorGraphicDataPtr; diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index 457a33cfcddb..b97f736c770d 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -84,6 +84,8 @@ private: bool mbSwapOut; bool mbDummyContext; VectorGraphicDataPtr maVectorGraphicData; +// cache checksum computation +mutable BitmapChecksum mnChecksum = 0; /// The PDF stream from which this Graphic is rendered, /// as converted (version downgraded) from the original, diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 2ea870e341e6..de9f2fb97762 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -181,9 +181,6 @@ bool BitmapEx::operator==( const BitmapEx& rBitmapEx ) const if (meTransparent != rBitmapEx.meTransparent) return false; -if (!maBitmap.ShallowEquals(rBitmapEx.maBitmap)) -return false; - if (GetSizePixel() != rBitmapEx.GetSizePixel()) return false; @@ -197,7 +194,10 @@ bool BitmapEx::operator==( const BitmapEx& rBitmapEx ) const if (mbAlpha != rBitmapEx.mbAlpha) return false; -return maMask.ShallowEquals(rBitmapEx.maMask); +if (maBitmap != rBitmapEx.maBitmap) +return false; + +return maMask == rBitmapEx.maMask; } bool BitmapEx::IsEmpty() const diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index f99d44799aaa..3cd67b08ce33 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -1663,6 +1663,9 @@ bool ImpGraphic::ImplIsLink() const BitmapChecksum ImpGraphic::ImplGetChecksum() const { +if (mnChecksum != 0) +return mnChecksum; + BitmapChecksum nRet = 0; ensureAvailable(); @@ -1676,25 +1679,16 @@ BitmapChecksum ImpGraphic::ImplGetChecksum() const case GraphicType::Bitmap: { -if(maVectorGraphicData.get() &&
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx
include/vcl/menu.hxx|3 + vcl/inc/salmenu.hxx |4 + vcl/inc/unx/gtk/gtksalmenu.hxx | 11 + vcl/source/app/salvtables.cxx |9 vcl/source/window/dockingarea.cxx |9 vcl/source/window/menu.cxx | 15 +++ vcl/source/window/menubarwindow.cxx |3 + vcl/unx/gtk/gtksalmenu.cxx | 73 8 files changed, 120 insertions(+), 7 deletions(-) New commits: commit 46efac592b76d32152353466120eea2c9800858f Author: Caolán McNamara AuthorDate: Tue Jan 22 11:21:27 2019 + Commit: Caolán McNamara CommitDate: Tue Jan 22 18:23:52 2019 +0100 Resolves: tdf#122241 support persona header in native gtk3 menubar Change-Id: Ia4485ec4c342c86f40e8e0bb7e5e1af1a47bb9b9 Reviewed-on: https://gerrit.libreoffice.org/66725 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx index 552a596b46a0..f3fb3e7c8056 100644 --- a/include/vcl/menu.hxx +++ b/include/vcl/menu.hxx @@ -469,6 +469,9 @@ public: tools::Rectangle GetMenuBarButtonRectPixel( sal_uInt16 nId ); void RemoveMenuBarButton( sal_uInt16 nId ); void LayoutChanged(); +// get the height of the menubar, return the native menubar height if that is active or the vcl +// one if not +int GetMenuBarHeight() const; }; inline MenuBar& MenuBar::operator=( const MenuBar& rMenu ) diff --git a/vcl/inc/salmenu.hxx b/vcl/inc/salmenu.hxx index 169d887068da..0b6cd9e22481 100644 --- a/vcl/inc/salmenu.hxx +++ b/vcl/inc/salmenu.hxx @@ -90,6 +90,10 @@ public: // return Rectangle( Point( -1, -1 ), Size( 1, 1 ) ) if menu bar buttons implemented // but rectangle cannot be determined virtual tools::Rectangle GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame* i_pReferenceFrame ); + +virtual int GetMenuBarHeight() const; + +virtual void ApplyPersona(); }; #endif // INCLUDED_VCL_INC_SALMENU_HXX diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx index 9ab448857085..bdacee7ca178 100644 --- a/vcl/inc/unx/gtk/gtksalmenu.hxx +++ b/vcl/inc/unx/gtk/gtksalmenu.hxx @@ -20,6 +20,7 @@ #include #include +#include #include #if GTK_CHECK_VERSION(3,0,0) @@ -40,6 +41,10 @@ # endif #endif +#if !GTK_CHECK_VERSION(3,0,0) +typedef void GtkCssProvider; +#endif + class MenuItemList; class GtkSalMenuItem; @@ -55,8 +60,12 @@ private: boolmbReturnFocusToDocument; boolmbAddedGrab; GtkWidget* mpMenuBarContainerWidget; +std::unique_ptr mxPersonaImage; +BitmapExmaPersonaBitmap; GtkWidget* mpMenuAllowShrinkWidget; GtkWidget* mpMenuBarWidget; +GtkCssProvider* mpMenuBarContainerProvider; +GtkCssProvider* mpMenuBarProvider; GtkWidget* mpCloseButton; VclPtrmpVCLMenu; GtkSalMenu* mpParentSalMenu; @@ -137,6 +146,8 @@ public: virtual void ShowCloseButton(bool bShow) override; virtual bool CanGetFocus() const override; virtual bool TakeFocus() override; +virtual int GetMenuBarHeight() const override; +virtual void ApplyPersona() override; }; class GtkSalMenuItem : public SalMenuItem diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 02f07418a44a..4c343f85d53d 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -205,6 +205,15 @@ tools::Rectangle SalMenu::GetMenuBarButtonRectPixel( sal_uInt16, SalFrame* ) return tools::Rectangle(); } +int SalMenu::GetMenuBarHeight() const +{ +return 0; +} + +void SalMenu::ApplyPersona() +{ +} + SalMenuItem::~SalMenuItem() { } diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx index 2f27d3e3f520..fed3fa5c4737 100644 --- a/vcl/source/window/dockingarea.cxx +++ b/vcl/source/window/dockingarea.cxx @@ -131,14 +131,9 @@ void DockingAreaWindow::ApplySettings(vcl::RenderContext& rRenderContext) // we need to shift the bitmap vertically so that it spans over the // menubar conveniently -long nMenubarHeight = 0; SystemWindow* pSysWin = GetSystemWindow(); -if (pSysWin && pSysWin->GetMenuBar()) -{ -vcl::Window* pMenubarWin = pSysWin->GetMenuBar()->GetWindow(); -if (pMenubarWin) -nMenubarHeight = pMenubarWin->GetOutputHeightPixel(); -} +MenuBar* pMenuBar = pSysWin ? pSysWin->GetMenuBar() : nullptr; +int nMenubarHeight = pMenuBar ? pMenuBar->GetMenuBarHeight() : 0; aWallpaper.SetRect(tools::Rectangle(Point(0, -nMenubarHeight), Size(rRenderContext.GetOutputWidthPixel(),
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/svapp.hxx | 16 vcl/inc/svdata.hxx |1 + vcl/source/app/salplug.cxx |7 +++ vcl/source/app/svapp.cxx | 12 vcl/source/opengl/OpenGLHelper.cxx | 13 - 5 files changed, 28 insertions(+), 21 deletions(-) New commits: commit a6dc9f3fd18ad69aa041662628f4f923ab3a82f8 Author: Jan-Marek Glogowski AuthorDate: Fri Nov 23 08:43:04 2018 +0100 Commit: Jan-Marek Glogowski CommitDate: Wed Dec 5 14:39:37 2018 +0100 Add interface for software-only bitmap rendering When SAL_USE_VCLPLUGIN=svp is used, LO is expected to render output only to bitmaps, without real GUI windows. This adds an enabler and a getter function to the Application class, so one can query this information easy as (Enable|Is)BitmapRendering. This can be used by all VCL plugins, which can't fall back to the Cairo based SVP plugin, primary OSX and Win. A working implementation should allow to run all test via SSH. All window-requiring tests already have to set this requirement using gb_CppunitTest_use_vcl_non_headless(_with_windows)? and should be moved to a different make target, or we need some test harness to handle this correctly, before VCL fails the test. Change-Id: I4bd4c81122a6686b090fdd93256d4712ac5f05dd Reviewed-on: https://gerrit.libreoffice.org/64051 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 6249e3449e6f..c597ba453de3 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -1218,19 +1218,19 @@ public: /** Enable Console Only mode - Used to disable Mac specific app init that requires an app bundle. + Convenience function to enable headless and bitmap rendering. */ static void EnableConsoleOnly(); -/** Determines if console only mode is enabled. - - Used to see if Mac specific app init has been disabled. +/** Enable software-only bitmap rendering + */ +static void EnableBitmapRendering(); - @returns True if console only mode is on, false if not. +/** Determines if bitmap rendering is enabled - @see EnableConsoleOnly -*/ -static bool IsConsoleOnly(); + @return True if bitmap rendering is enabled. + */ +static bool IsBitmapRendering(); ///@} diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index 21ca3567b56a..b83607f75c44 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -154,6 +154,7 @@ struct ImplSVAppData boolmbAppQuit = false; // is Application::Quit() called boolmbSettingsInit = false; // true: Settings are initialized DialogCancelMode meDialogCancel = DialogCancelMode::Off; // true: All Dialog::Execute() calls will be terminated immediately with return false +bool mbRenderToBitmaps = false; // set via svp / headless plugin /** Controls whether showing any IME status window is toggled on or off. diff --git a/vcl/source/app/salplug.cxx b/vcl/source/app/salplug.cxx index a79339cd0ad2..205f5dae0526 100644 --- a/vcl/source/app/salplug.cxx +++ b/vcl/source/app/salplug.cxx @@ -243,6 +243,13 @@ SalInstance *CreateSalInstance() #endif rtl::Bootstrap::get( "SAL_USE_VCLPLUGIN", aUsePlugin ); +if (aUsePlugin == "svp") +{ +Application::EnableBitmapRendering(); +#ifndef HEADLESS_VCLPLUG +aUsePlugin.clear(); +#endif +} if( !aUsePlugin.isEmpty() ) pInst = tryInstance( aUsePlugin, true ); diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index b42c1f158a9f..40ff79b7d70f 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1438,6 +1438,7 @@ const LocaleDataWrapper& Application::GetAppLocaleDataWrapper() void Application::EnableHeadlessMode( bool dialogsAreFatal ) { +assert(GetDialogCancelMode() == DialogCancelMode::Off); SetDialogCancelMode( dialogsAreFatal ? DialogCancelMode::Fatal : DialogCancelMode::Silent ); } @@ -1447,17 +1448,20 @@ bool Application::IsHeadlessModeEnabled() return IsDialogCancelEnabled() || comphelper::LibreOfficeKit::isActive(); } -static bool bConsoleOnly = false; +void Application::EnableBitmapRendering() +{ +ImplGetSVData()->maAppData.mbRenderToBitmaps = true; +} -bool Application::IsConsoleOnly() +bool Application::IsBitmapRendering() { -return bConsoleOnly; +return ImplGetSVData()->maAppData.mbRenderToBitmaps; } void Application::EnableConsoleOnly() { EnableHeadlessMode(true); -bConsoleOnly = true; +EnableBitmapRendering(); } static bool bEventTestingMode = false; diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx index 588ae70cabe0..882f35d424af 100644 ---
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/ImageTree.hxx |6 ++ vcl/inc/implimagetree.hxx | 15 +++ vcl/source/image/ImageTree.cxx | 10 +- vcl/source/image/ImplImageTree.cxx | 37 + 4 files changed, 51 insertions(+), 17 deletions(-) New commits: commit bc8e23fc946380751447ab24587b1631eb56ef19 Author: Michael Meeks AuthorDate: Mon Nov 26 13:24:03 2018 + Commit: Michael Meeks CommitDate: Tue Nov 27 13:16:38 2018 +0100 Add explicit API scaling via ImageTree API. Also add image scale to in-memory cache lookup. Change-Id: I1e84b922d4a9ab2f1723c5cb8a72f295c6940504 Reviewed-on: https://gerrit.libreoffice.org/64043 Tested-by: Jenkins Reviewed-by: Michael Meeks diff --git a/include/vcl/ImageTree.hxx b/include/vcl/ImageTree.hxx index 6598c34c09e9..4b49a31f30b9 100644 --- a/include/vcl/ImageTree.hxx +++ b/include/vcl/ImageTree.hxx @@ -64,6 +64,12 @@ public: BitmapEx & bitmap, bool localized, const ImageLoadFlags eFlags = ImageLoadFlags::NONE); +VCL_DLLPUBLIC bool loadImage( +OUString const & name, OUString const & style, +BitmapEx & bitmap, bool localized, +sal_Int32 nScalePercentage, +const ImageLoadFlags eFlags = ImageLoadFlags::NONE); + VCL_DLLPUBLIC css::uno::Reference const & getNameAccess(); diff --git a/vcl/inc/implimagetree.hxx b/vcl/inc/implimagetree.hxx index 3768b04388b3..1e81aba8fac8 100644 --- a/vcl/inc/implimagetree.hxx +++ b/vcl/inc/implimagetree.hxx @@ -46,14 +46,17 @@ struct ImageRequestParameters bool mbLocalized; ImageLoadFlags const meFlags; bool mbWriteImageToCache; +sal_Int32 mnScalePercentage; -ImageRequestParameters(const OUString & rName, const OUString & rStyle, BitmapEx& rBitmap, bool bLocalized, ImageLoadFlags eFlags) +ImageRequestParameters(const OUString & rName, const OUString & rStyle, BitmapEx& rBitmap, bool bLocalized, + ImageLoadFlags eFlags, sal_Int32 nScalePercentage) : msName(rName) , msStyle(rStyle) , mrBitmap(rBitmap) , mbLocalized(bLocalized) , meFlags(eFlags) , mbWriteImageToCache(false) +, mnScalePercentage(nScalePercentage) {} bool convertToDarkTheme(); @@ -75,7 +78,8 @@ public: bool loadImage( OUString const & name, OUString const & style, BitmapEx & bitmap, bool localized, -const ImageLoadFlags eFlags); +const ImageLoadFlags eFlags, +sal_Int32 nScalePercentage = -1); /** a crude form of life cycle control (called from DeInitVCL; otherwise, * if the ImplImageTree singleton were destroyed during exit that would @@ -88,14 +92,15 @@ private: ImplImageTree(const ImplImageTree&) = delete; ImplImageTree& operator=(const ImplImageTree&) = delete; -typedef std::unordered_map> IconCache; +typedef std::unordered_map> IconCache; +typedef std::unordered_map> ScaledIconCache; typedef std::unordered_map IconLinkHash; struct IconSet { OUString maURL; css::uno::Reference maNameAccess; -IconCache maIconCache; +ScaledIconCache maScaledIconCaches; IconLinkHash maLinkHash; IconSet() @@ -128,6 +133,8 @@ private: void createStyle(); +IconCache (ImageRequestParameters& rParameters); + bool iconCacheLookup(ImageRequestParameters& rParameters); bool findImage(std::vector const & rPaths, ImageRequestParameters& rParameters); diff --git a/vcl/source/image/ImageTree.cxx b/vcl/source/image/ImageTree.cxx index 2e20183b0da5..826671e110ec 100644 --- a/vcl/source/image/ImageTree.cxx +++ b/vcl/source/image/ImageTree.cxx @@ -37,9 +37,17 @@ std::shared_ptr ImageTree::getImageStream(OUString const & rName bool ImageTree::loadImage(OUString const & rName, OUString const & rStyle, BitmapEx & rBitmap, bool bLocalized, + sal_Int32 nScalePercentage, const ImageLoadFlags eFlags) { -return mpImplImageTree->loadImage(rName, rStyle, rBitmap, bLocalized, eFlags); +return mpImplImageTree->loadImage(rName, rStyle, rBitmap, bLocalized, eFlags, nScalePercentage); +} + +bool ImageTree::loadImage(OUString const & rName, OUString const & rStyle, + BitmapEx & rBitmap, bool bLocalized, + const ImageLoadFlags eFlags) +{ +return loadImage(rName, rStyle, rBitmap, bLocalized, -1, eFlags); } css::uno::Reference const & ImageTree::getNameAccess() diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx index 1fed00908365..22fd194b3a8d 100644 --- a/vcl/source/image/ImplImageTree.cxx +++ b/vcl/source/image/ImplImageTree.cxx @@ -69,6 +69,8 @@ sal_Int32 ImageRequestParameters::scalePercentage() sal_Int32 aScalePercentage = 100; if (!(meFlags &
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/window.hxx |2 ++ vcl/inc/messagedialog.hxx|2 ++ vcl/source/window/layout.cxx | 14 ++ 3 files changed, 18 insertions(+) New commits: commit 0120dfb12bcc8f86f256f8f56410215c1828e578 Author: Caolán McNamara AuthorDate: Thu Nov 8 17:21:30 2018 + Commit: Caolán McNamara CommitDate: Fri Nov 9 09:59:41 2018 +0100 Resolves: tdf#121181 expand message boxes to show full title as MsgBox used to do Change-Id: I03d459b8c18f60a19ea5b0034a8d98f6aa4f5ce4 Reviewed-on: https://gerrit.libreoffice.org/63117 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 7975bd252df8..6557c45434d1 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -443,6 +443,7 @@ class SystemWindow; class WorkWindow; class Dialog; class MessBox; +class MessageDialog; class DockingWindow; class FloatingWindow; class GroupBox; @@ -505,6 +506,7 @@ class VCL_DLLPUBLIC Window : public ::OutputDevice friend class ::WorkWindow; friend class ::Dialog; friend class ::MessBox; +friend class ::MessageDialog; friend class ::DockingWindow; friend class ::FloatingWindow; friend class ::GroupBox; diff --git a/vcl/inc/messagedialog.hxx b/vcl/inc/messagedialog.hxx index 5b4fda5a231c..756409ef8a3f 100644 --- a/vcl/inc/messagedialog.hxx +++ b/vcl/inc/messagedialog.hxx @@ -35,6 +35,8 @@ private: friend class VclPtr; MessageDialog(vcl::Window* pParent, WinBits nStyle); +virtual void StateChanged(StateChangedType nType) override; + public: MessageDialog(vcl::Window* pParent, const OUString& rMessage, VclMessageType eMessageType, VclButtonsType eButtonsType); diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 10f28daa6a6f..9c5a8c89dc0e 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -2479,6 +2479,20 @@ void MessageDialog::set_secondary_text(const OUString ) } } +void MessageDialog::StateChanged(StateChangedType nType) +{ +if (nType == StateChangedType::InitShow) +{ +// MessageBox should be at least as wide as to see the title +auto nTitleWidth = CalcTitleWidth(); +// Extra-Width for Close button +nTitleWidth += mpWindowImpl->mnTopBorder; +if (get_preferred_size().Width() < nTitleWidth) +set_width_request(nTitleWidth); +} +Dialog::StateChanged(nType); +} + VclVPaned::VclVPaned(vcl::Window *pParent) : VclContainer(pParent, WB_HIDE | WB_CLIPCHILDREN) , m_pSplitter(VclPtr::Create(this, WB_VSCROLL)) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/BitmapAlphaClampFilter.hxx|2 +- include/vcl/BitmapColorQuantizationFilter.hxx |2 +- include/vcl/BitmapConvolutionMatrixFilter.hxx |2 +- include/vcl/BitmapDuoToneFilter.hxx |2 +- include/vcl/BitmapEmbossGreyFilter.hxx|2 +- include/vcl/BitmapFilter.hxx |6 +++--- include/vcl/BitmapGaussianSeparableBlurFilter.hxx |4 ++-- include/vcl/BitmapMedianFilter.hxx|2 +- include/vcl/BitmapMonochromeFilter.hxx|2 +- include/vcl/BitmapMosaicFilter.hxx| 10 +++--- include/vcl/BitmapPopArtFilter.hxx|2 +- include/vcl/BitmapSeparableUnsharpenFilter.hxx|2 +- include/vcl/BitmapSepiaFilter.hxx |2 +- include/vcl/BitmapSimpleColorQuantizationFilter.hxx |2 +- include/vcl/BitmapSmoothenFilter.hxx |2 +- include/vcl/BitmapSobelGreyFilter.hxx |2 +- include/vcl/BitmapSolarizeFilter.hxx |2 +- vcl/inc/BitmapColorizeFilter.hxx |2 +- vcl/inc/BitmapDisabledImageFilter.hxx |2 +- vcl/inc/BitmapFastScaleFilter.hxx |2 +- vcl/inc/BitmapInterpolateScaleFilter.hxx |2 +- vcl/inc/BitmapLightenFilter.hxx |2 +- vcl/inc/BitmapScaleConvolutionFilter.hxx |2 +- vcl/inc/BitmapScaleSuperFilter.hxx|2 +- vcl/source/bitmap/BitmapAlphaClampFilter.cxx |2 +- vcl/source/bitmap/BitmapColorQuantizationFilter.cxx |2 +- vcl/source/bitmap/BitmapColorizeFilter.cxx|2 +- vcl/source/bitmap/BitmapConvolutionMatrixFilter.cxx |2 +- vcl/source/bitmap/BitmapDisabledImageFilter.cxx |2 +- vcl/source/bitmap/BitmapDuoToneFilter.cxx |2 +- vcl/source/bitmap/BitmapEmbossGreyFilter.cxx |2 +- vcl/source/bitmap/BitmapFastScaleFilter.cxx |2 +- vcl/source/bitmap/BitmapGaussianSeparableBlurFilter.cxx |4 ++-- vcl/source/bitmap/BitmapInterpolateScaleFilter.cxx|2 +- vcl/source/bitmap/BitmapLightenFilter.cxx |2 +- vcl/source/bitmap/BitmapMedianFilter.cxx |2 +- vcl/source/bitmap/BitmapMonochromeFilter.cxx |2 +- vcl/source/bitmap/BitmapMosaicFilter.cxx |8 +--- vcl/source/bitmap/BitmapPopArtFilter.cxx |2 +- vcl/source/bitmap/BitmapScaleConvolutionFilter.cxx|2 +- vcl/source/bitmap/BitmapScaleSuperFilter.cxx |2 +- vcl/source/bitmap/BitmapSeparableUnsharpenFilter.cxx |2 +- vcl/source/bitmap/BitmapSepiaFilter.cxx |2 +- vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx |2 +- vcl/source/bitmap/BitmapSmoothenFilter.cxx|2 +- vcl/source/bitmap/BitmapSobelGreyFilter.cxx |2 +- vcl/source/bitmap/BitmapSolarizeFilter.cxx|2 +- vcl/source/bitmap/bitmapfilter.cxx|4 ++-- 48 files changed, 59 insertions(+), 61 deletions(-) New commits: commit 453fde35bb838febf73bfda0bd981ee270c9b12e Author: Stephan Bergmann AuthorDate: Fri Sep 7 17:39:58 2018 +0200 Commit: Stephan Bergmann CommitDate: Fri Sep 7 20:42:59 2018 +0200 BitmapFilter::execute can be const ...after a little tweak to BitmapMosaicFilter Change-Id: I76b8ffdbf719a9d7960e7f3dafeb3adeb2300ec5 Reviewed-on: https://gerrit.libreoffice.org/60165 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/include/vcl/BitmapAlphaClampFilter.hxx b/include/vcl/BitmapAlphaClampFilter.hxx index 0fc6274b6d4e..39c039cbd02c 100644 --- a/include/vcl/BitmapAlphaClampFilter.hxx +++ b/include/vcl/BitmapAlphaClampFilter.hxx @@ -25,7 +25,7 @@ public: { } -virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; +virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: sal_uInt8 mcThreshold; diff --git a/include/vcl/BitmapColorQuantizationFilter.hxx b/include/vcl/BitmapColorQuantizationFilter.hxx index e695567a7bc0..170b0d88a471 100644 --- a/include/vcl/BitmapColorQuantizationFilter.hxx +++ b/include/vcl/BitmapColorQuantizationFilter.hxx @@ -28,7 +28,7 @@ public: { } -virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; +virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: sal_uInt16 mnNewColorCount; diff --git a/include/vcl/BitmapConvolutionMatrixFilter.hxx b/include/vcl/BitmapConvolutionMatrixFilter.hxx index cae8c3d8a91c..928eaa9f0aa2 100644 --- a/include/vcl/BitmapConvolutionMatrixFilter.hxx +++
[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
include/vcl/outdev.hxx |2 +- vcl/inc/fontselect.hxx | 18 -- vcl/source/font/fontselect.cxx | 19 --- 3 files changed, 1 insertion(+), 38 deletions(-) New commits: commit 450b89b61d3a061174194acb1c18cb859cfc0123 Author: Caolán McNamara AuthorDate: Tue Aug 21 09:35:08 2018 +0100 Commit: Caolán McNamara CommitDate: Wed Aug 22 00:24:35 2018 +0200 drop now unused FontSelectPattern Change-Id: Ie236f1dd88f21cf85130ab324787d7b9bd2ff81e Reviewed-on: https://gerrit.libreoffice.org/59389 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 54c22e6cc7fd..7f5d55d15641 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -87,7 +87,7 @@ class VirtualDevice; struct SalTwoRect; class VirtualDevice; class Printer; -class FontSelectPattern; +class FontSelectPatternAttributes; class VCLXGraphics; class OutDevStateStack; struct BitmapSystemData; diff --git a/vcl/inc/fontselect.hxx b/vcl/inc/fontselect.hxx index fd453a0d5f54..0350412366fe 100644 --- a/vcl/inc/fontselect.hxx +++ b/vcl/inc/fontselect.hxx @@ -68,24 +68,6 @@ public: ItalicMatrixmaItalicMatrix; // Force matrix for slant }; - -class FontSelectPattern : public FontSelectPatternAttributes -{ -public: -FontSelectPattern( const vcl::Font&, const OUString& rSearchName, - const Size&, float fExactHeight ); -#ifdef _WIN32 -// ifdeffed to prevent it going into unusedcode.easy -FontSelectPattern( const PhysicalFontFace&, const Size&, - float fExactHeight, int nOrientation, bool bVertical ); -#endif - -public: // TODO: change to private -rtl::Reference mpFontInstance;// pointer to the resulting FontCache entry - -voidcopyAttributes(const FontSelectPatternAttributes ); -}; - #endif // INCLUDED_VCL_INC_FONTSELECT_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/font/fontselect.cxx b/vcl/source/font/fontselect.cxx index 563c6ebcbc54..ebad5b035944 100644 --- a/vcl/source/font/fontselect.cxx +++ b/vcl/source/font/fontselect.cxx @@ -30,14 +30,6 @@ const char FontSelectPatternAttributes::FEAT_PREFIX = ':'; const char FontSelectPatternAttributes::FEAT_SEPARATOR = '&'; -FontSelectPattern::FontSelectPattern( const vcl::Font& rFont, -const OUString& rSearchName, const Size& rSize, float fExactHeight) -: FontSelectPatternAttributes(rFont, rSearchName, rSize, fExactHeight) -, mpFontInstance( nullptr ) -{ -} - - FontSelectPatternAttributes::FontSelectPatternAttributes( const vcl::Font& rFont, const OUString& rSearchName, const Size& rSize, float fExactHeight ) : maSearchName( rSearchName ) @@ -89,19 +81,8 @@ FontSelectPatternAttributes::FontSelectPatternAttributes( const PhysicalFontFace // NOTE: no normalization for width/height/orientation } -FontSelectPattern::FontSelectPattern( const PhysicalFontFace& rFontData, -const Size& rSize, float fExactHeight, int nOrientation, bool bVertical ) -: FontSelectPatternAttributes(rFontData, rSize, fExactHeight, nOrientation, bVertical) -, mpFontInstance( nullptr ) -{ -} #endif -void FontSelectPattern::copyAttributes(const FontSelectPatternAttributes ) -{ -static_cast(*this) = rAttributes; -} - size_t FontSelectPatternAttributes::hashCode() const { // TODO: does it pay off to improve this hash function? ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits