[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/jsdialog vcl/qa vcl/source vcl/unx vcl/workben

2023-11-19 Thread Stephan Bergmann (via logerrit)
 include/vcl/ITiledRenderable.hxx |2 
 vcl/inc/jsdialog/jsdialogbuilder.hxx |6 
 vcl/jsdialog/jsdialogbuilder.cxx |   39 
 vcl/qa/cppunit/GraphicFormatDetectorTest.cxx |   45 
 vcl/qa/cppunit/PDFDocumentTest.cxx   |  129 -
 vcl/qa/cppunit/PDFiumLibraryTest.cxx |2 
 vcl/qa/cppunit/TypeSerializerTest.cxx|2 
 vcl/qa/cppunit/filter/ipdf/ipdf.cxx  |4 
 vcl/qa/cppunit/graphicfilter/filters-pict-test.cxx   |8 
 vcl/qa/cppunit/pdfexport/pdfexport.cxx   |  689 +++
 vcl/qa/cppunit/pdfexport/pdfexport2.cxx  | 1376 +++
 vcl/qa/cppunit/svm/svmtest.cxx   |  328 +--
 vcl/qa/cppunit/widgetdraw/WidgetDefinitionReaderTest.cxx |   22 
 vcl/source/filter/GraphicFormatDetector.cxx  |   14 
 vcl/source/filter/graphicfilter.cxx  |2 
 vcl/source/filter/idxf/dxfentrd.cxx  |   10 
 vcl/source/filter/ieps/ieps.cxx  |2 
 vcl/source/filter/ipdf/pdfdocument.cxx   |   88 
 vcl/source/gdi/WidgetDefinition.cxx  |2 
 vcl/source/gdi/WidgetDefinitionReader.cxx|   68 
 vcl/source/gdi/gdimetafiletools.cxx  |4 
 vcl/source/gdi/gdimtf.cxx|4 
 vcl/source/gdi/mtfxmldump.cxx|  116 -
 vcl/source/gdi/pdfobjectcopier.cxx   |   12 
 vcl/source/gdi/pdfwriter_impl.cxx|   52 
 vcl/source/gdi/pdfwriter_impl2.cxx   |4 
 vcl/source/outdev/gradient.cxx   |4 
 vcl/source/outdev/transparent.cxx|4 
 vcl/source/pdf/XmpMetadata.cxx   |   81 
 vcl/source/treelist/iconview.cxx |2 
 vcl/source/treelist/imap2.cxx|4 
 vcl/source/window/DocWindow.cxx  |2 
 vcl/source/window/floatwin.cxx   |2 
 vcl/unx/generic/app/sm.cxx   |8 
 vcl/unx/generic/fontmanager/helper.cxx   |2 
 vcl/unx/generic/printer/cpdmgr.cxx   |   26 
 vcl/unx/generic/printer/printerinfomanager.cxx   |   34 
 vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx|2 
 vcl/workben/svpclient.cxx|4 
 39 files changed, 1649 insertions(+), 1556 deletions(-)

New commits:
commit 56c89190a2c717d6c24f2826f3b82ffe41b0ab6e
Author: Stephan Bergmann 
AuthorDate: Sun Nov 19 13:22:44 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Nov 19 15:23:35 2023 +0100

Extended loplugin:ostr: vcl

Change-Id: I2a9d5383d1831d8bf61e5280d66556d71fccae52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159666
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index 9b76eb11200e..be6c050ad36d 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -223,7 +223,7 @@ public:
 virtual OString getSheetGeometryData(bool /*bColumns*/, bool /*bRows*/, 
bool /*bSizes*/,
  bool /*bHidden*/, bool /*bFiltered*/, 
bool /*bGroups*/)
 {
-return "";
+return ""_ostr;
 }
 
 /**
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 030638e06e75..6e611c4f962c 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -396,7 +396,7 @@ public:
 {
 std::unique_ptr pMap
 = std::make_unique();
-(*pMap)[ACTION_TYPE] = "show";
+(*pMap)[ACTION_TYPE ""_ostr] = "show";
 sendAction(std::move(pMap));
 }
 }
@@ -409,7 +409,7 @@ public:
 {
 std::unique_ptr pMap
 = std::make_unique();
-(*pMap)[ACTION_TYPE] = "hide";
+(*pMap)[ACTION_TYPE ""_ostr] = "hide";
 sendAction(std::move(pMap));
 }
 }
@@ -448,7 +448,7 @@ public:
 {
 BaseInstanceClass::grab_focus();
 std::unique_ptr pMap = 
std::make_unique();
-(*pMap)[ACTION_TYPE] = "grab_focus";
+(*pMap)[ACTION_TYPE ""_ostr] = "grab_focus";
 sendAction(std::move(pMap));
 }
 
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index f694a5778fe7..def963b0510e 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -300,12 +300,13 @@ void JSDialogNotifyIdle::Invoke()
 break;
 
 case jsdialog::MessageType::Popup:
-send(*generatePopupMessage(rMessage.m_pWindow, 

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source

2023-10-23 Thread Chris Sherlock (via logerrit)
 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

2023-08-22 Thread Michael Weghorn (via logerrit)
 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

2023-08-02 Thread Noel Grandin (via logerrit)
 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

2023-05-11 Thread anfanite396 (via logerrit)
 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/osx vcl/source vcl/unx vcl/win

2023-04-14 Thread Caolán McNamara (via logerrit)
 include/vcl/settings.hxx |2 ++
 vcl/inc/osx/salframe.h   |1 +
 vcl/inc/salframe.hxx |1 +
 vcl/inc/unx/gtk/gtkframe.hxx |1 +
 vcl/inc/win/salframe.h   |1 +
 vcl/osx/salframe.cxx |   22 +++---
 vcl/source/app/settings.cxx  |8 
 vcl/unx/gtk3/gtkframe.cxx|   10 ++
 vcl/win/window/salframe.cxx  |5 +
 9 files changed, 44 insertions(+), 7 deletions(-)

New commits:
commit f76ec0b61e19267d9a01946dee2979f53f182a46
Author: Caolán McNamara 
AuthorDate: Fri Apr 14 10:50:59 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Apr 14 15:57:22 2023 +0200

add a way to resolve if dark mode (explicit or auto) is active

Change-Id: Ie0d4e0c3cd5d19cf6337ec79d30ae7c877cffd82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150394
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index 9292e10e45cf..05c7678869d0 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -648,6 +648,8 @@ public:
 // 0 auto, 1 light, 2, dark
 static void SetDarkMode(int nMode);
 static int  GetDarkMode();
+// return if dark mode is active, resolving 'auto' to dark (true) or light 
(false)
+static bool GetUseDarkMode();
 static void SetAppColorMode(int nMode);
 static int  GetAppColorMode();
 booloperator ==( const MiscSettings& rSet ) 
const;
diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index af8783b96147..a9c2a4039d0f 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -164,6 +164,7 @@ public:
 // done setting up the clipregion
 virtual void EndSetClipRegion() override;
 virtual void UpdateDarkMode() override;
+virtual bool GetUseDarkMode() const override;
 
 void UpdateFrameGeometry();
 
diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx
index a78f9afe08c0..8f6e2ddfbc50 100644
--- a/vcl/inc/salframe.hxx
+++ b/vcl/inc/salframe.hxx
@@ -300,6 +300,7 @@ public:
 void NotifyModalHierarchy(bool bModal) { 
m_aModalHierarchyHdl.Call(bModal); }
 
 virtual voidUpdateDarkMode() {}
+virtual boolGetUseDarkMode() const { return false; }
 
 // Call the callback set; this sometimes necessary for implementation 
classes
 // that should not know more than necessary about the SalFrame 
implementation
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index d84abd09f7d3..00bbd26379ae 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -612,6 +612,7 @@ public:
 virtual boolHidePopover(void* nId) override;
 virtual weld::Window*   GetFrameWeld() const override;
 virtual voidUpdateDarkMode() override;
+virtual boolGetUseDarkMode() const override;
 
 static GtkSalFrame *getFromWindow( GtkWidget *pWindow );
 
diff --git a/vcl/inc/win/salframe.h b/vcl/inc/win/salframe.h
index 78f61945a311..676c70c1eca0 100644
--- a/vcl/inc/win/salframe.h
+++ b/vcl/inc/win/salframe.h
@@ -140,6 +140,7 @@ public:
 virtual voidUnionClipRegion( tools::Long nX, tools::Long 
nY, tools::Long nWidth, tools::Long nHeight ) override;
 virtual voidEndSetClipRegion() override;
 virtual voidUpdateDarkMode() override;
+virtual boolGetUseDarkMode() const override;
 
 constexpr vcl::WindowState state() const { return m_eState; }
 void UpdateFrameState();
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 4c9f891881eb..6288c44b2ab1 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1279,6 +1279,20 @@ void AquaSalFrame::UpdateDarkMode()
 }
 }
 
+bool AquaSalFrame::GetUseDarkMode() const
+{
+if (!mpNSView)
+return false;
+bool bUseDarkMode(false);
+if (@available(macOS 10.14, iOS 13, *))
+{
+NSAppearanceName match = [mpNSView.effectiveAppearance 
bestMatchFromAppearancesWithNames: @[
+  NSAppearanceNameAqua, 
NSAppearanceNameDarkAqua]];
+bUseDarkMode = [match isEqualToString: NSAppearanceNameDarkAqua];
+}
+return bUseDarkMode;
+}
+
 // on OSX-Aqua the style settings are independent of the frame, so it does
 // not really belong here. Since the connection to the Appearance_Manager
 // is currently done in salnativewidgets.cxx this would be a good place.
@@ -1309,13 +1323,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
 
 StyleSettings aStyleSettings = rSettings.GetStyleSettings();
 
-bool bUseDarkMode(false);
-if (@available(macOS 10.14, iOS 13, *))
-{
-NSAppearanceName match = [mpNSView.effectiveAppearance 
bestMatchFromAppearancesWithNames: @[
-  NSAppearanceNameAqua, 

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source

2023-04-13 Thread Michael Meeks (via logerrit)
 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/jsdialog vcl/source

2023-04-06 Thread Szymon Kłos (via logerrit)
 include/vcl/jsdialog/executor.hxx |   15 +++
 include/vcl/layout.hxx|   10 +-
 include/vcl/weld.hxx  |6 ++
 vcl/inc/salvtables.hxx|6 ++
 vcl/jsdialog/executor.cxx |   26 --
 vcl/source/app/salvtables.cxx |   18 ++
 6 files changed, 66 insertions(+), 15 deletions(-)

New commits:
commit c19f041f27c9a297ec20107acc89e9b1144ec070
Author: Szymon Kłos 
AuthorDate: Fri Mar 31 17:12:51 2023 +0200
Commit: Szymon Kłos 
CommitDate: Thu Apr 6 10:53:21 2023 +0200

jsdialog: implemented mouse events for drawingarea

Change-Id: Ieab3d9fdbcee90ccd125e84f74c06cd1d6711a9f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149953
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150057
Tested-by: Jenkins

diff --git a/include/vcl/jsdialog/executor.hxx 
b/include/vcl/jsdialog/executor.hxx
index 6138f156e0de..005f9f36070d 100644
--- a/include/vcl/jsdialog/executor.hxx
+++ b/include/vcl/jsdialog/executor.hxx
@@ -66,6 +66,21 @@ public:
 rDrawingArea.dblclick(rPos);
 }
 
+static void trigger_mouse_up(weld::DrawingArea& rDrawingArea, const Point& 
rPos)
+{
+rDrawingArea.mouse_up(rPos);
+}
+
+static void trigger_mouse_down(weld::DrawingArea& rDrawingArea, const 
Point& rPos)
+{
+rDrawingArea.mouse_down(rPos);
+}
+
+static void trigger_mouse_move(weld::DrawingArea& rDrawingArea, const 
Point& rPos)
+{
+rDrawingArea.mouse_move(rPos);
+}
+
 static void trigger_selected(weld::MenuButton& rButton, const OUString& 
rIdent)
 {
 rButton.signal_selected(rIdent);
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 995b0d952ff0..507225f4d249 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -647,11 +647,6 @@ private:
 {
 m_aResizeHdl.Call(GetOutputSizePixel());
 }
-virtual void MouseMove(const MouseEvent& rMEvt) override
-{
-if (!m_aMouseMotionHdl.Call(rMEvt))
-Control::MouseMove(rMEvt);
-}
 virtual void KeyInput(const KeyEvent& rKEvt) override
 {
 if (!m_aKeyPressHdl.Call(rKEvt))
@@ -711,6 +706,11 @@ public:
 if (!m_aMouseReleaseHdl.Call(rMEvt))
 Control::MouseButtonUp(rMEvt);
 }
+virtual void MouseMove(const MouseEvent& rMEvt) override
+{
+if (!m_aMouseMotionHdl.Call(rMEvt))
+Control::MouseMove(rMEvt);
+}
 virtual OUString GetSurroundingText() const override;
 virtual Selection GetSurroundingTextSelection() const override;
 virtual bool DeleteSurroundingText(const Selection& rSelection) override;
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 5b763b4b253c..e9068f446d6d 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -2360,6 +2360,12 @@ private:
 virtual void click(const Point&) = 0;
 
 virtual void dblclick(const Point&){};
+
+virtual void mouse_up(const Point&){};
+
+virtual void mouse_down(const Point&){};
+
+virtual void mouse_move(const Point&){};
 };
 
 enum class Placement
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index bd462ad56ccd..cbb9fce51eee 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -1341,6 +1341,12 @@ public:
 virtual void click(const Point& rPos) override;
 
 virtual void dblclick(const Point& rPos) override;
+
+virtual void mouse_up(const Point& rPos) override;
+
+virtual void mouse_down(const Point& rPos) override;
+
+virtual void mouse_move(const Point& rPos) override;
 };
 
 class SalInstanceToolbar : public SalInstanceWidget, public virtual 
weld::Toolbar
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index cb8dfa4d455c..eb11af9b2884 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -192,7 +192,8 @@ bool ExecuteAction(const OUString& nWindowId, const 
OUString& rWidget, StringMap
 auto pArea = dynamic_cast(pWidget);
 if (pArea)
 {
-if (sAction == "click" || sAction == "dblclick")
+if (sAction == "click" || sAction == "dblclick" || sAction == 
"mousemove"
+|| sAction == "mousedown" || sAction == "mouseup")
 {
 OUString sClickData = rData["data"];
 int nSeparatorPos = sClickData.indexOf(';');
@@ -205,23 +206,28 @@ bool ExecuteAction(const OUString& nWindowId, const 
OUString& rWidget, StringMap
 if (nClickPosX.empty() || nClickPosY.empty())
 return true;
 
-double posX = o3tl::toDouble(nClickPosX);
-double posY = o3tl::toDouble(nClickPosY);
+double fPosX = o3tl::toDouble(nClickPosX);
+double fPosY = 

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/osx vcl/qt5 vcl/source vcl/unx vcl/win

2023-03-29 Thread Michael Weghorn (via logerrit)
 include/vcl/menu.hxx|2 
 vcl/inc/osx/salmenu.h   |2 
 vcl/inc/qt5/QtFrame.hxx |3 -
 vcl/inc/qt5/QtMenu.hxx  |6 +-
 vcl/inc/qt5/QtPainter.hxx   |   18 +--
 vcl/inc/qt5/QtTools.hxx |5 --
 vcl/inc/salmenu.hxx |   17 ++-
 vcl/inc/unx/gtk/gtksalmenu.hxx  |6 +-
 vcl/inc/win/salmenu.h   |3 -
 vcl/osx/salmenu.cxx |2 
 vcl/qt5/QtFrame.cxx |   62 ++
 vcl/qt5/QtMenu.cxx  |5 +-
 vcl/qt5/QtPainter.cxx   |   20 
 vcl/qt5/QtWidget.cxx|   28 +++-
 vcl/source/app/salvtables.cxx   |2 
 vcl/source/window/menu.cxx  |   28 ++--
 vcl/source/window/menubarwindow.cxx |   83 
 vcl/source/window/menubarwindow.hxx |1 
 vcl/unx/gtk3/gtksalmenu.cxx |7 ++-
 vcl/win/window/salmenu.cxx  |2 
 20 files changed, 126 insertions(+), 176 deletions(-)

New commits:
commit f51b220b953ec71fb742f799fbe645a93cf3d944
Author: Michael Weghorn 
AuthorDate: Fri Mar 24 08:06:56 2023 +0100
Commit: Michael Weghorn 
CommitDate: Wed Mar 29 10:46:00 2023 +

tdf#149805 tdf#151677 tdf#152217 tdf#154043 tdf#153458 tdf#153800 Revert 
"VCL expect

... correct frame size for native menubars"

This reverts

commit afc828b9833b7a612369e95606ba56d41ef2c369
Date:   Sat May 28 23:47:21 2022 +0200

VCL expect correct frame size for native menubars

... and renove the wrong framesize hack in the Qt backend

because it caused several regressions and unfortunately
the commit also doesn't fix all of the bugs mentioned
in its commit message (while some previous patch sets of the
change did address more, yet had other issues, s.a. the discussion
in the commit's Gerrit change [1]).

While e.g. the drag and drop issues reported in tdf#153458
and tdf#153800 could be fixed by translating the event position
using `mapToParent()` (as is done in
`QtWidget::fillSalAbstractMouseEvent` with the above commit
in place), I currently don't see how to address the other
issues and the overall direction of the change is not fully
clear to me at this point. (There are also other pending changes
in the relation change still pending in Gerrit that would presumably
need more work/analysis.)

After all, it seems the best way forward to revert the
commit for now.

This also reverts the follow-up commit

commit 25da92004038c03c0feedf373e8038e7ee3e0c37
Date:   Thu Jul 21 11:33:02 2022 +0200

Make JunitTest_toolkit_unoapi_1 succeed again on macOS

that fixed a test failure introduced by the above commit.

Luckily, there seem to be no follow-up commits that
depend on this and the commits can be reverted cleanly
without the need to resolve any conflicts manually.

This reverts commit 25da92004038c03c0feedf373e8038e7ee3e0c37.
This reverts commit afc828b9833b7a612369e95606ba56d41ef2c369.

[1] https://gerrit.libreoffice.org/c/core/+/135082

Change-Id: I4c099ad7de8cbbad10da391ede4770d8c748fbde
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149495
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
Reviewed-by: Michael Weghorn 

diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index bb0ef8cee6db..abad985775e4 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -179,8 +179,6 @@ protected:
 
 SAL_DLLPRIVATE void ImplFillLayoutData() const;
 SAL_DLLPRIVATE SalMenu* ImplGetSalMenu() { return mpSalMenu.get(); }
-// convenience function; just returns the SalMenu*, if HasNativeMenuBar() 
is true
-SAL_DLLPRIVATE SalMenu* GetNativeMenuBar();
 SAL_DLLPRIVATE OUString ImplGetHelpText( sal_uInt16 nItemId ) const;
 
 // returns native check and option menu symbol height in rCheckHeight and 
rRadioHeight
diff --git a/vcl/inc/osx/salmenu.h b/vcl/inc/osx/salmenu.h
index 274d1ecd70b2..597180cc1ac3 100644
--- a/vcl/inc/osx/salmenu.h
+++ b/vcl/inc/osx/salmenu.h
@@ -55,7 +55,7 @@ public:
 AquaSalMenu( bool bMenuBar );
 virtual ~AquaSalMenu() override;
 
-virtual bool HasNativeMenuBar() override;
+virtual bool VisibleMenuBar() override;
 
 virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ) 
override;
 virtual void RemoveItem( unsigned nPos ) override;
diff --git a/vcl/inc/qt5/QtFrame.hxx b/vcl/inc/qt5/QtFrame.hxx
index 40954f66d744..963572ca819b 100644
--- a/vcl/inc/qt5/QtFrame.hxx
+++ b/vcl/inc/qt5/QtFrame.hxx
@@ -131,6 +131,7 @@ class VCLPLUG_QT_PUBLIC QtFrame : public QObject, public 
SalFrame
 bool isMinimized() const;
 bool isMaximized() const;
 void SetWindowStateImpl(Qt::WindowStates eState);
+int 

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/jsdialog vcl/source

2023-03-22 Thread Szymon Kłos (via logerrit)
 include/vcl/jsdialog/executor.hxx |5 +
 include/vcl/weld.hxx  |4 +++-
 vcl/inc/salvtables.hxx|2 ++
 vcl/jsdialog/executor.cxx |7 +--
 vcl/source/app/salvtables.cxx |7 +++
 5 files changed, 22 insertions(+), 3 deletions(-)

New commits:
commit 464a3549ae228bcd70bae8ea519fc781c2cc9e45
Author: Szymon Kłos 
AuthorDate: Tue Mar 14 13:11:46 2023 +0100
Commit: Szymon Kłos 
CommitDate: Wed Mar 22 08:44:34 2023 +

jsdialog: double click for drawing area

Change-Id: I280158b101f39d107090a2eebb2c06e64591cb94
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148852
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149231
Tested-by: Jenkins

diff --git a/include/vcl/jsdialog/executor.hxx 
b/include/vcl/jsdialog/executor.hxx
index 50f71272bb61..0c47066da9fa 100644
--- a/include/vcl/jsdialog/executor.hxx
+++ b/include/vcl/jsdialog/executor.hxx
@@ -61,6 +61,11 @@ public:
 rDrawingArea.click(rPos);
 }
 
+static void trigger_dblclick(weld::DrawingArea& rDrawingArea, const Point& 
rPos)
+{
+rDrawingArea.dblclick(rPos);
+}
+
 static void trigger_value_changed(weld::SpinButton& rSpinButton)
 {
 rSpinButton.signal_value_changed();
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index d22fa5eb616e..21d6fec1acc2 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -2356,7 +2356,9 @@ public:
 private:
 friend class ::LOKTrigger;
 
-virtual void click(const Point& rPos) = 0;
+virtual void click(const Point&) = 0;
+
+virtual void dblclick(const Point&){};
 };
 
 enum class Placement
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 3c421fc89c90..c5665b28dd0c 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -1339,6 +1339,8 @@ public:
 virtual OutputDevice& get_ref_device() override;
 
 virtual void click(const Point& rPos) override;
+
+virtual void dblclick(const Point& rPos) override;
 };
 
 class SalInstanceToolbar : public SalInstanceWidget, public virtual 
weld::Toolbar
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index f52bef4b9aa7..4668193cb579 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -187,7 +187,7 @@ bool ExecuteAction(const std::string& nWindowId, const 
OString& rWidget, StringM
 auto pArea = dynamic_cast(pWidget);
 if (pArea)
 {
-if (sAction == "click")
+if (sAction == "click" || sAction == "dblclick")
 {
 OUString sClickData = rData["data"];
 int nSeparatorPos = sClickData.indexOf(';');
@@ -209,7 +209,10 @@ bool ExecuteAction(const std::string& nWindowId, const 
OString& rWidget, StringM
 Size size = rRefDevice.GetOutputSize();
 posX = posX * size.Width();
 posY = posY * size.Height();
-LOKTrigger::trigger_click(*pArea, Point(posX, posY));
+if (sAction == "click")
+LOKTrigger::trigger_click(*pArea, Point(posX, 
posY));
+else
+LOKTrigger::trigger_dblclick(*pArea, Point(posX, 
posY));
 return true;
 }
 
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 4a31b3d2cd3d..e4e76768ec55 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -6350,6 +6350,13 @@ void SalInstanceDrawingArea::click(const Point& rPos)
 m_xDrawingArea->MouseButtonUp(aEvent);
 }
 
+void SalInstanceDrawingArea::dblclick(const Point& rPos)
+{
+MouseEvent aEvent(rPos, 2, MouseEventModifiers::NONE, MOUSE_LEFT, 0);
+m_xDrawingArea->MouseButtonDown(aEvent);
+m_xDrawingArea->MouseButtonUp(aEvent);
+}
+
 IMPL_LINK(SalInstanceDrawingArea, PaintHdl, target_and_area, aPayload, void)
 {
 m_aDrawHdl.Call(aPayload);


[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx

2023-03-16 Thread Caolán McNamara (via logerrit)
 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

2023-03-14 Thread Noel Grandin (via logerrit)
 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

2023-03-03 Thread Szymon Kłos (via logerrit)
 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

2023-01-23 Thread Noel Grandin (via logerrit)
 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/unx

2023-01-11 Thread Caolán McNamara (via logerrit)
 include/vcl/sysdata.hxx  |2 --
 vcl/inc/unx/salgdi.h |2 --
 vcl/unx/generic/gdi/cairo_xlib_cairo.cxx |4 +---
 vcl/unx/generic/gdi/salgdi.cxx   |3 ---
 vcl/unx/generic/gdi/salvd.cxx|   12 +---
 5 files changed, 2 insertions(+), 21 deletions(-)

New commits:
commit 62a8b202782e38b766304b882b14ace80c0d8a8d
Author: Caolán McNamara 
AuthorDate: Tue Jan 10 16:18:44 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 11 12:12:54 2023 +

remove defunct pXRenderFormat field

Change-Id: Id48feeb0738bc89e9ba8580871db6e5fb307bfd1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145290
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/include/vcl/sysdata.hxx b/include/vcl/sysdata.hxx
index f7374a06d54e..b7bdb56228d1 100644
--- a/include/vcl/sysdata.hxx
+++ b/include/vcl/sysdata.hxx
@@ -156,7 +156,6 @@ struct SystemGraphicsData
 sal_uIntPtr hDrawable;  // a drawable
 void*   pVisual;// the visual in use
 int nScreen;// the current screen of the drawable
-void*   pXRenderFormat; // render format for drawable
 #endif
 #if USE_HEADLESS_CODE
 void*   pSurface;   // the cairo surface when using svp-based 
backends, which includes gtk[3|4]
@@ -177,7 +176,6 @@ struct SystemGraphicsData
 , hDrawable( 0 )
 , pVisual( nullptr )
 , nScreen( 0 )
-, pXRenderFormat( nullptr )
 #endif
 #if USE_HEADLESS_CODE
 , pSurface( nullptr )
diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h
index ed0a9d10ad9e..4302f849337a 100644
--- a/vcl/inc/unx/salgdi.h
+++ b/vcl/inc/unx/salgdi.h
@@ -101,7 +101,6 @@ public:
 virtual SalGraphicsImpl*GetImpl() const override;
 SalGeometryProvider*GetGeometryProvider() const;
 voidSetDrawable(Drawable d, cairo_surface_t* 
surface, SalX11Screen nXScreen);
-voidSetXRenderFormat( XRenderPictFormat* 
pXRenderFormat ) { m_pXRenderFormat = pXRenderFormat; }
 
 const SalX11Screen& GetScreenNumber() const { return 
m_nXScreen; }
 
@@ -166,7 +165,6 @@ private:
 std::unique_ptrm_pDeleteColormap;
 
 SalX11Screenm_nXScreen;
-mutable XRenderPictFormat*  m_pXRenderFormat;
 
 Region  mpClipRegion;
 Pixmap  hBrush_;// Dither
diff --git a/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx 
b/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx
index 6ff9c8bd205c..9ec8167fbfdd 100644
--- a/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx
+++ b/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx
@@ -65,8 +65,7 @@ namespace cairo
 pDisplay(pSysDat.pDisplay),
 hDrawable(pSysDat.hDrawable),
 pVisual(pSysDat.pVisual),
-nScreen(pSysDat.nScreen),
-pRenderFormat(pSysDat.pXRenderFormat)
+nScreen(pSysDat.nScreen)
 {}
 
 X11SysData::X11SysData( const SystemEnvData& pSysDat, const SalFrame* 
pReference ) :
@@ -248,7 +247,6 @@ namespace cairo
 
 aSystemGraphicsData.nSize = sizeof(SystemGraphicsData);
 aSystemGraphicsData.hDrawable = mpPixmap ? mpPixmap->mhDrawable : 
maSysData.hDrawable;
-aSystemGraphicsData.pXRenderFormat = maSysData.pRenderFormat;
 aSystemGraphicsData.pSurface = pSurface;
 
 int width = cairo_xlib_surface_get_width(pSurface);
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index 6a534ac4e236..b4347c0dfa59 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -83,7 +83,6 @@ X11SalGraphics::X11SalGraphics():
 m_pFrame(nullptr),
 m_pVDev(nullptr),
 m_nXScreen( 0 ),
-m_pXRenderFormat(nullptr),
 mpClipRegion(nullptr),
 hBrush_(None),
 bWindow_(false),
@@ -162,7 +161,6 @@ void X11SalGraphics::SetDrawable(Drawable aDrawable, 
cairo_surface_t* pSurface,
 }
 
 maX11Common.m_hDrawable = aDrawable;
-SetXRenderFormat( nullptr );
 }
 
 void X11SalGraphics::Init( X11SalFrame& rFrame, Drawable aTarget,
@@ -341,7 +339,6 @@ SystemGraphicsData X11SalGraphics::GetGraphicsData() const
 aRes.hDrawable = maX11Common.m_hDrawable;
 aRes.pVisual   = GetVisual().visual;
 aRes.nScreen   = m_nXScreen.getXScreen();
-aRes.pXRenderFormat = m_pXRenderFormat;
 return aRes;
 }
 
diff --git a/vcl/unx/generic/gdi/salvd.cxx b/vcl/unx/generic/gdi/salvd.cxx
index 047437a7f78c..ee23e9112d96 100644
--- a/vcl/unx/generic/gdi/salvd.cxx
+++ b/vcl/unx/generic/gdi/salvd.cxx
@@ -135,17 +135,7 @@ X11SalVirtualDevice::X11SalVirtualDevice(const 
SalGraphics& rGraphics, tools::Lo
 bExternPixmap_ = false;
 }
 
-XRenderPictFormat* pXRenderFormat = pData ? 
static_cast(pData->pXRenderFormat) : nullptr;
-if( pXRenderFormat )
-{
-pGraphics_->SetXRenderFormat( pXRenderFormat );
-if( 

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/jsdialog

2022-12-16 Thread Szymon Kłos (via logerrit)
 include/vcl/jsdialog/executor.hxx|   10 ++
 include/vcl/weld.hxx |2 ++
 vcl/inc/jsdialog/jsdialogbuilder.hxx |   17 +
 vcl/jsdialog/executor.cxx|3 +++
 vcl/jsdialog/jsdialogbuilder.cxx |   14 ++
 5 files changed, 46 insertions(+)

New commits:
commit cc067789ab7fd67bdd6f6ba8ce53a6580a56d7ff
Author: Szymon Kłos 
AuthorDate: Tue Dec 6 18:23:32 2022 +0100
Commit: Miklos Vajna 
CommitDate: Fri Dec 16 19:49:56 2022 +

jsdialog: enter/leave tab page handlers

(cherry picked from commit 1257c288a0ba03fc69e7bc29fcf05642eb91d150)

Change-Id: I2cbc0fc18f716bf214db61f0729d666a1d2d172c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144344
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/include/vcl/jsdialog/executor.hxx 
b/include/vcl/jsdialog/executor.hxx
index 6e388a6a3f79..9bccad3f1865 100644
--- a/include/vcl/jsdialog/executor.hxx
+++ b/include/vcl/jsdialog/executor.hxx
@@ -72,6 +72,16 @@ public:
 {
 rArea.m_aCommandHdl.Call(rCmd);
 }
+
+static void enter_page(weld::Notebook& rNotebook, const OString& rPage)
+{
+rNotebook.m_aEnterPageHdl.Call(rPage);
+}
+
+static void leave_page(weld::Notebook& rNotebook, const OString& rPage)
+{
+rNotebook.m_aLeavePageHdl.Call(rPage);
+}
 };
 
 namespace jsdialog
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 3bcbc0a7a08d..c9273bf4743b 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -463,6 +463,8 @@ public:
 
 class VCL_DLLPUBLIC Notebook : virtual public Widget
 {
+friend class ::LOKTrigger;
+
 protected:
 Link m_aLeavePageHdl;
 Link m_aEnterPageHdl;
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 291fd24babb7..564309a72626 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -534,6 +534,12 @@ public:
 
 class JSNotebook final : public JSWidget
 {
+Link m_aLeavePageOverridenHdl;
+Link m_aEnterPageOverridenHdl;
+
+DECL_LINK(LeaveHdl, const OString&, bool);
+DECL_LINK(EnterHdl, const OString&, bool);
+
 public:
 JSNotebook(JSDialogSender* pSender, ::TabControl* pControl, 
SalInstanceBuilder* pBuilder,
bool bTakeOwnership);
@@ -545,6 +551,17 @@ public:
 virtual void remove_page(const OString& rIdent) override;
 
 virtual void insert_page(const OString& rIdent, const OUString& rLabel, 
int nPos) override;
+
+void connect_leave_page(const Link& rLink)
+{
+m_aLeavePageHdl = LINK(this, JSNotebook, LeaveHdl);
+m_aLeavePageOverridenHdl = rLink;
+}
+void connect_enter_page(const Link& rLink)
+{
+m_aLeavePageHdl = LINK(this, JSNotebook, EnterHdl);
+m_aEnterPageOverridenHdl = rLink;
+}
 };
 
 class JSSpinButton final : public JSWidget
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 51dcca8f5d16..acd0e084ae76 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -91,7 +91,10 @@ bool ExecuteAction(const std::string& nWindowId, const 
OString& rWidget, StringM
 {
 sal_Int32 page = o3tl::toInt32(rData["data"]);
 
+OString aCurrentPage = pNotebook->get_current_page_ident();
+LOKTrigger::leave_page(*pNotebook, aCurrentPage);
 pNotebook->set_current_page(page);
+LOKTrigger::enter_page(*pNotebook, 
pNotebook->get_page_ident(page));
 
 return true;
 }
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index da30834b0568..51566201638d 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1315,6 +1315,20 @@ void JSComboBox::set_active(int pos)
 
 bool JSComboBox::changed_by_direct_pick() const { return true; }
 
+IMPL_LINK(JSNotebook, LeaveHdl, const OString&, rPage, bool)
+{
+m_aLeavePageOverridenHdl.Call(rPage);
+sendFullUpdate();
+return true;
+}
+
+IMPL_LINK(JSNotebook, EnterHdl, const OString&, rPage, bool)
+{
+m_aEnterPageOverridenHdl.Call(rPage);
+sendFullUpdate();
+return true;
+}
+
 JSNotebook::JSNotebook(JSDialogSender* pSender, ::TabControl* pControl,
SalInstanceBuilder* pBuilder, bool bTakeOwnership)
 : JSWidget(pSender, pControl, pBuilder, 
bTakeOwnership)


[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source

2022-12-04 Thread Khaled Hosny (via logerrit)
 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

2022-11-21 Thread Caolán McNamara (via logerrit)
 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

2022-11-10 Thread Caolán McNamara (via logerrit)
 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/Library_vcl.mk vcl/source

2022-10-26 Thread Dennis Francis (via logerrit)
 include/vcl/filter/pdfdocument.hxx |2 
 vcl/Library_vcl.mk |1 
 vcl/inc/pdf/ExternalPDFStreams.hxx |2 
 vcl/inc/pdf/pdfcompat.hxx  |   42 
 vcl/source/filter/ipdf/pdfcompat.cxx   |  114 +
 vcl/source/filter/ipdf/pdfdocument.cxx |   14 
 vcl/source/filter/ipdf/pdfread.cxx |  110 ++-
 7 files changed, 183 insertions(+), 102 deletions(-)

New commits:
commit 3f9e8ac6172f5b1dfd2869ee1c6aea4f24d3f480
Author: Dennis Francis 
AuthorDate: Tue Oct 18 16:14:37 2022 +0530
Commit: Dennis Francis 
CommitDate: Thu Oct 27 07:54:59 2022 +0200

vcl: re-exporting broken pdfs -> empty pages

Certain pdf documents when loaded in LO_IMPORT_USE_PDFIUM=1 mode even if
pdf-version < v1.6 sometimes has missing objects referred by other
objects for determing its stream length for instance.  As a result
parsing fails and results in a pdf with empty pages.  A round trip
through pdfium and exporting to v1.6 seems to cure the issue. Possibly
it does some repairing work to determine the length of the stream in a
independent pass through the file.

Conflicts:
vcl/source/filter/ipdf/pdfread.cxx

Change-Id: Id09f67eddab4163ed12a3a3f3a73baf92e2912aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141856
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/include/vcl/filter/pdfdocument.hxx 
b/include/vcl/filter/pdfdocument.hxx
index dd03029227d2..fbe0be89cdc6 100644
--- a/include/vcl/filter/pdfdocument.hxx
+++ b/include/vcl/filter/pdfdocument.hxx
@@ -576,6 +576,8 @@ public:
 //@{
 /// Read elements from the start of the stream till its end.
 bool Read(SvStream& rStream);
+/// Calls Read() first and if it fails it tries to fixup and then retry.
+bool ReadWithPossibleFixup(SvStream& rStream);
 void SetSignatureLine(std::vector&& rSignatureLine);
 void SetSignaturePage(size_t nPage);
 /// Sign the read document with xCertificate in the edit buffer.
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 4b1751005bf0..d0087d682d22 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -452,6 +452,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/filter/ipict/ipict \
 vcl/source/filter/ipsd/ipsd \
 vcl/source/filter/ipict/shape \
+vcl/source/filter/ipdf/pdfcompat \
 vcl/source/filter/ipdf/pdfread \
 vcl/source/filter/ipdf/pdfdocument \
 vcl/source/filter/iras/iras \
diff --git a/vcl/inc/pdf/ExternalPDFStreams.hxx 
b/vcl/inc/pdf/ExternalPDFStreams.hxx
index 7840217630c8..45b15f7a74bc 100644
--- a/vcl/inc/pdf/ExternalPDFStreams.hxx
+++ b/vcl/inc/pdf/ExternalPDFStreams.hxx
@@ -42,7 +42,7 @@ struct VCL_DLLPUBLIC ExternalPDFStream
 aPDFStream.WriteBytes(maDataContainer.getData(), 
maDataContainer.getSize());
 aPDFStream.Seek(0);
 auto pPDFDocument = std::make_shared();
-if (!pPDFDocument->Read(aPDFStream))
+if (!pPDFDocument->ReadWithPossibleFixup(aPDFStream))
 {
 SAL_WARN("vcl.pdfwriter",
  "PDFWriterImpl::writeReferenceXObject: reading the 
PDF document failed");
diff --git a/vcl/inc/pdf/pdfcompat.hxx b/vcl/inc/pdf/pdfcompat.hxx
new file mode 100644
index ..8f629b3bc8ee
--- /dev/null
+++ b/vcl/inc/pdf/pdfcompat.hxx
@@ -0,0 +1,42 @@
+/* -*- 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/.
+ */
+
+#pragma once
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+namespace vcl::pdf
+{
+/// Convert to inch, then assume 96 DPI.
+inline double pointToPixel(const double fPoint, const double fResolutionDPI)
+{
+return o3tl::convert(fPoint, o3tl::Length::pt, o3tl::Length::in) * 
fResolutionDPI;
+}
+
+/// Decide if PDF data is old enough to be compatible.
+bool isCompatible(SvStream& rInStream, sal_uInt64 nPos, sal_uInt64 nSize);
+
+/// Converts to highest supported format version (currently 1.6).
+/// Usually used to deal with missing referenced objects in the
+/// source pdf stream.
+bool convertToHighestSupported(SvStream& rInStream, SvStream& rOutStream);
+
+/// Takes care of transparently downgrading the version of the PDF stream in
+/// case it's too new for our PDF export.
+bool getCompatibleStream(SvStream& rInStream, SvStream& rOutStream);
+
+BinaryDataContainer createBinaryDataContainer(SvStream& rStream);
+
+} // end of vcl::filter::ipdf namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/filter/ipdf/pdfcompat.cxx 
b/vcl/source/filter/ipdf/pdfcompat.cxx
new file mode 100644
index 

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source

2022-10-03 Thread Caolán McNamara (via logerrit)
 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

2022-09-30 Thread Khaled Hosny (via logerrit)
 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

2022-09-27 Thread Caolán McNamara (via logerrit)
 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/qa vcl/source vcl/unx

2022-09-21 Thread Noel Grandin (via logerrit)
 include/vcl/filter/PDFiumLibrary.hxx   |2 -
 include/vcl/outdev.hxx |2 -
 include/vcl/pdfwriter.hxx  |2 -
 include/vcl/textview.hxx   |2 -
 vcl/inc/font/PhysicalFontCollection.hxx|2 -
 vcl/inc/fontattributes.hxx |6 +--
 vcl/inc/pdf/pdfwriter_impl.hxx |2 -
 vcl/inc/ppdparser.hxx  |2 -
 vcl/inc/sallayout.hxx  |2 -
 vcl/qa/cppunit/PDFiumLibraryTest.cxx   |2 -
 vcl/qa/cppunit/physicalfontcollection.cxx  |   52 ++---
 vcl/qa/cppunit/physicalfontfamily.cxx  |6 +--
 vcl/source/bitmap/BitmapPopArtFilter.cxx   |1 
 vcl/source/control/field.cxx   |   18 +-
 vcl/source/control/field2.cxx  |8 ++--
 vcl/source/edit/textdoc.cxx|   12 +++---
 vcl/source/edit/textdoc.hxx|4 +-
 vcl/source/edit/textview.cxx   |   10 ++---
 vcl/source/filter/FilterConfigItem.cxx |   11 +++---
 vcl/source/filter/svm/SvmConverter.cxx |4 +-
 vcl/source/filter/wmf/wmfwr.cxx|8 ++--
 vcl/source/filter/wmf/wmfwr.hxx|4 +-
 vcl/source/font/PhysicalFontCollection.cxx |   14 +++
 vcl/source/font/PhysicalFontFamily.cxx |4 +-
 vcl/source/gdi/pdfwriter.cxx   |2 -
 vcl/source/gdi/pdfwriter_impl.cxx  |6 +--
 vcl/source/gdi/sallayout.cxx   |4 +-
 vcl/source/gdi/textlayout.cxx  |4 +-
 vcl/source/outdev/font.cxx |   10 ++---
 vcl/source/pdf/PDFiumTools.cxx |   40 +++---
 vcl/source/uitest/uiobject.cxx |5 +-
 vcl/source/window/dlgctrl.cxx  |8 ++--
 vcl/source/window/dlgctrl.hxx  |2 -
 vcl/unx/generic/print/printerjob.cxx   |6 +--
 vcl/unx/generic/printer/ppdparser.cxx  |   50 +--
 vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx  |   14 +++
 36 files changed, 166 insertions(+), 165 deletions(-)

New commits:
commit 0fe36103482b6142833731e77b0d074946138538
Author: Noel Grandin 
AuthorDate: Tue Sep 20 14:50:10 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 21 10:20:02 2022 +0200

use more string_view in vcl

Change-Id: I66f96a305bb095716023ae1e565950971826bce0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140242
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/vcl/filter/PDFiumLibrary.hxx 
b/include/vcl/filter/PDFiumLibrary.hxx
index 1dc1382643d0..8140864171eb 100644
--- a/include/vcl/filter/PDFiumLibrary.hxx
+++ b/include/vcl/filter/PDFiumLibrary.hxx
@@ -233,7 +233,7 @@ struct VCL_DLLPUBLIC PDFiumLibrary final
 
 // Tools
 
-VCL_DLLPUBLIC OUString convertPdfDateToISO8601(OUString const& rInput);
+VCL_DLLPUBLIC OUString convertPdfDateToISO8601(std::u16string_view rInput);
 
 } // namespace vcl::pdf
 
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index d217b786bd15..928f49c3d614 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1137,7 +1137,7 @@ public:
 boolGetGlyphBoundRects( const Point& rOrigin, 
const OUString& rStr, int nIndex,
 int nLen, std::vector< 
tools::Rectangle >& rVector ) const;
 
