core.git: vcl/source

2024-05-19 Thread Khaled Hosny (via logerrit)
 vcl/source/gdi/pdfwriter_impl.cxx |   14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 44f2bc12779645bce1000289caf9c66804ecb14e
Author: Khaled Hosny 
AuthorDate: Sat May 18 17:23:19 2024 +0300
Commit: خالد حسني 
CommitDate: Sun May 19 09:30:06 2024 +0200

tdf#160884: Apply scale to position of embedded images in Type 3 fonts

Regression from:

commit bc3f6c3a47411a3b5dafadca4e5c55cd24e30662
Author: Khaled Hosny 
Date:   Tue Aug 22 10:47:33 2023 +0300

tdf#155610: Workaround Acrobat bug with Type 3 fonts and unusual UPEM

Change-Id: I5e352292268d19fb8348a038d251f2d395a0be46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167830
Reviewed-by: Stéphane Guillou 
Reviewed-by: خالد حسني 
Tested-by: Jenkins

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 3474c94c8a72..9d4cd6c51bf0 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2746,15 +2746,11 @@ bool PDFWriterImpl::emitType3Font(const 
vcl::font::PhysicalFontFace* pFace,
 appendDouble(aRect.GetWidth() * fScale, aContents);
 aContents.append(" 0 0 ");
 appendDouble(aRect.GetHeight() * fScale, aContents);
-aContents.append(
-+ " "
-+ OString::number(aRect.getX())
-+ " "
-+ OString::number(aRect.getY())
-+ " cm "
-  "/Im"
-+ OString::number(nObject)
-+ " Do Q
");
+aContents.append(" ");
+appendDouble(aRect.getX() * fScale, aContents);
+aContents.append(" ");
+appendDouble(aRect.getY() * fScale, aContents);
+aContents.append(" cm /Im" + OString::number(nObject) + " Do Q
");
 }
 
 const auto& rOutline = rGlyph.getOutline();


core.git: vcl/source

2024-05-13 Thread Michael Weghorn (via logerrit)
 vcl/source/control/spinfld.cxx |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 869b88488ac443cc64943254064da20b0f361c56
Author: Michael Weghorn 
AuthorDate: Mon May 13 16:37:45 2024 +0200
Commit: Michael Weghorn 
CommitDate: Tue May 14 07:25:44 2024 +0200

tdf#160824 vcl: Require mouse over spinfield to mouse-wheel through values

In the same way that

commit 22250df05830700b2555348b8ac46ee1007d0e5d
Author: Michael Weghorn 
Date:   Fri Dec 8 11:50:40 2023 +0100

tdf#158548 vcl: Require mouse over listbox to mouse-wheel through 
entries

restricted changing listbox values for the focused
listbox on mouse-wheel to the case when the listbox
is also hovered over by the mouse, do the same for
`SpinField` as well, to avoid accidently changing
the value as described e.g. for the tdf#160824
scenario.

This is also in line with Qt spin boxes that
only change their values on mouse-wheel when
the mouse pointer is above them.

For the gtk3 VCL plugin that uses native spin boxes,
this commit has no effect, and the value doesn't
change on mouse-wheel at all.

Change-Id: I22277294f76655cd13b1dc57416c82afe44460d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167604
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index 973825a3a977..1eb8357a2940 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -543,9 +543,18 @@ bool SpinField::EventNotify(NotifyEvent& rNEvt)
 {
 if ((rNEvt.GetCommandEvent()->GetCommand() == CommandEventId::Wheel) 
&& !IsReadOnly())
 {
+const Point& rMousePos = 
rNEvt.GetCommandEvent()->GetMousePosPixel();
+bool bMouseHovered = maUpperRect.Contains(rMousePos) || 
maLowerRect.Contains(rMousePos);
+if (!bMouseHovered && mpEdit)
+{
+const tools::Rectangle aEditRect(mpEdit->GetPosPixel(), 
mpEdit->GetSizePixel());
+bMouseHovered = aEditRect.Contains(rMousePos);
+}
+
 MouseWheelBehaviour 
nWheelBehavior(GetSettings().GetMouseSettings().GetWheelBehavior());
-if (nWheelBehavior == MouseWheelBehaviour::ALWAYS
-   || (nWheelBehavior == MouseWheelBehaviour::FocusOnly && 
HasChildPathFocus()))
+if (bMouseHovered
+&& (nWheelBehavior == MouseWheelBehaviour::ALWAYS
+|| (nWheelBehavior == MouseWheelBehaviour::FocusOnly && 
HasChildPathFocus(
 {
 const CommandWheelData* pData = 
rNEvt.GetCommandEvent()->GetWheelData();
 if (pData->GetMode() == CommandWheelMode::SCROLL)


core.git: vcl/source

2024-05-11 Thread Michael Meeks (via logerrit)
 vcl/source/window/window.cxx |   16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

New commits:
commit fbfeb33b38cc0a644c0315448f6a2d8637a0007e
Author: Michael Meeks 
AuthorDate: Fri May 10 20:29:32 2024 +0100
Commit: Caolán McNamara 
CommitDate: Sat May 11 14:27:33 2024 +0200

lok: Don't dump empty aria properties in every JSON element.

They simply bloat the json to no benefit if the properties are
empty, avoid serializing empty values.

Change-Id: I83c780d01820ec39acc85899d45ad9e929ad7e76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167496
Reviewed-by: Marco Cecchetti 
Tested-by: Michael Meeks 
(cherry picked from commit 24876e5611abbaec9b2fe5fcbcf4be71a10ee366)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167457
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index b7f0ea58181b..3cb43a8a4a05 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3410,13 +3410,17 @@ void Window::DumpAsPropertyTree(tools::JsonWriter& 
rJsonWriter)
 
 if(!pAccLabelFor && !pAccLabelledBy)
 {
-auto aAria = rJsonWriter.startNode("aria");
+OUString sAccName = GetAccessibleName();
+OUString sAccDesc = GetAccessibleDescription();
 
-OUString sAccString = GetAccessibleName();
-rJsonWriter.put("label", sAccString);
-
-sAccString = GetAccessibleDescription();
-rJsonWriter.put("description", sAccString);
+if (!sAccName.isEmpty() || !sAccDesc.isEmpty())
+{
+auto aAria = rJsonWriter.startNode("aria");
+if (!sAccName.isEmpty())
+rJsonWriter.put("label", sAccName);
+if (!sAccDesc.isEmpty())
+rJsonWriter.put("description", sAccDesc);
+}
 }
 
 mpWindowImpl->maDumpAsPropertyTreeHdl.Call(rJsonWriter);


core.git: vcl/source

2024-05-10 Thread Michael Meeks (via logerrit)
 vcl/source/app/svapp.cxx |   12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit b1c77f927aced5eeaebd5c17c30efdc1df74c4f9
Author: Michael Meeks 
AuthorDate: Fri May 10 17:13:55 2024 +0100
Commit: Michael Meeks 
CommitDate: Fri May 10 21:25:15 2024 +0200

lok: dumpState should truncate very long JSON messages.

Otherwise we get huge dumps which can overwhelm our logging and hide
more useful information, and/or the journal can drop them on the ground.

Change-Id: Ie942c70a90a6df60ccd8986444362d622c213e15
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167456
Tested-by: Jenkins
Reviewed-by: Michael Meeks 

diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 8bfcb5e03d66..b3a63cd05a46 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1750,11 +1750,17 @@ void dumpState(rtl::OStringBuffer )
 vcl::Window *pWin = Application::GetFirstTopLevelWindow();
 while (pWin)
 {
-tools::JsonWriter props;
-pWin->DumpAsPropertyTree(props);
+tools::JsonWriter aProps;
+pWin->DumpAsPropertyTree(aProps);
 
 rState.append("
Window: ");
-rState.append(props.finishAndGetAsOString());
+OString aPropStr = aProps.finishAndGetAsOString();
+if (aPropStr.getLength() > 256)
+{
+rState.append(aPropStr.subView(0, 256));
+rState.append("...");
+} else
+rState.append(aPropStr);
 
 pWin = Application::GetNextTopLevelWindow( pWin );
 }


core.git: vcl/source

2024-05-09 Thread Tomaž Vajngerl (via logerrit)
 vcl/source/window/accessibility.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 65e09958920057b3a15d38dcb2e26e752f42179c
Author: Tomaž Vajngerl 
AuthorDate: Wed May 8 21:07:06 2024 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu May 9 15:37:11 2024 +0200

lok: don't try to search for legacy label from/to

Searching for legacy label from/to can take quite some time in
complex hierarchies (wallclock timed to 100ms) and this quickly
can add up. In case of accessibility checker sidebar with many
entries it could add up to 10s or more (depending on the amount of
accessibility issues found in the document).

The legacy label from/to is not used when we load from .ui file so
it is not relevant for online currently. It is only relevant for ui
found in extensions or starbasic ui.

Also avoid making a copy of the vector of mnemonic label for no
particular reason.

Change-Id: I72002e6440a06f6e8548b7bddb46c3ab283ea283
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167347
Reviewed-by: Caolán McNamara 
Reviewed-by: Szymon Kłos 
Tested-by: Caolán McNamara 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 1353ae001ed83c1f20b81df1708f694427c587a4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167315
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/vcl/source/window/accessibility.cxx 
b/vcl/source/window/accessibility.cxx
index e48d5d22dd5e..2f3160a05b40 100644
--- a/vcl/source/window/accessibility.cxx
+++ b/vcl/source/window/accessibility.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -563,7 +564,8 @@ vcl::Window* Window::GetAccessibleRelationLabelFor() const
 if (pWindow)
 return pWindow;
 
-if (!isContainerWindow(this) && !isContainerWindow(GetParent()))
+// Avoid searching when using LOKit (jsdialog) - it can slow down dumping 
to json when we have a huge hierarchy
+if (!comphelper::LibreOfficeKit::isActive() && !isContainerWindow(this) && 
!isContainerWindow(GetParent()))
 return getLegacyNonLayoutAccessibleRelationLabelFor();
 
 return nullptr;
@@ -574,7 +576,7 @@ vcl::Window* Window::GetAccessibleRelationLabeledBy() const
 if (mpWindowImpl->mpAccessibleInfos && 
mpWindowImpl->mpAccessibleInfos->pLabeledByWindow)
 return mpWindowImpl->mpAccessibleInfos->pLabeledByWindow;
 
-std::vector > aMnemonicLabels(list_mnemonic_labels());
+auto const& aMnemonicLabels = list_mnemonic_labels();
 if (!aMnemonicLabels.empty())
 {
 //if we have multiple labels, then prefer the first that is visible
@@ -586,7 +588,8 @@ vcl::Window* Window::GetAccessibleRelationLabeledBy() const
 return aMnemonicLabels[0];
 }
 
-if (!isContainerWindow(this) && !isContainerWindow(GetParent()))
+// Avoid searching when using LOKit (jsdialog) - it can slow down dumping 
to json when we have a huge hierarchy
+if (!comphelper::LibreOfficeKit::isActive() && !isContainerWindow(this) && 
!isContainerWindow(GetParent()))
 return getLegacyNonLayoutAccessibleRelationLabeledBy();
 
 return nullptr;


core.git: vcl/source

2024-05-06 Thread Noel Grandin (via logerrit)
 vcl/source/uitest/uno/uiobject_uno.cxx |2 ++
 vcl/source/uitest/uno/uitest_uno.cxx   |4 
 2 files changed, 6 insertions(+)

New commits:
commit 39ca990a6e6a1e9b18241683ca7e9a2013db2356
Author: Noel Grandin 
AuthorDate: Fri May 3 20:46:17 2024 +0200
Commit: Noel Grandin 
CommitDate: Mon May 6 19:25:40 2024 +0200

throw more obvious error when a UITest fails to find a ui object

otherwise we might hit the assert inside the UIObjectUnoObj
constructor

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

diff --git a/vcl/source/uitest/uno/uiobject_uno.cxx 
b/vcl/source/uitest/uno/uiobject_uno.cxx
index a17c744c0331..5a67cf5f902e 100644
--- a/vcl/source/uitest/uno/uiobject_uno.cxx
+++ b/vcl/source/uitest/uno/uiobject_uno.cxx
@@ -57,6 +57,8 @@ css::uno::Reference SAL_CALL 
UIObjectUnoObj::getChild(
 SolarMutexGuard aGuard;
 std::unique_ptr pObj = mpObj->get_child(rID);
 SAL_WARN_IF(!pObj, "vcl", "child " << rID << " of parent " << 
mpObj->dumpState() << " does not exist");
+if (!pObj)
+throw css::uno::RuntimeException("getChild with id " + rID + " did not 
find a child");
 return new UIObjectUnoObj(std::move(pObj));
 }
 
diff --git a/vcl/source/uitest/uno/uitest_uno.cxx 
b/vcl/source/uitest/uno/uitest_uno.cxx
index 9886b049a43a..12694521fc19 100644
--- a/vcl/source/uitest/uno/uitest_uno.cxx
+++ b/vcl/source/uitest/uno/uitest_uno.cxx
@@ -80,6 +80,8 @@ css::uno::Reference SAL_CALL 
UITestUnoObj::getTopFocus
 {
 SolarMutexGuard aGuard;
 std::unique_ptr pObj = UITest::getFocusTopWindow();
+if (!pObj)
+throw css::uno::RuntimeException("UITest::getFocusTopWindow did not 
find a window");
 return new UIObjectUnoObj(std::move(pObj));
 }
 
@@ -87,6 +89,8 @@ css::uno::Reference SAL_CALL 
UITestUnoObj::getFloatWin
 {
 SolarMutexGuard aGuard;
 std::unique_ptr pObj = UITest::getFloatWindow();
+if (!pObj)
+throw css::uno::RuntimeException("UITest::getFloatWindow did not find 
a window");
 return new UIObjectUnoObj(std::move(pObj));
 }
 


core.git: vcl/source

2024-05-06 Thread Noel Grandin (via logerrit)
 vcl/source/gdi/pdfbuildin_fonts.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 49ebf692a0e4a9cbf8b550996589464064d12e54
Author: Noel Grandin 
AuthorDate: Mon May 6 09:25:07 2024 +0200
Commit: Noel Grandin 
CommitDate: Mon May 6 11:41:40 2024 +0200

fix jenkins Windows build

after
commit defc7a92064832423242635d48a7db4440a0b347
Author: Noel Grandin 
Date:   Fri May 3 09:20:04 2024 +0200
replace createFromAscii with OUString literals in vcl::pdf::BuildinFont

my local version of Visual Studio seems to have better support
for constinit than the jenkins one.

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

diff --git a/vcl/source/gdi/pdfbuildin_fonts.cxx 
b/vcl/source/gdi/pdfbuildin_fonts.cxx
index 07d2b69252dd..85a9a6d5343b 100644
--- a/vcl/source/gdi/pdfbuildin_fonts.cxx
+++ b/vcl/source/gdi/pdfbuildin_fonts.cxx
@@ -69,7 +69,7 @@ FontAttributes BuildinFont::GetFontAttributes() const
 return aDFA;
 }
 
-constinit const BuildinFont BuildinFontFace::m_aBuildinFonts[14]
+const BuildinFont BuildinFontFace::m_aBuildinFonts[14]
 = { { u"Courier"_ustr, // family name
   u"Normal"_ustr, // style
   "Courier", // PSName


core.git: vcl/source

2024-05-02 Thread Julien Nabet (via logerrit)
 vcl/source/filter/png/PngImageReader.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e783a1c09093f3dbaf778661b77a2d5872a2029d
Author: Julien Nabet 
AuthorDate: Thu May 2 09:16:26 2024 +0200
Commit: Julien Nabet 
CommitDate: Thu May 2 19:14:38 2024 +0200

Extend silence strange -Wclobbered with GCC <= 14

See 2bcd9fe0fa10339294e6ab820498fa18334e02f3
Silence strange -Wclobbered with recent GCC 14

Change-Id: Id51659cb8cd49b65c55b22ed0ac515a8ab609602
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166994
Reviewed-by: Stephan Bergmann 
Tested-by: Julien Nabet 

diff --git a/vcl/source/filter/png/PngImageReader.cxx 
b/vcl/source/filter/png/PngImageReader.cxx
index 61bfb9a0f16d..27e0e5bd766a 100644
--- a/vcl/source/filter/png/PngImageReader.cxx
+++ b/vcl/source/filter/png/PngImageReader.cxx
@@ -322,7 +322,7 @@ bool fcTLbeforeIDAT(SvStream& rStream)
 return false;
 }
 
-#if defined __GNUC__ && __GNUC__ == 14 && !defined __clang__
+#if defined __GNUC__ && __GNUC__ <= 14 && !defined __clang__
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wclobbered"
 #endif
@@ -821,7 +821,7 @@ BinaryDataContainer getMsGifChunk(SvStream& rStream)
 return {};
 }
 }
-#if defined __GNUC__ && __GNUC__ == 14 && !defined __clang__
+#if defined __GNUC__ && __GNUC__ <= 14 && !defined __clang__
 #pragma GCC diagnostic pop
 #endif
 


core.git: vcl/source

2024-04-28 Thread Patrick Luby (via logerrit)
 vcl/source/bitmap/BitmapEx.cxx |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 5425103fb5a09c7e5e56d077260523438c593e21
Author: Patrick Luby 
AuthorDate: Sun Apr 28 14:35:42 2024 -0400
Commit: Patrick Luby 
CommitDate: Sun Apr 28 23:05:49 2024 +0200

tdf#160831 only set outside color to black for alpha masks

The outside color still needs to be white for the content
so only apply the fix for tdf#157795 to the alpha mask.

Change-Id: I7486b2c9062ca96bf127f2bce6b1bd5e65d00ff6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166806
Reviewed-by: Noel Grandin 
Reviewed-by: Patrick Luby 
Tested-by: Jenkins

diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx
index dfad8876b315..0d1216bb7095 100644
--- a/vcl/source/bitmap/BitmapEx.cxx
+++ b/vcl/source/bitmap/BitmapEx.cxx
@@ -639,7 +639,7 @@ namespace
 const Bitmap& rSource,
 const Size& rDestinationSize,
 const basegfx::B2DHomMatrix& rTransform,
-bool bSmooth)
+bool bSmooth, bool bAlphaMask)
 {
 Bitmap aDestination(rDestinationSize, vcl::PixelFormat::N24_BPP);
 BitmapScopedWriteAccess xWrite(aDestination);
@@ -655,7 +655,10 @@ namespace
 // tdf#157795 set color to black outside of bitmap bounds
 // Due to commit 81994cb2b8b32453a92bcb011830fcb884f22ff3,
 // transparent areas are now black instead of white.
-const BitmapColor aOutside(0x0, 0x0, 0x0);
+// tdf#160831 only set outside color to black for alpha masks
+// The outside color still needs to be white for the content
+// so only apply the fix for tdf#157795 to the alpha mask.
+const BitmapColor aOutside = bAlphaMask ? BitmapColor(0x0, 
0x0, 0x0) : BitmapColor(0xff, 0xff, 0xff);
 
 for(tools::Long y(0); y < aDestinationSizePixel.getHeight(); 
y++)
 {
@@ -741,12 +744,12 @@ BitmapEx BitmapEx::TransformBitmapEx(
 // force destination to 24 bit, we want to smooth output
 const Size aDestinationSize(basegfx::fround(fWidth), 
basegfx::fround(fHeight));
 bool bSmooth = implTransformNeedsSmooth(rTransformation);
-const Bitmap aDestination(impTransformBitmap(GetBitmap(), 
aDestinationSize, rTransformation, bSmooth));
+const Bitmap aDestination(impTransformBitmap(GetBitmap(), 
aDestinationSize, rTransformation, bSmooth, false));
 
 // create mask
 if(IsAlpha())
 {
-const Bitmap aAlpha(impTransformBitmap(GetAlphaMask().GetBitmap(), 
aDestinationSize, rTransformation, bSmooth));
+const Bitmap aAlpha(impTransformBitmap(GetAlphaMask().GetBitmap(), 
aDestinationSize, rTransformation, bSmooth, true));
 return BitmapEx(aDestination, AlphaMask(aAlpha));
 }
 


core.git: vcl/source

2024-04-23 Thread Ilmari Lauhakangas (via logerrit)
 vcl/source/window/split.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7d13e62c3d468bd249db62cfdde14f28f74b3f59
Author: Ilmari Lauhakangas 
AuthorDate: Tue Apr 23 19:39:12 2024 +0300
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Apr 23 20:30:46 2024 +0200

tdf#39468 Translate German comments in vcl

Change-Id: I783d924bffddb637eac1a3d89f4ee956955e0044
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166558
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Jenkins

diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx
index df631b270bbf..d25e2b677e36 100644
--- a/vcl/source/window/split.cxx
+++ b/vcl/source/window/split.cxx
@@ -460,10 +460,10 @@ void Splitter::StartDrag()
 
 StartSplit();
 
-// Tracking starten
+// Start tracking
 StartTracking();
 
-// Start-Position ermitteln
+// Determine start position
 maDragPos = mpRefWin->GetPointerPosPixel();
 ImplSplitMousePos( maDragPos );
 if ( mbHorzSplit )


core.git: vcl/source

2024-04-23 Thread Noel Grandin (via logerrit)
 vcl/source/app/svapp.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit bced98442d5e9c4b55ec6d4e5da3d549f8141359
Author: Noel Grandin 
AuthorDate: Tue Apr 23 09:20:22 2024 +0200
Commit: Noel Grandin 
CommitDate: Tue Apr 23 10:56:12 2024 +0200

tdf#160469 Ctrl+Alt+F4 is marked reserved, but doesn't do anything

this used to be SV_SHORTCUT_DOCKUNDOCK, which was introduced in

commit b342b183aaea042ef0e6e1c75304072cb4e1375a
Author: Rüdiger Timm 
Date:   Tue Jul 24 09:03:18 2007 +
INTEGRATION: CWS mergesvp (1.1.2); FILE ADDED

I assume this was a solaris or something similar system hotkey, so
remove it as no longer being relevant.

Certainly nothing inside the vcl code is handling it specially.

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

diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 6f3cab0c90ed..72f6afcb3b01 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -104,7 +104,6 @@ vcl::KeyCode const ReservedKeys[]
 vcl::KeyCode(KEY_F2,KEY_SHIFT)  ,
 vcl::KeyCode(KEY_F4,KEY_MOD1)   ,
 vcl::KeyCode(KEY_F4,KEY_MOD2)   ,
-vcl::KeyCode(KEY_F4,KEY_MOD1|KEY_MOD2)  ,
 vcl::KeyCode(KEY_F6,0)  ,
 vcl::KeyCode(KEY_F6,KEY_MOD1)   ,
 vcl::KeyCode(KEY_F6,KEY_SHIFT)  ,


core.git: vcl/source

2024-04-18 Thread Tomaž Vajngerl (via logerrit)
 vcl/source/gdi/salmisc.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 92edab3d95ff5ee8a81a453b3224157839dfd32c
Author: Tomaž Vajngerl 
AuthorDate: Wed Apr 17 22:55:01 2024 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Apr 18 14:11:26 2024 +0200

tdf#160016 tdf#160704 Set the direction from src in StretchAndConvert

The direction of the BitmapBuffer was never set, so it defaulted
to BottomUp. The best is to set the direction to be the same as
source - It's unlikely they would be different.

Regression from 6588c30ed4477627b2623560ca867682b189bc80
"vcl: separate scanline direction from ScanlineFormat"

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

diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx
index ed210bf8475c..b1833855ab8c 100644
--- a/vcl/source/gdi/salmisc.cxx
+++ b/vcl/source/gdi/salmisc.cxx
@@ -234,6 +234,8 @@ std::optional StretchAndConvert(
 FncSetPixel pFncSetPixel;
 std::optional pDstBuffer(std::in_place);
 
+
+pDstBuffer->meDirection = rSrcBuffer.meDirection;
 // set function for getting pixels
 pFncGetPixel = BitmapReadAccess::GetPixelFunction(rSrcBuffer.meFormat);
 if( !pFncGetPixel )


core.git: vcl/source

2024-04-18 Thread Tibor Nagy (via logerrit)
 vcl/source/gdi/print3.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit d129495bb19dededacb27fee18c9ed7273dddb82
Author: Tibor Nagy 
AuthorDate: Thu Apr 18 00:09:36 2024 +0200
Commit: Nagy Tibor 
CommitDate: Thu Apr 18 08:34:48 2024 +0200

tdf#160698: fix crash after opening print dialog

Regression from I5a0ab3d781b21eff575afaebb233237eff1827d5
"tdf#155218 sc: fix regression page orientation in print dialog"

Change-Id: Iccdd8a6eefcadea963a1ffec61c0bcf798931fcd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166197
Tested-by: Jenkins
Reviewed-by: Nagy Tibor 

diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 6b15615f2bc9..5f5e0e0327c9 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -1018,9 +1018,12 @@ void 
vcl::ImplPrinterControllerData::resetPaperToLastConfigured()
 // reset the print area created by the Print Dialog to the page style's print 
area.
 void PrinterController::resetPrintArea()
 {
-mpImplData->mxPrinter->ResetPrintArea(true);
-mpImplData->mxPrinter->SetUsePrintDialogSetting(false);
-getPageCount();
+if (mpImplData->mxPrinter->IsUsePrintDialogSetting())
+{
+mpImplData->mxPrinter->ResetPrintArea(true);
+mpImplData->mxPrinter->SetUsePrintDialogSetting(false);
+getPageCount();
+}
 }
 
 int PrinterController::getPageCountProtected() const


core.git: vcl/source

2024-04-13 Thread Mike Kaganski (via logerrit)
 vcl/source/outdev/textline.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit a8931211b623cb38b7f703cf9a994ac66162f03a
Author: Mike Kaganski 
AuthorDate: Sat Apr 13 23:36:22 2024 +0500
Commit: Mike Kaganski 
CommitDate: Sun Apr 14 06:53:58 2024 +0200

Use more o3tl::convert

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

diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index 0dfd98d602f1..51937edc48ff 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -494,8 +494,8 @@ void OutputDevice::ImplDrawStraightTextLine( tools::Long 
nBaseX, tools::Long nBa
 nDashWidth = 100;
 nSpaceWidth = 50;
 }
-nDashWidth = ((nDashWidth*mnDPIX)+1270)/2540;
-nSpaceWidth = ((nSpaceWidth*mnDPIX)+1270)/2540;
+nDashWidth = o3tl::convert(nDashWidth * mnDPIX, 
o3tl::Length::mm100, o3tl::Length::in);
+nSpaceWidth = o3tl::convert(nSpaceWidth * mnDPIX, 
o3tl::Length::mm100, o3tl::Length::in);
 // DashWidth will be increased if the line is getting too thick
 // in proportion to the line's length
 if ( nDashWidth < nMinDashWidth )
@@ -521,7 +521,7 @@ void OutputDevice::ImplDrawStraightTextLine( tools::Long 
nBaseX, tools::Long nBa
 nDotWidth += mnDPIY/2;
 nDotWidth /= mnDPIY;
 
-tools::Long nDashWidth = ((100*mnDPIX)+1270)/2540;
+tools::Long nDashWidth = o3tl::convert(100 * mnDPIX, 
o3tl::Length::mm100, o3tl::Length::in);
 tools::Long nMinDashWidth = nDotWidth*4;
 // DashWidth will be increased if the line is getting too thick
 // in proportion to the line's length
@@ -556,7 +556,7 @@ void OutputDevice::ImplDrawStraightTextLine( tools::Long 
nBaseX, tools::Long nBa
 nDotWidth += mnDPIY/2;
 nDotWidth /= mnDPIY;
 
-tools::Long nDashWidth = ((100*mnDPIX)+1270)/2540;
+tools::Long nDashWidth = o3tl::convert(100 * mnDPIX, 
o3tl::Length::mm100, o3tl::Length::in);
 tools::Long nMinDashWidth = nDotWidth*4;
 // DashWidth will be increased if the line is getting too thick
 // in proportion to the line's length


core.git: vcl/source

2024-04-12 Thread Mike Kaganski (via logerrit)
 vcl/source/gdi/CommonSalLayout.cxx |6 +++---
 vcl/source/outdev/text.cxx |2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 01cabd3f998197f277300bcc71fc80e80642caed
Author: Mike Kaganski 
AuthorDate: Fri Apr 12 09:56:29 2024 +0100
Commit: Mike Kaganski 
CommitDate: Sat Apr 13 01:20:18 2024 +0200

Don't use lround when assigning to a double

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

diff --git a/vcl/source/gdi/CommonSalLayout.cxx 
b/vcl/source/gdi/CommonSalLayout.cxx
index fc3a2a2bf79c..8211b9ea6aa9 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -555,9 +555,9 @@ bool 
GenericSalLayout::LayoutText(vcl::text::ImplLayoutArgs& rArgs, const SalLay
 nYOffset = nYOffset * nYScale;
 if (!GetSubpixelPositioning())
 {
-nAdvance = std::lround(nAdvance);
-nXOffset = std::lround(nXOffset);
-nYOffset = std::lround(nYOffset);
+nAdvance = std::round(nAdvance);
+nXOffset = std::round(nXOffset);
+nYOffset = std::round(nYOffset);
 }
 
 basegfx::B2DPoint aNewPos(aCurrPos.getX() + nXOffset, 
aCurrPos.getY() + nYOffset);
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 80fb2b94bd40..ed782acf2ffb 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -1121,7 +1121,7 @@ std::unique_ptr OutputDevice::ImplLayout(const 
OUString& rOrigStr,
 {
 for(int i = 0; i < nLen; ++i)
 xDXPixelArray[i] = pDXArray.get(i);
-nEndGlyphCoord = std::lround(xDXPixelArray[nLen - 1]);
+nEndGlyphCoord = std::round(xDXPixelArray[nLen - 1]);
 }
 
 aLayoutArgs.SetDXArray(xDXPixelArray.get());


core.git: vcl/source

2024-04-10 Thread Xisco Fauli (via logerrit)
 vcl/source/bitmap/BitmapTools.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit e1f3120ce83c113d7dc91b60f50344f63f1c41f0
Author: Xisco Fauli 
AuthorDate: Wed Apr 10 16:20:09 2024 +0200
Commit: Xisco Fauli 
CommitDate: Wed Apr 10 17:42:03 2024 +0200

vcl: return earlier if size is empty

Change-Id: I96bcd47d93e0e4d05e33d3ad3eca86c6edcf87ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165950
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/vcl/source/bitmap/BitmapTools.cxx 
b/vcl/source/bitmap/BitmapTools.cxx
index ee0134a90010..2330483bb98b 100644
--- a/vcl/source/bitmap/BitmapTools.cxx
+++ b/vcl/source/bitmap/BitmapTools.cxx
@@ -376,6 +376,12 @@ BitmapEx CanvasTransformBitmap( const BitmapEx&
 rBitmap,
 ::basegfx::B2DRectangle const & rDestRect,
 ::basegfx::B2DHomMatrix const & 
rLocalTransform )
 {
+const Size aDestBmpSize( ::basegfx::fround( rDestRect.getWidth() ),
+ ::basegfx::fround( rDestRect.getHeight() ) );
+
+if( aDestBmpSize.IsEmpty() )
+return BitmapEx();
+
 const Size aBmpSize( rBitmap.GetSizePixel() );
 Bitmap aSrcBitmap( rBitmap.GetBitmap() );
 Bitmap aSrcAlpha;
@@ -416,12 +422,6 @@ BitmapEx CanvasTransformBitmap( const BitmapEx&
 rBitmap,
 }
 // else: mapping table is not used
 
-const Size aDestBmpSize( ::basegfx::fround( rDestRect.getWidth() ),
- ::basegfx::fround( rDestRect.getHeight() ) );
-
-if( aDestBmpSize.IsEmpty() )
-return BitmapEx();
-
 Bitmap aDstBitmap(aDestBmpSize, aSrcBitmap.getPixelFormat(), 
>GetPalette());
 Bitmap aDstAlpha( AlphaMask( aDestBmpSize ).GetBitmap() );
 


core.git: vcl/source

2024-04-07 Thread Aron Budea (via logerrit)
 vcl/source/gdi/sallayout.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 1a856fcede54b37701089849a838b6d52bb04b8c
Author: Aron Budea 
AuthorDate: Sat Apr 6 22:48:07 2024 +0200
Commit: Aron Budea 
CommitDate: Sun Apr 7 09:35:19 2024 +0200

tdf#160342 Unwanted space before end of line when printing

Also adjust some numeric literals to reflect they're
floating point values in the expressions.

Regression from 172b500ccbc8dac0496cc2936a9bcca793c0b594.

Change-Id: I8281ba7c7d480135471ba94b11d447d76fd33063
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165860
Tested-by: Jenkins
Reviewed-by: Aron Budea 

diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 3240e481578f..28138c3f61fd 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -304,7 +304,7 @@ void GenericSalLayout::Justify(double nNewWidth)
 std::vector::iterator pGlyphIter;
 // count stretchable glyphs
 int nStretchable = 0;
-double nMaxGlyphWidth = 0;
+double nMaxGlyphWidth = 0.0;
 for(pGlyphIter = m_GlyphItems.begin(); pGlyphIter != pGlyphIterRight; 
++pGlyphIter)
 {
 if( !pGlyphIter->IsInCluster() )
@@ -315,7 +315,7 @@ void GenericSalLayout::Justify(double nNewWidth)
 
 // move rightmost glyph to requested position
 nOldWidth -= pGlyphIterRight->origWidth();
-if( nOldWidth <= 0 )
+if( nOldWidth <= 0.0 )
 return;
 if( nNewWidth < nMaxGlyphWidth)
 nNewWidth = nMaxGlyphWidth;
@@ -324,10 +324,10 @@ void GenericSalLayout::Justify(double nNewWidth)
 
 // justify glyph widths and positions
 double nDiffWidth = nNewWidth - nOldWidth;
-if( nDiffWidth >= 0) // expanded case
+if( nDiffWidth >= 0.0 ) // expanded case
 {
 // expand width by distributing space between glyphs evenly
-int nDeltaSum = 0;
+double nDeltaSum = 0.0;
 for( pGlyphIter = m_GlyphItems.begin(); pGlyphIter != pGlyphIterRight; 
++pGlyphIter )
 {
 // move glyph to justified position


core.git: vcl/source

2024-04-01 Thread Mike Kaganski (via logerrit)
 vcl/source/gdi/sallayout.cxx |   22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

New commits:
commit 51244ebe62bb25f7d87ab1332e863720d980db66
Author: Mike Kaganski 
AuthorDate: Tue Apr 2 08:55:51 2024 +0500
Commit: Mike Kaganski 
CommitDate: Tue Apr 2 07:34:32 2024 +0200

Fix UB after 8962141a12c966b2d891829925e6203bf8d51852

(tdf#160430: Fix glyph bounds calculation, and use basegfx::B2DRectangle, 
2024-04-01).
As reported by Stephan in 
https://gerrit.libreoffice.org/c/core/+/165553/6#message-fec1e45288c0e87d43c58f777ebe51b03c534d82:

 `CppunitTest_sw_rtfexport CPPUNIT_TEST_NAME=testMathEqarray::TestBody` now 
fails with

  vcl/source/gdi/sallayout.cxx:245:30: runtime error: inf is outside the 
range of representable values of type 'long'
   #0 in SalLayout::GetBoundRect(tools::Rectangle&) const at 
vcl/source/gdi/sallayout.cxx:245:30
   #1 in OutputDevice::GetTextBoundRect(tools::Rectangle&, rtl::OUString 
const&, int, int, int, unsigned long, KernArraySpan, std::span, SalLayoutGlyphs const*) const at 
vcl/source/outdev/text.cxx:1932:28
   #2 in (anonymous namespace)::SmGetGlyphBoundRect(OutputDevice const&, 
rtl::OUString const&, tools::Rectangle&) at starmath/source/rect.cxx:80:32
   #3 in SmRect::SmRect(OutputDevice const&, SmFormat const*, rtl::OUString 
const&, unsigned short) at starmath/source/rect.cxx:224:21
   #4 in SmMathSymbolNode::AdaptToY(OutputDevice&, unsigned long) at 
starmath/source/node.cxx:2122:18
   #5 in SmBraceNode::Arrange(OutputDevice&, SmFormat const&) at 
starmath/source/node.cxx:1340:17
   #6 in SmBinHorNode::Arrange(OutputDevice&, SmFormat const&) at 
starmath/source/node.cxx:816:13
   #7 in SmLineNode::Arrange(OutputDevice&, SmFormat const&) at 
starmath/source/node.cxx:610:20
   #8 in SmTableNode::Arrange(OutputDevice&, SmFormat const&) at 
starmath/source/node.cxx:534:20
   #9 in SmDocShell::ArrangeFormula() at starmath/source/document.cxx:280:13
   #10 in SmDocShell::GetSize() at starmath/source/document.cxx:405:9
   #11 in SmDocShell::Repaint() at starmath/source/document.cxx:566:21
   #12 in SmDocShell::OnDocumentPrinterChanged(Printer*) at 
starmath/source/document.cxx:552:5
   #13 in SmDocShell::SetText(rtl::OUString const&) at 
starmath/source/document.cxx:188:9
   #14 in SmDocShell::readFormulaOoxml(oox::formulaimport::XmlStream&) at 
starmath/source/document.cxx:848:5
   #15 in SmModel::readFormulaOoxml(oox::formulaimport::XmlStream&) at 
starmath/source/unomodel.cxx:1105:22
   #16 in 
writerfilter::rtftok::RTFDocumentImpl::beforePopState(writerfilter::rtftok::RTFParserState&)
 at writerfilter/source/rtftok/rtfdocumentimpl.cxx:3010:30
   #17 in writerfilter::rtftok::RTFDocumentImpl::popState() at 
writerfilter/source/rtftok/rtfdocumentimpl.cxx:3666:23
   #18 in writerfilter::rtftok::RTFTokenizer::resolveParse() at 
writerfilter/source/rtftok/rtftokenizer.cxx:114:37
   #19 in 
writerfilter::rtftok::RTFDocumentImpl::resolve(writerfilter::Stream&) at 
writerfilter/source/rtftok/rtfdocumentimpl.cxx:856:27
   #20 in (anonymous 
namespace)::RtfFilter::filter(com::sun::star::uno::Sequence
 const&) at writerfilter/source/filter/RtfFilter.cxx:163:20
   #21 in SfxObjectShell::ImportFrom(SfxMedium&, 
com::sun::star::uno::Reference const&) at 
sfx2/source/doc/objstor.cxx:2392:34
   #22 in SfxObjectShell::DoLoad(SfxMedium*) at 
sfx2/source/doc/objstor.cxx:760:23
   #23 in 
SfxBaseModel::load(com::sun::star::uno::Sequence
 const&) at sfx2/source/doc/sfxbasemodel.cxx:1980:36
   #24 in (anonymous 
namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence
 const&, com::sun::star::uno::Reference const&) 
at sfx2/source/view/frmload.cxx:720:28
   #25 in framework::LoadEnv::impl_loadContent() at 
framework/source/loadenv/loadenv.cxx:1176:37
   #26 in framework::LoadEnv::start() at 
framework/source/loadenv/loadenv.cxx:412:20
   #27 in framework::LoadEnv::startLoading(rtl::OUString const&, 
com::sun::star::uno::Sequence const&, 
com::sun::star::uno::Reference const&, 
rtl::OUString const&, int, LoadEnvFeatures) at 
framework/source/loadenv/loadenv.cxx:308:5
   #28 in 
framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference
 const&, com::sun::star::uno::Reference 
const&, rtl::OUString const&, rtl::OUString const&, int, 
com::sun::star::uno::Sequence const&) at 
framework/source/loadenv/loadenv.cxx:168:14
   #29 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, 
rtl::OUString const&, int, 
com::sun::star::uno::Sequence const&) at 
framework/source/services/desktop.cxx:591:16
   #30 in non-virtual thunk to 
framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString 
const&, int, 
com::sun::star::uno::Sequence const&) at 
framework/source/services/desktop.cxx
   #31 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, 

core.git: vcl/source

2024-04-01 Thread Tomaž Vajngerl (via logerrit)
 vcl/source/filter/igif/gifread.cxx |   34 --
 1 file changed, 16 insertions(+), 18 deletions(-)

New commits:
commit cf01073667147f35758a2bde06aec666fc14898e
Author: Tomaž Vajngerl 
AuthorDate: Sat Mar 23 21:20:16 2024 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Apr 1 08:08:57 2024 +0200

vcl: get rid of NO_PENDING define

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

diff --git a/vcl/source/filter/igif/gifread.cxx 
b/vcl/source/filter/igif/gifread.cxx
index cfb4e84f2363..c3151f3274d0 100644
--- a/vcl/source/filter/igif/gifread.cxx
+++ b/vcl/source/filter/igif/gifread.cxx
@@ -25,8 +25,6 @@
 #include 
 #include 
 
-#define NO_PENDING( rStm ) ( ( rStm ).GetError() != ERRCODE_IO_PENDING )
-
 namespace {
 
 enum GIFAction
@@ -263,13 +261,13 @@ bool GIFReader::ReadGlobalHeader()
 boolbRet = false;
 
 auto nRead = rIStm.ReadBytes(pBuf, 6);
-if (nRead == 6 && NO_PENDING(rIStm))
+if (nRead == 6 && (rIStm.GetError() != ERRCODE_IO_PENDING))
 {
 pBuf[ 6 ] = 0;
 if( !strcmp( pBuf, "GIF87a" ) || !strcmp( pBuf, "GIF89a" ) )
 {
 nRead = rIStm.ReadBytes(pBuf, 7);
-if (nRead == 7 && NO_PENDING(rIStm))
+if (nRead == 7 && (rIStm.GetError() != ERRCODE_IO_PENDING))
 {
 sal_uInt8   nAspect;
 sal_uInt8   nRF;
@@ -289,7 +287,7 @@ bool GIFReader::ReadGlobalHeader()
 else
 nBackgroundColor = 0;
 
-if( NO_PENDING( rIStm ) )
+if (rIStm.GetError() != ERRCODE_IO_PENDING)
 bRet = true;
 }
 }
@@ -309,7 +307,7 @@ void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, 
sal_uLong nCount )
 std::unique_ptr pBuf(new sal_uInt8[ nLen ]);
 std::size_t nRead = rIStm.ReadBytes(pBuf.get(), nLen);
 nCount = nRead/3UL;
-if( !(NO_PENDING( rIStm )) )
+if (rIStm.GetError() == ERRCODE_IO_PENDING)
 return;
 
 sal_uInt8* pTmp = pBuf.get();
@@ -347,7 +345,7 @@ bool GIFReader::ReadExtension()
 // Extension-Label
 sal_uInt8 cFunction(0);
 rIStm.ReadUChar( cFunction );
-if( NO_PENDING( rIStm ) )
+if (rIStm.GetError() != ERRCODE_IO_PENDING)
 {
 boolbOverreadDataBlocks = false;
 sal_uInt8 cSize(0);
@@ -365,7 +363,7 @@ bool GIFReader::ReadExtension()
 sal_uInt8 cByte(0);
 rIStm.ReadUChar(cByte);
 
-if ( NO_PENDING( rIStm ) )
+if (rIStm.GetError() != ERRCODE_IO_PENDING)
 {
 nGCDisposalMethod = ( cFlags >> 2) & 7;
 bGCTransparent = ( cFlags & 1 );
@@ -378,7 +376,7 @@ bool GIFReader::ReadExtension()
 // Application extension
 case 0xff :
 {
-if ( NO_PENDING( rIStm ) )
+if (rIStm.GetError() != ERRCODE_IO_PENDING)
 {
 // by default overread this extension
 bOverreadDataBlocks = true;
@@ -406,7 +404,7 @@ bool GIFReader::ReadExtension()
 rIStm.ReadUChar( cByte );
 
 bStatus = ( cByte == 0 );
-bRet = NO_PENDING( rIStm );
+bRet = rIStm.GetError() != ERRCODE_IO_PENDING;
 bOverreadDataBlocks = false;
 
 // Netscape interprets the loop count
@@ -429,7 +427,7 @@ bool GIFReader::ReadExtension()
 rIStm.ReadUInt32( nLogWidth100 ).ReadUInt32( 
nLogHeight100 );
 rIStm.ReadUChar( cByte );
 bStatus = ( cByte == 0 );
-bRet = NO_PENDING( rIStm );
+bRet = rIStm.GetError() != ERRCODE_IO_PENDING;
 bOverreadDataBlocks = false;
 }
 else
@@ -463,7 +461,7 @@ bool GIFReader::ReadExtension()
 
 bRet = false;
 std::size_t nRead = rIStm.ReadBytes(, 1);
-if (NO_PENDING(rIStm) && nRead == 1)
+if (rIStm.GetError() != ERRCODE_IO_PENDING && nRead == 1)
 {
 bRet = true;
 }
@@ -482,7 +480,7 @@ bool GIFReader::ReadLocalHeader()
 boolbRet = false;
 
 std::size_t nRead = rIStm.ReadBytes(pBuf, 9);
-if (NO_PENDING(rIStm) && nRead == 9)
+if (rIStm.GetError() != ERRCODE_IO_PENDING && nRead == 9)
 {
 SvMemoryStream  aMemStm;
 BitmapPalette*  pPal;
@@ -511,7 +509,7 @@ bool GIFReader::ReadLocalHeader()
 // if we could read everything, we will create the local image;
 // if the global 

core.git: vcl/source

2024-04-01 Thread Tomaž Vajngerl (via logerrit)
 vcl/source/filter/ixpm/xpmread.cxx |  213 -
 1 file changed, 93 insertions(+), 120 deletions(-)

New commits:
commit d8ece6a5f56f012ecf1766cc3f68c85706e3b6cb
Author: Tomaž Vajngerl 
AuthorDate: Sat Mar 23 20:59:24 2024 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Apr 1 08:08:39 2024 +0200

vcl: remove partial XPM image loading

This removes the code that handles the IO_PENDING and the graphic
"context" handling from XPM image format.

Partial loading of images complicates the image filter life cycle
a lot (many exceptions) and is not really needed so much today as
this was needed in the past. In most cases we load the whole image
in one pass anyway. Even loading from the network should be fast
enough to not cause issues for the user.

Most image filters don't even implement this like PNG and nobody
noticed for many years that this is not supported.

To handle IO_PENDING case it is probably better to load the
bitstream into memory and then load the whole image after that
in one pass. This can also be implemented all inside (Imp)Graphic
in a very straight forward way.

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

diff --git a/vcl/source/filter/ixpm/xpmread.cxx 
b/vcl/source/filter/ixpm/xpmread.cxx
index eca9b50287bd..1ad06483a712 100644
--- a/vcl/source/filter/ixpm/xpmread.cxx
+++ b/vcl/source/filter/ixpm/xpmread.cxx
@@ -52,8 +52,7 @@ namespace {
 enum ReadState
 {
 XPMREAD_OK,
-XPMREAD_ERROR,
-XPMREAD_NEED_MORE
+XPMREAD_ERROR
 };
 
 }
@@ -112,7 +111,7 @@ private:
 public:
 explicit XPMReader(SvStream& rStream);
 
-ReadState ReadXPM(Graphic& rGraphic);
+ReadState ReadXPM(BitmapEx& rBitmapEx);
 };
 
 }
@@ -123,136 +122,122 @@ XPMReader::XPMReader(SvStream& rStream)
 {
 }
 
-ReadState XPMReader::ReadXPM(Graphic& rGraphic)
+ReadState XPMReader::ReadXPM(BitmapEx& rBitmapEx)
 {
-ReadState   eReadState;
-sal_uInt8   cDummy;
+if (!mrStream.good())
+return XPMREAD_ERROR;
 
-// check if we can real ALL
-mrStream.Seek( STREAM_SEEK_TO_END );
-mrStream.ReadUChar( cDummy );
+ReadState eReadState = XPMREAD_ERROR;
 
-// if we could not read all
-// return and wait for new data
-if (mrStream.GetError() != ERRCODE_IO_PENDING)
+mrStream.Seek( mnLastPos );
+mbStatus = true;
+
+if ( mbStatus )
 {
-mrStream.Seek( mnLastPos );
-mbStatus = true;
+mpStringBuf = new sal_uInt8 [ XPMSTRINGBUF ];
+mpTempBuf = new sal_uInt8 [ XPMTEMPBUFSIZE ];
 
+mbStatus = ImplGetString();
 if ( mbStatus )
 {
-mpStringBuf = new sal_uInt8 [ XPMSTRINGBUF ];
-mpTempBuf = new sal_uInt8 [ XPMTEMPBUFSIZE ];
+mnIdentifier = XPMVALUES;   // fetch Bitmap information
+mnWidth = ImplGetULONG( 0 );
+mnHeight = ImplGetULONG( 1 );
+mnColors = ImplGetULONG( 2 );
+mnCpp = ImplGetULONG( 3 );
+}
+if ( mnColors > ( SAL_MAX_UINT32 / ( 4 + mnCpp ) ) )
+mbStatus = false;
+if ( ( mnWidth * mnCpp ) >= XPMSTRINGBUF )
+mbStatus = false;
+//xpms are a minimum of one character (one byte) per pixel, so if the 
file isn't
+//even that long, it's not all there
+if (mrStream.remainingSize() + mnTempAvail < 
static_cast(mnWidth) * mnHeight)
+mbStatus = false;
+if ( mbStatus && mnWidth && mnHeight && mnColors && mnCpp )
+{
+mnIdentifier = XPMCOLORS;
 
-mbStatus = ImplGetString();
-if ( mbStatus )
+for (sal_uLong i = 0; i < mnColors; ++i)
 {
-mnIdentifier = XPMVALUES;   // fetch Bitmap information
-mnWidth = ImplGetULONG( 0 );
-mnHeight = ImplGetULONG( 1 );
-mnColors = ImplGetULONG( 2 );
-mnCpp = ImplGetULONG( 3 );
+if (!ImplGetColor())
+{
+mbStatus = false;
+break;
+}
 }
-if ( mnColors > ( SAL_MAX_UINT32 / ( 4 + mnCpp ) ) )
-mbStatus = false;
-if ( ( mnWidth * mnCpp ) >= XPMSTRINGBUF )
-mbStatus = false;
-//xpms are a minimum of one character (one byte) per pixel, so if 
the file isn't
-//even that long, it's not all there
-if (mrStream.remainingSize() + mnTempAvail < 
static_cast(mnWidth) * mnHeight)
-mbStatus = false;
-if ( mbStatus && mnWidth && mnHeight && mnColors && mnCpp )
+
+if ( mbStatus )
 {
-mnIdentifier = XPMCOLORS;
+// create a 24bit graphic when more as 256 colours 

core.git: vcl/source

2024-03-31 Thread Caolán McNamara (via logerrit)
 vcl/source/treelist/iconviewimpl.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 0544fb193b949dbcff97e8c475063dd72583ad1d
Author: Caolán McNamara 
AuthorDate: Sat Mar 30 21:25:51 2024 +
Commit: Caolán McNamara 
CommitDate: Sun Mar 31 18:00:33 2024 +0200

Resolves: tdf#157587 IconView scoll range not updated

IconView::SetUpdateMode(true) doesn't update the scroll
range for any changes that might have taken place while
updates were suspended.

The similar SvImpLBox::UpdateAll() for "normal" lists
does this update, so do the equivalent update here too.

Noticeable since:

commit 666925f2ab06e690c41c470713dc83f2d752bfb7
Date:   Sat Jun 3 15:23:15 2023 +0100

perf: use freeze/thaw around block insert of multiple icons

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

diff --git a/vcl/source/treelist/iconviewimpl.cxx 
b/vcl/source/treelist/iconviewimpl.cxx
index 048e193d4f4b..35025d1c81f4 100644
--- a/vcl/source/treelist/iconviewimpl.cxx
+++ b/vcl/source/treelist/iconviewimpl.cxx
@@ -467,6 +467,7 @@ void IconViewImpl::SyncVerThumb()
 void IconViewImpl::UpdateAll()
 {
 FindMostRight();
+AdjustScrollBars(m_aOutputSize);
 SyncVerThumb();
 FillView();
 ShowVerSBar();


core.git: vcl/source

2024-03-28 Thread Mike Kaganski (via logerrit)
 vcl/source/font/LogicalFontInstance.cxx |   17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 291c90811ada39ed079d458887a59fc8977494f6
Author: Mike Kaganski 
AuthorDate: Fri Mar 29 08:55:24 2024 +0500
Commit: Mike Kaganski 
CommitDate: Fri Mar 29 06:11:11 2024 +0100

Simplify a bit

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

diff --git a/vcl/source/font/LogicalFontInstance.cxx 
b/vcl/source/font/LogicalFontInstance.cxx
index 0c21cba47548..94e1e72353fb 100644
--- a/vcl/source/font/LogicalFontInstance.cxx
+++ b/vcl/source/font/LogicalFontInstance.cxx
@@ -113,19 +113,20 @@ double LogicalFontInstance::GetKashidaWidth() const
 void LogicalFontInstance::GetScale(double* nXScale, double* nYScale) const
 {
 double nUPEM = GetFontFace()->UnitsPerEm();
-double nHeight(m_aFontSelData.mnHeight);
-
-// On Windows, mnWidth is relative to average char width not font height,
-// and we need to keep it that way for GDI to correctly scale the glyphs.
-// Here we compensate for this so that HarfBuzz gives us the correct glyph
-// positions.
-double nWidth(m_aFontSelData.mnWidth ? m_aFontSelData.mnWidth * 
m_nAveWidthFactor : nHeight);
 
 if (nYScale)
-*nYScale = nHeight / nUPEM;
+*nYScale = m_aFontSelData.mnHeight / nUPEM;
 
 if (nXScale)
+{
+// On Windows, mnWidth is relative to average char width not font 
height,
+// and we need to keep it that way for GDI to correctly scale the 
glyphs.
+// Here we compensate for this so that HarfBuzz gives us the correct 
glyph
+// positions.
+double nWidth(m_aFontSelData.mnWidth ? m_aFontSelData.mnWidth * 
GetAverageWidthFactor()
+ : m_aFontSelData.mnHeight);
 *nXScale = nWidth / nUPEM;
+}
 }
 
 void LogicalFontInstance::AddFallbackForUnicode(sal_UCS4 cChar, FontWeight 
eWeight,


core.git: vcl/source

2024-03-28 Thread Attila Szűcs (via logerrit)
 vcl/source/filter/igif/gifread.cxx |   13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 110eb4f6f8ed43faf7d2a4e74bfdcb93934f6439
Author: Attila Szűcs 
AuthorDate: Mon Mar 25 01:04:14 2024 +0100
Commit: Caolán McNamara 
CommitDate: Thu Mar 28 10:19:23 2024 +0100

tdf#153162 Gif load transparency optimization

Converting a bitmap from transparency to alpha can be very slow.
fortunately it can be avoided.
Inverted the transparency colors (cTransIndex1, cNonTransIndex1)
that are used to create aBmp1 in GIFReader::FillImages.
It create the transparency bitmap inverted, so no need to invert it.

Change-Id: I14714fe4b8bbcd7849db57b2824a7077dda40f81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165261
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/filter/igif/gifread.cxx 
b/vcl/source/filter/igif/gifread.cxx
index 8f56edaee77f..cfb4e84f2363 100644
--- a/vcl/source/filter/igif/gifread.cxx
+++ b/vcl/source/filter/igif/gifread.cxx
@@ -220,18 +220,22 @@ void GIFReader::CreateBitmaps(tools::Long nWidth, 
tools::Long nHeight, BitmapPal
 if (bGCTransparent)
 {
 const Color aWhite(COL_WHITE);
+const Color aBlack(COL_BLACK);
 
 aBmp1 = Bitmap(aSize, vcl::PixelFormat::N8_BPP, 
::GetGreyPalette(256));
 
 if (!aAnimation.Count())
-aBmp1.Erase(aWhite);
+aBmp1.Erase(aBlack);
 
 pAcc1 = aBmp1;
 
 if (pAcc1)
 {
-cTransIndex1 = 
static_cast(pAcc1->GetBestPaletteIndex(aWhite));
-cNonTransIndex1 = cTransIndex1 ? 0 : 1;
+// We have to make an AlphaMask from it, that needs to be inverted 
from transparency.
+// It is faster to invert it here.
+// So Non-Transparent color should be 0xff , and Transparent 
should be 0.
+cNonTransIndex1 = 
static_cast(pAcc1->GetBestPaletteIndex(aWhite));
+cTransIndex1 = 
static_cast(pAcc1->GetBestPaletteIndex(aBlack));
 }
 else
 {
@@ -671,7 +675,8 @@ void GIFReader::CreateNewBitmaps()
 {
 pAcc1.reset();
 AlphaMask aAlphaMask(aBmp1);
-aAlphaMask.Invert(); // convert from transparency to alpha
+// No need to convert from transparency to alpha
+// aBmp1 is already inverted
 aAnimationFrame.maBitmapEx = BitmapEx( aBmp8, aAlphaMask );
 }
 else


core.git: vcl/source

2024-03-27 Thread Noel Grandin (via logerrit)
 vcl/source/uitest/uiobject.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 9b98856c59707037cc25ec7f2dae975bc269901d
Author: Noel Grandin 
AuthorDate: Wed Mar 27 21:52:04 2024 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 28 06:43:24 2024 +0100

prevent SEGV in ToolBoxUIObject::get_state

if we call it while it has no current item id

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

diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index 24b11ecb8556..2671a9145436 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -1696,9 +1696,10 @@ OUString ToolBoxUIObject::get_action(VclEventId nEvent) 
const
 StringMap ToolBoxUIObject::get_state()
 {
 StringMap aMap = WindowUIObject::get_state();
-aMap["CurrSelectedItemID"] = 
OUString::number(sal_uInt16(mxToolBox->GetCurItemId()));
-aMap["CurrSelectedItemText"] = 
mxToolBox->GetItemText(mxToolBox->GetCurItemId());
-aMap["CurrSelectedItemCommand"] = 
mxToolBox->GetItemCommand(mxToolBox->GetCurItemId());
+ToolBoxItemId nCurItemId = mxToolBox->GetCurItemId();
+aMap["CurrSelectedItemID"] = OUString::number(sal_uInt16(nCurItemId));
+aMap["CurrSelectedItemText"] = nCurItemId ? 
mxToolBox->GetItemText(nCurItemId) : "";
+aMap["CurrSelectedItemCommand"] = nCurItemId ? 
mxToolBox->GetItemCommand(nCurItemId) : "";
 aMap["ItemCount"] = OUString::number(mxToolBox->GetItemCount());
 return aMap;
 }


core.git: vcl/source

2024-03-27 Thread Caolán McNamara (via logerrit)
 vcl/source/window/printdlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6f89e03f3903474bc51ef8396eb366326cfc254c
Author: Caolán McNamara 
AuthorDate: Wed Mar 27 17:23:18 2024 +
Commit: Caolán McNamara 
CommitDate: Wed Mar 27 21:39:25 2024 +0100

Resolves: tdf#160392 preview's measurement are black on dark bg in dark mode

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

diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 3acd7ddb1ab1..35cbccf79ab1 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -122,7 +122,7 @@ void 
PrintDialog::PrintPreviewWindow::Paint(vcl::RenderContext& rRenderContext,
 {
 rRenderContext.Push();
 weld::SetPointFont(rRenderContext, 
rRenderContext.GetSettings().GetStyleSettings().GetLabelFont());
-
+
rRenderContext.SetTextColor(rRenderContext.GetSettings().GetStyleSettings().GetLabelTextColor());
 
rRenderContext.SetBackground(Wallpaper(Application::GetSettings().GetStyleSettings().GetDialogColor()));
 rRenderContext.Erase();
 


core.git: vcl/source

2024-03-26 Thread Mike Kaganski (via logerrit)
 vcl/source/app/scheduler.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit e89c4d157a66e273898a8851d25fd0504cb28fc6
Author: Mike Kaganski 
AuthorDate: Tue Mar 26 19:06:25 2024 +0500
Commit: Mike Kaganski 
CommitDate: Tue Mar 26 19:08:05 2024 +0100

Set the condition, even when main thread message queue is empty

Post an empty user event for that.

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

diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index 4f2543641c3c..e9f4057cd47c 100644
--- a/vcl/source/app/scheduler.cxx
+++ b/vcl/source/app/scheduler.cxx
@@ -284,6 +284,9 @@ Scheduler::IdlesLockGuard::IdlesLockGuard()
 // condition to proceed. Only main thread returning to 
Application::Execute guarantees that
 // the flag really took effect.
 pSVData->m_inExecuteCondtion.reset();
+// Put an empty event to the application's queue, to make sure that it 
loops through the
+// code that sets the condition, even when there's no other events in 
the queue
+Application::PostUserEvent({});
 SolarMutexReleaser releaser;
 pSVData->m_inExecuteCondtion.wait();
 }


core.git: vcl/source

2024-03-24 Thread Tomoyuki Kubota (via logerrit)
 vcl/source/text/textlayout.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6802878057e91a7d32b143d4e177de9b30e09a25
Author: Tomoyuki Kubota 
AuthorDate: Sun Mar 24 09:42:23 2024 +0100
Commit: Caolán McNamara 
CommitDate: Sun Mar 24 20:52:32 2024 +0100

for compilaton with OSL_DEBUG_LEVEL > 1, adapt to the commit f9395a12, 
which replaced std::vector with KernArray

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

diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx
index 303ea5b28659..7f69c1726fe1 100644
--- a/vcl/source/text/textlayout.cxx
+++ b/vcl/source/text/textlayout.cxx
@@ -606,7 +606,7 @@ namespace vcl
 aTrace.append( " = ( " );
 for ( sal_Int32 i=0; i<_nLength; )
 {
-aTrace.append( _pDXAry->at(i) );
+aTrace.append( _pDXAry->get(i) );
 if ( ++i < _nLength )
 aTrace.append( ", " );
 }


core.git: vcl/source

2024-03-19 Thread Caolán McNamara (via logerrit)
 vcl/source/filter/png/PngImageReader.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 3bec2d6a8a96102d5a6e93c339601347effa97d7
Author: Caolán McNamara 
AuthorDate: Tue Mar 19 08:41:13 2024 +
Commit: Caolán McNamara 
CommitDate: Tue Mar 19 22:33:04 2024 +0100

ofz#67495 Out-of-memory

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

diff --git a/vcl/source/filter/png/PngImageReader.cxx 
b/vcl/source/filter/png/PngImageReader.cxx
index 2af433f9d555..0445aff40af9 100644
--- a/vcl/source/filter/png/PngImageReader.cxx
+++ b/vcl/source/filter/png/PngImageReader.cxx
@@ -885,9 +885,11 @@ bool PngImageReader::isAPng(SvStream& rStream)
 rStream.ReadUInt32(nChunkType);
 if (!rStream.good() || nChunkType != PNG_IHDR_SIGNATURE)
 return false;
-rStream.SeekRel(nChunkSize);
+if (!checkSeek(rStream, rStream.Tell() + nChunkSize))
+return false;
 // Skip IHDR CRC
-rStream.SeekRel(PNG_CRC_SIZE);
+if (!checkSeek(rStream, rStream.Tell() + PNG_CRC_SIZE))
+return false;
 // Look for acTL chunk that exists before the first IDAT chunk
 while (true)
 {


core.git: vcl/source

2024-03-16 Thread Caolán McNamara (via logerrit)
 vcl/source/gdi/metaact.cxx |   19 ++-
 1 file changed, 18 insertions(+), 1 deletion(-)

New commits:
commit 7f43f00d55bc32fd62c2f72cb0343f9419eb8491
Author: Caolán McNamara 
AuthorDate: Sat Mar 16 20:56:01 2024 +
Commit: Caolán McNamara 
CommitDate: Sat Mar 16 22:30:25 2024 +0100

ofz#67445 Timeout

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

diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index bea295fb416e..81d72cdf8dbd 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -735,9 +735,26 @@ MetaStretchTextAction::MetaStretchTextAction( const Point& 
rPt, sal_uInt32 nWidt
 
 void MetaStretchTextAction::Execute( OutputDevice* pOut )
 {
-if (!AllowDim(pOut->LogicToPixel(maPt).Y()))
+if (!AllowRect(pOut->LogicToPixel(tools::Rectangle(maPt, Size(mnWidth, 
pOut->GetTextHeight())
 return;
 
+static bool bFuzzing = comphelper::IsFuzzing();
+if (bFuzzing && mnWidth > 1)
+{
+FontLineStyle eUnderline = pOut->GetFont().GetUnderline();
+FontLineStyle eOverline = pOut->GetFont().GetOverline();
+
+if (eUnderline == LINESTYLE_SMALLWAVE || eUnderline == LINESTYLE_WAVE 
||
+eUnderline == LINESTYLE_DOUBLEWAVE || eUnderline == 
LINESTYLE_BOLDWAVE ||
+eOverline == LINESTYLE_SMALLWAVE || eOverline == LINESTYLE_WAVE ||
+eOverline == LINESTYLE_DOUBLEWAVE || eOverline == 
LINESTYLE_BOLDWAVE)
+{
+SAL_WARN("vcl.gdi", "MetaStretchTextAction::Execute, skipping 
suspicious WaveTextLine of length: "
+<< mnWidth << " for fuzzing performance");
+return;
+}
+}
+
 pOut->DrawStretchText( maPt, mnWidth, maStr, mnIndex, mnLen );
 }
 


core.git: vcl/source

2024-03-15 Thread Mike Kaganski (via logerrit)
 vcl/source/window/menubarwindow.cxx  |6 +++---
 vcl/source/window/menufloatingwindow.cxx |2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit f097720636fe88c6d36e3a8cac98aa51622dbb6c
Author: Mike Kaganski 
AuthorDate: Fri Mar 15 12:02:38 2024 +0500
Commit: Mike Kaganski 
CommitDate: Fri Mar 15 10:24:17 2024 +0100

tdf#160020: don't hide mnemonics, when auto-accel feature is off

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

diff --git a/vcl/source/window/menubarwindow.cxx 
b/vcl/source/window/menubarwindow.cxx
index 9fb3552ed17a..d440e7ab3987 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -124,7 +124,7 @@ MenuBarWindow::MenuBarWindow( vcl::Window* pParent ) :
 m_nRolloveredItem = ITEMPOS_INVALID;
 mbAutoPopup = true;
 m_bIgnoreFirstMove = true;
-SetMBWHideAccel(true);
+SetMBWHideAccel(ImplGetSVData()->maNWFData.mbAutoAccel);
 SetMBWMenuKey(false);
 
 m_aCloseBtn->maImage = Image(StockImage::Yes, SV_RESID_BITMAP_CLOSEDOC);
@@ -422,7 +422,7 @@ void MenuBarWindow::MouseMove( const MouseEvent& rMEvt )
 if (m_nHighlightedItem != ITEMPOS_INVALID)
 {
 bool hide = GetMBWHideAccel();
-SetMBWHideAccel(true);
+SetMBWHideAccel(ImplGetSVData()->maNWFData.mbAutoAccel);
 Invalidate(); //HighlightItem( nRolloveredItem, false );
 SetMBWHideAccel(hide);
 }
@@ -466,7 +466,7 @@ void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, bool 
bSelectEntry, bool b
 return;
 
 if (n == ITEMPOS_INVALID)
-SetMBWHideAccel(true);
+SetMBWHideAccel(ImplGetSVData()->maNWFData.mbAutoAccel);
 
 // #57934# close active popup if applicable, as TH's background storage 
works.
 MenuItemData* pNextData = m_pMenu->pItemList->GetDataFromPos( n );
diff --git a/vcl/source/window/menufloatingwindow.cxx 
b/vcl/source/window/menufloatingwindow.cxx
index c46dcede0b53..16af78719e55 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -1182,7 +1182,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& 
rKEvent )
 if (pMenu && pMenu->pStartedFrom && pMenu->pStartedFrom->IsMenuBar())
 {
 MenuBar *pMenuBar = static_cast(pMenu->pStartedFrom.get());
-const bool bShowAccels = nCode != KEY_ESCAPE;
+const bool bShowAccels = !autoacc || nCode != KEY_ESCAPE;
 if (pMenuBar->getMenuBarWindow()->GetMBWMenuKey() != bShowAccels)
 {
 pMenuBar->getMenuBarWindow()->SetMBWMenuKey(bShowAccels);


core.git: vcl/source

2024-03-14 Thread Mike Kaganski (via logerrit)
 vcl/source/helper/threadex.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit ad161bf882099553949469f99759493c38169c8a
Author: Mike Kaganski 
AuthorDate: Thu Mar 14 23:03:55 2024 +0500
Commit: Mike Kaganski 
CommitDate: Thu Mar 14 21:56:46 2024 +0100

Make sure we hold the solar mutex before trying to release it

Might be not guarded by the solar mutex (and need not to!) e.g. when
an external script calls XDispatchHelper::executeDispatch, with stack
like this:

  vcllo.dll!vcl::SolarThreadExecutor::execute() Line 55 C++
  
fwklo.dll!vcl::solarthread::detail::GenericSolarThreadExecutor<`framework::DispatchHelper::executeDispatch'::`8'::,com::sun::star::uno::Any>::exec(const
 framework::DispatchHelper::executeDispatch::__l8:: & func) Line 63   
C++
  
fwklo.dll!vcl::solarthread::syncExecute<`framework::DispatchHelper::executeDispatch'::`8'::>(const
 framework::DispatchHelper::executeDispatch::__l8:: & func) Line 166  
  C++
  fwklo.dll!framework::DispatchHelper::executeDispatch(const 
com::sun::star::uno::Reference & 
xDispatchProvider, const rtl::OUString & sURL, const rtl::OUString & 
sTargetFrameName, long nSearchFlags, const 
com::sun::star::uno::Sequence & 
lArguments) Line 116  C++
  mscx_uno.dll!`anonymous 
namespace'::cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, 
bridges::cpp_uno::shared::VtableSlot aVtableSlot, 
_typelib_TypeDescriptionReference * pReturnTypeRef, long nParams, 
_typelib_MethodParameter * pParams, void * pUnoReturn, void * * pUnoArgs, 
_uno_Any * * ppUnoExc) Line 214   C++
  mscx_uno.dll!unoInterfaceProxyDispatch(_uno_Interface * pUnoI, const 
_typelib_TypeDescription * pMemberTD, void * pReturn, void * * pArgs, _uno_Any 
* * ppException) Line 430 C++
  
binaryurplo.dll!binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny 
* returnValue, 
std::vector> * 
outArguments) Line 239 C++
  binaryurplo.dll!binaryurp::IncomingRequest::execute() Line 79 C++
  binaryurplo.dll!request(void * pThreadSpecificData) Line 84   C++
  cppu3.dll!cppu_threadpool::JobQueue::enter(const void * nDisposeId, bool 
bReturnWhenNoJob) Line 101   C++
  cppu3.dll!cppu_threadpool::ORequestThread::run() Line 169 C++
  cppu3.dll!threadFunc(void * param) Line 190   C++
  sal3.dll!oslWorkerWrapperFunction(void * pData) Line 69   C++
  ucrtbased.dll!thread_start(void * 
const parameter) Line 97 C++
  kernel32.dll!BaseThreadInitThunk()Unknown
  ntdll.dll!RtlUserThreadStart()Unknown

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

diff --git a/vcl/source/helper/threadex.cxx b/vcl/source/helper/threadex.cxx
index cbd342bd28df..1590b91f1167 100644
--- a/vcl/source/helper/threadex.cxx
+++ b/vcl/source/helper/threadex.cxx
@@ -52,6 +52,7 @@ void SolarThreadExecutor::execute()
 m_aStart.reset();
 m_aFinish.reset();
 ImplSVEvent* nEvent = Application::PostUserEvent(LINK(this, 
SolarThreadExecutor, worker));
+SolarMutexGuard aGuard;
 SolarMutexReleaser aReleaser;
 if (m_aStart.wait() == osl::Condition::result_timeout)
 {


core.git: vcl/source

2024-03-13 Thread Mike Kaganski (via logerrit)
 vcl/source/app/svapp.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 3204c50563ed2aa1f667e1e7a8484ee899d7d62f
Author: Mike Kaganski 
AuthorDate: Wed Mar 13 18:51:10 2024 +0500
Commit: Mike Kaganski 
CommitDate: Wed Mar 13 18:07:45 2024 +0100

Assert in ProcessEventsToIdle, that idles are not delayed

As noted in 
https://gerrit.libreoffice.org/c/core/+/164753/9#message-88182774825ae8722961d099d643a6df6f4001a7:

> I think this needs an assert inside ProcessEventsToIdle if the guard 
count > 0.
> Otherwise we are going to get very hard to debug lock ups.

Change-Id: I2b8753da7a6ae1672ce5d8634771174d87fe376c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164781
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 5400dcf5780f..e0995e0793e2 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -420,6 +420,11 @@ bool Application::IsOnSystemEventLoop()
 
 void Scheduler::ProcessEventsToIdle()
 {
+#if OSL_DEBUG_LEVEL > 0
+const ImplSVData* pSVData = ImplGetSVData();
+if (pSVData->mpDefInst->IsMainThread())
+assert(pSVData->maSchedCtx.mnIdlesLockCount == 0);
+#endif
 int nSanity = 1;
 while (ImplYield(false, true))
 {
@@ -432,7 +437,6 @@ void Scheduler::ProcessEventsToIdle()
 // If we yield from a non-main thread we just can guarantee that all idle
 // events were processed at some point, but our check can't prevent further
 // processing in the main thread, which may add new events, so skip it.
-const ImplSVData* pSVData = ImplGetSVData();
 if ( !pSVData->mpDefInst->IsMainThread() )
 return;
 for (int nTaskPriority = 0; nTaskPriority < PRIO_COUNT; ++nTaskPriority)


core.git: vcl/source

2024-03-13 Thread Mike Kaganski (via logerrit)
 vcl/source/app/svmain.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit e1bcdbc6ee0899f3cb915c7a64a1c3b0d42ba977
Author: Mike Kaganski 
AuthorDate: Wed Mar 13 10:15:07 2024 +0500
Commit: Mike Kaganski 
CommitDate: Wed Mar 13 08:56:07 2024 +0100

Process pending events before ImplDeleteOnDeInit

The statics derived from DeleteOnDeinitBase are destroyed in the call
to ImplDeleteOnDeInit; and then they may be accessed, when a few lines
later, Scheduler::ImplDeInitScheduler is called, which itself calls
ProcessEventsToIdle. This change makes sure that the events, that may
potentially want to access these objects, are executed at a safe time.

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

diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 3aa2cecf4ec8..a93bda31bbc6 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -466,6 +466,9 @@ void DeInitVCL()
 pSVData->mpBlendFrameCache->m_aLastResult.Clear();
 pSVData->mbDeInit = true;
 
+// Some events may need to access objects destroyed in ImplDeleteOnDeInit, 
so process them first
+Scheduler::ProcessEventsToIdle();
+
 vcl::DeleteOnDeinitBase::ImplDeleteOnDeInit();
 
 #if OSL_DEBUG_LEVEL > 0


core.git: vcl/source

2024-03-07 Thread Patrick Luby (via logerrit)
 vcl/source/window/paint.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ff113b34dd6f54765995440cbedd27483fadb844
Author: Patrick Luby 
AuthorDate: Thu Mar 7 17:22:35 2024 -0500
Commit: Patrick Luby 
CommitDate: Fri Mar 8 00:57:20 2024 +0100

tdf#159996 use transparent alpha mask for output device

Since commit 81994cb2b8b32453a92bcb011830fcb884f22ff3, fixed text
needs to be drawn to an output device with a transparent alpha
mask.

Change-Id: I2036e8c6c9133b1caceb24aeca40f04524c16b23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164556
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 7cb1c969a983..5996b818d4bb 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1528,7 +1528,7 @@ void Window::ImplPaintToDevice( OutputDevice* 
i_pTargetOutDev, const Point& i_rP
 VclPtrInstance pMaskedDevice(*i_pTargetOutDev,
 DeviceFormat::WITH_ALPHA);
 
-pMaskedDevice->SetOutputSizePixel( GetOutputSizePixel() );
+pMaskedDevice->SetOutputSizePixel( GetOutputSizePixel(), true, true );
 pMaskedDevice->EnableRTL( IsRTLEnabled() );
 aMtf.WindStart();
 aMtf.Play(*pMaskedDevice);


core.git: vcl/source

2024-03-06 Thread Noel Grandin (via logerrit)
 vcl/source/gdi/pdfwriter_impl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit aad40b222cc646749cf7bb67e8d45a2d77018eb8
Author: Noel Grandin 
AuthorDate: Wed Mar 6 22:30:16 2024 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 7 06:51:57 2024 +0100

fix use-after-free in PDFWriterImpl::appendUnicodeTextStringEncrypt

where if the resize triggers a copy, the pCopy pointer is now
pointing to a block of memory that has been freed.

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

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 123a5fcbfcd2..bb444b32cf3d 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -1526,9 +1526,9 @@ inline void 
PDFWriterImpl::appendUnicodeTextStringEncrypt( const OUString& rInSt
 sal_Int32 nLen = rInString.getLength();
 //prepare a unicode string, encrypt it
 enableStringEncryption( nInObjectNumber );
-sal_uInt8 *pCopy = m_vEncryptionBuffer.data();
 sal_Int32 nChars = 2 + (nLen * 2);
 m_vEncryptionBuffer.resize(nChars);
+sal_uInt8 *pCopy = m_vEncryptionBuffer.data();
 *pCopy++ = 0xFE;
 *pCopy++ = 0xFF;
 // we need to prepare a byte stream from the unicode string buffer


core.git: vcl/source

2024-03-01 Thread Mike Kaganski (via logerrit)
 vcl/source/text/mnemonic.cxx |   23 ++-
 1 file changed, 6 insertions(+), 17 deletions(-)

New commits:
commit cde2bf606960b7bf0945b394a70e0e5c1a947ec0
Author: Mike Kaganski 
AuthorDate: Fri Mar 1 14:46:21 2024 +0600
Commit: Mike Kaganski 
CommitDate: Sat Mar 2 04:39:06 2024 +0100

Simplify removeMnemonicFromString

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

diff --git a/vcl/source/text/mnemonic.cxx b/vcl/source/text/mnemonic.cxx
index 7336032b8d12..9a63c2e7d785 100644
--- a/vcl/source/text/mnemonic.cxx
+++ b/vcl/source/text/mnemonic.cxx
@@ -18,33 +18,22 @@ OUString removeMnemonicFromString(OUString const& rStr)
 OUString removeMnemonicFromString(OUString const& rStr, sal_Int32& 
rMnemonicPos)
 {
 OUString aStr = rStr;
-sal_Int32 nLen = aStr.getLength();
-sal_Int32 i = 0;
+sal_Int32 nLen = aStr.getLength() - 1; // Don't remove trailing ~
 
 rMnemonicPos = -1;
-while (i < nLen)
+for (sal_Int32 i = 0; i < nLen; ++i)
 {
 if (aStr[i] == '~')
 {
-if (nLen <= i + 1)
-break;
-
-if (aStr[i + 1] != '~')
+aStr = aStr.replaceAt(i, 1, u"");
+nLen--;
+if (aStr[i] != '~')
 {
 if (rMnemonicPos == -1)
 rMnemonicPos = i;
-aStr = aStr.replaceAt(i, 1, u"");
-nLen--;
-}
-else
-{
-aStr = aStr.replaceAt(i, 1, u"");
-nLen--;
-i++;
 }
+// else skip the escaped second ~
 }
-else
-i++;
 }
 
 return aStr;


core.git: vcl/source

2024-03-01 Thread Mike Kaganski (via logerrit)
 vcl/source/gdi/pdfwriter_impl.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit f85d6a0edd509100af0c5f6b9249bcd0507be301
Author: Mike Kaganski 
AuthorDate: Fri Mar 1 10:36:38 2024 +0100
Commit: Mike Kaganski 
CommitDate: Sat Mar 2 04:38:43 2024 +0100

Drop unused variable

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

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 321f628cbf7a..123a5fcbfcd2 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -7247,11 +7247,10 @@ void PDFWriterImpl::drawText( const tools::Rectangle& 
rRect, const OUString& rOr
 Point   aPos= rRect.TopLeft();
 
 tools::LongnTextHeight = GetTextHeight();
-sal_Int32   nMnemonicPos= -1;
 
 OUString aStr = rOrigStr;
 if ( nStyle & DrawTextFlags::Mnemonic )
-aStr = removeMnemonicFromString( aStr, nMnemonicPos );
+aStr = removeMnemonicFromString(aStr);
 
 // multiline text
 if ( nStyle & DrawTextFlags::MultiLine )


core.git: vcl/source

2024-02-29 Thread Stephan Bergmann (via logerrit)
 vcl/source/gdi/print.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit acce5d17ac7f5d8c92e5f75a5757ac449692e2fa
Author: Stephan Bergmann 
AuthorDate: Thu Feb 29 08:10:40 2024 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Feb 29 10:03:27 2024 +0100

Read of uninitialized Printer::mbResetPrintArea

...introduced in 364f0bb1cac0e12f5f926857f61c2f329a353ec7 "tdf#155218 sc: 
fix
regression page orientation in print dialog", causing UITest_calc_dialogs to
fail with

> /include/vcl/print.hxx:227:61: runtime error: load of value 190, which is 
not a valid value for type 'bool'
> #0 0x7f1337c5ec9e in Printer::IsPrintAreaReset() 
/include/vcl/print.hxx:227:61
> #1 0x7f1337bd64be in 
ScModelObj::getRendererCount(com::sun::star::uno::Any const&, 
com::sun::star::uno::Sequence const&) 
/sc/source/ui/unoobj/docuno.cxx:1856:41
> #2 0x7f13ca466d5f in SfxPrinterController::getPageCount() const 
/sfx2/source/view/viewprn.cxx:228:36
> #3 0x7f13a130580e in 
Printer::PreparePrintJob(std::shared_ptr, JobSetup 
const&) /vcl/source/gdi/print3.cxx:420:53
> #4 0x7f13a13027e3 in 
Printer::ImplPrintJob(std::shared_ptr const&, JobSetup 
const&) /vcl/source/gdi/print3.cxx:575:9
> #5 0x7f13a134cdc8 in (anonymous 
namespace)::PrintJobAsync::ExecJob(void*) /vcl/source/gdi/print3.cxx:318:5
> #6 0x7f13a1302b28 in (anonymous 
namespace)::PrintJobAsync::LinkStubExecJob(void*, void*) 
/vcl/source/gdi/print3.cxx:316:1
> #7 0x7f139f592d0d in Link::Call(void*) const 
/include/tools/link.hxx:111:45
> #8 0x7f139f579a00 in ImplHandleUserEvent(ImplSVEvent*) 
/vcl/source/window/winproc.cxx:2287:30
> #9 0x7f139f5646c0 in ImplWindowFrameProc(vcl::Window*, SalEvent, void 
const*) /vcl/source/window/winproc.cxx:2851:13
> #10 0x7f13a3273a82 in SalFrame::CallCallback(SalEvent, void const*) 
const /vcl/inc/salframe.hxx:310:29
> #11 0x7f13a3320ea1 in 
SvpSalInstance::ProcessEvent(SalUserEventList::SalUserEvent) 
/vcl/headless/svpinst.cxx:266:22
> #12 0x7f13a3321632 in non-virtual thunk to 
SvpSalInstance::ProcessEvent(SalUserEventList::SalUserEvent) 
/vcl/headless/svpinst.cxx
> #13 0x7f13a1b7e593 in 
SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const 
/vcl/source/app/salusereventlist.cxx:119:58
> #14 0x7f13a1b7dd25 in SalUserEventList::DispatchUserEvents(bool) 
/vcl/source/app/salusereventlist.cxx:120:13
> #15 0x7f13a3325345 in SvpSalInstance::ImplYield(bool, bool) 
/vcl/headless/svpinst.cxx:395:22
> #16 0x7f13a3327b4e in SvpSalInstance::DoYield(bool, bool) 
/vcl/headless/svpinst.cxx:471:21
> #17 0x7f13a2012c4a in ImplYield(bool, bool) 
/vcl/source/app/svapp.cxx:390:48
> #18 0x7f13a20112b8 in Application::Yield() 
/vcl/source/app/svapp.cxx:474:5
> #19 0x7f13a2010b57 in Application::Execute() 
/vcl/source/app/svapp.cxx:368:13
> #20 0x7f13e355d421 in desktop::Desktop::Main() 
/desktop/source/app/app.cxx:1614:13
> #21 0x7f13a20b6ae2 in ImplSVMain() /vcl/source/app/svmain.cxx:229:35
> #22 0x7f13a20bfd20 in SVMain() /vcl/source/app/svmain.cxx:261:12
> #23 0x7f13e376dc40 in soffice_main 
/desktop/source/app/sofficemain.cxx:94:12
> #24 0x4fda3c in sal_main /desktop/source/app/main.c:51:15

()

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

diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 3697e51c338d..42013175e131 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -450,6 +450,7 @@ void Printer::ImplInitData()
 mbNewJobSetup   = false;
 mbSinglePrintJobs   = false;
 mbUsePrintSetting   = false;
+mbResetPrintArea= false;
 mpInfoPrinter   = nullptr;
 mpPrinter   = nullptr;
 mpDisplayDev= nullptr;


core.git: vcl/source

2024-02-28 Thread Noel Grandin (via logerrit)
 vcl/source/window/builder.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 08d265144421deed247c23af36b0a6d41c35bf1f
Author: Noel Grandin 
AuthorDate: Wed Feb 28 16:41:04 2024 +0200
Commit: Noel Grandin 
CommitDate: Thu Feb 29 07:38:25 2024 +0100

assert on failure to load .ui file

otherwise I get hard to diagnose SIGSEGV further on in other code

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

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 7c77fad75a53..de5c5ea1bbce 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -476,8 +476,9 @@ VclBuilder::VclBuilder(vcl::Window* pParent, const 
OUString& sUIDir, const OUStr
 }
 catch (const css::uno::Exception )
 {
-DBG_UNHANDLED_EXCEPTION("vcl.builder", "Unable to read .ui file");
+TOOLS_WARN_EXCEPTION("vcl.builder", "Unable to read .ui file " << 
sUIDir << sUIFile);
 CrashReporter::addKeyValue("VclBuilderException", "Unable to read .ui 
file: " + rExcept.Message, CrashReporter::Write);
+assert(false && "missing ui file or missing 
gb_CppunitTest_use_uiconfigs dependency");
 throw;
 }
 


core.git: vcl/source

2024-02-23 Thread Jim Raykowski (via logerrit)
 vcl/source/window/toolbox.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 45e3abcb79fb1ccf7d813a7b080a8ad70bdcb5b1
Author: Jim Raykowski 
AuthorDate: Thu Feb 22 22:47:10 2024 -0900
Commit: Jim Raykowski 
CommitDate: Fri Feb 23 17:56:13 2024 +0100

tdf#159837 Make keyboard shortcuts work when focus is in toolbar

for SalInstanceBuilder based VCL backends

Change-Id: I36764e7199a0f7292b331da3d187fbe939b4becc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163800
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index fc9effe58065..272263072a36 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4435,7 +4435,9 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt )
 // do nothing to avoid key presses going into the document
 // while the toolbox has the focus
 // just forward function and special keys and combinations 
with Alt-key
-if( aKeyGroup == KEYGROUP_FKEYS || aKeyGroup == KEYGROUP_MISC 
|| aKeyCode.IsMod2() )
+// and Ctrl-key
+if( aKeyGroup == KEYGROUP_FKEYS || aKeyGroup == KEYGROUP_MISC 
|| aKeyCode.IsMod2()
+|| aKeyCode.IsMod1() )
 bForwardKey = true;
 }
 }


core.git: vcl/source

2024-02-18 Thread Noel Grandin (via logerrit)
 vcl/source/bitmap/bitmappaint.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit d367142731f09c7be03ce1707e3aeab3c55b4f21
Author: Noel Grandin 
AuthorDate: Sun Feb 18 16:12:52 2024 +0200
Commit: Noel Grandin 
CommitDate: Sun Feb 18 17:02:49 2024 +0100

restore comment I removed in

bb3157e38bfffd23505abc35f790043392f43d2c

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

diff --git a/vcl/source/bitmap/bitmappaint.cxx 
b/vcl/source/bitmap/bitmappaint.cxx
index bbf3239905f6..8cf32d3cde6f 100644
--- a/vcl/source/bitmap/bitmappaint.cxx
+++ b/vcl/source/bitmap/bitmappaint.cxx
@@ -86,6 +86,9 @@ bool Bitmap::Invert()
 
 if (pWriteAcc->GetPalette().IsGreyPalette8Bit())
 {
+// For alpha masks, we need to actually invert the underlying data
+// or the optimisations elsewhere do not always work right. If 
this is a bottleneck,
+// probably better to try improving it inside the 
mxSalBmp->Invert() call above.
 for (tools::Long nY = 0; nY < nHeight; nY++)
 {
 Scanline pScanline = pWriteAcc->GetScanline(nY);


core.git: vcl/source

2024-02-18 Thread Michael Weghorn (via logerrit)
 vcl/source/window/builder.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 6a4b9bf503204b5770ad314eae0bfed18c5d84c7
Author: Michael Weghorn 
AuthorDate: Sat Feb 17 23:42:55 2024 +0100
Commit: Michael Weghorn 
CommitDate: Sun Feb 18 10:28:58 2024 +0100

tdf#130857 VclBuilder: Use VclPtr instead of raw vcl::Window*

`VclBuilder::handleObject` returns a `VclPtr`.
Use the same for the local variable `pCurrentChild` that the
return value of the former is assigned to.

There's no reason to use a raw pointer here and explicitly calling
`VclPtr::get()` also makes it harder to reuse/share
the existing code for an upcoming `QtBuilder`, s. Omkar's comment
in his pending Gerrit change [1].

While at it, also move the declaration of `pCurrentChild` closer
to its first use.

[1] 
https://gerrit.libreoffice.org/c/core/+/163103/comments/f37a6add_b0f00eb1

Change-Id: I30520d5d18453c78150b2b0c9af044e043a1c74f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163528
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index ff20cd07be2b..28d789f64b8f 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -2799,8 +2799,6 @@ void VclBuilder::tweakInsertedChild(vcl::Window *pParent, 
vcl::Window* pCurrentC
 
 void VclBuilder::handleChild(vcl::Window *pParent, stringmap* pAtkProps, 
xmlreader::XmlReader )
 {
-vcl::Window *pCurrentChild = nullptr;
-
 xmlreader::Span name;
 int nsId;
 OString sType, sInternalChild;
@@ -2825,6 +2823,7 @@ void VclBuilder::handleChild(vcl::Window *pParent, 
stringmap* pAtkProps, xmlread
 return;
 }
 
+VclPtr pCurrentChild;
 int nLevel = 1;
 while(true)
 {
@@ -2835,7 +2834,7 @@ void VclBuilder::handleChild(vcl::Window *pParent, 
stringmap* pAtkProps, xmlread
 {
 if (name == "object" || name == "placeholder")
 {
-pCurrentChild = handleObject(pParent, pAtkProps, reader).get();
+pCurrentChild = handleObject(pParent, pAtkProps, reader);
 
 bool bObjectInserted = pCurrentChild && pParent != 
pCurrentChild;
 if (bObjectInserted)


core.git: vcl/source

2024-02-15 Thread Caolán McNamara (via logerrit)
 vcl/source/filter/wmf/wmfwr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 546a8d72cf64d6eb8a2bfe5adb3c31ea07afad8f
Author: Caolán McNamara 
AuthorDate: Wed Feb 14 21:55:14 2024 +
Commit: Caolán McNamara 
CommitDate: Thu Feb 15 18:07:29 2024 +0100

GetExtendedTextEncoding for RTL_TEXTENCODING_MS_1252 just returns same

i.e. GetExtendedTextEncoding calls GetExtendedCompatibilityTextEncoding
if the arg is RTL_TEXTENCODING_MS_1252 and that just return its input
for this case.

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

diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx
index 13a9406a377b..3e3267c8e647 100644
--- a/vcl/source/filter/wmf/wmfwr.cxx
+++ b/vcl/source/filter/wmf/wmfwr.cxx
@@ -1766,7 +1766,7 @@ bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, 
SvStream& rTargetStream,
 aDstClipRegion = aSrcClipRegion = vcl::Region();
 
 vcl::Font aFont;
-aFont.SetCharSet( GetExtendedTextEncoding( RTL_TEXTENCODING_MS_1252 ) );
+aFont.SetCharSet(RTL_TEXTENCODING_MS_1252);
 aFont.SetColor( COL_WHITE );
 aFont.SetAlignment( ALIGN_BASELINE );
 aDstFont = aSrcFont = aFont;


core.git: vcl/source

2024-02-12 Thread Mike Kaganski (via logerrit)
 vcl/source/gdi/pdfwriter_impl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5121c1f8a3dc1e326a4195393f463f5c0383859b
Author: Mike Kaganski 
AuthorDate: Mon Feb 12 12:50:05 2024 +0100
Commit: Mike Kaganski 
CommitDate: Tue Feb 13 05:09:43 2024 +0100

tdf#159689: trailing newline before "endstream" must not count in Length

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

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 11a62a156bb0..321f628cbf7a 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2775,7 +2775,7 @@ bool PDFWriterImpl::emitType3Font(const 
vcl::font::PhysicalFontFace* pFace,
 aLine.setLength(0);
 aLine.append(OString::number(nStream)
 + " 0 obj
<>
stream
");
 if (!writeBuffer(aLine))
 return false;


core.git: vcl/source

2024-02-11 Thread Caolán McNamara (via logerrit)
 vcl/source/gdi/impglyphitem.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3d3242ef3a6f111d6220c60d5c1b968c7f46fc5f
Author: Caolán McNamara 
AuthorDate: Sun Feb 11 21:11:50 2024 +
Commit: Caolán McNamara 
CommitDate: Sun Feb 11 22:34:48 2024 +0100

ofz#66222 Timeout, raise glyph cache size for fuzzing

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

diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index d888d823494c..301b2b9db824 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -236,7 +236,7 @@ SalLayoutGlyphsCache* SalLayoutGlyphsCache::self()
 {
 static vcl::DeleteOnDeinit cache(
 !comphelper::IsFuzzing() ? 
officecfg::Office::Common::Cache::Font::GlyphsCacheSize::get()
- : 2);
+ : 2000);
 return cache.get();
 }
 


core.git: vcl/source

2024-02-11 Thread Tibor Nagy (via logerrit)
 vcl/source/gdi/print3.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 5ccee13baa29c9899c88519ad71ed18c3fe944c1
Author: Tibor Nagy 
AuthorDate: Sun Feb 11 16:25:48 2024 +0100
Commit: Nagy Tibor 
CommitDate: Sun Feb 11 18:52:48 2024 +0100

tdf#155218 sc: fix incorrect print area

In the print dialog, changes to the page orientation should not alter
the print area that is defined by the page style.

issue caused by commit I5e494a0714e398221bee00744d7e25c419a41df7
(tdf#155218 sc: fix different page orientation in print dialog)

Change-Id: I44eb3b30df0e8a227743df334da35316f86a0679
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163231
Tested-by: Jenkins
Reviewed-by: Nagy Tibor 

diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index dde3d8368116..a43bc41599cd 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -514,6 +514,7 @@ bool 
Printer::PreparePrintJob(std::shared_ptr xController,
 PrintDialog aDlg(xController->getWindow(), xController);
 if (!aDlg.run())
 {
+xController->getPrinter()->SetUsePrintDialogSetting(false);
 xController->abortJob();
 return false;
 }


core.git: vcl/source

2024-02-10 Thread Mike Kaganski (via logerrit)
 vcl/source/window/menu.cxx  |7 ---
 vcl/source/window/menubarwindow.cxx |   14 ++
 2 files changed, 2 insertions(+), 19 deletions(-)

New commits:
commit 7d594687216f183a681ecfe7e1d424d8a55422c2
Author: Mike Kaganski 
AuthorDate: Sat Feb 10 23:30:02 2024 +0600
Commit: Mike Kaganski 
CommitDate: Sun Feb 11 01:43:04 2024 +0100

tdf#54169: do not hide mnemonics in menu, when navigating using mouse

Pressing Alt (or F10) by itself would activate/highlight the menu, and
show mnemonics. But clicking such activated menu used to disable the
mnemonics. This change fixes it, making sure that they keep displaying
until closing the menu.

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

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index b72f2f8c8091..eb08c4de9848 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2861,13 +2861,6 @@ bool PopupMenu::PrepareRun(const VclPtr& 
pParentWin, tools::Rectang
 if (!pSFrom && (vcl::IsInPopupMenuExecute() || !nItemCount))
 return false;
 
-// set the flag to hide or show accelerators in the menu depending on 
whether the menu was launched by mouse or keyboard shortcut
-if( pSFrom && pSFrom->IsMenuBar())
-{
-auto pMenuBarWindow = 
static_cast(pSFrom->pWindow.get());
-pMenuBarWindow->SetMBWHideAccel( !(pMenuBarWindow->GetMBWMenuKey()) );
-}
-
 mpLayoutData.reset();
 
 ImplSVData* pSVData = ImplGetSVData();
diff --git a/vcl/source/window/menubarwindow.cxx 
b/vcl/source/window/menubarwindow.cxx
index 4198c5a824c3..9fb3552ed17a 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -465,7 +465,8 @@ void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, bool 
bSelectEntry, bool b
 if( ! m_pMenu )
 return;
 
-SetMBWHideAccel(n == ITEMPOS_INVALID);
+if (n == ITEMPOS_INVALID)
+SetMBWHideAccel(true);
 
 // #57934# close active popup if applicable, as TH's background storage 
works.
 MenuItemData* pNextData = m_pMenu->pItemList->GetDataFromPos( n );
@@ -850,8 +851,6 @@ bool MenuBarWindow::HandleKeyEvent( const KeyEvent& 
rKEvent, bool bFromMenu )
 }
 }
 
-bool autoacc = ImplGetSVData()->maNWFData.mbAutoAccel;
-
 if ( !bDone && ( bFromMenu || rKEvent.GetKeyCode().IsMod2() ) )
 {
 sal_Unicode nCharCode = rKEvent.GetCharCode();
@@ -868,15 +867,6 @@ bool MenuBarWindow::HandleKeyEvent( const KeyEvent& 
rKEvent, bool bFromMenu )
 }
 }
 
-const bool bShowAccels = nCode != KEY_ESCAPE;
-if (GetMBWMenuKey() != bShowAccels)
-{
-SetMBWMenuKey(bShowAccels);
-SetMBWHideAccel(!bShowAccels);
-if (autoacc)
-Invalidate(InvalidateFlags::Update);
-}
-
 return bDone;
 }
 


core.git: vcl/source

2024-02-10 Thread Caolán McNamara (via logerrit)
 vcl/source/window/printdlg.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit edab3a9fd243c238f840db84af31c39c3617eb8c
Author: Caolán McNamara 
AuthorDate: Sat Feb 10 16:48:43 2024 +
Commit: Caolán McNamara 
CommitDate: Sat Feb 10 20:19:46 2024 +0100

cid#1591787 silence Arguments in wrong order

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

diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 66cadb91d18a..5b80ca57fa69 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -1033,6 +1033,7 @@ void PrintDialog::updatePageSize(int nOrientation)
 if ((nOrientation == ORIENTATION_PORTRAIT && aSize.Width() > 
aSize.Height())
 || (nOrientation == ORIENTATION_LANDSCAPE && aSize.Width() < 
aSize.Height()))
 {
+// coverity[swapped_arguments : FALSE] - this is in the intended 
order
 aSize = Size(aSize.Height(), aSize.Width());
 }
 }


core.git: vcl/source

2024-02-09 Thread Caolán McNamara (via logerrit)
 vcl/source/bitmap/bitmappaint.cxx |   16 
 1 file changed, 4 insertions(+), 12 deletions(-)

New commits:
commit 112dd7edb69a0262d829fb071df1bc5d402aab50
Author: Caolán McNamara 
AuthorDate: Fri Feb 9 11:34:55 2024 +
Commit: Caolán McNamara 
CommitDate: Fri Feb 9 14:45:03 2024 +0100

ofz#66573 directly invert the colors in the palette

instead of looping over each pixel.

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

diff --git a/vcl/source/bitmap/bitmappaint.cxx 
b/vcl/source/bitmap/bitmappaint.cxx
index cc3674ad3123..bbf3239905f6 100644
--- a/vcl/source/bitmap/bitmappaint.cxx
+++ b/vcl/source/bitmap/bitmappaint.cxx
@@ -83,7 +83,6 @@ bool Bitmap::Invert()
 if (pWriteAcc->HasPalette())
 {
 const sal_uInt16 nActColors = pWriteAcc->GetPaletteEntryCount();
-const sal_uInt16 nMaxColors = 1 << pWriteAcc->GetBitCount();
 
 if (pWriteAcc->GetPalette().IsGreyPalette8Bit())
 {
@@ -100,18 +99,11 @@ bool Bitmap::Invert()
 }
 else
 {
-for (tools::Long nY = 0; nY < nHeight; nY++)
+for (sal_uInt16 i = 0; i < nActColors; ++i)
 {
-Scanline pScanline = pWriteAcc->GetScanline(nY);
-for (tools::Long nX = 0; nX < nWidth; nX++)
-{
-BitmapColor aBmpColor = 
pWriteAcc->GetPixelFromData(pScanline, nX);
-aBmpColor = 
pWriteAcc->GetPaletteColor(aBmpColor.GetIndex());
-aBmpColor.Invert();
-BitmapColor aReplace = UpdatePaletteForNewColor(
-pWriteAcc, nActColors, nMaxColors, nHeight, nWidth, 
aBmpColor);
-pWriteAcc->SetPixelOnData(pScanline, nX, aReplace);
-}
+BitmapColor aBmpColor = pWriteAcc->GetPaletteColor(i);
+aBmpColor.Invert();
+pWriteAcc->SetPaletteColor(i, aBmpColor);
 }
 }
 }


core.git: vcl/source

2024-02-09 Thread Noel Grandin (via logerrit)
 vcl/source/treelist/svimpbox.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 30fb8cde7579fb5da15c1d8da9611198f2f5ce78
Author: Noel Grandin 
AuthorDate: Fri Feb 9 10:55:18 2024 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 9 11:04:30 2024 +0100

tdf#159641 TreeView repaint problem with PgUp in kf5/gen

regression from
commit be53f32655973c7a18824d5145eed992be788d2f
Author: Noel Grandin 
Date:   Thu Mar 12 13:55:55 2020 +0200
rename vcl::Window::Update to PaintImmediately

Change-Id: I74fc87e984e1f085d2351cbae033e51920608e3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163154
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx
index 0deea8f69820..66c697e8afd8 100644
--- a/vcl/source/treelist/svimpbox.cxx
+++ b/vcl/source/treelist/svimpbox.cxx
@@ -387,6 +387,7 @@ void SvImpLBox::PageDown( sal_uInt16 nDelta )
 ShowCursor( false );
 
 m_nFlags &= ~LBoxFlags::Filling;
+m_pView->PaintImmediately();
 m_pStartEntry = pNext;
 
 if( nRealDelta >= m_nVisibleCount )
@@ -424,6 +425,7 @@ void SvImpLBox::PageUp( sal_uInt16 nDelta )
 m_nFlags &= ~LBoxFlags::Filling;
 ShowCursor( false );
 
+m_pView->PaintImmediately();
 m_pStartEntry = pPrev;
 if( nRealDelta >= m_nVisibleCount )
 {


core.git: vcl/source

2024-01-31 Thread Caolán McNamara (via logerrit)
 vcl/source/app/svapp.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit dcbcc12b9f9db99ba18811c7249917916748e2a7
Author: Caolán McNamara 
AuthorDate: Wed Jan 31 09:25:57 2024 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 31 16:29:56 2024 +0100

lo_dumpState doesn't take the SolarMutex, so dbgutil state dumping can 
assert

so disable the SolarMutex checks during dumpState and restore afterwards

#8  0x7fa179e287f3 in abort () at 
/lib/x86_64-linux-gnu/libc.so.6
#9  0x7fa179e2871b in  () at /lib/x86_64-linux-gnu/libc.so.6
#10 0x7fa179e39e96 in  () at /lib/x86_64-linux-gnu/libc.so.6
#11 0x7fa1706904de in ImplDbgTestSolarMutex() () at 
libreoffice/vcl/source/app/dbggui.cxx:35
__PRETTY_FUNCTION__ = "void ImplDbgTestSolarMutex()"
#12 0x7fa1782cb713 in DbgTestSolarMutex() () at 
libreoffice/tools/source/debug/debug.cxx:54
#13 0x7fa170559ebb in VirtualDevice::AcquireGraphics() const 
(this=0x5589006636b0) at libreoffice/vcl/source/gdi/virdev.cxx:49
pSVData = 0x7fff8a2386d0
#14 0x7fa17020d849 in OutputDevice::DrawRect(tools::Rectangle 
const&) (this=0x5589006636b0, rRect=...) at 
libreoffice/vcl/source/outdev/rect.cxx:67
__PRETTY_FUNCTION__ = "void OutputDevice::DrawRect(const 
tools::Rectangle&)"
aRect = {static RECT_EMPTY = -32767, mnLeft = 0, mnTop = 0, 
mnRight = 10244, mnBottom = 269}
#15 0x7fa17021d997 in OutputDevice::DrawColorWallpaper(long, 
long, long, long, Wallpaper const&) (this=0x5589006636b0, nX=0, nY=0, 
nWidth=10245, nHeight=270, rWallpaper=...) at 
libreoffice/vcl/source/outdev/wallpaper.cxx:90
__PRETTY_FUNCTION__ = "void 
OutputDevice::DrawColorWallpaper(tools::Long, tools::Long, tools::Long, 
tools::Long, const Wallpaper&)"
aOldLineColor = {{mValue = 0, {B = 0 '
aOldFillColor = {{mValue = 16777215, {B = 255 '�', G = 255 
'�', R = 255 '�', T = 0 '
bMap = false
#16 0x7fa17021d851 in OutputDevice::DrawWallpaper(long, long, 
long, long, Wallpaper const&) (this=0x5589006636b0, nX=0, nY=0, nWidth=10245, 
nHeight=270, rWallpaper=...) at libreoffice/vcl/source/outdev/wallpaper.cxx:73
__PRETTY_FUNCTION__ = "void 
OutputDevice::DrawWallpaper(tools::Long, tools::Long, tools::Long, tools::Long, 
const Wallpaper&)"
#17 0x7fa17021daa8 in OutputDevice::Erase() 
(this=0x5589006636b0) at libreoffice/vcl/source/outdev/wallpaper.cxx:106
eRasterOp = RasterOp::OverPaint
#18 0x7fa17055c716 in 
VirtualDevice::InnerImplSetOutputSizePixel(Size const&, bool, unsigned char*) 
(this=0x5589006636b0, rNewSize=..., bErase=true, pBuffer=0x0) at 
libreoffice/vcl/source/gdi/virdev.cxx:292
bRet = true
nNewWidth = 10245
nNewHeight = 270
__PRETTY_FUNCTION__ = "bool 
VirtualDevice::InnerImplSetOutputSizePixel(const Size&, bool, sal_uInt8*)"
#19 0x7fa17055cbf5 in 
VirtualDevice::ImplSetOutputSizePixel(Size const&, bool, unsigned char*) 
(this=0x5589006636b0, rNewSize=..., bErase=true, pBuffer=0x0) at 
libreoffice/vcl/source/gdi/virdev.cxx:360
#20 0x7fa17055ceba in VirtualDevice::SetOutputSizePixel(Size 
const&, bool) (this=0x5589006636b0, rNewSize=..., bErase=true) at 
libreoffice/vcl/source/gdi/virdev.cxx:408
#21 0x7fa16fea3ca4 in VirtualDevice::SetOutputSize(Size const&) 
(this=0x5589006636b0, rNewSize=...) at libreoffice/include/vcl/virdev.hxx:163
#22 0x7fa16fe96388 in 
VclDrawingArea::DumpAsPropertyTree(tools::JsonWriter&) (this=0x5588fe9ba320, 
rJsonWriter=...) at libreoffice/vcl/source/window/layout.cxx:3092
pDevice = {> = 
{> = {m_rInnerRef = {m_pBody = 0x5589006636b0}}, }, }
pRefDevice = 0x5588ff474fd0
aRenderSize = { = {mnA = 10245, mnB = 270}, }
aOutputSize = { = {mnA = 683, mnB = 18}, }
aRect = {static RECT_EMPTY = -32767, mnLeft = 
140735510973440, mnTop = 140331342376707, mnRight = 140735510973456, mnBottom = 
94046886702440}
aImage = {maBitmap = {_vptr.Bitmap = 0x7fff8a238c20, 
mxSalBmp = std::shared_ptr (empty) = {get() = 0x7fa16fd029cc 
 >::_M_ptr() 
const+28>}, maPrefMapMode = {mpImplMapMode = {m_pimpl = 0x7fff8a238d60}}, 
maPrefSize = { = {mnA = 94046793857224, mnB = 140331516265348}, }}, maAlphaMask = {_vptr.Bitmap = 0x0, mxSalBmp = std::shared_ptr (use count 1875914999, weak count 32672) = {get() = 0x5588ff46fa98}, 
maPrefMapMode = {mpImplMapMode = {m_pimpl = 0x7fa16fd030f7 
 
>::_M_head(std::_Tuple_impl<0ul, WindowImpl*, std::default_delete > 
const&)+28>}}, maPrefSize = { = {mnA = 94046793857224, mnB = 
94046886754968}, }}, 

core.git: vcl/source

2024-01-30 Thread Méven Car (via logerrit)
 vcl/source/control/fmtfield.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit e785ee257a44bd406909ef012bddde29a1fe3f0d
Author: Méven Car 
AuthorDate: Fri Jan 26 11:46:27 2024 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jan 30 10:52:35 2024 +0100

LOK: exposed time formatted field as time fields

Change-Id: Idf7613b9141c55372e19199b5641719ba42e43ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162598
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 2de4572fdff7364c98fd7c9440c4cf132206031d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162713
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/control/fmtfield.cxx b/vcl/source/control/fmtfield.cxx
index fc7bdfee6f58..e8b02a29c111 100644
--- a/vcl/source/control/fmtfield.cxx
+++ b/vcl/source/control/fmtfield.cxx
@@ -27,10 +27,12 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1352,6 +1354,12 @@ void 
FormattedField::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
 {
 SpinField::DumpAsPropertyTree(rJsonWriter);
 Formatter& rFormatter = GetFormatter();
+
+if (dynamic_cast())
+{
+// weld::TimeFormatter uses h24 format
+rJsonWriter.put("type", "time");
+}
 rJsonWriter.put("min", rFormatter.GetMinValue());
 rJsonWriter.put("max", rFormatter.GetMaxValue());
 rJsonWriter.put("value", rFormatter.GetValue());


core.git: vcl/source

2024-01-29 Thread Andrea Gelmini (via logerrit)
 vcl/source/window/dialog.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4f09826f731d5ecfc1ed094e2f9e720071b1e58d
Author: Andrea Gelmini 
AuthorDate: Mon Jan 29 17:17:41 2024 +0100
Commit: Taichi Haradaguchi <20001...@ymail.ne.jp>
CommitDate: Tue Jan 30 00:41:48 2024 +0100

Fix typo

Change-Id: I9f090d5b38e039b8c3fbb8e5a66190d686a8dccb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162702
Tested-by: Jenkins
Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp>

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index f395dd307411..b60a96e06440 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1184,7 +1184,7 @@ void Dialog::EndDialog( tools::Long nResult )
 {
 // We have a special case with async-dialogs that re-execute 
themselves.
 // In order to prevent overwriting state we need here, we need to 
extract
-// all the state we need before before calling maEndDialogFn, because
+// all the state we need before calling maEndDialogFn, because
 // maEndDialogFn might itself call StartExecuteAsync and store new 
state.
 std::shared_ptr xOwnerDialogController = 
std::move(mpDialogImpl->maEndCtx.mxOwnerDialogController);
 std::shared_ptr xOwnerSelf = 
std::move(mpDialogImpl->maEndCtx.mxOwnerSelf);


core.git: vcl/source

2024-01-23 Thread Sarper Akdemir (via logerrit)
 vcl/source/pdf/XmpMetadata.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 3a20c691ab1d6a16ad0fc144926b22c098552be4
Author: Sarper Akdemir 
AuthorDate: Mon Jan 22 18:24:41 2024 +0300
Commit: Sarper Akdemir 
CommitDate: Tue Jan 23 13:45:27 2024 +0100

tdf#138792: PDF export: export metadata dc:date

Dublin Core attribute dc:date wasn't exported so far in the
current implementation. Looking at the information pointed
by http://purl.org/dc/elements/1.1/date, dc:date is a
vaguely defined field.

Now creation date is exported there, as I've came across
the note of "Typically, Date will be associated with the
creation or availability of the resource" in the resource
linked below.

https://www.dublincore.org/specifications/dublin-core/dcmi-terms/2005-06-13/#:~:text=Typically%2C%20Date%20will%20be%20associated%20with%20the%20creation%20or%20availability%20of%20the%20resource

Change-Id: I0b5f37058f64e3d6d08cb46045a27ccde54ee434
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162404
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/vcl/source/pdf/XmpMetadata.cxx b/vcl/source/pdf/XmpMetadata.cxx
index ddd638551bd5..47d76f187d02 100644
--- a/vcl/source/pdf/XmpMetadata.cxx
+++ b/vcl/source/pdf/XmpMetadata.cxx
@@ -83,6 +83,14 @@ void XmpMetadata::write()
 aXmlWriter.content("application/pdf"_ostr);
 aXmlWriter.endElement();
 
+aXmlWriter.startElement("dc:date");
+aXmlWriter.startElement("rdf:Seq");
+aXmlWriter.startElement("rdf:li");
+aXmlWriter.content(m_sCreateDate);
+aXmlWriter.endElement();
+aXmlWriter.endElement();
+aXmlWriter.endElement();
+
 if (!msTitle.isEmpty())
 {
 // this is according to PDF/A-1, technical corrigendum 1 
(2007-04-01)


core.git: vcl/source

2024-01-14 Thread Patrick Luby (via logerrit)
 vcl/source/app/salvtables.cxx |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit 563f7077f1dbce31ff95ee8d2e8d17b629693db1
Author: Patrick Luby 
AuthorDate: Wed Jan 10 19:30:17 2024 -0500
Commit: Patrick Luby 
CommitDate: Sun Jan 14 12:52:16 2024 +0100

tdf#159089 dispose custom accessible here and unset for `m_xDrawingArea`

rather than waiting for `m_xDrawingArea` to get disposed, to prevent
unsafe use of the now potentially non-functional accessible until it
gets disposed with the VclDrawingArea

Change-Id: I5b8720ac4d5ed41cb1775b0142b17d198e9f036d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161903
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index bf76517fea68..7482a086b1be 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -6340,6 +6340,19 @@ SalInstanceDrawingArea::~SalInstanceDrawingArea()
 m_xDrawingArea->SetResizeHdl(Link());
 m_xDrawingArea->SetPaintHdl(
 Link, void>());
+
+// tdf#159089 dispose custom accessible here and unset for `m_xDrawingArea`
+// rather than waiting for `m_xDrawingArea` to get disposed, to prevent
+// unsafe use of the now potentially non-functional accessible until it
+// gets disposed with the VclDrawingArea
+css::uno::Reference xAccessible
+= m_xDrawingArea->GetAccessible();
+css::uno::Reference xComp(xAccessible, 
css::uno::UNO_QUERY);
+if (xComp.is())
+{
+xComp->dispose();
+m_xDrawingArea->SetAccessible(nullptr);
+}
 }
 
 OutputDevice& SalInstanceDrawingArea::get_ref_device() { return 
*m_xDrawingArea->GetOutDev(); }


core.git: vcl/source

2024-01-08 Thread Samuel Mehrbrodt (via logerrit)
 vcl/source/window/dlgctrl.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 3ad0f2317492f5a11ed9786e849f18a5fa817480
Author: Samuel Mehrbrodt 
AuthorDate: Mon Jan 8 13:58:03 2024 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Jan 8 17:45:36 2024 +0100

tdf#157649 Allow omitting Alt key in Windows only

Follow-up for ea1421747985bd09ad40565da8536e857b5c2e9a

Change-Id: Ifdfeb8a0a9507f66af26607efc31438169452b46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161786
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index 90cdf353f8c0..ac75333d9011 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -952,9 +952,13 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool 
bKeyInput )
 GetFocusFlags nGetFocusFlags = GetFocusFlags::Mnemonic;
 if ( pSWindow == ::ImplFindAccelWindow( this, i, c, 
nFormStart, nFormEnd ) )
 nGetFocusFlags |= GetFocusFlags::UniqueMnemonic;
+#ifdef _WIN32
 // tdf#157649 Allow omitting the Alt key when focus is in 
the dialog action area:
 bool bIsButtonBox = 
dynamic_cast(pSWindow->GetParent()) != nullptr;
 if ((bIsButtonBox && 
pSWindow->GetParent()->HasChildPathFocus(true)) || aKeyCode.IsMod2())
+#else
+if (aKeyCode.IsMod2())
+#endif
 {
 pSWindow->ImplControlFocus( nGetFocusFlags );
 return true;


core.git: vcl/source

2024-01-05 Thread Darshan11 (via logerrit)
 vcl/source/treelist/svtabbx.cxx |   17 +
 1 file changed, 17 insertions(+)

New commits:
commit 4030a043914217ee19487bcdd4389d0e184d
Author: Darshan11 
AuthorDate: Wed Dec 20 11:35:46 2023 +0530
Commit: Caolán McNamara 
CommitDate: Fri Jan 5 15:10:19 2024 +0100

Send checkboxtype property to online for webtreeview widget

- webtreeview widget does not have any property that define that element is 
a checkbox or radio button
- added `checboxtype` property
- will help to identify the element type (radio/checbox)
Change-Id: Ic8aa0c3eeb6373566f3507ebf01cee3427a57704
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161043
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161655
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx
index 81f0f4e8b078..6f309bb9a85f 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -142,6 +142,23 @@ void SvTabListBox::DumpAsPropertyTree(tools::JsonWriter& 
rJsonWriter)
 
 bool bCheckButtons = static_cast(nTreeFlags & SvTreeFlags::CHKBTN);
 
+bool isRadioButton = false;
+if (pCheckButtonData)
+{
+isRadioButton = pCheckButtonData -> IsRadio();
+}
+
+OUString checkboxtype;
+if (bCheckButtons)
+{
+checkboxtype = "checkbox";
+if(isRadioButton)
+{
+checkboxtype = "radio";
+}
+}
+
+rJsonWriter.put("checkboxtype", checkboxtype);
 auto entriesNode = rJsonWriter.startArray("entries");
 lcl_DumpEntryAndSiblings(rJsonWriter, First(), this, bCheckButtons);
 }


core.git: vcl/source

2023-12-31 Thread Caolán McNamara (via logerrit)
 vcl/source/gdi/metaact.cxx |   54 +
 1 file changed, 30 insertions(+), 24 deletions(-)

New commits:
commit c77ecfbdbee4b03225e9dad7cbedd5c9c7be0995
Author: Caolán McNamara 
AuthorDate: Sun Dec 31 14:22:00 2023 +
Commit: Caolán McNamara 
CommitDate: Sun Dec 31 23:01:51 2023 +0100

ofz#65266 Timeout

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

diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index c1d7e5327dd7..bea295fb416e 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -237,8 +237,35 @@ MetaRectAction::MetaRectAction( const tools::Rectangle& 
rRect ) :
 maRect  ( rRect )
 {}
 
+static bool AllowDim(tools::Long nDim)
+{
+static bool bFuzzing = comphelper::IsFuzzing();
+if (bFuzzing)
+{
+if (nDim > 0x2000 || nDim < -0x2000)
+{
+SAL_WARN("vcl", "skipping huge dimension: " << nDim);
+return false;
+}
+}
+return true;
+}
+
+static bool AllowPoint(const Point& rPoint)
+{
+return AllowDim(rPoint.X()) && AllowDim(rPoint.Y());
+}
+
+static bool AllowRect(const tools::Rectangle& rRect)
+{
+return AllowPoint(rRect.TopLeft()) && AllowPoint(rRect.BottomRight());
+}
+
 void MetaRectAction::Execute( OutputDevice* pOut )
 {
+if (!AllowRect(pOut->LogicToPixel(maRect)))
+return;
+
 pOut->DrawRect( maRect );
 }
 
@@ -463,30 +490,6 @@ MetaPolyLineAction::MetaPolyLineAction( tools::Polygon 
aPoly, LineInfo aLineInfo
 maPoly  (std::move( aPoly ))
 {}
 
-static bool AllowDim(tools::Long nDim)
-{
-static bool bFuzzing = comphelper::IsFuzzing();
-if (bFuzzing)
-{
-if (nDim > 0x2000 || nDim < -0x2000)
-{
-SAL_WARN("vcl", "skipping huge dimension: " << nDim);
-return false;
-}
-}
-return true;
-}
-
-static bool AllowPoint(const Point& rPoint)
-{
-return AllowDim(rPoint.X()) && AllowDim(rPoint.Y());
-}
-
-static bool AllowRect(const tools::Rectangle& rRect)
-{
-return AllowPoint(rRect.TopLeft()) && AllowPoint(rRect.BottomRight());
-}
-
 void MetaPolyLineAction::Execute( OutputDevice* pOut )
 {
 if (!AllowRect(pOut->LogicToPixel(maPoly.GetBoundRect(
@@ -822,6 +825,9 @@ void MetaTextLineAction::Execute( OutputDevice* pOut )
 SAL_WARN("vcl", "skipping line with negative width: " << mnWidth);
 return;
 }
+if (!AllowRect(pOut->LogicToPixel(tools::Rectangle(maPos, Size(mnWidth, 
pOut->GetTextHeight())
+return;
+
 pOut->DrawTextLine( maPos, mnWidth, meStrikeout, meUnderline, meOverline );
 }
 


core.git: vcl/source

2023-12-31 Thread Julien Nabet (via logerrit)
 vcl/source/fontsubset/ttcr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ec4ce4362a8d33f5608f62a11e1ed84b8dc448a4
Author: Julien Nabet 
AuthorDate: Sun Dec 31 12:19:15 2023 +0100
Commit: Julien Nabet 
CommitDate: Sun Dec 31 13:45:27 2023 +0100

Replace "size() == 0 with empty()" (vcl)

Change-Id: If93925fca6c0bb27ea5570d500e13b195b993f36
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161471
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx
index 84a0375c8087..e2095f987338 100644
--- a/vcl/source/fontsubset/ttcr.cxx
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -380,7 +380,7 @@ int TrueTypeTableGlyf::GetRawData(TableEntry* te)
 te->length = 0;
 te->tag = 0;
 
-if (m_list.size() == 0) return TTCR_ZEROGLYPHS;
+if (m_list.empty()) return TTCR_ZEROGLYPHS;
 
 for (const std::unique_ptr& pGlyph : m_list)
 {


core.git: vcl/source

2023-12-24 Thread Patrick Luby (via logerrit)
 vcl/source/control/InterimItemWindow.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 04eb7f5a47b77511dd7a6e797b66ef2cfffce235
Author: Patrick Luby 
AuthorDate: Sun Dec 24 16:43:54 2023 -0500
Commit: Patrick Luby 
CommitDate: Sun Dec 24 23:46:54 2023 +0100

Eliminate warning when changing timer's priority

Task::SetPriority() expects the timer to be stopped while
changing the timer's priority.

Change-Id: Ib025cc1451bf6fa959284d202d29dbb1489beb0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161272
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/vcl/source/control/InterimItemWindow.cxx 
b/vcl/source/control/InterimItemWindow.cxx
index 697f78759933..0769245eb477 100644
--- a/vcl/source/control/InterimItemWindow.cxx
+++ b/vcl/source/control/InterimItemWindow.cxx
@@ -189,7 +189,15 @@ void InterimItemWindow::Draw(OutputDevice* pDevice, const 
Point& rPos,
 
 void InterimItemWindow::SetPriority(TaskPriority nPriority)
 {
+// Eliminate warning when changing timer's priority
+// Task::SetPriority() expects the timer to be stopped while
+// changing the timer's priority.
+bool bActive = m_aLayoutIdle.IsActive();
+if (bActive)
+m_aLayoutIdle.Stop();
 m_aLayoutIdle.SetPriority(nPriority);
+if (bActive)
+m_aLayoutIdle.Start();
 }
 
 void InterimItemWindow::ImplPaintToDevice(::OutputDevice* pTargetOutDev, const 
Point& rPos)


core.git: vcl/source

2023-12-24 Thread Patrick Luby (via logerrit)
 vcl/source/bitmap/bitmappaint.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2d514b422257ccf2b53215ee948dda2c9a476d37
Author: Patrick Luby 
AuthorDate: Sat Dec 23 17:25:54 2023 -0500
Commit: Patrick Luby 
CommitDate: Sun Dec 24 14:41:57 2023 +0100

tdf#158807 Call UpdatePaletteForNewColor with rReplaceColor parameter

Change-Id: Id9d55600c69e84f7d7ffdd9cfbf4e1b3985b79c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161260
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Patrick Luby 

diff --git a/vcl/source/bitmap/bitmappaint.cxx 
b/vcl/source/bitmap/bitmappaint.cxx
index fa1e8486c2e3..cc3674ad3123 100644
--- a/vcl/source/bitmap/bitmappaint.cxx
+++ b/vcl/source/bitmap/bitmappaint.cxx
@@ -919,8 +919,8 @@ bool Bitmap::ReplaceMask(const AlphaMask& rMask, const 
Color& rReplaceColor)
 const sal_uInt16 nActColors = pAcc->GetPaletteEntryCount();
 const sal_uInt16 nMaxColors = 1 << pAcc->GetBitCount();
 
-aReplace
-= UpdatePaletteForNewColor(pAcc, nActColors, nMaxColors, nHeight, 
nWidth, aReplace);
+aReplace = UpdatePaletteForNewColor(pAcc, nActColors, nMaxColors, 
nHeight, nWidth,
+BitmapColor(rReplaceColor));
 }
 else
 aReplace = rReplaceColor;


core.git: vcl/source

2023-12-23 Thread Samuel Mehrbrodt (via logerrit)
 vcl/source/window/dlgctrl.cxx |   11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit ea1421747985bd09ad40565da8536e857b5c2e9a
Author: Samuel Mehrbrodt 
AuthorDate: Fri Dec 22 09:25:53 2023 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Sat Dec 23 17:37:02 2023 +0100

tdf#157649 Allow omitting Alt key when focus is in dialog action area

Adapt to usual Windows experience: Allow triggering the Ok, Cancel, etc
buttons in the dialog action area without pressing the Alt key - when
the focus is in that area (and the accelerator is unique in that dialog).

Change-Id: I85b544867cf5507a15240b2972a26a1c248c4f82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161146
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index adf416b21769..90cdf353f8c0 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -941,7 +941,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool 
bKeyInput )
 }
 }
 }
-else if (aKeyCode.IsMod2()) // tdf#151385
+else
 {
 sal_Unicode c = rKEvt.GetCharCode();
 if ( c )
@@ -952,8 +952,13 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool 
bKeyInput )
 GetFocusFlags nGetFocusFlags = GetFocusFlags::Mnemonic;
 if ( pSWindow == ::ImplFindAccelWindow( this, i, c, 
nFormStart, nFormEnd ) )
 nGetFocusFlags |= GetFocusFlags::UniqueMnemonic;
-pSWindow->ImplControlFocus( nGetFocusFlags );
-return true;
+// tdf#157649 Allow omitting the Alt key when focus is in 
the dialog action area:
+bool bIsButtonBox = 
dynamic_cast(pSWindow->GetParent()) != nullptr;
+if ((bIsButtonBox && 
pSWindow->GetParent()->HasChildPathFocus(true)) || aKeyCode.IsMod2())
+{
+pSWindow->ImplControlFocus( nGetFocusFlags );
+return true;
+}
 }
 }
 }


core.git: vcl/source

2023-12-14 Thread Darshan11 (via logerrit)
 vcl/source/window/dockwin.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1ad7c71892cc0d6ea451ab4026dc82f54ed48f6f
Author: Darshan11 
AuthorDate: Fri Dec 1 18:49:32 2023 +0530
Commit: Szymon Kłos 
CommitDate: Thu Dec 14 09:31:23 2023 +0100

Fix posx and posy for Filter by color in autofilter jsDialog

Change-Id: I2d4cd198197250495cc87eb1ee68407baf8e6a1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160216
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 8b08a9927bc4ee66a9575c658934dd27f06be702)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160698
Tested-by: Jenkins

diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index 3f8853877b08..2bced4d8047b 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -927,7 +927,7 @@ Point DockingWindow::GetFloatingPos() const
 pWrapper->mpFloatWin->GetWindowState( aData );
 AbsoluteScreenPixelPoint aPos(aData.x(), aData.y());
 // LOK needs logic coordinates not absolute screen position for 
autofilter menu
-if (!comphelper::LibreOfficeKit::isActive() || get_id() != 
"check_list_menu")
+if (!comphelper::LibreOfficeKit::isActive())
 return 
pWrapper->mpFloatWin->GetParent()->ImplGetFrameWindow()->AbsoluteScreenToOutputPixel(
 aPos );
 return Point(aPos);
 }


core.git: vcl/source

2023-12-13 Thread Stephan Bergmann (via logerrit)
 vcl/source/pdf/XmpMetadata.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 297a6673175308168669870882c016b496652a76
Author: Stephan Bergmann 
AuthorDate: Wed Dec 13 13:11:03 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Dec 13 23:15:01 2023 +0100

Work around strange error seen at least with VS 2022 Preview 17.9.0 Preview 
2.0

> vcl/source/pdf/XmpMetadata.cxx(39): error C2440: '': 
cannot convert from 'initializer list' to 'rtl::OStringLiteral<55>'
> vcl/source/pdf/XmpMetadata.cxx(39): note: Invalid aggregate initialization
> vcl/source/pdf/XmpMetadata.cxx(39): note: too many initializers

(Smells like a bug in that compiler's u8"..." handling, where it maybe gets
tripped by the 3-byte UTF-8 encoding of \uFEFF?)

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

diff --git a/vcl/source/pdf/XmpMetadata.cxx b/vcl/source/pdf/XmpMetadata.cxx
index 53bf3902ab2b..ddd638551bd5 100644
--- a/vcl/source/pdf/XmpMetadata.cxx
+++ b/vcl/source/pdf/XmpMetadata.cxx
@@ -8,6 +8,10 @@
  *
  */
 
+#include 
+
+#include 
+
 #include 
 #include 
 
@@ -35,8 +39,8 @@ void XmpMetadata::write()
 mpMemoryStream = std::make_unique(4096 /*Initial*/, 64 
/*Resize*/);
 
 // Header
-mpMemoryStream->WriteOString(
-OStringLiteral(u8"\n"));
+mpMemoryStream->WriteOString(std::string_view(reinterpret_cast(
+u8"\n")));
 
 {
 tools::XmlWriter aXmlWriter(mpMemoryStream.get());


core.git: vcl/source

2023-12-13 Thread Patrick Luby (via logerrit)
 vcl/source/filter/png/PngImageWriter.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 1956bd5f27fa10a336b9cf9e27751eca5ff907b5
Author: Patrick Luby 
AuthorDate: Wed Dec 13 09:03:12 2023 -0500
Commit: Patrick Luby 
CommitDate: Wed Dec 13 21:37:51 2023 +0100

Fix unit test failure when using Skia in debug builds

Calling aBitmap.HasGreyPalette8Bit() hits an assert when
using Skia in a debug build so query the palette through
the bitmap read access object.

Change-Id: I12fad6783ec7d6df6c99db197aaa52fd4b01ed69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160684
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/vcl/source/filter/png/PngImageWriter.cxx 
b/vcl/source/filter/png/PngImageWriter.cxx
index 584487fabdd5..1674f80e14a0 100644
--- a/vcl/source/filter/png/PngImageWriter.cxx
+++ b/vcl/source/filter/png/PngImageWriter.cxx
@@ -209,7 +209,10 @@ static bool pngWrite(SvStream& rStream, const Graphic& 
rGraphic, int nCompressio
 }
 case ScanlineFormat::N8BitPal:
 {
-if (!aBitmap.HasGreyPalette8Bit())
+// Calling aBitmap.HasGreyPalette8Bit() hits an assert when
+// using Skia in a debug build so query the palette through
+// the bitmap read access object.
+if (!pAccess->HasPalette() || 
!pAccess->GetPalette().IsGreyPalette8Bit())
 colorType = PNG_COLOR_TYPE_PALETTE;
 else
 {


core.git: vcl/source

2023-12-12 Thread Chris Sherlock (via logerrit)
 vcl/source/text/textlayout.cxx |7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

New commits:
commit 755ce3ae9f6c672cc3ac1596fce182cd2c6993db
Author: Chris Sherlock 
AuthorDate: Thu Oct 26 02:07:02 2023 +1100
Commit: Tomaž Vajngerl 
CommitDate: Tue Dec 12 10:48:39 2023 +0100

vcl: remove out of sync comment - the code has since changed!

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

diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx
index 535e0c1c16f1..095c087d5377 100644
--- a/vcl/source/text/textlayout.cxx
+++ b/vcl/source/text/textlayout.cxx
@@ -245,10 +245,7 @@ namespace vcl
 return nBreakPos;
 
 // Whether hyphen or not: Put the word after the hyphen through
-// word boundary.
-
-// nMaxBreakPos the last char that fits into the line
-// nBreakPos is the word's start
+// the word boundary.
 
 // We run into a problem if the doc is so narrow, that a word
 // is broken into more than two lines ...
@@ -264,8 +261,6 @@ namespace vcl
 if ( ( nWordEnd < nSoftBreak ) || ( nWordLen <= 3 ) )
 return nBreakPos;
 
-// #104415# May happen, because getLineBreak may differ from 
getWordBoundary with DICTIONARY_WORD
-// SAL_WARN_IF( nWordEnd < nMaxBreakPos, "vcl", "Hyph: Break?" );
 OUString aWord = rStr.copy( nWordStart, nWordLen );
 sal_Int32 nMinTrail = nWordEnd-nSoftBreak+1;  //+1: Before the "broken 
off" char
 css::uno::Reference< css::linguistic2::XHyphenatedWord > xHyphWord;


core.git: vcl/source

2023-12-12 Thread Chris Sherlock (via logerrit)
 vcl/source/text/textlayout.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 0db0662376dd9e89e1ad1e0a5764c69f94f9a059
Author: Chris Sherlock 
AuthorDate: Wed Oct 25 06:15:37 2023 +1100
Commit: Tomaž Vajngerl 
CommitDate: Tue Dec 12 10:45:05 2023 +0100

vcl: move bClipping closer to first use

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

diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx
index b6f90c6b972d..8e2ddeb55875 100644
--- a/vcl/source/text/textlayout.cxx
+++ b/vcl/source/text/textlayout.cxx
@@ -393,8 +393,6 @@ namespace vcl
 if (rStr.isEmpty())
 return 0;
 
-const bool bClipping = (nStyle & DrawTextFlags::Clip) && !(nStyle & 
DrawTextFlags::EndEllipsis);
-
 tools::Long nMaxLineWidth  = 0;
 const bool bHyphenate = (nStyle & DrawTextFlags::WordBreakHyphenation) 
== DrawTextFlags::WordBreakHyphenation;
 css::uno::Reference< css::linguistic2::XHyphenator > xHyph;
@@ -410,6 +408,7 @@ namespace vcl
 sal_Int32 nPos = 0;
 sal_Int32 nLen = rStr.getLength();
 sal_Int32 nCurrentTextY = 0;
+
 while ( nPos < nLen )
 {
 sal_Int32 nBreakPos = lcl_GetEndOfLine(rStr, nPos, nLen);
@@ -437,6 +436,7 @@ namespace vcl
 
 if ( nBreakPos == nPos )
 nBreakPos++;
+
 nPos = nBreakPos;
 
 if ( nPos < nLen && ( ( rStr[ nPos ] == '\r' ) || ( rStr[ nPos ] 
== '\n' ) ) )
@@ -447,6 +447,9 @@ namespace vcl
 nPos++;
 }
 nCurrentTextY += nTextHeight;
+
+const bool bClipping = (nStyle & DrawTextFlags::Clip) && !(nStyle 
& DrawTextFlags::EndEllipsis);
+
 if (bClipping && nCurrentTextY > rRect.GetHeight())
 break;
 }


core.git: vcl/source

2023-12-12 Thread Chris Sherlock (via logerrit)
 vcl/source/text/textlayout.cxx |   20 ++--
 1 file changed, 14 insertions(+), 6 deletions(-)

New commits:
commit 37bd1098fa0b2c5094aee0a48feff260b59681f3
Author: Chris Sherlock 
AuthorDate: Wed Oct 25 05:18:43 2023 +1100
Commit: Tomaž Vajngerl 
CommitDate: Tue Dec 12 10:44:29 2023 +0100

vcl: extract lcl_GetEndOfLine()

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

diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx
index 587060cb8690..b6f90c6b972d 100644
--- a/vcl/source/text/textlayout.cxx
+++ b/vcl/source/text/textlayout.cxx
@@ -365,6 +365,18 @@ namespace vcl
 {
 return ((nLineWidth > nWidth) && (nStyle & 
DrawTextFlags::WordBreak));
 }
+
+sal_Int32 lcl_GetEndOfLine(std::u16string_view rStr, const sal_Int32 
nPos, const sal_Int32 nLen)
+{
+sal_Int32 nBreakPos = nPos;
+
+while ((nBreakPos < nLen) && (rStr[nBreakPos] != '\r') && 
(rStr[nBreakPos] != '\n'))
+{
+nBreakPos++;
+}
+
+return nBreakPos;
+}
 }
 
 tools::Long TextLayoutCommon::GetTextLines(tools::Rectangle const& rRect, 
const tools::Long nTextHeight,
@@ -400,12 +412,8 @@ namespace vcl
 sal_Int32 nCurrentTextY = 0;
 while ( nPos < nLen )
 {
-sal_Int32 nBreakPos = nPos;
-
-while ( ( nBreakPos < nLen ) && ( rStr[ nBreakPos ] != '\r' ) && ( 
rStr[ nBreakPos ] != '\n' ) )
-nBreakPos++;
-
-tools::Long nLineWidth = GetTextWidth( rStr, nPos, nBreakPos-nPos 
);
+sal_Int32 nBreakPos = lcl_GetEndOfLine(rStr, nPos, nLen);
+tools::Long nLineWidth = GetTextWidth(rStr, nPos, nBreakPos-nPos);
 
 if (lcl_ShouldBreakWord(nLineWidth, nWidth, nStyle))
 {


core.git: vcl/source

2023-12-12 Thread Chris Sherlock (via logerrit)
 vcl/source/text/textlayout.cxx |   15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

New commits:
commit 5aad3b5d8c4da23e90869b70907c3e5c5883ceea
Author: Chris Sherlock 
AuthorDate: Wed Oct 25 05:12:06 2023 +1100
Commit: Tomaž Vajngerl 
CommitDate: Tue Dec 12 10:43:39 2023 +0100

vcl: extract lcl_ShouldBreakWord()

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

diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx
index 33232b6f0999..587060cb8690 100644
--- a/vcl/source/text/textlayout.cxx
+++ b/vcl/source/text/textlayout.cxx
@@ -359,6 +359,14 @@ namespace vcl
 return nBreakPos;
 }
 
+namespace
+{
+bool lcl_ShouldBreakWord(const sal_Int32 nLineWidth, const sal_Int32 
nWidth, const DrawTextFlags nStyle)
+{
+return ((nLineWidth > nWidth) && (nStyle & 
DrawTextFlags::WordBreak));
+}
+}
+
 tools::Long TextLayoutCommon::GetTextLines(tools::Rectangle const& rRect, 
const tools::Long nTextHeight,
ImplMultiTextLineInfo& 
rLineInfo,
tools::Long nWidth, OUString 
const& rStr,
@@ -398,12 +406,13 @@ namespace vcl
 nBreakPos++;
 
 tools::Long nLineWidth = GetTextWidth( rStr, nPos, nBreakPos-nPos 
);
-if ( ( nLineWidth > nWidth ) && ( nStyle & 
DrawTextFlags::WordBreak ) )
+
+if (lcl_ShouldBreakWord(nLineWidth, nWidth, nStyle))
 {
-if ( !xBI.is() )
+if (!xBI.is())
 xBI = vcl::unohelper::CreateBreakIterator();
 
-if ( xBI.is() )
+if (xBI.is())
 {
 nBreakPos = BreakLinesWithIterator(nWidth, rStr, xHyph, 
xBI, bHyphenate, nPos, nBreakPos);
 nLineWidth = GetTextWidth(rStr, nPos, nBreakPos - nPos);


core.git: vcl/source

2023-12-11 Thread Michael Weghorn (via logerrit)
 vcl/source/control/listbox.cxx |   12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 22250df05830700b2555348b8ac46ee1007d0e5d
Author: Michael Weghorn 
AuthorDate: Fri Dec 8 11:50:40 2023 +0100
Commit: Michael Weghorn 
CommitDate: Tue Dec 12 06:22:11 2023 +0100

tdf#158548 vcl: Require mouse over listbox to mouse-wheel through entries

As described in tdf#158548, it's unexpected that listbox/
combobox entries change when using the mouse wheel while the
listbox/combobox has keyboard focus, but the mouse cursor
is positioned somewhere else

Therefore, only do that for the VCL ListBox when the mouse cursor
is currently positioned above it, which also matches what
e.g. native Qt applications do.
(When using the gtk3 VCL plugin that uses a native GtkComboBox,
nothing changes on scroll independent of the position.)

Change-Id: I8a69628471c1cd4258194627b95145d6b8fb686a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160459
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx
index 7e87ae390185..e189c8480f05 100644
--- a/vcl/source/control/listbox.cxx
+++ b/vcl/source/control/listbox.cxx
@@ -867,12 +867,14 @@ bool ListBox::PreNotify( NotifyEvent& rNEvt )
   (rNEvt.GetCommandEvent()->GetCommand() == 
CommandEventId::Wheel) &&
   (rNEvt.GetWindow() == mpImplWin) )
 {
+const Point& rMousePos = 
rNEvt.GetCommandEvent()->GetMousePosPixel();
+const tools::Rectangle aWinRect(mpImplWin->GetPosPixel(), 
mpImplWin->GetSizePixel());
+const bool bMousePositionedOverWin = aWinRect.Contains(rMousePos);
+
 MouseWheelBehaviour nWheelBehavior( 
GetSettings().GetMouseSettings().GetWheelBehavior() );
-if  (   ( nWheelBehavior == MouseWheelBehaviour::ALWAYS )
-||  (   ( nWheelBehavior == MouseWheelBehaviour::FocusOnly )
-&&  HasChildPathFocus()
-)
-)
+if (bMousePositionedOverWin
+&& ((nWheelBehavior == MouseWheelBehaviour::ALWAYS)
+|| ((nWheelBehavior == MouseWheelBehaviour::FocusOnly) && 
HasChildPathFocus(
 {
 bDone = 
mpImplLB->HandleWheelAsCursorTravel(*rNEvt.GetCommandEvent(), *this);
 }


core.git: vcl/source

2023-12-08 Thread Chris Sherlock (via logerrit)
 vcl/source/outdev/bitmap.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 29df1afa1f439bf44a6be1b04ec0190e8f40abe2
Author: Chris Sherlock 
AuthorDate: Sun Sep 24 00:29:02 2023 +1000
Commit: Tomaž Vajngerl 
CommitDate: Fri Dec 8 11:49:31 2023 +0100

tdf#43157 vcl: remove DBG_ASSERT() from DrawDeviceAlphaBitmapSlowPath()

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

diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index c6855909d312..86ac23137562 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -653,8 +653,8 @@ void OutputDevice::DrawDeviceAlphaBitmapSlowPath(const 
Bitmap& rBitmap,
 BitmapScopedReadAccess pBitmapReadAccess(rBitmap);
 BitmapScopedReadAccess pAlphaReadAccess(rAlpha);
 
-DBG_ASSERT( pAlphaReadAccess->GetScanlineFormat() == 
ScanlineFormat::N8BitPal,
-"OutputDevice::ImplDrawAlpha(): non-8bit alpha no longer 
supported!" );
+SAL_WARN_IF(pAlphaReadAccess->GetScanlineFormat() != 
ScanlineFormat::N8BitPal, "vcl.gdi", "non-8bit alpha no longer supported!");
+assert(pAlphaReadAccess->GetScanlineFormat() == ScanlineFormat::N8BitPal);
 
 // #i38887# reading from screen may sometimes fail
 if (aBmp.ImplGetSalBitmap())


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

2023-12-04 Thread Mike Kaganski (via logerrit)
 vcl/source/treelist/transfer.cxx |   46 +--
 1 file changed, 16 insertions(+), 30 deletions(-)

New commits:
commit 2bde39767ff2aead9d4cfddc37f32103bfc52f63
Author: Mike Kaganski 
AuthorDate: Mon Dec 4 13:40:04 2023 +0300
Commit: Mike Kaganski 
CommitDate: Tue Dec 5 05:40:32 2023 +0100

Drop own mutex to prevent lock order problem

When running UITests on Windows with parallelism, I often see deadlocks
in clipboard threads, where one thread holds own mutex and tries to lock
solar mutex, and the other holds it and waits for own mutex. The problem
is in TransferableDataHelper::GetAny, where solar mutex is released
temporarily.

Avoid it by dropping own mutex, and only using solar mutex.

Change-Id: Idbfa2e1399fe94d092b4090e7aa4956be4103744
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160296
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Mike Kaganski 

diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx
index 955b47b7cdf2..7e6009de77dc 100644
--- a/vcl/source/treelist/transfer.cxx
+++ b/vcl/source/treelist/transfer.cxx
@@ -23,7 +23,6 @@
 #include 
 #endif
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -1036,7 +1035,6 @@ namespace {
 class TransferableClipboardNotifier : public ::cppu::WeakImplHelper< 
XClipboardListener >
 {
 private:
-::osl::Mutex&   mrMutex;
 Reference< XClipboardNotifier > mxNotifier;
 TransferableDataHelper* mpListener;
 
@@ -1048,7 +1046,7 @@ protected:
 virtual void SAL_CALL disposing( const EventObject& Source ) override;
 
 public:
-TransferableClipboardNotifier( const Reference< XClipboard >& 
_rxClipboard, TransferableDataHelper& _rListener, ::osl::Mutex& _rMutex );
+TransferableClipboardNotifier( const Reference< XClipboard >& 
_rxClipboard, TransferableDataHelper& _rListener );
 
 /// determines whether we're currently listening
 bool isListening() const { return mpListener != nullptr; }
@@ -1059,9 +1057,8 @@ public:
 
 }
 
-TransferableClipboardNotifier::TransferableClipboardNotifier( const Reference< 
XClipboard >& _rxClipboard, TransferableDataHelper& _rListener, ::osl::Mutex& 
_rMutex )
-:mrMutex( _rMutex )
-,mxNotifier( _rxClipboard, UNO_QUERY )
+TransferableClipboardNotifier::TransferableClipboardNotifier( const Reference< 
XClipboard >& _rxClipboard, TransferableDataHelper& _rListener )
+:mxNotifier( _rxClipboard, UNO_QUERY )
 ,mpListener( &_rListener )
 {
 osl_atomic_increment( _refCount );
@@ -1079,11 +1076,6 @@ 
TransferableClipboardNotifier::TransferableClipboardNotifier( const Reference< X
 void SAL_CALL TransferableClipboardNotifier::changedContents( const 
clipboard::ClipboardEvent& event )
 {
 SolarMutexGuard aSolarGuard;
-// the SolarMutex here is necessary, since
-// - we cannot call mpListener without our own mutex locked
-// - Rebind respectively InitFormats (called by Rebind) will
-// try to lock the SolarMutex, too
-::osl::MutexGuard aGuard( mrMutex );
 if( mpListener )
 mpListener->Rebind( event.Contents );
 }
@@ -1098,7 +1090,7 @@ void SAL_CALL TransferableClipboardNotifier::disposing( 
const EventObject& )
 
 void TransferableClipboardNotifier::dispose()
 {
-::osl::MutexGuard aGuard( mrMutex );
+SolarMutexGuard g;
 
 Reference< XClipboardListener > xKeepMeAlive( this );
 
@@ -,7 +1103,6 @@ void TransferableClipboardNotifier::dispose()
 
 struct TransferableDataHelper_Impl
 {
-::osl::MutexmaMutex;
 rtl::Reference  mxClipboardListener;
 
 TransferableDataHelper_Impl()
@@ -1155,7 +1146,7 @@ TransferableDataHelper& 
TransferableDataHelper::operator=( const TransferableDat
 {
 if ( this !=  )
 {
-::osl::MutexGuard aGuard(mxImpl->maMutex);
+SolarMutexGuard g;
 
 const bool bWasClipboardListening = mxImpl->mxClipboardListener.is();
 
@@ -1176,7 +1167,7 @@ TransferableDataHelper& 
TransferableDataHelper::operator=( const TransferableDat
 
 TransferableDataHelper& 
TransferableDataHelper::operator=(TransferableDataHelper&& rDataHelper)
 {
-::osl::MutexGuard aGuard(mxImpl->maMutex);
+SolarMutexGuard g;
 
 const bool bWasClipboardListening = mxImpl->mxClipboardListener.is();
 
@@ -1198,7 +1189,7 @@ TransferableDataHelper::~TransferableDataHelper()
 {
 StopClipboardListening( );
 {
-::osl::MutexGuard aGuard(mxImpl->maMutex);
+SolarMutexGuard g;
 maFormats.clear();
 mxObjDesc.reset();
 }
@@ -1302,7 +1293,6 @@ void TransferableDataHelper::FillDataFlavorExVector( 
const Sequence< DataFlavor
 void TransferableDataHelper::InitFormats()
 {
 SolarMutexGuard aSolarGuard;
-::osl::MutexGuard aGuard(mxImpl->maMutex);
 
 maFormats.clear();
 mxObjDesc.reset(new TransferableObjectDescriptor);
@@ -1328,14 +1318,14 @@ void 

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

2023-12-04 Thread Mike Kaganski (via logerrit)
 vcl/source/app/svmain.cxx   |   18 +-
 vcl/win/dtrans/WinClipboard.cxx |   12 
 vcl/win/dtrans/WinClipboard.hxx |2 ++
 3 files changed, 23 insertions(+), 9 deletions(-)

New commits:
commit 8472365774b7471e96a025f424a6c7eb7b02db26
Author: Mike Kaganski 
AuthorDate: Mon Dec 4 15:08:26 2023 +0300
Commit: Mike Kaganski 
CommitDate: Mon Dec 4 21:49:03 2023 +0100

Avoid clipboard messages after Scheduler::ImplDeInitScheduler

When running UITests on Windows with parallelism, often there are
clipboard "content changed" messages that fail the assertion in
Scheduler::ImplDeInitScheduler. This is because the clipboard is
only uninitialized after the scheduler de-init; and even then,
the respective threads are not stopped yet.

Make sure that clipboard listeners are stopped before calling the
Scheduler::ImplDeInitScheduler in DeInitVCL.

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

diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 71dcca106a57..3aa2cecf4ec8 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -507,15 +507,6 @@ void DeInitVCL()
 // as this processes all pending events in debug builds.
 ImplGetSystemDependentDataManager().flushAll();
 
-Scheduler::ImplDeInitScheduler();
-
-pSVData->mpWinData->maMsgBoxImgList.clear();
-pSVData->maCtrlData.maCheckImgList.clear();
-pSVData->maCtrlData.maRadioImgList.clear();
-pSVData->maCtrlData.moDisclosurePlus.reset();
-pSVData->maCtrlData.moDisclosureMinus.reset();
-pSVData->mpDefaultWin.disposeAndClear();
-
 #if defined _WIN32
 // See GetSystemClipboard (vcl/source/treelist/transfer2.cxx):
 if (auto const comp = css::uno::Reference(
@@ -527,6 +518,15 @@ void DeInitVCL()
 pSVData->m_xSystemClipboard.clear();
 #endif
 
+Scheduler::ImplDeInitScheduler();
+
+pSVData->mpWinData->maMsgBoxImgList.clear();
+pSVData->maCtrlData.maCheckImgList.clear();
+pSVData->maCtrlData.maRadioImgList.clear();
+pSVData->maCtrlData.moDisclosurePlus.reset();
+pSVData->maCtrlData.moDisclosureMinus.reset();
+pSVData->mpDefaultWin.disposeAndClear();
+
 #ifndef NDEBUG
 DbgGUIDeInitSolarMutexCheck();
 #endif
diff --git a/vcl/win/dtrans/WinClipboard.cxx b/vcl/win/dtrans/WinClipboard.cxx
index f82c56784523..1a8eaea151b5 100644
--- a/vcl/win/dtrans/WinClipboard.cxx
+++ b/vcl/win/dtrans/WinClipboard.cxx
@@ -82,6 +82,18 @@ CWinClipboard::~CWinClipboard()
 unregisterClipboardViewer();
 }
 
+void CWinClipboard::disposing(std::unique_lock& mutex)
+{
+{
+osl::MutexGuard aGuard(s_aClipboardSingletonMutex);
+s_pCWinClipbImpl = nullptr;
+}
+
+unregisterClipboardViewer();
+
+WeakComponentImplHelper::disposing(mutex);
+}
+
 // XClipboard
 
 // to avoid unnecessary traffic we check first if there is a clipboard
diff --git a/vcl/win/dtrans/WinClipboard.hxx b/vcl/win/dtrans/WinClipboard.hxx
index 779c272c56c9..fbaa1b206288 100644
--- a/vcl/win/dtrans/WinClipboard.hxx
+++ b/vcl/win/dtrans/WinClipboard.hxx
@@ -105,6 +105,8 @@ public:
 virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() 
override;
 
 IDataObjectPtr getIDataObject();
+
+virtual void disposing(std::unique_lock&) override;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-12-04 Thread Mike Kaganski (via logerrit)
 vcl/source/app/scheduler.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 274e078a6e94e477b594839355cc709829d921dd
Author: Mike Kaganski 
AuthorDate: Mon Dec 4 14:45:57 2023 +0300
Commit: Mike Kaganski 
CommitDate: Mon Dec 4 17:26:37 2023 +0100

Relax assertion a bit

When running UITests on Windows with parallelism, I often see this
assertion failing. I don't know why; but every time I attach the
debugger to the failed process, I see mpSchedulerStack's mpTask
and mpNext are both nullptr. The only place where this can happen
is Task::~Task, which seems to suggest that this situation is
basically the same as no mpSchedulerStack.

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

diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index 098242fe6c70..e6893055f633 100644
--- a/vcl/source/app/scheduler.cxx
+++ b/vcl/source/app/scheduler.cxx
@@ -130,7 +130,7 @@ void Scheduler::ImplDeInitScheduler()
 #endif
 rSchedCtx.mbActive = false;
 
-assert( nullptr == rSchedCtx.mpSchedulerStack );
+assert( nullptr == rSchedCtx.mpSchedulerStack || 
(!rSchedCtx.mpSchedulerStack->mpTask && !rSchedCtx.mpSchedulerStack->mpNext) );
 
 if (rSchedCtx.mpSalTimer) rSchedCtx.mpSalTimer->Stop();
 delete rSchedCtx.mpSalTimer;


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

2023-12-04 Thread Caolán McNamara (via logerrit)
 vcl/source/filter/png/PngImageReader.cxx |   21 ++---
 1 file changed, 14 insertions(+), 7 deletions(-)

New commits:
commit a5b6255ee4c4b4df8141235cd4ee392d86e7fb5c
Author: Caolán McNamara 
AuthorDate: Mon Dec 4 13:03:10 2023 +
Commit: Caolán McNamara 
CommitDate: Mon Dec 4 15:25:43 2023 +0100

ofz#64582 Out-of-memory

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

diff --git a/vcl/source/filter/png/PngImageReader.cxx 
b/vcl/source/filter/png/PngImageReader.cxx
index 860bd807a685..d29c0b90c473 100644
--- a/vcl/source/filter/png/PngImageReader.cxx
+++ b/vcl/source/filter/png/PngImageReader.cxx
@@ -209,7 +209,6 @@ void getImportantChunks(SvStream& rInStream, SvStream& 
rOutStream, sal_uInt32 nW
 sal_uInt32 nHeight)
 {
 sal_uInt64 nPos = rInStream.Tell();
-sal_uInt32 nChunkSize, nChunkType;
 rInStream.SetEndian(SvStreamEndian::BIG);
 rOutStream.SetEndian(SvStreamEndian::BIG);
 rOutStream.WriteUInt64(PNG_SIGNATURE);
@@ -232,6 +231,7 @@ void getImportantChunks(SvStream& rInStream, SvStream& 
rOutStream, sal_uInt32 nW
+ PNG_CRC_SIZE);
 while (rInStream.good())
 {
+sal_uInt32 nChunkSize(0), nChunkType(0);
 rInStream.ReadUInt32(nChunkSize);
 rInStream.ReadUInt32(nChunkType);
 bool bBreakOuter = false;
@@ -255,13 +255,20 @@ void getImportantChunks(SvStream& rInStream, SvStream& 
rOutStream, sal_uInt32 nW
 {
 // Seek back to start of chunk
 rInStream.SeekRel(-PNG_TYPE_SIZE - PNG_SIZE_SIZE);
+const size_t nDataSize = PNG_SIZE_SIZE + PNG_TYPE_SIZE
+ + static_cast(nChunkSize) + 
PNG_CRC_SIZE;
+if (nDataSize > rInStream.remainingSize())
+{
+SAL_WARN("vcl.filter", "png claims record of size: "
+   << nDataSize << ", but only "
+   << rInStream.remainingSize() << 
" available.");
+bBreakOuter = true;
+break;
+}
 // Copy chunk to rOutStream
-std::vector aData(nChunkSize + PNG_TYPE_SIZE + 
PNG_SIZE_SIZE
-   + PNG_CRC_SIZE);
-rInStream.ReadBytes(aData.data(),
-PNG_TYPE_SIZE + PNG_SIZE_SIZE + nChunkSize 
+ PNG_CRC_SIZE);
-rOutStream.WriteBytes(aData.data(),
-  PNG_TYPE_SIZE + PNG_SIZE_SIZE + 
nChunkSize + PNG_CRC_SIZE);
+std::vector aData(nDataSize);
+rInStream.ReadBytes(aData.data(), nDataSize);
+rOutStream.WriteBytes(aData.data(), nDataSize);
 break;
 }
 }


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

2023-12-04 Thread Caolán McNamara (via logerrit)
 vcl/source/gdi/metaact.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 8bf16dc47e518e3cd2a6611b1c768ae589ea206e
Author: Caolán McNamara 
AuthorDate: Mon Dec 4 10:58:35 2023 +
Commit: Caolán McNamara 
CommitDate: Mon Dec 4 13:10:23 2023 +0100

ofz#64680 Integer-overflow

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

diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 1d5423cb6fed..2e1f3e4d8459 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -1098,6 +1098,9 @@ MetaBmpExScalePartAction::MetaBmpExScalePartAction( const 
Point& rDstPt, const S
 
 void MetaBmpExScalePartAction::Execute( OutputDevice* pOut )
 {
+if (!AllowRect(pOut->LogicToPixel(tools::Rectangle(maDstPt, maDstSz
+return;
+
 pOut->DrawBitmapEx( maDstPt, maDstSz, maSrcPt, maSrcSz, maBmpEx );
 }
 


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

2023-12-04 Thread Caolán McNamara (via logerrit)
 vcl/source/window/window.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 1f31cfc305224d3494da1b4eeadbe56b7227bb38
Author: Caolán McNamara 
AuthorDate: Sun Dec 3 21:01:20 2023 +
Commit: Caolán McNamara 
CommitDate: Mon Dec 4 10:49:22 2023 +0100

cid#1545582 COPY_INSTEAD_OF_MOVE

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

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index be029ca9572f..c3fa7fb3d74a 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3112,8 +3112,7 @@ const OUString& Window::GetHelpText() const
 static const char* pEnv = getenv( "HELP_DEBUG" );
 if( pEnv && *pEnv )
 {
-OUString aTxt = mpWindowImpl->maHelpText + 
"\n--\n" + aStrHelpId;
-mpWindowImpl->maHelpText = aTxt;
+mpWindowImpl->maHelpText = mpWindowImpl->maHelpText + 
"\n--\n" + aStrHelpId;
 }
 mpWindowImpl->mbHelpTextDynamic = false;
 }


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

2023-12-02 Thread Noel Grandin (via logerrit)
 vcl/source/bitmap/BitmapEx.cxx |   11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 52512614d27d0dfe6ff94a738ed3b0cd477ef251
Author: Noel Grandin 
AuthorDate: Sat Dec 2 15:38:57 2023 +0200
Commit: Noel Grandin 
CommitDate: Sat Dec 2 21:27:15 2023 +0100

Simplify some AlphaMask code

AlphaMask has an operator=, no need for extra complication

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

diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx
index 1ef50dc5d6a7..84c14cae4b7c 100644
--- a/vcl/source/bitmap/BitmapEx.cxx
+++ b/vcl/source/bitmap/BitmapEx.cxx
@@ -65,7 +65,7 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, 
Size aSize )
 maBitmap = Bitmap(aSize, rBitmapEx.maBitmap.getPixelFormat());
 SetSizePixel(aSize);
 if( rBitmapEx.IsAlpha() )
-maAlphaMask = AlphaMask( aSize ).ImplGetBitmap();
+maAlphaMask = AlphaMask( aSize );
 
 tools::Rectangle aDestRect( Point( 0, 0 ), aSize );
 tools::Rectangle aSrcRect( aSrc, aSize );
@@ -149,7 +149,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask 
) :
 
 BitmapEx::BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ) :
 maBitmap ( rBmp ),
-maAlphaMask  ( rAlphaMask.ImplGetBitmap() ),
+maAlphaMask  ( rAlphaMask ),
 maBitmapSize ( maBitmap.GetSizePixel() )
 {
 if (!maBitmap.IsEmpty() && !maAlphaMask.IsEmpty() && 
maBitmap.GetSizePixel() != maAlphaMask.GetSizePixel())
@@ -438,10 +438,7 @@ bool BitmapEx::CopyPixel( const tools::Rectangle& 
rRectDst, const tools::Rectang
 else
 {
 sal_uInt8 nTransparencyOpaque = 0;
-std::optional pAlpha(std::in_place, 
GetSizePixel(), );
-
-maAlphaMask = pAlpha->ImplGetBitmap();
-pAlpha.reset();
+maAlphaMask = AlphaMask(GetSizePixel(), 
);
 maAlphaMask.CopyPixel( rRectDst, rRectSrc, 
>maAlphaMask );
 }
 }
@@ -450,7 +447,7 @@ bool BitmapEx::CopyPixel( const tools::Rectangle& rRectDst, 
const tools::Rectang
 sal_uInt8 nTransparencyOpaque = 0;
 const AlphaMask aAlphaSrc(pBmpExSrc->GetSizePixel(), 
);
 
-maAlphaMask.CopyPixel( rRectDst, rRectSrc, 
() );
+maAlphaMask.CopyPixel( rRectDst, rRectSrc,  );
 }
 }
 }


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

2023-11-30 Thread Khaled Hosny (via logerrit)
 vcl/source/gdi/CommonSalLayout.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit fdbf404073bd4a59dc0378418cad297a547d5dd4
Author: Khaled Hosny 
AuthorDate: Thu Nov 30 12:32:23 2023 +0200
Commit: خالد حسني 
CommitDate: Thu Nov 30 13:18:02 2023 +0100

vcl: Fix comment

The comment is saying the opposite of what the code is doing.

Change-Id: I16cc44b56f90f622cedb87b9107d17b940665896
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160144
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/vcl/source/gdi/CommonSalLayout.cxx 
b/vcl/source/gdi/CommonSalLayout.cxx
index da2c898c8b24..bcf6f54639e8 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -192,8 +192,8 @@ bool GenericSalLayout::HasVerticalAlternate(sal_UCS4 aChar, 
sal_UCS4 aVariationS
 hb_ot_layout_collect_lookups(pHbFace, HB_OT_TAG_GSUB, nullptr, 
nullptr, pFeatures, pLookups);
 if (!hb_set_is_empty(pLookups))
 {
-// Find the output glyphs in each lookup (i.e. the glyphs that
-// would result from applying this lookup).
+// Find the input glyphs in each lookup (i.e. the glyphs that
+// this lookup applies to).
 hb_codepoint_t nIdx = HB_SET_VALUE_INVALID;
 while (hb_set_next(pLookups, ))
 {


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

2023-11-29 Thread Gülşah Köse (via logerrit)
 vcl/source/window/layout.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit c9bae2d26ed065bad1e490815a7606435cf63556
Author: Gülşah Köse 
AuthorDate: Wed Nov 29 16:40:00 2023 +0300
Commit: Szymon Kłos 
CommitDate: Wed Nov 29 22:28:50 2023 +0100

Online: Put the image width height info into json.

When online's image render is delayed we don't have any image size info
so getting 0x0. To show better result we need that info into message.

Signed-off-by: Gülşah Köse 
Change-Id: I28f345cdd64de5fa47b3b1054330e606e7b32f03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160106
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 5095ee62009d..5639d8e62d57 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -3104,6 +3104,8 @@ void 
VclDrawingArea::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
 
 BitmapEx aImage = pDevice->GetBitmapEx(Point(0,0), aRenderSize);
 aImage.Scale(aOutputSize);
+rJsonWriter.put("imagewidth", aRenderSize.Width());
+rJsonWriter.put("imageheight", aRenderSize.Height());
 
 SvMemoryStream aOStm(65535, 65535);
 if(GraphicConverter::Export(aOStm, aImage, ConvertDataFormat::PNG) == 
ERRCODE_NONE)


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

2023-11-24 Thread Noel Grandin (via logerrit)
 vcl/source/window/floatwin.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit b5bc39f84984fd1063865225209d905bea19833d
Author: Noel Grandin 
AuthorDate: Fri Nov 24 10:45:37 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Nov 24 18:46:05 2023 +0100

tdf#157551 Calc-Validity-CellRange, dropdown tiny

regression from
commit b6b26421a1029b18b48b69dbdac4bb70fb622604
Author: Noel Grandin 
Date:   Thu Jul 20 08:19:52 2023 +0200
split Point/Size/Rectangle into AbsoluteScreenPixel* types

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

diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 3f9bee4041f2..b2faacadb5fa 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -540,7 +540,8 @@ tools::Rectangle 
FloatingWindow::ImplConvertToRelPos(vcl::Window* pReference, co
 pParentWinOutDev->ReMirror(aFloatRect);
 }
 else
-
aFloatRect.SetPos(pReference->OutputToScreenPixel(pReference->AbsoluteScreenToOutputPixel(rRect.TopLeft(;
+aFloatRect = 
tools::Rectangle(pReference->OutputToScreenPixel(pReference->AbsoluteScreenToOutputPixel(rRect.TopLeft())),
+  rRect.GetSize());
 
 return aFloatRect;
 }


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

2023-11-18 Thread Taichi Haradaguchi (via logerrit)
 vcl/source/filter/jpeg/jpeg.h |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 9beb65b258f5e3e95ad4b86f2682c15ea1dac1af
Author: Taichi Haradaguchi <20001...@ymail.ne.jp>
AuthorDate: Sun Nov 19 10:49:53 2023 +0900
Commit: Taichi Haradaguchi <20001...@ymail.ne.jp>
CommitDate: Sun Nov 19 06:41:07 2023 +0100

tdf#143148: Use pragma once instead of include guards in vcl/source

Change-Id: Ie19a3e16861946434342c7e07482ae649a4afb4e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159646
Tested-by: Jenkins
Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp>

diff --git a/vcl/source/filter/jpeg/jpeg.h b/vcl/source/filter/jpeg/jpeg.h
index a7ddcffa6ece..2cf600bb6de4 100644
--- a/vcl/source/filter/jpeg/jpeg.h
+++ b/vcl/source/filter/jpeg/jpeg.h
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEG_H
-#define INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEG_H
+#pragma once
 
 #include 
 
@@ -62,6 +61,4 @@ struct SourceManagerStruct {
 int no_data_available_failures;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-11-18 Thread Chris Sherlock (via logerrit)
 vcl/source/text/textlayout.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2195d87e62dae3465554be5a20a45b0a377845d2
Author: Chris Sherlock 
AuthorDate: Tue Oct 17 18:54:26 2023 +1100
Commit: Tomaž Vajngerl 
CommitDate: Sun Nov 19 02:23:09 2023 +0100

vcl: simplify warning message

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

diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx
index a9e219099191..33232b6f0999 100644
--- a/vcl/source/text/textlayout.cxx
+++ b/vcl/source/text/textlayout.cxx
@@ -254,7 +254,7 @@ namespace vcl
 css::i18n::Boundary aBoundary = xBI->getWordBoundary( rStr, nBreakPos, 
rDefLocale, css::i18n::WordType::DICTIONARY_WORD, true );
 sal_Int32 nWordStart = nPos;
 sal_Int32 nWordEnd = aBoundary.endPos;
-SAL_WARN_IF( nWordEnd <= nWordStart, "vcl", "ImpBreakLine: Start >= 
End?" );
+SAL_WARN_IF(nWordEnd <= nWordStart, "vcl", "Start >= End?");
 
 sal_Int32 nWordLen = nWordEnd - nWordStart;
 if ( ( nWordEnd < nSoftBreak ) || ( nWordLen <= 3 ) )


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

2023-11-18 Thread Chris Sherlock (via logerrit)
 vcl/source/text/textlayout.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 72eaff7b6af01f3b6d9754660ce231e74d501466
Author: Chris Sherlock 
AuthorDate: Tue Oct 17 18:39:01 2023 +1100
Commit: Tomaž Vajngerl 
CommitDate: Sun Nov 19 02:21:38 2023 +0100

vcl: ImplIsCharIn() -> lcl_IsCharIn()

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

diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx
index dd05d57f77c3..a9e219099191 100644
--- a/vcl/source/text/textlayout.cxx
+++ b/vcl/source/text/textlayout.cxx
@@ -30,7 +30,7 @@
 #include 
 #include 
 
-static bool ImplIsCharIn(sal_Unicode c, const char* pStr)
+static bool lcl_IsCharIn(sal_Unicode c, const char* pStr)
 {
 while ( *pStr )
 {
@@ -124,11 +124,11 @@ namespace vcl
 {
 nLastContent--;
 
-if (ImplIsCharIn(aStr[nLastContent], pSepChars))
+if (lcl_IsCharIn(aStr[nLastContent], pSepChars))
 break;
 }
 
-while (nLastContent && ImplIsCharIn(aStr[nLastContent-1], pSepChars))
+while (nLastContent && lcl_IsCharIn(aStr[nLastContent-1], pSepChars))
 {
 nLastContent--;
 }
@@ -143,11 +143,11 @@ namespace vcl
 while (nFirstContent < nLastContent)
 {
 nFirstContent++;
-if (ImplIsCharIn(aStr[nFirstContent], pSepChars))
+if (lcl_IsCharIn(aStr[nFirstContent], pSepChars))
 break;
 }
 
-while ((nFirstContent < nLastContent) && 
ImplIsCharIn(aStr[nFirstContent], pSepChars))
+while ((nFirstContent < nLastContent) && 
lcl_IsCharIn(aStr[nFirstContent], pSepChars))
 {
 nFirstContent++;
 }
@@ -174,12 +174,12 @@ namespace vcl
 while (nFirstContent < nLastContent)
 {
 nLastContent--;
-if (ImplIsCharIn(aStr[nLastContent], pSepChars))
+if (lcl_IsCharIn(aStr[nLastContent], pSepChars))
 break;
 
 }
 
-while ((nFirstContent < nLastContent) && 
ImplIsCharIn(aStr[nLastContent-1], pSepChars))
+while ((nFirstContent < nLastContent) && 
lcl_IsCharIn(aStr[nLastContent-1], pSepChars))
 {
 nLastContent--;
 }


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

2023-11-18 Thread Chris Sherlock (via logerrit)
 vcl/source/text/textlayout.cxx |6 --
 1 file changed, 6 deletions(-)

New commits:
commit 696644462e1f3e43608319068db2bbc167e7b8f8
Author: Chris Sherlock 
AuthorDate: Tue Oct 17 18:34:46 2023 +1100
Commit: Tomaž Vajngerl 
CommitDate: Sun Nov 19 02:19:35 2023 +0100

vcl: remove unnecessary includes from textlayout.cxx

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

diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx
index 3b084a03115f..dd05d57f77c3 100644
--- a/vcl/source/text/textlayout.cxx
+++ b/vcl/source/text/textlayout.cxx
@@ -20,22 +20,16 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
 #include 
-#include 
-#include 
 #include 
 #include 
 
 #include 
 #include 
 
-#include 
-#include 
-
 static bool ImplIsCharIn(sal_Unicode c, const char* pStr)
 {
 while ( *pStr )


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

2023-11-10 Thread Michael Stahl (via logerrit)
 vcl/source/app/svmain.cxx |   26 +++---
 1 file changed, 15 insertions(+), 11 deletions(-)

New commits:
commit d45bd161a4750ca30639ce1c6ca6d6d070e6d2cb
Author: Michael Stahl 
AuthorDate: Thu Nov 9 17:13:30 2023 +0100
Commit: Michael Stahl 
CommitDate: Fri Nov 10 10:15:51 2023 +0100

vcl: don't override user's SSL_CERT_FILE for bundled OpenSSL

Change-Id: I5d61fe62c2e6814ea757a0b543f7dbf45e0db456
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159219
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index aa22d61de197..3458e6df2a29 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -197,18 +197,22 @@ int ImplSVMain()
 #if defined(LINUX) && !defined(SYSTEM_OPENSSL)
 if (!bWasInitVCL)
 {
-try // to point bundled OpenSSL to some system certificate file
-{   // ... this only works if the client actually calls
-// SSL_CTX_set_default_verify_paths() or similar; e.g. python ssl.
-char const*const path = GetCABundleFile();
-OUString constexpr name(u"SSL_CERT_FILE"_ustr);
-OUString const filepath(::rtl::OStringToOUString(
-::std::string_view(path), osl_getThreadTextEncoding()));
-osl_setEnvironment(name.pData, filepath.pData);
-}
-catch (uno::RuntimeException const& e)
+OUString constexpr name(u"SSL_CERT_FILE"_ustr);
+OUString temp;
+if (osl_getEnvironment(name.pData, ) == 
osl_Process_E_NotFound)
 {
-SAL_WARN("vcl", e.Message);
+try // to point bundled OpenSSL to some system certificate file
+{   // ... this only works if the client actually calls
+// SSL_CTX_set_default_verify_paths() or similar; e.g. python 
ssl.
+char const*const path = GetCABundleFile();
+OUString const filepath(::rtl::OStringToOUString(
+::std::string_view(path), osl_getThreadTextEncoding()));
+osl_setEnvironment(name.pData, filepath.pData);
+}
+catch (uno::RuntimeException const& e)
+{
+SAL_WARN("vcl", e.Message);
+}
 }
 }
 #endif


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

2023-11-05 Thread Chris Sherlock (via logerrit)
 vcl/source/text/textlayout.cxx |   23 ++-
 1 file changed, 10 insertions(+), 13 deletions(-)

New commits:
commit 383f666bcad27b2fbea6ac13a42cafd6f035fc5c
Author: Chris Sherlock 
AuthorDate: Tue Oct 17 18:25:38 2023 +1100
Commit: Tomaž Vajngerl 
CommitDate: Mon Nov 6 07:22:51 2023 +0100

tdf#43157 vcl: remove DBG_ASSERT() from BreakLinesWithIterator()

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

diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx
index 95e5d54a4b3c..3b084a03115f 100644
--- a/vcl/source/text/textlayout.cxx
+++ b/vcl/source/text/textlayout.cxx
@@ -17,6 +17,13 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -26,14 +33,6 @@
 #include 
 #include 
 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
 #include 
 #include 
 
@@ -523,7 +522,7 @@ namespace vcl
 m_rTargetDevice.Push( PushFlags::MAPMODE | PushFlags::FONT | 
PushFlags::TEXTLAYOUTMODE );
 
 MapMode aTargetMapMode( m_rTargetDevice.GetMapMode() );
-OSL_ENSURE( aTargetMapMode.GetOrigin() == Point(), 
"ReferenceDeviceTextLayout::ReferenceDeviceTextLayout: uhm, the code below 
won't work here ..." );
+SAL_WARN_IF(aTargetMapMode.GetOrigin() != Point(), "vcl", "uhm, the 
code below won't work here ...");
 
 // normally, controls simulate "zoom" by "zooming" the font. This is 
responsible for (part of) the discrepancies
 // between text in Writer and text in controls in Writer, though both 
have the same font.
@@ -534,13 +533,11 @@ namespace vcl
 
 // also, use a higher-resolution map unit than "pixels", which should 
save us some rounding errors when
 // translating coordinates between the reference device and the target 
device.
-OSL_ENSURE( aTargetMapMode.GetMapUnit() == MapUnit::MapPixel,
-"ReferenceDeviceTextLayout::ReferenceDeviceTextLayout: this class 
is not expected to work with such target devices!" );
+SAL_WARN_IF(aTargetMapMode.GetMapUnit() != MapUnit::MapPixel, "vcl", 
"this class is not expected to work with such target devices!");
 // we *could* adjust all the code in this class to handle this 
case, but at the moment, it's not necessary
 const MapUnit eTargetMapUnit = 
m_rReferenceDevice.GetMapMode().GetMapUnit();
 aTargetMapMode.SetMapUnit( eTargetMapUnit );
-OSL_ENSURE( aTargetMapMode.GetMapUnit() != MapUnit::MapPixel,
-"ReferenceDeviceTextLayout::ReferenceDeviceTextLayout: a reference 
device which has map mode PIXEL?!" );
+SAL_WARN_IF(aTargetMapMode.GetMapUnit() == MapUnit::MapPixel, "vcl", 
"a reference device which has map mode PIXEL?!");
 
 m_rTargetDevice.SetMapMode( aTargetMapMode );
 


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

2023-11-05 Thread Chris Sherlock (via logerrit)
 vcl/source/text/textlayout.cxx |   97 +
 1 file changed, 42 insertions(+), 55 deletions(-)

New commits:
commit 183973ece62c0eefbd841dcf99f7fb8716f0fca1
Author: Chris Sherlock 
AuthorDate: Tue Oct 17 18:06:59 2023 +1100
Commit: Tomaž Vajngerl 
CommitDate: Mon Nov 6 07:21:23 2023 +0100

vcl: flatten TextLayoutHelper::GetNewsEllipsisString()

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

diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx
index db2226842d09..95e5d54a4b3c 100644
--- a/vcl/source/text/textlayout.cxx
+++ b/vcl/source/text/textlayout.cxx
@@ -144,76 +144,63 @@ namespace vcl
 OUString aTempLastStr1 = "..." + aLastStr;
 
 if (GetTextWidth(aTempLastStr1, 0, aTempLastStr1.getLength()) > 
nMaxWidth)
+return GetEllipsisString(aStr, nMaxWidth, 
DrawTextFlags::EndEllipsis);
+
+sal_Int32 nFirstContent = 0;
+while (nFirstContent < nLastContent)
+{
+nFirstContent++;
+if (ImplIsCharIn(aStr[nFirstContent], pSepChars))
+break;
+}
+
+while ((nFirstContent < nLastContent) && 
ImplIsCharIn(aStr[nFirstContent], pSepChars))
 {
-aStr = GetEllipsisString(aStr, nMaxWidth, 
DrawTextFlags::EndEllipsis);
+nFirstContent++;
 }
-else
+
+if (nFirstContent >= nLastContent)
+return GetEllipsisString(aStr, nMaxWidth, nStyle | 
DrawTextFlags::EndEllipsis);
+
+if (nFirstContent > 4)
+nFirstContent = 4;
+
+OUString aFirstStr = OUString::Concat(aStr.subView(0, nFirstContent)) 
+ "...";
+OUString aTempStr = aFirstStr + aLastStr;
+
+if (GetTextWidth(aTempStr, 0, aTempStr.getLength() ) > nMaxWidth)
+return GetEllipsisString(aStr, nMaxWidth, nStyle | 
DrawTextFlags::EndEllipsis);
+
+do
 {
-sal_Int32 nFirstContent = 0;
+aStr = aTempStr;
+
+if (nLastContent > aStr.getLength())
+nLastContent = aStr.getLength();
+
 while (nFirstContent < nLastContent)
 {
-nFirstContent++;
-if (ImplIsCharIn( aStr[nFirstContent], pSepChars))
+nLastContent--;
+if (ImplIsCharIn(aStr[nLastContent], pSepChars))
 break;
-}
 
-while ((nFirstContent < nLastContent) && 
ImplIsCharIn(aStr[nFirstContent], pSepChars))
-{
-nFirstContent++;
 }
 
-// MEM continue here
-if (nFirstContent >= nLastContent)
+while ((nFirstContent < nLastContent) && 
ImplIsCharIn(aStr[nLastContent-1], pSepChars))
 {
-aStr = GetEllipsisString(aStr, nMaxWidth, nStyle | 
DrawTextFlags::EndEllipsis);
+nLastContent--;
 }
-else
-{
-if (nFirstContent > 4)
-nFirstContent = 4;
 
-OUString aFirstStr = OUString::Concat(aStr.subView(0, 
nFirstContent)) + "...";
-OUString aTempStr = aFirstStr + aLastStr;
+if (nFirstContent < nLastContent)
+{
+std::u16string_view aTempLastStr = aStr.subView(nLastContent);
+aTempStr = aFirstStr + aTempLastStr;
 
-if (GetTextWidth(aTempStr, 0, aTempStr.getLength() ) > 
nMaxWidth)
-{
-aStr = GetEllipsisString(aStr, nMaxWidth, nStyle | 
DrawTextFlags::EndEllipsis);
-}
-else
-{
-do
-{
-aStr = aTempStr;
-
-if (nLastContent > aStr.getLength())
-nLastContent = aStr.getLength();
-
-while (nFirstContent < nLastContent)
-{
-nLastContent--;
-if (ImplIsCharIn(aStr[nLastContent], pSepChars))
-break;
-
-}
-
-while ((nFirstContent < nLastContent) && 
ImplIsCharIn(aStr[nLastContent-1], pSepChars))
-{
-nLastContent--;
-}
-
-if (nFirstContent < nLastContent)
-{
-std::u16string_view aTempLastStr = 
aStr.subView(nLastContent);
-aTempStr = aFirstStr + aTempLastStr;
-
-if (GetTextWidth(aTempStr, 0, 
aTempStr.getLength()) > nMaxWidth)
-break;
-}
-}
-while (nFirstContent < nLastContent);
-   

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

2023-11-03 Thread Patrick Luby (via logerrit)
 vcl/source/filter/igif/gifread.cxx |   18 +++---
 1 file changed, 7 insertions(+), 11 deletions(-)

New commits:
commit 2a5dac6d75b346a77652dec05cafa6562177d40f
Author: Patrick Luby 
AuthorDate: Fri Nov 3 10:37:00 2023 -0400
Commit: Patrick Luby 
CommitDate: Fri Nov 3 18:32:26 2023 +0100

tdf#158047 allow the tdf#157635 fix for palettes with 64 entries

Change-Id: Ib4e4deb5f7e332a7ef3a9231e993231068c21c4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158885
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Patrick Luby 

diff --git a/vcl/source/filter/igif/gifread.cxx 
b/vcl/source/filter/igif/gifread.cxx
index 78d3190a0c85..cac966c665f4 100644
--- a/vcl/source/filter/igif/gifread.cxx
+++ b/vcl/source/filter/igif/gifread.cxx
@@ -319,8 +319,6 @@ void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, 
sal_uLong nCount )
 rColor.SetBlue( *pTmp++ );
 }
 
-bEnhance = false;
-
 // if possible accommodate some standard colours
 if( nCount < 256 )
 {
@@ -329,15 +327,13 @@ void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, 
sal_uLong nCount )
 if( nCount < 255 )
 (*pPal)[ 254UL ] = COL_BLACK;
 }
-else
-{
-// tdf#157793 limit tdf#157635 fix to only larger palettes
-// I don't know why, but the fix for tdf#157635 causes
-// images with a palette of 16 entries to be inverted.
-// Is this the only condition for masking out black
-// pixels in non-transparent animation frames?
-bEnhance = true;
-}
+
+// tdf#157793 limit tdf#157635 fix to only larger palettes
+// I don't know why, but the fix for tdf#157635 causes
+// images with a palette of 16 entries to be inverted.
+// Also, fix tdf#158047 by allowing the tdf#157635 fix for
+// palettes with 64 entries.
+bEnhance = (nCount > 16);
 }
 
 bool GIFReader::ReadExtension()


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

2023-11-02 Thread Vasily Melenchuk (via logerrit)
 vcl/source/window/window.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit 3d83bdb94a43b7d77c5a2362cb8204caf47a6b54
Author: Vasily Melenchuk 
AuthorDate: Wed Oct 25 13:48:39 2023 +0300
Commit: Vasily Melenchuk 
CommitDate: Thu Nov 2 09:41:06 2023 +0100

vcl: removed redundant check

Change-Id: Iec2c344df9eb1fa61bb04355c3eee38499edcdac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158422
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk 

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 35b17761e2c4..437a8b14dcb6 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2398,9 +2398,6 @@ void Window::Show(bool bVisible, ShowFlags nFlags)
 // now only notify with a NULL data pointer, for all other clients except 
the access bridge.
 if ( !bRealVisibilityChanged )
 CallEventListeners( mpWindowImpl->mbVisible ? VclEventId::WindowShow : 
VclEventId::WindowHide );
-if( xWindow->isDisposed() )
-return;
-
 }
 
 Size Window::GetSizePixel() const


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

2023-10-30 Thread Caolán McNamara (via logerrit)
 vcl/source/gdi/jobset.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0bd5b0f92c10db2da04ad8ee7de8e11534df046e
Author: Caolán McNamara 
AuthorDate: Mon Oct 30 16:49:11 2023 +
Commit: Noel Grandin 
CommitDate: Tue Oct 31 06:16:19 2023 +0100

ofz#63741 Unknown Read

this went wrong in

commit d97e0458914991214e3d396273862855aff66234
Date:   Mon Oct 1 03:09:35 2018 +0200

vcl: no raw pointers

where

rJobData.SetDriverDataLen()

was dropped

in favour of using using nDriverDataLen, but missed replacing an interleaved
GetDriverDataLen() with nDriverDataLen

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

diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx
index c9ed0d9626ec..19fa712ea658 100644
--- a/vcl/source/gdi/jobset.cxx
+++ b/vcl/source/gdi/jobset.cxx
@@ -297,7 +297,7 @@ SvStream& ReadJobSetup( SvStream& rIStream, JobSetup& 
rJobSetup )
 if ( nDriverDataLen )
 {
 const char* pDriverData = reinterpret_cast(pOldJobData) + nOldJobDataSize;
-const char* pDriverDataEnd = pDriverData + 
rJobData.GetDriverDataLen();
+const char* pDriverDataEnd = pDriverData + nDriverDataLen;
 if (pDriverDataEnd > pTempBuf.get() + nRead)
 {
 SAL_WARN("vcl", "corrupted job setup");


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

2023-10-29 Thread Caolán McNamara (via logerrit)
 vcl/source/filter/itiff/itiff.cxx |   45 ++
 1 file changed, 22 insertions(+), 23 deletions(-)

New commits:
commit 63ae3bd49834b9961f43b5a082ec809878acb891
Author: Caolán McNamara 
AuthorDate: Sat Oct 28 20:10:24 2023 +0100
Commit: Caolán McNamara 
CommitDate: Sun Oct 29 10:16:00 2023 +0100

ofz#63518 don't allow short read with PHOTOMETRIC_YCBCR format

which the old parser didn't support

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

diff --git a/vcl/source/filter/itiff/itiff.cxx 
b/vcl/source/filter/itiff/itiff.cxx
index 39bc51a00860..acd9e6d8e1ae 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -171,6 +171,14 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& 
rGraphic)
 }
 }
 
+uint16_t PhotometricInterpretation(0);
+uint16_t Compression(COMPRESSION_NONE);
+if (bOk)
+{
+TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, );
+TIFFGetField(tif, TIFFTAG_COMPRESSION, );
+}
+
 if (bOk && bFuzzing)
 {
 const uint64_t MAX_PIXEL_SIZE = 12000;
@@ -194,26 +202,18 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& 
rGraphic)
 SAL_WARN_IF(!bOk, "filter.tiff", "skipping slow bizarre 
ratio tile of " << tw << " x " << th << " for image of " << w << " x " << h);
 }
 
-uint16_t PhotometricInterpretation;
-if (TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, 
) == 1)
+if (PhotometricInterpretation == PHOTOMETRIC_LOGL)
 {
-if (PhotometricInterpretation == PHOTOMETRIC_LOGL)
-{
-uint32_t nLogLBufferRequired;
-bOk &= !o3tl::checked_multiply(tw, th, 
nLogLBufferRequired) && nLogLBufferRequired < MAX_PIXEL_SIZE;
-SAL_WARN_IF(!bOk, "filter.tiff", "skipping oversized 
tiff tile " << tw << " x " << th);
-}
+uint32_t nLogLBufferRequired;
+bOk &= !o3tl::checked_multiply(tw, th, 
nLogLBufferRequired) && nLogLBufferRequired < MAX_PIXEL_SIZE;
+SAL_WARN_IF(!bOk, "filter.tiff", "skipping oversized tiff 
tile " << tw << " x " << th);
 }
 
-uint16_t Compression;
-if (TIFFGetField(tif, TIFFTAG_COMPRESSION, ) == 1)
+if (Compression == COMPRESSION_CCITTFAX4)
 {
-if (Compression == COMPRESSION_CCITTFAX4)
-{
-uint32_t DspRuns;
-bOk &= !o3tl::checked_multiply(tw, 
static_cast(4), DspRuns) && DspRuns < MAX_PIXEL_SIZE;
-SAL_WARN_IF(!bOk, "filter.tiff", "skipping oversized 
tiff tile width: " << tw);
-}
+uint32_t DspRuns;
+bOk &= !o3tl::checked_multiply(tw, 
static_cast(4), DspRuns) && DspRuns < MAX_PIXEL_SIZE;
+SAL_WARN_IF(!bOk, "filter.tiff", "skipping oversized tiff 
tile width: " << tw);
 }
 }
 }
@@ -223,14 +223,13 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& 
rGraphic)
 
 std::vector raster(nPixelsRequired);
 
-uint16_t compression(COMPRESSION_NONE);
-const bool bNewCodec = TIFFGetField(tif, TIFFTAG_COMPRESSION, 
) == 1 &&
-   compression >= COMPRESSION_ZSTD; // >= 5 at 
time of writing
+const bool bNewCodec = Compression >= COMPRESSION_ZSTD; // >= 5 at 
time of writing
 // For tdf#149417 we generally allow one short read for fidelity with 
the old
-// parser that this replaced. But don't allow that for new format 
variations
-// that the old parser didn't handle so we don't take libtiff into 
uncharted
-// territory.
-aContext.bAllowOneShortRead = !bNewCodec;
+// parser that this replaced. But don't allow that for:
+// a) new compression variations that the old parser didn't handle
+// b) complicated pixel layout variations that the old parser didn't 
handle
+// so we don't take libtiff into uncharted territory.
+aContext.bAllowOneShortRead = !bNewCodec && PhotometricInterpretation 
!= PHOTOMETRIC_YCBCR;
 
 if (TIFFReadRGBAImageOriented(tif, w, h, raster.data(), 
ORIENTATION_TOPLEFT, 1))
 {


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

2023-10-28 Thread Noel Grandin (via logerrit)
 vcl/source/graphic/BinaryDataContainer.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d63bcfe3dde8cf873c897dbbe73fe8db38aaa70f
Author: Noel Grandin 
AuthorDate: Sat Oct 28 19:59:33 2023 +0200
Commit: Noel Grandin 
CommitDate: Sat Oct 28 22:56:30 2023 +0200

use more TempFileFast in BinaryDataContainer::Impl

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

diff --git a/vcl/source/graphic/BinaryDataContainer.cxx 
b/vcl/source/graphic/BinaryDataContainer.cxx
index c9e75bc4ef77..89ae5eb8da1e 100644
--- a/vcl/source/graphic/BinaryDataContainer.cxx
+++ b/vcl/source/graphic/BinaryDataContainer.cxx
@@ -18,7 +18,7 @@
 struct BinaryDataContainer::Impl
 {
 // temp file to store the data out of RAM if necessary
-std::unique_ptr mpFile;
+std::unique_ptr mpFile;
 // the binary data
 std::shared_ptr> mpData;
 
@@ -59,7 +59,7 @@ struct BinaryDataContainer::Impl
 if (!mpData || mpData->empty())
 return;
 
-mpFile.reset(new utl::TempFileNamed());
+mpFile.reset(new utl::TempFileFast());
 auto pStream = mpFile->GetStream(StreamMode::READWRITE);
 
 pStream->WriteBytes(mpData->data(), mpData->size());


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

2023-10-26 Thread Chris Sherlock (via logerrit)
 vcl/source/outdev/bitmap.cxx |   64 ++-
 1 file changed, 28 insertions(+), 36 deletions(-)

New commits:
commit 4a6492e155d44ef51fc9a89271f857a6f987182e
Author: Chris Sherlock 
AuthorDate: Sun Sep 24 00:42:07 2023 +1000
Commit: Tomaž Vajngerl 
CommitDate: Fri Oct 27 05:52:56 2023 +0200

vcl: flatten OutputDevice::BlendBitmap()

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

diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index d95c97e8633c..1806635593d2 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -909,8 +909,6 @@ Bitmap OutputDevice::BlendBitmap(
 if( !pP || !pA )
 return aBmp;
 
-Bitmap  res;
-
 if( GetBitCount() <= 8 )
 {
 Bitmap aDither(aBmp.GetSizePixel(), vcl::PixelFormat::N8_BPP);
@@ -949,53 +947,47 @@ Bitmap OutputDevice::BlendBitmap(
 
 pB.reset();
 pW.reset();
-res = aDither;
+return aDither;
 }
-else
+
+BitmapScopedWriteAccess pB(aBmp);
+
+bool bFastBlend = false;
+if (!bHMirr && !bVMirr)
 {
-BitmapScopedWriteAccess pB(aBmp);
+SalTwoRect aTR(aBmpRect.Left(), aBmpRect.Top(), aBmpRect.GetWidth(), 
aBmpRect.GetHeight(),
+nOffX, nOffY, aOutSz.Width(), aOutSz.Height());
 
-bool bFastBlend = false;
-if( !bHMirr && !bVMirr )
+bFastBlend = ImplFastBitmapBlending(*pB, *pP, *pA, aTR);
+}
+
+if (!bFastBlend)
+{
+for (int nY = 0; nY < nDstHeight; nY++)
 {
-SalTwoRect aTR(aBmpRect.Left(), aBmpRect.Top(), 
aBmpRect.GetWidth(), aBmpRect.GetHeight(),
-nOffX, nOffY, aOutSz.Width(), aOutSz.Height());
+tools::Long  nMapY = pMapY[nY];
 
-bFastBlend = ImplFastBitmapBlending( *pB,*pP,*pA, aTR );
-}
+if (bVMirr)
+nMapY = aBmpRect.Bottom() - nMapY;
 
-if( !bFastBlend )
-{
-for( int nY = 0; nY < nDstHeight; nY++ )
+Scanline pAScan = pA->GetScanline(nMapY);
+Scanline pBScan = pB->GetScanline(nY);
+for(int nX = 0; nX < nDstWidth; nX++)
 {
-tools::Long  nMapY = pMapY[ nY ];
+tools::Long nMapX = pMapX[nX];
 
-if ( bVMirr )
-{
-nMapY = aBmpRect.Bottom() - nMapY;
-}
-Scanline pAScan = pA->GetScanline( nMapY );
-Scanline pBScan = pB->GetScanline(nY);
-for( int nX = 0; nX < nDstWidth; nX++ )
-{
-tools::Long nMapX = pMapX[ nX ];
+if (bHMirr)
+nMapX = aBmpRect.Right() - nMapX;
 
-if ( bHMirr )
-{
-nMapX = aBmpRect.Right() - nMapX;
-}
-BitmapColor aDstCol = pB->GetPixelFromData( pBScan, nX );
-aDstCol.Merge( pP->GetColor( nMapY, nMapX ), pAScan[ nMapX 
] );
-pB->SetPixelOnData( pBScan, nX, aDstCol );
-}
+BitmapColor aDstCol = pB->GetPixelFromData(pBScan, nX);
+aDstCol.Merge(pP->GetColor(nMapY, nMapX), pAScan[nMapX]);
+pB->SetPixelOnData(pBScan, nX, aDstCol);
 }
 }
-
-pB.reset();
-res = aBmp;
 }
 
-return res;
+pB.reset();
+return aBmp;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-10-26 Thread Chris Sherlock (via logerrit)
 vcl/source/outdev/bitmapex.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d35236adb3fc561f49134a88c7468411527ee3d5
Author: Chris Sherlock 
AuthorDate: Sun Sep 24 00:58:17 2023 +1000
Commit: Tomaž Vajngerl 
CommitDate: Fri Oct 27 05:50:44 2023 +0200

vcl: flatten OutputDevice::GetBitmapEx()

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

diff --git a/vcl/source/outdev/bitmapex.cxx b/vcl/source/outdev/bitmapex.cxx
index e849f4b73181..b4fa9641a1e5 100644
--- a/vcl/source/outdev/bitmapex.cxx
+++ b/vcl/source/outdev/bitmapex.cxx
@@ -160,8 +160,8 @@ BitmapEx OutputDevice::GetBitmapEx( const Point& rSrcPt, 
const Size& rSize ) con
 
 return BitmapEx(GetBitmap( rSrcPt, rSize ), AlphaMask( aAlphaBitmap ) 
);
 }
-else
-return BitmapEx(GetBitmap( rSrcPt, rSize ));
+
+return BitmapEx(GetBitmap( rSrcPt, rSize ));
 }
 
 void OutputDevice::DrawDeviceBitmapEx( const Point& rDestPt, const Size& 
rDestSize,


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

2023-10-26 Thread Chris Sherlock (via logerrit)
 vcl/source/gdi/textlayout.cxx |  182 ++
 1 file changed, 96 insertions(+), 86 deletions(-)

New commits:
commit adba3022f14d28090a668da10fc3311633535ae8
Author: Chris Sherlock 
AuthorDate: Thu Sep 28 21:14:15 2023 +1000
Commit: Tomaž Vajngerl 
CommitDate: Fri Oct 27 05:48:33 2023 +0200

vcl: flatten TextLayoutCommon::GetEllipsisString()

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

diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx
index 2eaf5746f30b..a1597c69793e 100644
--- a/vcl/source/gdi/textlayout.cxx
+++ b/vcl/source/gdi/textlayout.cxx
@@ -75,117 +75,127 @@ namespace vcl
 OUString aStr = rOrigStr;
 sal_Int32 nIndex = GetTextBreak( aStr, nMaxWidth, 0, aStr.getLength() 
);
 
-if ( nIndex != -1 )
+if (nIndex == -1)
+return aStr;
+
+if( (nStyle & DrawTextFlags::CenterEllipsis) == 
DrawTextFlags::CenterEllipsis )
 {
-if( (nStyle & DrawTextFlags::CenterEllipsis) == 
DrawTextFlags::CenterEllipsis )
+OUStringBuffer aTmpStr( aStr );
+// speed it up by removing all but 1.33x as many as the break pos.
+sal_Int32 nEraseChars = std::max(4, aStr.getLength() - 
(nIndex*4)/3);
+while( nEraseChars < aStr.getLength() && GetTextWidth( 
aTmpStr.toString(), 0, aTmpStr.getLength() ) > nMaxWidth )
 {
-OUStringBuffer aTmpStr( aStr );
-// speed it up by removing all but 1.33x as many as the break 
pos.
-sal_Int32 nEraseChars = std::max(4, 
aStr.getLength() - (nIndex*4)/3);
-while( nEraseChars < aStr.getLength() && GetTextWidth( 
aTmpStr.toString(), 0, aTmpStr.getLength() ) > nMaxWidth )
-{
-aTmpStr = aStr;
-sal_Int32 i = (aTmpStr.getLength() - nEraseChars)/2;
-aTmpStr.remove(i, nEraseChars++);
-aTmpStr.insert(i, "...");
-}
-aStr = aTmpStr.makeStringAndClear();
+aTmpStr = aStr;
+sal_Int32 i = (aTmpStr.getLength() - nEraseChars)/2;
+aTmpStr.remove(i, nEraseChars++);
+aTmpStr.insert(i, "...");
 }
-else if ( nStyle & DrawTextFlags::EndEllipsis )
+aStr = aTmpStr.makeStringAndClear();
+}
+else if ( nStyle & DrawTextFlags::EndEllipsis )
+{
+aStr = aStr.copy(0, nIndex);
+if ( nIndex > 1 )
 {
-aStr = aStr.copy(0, nIndex);
-if ( nIndex > 1 )
+aStr += "...";
+while ( !aStr.isEmpty() && ( GetTextWidth( aStr, 0, 
aStr.getLength() ) > nMaxWidth) )
 {
-aStr += "...";
-while ( !aStr.isEmpty() && ( GetTextWidth( aStr, 0, 
aStr.getLength() ) > nMaxWidth) )
-{
-if ( (nIndex > 1) || (nIndex == aStr.getLength()) )
-nIndex--;
-aStr = aStr.replaceAt( nIndex, 1, u"");
-}
+if ( (nIndex > 1) || (nIndex == aStr.getLength()) )
+nIndex--;
+aStr = aStr.replaceAt( nIndex, 1, u"");
 }
+}
 
-if ( aStr.isEmpty() && (nStyle & DrawTextFlags::Clip) )
-aStr += OUStringChar(rOrigStr[ 0 ]);
+if ( aStr.isEmpty() && (nStyle & DrawTextFlags::Clip) )
+aStr += OUStringChar(rOrigStr[ 0 ]);
+}
+else if ( nStyle & DrawTextFlags::PathEllipsis )
+{
+OUString aPath( rOrigStr );
+OUString aAbbreviatedPath;
+osl_abbreviateSystemPath( aPath.pData, , 
nIndex, nullptr );
+aStr = aAbbreviatedPath;
+}
+else if ( nStyle & DrawTextFlags::NewsEllipsis )
+{
+static char const   pSepChars[] = ".";
+// Determine last section
+sal_Int32 nLastContent = aStr.getLength();
+while ( nLastContent )
+{
+nLastContent--;
+if ( ImplIsCharIn( aStr[ nLastContent ], pSepChars ) )
+break;
 }
-else if ( nStyle & DrawTextFlags::PathEllipsis )
+while ( nLastContent &&
+ImplIsCharIn( aStr[ nLastContent-1 ], pSepChars ) )
+nLastContent--;
+
+OUString aLastStr = aStr.copy(nLastContent);
+OUString aTempLastStr1 = "..." + aLastStr;
+if ( GetTextWidth( aTempLastStr1, 0, aTempLastStr1.getLength() ) > 
nMaxWidth )
 {
-OUString aPath( rOrigStr );
-OUString aAbbreviatedPath;
-

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

2023-10-26 Thread Caolán McNamara (via logerrit)
 vcl/source/window/window2.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 455a1775ccef305cfb96cc5f67c8ee47b7f3a2ae
Author: Caolán McNamara 
AuthorDate: Thu Oct 26 12:18:37 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 26 15:52:33 2023 +0200

crash seen in Window::ImplTrackTimerHdl

 #0  vcl::Window::ImplTrackTimerHdl (this=0x3403b0a0, pTimer=) at libreoffice/vcl/source/window/window2.cxx:231
 #1  0x7f2bdd31f5e7 in Scheduler::CallbackTaskScheduling () at 
libreoffice/vcl/source/app/scheduler.cxx:485
 #2  0x7f2bdd4e5176 in SalTimer::CallCallback (this=) at 
libreoffice/vcl/inc/saltimer.hxx:54
 #3  SvpSalInstance::CheckTimeout (this=this@entry=0x261ef40, 
bExecuteTimers=bExecuteTimers@entry=true)
 at libreoffice/vcl/headless/svpinst.cxx:212
 #4  0x7f2bdd4e713d in SvpSalInstance::ImplYield 
(this=this@entry=0x261ef40, bWait=bWait@entry=true, 
bHandleAllCurrentEvents=bHandleAllCurrentEvents@entry=false)
 at libreoffice/vcl/headless/svpinst.cxx:453
 #5  0x7f2bdd4e74a0 in SvpSalInstance::DoYield (this=0x261ef40, 
bWait=, bHandleAllCurrentEvents=)
at libreoffice/vcl/headless/svpinst.cxx:525

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

diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 1551bad52cd1..ceaebf52bea8 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -221,6 +221,12 @@ void Window::InvertTracking( const tools::Rectangle& 
rRect, ShowTrackFlags nFlag
 
 IMPL_LINK( Window, ImplTrackTimerHdl, Timer*, pTimer, void )
 {
+if (!mpWindowImpl)
+{
+SAL_WARN("vcl", "ImplTrackTimerHdl has outlived dispose");
+return;
+}
+
 ImplSVData* pSVData = ImplGetSVData();
 
 // if Button-Repeat we have to change the timeout


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

2023-10-26 Thread Caolán McNamara (via logerrit)
 vcl/source/window/window2.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 6f3334a204193f9e47f60f45b17dd102148ed586
Author: Caolán McNamara 
AuthorDate: Thu Oct 26 12:30:12 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 26 15:51:53 2023 +0200

add warning for suspicious potential double-tracking

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

diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index c9720139585d..1551bad52cd1 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -265,6 +265,8 @@ void Window::StartTracking( StartTrackingFlags nFlags )
 pTrackWin->EndTracking( TrackingEventFlags::Cancel );
 }
 
+SAL_WARN_IF(pSVData->mpWinData->mpTrackTimer, "vcl", "StartTracking called 
while TrackerTimer still running");
+
 if ( !mpWindowImpl->mbUseFrameData &&
  (nFlags & (StartTrackingFlags::ScrollRepeat | 
StartTrackingFlags::ButtonRepeat)) )
 {


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

2023-10-24 Thread Michael Weghorn (via logerrit)
 vcl/source/treelist/svimpbox.cxx |   17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 6974c10901cc052bce23295ddff25530137e94c8
Author: Michael Weghorn 
AuthorDate: Tue Oct 24 09:49:32 2023 +0200
Commit: Michael Weghorn 
CommitDate: Tue Oct 24 12:57:32 2023 +0200

tdf#135921 a11y: Toggle listbox item checkbox on space

Allow toggling the state of the checkbox in a listbox/
treelist entry using the space key if the entry is currently
selected.

This aligns it with the behavior for "plain" checkboxes.

On the a11y layer, these listbox entries are
even exposed just as a checkbox when there's only
a single checkbox for the entry
(s. `AccessibleListBoxEntry::getAccessibleRole`),
like in the Spelling options dialog ("Tools" -> "Spelling",
then press the "Options..." button).

For the case where there are multiple checkboxes
(like in the Writer autocorrect options dialog),
the first checkbox will be toggled.
Making it possible to toggle any of the checkboxes
for that case would need further work, s.a. the
the related tdf#135585.
(For gtk3, it's possible to use the arrow keys
to switch the column, then use the space key
to toggle the checkbox.)
That scenario also uses a different approach
for the a11y layer, not a single
`AccessibleListBoxEntry` object as is the case
for the tdf#135921 scenario.

This change makes it possible to toggle the checkbox,
but so far, the new state is not yet announced
when a screen reader is running, neither when
using the keyboard nor when using the mouse
(which was possible without this change already).
The event handling that's required for this will
be added in a separate commit.

Change-Id: Ic78f9052d166be0da17a76261a09da02b8a11cd7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158374
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx
index f0fa1938a8a9..559882560a12 100644
--- a/vcl/source/treelist/svimpbox.cxx
+++ b/vcl/source/treelist/svimpbox.cxx
@@ -2326,13 +2326,24 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt)
 // toggle selection
 m_pView->Select( m_pCursor, !m_pView->IsSelected( 
m_pCursor ) );
 }
-else if ( !m_pView->IsSelected( m_pCursor ) )
+else if (m_pView->IsSelected(m_pCursor))
+{
+// trigger button
+SvLBoxItem* pButtonItem = 
m_pCursor->GetFirstItem(SvLBoxItemType::Button);
+if (pButtonItem)
+{
+SvLBoxButton* pButton = 
static_cast(pButtonItem);
+pButton->ClickHdl(m_pCursor);
+InvalidateEntry(m_pCursor);
+}
+else
+bKeyUsed = false;
+}
+else
 {
 SelAllDestrAnch( false );
 m_pView->Select( m_pCursor );
 }
-else
-bKeyUsed = false;
 }
 else
 bKeyUsed = false;


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

2023-10-24 Thread Andrea Gelmini (via logerrit)
 vcl/source/bitmap/BitmapEx.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 28d2ac7c10cc6ef7199781a786d8a3514a14b6be
Author: Andrea Gelmini 
AuthorDate: Tue Oct 24 07:50:14 2023 +0200
Commit: Julien Nabet 
CommitDate: Tue Oct 24 10:09:57 2023 +0200

Fix typo

Change-Id: Ib2e612960f27d103bd25d14b86fa9eb0c0422669
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158367
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx
index 7160a5064453..d29a4aaaff40 100644
--- a/vcl/source/bitmap/BitmapEx.cxx
+++ b/vcl/source/bitmap/BitmapEx.cxx
@@ -678,7 +678,7 @@ namespace
 {
 const Size aDestinationSizePixel(aDestination.GetSizePixel());
 
-// tdf#157795 set color to black outside of of bitmap bounds
+// tdf#157795 set color to black outside of bitmap bounds
 // Due to commit 81994cb2b8b32453a92bcb011830fcb884f22ff3,
 // transparent areas are now black instead of white.
 const BitmapColor aOutside(0x0, 0x0, 0x0);


  1   2   3   4   5   6   7   8   9   10   >