-sal_Int32   HasGlyphs( const vcl::Font& rFont, const 
OUString& rStr,
+sal_Int32   HasGlyphs( const vcl::Font& rFont, 
std::u16string_view rStr,
sal_Int32 nIndex = 0, sal_Int32 
nLen = -1 ) const;
 
 tools::LongGetMinKashida() const;
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 34da05a642da..d1543df7dde2 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -1076,7 +1076,7 @@ The following structure describes the permissions used in 
PDF security
 @returns
 the new structure element's id for use in SetCurrentStructureElement
  */
- sal_Int32 BeginStructureElement( enum StructElement eType, const 
OUString& rAlias );
+ sal_Int32 BeginStructureElement( enum StructElement eType, 
std::u16string_view rAlias );
 /** end the current logical structure element
 
 Close the current structure element. The current element's
diff --git a/include/vcl/textview.hxx b/include/vcl/textview.hxx
index 9b7255db8638..903e1b4fae2a 100644
--- a/include/vcl/textview.hxx
+++ b/include/vcl/textview.hxx
@@ -105,7 +105,7 @@ class VCL_DLLPUBLIC TextView final : public 
vcl::unohelper::DragAndDropClient
 voidImpShowDDCursor();
 
 boolImplTruncateNewText( OUString& rNewText ) const;
-boolImplCheckTextLen( const OUString& rNewText ) const;
+boolImplCheckTextLen( std::u16string_view rNewText ) const;
 
 // DragAndDropClient
 virtual 

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source

2022-09-09 Thread Khaled Hosny (via logerrit)
 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

2022-09-08 Thread Khaled Hosny (via logerrit)
 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

2022-09-08 Thread Khaled Hosny (via logerrit)
 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

2022-09-07 Thread Khaled Hosny (via logerrit)
 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

2022-08-14 Thread Khaled Hosny (via logerrit)
 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

2022-08-11 Thread Mike Kaganski (via logerrit)
 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/qa vcl/source

2022-08-09 Thread offtkp (via logerrit)
 include/vcl/graphic/GraphicMetadata.hxx|   61 ++
 include/vcl/graphicfilter.hxx  |   72 +--
 vcl/inc/graphic/GraphicFormatDetector.hxx  |  112 ++-
 vcl/qa/cppunit/GraphicFormatDetectorTest.cxx   |8 
 vcl/qa/cppunit/GraphicTest.cxx |   14 -
 vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx |3 
 vcl/qa/cppunit/graphicfilter/filters-webp-test.cxx |3 
 vcl/source/filter/GraphicFormatDetector.cxx|  128 +++-
 vcl/source/filter/graphicfilter2.cxx   |  212 +
 9 files changed, 362 insertions(+), 251 deletions(-)

New commits:
commit 5e636747faf919e36bfd015c6dfcf0aea0c41938
Author: offtkp 
AuthorDate: Sat Jul 30 01:47:54 2022 +0300
Commit: Tomaž Vajngerl 
CommitDate: Wed Aug 10 07:45:01 2022 +0200

Prepare GraphicDescriptor and GraphicFormatDetector for merging

Make GraphicFormatDetector return GraphicFileFormat instead of a string
and various variable changes so that the two can be combined in future
patches.

Change-Id: I6e184b3ba52289db02e0d4eebeeadde0ce0433b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137627
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/graphic/GraphicMetadata.hxx 
b/include/vcl/graphic/GraphicMetadata.hxx
new file mode 100644
index ..da27fde01514
--- /dev/null
+++ b/include/vcl/graphic/GraphicMetadata.hxx
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+#ifndef INCLUDED_VCL_GRAPHIC_GRAPHICMETADATA_HXX
+#define INCLUDED_VCL_GRAPHIC_GRAPHICMETADATA_HXX
+// Info class for all supported file formats
+enum class GraphicFileFormat
+{
+NOT = 0x,
+BMP = 0x0001,
+GIF = 0x0002,
+JPG = 0x0003,
+PCD = 0x0004,
+PCX = 0x0005,
+PNG = 0x0006,
+TIF = 0x0007,
+XBM = 0x0008,
+XPM = 0x0009,
+PBM = 0x000a,
+PGM = 0x000b,
+PPM = 0x000c,
+RAS = 0x000d,
+TGA = 0x000e,
+PSD = 0x000f,
+EPS = 0x0010,
+WEBP = 0x0011,
+MOV = 0x00e0,
+PDF = 0x00e1,
+DXF = 0x00f1,
+MET = 0x00f2,
+PCT = 0x00f3,
+// retired SGF = 0x00f4,
+SVM = 0x00f5,
+WMF = 0x00f6,
+// retired SGV = 0x00f7,
+EMF = 0x00f8,
+SVG = 0x00f9,
+WMZ = 0x00fa,
+EMZ = 0x00fb,
+SVGZ = 0x00fc
+};
+struct GraphicMetadata
+{
+Size maPixSize{};
+Size maLogSize{};
+std::optional maPreferredLogSize = std::nullopt;
+std::optional maPreferredMapMode = std::nullopt;
+sal_uInt16 mnBitsPerPixel = 0;
+sal_uInt16 mnPlanes = 0;
+GraphicFileFormat mnFormat = GraphicFileFormat::NOT;
+sal_uInt8 mnNumberOfImageComponents = 0;
+bool mbIsTransparent = false;
+bool mbIsAlpha = false;
+};
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx
index fb237bc780a4..8985b09eab32 100644
--- a/include/vcl/graphicfilter.hxx
+++ b/include/vcl/graphicfilter.hxx
@@ -25,9 +25,9 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
-#include 
 
 namespace com::sun::star::beans { struct PropertyValue; }
 namespace com::sun::star::uno { template  class Sequence; }
@@ -124,56 +124,12 @@ inline constexpr OUStringLiteral SVG_SHORTNAME = u"SVG";
 inline constexpr OUStringLiteral PDF_SHORTNAME = u"PDF";
 inline constexpr OUStringLiteral WEBP_SHORTNAME = u"WEBP";
 
-//  Info class for all supported file formats
-
-enum class GraphicFileFormat
-{
-NOT = 0x,
-BMP = 0x0001,
-GIF = 0x0002,
-JPG = 0x0003,
-PCD = 0x0004,
-PCX = 0x0005,
-PNG = 0x0006,
-TIF = 0x0007,
-XBM = 0x0008,
-XPM = 0x0009,
-PBM = 0x000a,
-PGM = 0x000b,
-PPM = 0x000c,
-RAS = 0x000d,
-TGA = 0x000e,
-PSD = 0x000f,
-EPS = 0x0010,
-WEBP = 0x0011,
-DXF = 0x00f1,
-MET = 0x00f2,
-PCT = 0x00f3,
-// retired SGF = 0x00f4,
-SVM = 0x00f5,
-WMF = 0x00f6,
-// retired SGV = 0x00f7,
-EMF = 0x00f8,
-SVG = 0x00f9
-};
-
-
 class VCL_DLLPUBLIC GraphicDescriptor final
 {
-SvStream*   pFileStm;
-
-OUStringaPathExt;
-SizeaPixSize;
-SizeaLogSize;
-std::optional maPreferredLogSize;
-std::optional maPreferredMapMode;
-sal_uInt16  nBitsPerPixel;
-sal_uInt16  nPlanes;
-GraphicFileFormat   nFormat;
-boolbOwnStream;
-sal_uInt8 mnNumberOfImageComponents;
-boolbIsTransparent;
-boolbIsAlpha;
+SvStream*pFileStm;
+OUString   

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx

2022-08-03 Thread Caolán McNamara (via logerrit)
 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

2022-07-18 Thread Caolán McNamara (via logerrit)
 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/osx vcl/qt5 vcl/source vcl/unx vcl/win

2022-06-21 Thread Jan-Marek Glogowski (via logerrit)
 include/vcl/menu.hxx|2 
 vcl/inc/osx/salmenu.h   |2 
 vcl/inc/qt5/QtFrame.hxx |3 -
 vcl/inc/qt5/QtMenu.hxx  |6 +-
 vcl/inc/qt5/QtPainter.hxx   |   18 ++-
 vcl/inc/qt5/QtTools.hxx |5 ++
 vcl/inc/salmenu.hxx |   17 +--
 vcl/inc/unx/gtk/gtksalmenu.hxx  |6 --
 vcl/inc/win/salmenu.h   |3 -
 vcl/osx/salmenu.cxx |2 
 vcl/qt5/QtFrame.cxx |   62 --
 vcl/qt5/QtMenu.cxx  |5 --
 vcl/qt5/QtPainter.cxx   |   20 
 vcl/qt5/QtWidget.cxx|   28 
 vcl/source/app/salvtables.cxx   |2 
 vcl/source/window/menu.cxx  |   25 --
 vcl/source/window/menubarwindow.cxx |   83 +++-
 vcl/source/window/menubarwindow.hxx |1 
 vcl/unx/gtk3/gtksalmenu.cxx |7 ---
 vcl/win/window/salmenu.cxx  |2 
 20 files changed, 172 insertions(+), 127 deletions(-)

New commits:
commit afc828b9833b7a612369e95606ba56d41ef2c369
Author: Jan-Marek Glogowski 
AuthorDate: Sat May 28 23:47:21 2022 +0200
Commit: Jan-Marek Glogowski 
CommitDate: Tue Jun 21 17:26:06 2022 +0200

VCL expect correct frame size for native menubars

... and renove the wrong framesize hack in the Qt backend

This wastes a few additional pixels in the frame backing store,
actually covered by the real native menu bar, to get rid of all
the hacks and eventually fix quite a bunch of bugs in Qt (and
maybe other backends).

This seems to work correct with Qt using either QPainter or Cairo
as the painting backend. It's much simpler then my previous failed
attempts to fix the Qt related bugs. I would like to convert every
implementation to my interpretation of the API (at least I now
documented the API). It looks like Win and Mac will just work,
because Win has no native menu bar and Mac uses a global menu,
so always returns the size of 0. And Gtk also seems to work, if
it also lies about the menu bar size being zero. That just seems
consequent, if the frame size is reduced by the menubar size.

This fixes at least:
tdf#64438 - Dockable panels in LibreOffice not dockable using KDE
Works.

tdf#130893 - XWindow::SetPosSize resizing based on
  XWindow::GetPosSize shrinks the window
The document macro from tdf#130841 now doesn't resize the window.
This is just fixed for Qt.

tdf#134704 - KDE5 - unable to dock sidebar by dragging frame
not fixed, because the sidebar window is now a dialog, which is
not dockable. FWIW the same has happend the Navigator (F5), which
also renders it non-dockable. No idea, if this is intentional.

tdf#137471 - CMIS dialog advances beyond lower right corner of the
  screen
So commit 3f8d3fd4649ef09e86c735617383a4bda0425540 ("tdf#137471 Qt
return frame pos + client area size") was really not enought as a
fix (at least it didn't break anything). The whole parent-based
repositioning is wrong and it really depends on the correct frame
size, so I'm keeping this as fixed by this patch.

Change-Id: I7faeace61b456c2b0f42c7a826f58018b70d46ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135082
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index 54df7ee66631..538cc4c88b80 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -179,6 +179,8 @@ protected:
 
 SAL_DLLPRIVATE void ImplFillLayoutData() const;
 SAL_DLLPRIVATE SalMenu* ImplGetSalMenu() { return mpSalMenu.get(); }
+// convenience function; just returns the SalMenu*, if HasNativeMenuBar() 
is true
+SAL_DLLPRIVATE SalMenu* GetNativeMenuBar();
 SAL_DLLPRIVATE OUString ImplGetHelpText( sal_uInt16 nItemId ) const;
 
 // returns native check and option menu symbol height in rCheckHeight and 
rRadioHeight
diff --git a/vcl/inc/osx/salmenu.h b/vcl/inc/osx/salmenu.h
index 597180cc1ac3..274d1ecd70b2 100644
--- a/vcl/inc/osx/salmenu.h
+++ b/vcl/inc/osx/salmenu.h
@@ -55,7 +55,7 @@ public:
 AquaSalMenu( bool bMenuBar );
 virtual ~AquaSalMenu() override;
 
-virtual bool VisibleMenuBar() override;
+virtual bool HasNativeMenuBar() override;
 
 virtual void InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ) 
override;
 virtual void RemoveItem( unsigned nPos ) override;
diff --git a/vcl/inc/qt5/QtFrame.hxx b/vcl/inc/qt5/QtFrame.hxx
index 963572ca819b..40954f66d744 100644
--- a/vcl/inc/qt5/QtFrame.hxx
+++ b/vcl/inc/qt5/QtFrame.hxx
@@ -131,7 +131,6 @@ class VCLPLUG_QT_PUBLIC QtFrame : public QObject, public 
SalFrame
 bool isMinimized() const;
 bool isMaximized() const;
 void SetWindowStateImpl(Qt::WindowStates eState);
-int menuBarOffset() const;
 
 void 

[Libreoffice-commits] core.git: include/vcl vcl/inc

2022-06-17 Thread Jan-Marek Glogowski (via logerrit)
 include/vcl/WindowPosSize.hxx |5 +++--
 include/vcl/windowstate.hxx   |   29 +
 vcl/inc/salgeom.hxx   |2 +-
 3 files changed, 33 insertions(+), 3 deletions(-)

New commits:
commit e2a8b4a420ab0f726c43ec6c609d17211cd6ed11
Author: Jan-Marek Glogowski 
AuthorDate: Sun Jun 12 08:01:32 2022 +0200
Commit: Jan-Marek Glogowski 
CommitDate: Fri Jun 17 20:27:50 2022 +0200

Fix and add ostreams for vcl::WindowPosSize

... and inheriting classes.

Follow-up on commit ea5a0918c8c32309821ab239c4b95f4d6a3b5c12
("VCL add vcl::WindowPosSize abstract class").

Change-Id: I4733cd4619f91fe1ba05c208a650be591ecf5d8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135806
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/include/vcl/WindowPosSize.hxx b/include/vcl/WindowPosSize.hxx
index ed52488be33a..6c5484c47b30 100644
--- a/include/vcl/WindowPosSize.hxx
+++ b/include/vcl/WindowPosSize.hxx
@@ -124,9 +124,10 @@ public:
 void setPosSize(const Point& rPos, const Size& rSize) { setPosSize({ rPos, 
rSize }); }
 };
 
-inline std::ostream& operator<<(std::ostream& s, const WindowPosSize& rGeom)
+inline std::ostream& operator<<(std::ostream& s, const WindowPosSize& rPosSize)
 {
-s << rGeom.width() << "x" << rGeom.height() << "@(" << rGeom.x() << "," << 
rGeom.y() << ")";
+s << rPosSize.width() << "x" << rPosSize.height() << "@(" << rPosSize.x() 
<< "," << rPosSize.y()
+  << ")";
 return s;
 }
 
diff --git a/include/vcl/windowstate.hxx b/include/vcl/windowstate.hxx
index 772d5c397f76..ed3cbf1a7f6e 100644
--- a/include/vcl/windowstate.hxx
+++ b/include/vcl/windowstate.hxx
@@ -115,6 +115,35 @@ template <> struct typed_flags : 
is_typed_flags(rData.state()) << 
std::dec;
+else
+s << "?";
+return s;
+}
+
+} // namespace vcl
+
 #endif // INCLUDED_VCL_WINDOWSTATE_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/salgeom.hxx b/vcl/inc/salgeom.hxx
index 63675b6d9ceb..1b19931c5c50 100644
--- a/vcl/inc/salgeom.hxx
+++ b/vcl/inc/salgeom.hxx
@@ -98,7 +98,7 @@ public:
 
 inline std::ostream& operator<<(std::ostream& s, const SalFrameGeometry& rGeom)
 {
-s << static_cast() << ":{" << 
rGeom.leftDecoration() << ","
+s << *static_cast() << ":{" << 
rGeom.leftDecoration() << ","
   << rGeom.topDecoration() << "," << rGeom.rightDecoration() << "," << 
rGeom.bottomDecoration()
   << "}s" << rGeom.screen();
 return s;


[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx

2022-06-17 Thread Jan-Marek Glogowski (via logerrit)
 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

2022-06-03 Thread Caolán McNamara (via logerrit)
 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

2022-05-10 Thread Andrea Gelmini (via logerrit)
 include/vcl/metric.hxx|2 +-
 vcl/inc/impfontmetricdata.hxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit adb5eca79f3ae0c80c8046e73d7a411734a1b75d
Author: Andrea Gelmini 
AuthorDate: Tue May 10 19:14:50 2022 +0200
Commit: Julien Nabet 
CommitDate: Tue May 10 20:06:38 2022 +0200

Fix typos

Change-Id: I48781032778c403420b3258c53e4be5d2b7531d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134133
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/include/vcl/metric.hxx b/include/vcl/metric.hxx
index 36964eef2347..b08403da81a3 100644
--- a/include/vcl/metric.hxx
+++ b/include/vcl/metric.hxx
@@ -76,7 +76,7 @@ private:
 tools::LongmnLineHeight;  // 
Ascent+Descent+EmphasisMark
 tools::LongmnSlant;   // Slant
 tools::LongmnBulletOffset;// Offset for 
non-printing character
-tools::LongmnHangingBaseline; // Offset from 
Romn baseline to hanigng baseline.
+tools::LongmnHangingBaseline; // Offset from 
Romn baseline to hanging baseline.
 
 boolmbFullstopCentered;
 };
diff --git a/vcl/inc/impfontmetricdata.hxx b/vcl/inc/impfontmetricdata.hxx
index 0ad29f3e821e..0d6ab70e97b5 100644
--- a/vcl/inc/impfontmetricdata.hxx
+++ b/vcl/inc/impfontmetricdata.hxx
@@ -117,7 +117,7 @@ private:
 tools::LongmnExtLeading;   // External Leading
 int mnSlant;// Slant (Italic/Oblique)
 tools::LongmnMinKashida;   // Minimal width of 
kashida (Arabic)
-tools::LongmnHangingBaseline;  // Offset of haning 
baseline to Romn baseline
+tools::LongmnHangingBaseline;  // Offset of hanging 
baseline to Romn baseline
 
 // font attributes queried from the font instance
 boolmbFullstopCentered;


[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/qt5 vcl/quartz vcl/source vcl/unx vcl/win

2022-05-10 Thread Mark Hung (via logerrit)
 include/vcl/metric.hxx |3 +++
 vcl/inc/impfontmetricdata.hxx  |3 +++
 vcl/qt5/QtGraphics_Text.cxx|1 +
 vcl/quartz/ctfonts.cxx |1 +
 vcl/source/font/fontmetric.cxx |   21 +
 vcl/source/outdev/font.cxx |1 +
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |1 +
 vcl/win/gdi/salfont.cxx|1 +
 8 files changed, 32 insertions(+)

New commits:
commit 5f92e8cf3da6b5f66b6ef23219fcc91d2ad7c754
Author: Mark Hung 
AuthorDate: Sun May 1 13:50:00 2022 +0800
Commit: Mark Hung 
CommitDate: Tue May 10 15:01:25 2022 +0200

tdf#104930 Implement TextMetric::GetHangingBaseline.

The text metric value is initialized in 
ImplFontMetricData::ImplInitBaselines() using harfbuzz API 
hb_ot_layout_get_baseline. It can't handle multiple hanging baselines of the 
same font for different scripts yet because the script is fixed to 
HB_SCRIPT_UNKOWN.

Change-Id: I2574f0dba45501187064b9341c573159914a4a17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133667
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/include/vcl/metric.hxx b/include/vcl/metric.hxx
index a89e8eedfb0c..36964eef2347 100644
--- a/include/vcl/metric.hxx
+++ b/include/vcl/metric.hxx
@@ -47,6 +47,7 @@ public:
 tools::LongGetLineHeight() const   { 
return mnLineHeight; } // TODO this is ascent + descnt
 tools::LongGetSlant() const{ 
return mnSlant; }
 tools::LongGetBulletOffset() const { 
return mnBulletOffset; }
+tools::LongGetHangingBaseline() const  { 
return mnHangingBaseline; }
 
 voidSetAscent( tools::Long nAscent )   { 
mnAscent = nAscent; }
 voidSetDescent( tools::Long nDescent ) { 
mnDescent = nDescent; }
@@ -55,6 +56,7 @@ public:
 voidSetLineHeight( tools::Long nHeight )   { 
mnLineHeight = nHeight; } // TODO this is ascent + descent
 voidSetSlant( tools::Long nSlant ) { 
mnSlant = nSlant; }
 voidSetBulletOffset( tools::Long nOffset ) { 
mnBulletOffset = nOffset; }
+voidSetHangingBaseline( tools::Long nBaseline ){ 
mnHangingBaseline = nBaseline; }
 
 boolIsFullstopCentered() const  { return 
mbFullstopCentered; }
 
@@ -74,6 +76,7 @@ private:
 tools::LongmnLineHeight;  // 
Ascent+Descent+EmphasisMark
 tools::LongmnSlant;   // Slant
 tools::LongmnBulletOffset;// Offset for 
non-printing character
+tools::LongmnHangingBaseline; // Offset from 
Romn baseline to hanigng baseline.
 
 boolmbFullstopCentered;
 };
diff --git a/vcl/inc/impfontmetricdata.hxx b/vcl/inc/impfontmetricdata.hxx
index aca6da417367..0ad29f3e821e 100644
--- a/vcl/inc/impfontmetricdata.hxx
+++ b/vcl/inc/impfontmetricdata.hxx
@@ -58,6 +58,7 @@ public:
 tools::LongGetExternalLeading() const  
{ return mnExtLeading; }
 int GetSlant() const   
 { return mnSlant; }
 tools::LongGetMinKashida() const   
{ return mnMinKashida; }
+tools::LongGetHangingBaseline() const  
{ return mnHangingBaseline; }
 
 voidSetSlant(int nSlant)   
 { mnSlant=nSlant; }
 voidSetMinKashida( tools::Long nMinKashida )   
{ mnMinKashida=nMinKashida; }
@@ -99,6 +100,7 @@ public:
 voidImplInitAboveTextLineSize();
 voidImplInitFlags( const OutputDevice* pDev );
 voidImplCalcLineSpacing(LogicalFontInstance *pFontInstance);
+voidImplInitBaselines(LogicalFontInstance *pFontInstance);
 
 private:
 boolShouldUseWinMetrics(const vcl::TTGlobalFontInfo& rInfo) 
const;
@@ -115,6 +117,7 @@ private:
 tools::LongmnExtLeading;   // External Leading
 int mnSlant;// Slant (Italic/Oblique)
 tools::LongmnMinKashida;   // Minimal width of 
kashida (Arabic)
+tools::LongmnHangingBaseline;  // Offset of haning 
baseline to Romn baseline
 
 // font attributes queried from the font instance
 boolmbFullstopCentered;
diff --git a/vcl/qt5/QtGraphics_Text.cxx b/vcl/qt5/QtGraphics_Text.cxx
index 02158fca29db..9859ff02f061 100644
--- 

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx

2022-05-01 Thread Noel Grandin (via logerrit)
 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

2022-04-27 Thread Luboš Luňák (via logerrit)
 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

2022-04-19 Thread VaibhavMalik4187 (via logerrit)
 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

2022-04-14 Thread Luboš Luňák (via logerrit)
 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/qa vcl/source

2022-04-13 Thread Noel Grandin (via logerrit)
 include/vcl/IconThemeInfo.hxx|4 +-
 include/vcl/font/FeatureParser.hxx   |2 -
 include/vcl/i18nhelp.hxx |2 -
 vcl/inc/sallayout.hxx|2 -
 vcl/qa/cppunit/FontFeatureTest.cxx   |   42 +--
 vcl/qa/cppunit/app/test_IconThemeInfo.cxx|   10 +++---
 vcl/qa/cppunit/app/test_IconThemeScanner.cxx |4 +-
 vcl/source/app/IconThemeInfo.cxx |   26 
 vcl/source/app/i18nhelp.cxx  |8 ++---
 vcl/source/control/field2.cxx|   12 +++
 vcl/source/font/FeatureParser.cxx|8 ++---
 vcl/source/gdi/CommonSalLayout.cxx   |2 -
 vcl/source/image/ImplImageTree.cxx   |   23 +++---
 13 files changed, 73 insertions(+), 72 deletions(-)

New commits:
commit 239752d358a44d9bd9e5e2a9b7e6084da97d8862
Author: Noel Grandin 
AuthorDate: Wed Apr 13 14:32:50 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 13 16:55:54 2022 +0200

use more string_view in vcl

Change-Id: Iabe6c14d17c7805fcc3697cd919234abe3f0a0f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132963
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/vcl/IconThemeInfo.hxx b/include/vcl/IconThemeInfo.hxx
index ec116ca2f4fc..f061821ceaa1 100644
--- a/include/vcl/IconThemeInfo.hxx
+++ b/include/vcl/IconThemeInfo.hxx
@@ -51,7 +51,7 @@ public:
 static Size SizeByThemeName(std::u16string_view);
 
 /** Check whether an IconThemeInfo can be constructed from a URL */
-static bool UrlCanBeParsed(const OUString& url);
+static bool UrlCanBeParsed(std::u16string_view url);
 
 /** Find an icon theme by its id in a vector.
  * Throws a runtime_error if the theme is not contained in the vector
@@ -73,7 +73,7 @@ private:
  * If the name does not have an underscore in it, the whole name until the 
last dot is returned,
  * e.g. default.zip becomes default
  */
-static OUString FileNameToThemeId(const OUString&);
+static OUString FileNameToThemeId(std::u16string_view);
 
 /** Creates the display name for the given id of a file.
  * Currently, we only uppercase the id.
diff --git a/include/vcl/font/FeatureParser.hxx 
b/include/vcl/font/FeatureParser.hxx
index 3662c6a20baf..93fe6eabe261 100644
--- a/include/vcl/font/FeatureParser.hxx
+++ b/include/vcl/font/FeatureParser.hxx
@@ -32,7 +32,7 @@ private:
 std::vector m_aFeatures;
 
 public:
-FeatureParser(OUString const& sFontName);
+FeatureParser(std::u16string_view sFontName);
 
 OUString const& getLanguage() const { return m_sLanguage; }
 
diff --git a/include/vcl/i18nhelp.hxx b/include/vcl/i18nhelp.hxx
index f48d562c40a9..e5368da08547 100644
--- a/include/vcl/i18nhelp.hxx
+++ b/include/vcl/i18nhelp.hxx
@@ -63,7 +63,7 @@ public:
 sal_Int32   CompareString( const OUString& rStr1, const OUString& rStr2 ) 
const;
 
 boolMatchString( const OUString& rStr1, const OUString& rStr2 ) const;
-boolMatchMnemonic( const OUString& rString, sal_Unicode cMnemonicChar 
) const;
+boolMatchMnemonic( std::u16string_view rString, sal_Unicode 
cMnemonicChar ) const;
 
 OUStringGetNum( tools::Long nNumber, sal_uInt16 nDecimals, bool 
bUseThousandSep = true, bool bTrailingZeros = true ) const;
 
diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx
index 75110158dc53..894be0a3098b 100644
--- a/vcl/inc/sallayout.hxx
+++ b/vcl/inc/sallayout.hxx
@@ -154,7 +154,7 @@ private:
 
 boolHasVerticalAlternate(sal_UCS4 aChar, sal_UCS4 aNextChar);
 
-voidParseFeatures(const OUString& name);
+voidParseFeatures(std::u16string_view name);
 
 css::uno::Reference mxBreak;
 
diff --git a/vcl/qa/cppunit/FontFeatureTest.cxx 
b/vcl/qa/cppunit/FontFeatureTest.cxx
index 091654b8a87a..0e9ada19cdd4 100644
--- a/vcl/qa/cppunit/FontFeatureTest.cxx
+++ b/vcl/qa/cppunit/FontFeatureTest.cxx
@@ -128,11 +128,11 @@ void FontFeatureTest::testGetFontFeatures()
 void FontFeatureTest::testParseFeature()
 {
 { // No font features specified
-vcl::font::FeatureParser aParser("Font name with no features");
+vcl::font::FeatureParser aParser(u"Font name with no features");
 CPPUNIT_ASSERT_EQUAL(size_t(0), aParser.getFeatures().size());
 }
 { // One feature specified, no value
-vcl::font::FeatureParser aParser("Font name:abcd");
+vcl::font::FeatureParser aParser(u"Font name:abcd");
 CPPUNIT_ASSERT_EQUAL(size_t(1), aParser.getFeatures().size());
 auto aFeatures = aParser.getFeatures();
 
@@ -140,7 +140,7 @@ void FontFeatureTest::testParseFeature()
 CPPUNIT_ASSERT_EQUAL(uint32_t(1), aFeatures[0].m_nValue);
 }
 { // One feature specified, explicit value
-vcl::font::FeatureParser aParser("Font name:abcd=5");
+vcl::font::FeatureParser aParser(u"Font name:abcd=5");
 

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source

2022-04-09 Thread Luboš Luňák (via logerrit)
 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/jsdialog vcl/source

2022-03-04 Thread Szymon Kłos (via logerrit)
 include/vcl/toolkit/fixed.hxx|1 
 vcl/inc/jsdialog/jsdialogbuilder.hxx |8 ---
 vcl/jsdialog/enabled.cxx |3 +-
 vcl/jsdialog/jsdialogbuilder.cxx |   39 +--
 vcl/source/control/fixed.cxx |7 ++
 5 files changed, 48 insertions(+), 10 deletions(-)

New commits:
commit b350a9a3f36282be41a2fb8ea9016f4ccfd4128d
Author: Szymon Kłos 
AuthorDate: Tue Mar 1 16:19:07 2022 +0100
Commit: Szymon Kłos 
CommitDate: Fri Mar 4 12:30:38 2022 +0100

jsdialog: enable Accessibility Check dialog

- fix crash due to wrong type for label
- deduplicate widgets with the same id in one dialog/builder
- refresh on box reordering

Change-Id: I6993552342a3f139de40c3f87243bdf4e0617fc5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130797
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130951
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/include/vcl/toolkit/fixed.hxx b/include/vcl/toolkit/fixed.hxx
index afa0004f7ec8..238d1cbdfafb 100644
--- a/include/vcl/toolkit/fixed.hxx
+++ b/include/vcl/toolkit/fixed.hxx
@@ -83,6 +83,7 @@ public:
 
 virtual voidLoseFocus() override;
 virtual voidApplySettings(vcl::RenderContext&) override;
+virtual voidDumpAsPropertyTree(tools::JsonWriter& rJsonWriter) 
override;
 };
 
 class VCL_DLLPUBLIC FixedLine final : public Control
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index ca45a53c1e76..7aac0d4e25dd 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -224,7 +224,7 @@ class JSInstanceBuilder final : public SalInstanceBuilder, 
public JSDialogSender
 
 static std::map& GetLOKWeldWidgetsMap();
 static void InsertWindowToMap(const std::string& nWindowId);
-void RememberWidget(const OString& id, weld::Widget* pWidget);
+void RememberWidget(OString id, weld::Widget* pWidget);
 static void RememberWidget(const std::string& nWindowId, const OString& id,
weld::Widget* pWidget);
 static weld::Widget* FindWeldWidgetsMap(const std::string& nWindowId, 
const OString& rWidget);
@@ -459,10 +459,10 @@ public:
 bool bTakeOwnership);
 };
 
-class JSLabel final : public JSWidget
+class JSLabel final : public JSWidget
 {
 public:
-JSLabel(JSDialogSender* pSender, FixedText* pLabel, SalInstanceBuilder* 
pBuilder,
+JSLabel(JSDialogSender* pSender, Control* pLabel, SalInstanceBuilder* 
pBuilder,
 bool bTakeOwnership);
 virtual void set_label(const OUString& rText) override;
 };
@@ -705,6 +705,8 @@ class JSBox : public JSWidget
 {
 public:
 JSBox(JSDialogSender* pSender, VclBox* pBox, SalInstanceBuilder* pBuilder, 
bool bTakeOwnership);
+
+void reorder_child(weld::Widget* pWidget, int nNewPosition) override;
 };
 
 class JSWidgetInstance : public JSWidget
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index 14fc9610c356..31b18a3ae347 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -54,7 +54,8 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
 || rUIFile == u"modules/scalc/ui/textimportcsv.ui"
 || rUIFile == u"xmlsec/ui/digitalsignaturesdialog.ui"
 || rUIFile == u"xmlsec/ui/viewcertdialog.ui" || rUIFile == 
u"xmlsec/ui/certgeneral.ui"
-|| rUIFile == u"xmlsec/ui/certpage.ui")
+|| rUIFile == u"xmlsec/ui/certpage.ui" || rUIFile == 
u"svx/ui/accessibilitycheckdialog.ui"
+|| rUIFile == u"svx/ui/accessibilitycheckentry.ui")
 {
 return true;
 }
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index b6eac0bf126a..0a49f20a9b82 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -701,10 +701,31 @@ void JSInstanceBuilder::InsertWindowToMap(const 
std::string& nWindowId)
 GetLOKWeldWidgetsMap().insert(std::map::value_type(nWindowId, map));
 }
 
-void JSInstanceBuilder::RememberWidget(const OString& id, weld::Widget* 
pWidget)
+void JSInstanceBuilder::RememberWidget(OString sId, weld::Widget* pWidget)
 {
-RememberWidget(getMapIdFromWindowId(), id, pWidget);
-m_aRememberedWidgets.push_back(id.getStr());
+// do not use the same id for two widgets inside one builder
+// exception is sidebar where we base our full invalidation on that 
"Panel" id sharing
+if (m_sTypeOfJSON != "sidebar")
+{
+static std::atomic nNotRepeatIndex = 0;
+auto aWindowIt = GetLOKWeldWidgetsMap().find(getMapIdFromWindowId());
+if (aWindowIt != GetLOKWeldWidgetsMap().end())
+{
+auto aWidgetIt = aWindowIt->second.find(sId);
+if (aWidgetIt != aWindowIt->second.end())
+{
+unsigned long long int nIndex = nNotRepeatIndex++;
+ 

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source

2022-02-10 Thread Henry Castro (via logerrit)
 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

2022-02-08 Thread Henry Castro (via logerrit)
 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

2022-02-01 Thread Luboš Luňák (via logerrit)
 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

2022-01-13 Thread Caolán McNamara (via logerrit)
 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/qt5 vcl/skia vcl/source vcl/unx vcl/win

2022-01-13 Thread Caolán McNamara (via logerrit)
 include/vcl/outdev.hxx  |5 +
 vcl/inc/salgdi.hxx  |   11 +++
 vcl/inc/win/DWriteTextRenderer.hxx  |   16 ++--
 vcl/inc/win/salgdi.h|2 +-
 vcl/inc/win/winlayout.hxx   |8 +---
 vcl/qt5/QtGraphics_Text.cxx |   17 -
 vcl/skia/win/gdiimpl.cxx|8 +++-
 vcl/skia/x11/textrender.cxx |   18 --
 vcl/source/gdi/salgdilayout.cxx |3 ++-
 vcl/source/gdi/virdev.cxx   |2 ++
 vcl/source/outdev/outdev.cxx|   19 ---
 vcl/unx/generic/gdi/cairotextrender.cxx |   16 ++--
 vcl/win/gdi/DWriteTextRenderer.cxx  |   27 ---
 vcl/win/gdi/winlayout.cxx   |   25 +
 14 files changed, 138 insertions(+), 39 deletions(-)

New commits:
commit 99c51ce0e44bf03ddea0efd7612389faa636b658
Author: Caolán McNamara 
AuthorDate: Wed Dec 22 15:49:52 2021 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 13 18:32:05 2022 +0100

allow selecting text rendering mode suitable for natural glyph positions

Change-Id: I6b8c815fda3a48917467719432071c0716e3e9ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127338
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 02faeb1477fb..ddeafe9f8599 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -242,6 +242,7 @@ private:
 Point   maRefPoint;
 AntialiasingFlags   mnAntialiasing;
 LanguageTypemeTextLanguage;
+bool mbTextRenderModeForResolutionIndependentLayout;
 
 mutable boolmbMap : 1;
 mutable boolmbClipRegion : 1;
@@ -486,6 +487,10 @@ public:
 voidSetAntialiasing( AntialiasingFlags nMode );
 AntialiasingFlags   GetAntialiasing() const { return 
mnAntialiasing; }
 
+// Render glyphs with a mode suitable for rendering of 
resolution-independent layout positions.
+void
SetTextRenderModeForResolutionIndependentLayout(bool bMode);
+bool
GetTextRenderModeForResolutionIndependentLayout() const { return 
mbTextRenderModeForResolutionIndependentLayout; }
+
 voidSetDrawMode( DrawModeFlags nDrawMode );
 DrawModeFlags   GetDrawMode() const { return mnDrawMode; }
 
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index db3ed6806f7e..eed8ab7160ac 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -96,6 +96,16 @@ public:
 return m_bAntiAlias;
 }
 
+void setTextRenderModeForResolutionIndependentLayout(bool bNew)
+{
+m_bTextRenderModeForResolutionIndependentLayout = bNew;
+}
+
+bool getTextRenderModeForResolutionIndependentLayoutEnabled() const
+{
+return m_bTextRenderModeForResolutionIndependentLayout;
+}
+
 // public SalGraphics methods, the interface to the independent vcl part
 
 // get device resolution
@@ -636,6 +646,7 @@ private:
 protected:
 /// flags which hold the SetAntialiasing() value from OutputDevice
 boolm_bAntiAlias : 1;
+bool
m_bTextRenderModeForResolutionIndependentLayout : 1;
 
 inline tools::Long GetDeviceWidth(const OutputDevice& rOutDev) const;
 
diff --git a/vcl/inc/win/DWriteTextRenderer.hxx 
b/vcl/inc/win/DWriteTextRenderer.hxx
index 77d26e750e5a..b64cc48a1c6a 100644
--- a/vcl/inc/win/DWriteTextRenderer.hxx
+++ b/vcl/inc/win/DWriteTextRenderer.hxx
@@ -37,12 +37,13 @@ enum class D2DTextAntiAliasMode
 class D2DWriteTextOutRenderer : public TextOutRenderer
 {
 public:
-explicit D2DWriteTextOutRenderer();
+explicit D2DWriteTextOutRenderer(bool bRenderingModeNatural);
 virtual ~D2DWriteTextOutRenderer() override;
 
-bool operator ()(GenericSalLayout const ,
+bool operator()(GenericSalLayout const ,
 SalGraphics ,
-HDC hDC) override;
+HDC hDC,
+bool bRenderingModeNatural) override;
 
 HRESULT BindDC(HDC hDC, tools::Rectangle const & rRect = 
tools::Rectangle(0, 0, 1, 1));
 
@@ -54,11 +55,13 @@ public:
 IDWriteFontFace   * GetFontFace() const { return mpFontFace; }
 float   GetEmHeight() const { return mlfEmHeight; }
 
-HRESULT CreateRenderTarget();
+HRESULT CreateRenderTarget(bool bRenderingModeNatural);
 
 bool Ready() const;
 
-void applyTextAntiAliasMode();
+void applyTextAntiAliasMode(bool bRenderingModeNatural);
+
+bool GetRenderingModeNatural() const { return mbRenderingModeNatural; }
 
 private:
 // This is a singleton object disable copy ctor and assignment operator
@@ -66,7 +69,7 @@ private:
 D2DWriteTextOutRenderer & operator = (const D2DWriteTextOutRenderer 

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/qt5 vcl/quartz vcl/skia vcl/source vcl/unx vcl/win

2022-01-12 Thread Caolán McNamara (via logerrit)
 include/vcl/devicecoordinate.hxx |2 +
 include/vcl/vcllayout.hxx|4 +-
 vcl/inc/impglyphitem.hxx |4 +-
 vcl/inc/sallayout.hxx|4 +-
 vcl/qt5/QtGraphics_Text.cxx  |4 +-
 vcl/quartz/salgdi.cxx|4 +-
 vcl/skia/gdiimpl.cxx |4 +-
 vcl/source/gdi/CommonSalLayout.cxx   |   21 ++
 vcl/source/gdi/pdfwriter_impl.cxx|   24 
 vcl/source/gdi/sallayout.cxx |   45 +++
 vcl/source/outdev/font.cxx   |8 ++---
 vcl/source/outdev/text.cxx   |   15 +-
 vcl/source/outdev/textline.cxx   |   10 +++---
 vcl/unx/generic/gdi/cairotextrender.cxx  |6 ++--
 vcl/unx/generic/print/genpspgraphics.cxx |4 +-
 vcl/win/gdi/DWriteTextRenderer.cxx   |6 ++--
 vcl/win/gdi/winlayout.cxx|6 ++--
 17 files changed, 88 insertions(+), 83 deletions(-)

New commits:
commit be30c734bf420f9dd890906c84d2b4460385a2ba
Author: Caolán McNamara 
AuthorDate: Tue Jan 11 19:51:54 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 12 15:08:36 2022 +0100

keep positions as DeviceCoordinate within SalLayout

Change-Id: I20bbb0e252ffd09901f587599430e715dbe977b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128300
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/include/vcl/devicecoordinate.hxx b/include/vcl/devicecoordinate.hxx
index 4532b51429e0..708cb6ead0e3 100644
--- a/include/vcl/devicecoordinate.hxx
+++ b/include/vcl/devicecoordinate.hxx
@@ -15,11 +15,13 @@
 #if VCL_FLOAT_DEVICE_PIXEL
 #include 
 typedef double DeviceCoordinate;
+typedef basegfx::B2DPoint DevicePoint;
 
 #else /* !VCL_FLOAT_DEVICE_PIXEL */
 
 #include 
 typedef sal_Int32 DeviceCoordinate;
+typedef basegfx::B2IPoint DevicePoint;
 
 #endif /* ! Carpet Cushion */
 
diff --git a/include/vcl/vcllayout.hxx b/include/vcl/vcllayout.hxx
index ce82d56f274a..957d18cebd95 100644
--- a/include/vcl/vcllayout.hxx
+++ b/include/vcl/vcllayout.hxx
@@ -72,7 +72,7 @@ public:
 const Point&DrawBase() const{ return 
maDrawBase; }
 Point&  DrawOffset(){ return 
maDrawOffset; }
 const Point&DrawOffset() const  { return 
maDrawOffset; }
-Point   GetDrawPosition( const Point& rRelative = Point(0,0) ) 
const;
+DevicePoint GetDrawPosition( const DevicePoint& rRelative = 
DevicePoint(0,0) ) const;
 
 virtual boolLayoutText( vcl::text::ImplLayoutArgs&, const 
SalLayoutGlyphsImpl* ) = 0;  // first step of layouting
 virtual voidAdjustLayout( vcl::text::ImplLayoutArgs& );// 
adjusting after fallback etc.
@@ -90,7 +90,7 @@ public:
 virtual boolIsKashidaPosValid ( int /*nCharPos*/ ) const { return 
true; } // i60594
 
 // methods using glyph indexing
-virtual boolGetNextGlyph(const GlyphItem** pGlyph, Point& rPos, int& 
nStart,
+virtual boolGetNextGlyph(const GlyphItem** pGlyph, DevicePoint& rPos, 
int& nStart,
  const LogicalFontInstance** ppGlyphFont = 
nullptr,
  const vcl::font::PhysicalFontFace** 
pFallbackFont = nullptr) const = 0;
 virtual bool GetOutline(basegfx::B2DPolyPolygonVector&) const;
diff --git a/vcl/inc/impglyphitem.hxx b/vcl/inc/impglyphitem.hxx
index b33ccbd37d7c..bb981d011a8d 100644
--- a/vcl/inc/impglyphitem.hxx
+++ b/vcl/inc/impglyphitem.hxx
@@ -58,10 +58,10 @@ class VCL_DLLPUBLIC GlyphItem
 GlyphItemFlags m_nFlags;
 
 public:
-Point m_aLinearPos; // absolute position of non rotated string
+DevicePoint m_aLinearPos; // absolute position of non rotated string
 sal_Int32 m_nNewWidth; // width after adjustments
 
-GlyphItem(int nCharPos, int nCharCount, sal_GlyphId aGlyphId, const Point& 
rLinearPos,
+GlyphItem(int nCharPos, int nCharCount, sal_GlyphId aGlyphId, const 
DevicePoint& rLinearPos,
   GlyphItemFlags nFlags, int nOrigWidth, int nXOffset)
 : m_nOrigWidth(nOrigWidth)
 , m_nCharPos(nCharPos)
diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx
index ab29a2022985..acd49edfda30 100644
--- a/vcl/inc/sallayout.hxx
+++ b/vcl/inc/sallayout.hxx
@@ -64,7 +64,7 @@ public:
 sal_Int32   GetTextBreak(DeviceCoordinate nMaxWidth, DeviceCoordinate 
nCharExtra, int nFactor) const override;
 DeviceCoordinate FillDXArray(std::vector* pDXArray) 
const override;
 voidGetCaretPositions(int nArraySize, sal_Int32* pCaretXArray) 
const override;
-boolGetNextGlyph(const GlyphItem** pGlyph, Point& rPos, int& 
nStart,
+boolGetNextGlyph(const GlyphItem** pGlyph, DevicePoint& rPos, 
int& nStart,
  const LogicalFontInstance** ppGlyphFont = 
nullptr,
  const 

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx

2021-12-10 Thread Caolán McNamara (via logerrit)
 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

2021-11-19 Thread Caolán McNamara (via logerrit)
 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

2021-11-19 Thread Noel Grandin (via logerrit)
 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

2021-11-17 Thread Caolán McNamara (via logerrit)
 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

2021-10-06 Thread Chris Sherlock (via logerrit)
 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

2021-09-27 Thread Jan-Marek Glogowski (via logerrit)
 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

2021-09-22 Thread Stephan Bergmann (via logerrit)
 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/qt5 vcl/skia vcl/source vcl/unx vcl/win

2021-09-20 Thread Chris Sherlock (via logerrit)
 include/vcl/vcllayout.hxx  |2 ++
 vcl/inc/fontinstance.hxx   |2 ++
 vcl/inc/impfont.hxx|2 ++
 vcl/inc/impfontcache.hxx   |2 ++
 vcl/inc/impfontmetricdata.hxx  |2 ++
 vcl/inc/pdf/pdfbuildin_fonts.hxx   |2 ++
 vcl/inc/pdf/pdffontcache.hxx   |2 ++
 vcl/inc/pdf/pdfwriter_impl.hxx |2 ++
 vcl/inc/qt5/Qt5Font.hxx|2 ++
 vcl/inc/qt5/Qt5FontFace.hxx|2 ++
 vcl/inc/qt5/Qt5Graphics.hxx|2 ++
 vcl/inc/quartz/salgdi.h|2 ++
 vcl/inc/salgdi.hxx |2 ++
 vcl/inc/skia/win/font.hxx  |2 ++
 vcl/inc/unx/fontmanager.hxx|2 ++
 vcl/inc/unx/freetype_glyphcache.hxx|2 ++
 vcl/inc/unx/freetypetextrender.hxx |2 ++
 vcl/inc/unx/genpspgraphics.h   |2 ++
 vcl/inc/unx/glyphcache.hxx |2 ++
 vcl/inc/unx/salgdi.h   |2 ++
 vcl/inc/win/salgdi.h   |2 ++
 vcl/inc/win/winlayout.hxx  |2 ++
 vcl/qt5/Qt5Font.cxx|2 ++
 vcl/qt5/Qt5Graphics_Text.cxx   |2 ++
 vcl/skia/osx/gdiimpl.cxx   |2 ++
 vcl/skia/win/gdiimpl.cxx   |2 ++
 vcl/skia/x11/textrender.cxx|2 ++
 vcl/source/font/fontinstance.cxx   |1 +
 vcl/source/gdi/CommonSalLayout.cxx |2 ++
 vcl/source/gdi/pdfbuildin_fonts.cxx|2 ++
 vcl/source/gdi/pdfwriter_impl.cxx  |1 +
 vcl/source/gdi/salgdilayout.cxx|2 ++
 vcl/source/gdi/sallayout.cxx   |2 ++
 vcl/unx/generic/fontmanager/fontconfig.cxx |2 ++
 vcl/unx/generic/fontmanager/fontsubst.cxx  |2 ++
 vcl/unx/generic/gdi/cairotextrender.cxx|2 ++
 vcl/unx/generic/gdi/font.cxx   |2 ++
 vcl/unx/generic/gdi/freetypetextrender.cxx |2 ++
 vcl/unx/generic/glyphs/glyphcache.cxx  |2 ++
 vcl/win/gdi/winlayout.cxx  |1 +
 40 files changed, 77 insertions(+)

New commits:
commit 5c98fcffb23a9da8459e35bdd9946422fec8a320
Author: Chris Sherlock 
AuthorDate: Fri Sep 17 15:13:14 2021 +1000
Commit: Mike Kaganski 
CommitDate: Tue Sep 21 07:11:24 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.

This patch is created in preparation of a patch I have queued to test
and move PhysicalFontFace to vcl::font namespace.

Change-Id: I15dd24d7f01e077d407ac192a0413d796517eb72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/18
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/include/vcl/vcllayout.hxx b/include/vcl/vcllayout.hxx
index 7ca5d3f31c78..3b6254869f1b 100644
--- a/include/vcl/vcllayout.hxx
+++ b/include/vcl/vcllayout.hxx
@@ -19,6 +19,8 @@
 
 #pragma once
 
+#include 
+
 #include 
 #include 
 #include 
diff --git a/vcl/inc/fontinstance.hxx b/vcl/inc/fontinstance.hxx
index 20f9b626474f..e2a98f00ac77 100644
--- a/vcl/inc/fontinstance.hxx
+++ b/vcl/inc/fontinstance.hxx
@@ -19,6 +19,8 @@
 
 #pragma once
 
+#include 
+
 #include "fontselect.hxx"
 #include "impfontmetricdata.hxx"
 
diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx
index b0cebef83240..3f3b89f0e969 100644
--- a/vcl/inc/impfont.hxx
+++ b/vcl/inc/impfont.hxx
@@ -19,6 +19,8 @@
 
 #pragma once
 
+#include 
+
 #include 
 #include 
 #include 
diff --git a/vcl/inc/impfontcache.hxx b/vcl/inc/impfontcache.hxx
index ab6ae3af5c04..f3d8736add41 100644
--- a/vcl/inc/impfontcache.hxx
+++ b/vcl/inc/impfontcache.hxx
@@ -19,6 +19,8 @@
 
 #pragma once
 
+#include 
+
 #include 
 #include 
 #include 
diff --git a/vcl/inc/impfontmetricdata.hxx b/vcl/inc/impfontmetricdata.hxx
index 0c523dc2c88d..fb493e99eed3 100644
--- a/vcl/inc/impfontmetricdata.hxx
+++ b/vcl/inc/impfontmetricdata.hxx
@@ -19,6 +19,8 @@
 
 #pragma once
 
+#include 
+
 #include 
 #include 
 #include 
diff --git a/vcl/inc/pdf/pdfbuildin_fonts.hxx b/vcl/inc/pdf/pdfbuildin_fonts.hxx
index 9369c058072b..0ca4f9bdc492 100644
--- a/vcl/inc/pdf/pdfbuildin_fonts.hxx
+++ b/vcl/inc/pdf/pdfbuildin_fonts.hxx
@@ -19,6 +19,8 @@
 
 #pragma once
 
+#include 
+
 #include 
 #include 
 
diff --git a/vcl/inc/pdf/pdffontcache.hxx b/vcl/inc/pdf/pdffontcache.hxx
index b3eca45d4002..094652fefe89 100644
--- a/vcl/inc/pdf/pdffontcache.hxx
+++ b/vcl/inc/pdf/pdffontcache.hxx
@@ -19,6 +19,8 @@
 
 #pragma once
 
+#include 
+
 #include 
 
 #include 
diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx
index 3accc4d4488e..598c124f36b9 100644
--- a/vcl/inc/pdf/pdfwriter_impl.hxx
+++ b/vcl/inc/pdf/pdfwriter_impl.hxx
@@ -19,6 +19,8 @@
 
 #pragma once
 
+#include 
+
 #include 
 #include 
 #include 
diff --git a/vcl/inc/qt5/Qt5Font.hxx b/vcl/inc/qt5/Qt5Font.hxx
index 

[Libreoffice-commits] core.git: include/vcl vcl/inc

2021-09-20 Thread Chris Sherlock (via logerrit)
 include/vcl/vcllayout.hxx   |5 +
 vcl/inc/fontinstance.hxx|5 +
 vcl/inc/fontselect.hxx  |5 +
 vcl/inc/impfont.hxx |5 +
 vcl/inc/impfontcache.hxx|6 +-
 vcl/inc/impfontmetricdata.hxx   |5 +
 vcl/inc/pdf/pdfbuildin_fonts.hxx|6 ++
 vcl/inc/pdf/pdffontcache.hxx|5 +
 vcl/inc/quartz/salgdi.h |6 +-
 vcl/inc/salgdi.hxx  |5 +
 vcl/inc/skia/win/font.hxx   |5 +
 vcl/inc/unx/fontmanager.hxx |5 +
 vcl/inc/unx/freetype_glyphcache.hxx |5 +
 vcl/inc/unx/freetypetextrender.hxx  |5 +
 vcl/inc/unx/genpspgraphics.h|5 +
 vcl/inc/unx/glyphcache.hxx  |5 +
 vcl/inc/unx/salgdi.h|5 +
 vcl/inc/win/salgdi.h|5 +
 vcl/inc/win/winlayout.hxx   |5 +
 19 files changed, 20 insertions(+), 78 deletions(-)

New commits:
commit 88b72d85ef82a5a6ca019ef9b88f5389db067c83
Author: Chris Sherlock 
AuthorDate: Fri Sep 17 14:54:33 2021 +1000
Commit: Mike Kaganski 
CommitDate: Mon Sep 20 16:56:54 2021 +0200

tdf#124176 - Use pragma once instead of include guards

This patch is created in preparation of a patch I have queued to test
and move PhysicalFontFace to vcl::font namespace.

Change-Id: I805a8bd1fa881fc4bc6d2f26f1051b9247587701
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/16
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/include/vcl/vcllayout.hxx b/include/vcl/vcllayout.hxx
index 2546b5f72c09..7ca5d3f31c78 100644
--- a/include/vcl/vcllayout.hxx
+++ b/include/vcl/vcllayout.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_VCLLAYOUT_HXX
-#define INCLUDED_VCL_VCLLAYOUT_HXX
+#pragma once
 
 #include 
 #include 
@@ -117,6 +116,4 @@ protected:
 Point   maDrawBase;
 };
 
-#endif // INCLUDED_VCL_VCLLAYOUT_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/fontinstance.hxx b/vcl/inc/fontinstance.hxx
index 4918d612c5cf..20f9b626474f 100644
--- a/vcl/inc/fontinstance.hxx
+++ b/vcl/inc/fontinstance.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_INC_FONTINSTANCE_HXX
-#define INCLUDED_VCL_INC_FONTINSTANCE_HXX
+#pragma once
 
 #include "fontselect.hxx"
 #include "impfontmetricdata.hxx"
@@ -122,6 +121,4 @@ inline void LogicalFontInstance::DecodeOpenTypeTag(const 
uint32_t nTableTag, cha
 pTagName[4] = 0;
 }
 
-#endif // INCLUDED_VCL_INC_FONTINSTANCE_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/fontselect.hxx b/vcl/inc/fontselect.hxx
index c517268763d4..5a334ed75366 100644
--- a/vcl/inc/fontselect.hxx
+++ b/vcl/inc/fontselect.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_INC_FONTSELECT_HXX
-#define INCLUDED_VCL_INC_FONTSELECT_HXX
+#pragma once
 
 #include 
 #include 
@@ -79,6 +78,4 @@ inline std::basic_ostream & operator <<(
 return stream;
 }
 
-#endif // INCLUDED_VCL_INC_FONTSELECT_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx
index e21a61c49c07..b0cebef83240 100644
--- a/vcl/inc/impfont.hxx
+++ b/vcl/inc/impfont.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_INC_IMPFONT_HXX
-#define INCLUDED_VCL_INC_IMPFONT_HXX
+#pragma once
 
 #include 
 #include 
@@ -145,6 +144,4 @@ private:
 tools::Long mnCalculatedAverageFontWidth;
 };
 
-#endif // INCLUDED_VCL_INC_IMPFONT_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/impfontcache.hxx b/vcl/inc/impfontcache.hxx
index 09aa33ca906b..ab6ae3af5c04 100644
--- a/vcl/inc/impfontcache.hxx
+++ b/vcl/inc/impfontcache.hxx
@@ -17,9 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_INC_IMPFONTCACHE_HXX
-#define INCLUDED_VCL_INC_IMPFONTCACHE_HXX
-
+#pragma once
 
 #include 
 #include 
@@ -92,6 +90,4 @@ public:
 voidInvalidate();
 };
 
-#endif // INCLUDED_VCL_INC_IMPFONTCACHE_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/impfontmetricdata.hxx b/vcl/inc/impfontmetricdata.hxx
index 2a49726608d7..0c523dc2c88d 100644
--- a/vcl/inc/impfontmetricdata.hxx
+++ b/vcl/inc/impfontmetricdata.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX
-#define INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX
+#pragma once
 
 #include 
 #include 
@@ -145,6 +144,4 @@ private:
 
 };
 
-#endif // INCLUDED_VCL_INC_IMPFONTMETRICDATA_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git 

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/win

2021-09-17 Thread Chris Sherlock (via logerrit)
 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

2021-09-17 Thread Chris Sherlock (via logerrit)
 include/vcl/outdev.hxx |5 +
 vcl/inc/PhysicalFontCollection.hxx |5 +
 vcl/inc/PhysicalFontFamily.hxx |5 +
 vcl/inc/outdev.h   |5 +
 4 files changed, 4 insertions(+), 16 deletions(-)

New commits:
commit 83070c694c742ef1e86e017a5e684e72b23bf3c9
Author: Chris Sherlock 
AuthorDate: Thu Sep 16 12:46:23 2021 +1000
Commit: Mike Kaganski 
CommitDate: Sat Sep 18 05:51:17 2021 +0200

tdf#124176 - Use pragma once instead of include guards

I have a patch queued to rename ImplDeviceFontList to
PhysicalFontFaceCollection, which I am adding a test to. Submitting
patch to update the include guards to pragma once

Change-Id: I091817905599089edec113806ba3dacd6964
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/15
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 6e357b077a14..0890da948a0b 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_OUTDEV_HXX
-#define INCLUDED_VCL_OUTDEV_HXX
+#pragma once
 
 #include 
 #include 
@@ -1907,6 +1906,4 @@ protected:
 
 };
 
-#endif // INCLUDED_VCL_OUTDEV_HXX
-
 /* 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 8af07e2883cf..89d6fdf222e8 100644
--- a/vcl/inc/PhysicalFontCollection.hxx
+++ b/vcl/inc/PhysicalFontCollection.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_INC_PHYSICALFONTCOLLECTION_HXX
-#define INCLUDED_VCL_INC_PHYSICALFONTCOLLECTION_HXX
+#pragma once
 
 #include 
 
@@ -91,6 +90,4 @@ private:
 
 };
 
-#endif // INCLUDED_VCL_INC_PHYSICALFONTCOLLECTION_HXX
-
 /* 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 5c2ae12f24c8..f883d383be54 100644
--- a/vcl/inc/PhysicalFontFamily.hxx
+++ b/vcl/inc/PhysicalFontFamily.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_INC_PHYSICALFONTFAMILY_HXX
-#define INCLUDED_VCL_INC_PHYSICALFONTFAMILY_HXX
+#pragma once
 
 #include 
 #include 
@@ -96,6 +95,4 @@ private:
 FontWidth   meMatchWidth;   // MATCH - Width
 };
 
-#endif // INCLUDED_VCL_INC_PHYSICALFONTFAMILY_HXX
-
 /* 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 8746d790eb62..16871789bb22 100644
--- a/vcl/inc/outdev.h
+++ b/vcl/inc/outdev.h
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_INC_OUTDEV_H
-#define INCLUDED_VCL_INC_OUTDEV_H
+#pragma once
 
 #include 
 #include 
@@ -139,6 +138,4 @@ struct ImplOutDevData
 
 void ImplFontSubstitute( OUString& rFontName );
 
-#endif // INCLUDED_VCL_INC_OUTDEV_H
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */


[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/win

2021-09-17 Thread Chris Sherlock (via logerrit)
 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

2021-09-11 Thread Noel Grandin (via logerrit)
 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

2021-09-07 Thread Chris Sherlock (via logerrit)
 include/vcl/outdev.hxx |2 +-
 vcl/inc/pdf/pdfwriter_impl.hxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2284be4f80664c54fa2ef8652030aa14d63c13a2
Author: Chris Sherlock 
AuthorDate: Tue Sep 7 04:46:19 2021 +1000
Commit: Noel Grandin 
CommitDate: Tue Sep 7 08:54:03 2021 +0200

vcl: followup tdf#74702 vcl: remove GetOutDevType() from ImplNewFont()

virtual keyword was missing on ImplNewFont(), without it the previous
change effectively removed the PDFWriterImpl code. Thanks to Noel for
pointing this out.

Change-Id: I3148ee90e61cdb9d2d6b242ebe4964fb0394416d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121734
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 23b70e5599c7..2995769bd060 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1191,7 +1191,7 @@ protected:
 void SetFontCollectionFromSVData();
 void ResetNewFontCache();
 
-SAL_DLLPRIVATE bool ImplNewFont() const;
+virtual bool ImplNewFont() const;
 
 private:
 
diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx
index c345fbf23d42..d8dc69d07a13 100644
--- a/vcl/inc/pdf/pdfwriter_impl.hxx
+++ b/vcl/inc/pdf/pdfwriter_impl.hxx
@@ -643,7 +643,7 @@ public:
 static void convertLineInfoToExtLineInfo( const LineInfo& rIn, 
PDFWriter::ExtLineInfo& rOut );
 
 protected:
-bool ImplNewFont() const;
+bool ImplNewFont() const override;
 void ImplClearFontData(bool bNewFontLists) override;
 void ImplRefreshFontData(bool bNewFontLists) override;
 vcl::Region ClipToDeviceBounds(vcl::Region aRegion) const override;


[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/Library_vcl.mk vcl/qa vcl/source

2021-09-06 Thread Chris Sherlock (via logerrit)
 include/vcl/outdev.hxx |8 
 include/vcl/vcllayout.hxx  |6 
 vcl/Library_vcl.mk |1 
 vcl/inc/ImplLayoutArgs.hxx |   69 +++
 vcl/inc/salgdi.hxx |1 
 vcl/inc/sallayout.hxx  |   62 --
 vcl/qa/cppunit/complextext.cxx |5 
 vcl/qa/cppunit/text.cxx|  142 +++
 vcl/source/gdi/CommonSalLayout.cxx |7 
 vcl/source/gdi/sallayout.cxx   |  278 --
 vcl/source/outdev/font.cxx |5 
 vcl/source/outdev/text.cxx |9 
 vcl/source/text/ImplLayoutArgs.cxx |  339 +
 13 files changed, 585 insertions(+), 347 deletions(-)

New commits:
commit 8381242c2e0bfda1b37e7e82525926c0497c81d4
Author: Chris Sherlock 
AuthorDate: Sun Mar 7 13:59:04 2021 +1100
Commit: Noel Grandin 
CommitDate: Mon Sep 6 12:52:14 2021 +0200

vcl: move ImplLayoutArgs to own header and source files

Add unit tests for ImplLayoutArgs. Also add to the vcl::text namespace.

Change-Id: I9fa0943548be8ca17ea3dac104e9cb609337a70e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121209
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 26376fedc9e2..6bf789793af6 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -89,7 +89,6 @@ class LineInfo;
 class AlphaMask;
 class FontCharMap;
 class SalLayout;
-class ImplLayoutArgs;
 class VirtualDevice;
 struct SalTwoRect;
 class Printer;
@@ -109,6 +108,7 @@ namespace vcl
 }
 
 namespace text {
+class ImplLayoutArgs;
 class TextLayoutCache;
 }
 }
@@ -1226,18 +1226,18 @@ public:
 const tools::Long* 
pLogicDXArray=nullptr, SalLayoutFlags flags = SalLayoutFlags::NONE,
 vcl::text::TextLayoutCache const* 
= nullptr,
 const SalLayoutGlyphs* pGlyphs = 
nullptr) const;
-SAL_DLLPRIVATE ImplLayoutArgs ImplPrepareLayoutArgs( OUString&, const 
sal_Int32 nIndex, const sal_Int32 nLen,
+SAL_DLLPRIVATE vcl::text::ImplLayoutArgs ImplPrepareLayoutArgs( OUString&, 
const sal_Int32 nIndex, const sal_Int32 nLen,
  DeviceCoordinate 
nPixelWidth, const DeviceCoordinate* pPixelDXArray,
  SalLayoutFlags flags 
= SalLayoutFlags::NONE,
  
vcl::text::TextLayoutCache const* = nullptr) const;
 SAL_DLLPRIVATE std::unique_ptr
 ImplGlyphFallbackLayout( 
std::unique_ptr,
- ImplLayoutArgs&,
+ 
vcl::text::ImplLayoutArgs&,
  const 
SalLayoutGlyphs* ) const;
 SAL_DLLPRIVATE std::unique_ptr
 getFallbackLayout(
 LogicalFontInstance* pLogicalFont, int 
nFallbackLevel,
-ImplLayoutArgs& rLayoutArgs, const 
SalLayoutGlyphs* ) const;
+vcl::text::ImplLayoutArgs& rLayoutArgs, 
const SalLayoutGlyphs* ) const;
 
 
 // Enabling/disabling RTL only makes sense for OutputDevices that use a 
mirroring SalGraphicsLayout
diff --git a/include/vcl/vcllayout.hxx b/include/vcl/vcllayout.hxx
index 670e8aaad0c3..2546b5f72c09 100644
--- a/include/vcl/vcllayout.hxx
+++ b/include/vcl/vcllayout.hxx
@@ -28,7 +28,7 @@
 #include 
 
 class LogicalFontInstance;
-class ImplLayoutArgs;
+namespace vcl::text { class ImplLayoutArgs; }
 class PhysicalFontFace;
 class SalGraphics;
 class GlyphItem;
@@ -74,8 +74,8 @@ public:
 const Point&DrawOffset() const  { return 
maDrawOffset; }
 Point   GetDrawPosition( const Point& rRelative = Point(0,0) ) 
const;
 
-virtual boolLayoutText( ImplLayoutArgs&, const SalLayoutGlyphsImpl* ) 
= 0;  // first step of layouting
-virtual voidAdjustLayout( ImplLayoutArgs& );// adjusting after 
fallback etc.
+virtual boolLayoutText( vcl::text::ImplLayoutArgs&, const 
SalLayoutGlyphsImpl* ) = 0;  // first step of layouting
+virtual voidAdjustLayout( vcl::text::ImplLayoutArgs& );// 
adjusting after fallback etc.
 virtual voidInitFont() const {}
 virtual voidDrawText( SalGraphics& ) const = 0;
 
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 05f33b07115d..f9403f25b7e9 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -236,6 +236,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/outdev/vclreferencebase \
 vcl/source/outdev/nativecontrols \
 vcl/source/outdev/map \
+vcl/source/text/ImplLayoutArgs \
 

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source

2021-09-03 Thread Noel Grandin (via logerrit)
 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

2021-08-04 Thread Caolán McNamara (via logerrit)
 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

2021-07-30 Thread Noel Grandin (via logerrit)
 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/jsdialog vcl/source

2021-07-29 Thread Szymon Kłos (via logerrit)
 include/vcl/toolkit/menubtn.hxx  |3 
 vcl/inc/jsdialog/jsdialogbuilder.hxx |   35 -
 vcl/inc/salvtables.hxx   |4 -
 vcl/jsdialog/enabled.cxx |2 
 vcl/jsdialog/jsdialogbuilder.cxx |  132 ---
 vcl/source/control/menubtn.cxx   |   17 
 vcl/source/window/toolbox2.cxx   |8 +-
 7 files changed, 166 insertions(+), 35 deletions(-)

New commits:
commit cf9baa91a3c15fb798639c96f2fee6a5bd4975ff
Author: Szymon Kłos 
AuthorDate: Thu Jun 24 14:31:45 2021 +0200
Commit: Szymon Kłos 
CommitDate: Thu Jul 29 11:04:29 2021 +0200

jsdialog: toolbox popups

unify menubutton popups and toolbox dropdowns

Change-Id: I61c0c33a17d96f03d6513507bda6d5c8edbc55dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117786
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119608
Tested-by: Szymon Kłos 

diff --git a/include/vcl/toolkit/menubtn.hxx b/include/vcl/toolkit/menubtn.hxx
index 95d8a65d4769..ca77a48c9fec 100644
--- a/include/vcl/toolkit/menubtn.hxx
+++ b/include/vcl/toolkit/menubtn.hxx
@@ -82,6 +82,7 @@ public:
 PopupMenu*  GetPopupMenu() const { return mpMenu; }
 
 voidSetPopover(Window* pWindow);
+Window* GetPopover() { return mpFloatingWindow.get(); }
 
 OString const & GetCurItemIdent() const { return msCurItemIdent; }
 
@@ -91,8 +92,6 @@ public:
 virtual FactoryFunction GetUITestFactory() const override;
 
 void SetCurItemId();
-
-void DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) override;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 7c6ce7be45e1..92acff3fc594 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -9,9 +9,10 @@
 
 #pragma once
 
+#include 
+#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -29,6 +30,9 @@
 #include 
 
 #define ACTION_TYPE "action_type"
+#define PARENT_ID "parent_id"
+#define WINDOW_ID "id"
+#define CLOSE_ID "close_id"
 
 class ToolBox;
 class ComboBox;
@@ -46,7 +50,8 @@ enum MessageType
 FullUpdate,
 WidgetUpdate,
 Close,
-Action
+Action,
+Popup
 };
 }
 
@@ -102,6 +107,7 @@ class JSDialogNotifyIdle final : public Idle
 bool m_bForce;
 
 std::deque m_aMessageQueue;
+osl::Mutex m_aQueueMutex;
 
 public:
 JSDialogNotifyIdle(VclPtr aNotifierWindow, 
VclPtr aContentWindow,
@@ -121,6 +127,9 @@ private:
 std::unique_ptr generateCloseMessage() const;
 std::unique_ptr
 generateActionMessage(VclPtr pWindow, 
std::unique_ptr pData) const;
+std::unique_ptr
+generatePopupMessage(VclPtr pWindow, OUString sParentId, 
OUString sCloseId) const;
+std::unique_ptr generateClosePopupMessage(OUString 
sWindowId) const;
 };
 
 class JSDialogSender
@@ -141,6 +150,8 @@ public:
 void sendClose();
 void sendUpdate(VclPtr pWindow, bool bForce = false);
 virtual void sendAction(VclPtr pWindow, 
std::unique_ptr pData);
+virtual void sendPopup(VclPtr pWindow, OUString sParentId, 
OUString sCloseId);
+virtual void sendClosePopup(vcl::LOKWindowId nWindowId);
 void flush() { mpIdleNotify->Invoke(); }
 
 protected:
@@ -288,6 +299,10 @@ public:
 virtual void sendFullUpdate(bool bForce = false) = 0;
 
 virtual void sendAction(std::unique_ptr pData) = 0;
+
+virtual void sendPopup(vcl::Window* pPopup, OUString sParentId, OUString 
sCloseId) = 0;
+
+virtual void sendClosePopup(vcl::LOKWindowId nWindowId) = 0;
 };
 
 template 
@@ -395,6 +410,18 @@ public:
 if (!m_bIsFreezed && m_pSender && pData)
 m_pSender->sendAction(BaseInstanceClass::m_xWidget, 
std::move(pData));
 }
+
+virtual void sendPopup(vcl::Window* pPopup, OUString sParentId, OUString 
sCloseId) override
+{
+if (!m_bIsFreezed && m_pSender)
+m_pSender->sendPopup(pPopup, sParentId, sCloseId);
+}
+
+virtual void sendClosePopup(vcl::LOKWindowId nWindowId) override
+{
+if (!m_bIsFreezed && m_pSender)
+m_pSender->sendClosePopup(nWindowId);
+}
 };
 
 class JSDialog final : public JSWidget
@@ -531,9 +558,13 @@ public:
 
 class JSToolbar final : public JSWidget
 {
+std::map m_pPopovers;
+
 public:
 JSToolbar(JSDialogSender* pSender, ::ToolBox* pToolbox, 
SalInstanceBuilder* pBuilder,
   bool bTakeOwnership);
+
+virtual void set_menu_item_active(const OString& rIdent, bool bActive) 
override;
 };
 
 class JSTextView final : public JSWidget
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 3d5dc97a3a31..1cca6afd071b 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -1189,7 +1189,7 @@ public:
 
 class SalInstanceToolbar : public SalInstanceWidget, public virtual 
weld::Toolbar
 {
-private:

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/jsdialog vcl/source

2021-07-28 Thread Szymon Kłos (via logerrit)
 include/vcl/toolkit/menubtn.hxx  |1 
 vcl/inc/jsdialog/enabled.hxx |1 
 vcl/inc/jsdialog/jsdialogbuilder.hxx |   18 +-
 vcl/jsdialog/enabled.cxx |9 +
 vcl/jsdialog/executor.cxx|   20 +++
 vcl/jsdialog/jsdialogbuilder.cxx |   59 ++-
 vcl/source/control/menubtn.cxx   |   18 ++
 vcl/source/window/builder.cxx|4 +-
 8 files changed, 126 insertions(+), 4 deletions(-)

New commits:
commit 79eab8450b3a9db343a082e6d450764643340a3e
Author: Szymon Kłos 
AuthorDate: Tue Jun 15 13:10:00 2021 +0200
Commit: Szymon Kłos 
CommitDate: Wed Jul 28 14:32:30 2021 +0200

jsdialog: dump and activate popup windows

Change-Id: I4eb49a81d12ac37f50c6595eeec6d472fdbe6d82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117251
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119581
Tested-by: Szymon Kłos 

diff --git a/include/vcl/toolkit/menubtn.hxx b/include/vcl/toolkit/menubtn.hxx
index db4f9f44f5d6..95d8a65d4769 100644
--- a/include/vcl/toolkit/menubtn.hxx
+++ b/include/vcl/toolkit/menubtn.hxx
@@ -92,6 +92,7 @@ public:
 
 void SetCurItemId();
 
+void DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) override;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/jsdialog/enabled.hxx b/vcl/inc/jsdialog/enabled.hxx
index 50586cf3bb13..0f37301d0c0d 100644
--- a/vcl/inc/jsdialog/enabled.hxx
+++ b/vcl/inc/jsdialog/enabled.hxx
@@ -14,6 +14,7 @@
 namespace jsdialog
 {
 bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile);
+bool isBuilderEnabledForPopup(std::u16string_view rUIFile);
 bool isBuilderEnabledForSidebar(std::u16string_view rUIFile);
 bool isInterimBuilderEnabledForNotebookbar(std::u16string_view rUIFile);
 }
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 78534ea8c29a..7c6ce7be45e1 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -195,6 +195,8 @@ class JSInstanceBuilder final : public SalInstanceBuilder, 
public JSDialogSender
 std::string m_sTypeOfJSON;
 bool m_bHasTopLevelDialog;
 bool m_bIsNotebookbar;
+/// When LOKNotifier is set by jsdialogs code we need to release it
+VclPtr m_aWindowToRelease;
 
 friend VCL_DLLPUBLIC bool jsdialog::ExecuteAction(sal_uInt64 nWindowId, 
const OString& rWidget,
   StringMap& rData);
@@ -206,8 +208,9 @@ class JSInstanceBuilder final : public SalInstanceBuilder, 
public JSDialogSender
 void RememberWidget(const OString& id, weld::Widget* pWidget);
 static weld::Widget* FindWeldWidgetsMap(sal_uInt64 nWindowId, const 
OString& rWidget);
 
-/// used for dialogs
-JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIRoot, const 
OUString& rUIFile);
+/// used for dialogs or popups
+JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIRoot, const 
OUString& rUIFile,
+  bool bPopup = false);
 /// used for sidebar panels
 JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIRoot, const 
OUString& rUIFile,
   sal_uInt64 nLOKWindowId);
@@ -231,6 +234,8 @@ public:
 static JSInstanceBuilder* CreateSidebarBuilder(weld::Widget* pParent, 
const OUString& rUIRoot,
const OUString& rUIFile,
sal_uInt64 nLOKWindowId = 
0);
+static JSInstanceBuilder* CreatePopupBuilder(weld::Widget* pParent, const 
OUString& rUIRoot,
+ const OUString& rUIFile);
 
 virtual ~JSInstanceBuilder() override;
 virtual std::unique_ptr weld_message_dialog(const 
OString& id) override;
@@ -255,6 +260,7 @@ public:
 virtual std::unique_ptr weld_radio_button(const 
OString& id) override;
 virtual std::unique_ptr weld_frame(const OString& id) 
override;
 virtual std::unique_ptr weld_menu_button(const OString& 
id) override;
+virtual std::unique_ptr weld_popover(const OString& id) 
override;
 
 static weld::MessageDialog* CreateMessageDialog(weld::Widget* pParent,
 VclMessageType 
eMessageType,
@@ -627,6 +633,14 @@ public:
 virtual void set_label(const OUString& rText) override;
 virtual void set_image(VirtualDevice* pDevice) override;
 virtual void set_image(const css::uno::Reference& 
rImage) override;
+virtual void set_active(bool active) override;
+};
+
+class JSPopover : public JSWidget
+{
+public:
+JSPopover(JSDialogSender* pSender, DockingWindow* pPopover, 
SalInstanceBuilder* pBuilder,
+  bool bTakeOwnership);
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git 

[Libreoffice-commits] core.git: include/vcl vcl/inc

2021-05-15 Thread Caolán McNamara (via logerrit)
 include/vcl/weld.hxx   |2 +-
 vcl/inc/salvtables.hxx |6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit e3fa56977c585e5f354319ac70b15d42e9a84f74
Author: Caolán McNamara 
AuthorDate: Sat May 15 19:54:38 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sat May 15 22:33:25 2021 +0200

inherit ComboBox from Widget instead of Container

Change-Id: I7f6b6e90e08c710672335ddffaa41e385d33611f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115664
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 1101df6b46c4..e55ca8d6b534 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -675,7 +675,7 @@ enum class EntryMessageType
 class Menu;
 
 /// A widget used to choose from a list of items.
-class VCL_DLLPUBLIC ComboBox : virtual public Container
+class VCL_DLLPUBLIC ComboBox : virtual public Widget
 {
 private:
 OUString m_sSavedValue;
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index a20a862d9a45..361d26e3d9fe 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -663,7 +663,7 @@ public:
 //ComboBox and ListBox have similar apis, ComboBoxes in LibreOffice have an 
edit box and ListBoxes
 //don't. This distinction isn't there in Gtk. Use a template to sort this 
problem out.
 template 
-class SalInstanceComboBox : public SalInstanceContainer, public virtual 
weld::ComboBox
+class SalInstanceComboBox : public SalInstanceWidget, public virtual 
weld::ComboBox
 {
 protected:
 // owner for ListBox/ComboBox UserData
@@ -674,7 +674,7 @@ protected:
 
 public:
 SalInstanceComboBox(vcl_type* pComboBox, SalInstanceBuilder* pBuilder, 
bool bTakeOwnership)
-: SalInstanceContainer(pComboBox, pBuilder, bTakeOwnership)
+: SalInstanceWidget(pComboBox, pBuilder, bTakeOwnership)
 , m_xComboBox(pComboBox)
 {
 }
@@ -863,7 +863,7 @@ public:
 signal_popup_toggled();
 return;
 }
-SalInstanceContainer::HandleEventListener(rEvent);
+SalInstanceWidget::HandleEventListener(rEvent);
 }
 };
 
___
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

2021-05-15 Thread Caolán McNamara (via logerrit)
 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

2021-05-15 Thread Caolán McNamara (via logerrit)
 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

2021-05-15 Thread Caolán McNamara (via logerrit)
 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

2021-05-06 Thread Caolán McNamara (via logerrit)
 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

2021-05-05 Thread Noel Grandin (via logerrit)
 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

2021-05-04 Thread Noel Grandin (via logerrit)
 include/vcl/window.hxx |5 ++---
 vcl/inc/salframe.hxx   |4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 5c6db303f5b7692c8e0e4bed5fa42a1303b71e7c
Author: Noel Grandin 
AuthorDate: Mon May 3 20:43:54 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue May 4 08:40:36 2021 +0200

sal_uLong->sal_Int32 in PointerState

Change-Id: I5b3ea673d1b89d6584ad4e4cc5ada927791eeb29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115048
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 4675d4254b30..ce93f06598a6 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_VCL_WINDOW_HXX
 #define INCLUDED_VCL_WINDOW_HXX
 
-#include 
 #include 
 #include 
 #include 
@@ -851,8 +850,8 @@ public:
 
 struct PointerState
 {
-sal_uLong   mnState;// the button state
-Point   maPos;  // mouse position in output coordinates
+sal_Int32 mnState;// the button state
+Point maPos;  // mouse position in output coordinates
 };
 PointerStateGetPointerState();
 boolIsMouseOver() const;
diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx
index f79ae07ce9a8..20eab00d7989 100644
--- a/vcl/inc/salframe.hxx
+++ b/vcl/inc/salframe.hxx
@@ -222,8 +222,8 @@ public:
 // get current modifier, button mask and mouse position
 struct SalPointerState
 {
-sal_uLong   mnState;
-Point   maPos;  // in frame coordinates
+sal_Int32 mnState;
+Point maPos;  // in frame coordinates
 };
 
 virtual SalPointerState GetPointerState() = 0;
___
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

2021-04-30 Thread Noel Grandin (via logerrit)
 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

2021-04-29 Thread Caolán McNamara (via logerrit)
 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

2021-04-06 Thread Caolán McNamara (via logerrit)
 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

2021-03-16 Thread Caolán McNamara (via logerrit)
 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

2021-03-16 Thread Caolán McNamara (via logerrit)
 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

2021-03-07 Thread Caolán McNamara (via logerrit)
 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

2021-03-01 Thread Caolán McNamara (via logerrit)
 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

2021-02-05 Thread Caolán McNamara (via logerrit)
 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

2021-02-04 Thread Caolán McNamara (via logerrit)
 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

2021-01-21 Thread Tomaž Vajngerl (via logerrit)
 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/jsdialog

2021-01-20 Thread Szymon Kłos (via logerrit)
 include/vcl/weld.hxx |2 +-
 vcl/inc/jsdialog/jsdialogbuilder.hxx |2 --
 vcl/jsdialog/jsdialogbuilder.cxx |6 --
 3 files changed, 1 insertion(+), 9 deletions(-)

New commits:
commit b08e5a649c6bff4368e9a6629a940bc2b8f8b07b
Author: Szymon Kłos 
AuthorDate: Tue Jan 19 14:20:51 2021 +0100
Commit: Szymon Kłos 
CommitDate: Thu Jan 21 06:52:50 2021 +0100

jsdialog: remove unnecessary handler

Change-Id: I4e4d032c73fc090f443dcc7bef0267e1df123810
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109643
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index b788a1313b74..00afd2fc45b9 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -2259,7 +2259,7 @@ protected:
 
 friend class ::LOKTrigger;
 
-virtual void signal_clicked(const OString& rIdent) { 
m_aClickHdl.Call(rIdent); }
+void signal_clicked(const OString& rIdent) { m_aClickHdl.Call(rIdent); }
 void signal_toggle_menu(const OString& rIdent) { 
m_aToggleMenuHdl.Call(rIdent); }
 
 public:
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index bf35c54609cf..0c274868c716 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -409,8 +409,6 @@ class JSToolbar : public JSWidget
 public:
 JSToolbar(JSDialogSender* pSender, ::ToolBox* pToolbox, 
SalInstanceBuilder* pBuilder,
   bool bTakeOwnership);
-
-virtual void signal_clicked(const OString& rIdent) override;
 };
 
 class JSTextView : public JSWidget
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index e40e098b74e0..98eb4fbdeb3a 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -949,12 +949,6 @@ JSToolbar::JSToolbar(JSDialogSender* pSender, ::ToolBox* 
pToolbox, SalInstanceBu
 {
 }
 
-void JSToolbar::signal_clicked(const OString& rIdent)
-{
-SalInstanceToolbar::signal_clicked(rIdent);
-sendFullUpdate();
-}
-
 JSTextView::JSTextView(JSDialogSender* pSender, ::VclMultiLineEdit* pTextView,
SalInstanceBuilder* pBuilder, bool bTakeOwnership)
 : JSWidget(pSender, pTextView, 
pBuilder,
___
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

2021-01-16 Thread Caolán McNamara (via logerrit)
 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/jsdialog vcl/source

2021-01-12 Thread Szymon Kłos (via logerrit)
 include/vcl/window.hxx   |3 --
 vcl/inc/jsdialog/jsdialogbuilder.hxx |   11 ---
 vcl/inc/window.h |2 -
 vcl/jsdialog/jsdialogbuilder.cxx |   52 +++
 vcl/source/window/window.cxx |   14 -
 5 files changed, 6 insertions(+), 76 deletions(-)

New commits:
commit 8cbf3938ee3951ef53842bb5664bea6b57828111
Author: Szymon Kłos 
AuthorDate: Wed Dec 30 10:05:26 2020 +0100
Commit: Szymon Kłos 
CommitDate: Wed Jan 13 08:47:15 2021 +0100

Revert "jsdialog: disable idle notify"

This reverts commit 71ec214d7583f637fefcb5eca13c637cc6b38029.
and partially 54b5e6b4e083ce7a71e16ef622753898f38dc8ab

freeze/thaw functionality was added so no longer needed.

Change-Id: Iee29fa79bcebfd409fd3cea4f11cb1d48053daa6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108509
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index bf4a8790ae25..1a164c0654ed 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -1178,9 +1178,6 @@ public:
 /// Find an existing Window based on the LOKWindowId.
 static VclPtr  FindLOKWindow(vcl::LOKWindowId 
nWindowId);
 
-boolIsDisableIdleNotify();
-voidSetDisableIdleNotify(bool bValue);
-
 /// check if LOK Window container is empty
 static bool IsLOKWindowsEmpty();
 
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index c31c3e5fa560..2df2aaeb3ad1 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -73,7 +73,6 @@ public:
 
 virtual void notifyDialogState(bool bForce = false);
 void sendClose();
-void dumpStatus();
 virtual void sendUpdate(VclPtr pWindow);
 };
 
@@ -250,11 +249,6 @@ public:
 
 class JSDialog : public JSWidget
 {
-DECL_LINK(on_dump_status, void*, void);
-DECL_LINK(on_window_event, VclWindowEvent&, void);
-
-bool m_bNotifyCreated;
-
 public:
 JSDialog(VclPtr aNotifierWindow, VclPtr 
aContentWindow,
  ::Dialog* pDialog, SalInstanceBuilder* pBuilder, bool 
bTakeOwnership,
@@ -343,11 +337,6 @@ public:
 
 class JSMessageDialog : public SalInstanceMessageDialog, public JSDialogSender
 {
-DECL_LINK(on_dump_status, void*, void);
-DECL_LINK(on_window_event, VclWindowEvent&, void);
-
-bool m_bNotifyCreated;
-
 public:
 JSMessageDialog(::MessageDialog* pDialog, VclPtr 
aContentWindow,
 SalInstanceBuilder* pBuilder, bool bTakeOwnership);
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index a6d46c41eeda..a14852ca02c0 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -117,8 +117,6 @@ struct ImplWinData
 sal_uInt16  mnIsTopWindow;
 boolmbMouseOver;//< tracks mouse over for 
native widget paint effect
 boolmbEnableNativeWidget;   //< toggle native widget 
rendering
-boolmbDisableIdleNotify;
-
 ::std::list< VclPtr >
 maTopWindowChildren;
 
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index f33d0be85fd5..df2d68e71c16 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -159,8 +159,7 @@ void JSDialogNotifyIdle::sendClose() { 
send(*generateCloseMessage()); }
 
 void JSDialogSender::notifyDialogState(bool bForce)
 {
-auto aNotifierWnd = mpIdleNotify->getNotifierWindow();
-if (aNotifierWnd && aNotifierWnd->IsDisableIdleNotify())
+if (!mpIdleNotify->getNotifierWindow())
 return;
 
 if (bForce)
@@ -170,8 +169,6 @@ void JSDialogSender::notifyDialogState(bool bForce)
 
 void JSDialogSender::sendClose() { mpIdleNotify->sendClose(); }
 
-void JSDialogSender::dumpStatus() { mpIdleNotify->Invoke(); }
-
 void JSDialogSender::sendUpdate(VclPtr pWindow)
 {
 mpIdleNotify->updateStatus(pWindow);
@@ -461,16 +458,13 @@ std::unique_ptr 
JSInstanceBuilder::weld_dialog(const OString& id)
 m_xBuilder->drop_ownership(pDialog);
 m_bHasTopLevelDialog = true;
 
-if (id == "MacroSelectorDialog")
-pDialog->SetDisableIdleNotify(true);
-
 pRet.reset(
 new JSDialog(m_aOwnedToplevel, m_aOwnedToplevel, pDialog, this, 
false, m_sTypeOfJSON));
 
 RememberWidget("__DIALOG__", pRet.get());
 
 const vcl::ILibreOfficeKitNotifier* pNotifier = 
pDialog->GetLOKNotifier();
-if (pNotifier && id != "MacroSelectorDialog")
+if (pNotifier)
 {
 tools::JsonWriter aJsonWriter;
 m_aOwnedToplevel->DumpAsPropertyTree(aJsonWriter);
@@ -497,14 +491,14 @@ std::unique_ptr 
JSInstanceBuilder::weld_message_dialog(cons
 assert(!m_aOwnedToplevel && "only one toplevel per .ui allowed");
 

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/jsdialog vcl/source

2020-12-22 Thread Henry Castro (via logerrit)
 include/vcl/window.hxx   |3 +++
 vcl/inc/jsdialog/jsdialogbuilder.hxx |1 +
 vcl/inc/window.h |2 ++
 vcl/jsdialog/jsdialogbuilder.cxx |6 ++
 vcl/source/window/window.cxx |   14 +-
 5 files changed, 25 insertions(+), 1 deletion(-)

New commits:
commit 71ec214d7583f637fefcb5eca13c637cc6b38029
Author: Henry Castro 
AuthorDate: Thu Dec 17 10:45:13 2020 -0400
Commit: Henry Castro 
CommitDate: Tue Dec 22 13:03:59 2020 +0100

jsdialog: disable idle notify

After testing on client side, when showing
the Macro Selector Dialog its receive 5 times
the same data.

So add an option to not use the idle notifier
instead it will use the event 'WindowShow'.

Change-Id: Ib5657f3c823fc6e998581b99052aaf578d0913e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107893
Tested-by: Jenkins
Reviewed-by: Henry Castro 

diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index d4e96f93a45e..99a1043bb3d3 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -1176,6 +1176,9 @@ public:
 /// Find an existing Window based on the LOKWindowId.
 static VclPtr  FindLOKWindow(vcl::LOKWindowId 
nWindowId);
 
+boolIsDisableIdleNotify();
+voidSetDisableIdleNotify(bool bValue);
+
 /// check if LOK Window container is empty
 static bool IsLOKWindowsEmpty();
 
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index d3c6e7b26d48..14090f43a0e4 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -49,6 +49,7 @@ public:
 void Invoke() override;
 void ForceUpdate();
 void sendClose();
+VclPtr getNotifierWindow() { return m_aNotifierWindow; }
 
 private:
 void send(std::unique_ptr aJsonWriter);
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index a14852ca02c0..a6d46c41eeda 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -117,6 +117,8 @@ struct ImplWinData
 sal_uInt16  mnIsTopWindow;
 boolmbMouseOver;//< tracks mouse over for 
native widget paint effect
 boolmbEnableNativeWidget;   //< toggle native widget 
rendering
+boolmbDisableIdleNotify;
+
 ::std::list< VclPtr >
 maTopWindowChildren;
 
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 795acc644274..11a84bc8bc64 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -107,6 +107,9 @@ void JSDialogNotifyIdle::sendClose() { 
send(generateCloseMessage()); }
 
 void JSDialogSender::notifyDialogState(bool bForce)
 {
+if (mpIdleNotify->getNotifierWindow()->IsDisableIdleNotify())
+return;
+
 if (bForce)
 mpIdleNotify->ForceUpdate();
 mpIdleNotify->Start();
@@ -404,6 +407,9 @@ std::unique_ptr 
JSInstanceBuilder::weld_dialog(const OString& id)
 
 RememberWidget("__DIALOG__", pRet.get());
 
+if (id == "MacroSelectorDialog")
+pDialog->SetDisableIdleNotify(true);
+
 const vcl::ILibreOfficeKitNotifier* pNotifier = 
pDialog->GetLOKNotifier();
 if (pNotifier && id != "MacroSelectorDialog")
 {
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 7bbc9924709d..719a5268c2f2 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -755,7 +755,8 @@ ImplWinData::ImplWinData() :
 mnTrackFlags(ShowTrackFlags::NONE),
 mnIsTopWindow(sal_uInt16(~0)), // not initialized yet, 0/1 will indicate 
TopWindow (see IsTopWindow())
 mbMouseOver(false),
-mbEnableNativeWidget(false)
+mbEnableNativeWidget(false),
+mbDisableIdleNotify(false)
 {
 }
 
@@ -3201,6 +3202,17 @@ VclPtr Window::FindLOKWindow(vcl::LOKWindowId 
nWindowId)
 return VclPtr();
 }
 
+bool Window::IsDisableIdleNotify()
+{
+return ImplGetWinData()->mbDisableIdleNotify;
+}
+
+void Window::SetDisableIdleNotify(bool bValue)
+{
+if (ImplGetWinData()->mbDisableIdleNotify != bValue)
+ImplGetWinData()->mbDisableIdleNotify = bValue;
+}
+
 bool Window::IsLOKWindowsEmpty()
 {
 return GetLOKWindowsMap().empty();
___
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

2020-12-17 Thread Caolán McNamara (via logerrit)
 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/README.scheduler vcl/source

2020-12-08 Thread Stephan Bergmann (via logerrit)
 include/vcl/task.hxx |2 +-
 vcl/README.scheduler |   14 --
 vcl/inc/schedulerimpl.hxx|   17 -
 vcl/inc/svdata.hxx   |4 +++-
 vcl/source/app/scheduler.cxx |   22 ++
 5 files changed, 10 insertions(+), 49 deletions(-)

New commits:
commit 69a9b48d50d98130a65aa6c823dc6cc464fefd71
Author: Stephan Bergmann 
AuthorDate: Tue Dec 8 16:04:48 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Dec 8 20:42:39 2020 +0100

Replace SchedulerMutex with (non-recursive) std::mutex

...following up on the TODO from 84af20ef3ea72190784e9e7be820684c2558ba8c 
"Make
SchedulerMutex non-recursive"

Change-Id: I3be98f2dba7c7486b79ec1f166431333cc69451a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107423
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/include/vcl/task.hxx b/include/vcl/task.hxx
index 35efe4825bbc..d8adae7eff0b 100644
--- a/include/vcl/task.hxx
+++ b/include/vcl/task.hxx
@@ -91,7 +91,7 @@ public:
 
 /**
  * This function must be called for static tasks, so the Task destructor
- * ignores the SchedulerMutex, as it may not be available anymore.
+ * ignores the scheduler mutex, as it may not be available anymore.
  * The cleanup is still correct, as it has already happened in
  * DeInitScheduler call well before the static destructor calls.
  */
diff --git a/vcl/README.scheduler b/vcl/README.scheduler
index 466485f16645..e08f59e37cdf 100644
--- a/vcl/README.scheduler
+++ b/vcl/README.scheduler
@@ -60,7 +60,7 @@ Start new Tasks.
 
 The Scheduler just processes it's own Tasks in the main thread and needs
 the SolarMutex for it and for DeInit (tested by DBG_TESTSOLARMUTEX). All
-the other interaction just take the SchedulerMutex or don't need locking
+the other interaction just take the scheduler mutex or don't need locking
 at all.
 
 There is a "workaround" for static Task objecs, which would crash LO on
@@ -69,9 +69,9 @@ Scheduler, while the SchedulerLock would be long gone. OTOH 
this makes
 Task handling less error-prone, than doing "special" manual cleanup.
 There is also a "= TODOs and ideas =" to get rid if static Tasks.
 
-Actually the SchedulerMutex should never be locked when calling into
-non-scheduler code, so it was converted to simulate a non-recursive
-mutex later. As an alternative it could use a std::mutex.
+Actually the scheduler mutex should never be locked when calling into
+non-scheduler code, so it was converted to a non-recursive
+std::mutex.
 
 
 = Lifecycle / thread-safety of Scheduler-based objects =
@@ -407,9 +407,3 @@ will also affect the Gtk+ and KDE backend for the user 
event handling.
 
 This way it can be easier used to profile Tasks, eventually to improve LO's
 interactivity.
-
-== Convert SchedulerMutex to std::mutex ==
-
-Since the SchedulerMutex is non-recursive, it could use a std::mutex instead
-of simulating one still using the osl::Mutex. Not sure, if a deadlock instead
-of a crash, when called recursively, is the better "user experience"...
diff --git a/vcl/inc/schedulerimpl.hxx b/vcl/inc/schedulerimpl.hxx
index 26a9c47de11f..f6d5dda708bd 100644
--- a/vcl/inc/schedulerimpl.hxx
+++ b/vcl/inc/schedulerimpl.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_VCL_INC_SCHEDULERIMPL_HXX
 
 #include "salwtype.hxx"
-#include 
 #include 
 
 class Task;
@@ -38,22 +37,6 @@ struct ImplSchedulerData final
 const char *GetDebugName() const;
 };
 
-class SchedulerMutex final
-{
-// this simulates a non-recursive mutex
-bool m_bIsLocked;
-osl::Mutex m_aMutex;
-
-public:
-SchedulerMutex()
-: m_bIsLocked(false)
-{
-}
-
-void acquire();
-void release();
-};
-
 class SchedulerGuard final
 {
 public:
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index e7a423234043..564c28bdc9b0 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -38,6 +38,7 @@
 #include "salwtype.hxx"
 #include "displayconnectiondispatch.hxx"
 
+#include 
 #include 
 #include 
 #include 
@@ -369,7 +370,8 @@ struct ImplSchedulerContext
 SalTimer*   mpSalTimer = nullptr;   ///< interface to 
sal event loop / system timer
 sal_uInt64  mnTimerStart = 0;   ///< start time of 
the timer
 sal_uInt64  mnTimerPeriod = SAL_MAX_UINT64; ///< current timer 
period
-SchedulerMutex  maMutex;///< lock counting 
mutex for scheduler locking
+std::mutex  maMutex;///< the 
"scheduler mutex" (see
+///< 
vcl/README.scheduler)
 boolmbActive = true;///< is the 
scheduler active?
 };
 
diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index 1759178e2e2f..da8511bffa55 100644
--- a/vcl/source/app/scheduler.cxx
+++ b/vcl/source/app/scheduler.cxx
@@ -207,36 +207,18 @@ 

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/README.scheduler vcl/source

2020-12-07 Thread Jan-Marek Glogowski (via logerrit)
 include/vcl/scheduler.hxx|4 +--
 vcl/README.scheduler |   10 +
 vcl/inc/schedulerimpl.hxx|   15 -
 vcl/source/app/scheduler.cxx |   47 ++-
 4 files changed, 41 insertions(+), 35 deletions(-)

New commits:
commit 84af20ef3ea72190784e9e7be820684c2558ba8c
Author: Jan-Marek Glogowski 
AuthorDate: Sat Dec 5 12:42:11 2020 +0100
Commit: Jan-Marek Glogowski 
CommitDate: Mon Dec 7 14:27:14 2020 +0100

Make SchedulerMutex non-recursive

While thinking about the "Unlock scheduler in deinit for
ProcessEventsToIdle" patch, I came to the conclusion, that this
mutex should actually be non-recursive. I had a look at the code
and did run "make check" for my symbol build on Linux, but for
the rest I'm reying on the LO CI.

Maybe this can be converted to a std::mutex later. I've updated
the vcl/README.scheduler and added a TODO.

Change-Id: Ib9cb086af74b51e48f99ebfa1201d14db12b140e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107254
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/include/vcl/scheduler.hxx b/include/vcl/scheduler.hxx
index 9318b2109641..7219146cbf39 100644
--- a/include/vcl/scheduler.hxx
+++ b/include/vcl/scheduler.hxx
@@ -36,8 +36,8 @@ class VCL_DLLPUBLIC Scheduler final
 
 static void ImplStartTimer ( sal_uInt64 nMS, bool bForce, sal_uInt64 nTime 
);
 
-static void Lock( sal_uInt32 nLockCount = 1 );
-static sal_uInt32 Unlock( bool bUnlockAll = false );
+static void Lock();
+static void Unlock();
 
 public:
 static constexpr sal_uInt64 ImmediateTimeoutMs = 0;
diff --git a/vcl/README.scheduler b/vcl/README.scheduler
index 718509033e79..466485f16645 100644
--- a/vcl/README.scheduler
+++ b/vcl/README.scheduler
@@ -69,6 +69,10 @@ Scheduler, while the SchedulerLock would be long gone. OTOH 
this makes
 Task handling less error-prone, than doing "special" manual cleanup.
 There is also a "= TODOs and ideas =" to get rid if static Tasks.
 
+Actually the SchedulerMutex should never be locked when calling into
+non-scheduler code, so it was converted to simulate a non-recursive
+mutex later. As an alternative it could use a std::mutex.
+
 
 = Lifecycle / thread-safety of Scheduler-based objects =
 
@@ -403,3 +407,9 @@ will also affect the Gtk+ and KDE backend for the user 
event handling.
 
 This way it can be easier used to profile Tasks, eventually to improve LO's
 interactivity.
+
+== Convert SchedulerMutex to std::mutex ==
+
+Since the SchedulerMutex is non-recursive, it could use a std::mutex instead
+of simulating one still using the osl::Mutex. Not sure, if a deadlock instead
+of a crash, when called recursively, is the better "user experience"...
diff --git a/vcl/inc/schedulerimpl.hxx b/vcl/inc/schedulerimpl.hxx
index ffb08084252c..26a9c47de11f 100644
--- a/vcl/inc/schedulerimpl.hxx
+++ b/vcl/inc/schedulerimpl.hxx
@@ -40,15 +40,18 @@ struct ImplSchedulerData final
 
 class SchedulerMutex final
 {
-sal_uInt32  mnLockDepth;
-osl::Mutex  maMutex;
+// this simulates a non-recursive mutex
+bool m_bIsLocked;
+osl::Mutex m_aMutex;
 
 public:
-SchedulerMutex() : mnLockDepth( 0 ) {}
+SchedulerMutex()
+: m_bIsLocked(false)
+{
+}
 
-void acquire( sal_uInt32 nLockCount = 1 );
-sal_uInt32 release( bool bUnlockAll = false );
-sal_uInt32 lockDepth() const { return mnLockDepth; }
+void acquire();
+void release();
 };
 
 class SchedulerGuard final
diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index 9ae60f3f344d..1759178e2e2f 100644
--- a/vcl/source/app/scheduler.cxx
+++ b/vcl/source/app/scheduler.cxx
@@ -124,15 +124,13 @@ void Scheduler::ImplDeInitScheduler()
   "DeInit the scheduler - pending tasks: " << nTasks );
 
 // clean up all the sfx::SfxItemDisruptor_Impl Idles
-sal_uInt32 nLockCount = Unlock(true);
-assert(1 == nLockCount);
+Unlock();
 ProcessEventsToIdle();
-Lock(nLockCount);
+Lock();
 #endif
 rSchedCtx.mbActive = false;
 
 assert( nullptr == rSchedCtx.mpSchedulerStack );
-assert( 1 == rSchedCtx.maMutex.lockDepth() );
 
 if (rSchedCtx.mpSalTimer) rSchedCtx.mpSalTimer->Stop();
 delete rSchedCtx.mpSalTimer;
@@ -209,41 +207,36 @@ next_priority:
 rSchedCtx.mnTimerPeriod= InfiniteTimeoutMs;
 }
 
-void SchedulerMutex::acquire( sal_uInt32 nLockCount )
+void SchedulerMutex::acquire()
 {
-assert(nLockCount > 0);
-for (sal_uInt32 i = 0; i != nLockCount; ++i) {
-if (!maMutex.acquire())
-abort();
-}
-mnLockDepth += nLockCount;
+if (!m_aMutex.acquire())
+std::abort();
+if (m_bIsLocked)
+std::abort();
+m_bIsLocked = true;
 }
 
-sal_uInt32 SchedulerMutex::release( bool bUnlockAll )
+void SchedulerMutex::release()
 {
-assert(mnLockDepth > 0);
-const sal_uInt32 nLockCount =
-

[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/README.scheduler vcl/source

2020-12-07 Thread Jan-Marek Glogowski (via logerrit)
 include/vcl/scheduler.hxx|1 -
 vcl/README.scheduler |   11 +++
 vcl/inc/schedulerimpl.hxx|   19 ---
 vcl/source/app/scheduler.cxx |3 +++
 vcl/source/app/svapp.cxx |1 -
 5 files changed, 14 insertions(+), 21 deletions(-)

New commits:
commit e4b702718e83c1ad76f001e4d3641cc2dd17cd7b
Author: Jan-Marek Glogowski 
AuthorDate: Fri Dec 4 21:05:28 2020 +0100
Commit: Jan-Marek Glogowski 
CommitDate: Mon Dec 7 14:23:57 2020 +0100

Unlock scheduler in deinit for ProcessEventsToIdle

The scheduler is normally never locked when not processing its own
task lists. So while the fix is correct, that ProcessEventsToIdle
shouldn't run with a locked scheduler, just unlock it in the
actual shutdown case, where the deadlock occurred.

This also reverts commit 46f6b39c6d8acd064bafb2416feba757ba0d0fbc.

Change-Id: If1603c1563772dd1d156dc6d9bcddbf58aa721c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107241
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/include/vcl/scheduler.hxx b/include/vcl/scheduler.hxx
index 955043116b50..9318b2109641 100644
--- a/include/vcl/scheduler.hxx
+++ b/include/vcl/scheduler.hxx
@@ -27,7 +27,6 @@ struct ImplSchedulerContext;
 class VCL_DLLPUBLIC Scheduler final
 {
 friend class SchedulerGuard;
-friend class SchedulerGuardReleaser;
 friend class Task;
 Scheduler() = delete;
 
diff --git a/vcl/README.scheduler b/vcl/README.scheduler
index 52c76dac5b85..718509033e79 100644
--- a/vcl/README.scheduler
+++ b/vcl/README.scheduler
@@ -58,6 +58,17 @@ Task::mpSchedulerData, which is actually a part of the 
scheduler.
 Before invoking the task, we have to release the lock, so others can
 Start new Tasks.
 
+The Scheduler just processes it's own Tasks in the main thread and needs
+the SolarMutex for it and for DeInit (tested by DBG_TESTSOLARMUTEX). All
+the other interaction just take the SchedulerMutex or don't need locking
+at all.
+
+There is a "workaround" for static Task objecs, which would crash LO on
+destruction, because Task::~Task would try to de-register itself in the
+Scheduler, while the SchedulerLock would be long gone. OTOH this makes
+Task handling less error-prone, than doing "special" manual cleanup.
+There is also a "= TODOs and ideas =" to get rid if static Tasks.
+
 
 = Lifecycle / thread-safety of Scheduler-based objects =
 
diff --git a/vcl/inc/schedulerimpl.hxx b/vcl/inc/schedulerimpl.hxx
index d95fb0157880..ffb08084252c 100644
--- a/vcl/inc/schedulerimpl.hxx
+++ b/vcl/inc/schedulerimpl.hxx
@@ -65,25 +65,6 @@ public:
 }
 };
 
-class SchedulerGuardReleaser final
-{
-public:
-SchedulerGuardReleaser()
-{
-Scheduler::Lock();
-m_nLockCount = Scheduler::Unlock(true) - 1;
-}
-
-~SchedulerGuardReleaser()
-{
-if (m_nLockCount)
-Scheduler::Lock(m_nLockCount);
-}
-
-private:
-sal_uInt32 m_nLockCount;
-};
-
 #endif // INCLUDED_VCL_INC_SCHEDULERIMPL_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index f9fc3dc01fc6..9ae60f3f344d 100644
--- a/vcl/source/app/scheduler.cxx
+++ b/vcl/source/app/scheduler.cxx
@@ -124,7 +124,10 @@ void Scheduler::ImplDeInitScheduler()
   "DeInit the scheduler - pending tasks: " << nTasks );
 
 // clean up all the sfx::SfxItemDisruptor_Impl Idles
+sal_uInt32 nLockCount = Unlock(true);
+assert(1 == nLockCount);
 ProcessEventsToIdle();
+Lock(nLockCount);
 #endif
 rSchedCtx.mbActive = false;
 
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 0b30a0b6b688..f91375e77edd 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -462,7 +462,6 @@ bool Application::Reschedule( bool i_bAllEvents )
 
 void Scheduler::ProcessEventsToIdle()
 {
-SchedulerGuardReleaser aReleaser;
 int nSanity = 1;
 while( Application::Reschedule( true ) )
 {
___
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

2020-12-04 Thread Mike Kaganski (via logerrit)
 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

2020-12-03 Thread Caolán McNamara (via logerrit)
 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

2020-11-28 Thread Caolán McNamara (via logerrit)
 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* 

  1   2   3   >