[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - vcl/headless

2021-04-05 Thread Tor Lillqvist (via logerrit)
 vcl/headless/svpinst.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 122a213f12bc73589bef92a9a386196345e78abc
Author: Tor Lillqvist 
AuthorDate: Fri Sep 20 15:03:12 2019 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Apr 6 09:45:14 2021 +0300

Revert "m_FeedbackFDs is unused on iOS"

It is not unused now any longer. However it is unclear whether it
actually is needed or not. I was able to build and run the iOS app
even while it was unused.

This reverts commit 629f9ff63bf3a1e16ed38a737a7fdd074b9c0ca7.

Change-Id: I7c1d1abb6dae5f0739b112883149ea83ca4fb975
Reviewed-on: https://gerrit.libreoffice.org/79285
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 9654243f5ac3..46f1b940c926 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -330,9 +330,7 @@ void SvpSalInstance::ProcessEvent( SalUserEvent aEvent )
 
 SvpSalYieldMutex::SvpSalYieldMutex()
 {
-#ifndef IOS
 m_FeedbackFDs[0] = m_FeedbackFDs[1] = -1;
-#endif
 }
 
 SvpSalYieldMutex::~SvpSalYieldMutex()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-05 Thread Tomaž Vajngerl (via logerrit)
 vcl/quartz/salbmp.cxx |  241 ++
 1 file changed, 11 insertions(+), 230 deletions(-)

New commits:
commit c47ad11f8c2e917adebbd5d7b3a3ef6cc4b3e670
Author: Tomaž Vajngerl 
AuthorDate: Mon Apr 5 23:31:44 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Apr 6 08:40:57 2021 +0200

vcl: quartz - use ScanlineTransformer instead of local converter

ScanlineTransformer was created because there are multiple impl.
of the same tool (ImplPixelFormat), but it never replaced those
duplications. This change removes one of the duplications - the
one in Quartz backend.

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

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 72c0b8d5634f..8fadba1b509e 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef MACOSX
 #include 
@@ -253,226 +254,6 @@ bool QuartzSalBitmap::AllocateUserData()
 return bool(m_pUserBuffer);
 }
 
-namespace {
-
-class ImplPixelFormat
-{
-public:
-static std::unique_ptr GetFormat( sal_uInt16 nBits, const 
BitmapPalette& rPalette );
-
-virtual void StartLine( sal_uInt8* pLine ) = 0;
-virtual void SkipPixel( sal_uInt32 nPixel ) = 0;
-virtual Color ReadPixel() = 0;
-virtual void WritePixel( Color nColor ) = 0;
-virtual ~ImplPixelFormat() { }
-};
-
-class ImplPixelFormat32 : public ImplPixelFormat
-// currently ARGB-format for 32bit depth
-{
-sal_uInt8* pData;
-public:
-virtual void StartLine( sal_uInt8* pLine ) override { pData = pLine; }
-virtual void SkipPixel( sal_uInt32 nPixel ) override
-{
-pData += nPixel << 2;
-}
-virtual Color ReadPixel() override
-{
-const Color c( pData[1], pData[2], pData[3] );
-pData += 4;
-return c;
-}
-virtual void WritePixel( Color nColor ) override
-{
-*pData++ = 0;
-*pData++ = nColor.GetRed();
-*pData++ = nColor.GetGreen();
-*pData++ = nColor.GetBlue();
-}
-};
-
-class ImplPixelFormat24 : public ImplPixelFormat
-// currently BGR-format for 24bit depth
-{
-sal_uInt8* pData;
-public:
-virtual void StartLine( sal_uInt8* pLine ) override { pData = pLine; }
-virtual void SkipPixel( sal_uInt32 nPixel ) override
-{
-pData += (nPixel << 1) + nPixel;
-}
-virtual Color ReadPixel() override
-{
-const Color c( pData[2], pData[1], pData[0] );
-pData += 3;
-return c;
-}
-virtual void WritePixel( Color nColor ) override
-{
-*pData++ = nColor.GetBlue();
-*pData++ = nColor.GetGreen();
-*pData++ = nColor.GetRed();
-}
-};
-
-class ImplPixelFormat8 : public ImplPixelFormat
-{
-private:
-sal_uInt8* pData;
-const BitmapPalette& mrPalette;
-const sal_uInt16 mnPaletteCount;
-
-public:
-explicit ImplPixelFormat8( const BitmapPalette& rPalette )
-: pData(nullptr)
-, mrPalette(rPalette)
-, mnPaletteCount(rPalette.GetEntryCount())
-{
-}
-virtual void StartLine( sal_uInt8* pLine ) override { pData = pLine; }
-virtual void SkipPixel( sal_uInt32 nPixel ) override
-{
-pData += nPixel;
-}
-virtual Color ReadPixel() override
-{
-const sal_uInt8 nIndex(*pData++);
-
-// Caution(!) rPalette.GetEntryCount() may be != (depth^^2)-1 (!)
-if(nIndex < mnPaletteCount)
-return mrPalette[nIndex];
-else
-return COL_BLACK;
-}
-virtual void WritePixel( Color nColor ) override
-{
-*pData++ = static_cast< sal_uInt8 >( mrPalette.GetBestIndex( 
nColor ) );
-}
-};
-
-class ImplPixelFormat4 : public ImplPixelFormat
-{
-private:
-sal_uInt8* pData;
-const BitmapPalette& mrPalette;
-const sal_uInt16 mnPaletteCount;
-sal_uInt32 mnX;
-sal_uInt32 mnShift;
-
-public:
-explicit ImplPixelFormat4( const BitmapPalette& rPalette )
-: pData(nullptr)
-, mrPalette(rPalette)
-, mnPaletteCount(rPalette.GetEntryCount())
-, mnX(0)
-, mnShift(0)
-{
-}
-virtual void SkipPixel( sal_uInt32 nPixel ) override
-{
-mnX += nPixel;
-if( nPixel & 1 )
-{
-mnShift ^= 4;
-}
-}
-virtual void StartLine( sal_uInt8* pLine ) override
-{
-pData = pLine;
-mnX = 0;
-mnShift = 4;
-}
-virtual Color ReadPixel() override
-{
-// Caution(!) rPalette.GetEntryCount() may be != (depth^^2)-1 (!)
-const sal_uInt8 nIndex(( pData[mnX >> 1] >> mnShift) & 0x0f);
-mnX++;
-mnShift ^= 4;
-
-if(nInde

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

2021-04-05 Thread Tomaž Vajngerl (via logerrit)
 vcl/headless/svpbmp.cxx|   44 ++---
 vcl/headless/svpgdi.cxx|8 +-
 vcl/inc/headless/svpbmp.hxx|   10 +++
 vcl/inc/qt5/Qt5Bitmap.hxx  |4 +--
 vcl/inc/qt5/Qt5Tools.hxx   |   13 +
 vcl/inc/quartz/salbmp.h|4 +--
 vcl/inc/salbmp.hxx |5 ++-
 vcl/inc/skia/salbmp.hxx|4 +--
 vcl/inc/unx/salbmp.h   |6 ++--
 vcl/inc/win/salbmp.h   |6 ++--
 vcl/qa/cppunit/skia/skia.cxx   |2 -
 vcl/qt5/Qt5Bitmap.cxx  |   24 --
 vcl/quartz/salbmp.cxx  |   29 +++--
 vcl/skia/salbmp.cxx|   27 ++--
 vcl/source/bitmap/BitmapInfoAccess.cxx |2 -
 vcl/source/bitmap/bitmap.cxx   |4 +--
 vcl/unx/generic/gdi/gdiimpl.cxx|9 ++
 vcl/unx/generic/gdi/salbmp.cxx |   44 -
 vcl/win/gdi/gdiimpl.cxx|2 -
 vcl/win/gdi/salbmp.cxx |   33 +---
 vcl/win/gdi/salgdi2.cxx|2 -
 21 files changed, 147 insertions(+), 135 deletions(-)

New commits:
commit e992f5c53aadbbfdf93a45f4011fc8733315585f
Author: Tomaž Vajngerl 
AuthorDate: Mon Apr 5 22:34:32 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Apr 6 08:40:35 2021 +0200

vcl: use PixelFormat enum in SalBitmap interface and backends

This changes all backends to use PixelFormat as the input to
the SalBitmap::Create method (and all the backends). This is the
first part as we need to make sure to also limit the use of
GetBitCount method and also use of it in SalGraphics.

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

diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx
index 4524478078ac..29b85a1acf91 100644
--- a/vcl/headless/svpbmp.cxx
+++ b/vcl/headless/svpbmp.cxx
@@ -48,18 +48,9 @@ SvpSalBitmap::~SvpSalBitmap()
 
 static std::unique_ptr ImplCreateDIB(
 const Size& rSize,
-sal_uInt16 nBitCount,
+vcl::PixelFormat ePixelFormat,
 const BitmapPalette& rPal)
 {
-assert(
-  (nBitCount ==  0
-|| nBitCount ==  1
-|| nBitCount ==  4
-|| nBitCount ==  8
-|| nBitCount == 24
-|| nBitCount == 32)
-&& "Unsupported BitCount!");
-
 if (!rSize.Width() || !rSize.Height())
 return nullptr;
 
@@ -74,32 +65,35 @@ static std::unique_ptr ImplCreateDIB(
 return nullptr;
 }
 
-const sal_uInt16 nColors = ( nBitCount <= 8 ) ? ( 1 << nBitCount ) : 0;
-
-switch (nBitCount)
+switch (ePixelFormat)
 {
-case 1:
+case vcl::PixelFormat::N1_BPP:
 pDIB->mnFormat = ScanlineFormat::N1BitLsbPal;
 break;
-case 8:
+case vcl::PixelFormat::N8_BPP:
 pDIB->mnFormat = ScanlineFormat::N8BitPal;
 break;
-case 24:
+case vcl::PixelFormat::N24_BPP:
 pDIB->mnFormat = SVP_24BIT_FORMAT;
 break;
-case 32:
+case vcl::PixelFormat::N32_BPP:
 pDIB->mnFormat = SVP_CAIRO_FORMAT;
 break;
-default:
+case vcl::PixelFormat::INVALID:
 assert(false);
 pDIB->mnFormat = SVP_CAIRO_FORMAT;
+break;
 }
 
+sal_uInt16 nColors = 0;
+if (ePixelFormat <= vcl::PixelFormat::N8_BPP)
+nColors = vcl::numberOfColors(ePixelFormat);
+
 pDIB->mnFormat |= ScanlineFormat::TopDown;
 pDIB->mnWidth = rSize.Width();
 pDIB->mnHeight = rSize.Height();
 tools::Long nScanlineBase;
-bool bFail = o3tl::checked_multiply(pDIB->mnWidth, nBitCount, 
nScanlineBase);
+bool bFail = o3tl::checked_multiply(pDIB->mnWidth, 
vcl::pixelFormatBitCount(ePixelFormat), nScanlineBase);
 if (bFail)
 {
 SAL_WARN("vcl.gdi", "checked multiply failed");
@@ -111,9 +105,9 @@ static std::unique_ptr ImplCreateDIB(
 SAL_WARN("vcl.gdi", "scanline calculation wraparound");
 return nullptr;
 }
-pDIB->mnBitCount = nBitCount;
+pDIB->mnBitCount = vcl::pixelFormatBitCount(ePixelFormat);
 
-if( nColors )
+if (nColors)
 {
 pDIB->maPalette = rPal;
 pDIB->maPalette.SetEntryCount( nColors );
@@ -155,10 +149,10 @@ void SvpSalBitmap::Create(std::unique_ptr 
pBuf)
 mpDIB = std::move(pBuf);
 }
 
-bool SvpSalBitmap::Create(const Size& rSize, sal_uInt16 nBitCount, const 
BitmapPalette& rPal)
+bool SvpSalBitmap::Create(const Size& rSize, vcl::PixelFormat ePixelFormat, 
const BitmapPalette& rPal)
 {
 Destroy();
-mpDIB = ImplCreateDIB( rSize, nBitCount, rPal );
+mpDIB = ImplCreateDIB(rSize, ePixelFormat, rPal);
 return mpDIB != nullptr;
 }
 
@@ -201,8 +195

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - external/python3

2021-04-05 Thread Tor Lillqvist (via logerrit)
 external/python3/macos-11.patch.0 |   20 
 1 file changed, 20 insertions(+)

New commits:
commit 21354ef11d84224aa90e4b06f77eaa0e79b24878
Author: Tor Lillqvist 
AuthorDate: Tue Dec 1 21:36:05 2020 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Apr 6 09:26:08 2021 +0300

Guard against sysconf(_SC_OPEN_MAX) returning LONG_MAX

That seems to happen in a sandboxed process on macOS, at least. This
caused an apparent hang when invoking Python, for instance simply
through Tools > Macros > Run Macro... .

Change-Id: I6bc055b44f298251ed596084538b98442c215fce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107012
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/external/python3/macos-11.patch.0 
b/external/python3/macos-11.patch.0
index 23fc5f9760c5..3c42d515f6bd 100644
--- a/external/python3/macos-11.patch.0
+++ b/external/python3/macos-11.patch.0
@@ -48,3 +48,23 @@
#else
  #error "unknown architecture for universal build."
#endif
+--- Modules/_posixsubprocess.c
 Modules/_posixsubprocess.c
+@@ -31,6 +31,8 @@
+ # define SYS_getdents64  __NR_getdents64
+ #endif
+ 
++#include 
++
+ #if defined(__sun) && defined(__SVR4)
+ /* readdir64 is used to work around Solaris 9 bug 6395699. */
+ # define readdir readdir64
+@@ -202,7 +202,7 @@
+ #endif
+ #ifdef _SC_OPEN_MAX
+ local_max_fd = sysconf(_SC_OPEN_MAX);
+-if (local_max_fd == -1)
++if (local_max_fd == -1 || local_max_fd == LONG_MAX)
+ #endif
+ local_max_fd = 256;  /* Matches legacy Lib/subprocess.py behavior. */
+ return local_max_fd;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 2 commits - solenv/bin vcl/ios

2021-04-05 Thread Tor Lillqvist (via logerrit)
 solenv/bin/macosx-codesign-app-bundle |   10 ++--
 vcl/ios/DataFlavorMapping.cxx |   81 +-
 2 files changed, 47 insertions(+), 44 deletions(-)

New commits:
commit 67b045c8aa66e2d2c51363d2d8448fa79b467628
Author: Tor Lillqvist 
AuthorDate: Fri Nov 20 01:02:02 2020 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Apr 6 09:13:32 2021 +0300

Check first if there is such a "bin" directory before attempting to use it

In the test-install target in Makefile.in we remove the "bin" folder
of the LibreOfficePython framework.

Change-Id: Idf3d440c4f9465f21b5dcae60d4fc5ac21965dd8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106284
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/solenv/bin/macosx-codesign-app-bundle 
b/solenv/bin/macosx-codesign-app-bundle
index e34eee7e7111..a69efff0d37d 100755
--- a/solenv/bin/macosx-codesign-app-bundle
+++ b/solenv/bin/macosx-codesign-app-bundle
@@ -99,10 +99,12 @@ while read framework; do
 if test ! -L "$version" -a -d "$version"; then
# Assume the framework has a XML (and not binary) Info.plist
id=`grep -A 1 'CFBundleIdentifier' 
"$version/Resources/Info.plist" | tail -1 | sed -e 's,.*,,' -e 
's,.*,,'`
-# files in bin are not covered by signing the framework...
-for scriptorexecutable in $(find $version/bin/ -type f); do
-codesign --verbose --options=runtime --force --identifier=$id 
--sign "$MACOSX_CODESIGNING_IDENTITY" "$scriptorexecutable" >> 
"/tmp/codesign_${fn}.log" 2>&1
-done
+   if test -d $version/bin; then
+   # files in bin are not covered by signing the framework...
+   for scriptorexecutable in $(find $version/bin/ -type f); do
+   codesign --verbose --options=runtime --force 
--identifier=$id --sign "$MACOSX_CODESIGNING_IDENTITY" "$scriptorexecutable" >> 
"/tmp/codesign_${fn}.log" 2>&1
+   done
+   fi
 codesign --verbose --force --identifier=$id --sign 
"$MACOSX_CODESIGNING_IDENTITY" "$version" >> "/tmp/codesign_${fn}.log" 2>&1
if [ "$?" != "0" ] ; then
exit 1
commit 77600de374646893146c6690e942f1cec898931f
Author: Tor Lillqvist 
AuthorDate: Fri Jan 15 15:32:58 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Tue Apr 6 09:07:28 2021 +0300

Fix handling of the OBJECTDESCRIPTOR clipboard (pasteboard) type on iOS

This should fix https://github.com/CollaboraOnline/online/issues/849

This is based on the corresponding fix for macOS. Much of our
clipboard code for iOS is based on that for macOS.

We need the pasteboard to have the OBJECTDESCRIPTOR type as a MIME
type that includes the typename attribute, because the code in sc
checks for that when it decides whether it is a proper
OBJECTDESCRIPTOR.

Simplify the data in the flavorMap array. No need to duplicate the
same MIME type string as both the pasteboard type and MIME type, for
those cases where the MIME type is used diretly as pasteboard type. We
also know that for those types, the MIME type might have additional
parameters, so be more lenient in checking.

With this change, and my recent change to sot, this now works:

Start the Collabora Office app. Open a spreadsheet. Select a cell
range. (It can include formulas.) Copy. Close the spreadsheet
document.

(Killing the app process is not necessary, as no in-process
clipboard is kept on iOS, but to make sure you are really accessing
the system pasteboard and not some in-process cache, feel free to kill
the process. After that, start Collabora Office again.)

Open a spreadsheet. Paste. You get the very same cells that you pasted
as such (with relative cell addresses in formulas properly adjusted,
as expected).

Previously, it would paste an image of the copied cell range, which is
fairly pointless.

There is still lots of opportunity for cleanup in the clipboard code
for macOS and iOS.

Change-Id: I4a385d52bbaafcd2ab8cb18e8f613c5efa592d11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109368
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109373
Tested-by: Jenkins CollaboraOffice 

diff --git a/vcl/ios/DataFlavorMapping.cxx b/vcl/ios/DataFlavorMapping.cxx
index a53cd8afdecb..6a3815cf7eb3 100644
--- a/vcl/ios/DataFlavorMapping.cxx
+++ b/vcl/ios/DataFlavorMapping.cxx
@@ -80,21 +80,6 @@ NSString* PBTYPE_PNG = (__bridge NSString*)kUTTypePNG;
 NSString* PBTYPE_JPEG = (__bridge NSString*)kUTTypeJPEG;
 NSString* PBTYPE_HTML = (__bridge NSString*)kUTTypeHTML;
 NSString* PBTYPE_PDF = (__bridge NSString*)kUTTypePDF;
-NSString* PBTYPE_SESX
-= @"application/x-openoffice-embed-source-xml;windows_formatname=\"Star 
Embed Sourc

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

2021-04-05 Thread Tomaž Vajngerl (via logerrit)
 vcl/inc/qt5/Qt5Bitmap.hxx   |4 -
 vcl/qt5/Qt5Bitmap.cxx   |  135 
 vcl/qt5/Qt5Graphics_GDI.cxx |   22 +--
 3 files changed, 18 insertions(+), 143 deletions(-)

New commits:
commit 615ceb107e9faf01b568b0a2440a3f09c8f88ca6
Author: Tomaž Vajngerl 
AuthorDate: Tue Apr 6 10:21:01 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Apr 6 06:35:11 2021 +0200

vcl: remove 4-bit bitmap support from qt5 backend

We removed 4-bit support for bitmaps, but the qt5 backend still has
(special) support this bitmap format, which now can safely be
removed and make the backend a lot simpler.

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

diff --git a/vcl/inc/qt5/Qt5Bitmap.hxx b/vcl/inc/qt5/Qt5Bitmap.hxx
index 8ff4297e43f0..201742ef39cd 100644
--- a/vcl/inc/qt5/Qt5Bitmap.hxx
+++ b/vcl/inc/qt5/Qt5Bitmap.hxx
@@ -29,11 +29,7 @@ class Qt5Bitmap final : public SalBitmap
 {
 std::unique_ptr m_pImage;
 BitmapPalette m_aPalette;
-
-// for 4bit support
-std::unique_ptr m_pBuffer;
 Size m_aSize;
-sal_uInt32 m_nScanline;
 
 public:
 Qt5Bitmap();
diff --git a/vcl/qt5/Qt5Bitmap.cxx b/vcl/qt5/Qt5Bitmap.cxx
index fd7932f879bd..a9ea1f707431 100644
--- a/vcl/qt5/Qt5Bitmap.cxx
+++ b/vcl/qt5/Qt5Bitmap.cxx
@@ -41,33 +41,11 @@ bool Qt5Bitmap::Create(const Size& rSize, sal_uInt16 
nBitCount, const BitmapPale
 
 if (nBitCount == 1)
 assert(2 >= rPal.GetEntryCount());
-if (nBitCount == 4)
-assert(16 >= rPal.GetEntryCount());
 if (nBitCount == 8)
 assert(256 >= rPal.GetEntryCount());
 
-if (nBitCount == 4)
-{
-m_pImage.reset();
-m_aSize = rSize;
-bool bFail = o3tl::checked_multiply(rSize.Width(), 
nBitCount, m_nScanline);
-if (bFail)
-{
-SAL_WARN("vcl.gdi", "checked multiply failed");
-return false;
-}
-m_nScanline = AlignedWidth4Bytes(m_nScanline);
-sal_uInt8* pBuffer = nullptr;
-if (0 != m_nScanline && 0 != rSize.Height())
-pBuffer = new sal_uInt8[m_nScanline * rSize.Height()];
-m_pBuffer.reset(pBuffer);
-}
-else
-{
-m_pImage.reset(new QImage(toQSize(rSize), getBitFormat(nBitCount)));
-m_pImage->fill(Qt::transparent);
-m_pBuffer.reset();
-}
+m_pImage.reset(new QImage(toQSize(rSize), getBitFormat(nBitCount)));
+m_pImage->fill(Qt::transparent);
 m_aPalette = rPal;
 
 auto count = rPal.GetEntryCount();
@@ -84,25 +62,7 @@ bool Qt5Bitmap::Create(const Size& rSize, sal_uInt16 
nBitCount, const BitmapPale
 bool Qt5Bitmap::Create(const SalBitmap& rSalBmp)
 {
 const Qt5Bitmap* pBitmap = static_cast(&rSalBmp);
-if (pBitmap->m_pImage)
-{
-m_pImage.reset(new QImage(*pBitmap->m_pImage));
-m_pBuffer.reset();
-}
-else
-{
-m_aSize = pBitmap->m_aSize;
-m_nScanline = pBitmap->m_nScanline;
-sal_uInt8* pBuffer = nullptr;
-if (0 != m_nScanline && 0 != m_aSize.Height())
-{
-sal_uInt32 nSize = m_nScanline * m_aSize.Height();
-pBuffer = new sal_uInt8[nSize];
-memcpy(pBuffer, pBitmap->m_pBuffer.get(), nSize);
-}
-m_pBuffer.reset(pBuffer);
-m_pImage.reset();
-}
+m_pImage.reset(new QImage(*pBitmap->m_pImage));
 m_aPalette = pBitmap->m_aPalette;
 return true;
 }
@@ -113,64 +73,16 @@ bool Qt5Bitmap::Create(const SalBitmap& rSalBmp, 
SalGraphics* pSalGraphics)
 Qt5Graphics* pGraphics = static_cast(pSalGraphics);
 QImage* pImage = pGraphics->m_pQImage;
 m_pImage.reset(new 
QImage(pBitmap->m_pImage->convertToFormat(pImage->format(;
-m_pBuffer.reset();
 return true;
 }
 
 bool Qt5Bitmap::Create(const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount)
 {
-assert((nNewBitCount == 1 || nNewBitCount == 4 || nNewBitCount == 8 || 
nNewBitCount == 24
-|| nNewBitCount == 32)
+assert((nNewBitCount == 1 || nNewBitCount == 8 || nNewBitCount == 24 || 
nNewBitCount == 32)
&& "Unsupported BitCount!");
 
 const Qt5Bitmap* pBitmap = static_cast(&rSalBmp);
-if (pBitmap->m_pBuffer)
-{
-if (nNewBitCount != 32)
-return false;
-
-// convert 4bit indexed palette to 32bit ARGB
-m_pImage.reset(new QImage(pBitmap->m_aSize.Width(), 
pBitmap->m_aSize.Height(),
-  getBitFormat(nNewBitCount)));
-m_pImage->fill(Qt::transparent);
-
-// prepare a whole palette
-const BitmapPalette& rPal = pBitmap->m_aPalette;
-QVector colorTable(16);
-int i = 0, maxEntry = pBitmap->m_aPalette.GetEntryCount();
-assert(maxEntry <= 16 && maxEntry >= 0);
-for (; i < maxEntry; ++i)
-colorTable[i] = qRgb(rPal[i].GetRed(), rPal[i].Ge

[Libreoffice-commits] core.git: Branch 'feature/cib_contract138c' - sdext/source

2021-04-05 Thread Vasily Melenchuk (via logerrit)
 sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 52f605c1506bac06a3ac727507c00b79a6063ca4
Author: Vasily Melenchuk 
AuthorDate: Mon Apr 5 23:38:21 2021 +0300
Commit: Vasily Melenchuk 
CommitDate: Mon Apr 5 23:38:21 2021 +0300

poppler: use o3tl::make_unique instead of std::make_unique

This older varialt is still used on that branch

Change-Id: I36331b672fb499218745bdcd00d077e36272f4fe

diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
index 48f46961f07e..a2d2ce3226ca 100644
--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
@@ -69,7 +69,7 @@ int main(int argc, char **argv)
 
 // read config file
 #if POPPLER_CHECK_VERSION(0, 83, 0)
-globalParams = std::make_unique();
+globalParams = o3tl::make_unique();
 #else
 globalParams = new GlobalParams();
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-05 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtk3gtkinst.cxx |   31 +++
 1 file changed, 31 insertions(+)

New commits:
commit c7cfd3323cf80d5953f5c3808c1afd6fec0c674b
Author: Caolán McNamara 
AuthorDate: Mon Apr 5 20:25:42 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 5 22:20:22 2021 +0200

tdf#141499 trigger container_focus_changed for toplevel window focus events

retaining the single callback of

commit 9ffd28c32a301141a26e41ddd0cf485a562c83bb
Date:   Fri Mar 5 16:13:19 2021 +

use container_focus_changed instead of toplevel_focus_changed

for focus events affecting the container where for gen its all the same
thing, but restore the gtk code for toplevel window gaining/losing focus
which set-focus-child doesn't fire on

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

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 95377fbe6594..377ac47461de 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -4075,6 +4075,7 @@ class GtkInstanceWindow : public GtkInstanceContainer, 
public virtual weld::Wind
 private:
 GtkWindow* m_pWindow;
 rtl::Reference m_xWindow; //uno api
+gulong m_nToplevelFocusChangedSignalId;
 
 static gboolean help_pressed(GtkAccelGroup*, GObject*, guint, 
GdkModifierType, gpointer widget)
 {
@@ -4083,6 +4084,12 @@ private:
 return true;
 }
 
+static void signalToplevelFocusChanged(GtkWindow*, GParamSpec*, gpointer 
widget)
+{
+GtkInstanceWindow* pThis = static_cast(widget);
+pThis->signal_container_focus_changed();
+}
+
 bool isPositioningAllowed() const
 {
 bool bPositioningAllowed = true;
@@ -4100,6 +4107,7 @@ public:
 GtkInstanceWindow(GtkWindow* pWindow, GtkInstanceBuilder* pBuilder, bool 
bTakeOwnership)
 : GtkInstanceContainer(GTK_CONTAINER(pWindow), pBuilder, 
bTakeOwnership)
 , m_pWindow(pWindow)
+, m_nToplevelFocusChangedSignalId(0)
 {
 const bool bIsFrameWeld = pBuilder == nullptr;
 if (!bIsFrameWeld)
@@ -4259,6 +4267,27 @@ public:
 return aData.ToStr();
 }
 
+virtual void connect_container_focus_changed(const Link& 
rLink) override
+{
+if (!m_nToplevelFocusChangedSignalId)
+m_nToplevelFocusChangedSignalId = g_signal_connect(m_pWindow, 
"notify::has-toplevel-focus", G_CALLBACK(signalToplevelFocusChanged), this);
+GtkInstanceContainer::connect_container_focus_changed(rLink);
+}
+
+virtual void disable_notify_events() override
+{
+if (m_nToplevelFocusChangedSignalId)
+g_signal_handler_block(m_pWidget, m_nToplevelFocusChangedSignalId);
+GtkInstanceContainer::disable_notify_events();
+}
+
+virtual void enable_notify_events() override
+{
+GtkInstanceContainer::enable_notify_events();
+if (m_nToplevelFocusChangedSignalId)
+g_signal_handler_unblock(m_pWidget, 
m_nToplevelFocusChangedSignalId);
+}
+
 virtual VclPtr screenshot() override
 {
 // detect if we have to manually setup its size
@@ -4312,6 +4341,8 @@ public:
 
 virtual ~GtkInstanceWindow() override
 {
+if (m_nToplevelFocusChangedSignalId)
+g_signal_handler_disconnect(m_pWindow, 
m_nToplevelFocusChangedSignalId);
 if (m_xWindow.is())
 m_xWindow->clear();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-05 Thread Caolán McNamara (via logerrit)
 cui/source/dialogs/cuihyperdlg.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 30507382e11e2340c7dee7adced1f5f37a2d9e7f
Author: Caolán McNamara 
AuthorDate: Mon Apr 5 20:02:37 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 5 21:44:49 2021 +0200

Related: tdf#141499 don't grab focus during teardown of dialog

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

diff --git a/cui/source/dialogs/cuihyperdlg.cxx 
b/cui/source/dialogs/cuihyperdlg.cxx
index f4da049c61cb..42d17b2fe720 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -150,6 +150,8 @@ SvxHpLinkDlg::SvxHpLinkDlg(SfxBindings* pBindings, 
SfxChildWindow* pChild, weld:
 
 SvxHpLinkDlg::~SvxHpLinkDlg()
 {
+mbGrabFocus = false; // don't do any grab if tear-down moves focus around 
during destruction
+
 // delete config item, so the base class (SfxModelessDialogController) can 
not load it on the next start
 SvtViewOptions aViewOpt( EViewType::TabDialog, 
OUString::number(SID_HYPERLINK_DIALOG) );
 aViewOpt.Delete();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 2 commits - sfx2/source sw/source

2021-04-05 Thread Caolán McNamara (via logerrit)
 sfx2/source/sidebar/Deck.cxx |7 +--
 sw/source/filter/basflt/fltshell.cxx |5 ++---
 2 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 92b6f24e27e91b08439e3379eb1c83bde7082308
Author: Caolán McNamara 
AuthorDate: Tue Nov 24 13:06:13 2020 +
Commit: Michael Meeks 
CommitDate: Mon Apr 5 20:31:34 2021 +0100

ofz#27817 null deref

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

diff --git a/sw/source/filter/basflt/fltshell.cxx 
b/sw/source/filter/basflt/fltshell.cxx
index 1fe51c4afbd5..9a2a9ddf8148 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -632,9 +632,8 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& 
rTmpPos,
 {
 SwTextNode const*const pTextNode(
 aRegion.End()->nNode.GetNode().GetTextNode());
-assert(pTextNode);
-SwTextField const*const pField(pTextNode->GetFieldTextAttrAt(
-aRegion.End()->nContent.GetIndex() - 1, true));
+SwTextField const*const pField = pTextNode ? 
pTextNode->GetFieldTextAttrAt(
+aRegion.End()->nContent.GetIndex() - 1, true) : 
nullptr;
 if (pField)
 {
 SwPostItField const*const pPostIt(
commit 3412a6ac0283b5c0e9fca7f1cf80f3a75a4f3675
Author: Michael Meeks 
AuthorDate: Sat Jan 16 17:56:06 2021 +
Commit: Michael Meeks 
CommitDate: Mon Apr 5 20:28:50 2021 +0100

sidebar: only invalidate when things change.

Change-Id: Icc9c5bcde224cc979b834585531b847f1c5f7d0b
Signed-off-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109457
Tested-by: Jenkins

diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 1cc11cafc37e..9c0c37041f58 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -430,8 +430,11 @@ void 
Deck::ScrollContainerWindow::Paint(vcl::RenderContext& rRenderContext, cons
 
 void Deck::ScrollContainerWindow::SetSeparators (const 
::std::vector& rSeparators)
 {
-maSeparators = rSeparators;
-Invalidate();
+if (rSeparators != maSeparators)
+{
+maSeparators = rSeparators;
+Invalidate();
+}
 }
 
 } // end of namespace sfx2::sidebar
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 6 commits - framework/source sc/source sfx2/source

2021-04-05 Thread Michael Meeks (via logerrit)
 framework/source/layoutmanager/helpers.cxx |6 ++
 sc/source/core/data/table2.cxx |   23 ++-
 sc/source/ui/view/viewdata.cxx |7 ++-
 sfx2/source/sidebar/DeckLayouter.cxx   |7 ++-
 sfx2/source/sidebar/SidebarController.cxx  |9 +++--
 sfx2/source/sidebar/TabBar.cxx |5 +
 sfx2/source/view/lokhelper.cxx |3 +++
 7 files changed, 51 insertions(+), 9 deletions(-)

New commits:
commit 129a42fd08850226eb3eed0dce2fb923b4d48697
Author: Michael Meeks 
AuthorDate: Fri Jan 22 21:10:49 2021 +
Commit: Michael Meeks 
CommitDate: Mon Apr 5 20:26:56 2021 +0100

lok: avoid expensive fetching of a property.

--doc_setView
   SfxLokHelper::setView
   SfxViewFrame::MakeActive_Impl
   SfxApplication::SetViewFrame_Impl
   |
--SfxDispatcher::Update_Impl
  |
   --SfxWorkWindow::UpdateObjectBars_Impl
 SfxWorkWindow::UpdateObjectBars_Impl2
 |
  --framework::LayoutManager::requestElement
framework::LayoutManager::createElement
|
--11.97%--framework::implts_isPreviewModel

We re-calculate the calc print-area on every setView via this
code-path; pointlessly expensive.

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

diff --git a/framework/source/layoutmanager/helpers.cxx 
b/framework/source/layoutmanager/helpers.cxx
index 7c620b699fcd..f5fe1fc48f44 100644
--- a/framework/source/layoutmanager/helpers.cxx
+++ b/framework/source/layoutmanager/helpers.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -261,6 +262,11 @@ uno::Reference< frame::XModel > impl_getModelFromFrame( 
const uno::Reference< fr
 
 bool implts_isPreviewModel( const uno::Reference< frame::XModel >& xModel )
 {
+// the cost in calc of calling getArgs for this property
+// includes measuring the entire sheet - which is extremely slow.
+if (comphelper::LibreOfficeKit::isActive())
+return false;
+
 if ( xModel.is() )
 {
 utl::MediaDescriptor aDesc( xModel->getArgs() );
commit 2519a7d1392ecec9bd8027117bb02b08fb7bcfa8
Author: Michael Meeks 
AuthorDate: Fri Jan 22 21:17:25 2021 +
Commit: Michael Meeks 
CommitDate: Mon Apr 5 20:26:56 2021 +0100

sc: GetRowForHeight performance improvement.

Instead of just skipping hidden rows, either skip or interpolate
into visible ones.

This method, and it's single caller look rather unusual to me. It is
unclear why we would want to return the results we do, and why the
one caller subtracts a row.

Some surprising proportion of tile rendering was exercising this code
path extremely slowly.

--5.94%--ScDocument::GetPrintArea
  |
  |--5.04%--ScDrawLayer::GetPrintArea
  |  ScTable::GetRowForHeight
  |  |
  |   --4.58%--ScFlatBoolRowSegments::getRangeData
  | |
  |  --2.46%--ScFlatSegmentsImpl::getRangeData

Change-Id: I75418d6af59a33b99e8bb0c374139e1a4ee6ef87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109837
Tested-by: Jenkins CollaboraOffice 
Tested-by: Michael Meeks 
Reviewed-by: Ashod Nakashian 
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109848
Tested-by: Jenkins

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 02a9ad19cbaf..33ca0d85128f 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -3998,16 +3998,25 @@ SCROW ScTable::GetRowForHeight(sal_uLong nHeight) const
 break;
 }
 
-nSum += aRowHeightRange.mnValue;
+// find the last common row between hidden & height spans
+SCROW nLastCommon = std::min(aData.mnRow2, aRowHeightRange.mnRow2);
+assert (nLastCommon >= nRow);
+SCROW nCommon = nLastCommon - nRow + 1;
 
-if (nSum > nHeight)
+// how much further to go ?
+sal_uLong nPixelsLeft = nHeight - nSum;
+sal_uLong nCommonPixels = aRowHeightRange.mnValue * nCommon;
+
+// are we in the zone ?
+if (nCommonPixels > nPixelsLeft)
 {
+nRow += (nPixelsLeft + aRowHeightRange.mnValue - 1) / 
aRowHeightRange.mnValue;
+
+// FIXME: finding this next row is far from elegant,
+// we have a single caller, which subtracts one as well(!?)
 if (nRow >= rDocument.MaxRow())
 return rDocument.MaxRow();
 
-// Find the next visible row.
-++nRow;
-
 if (!mpHidd

[Libreoffice-commits] core.git: sw/source writerfilter/source

2021-04-05 Thread Mike Kaganski (via logerrit)
 sw/source/uibase/dochdl/swdtflvr.cxx   |6 ++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit d7c4d0d4ea83481693af3645a03b03b53e456f60
Author: Mike Kaganski 
AuthorDate: Mon Apr 5 19:19:44 2021 +0300
Commit: Mike Kaganski 
CommitDate: Mon Apr 5 21:26:02 2021 +0200

tdf#136740: Do not initialize document settings when pasting

When pasting from clipboard, the document already has the defaults
set, and pasted text must not change those defaults.

When pasting RTF, RTFDocumentImpl::outputSettingsTable does the document
settings initialization, and is called from RTFDocumentImpl::checkFirstRun
when m_bFirstRun is true. Other defaults are set in the latter function,
too.

This makes m_bFirstRun false when RTFDocumentImpl is created in the context
of a paste operation. Alternatively, checking the context could be made
when deciding if to apply specific settings.

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

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index 6466f17af9c2..bf552656356d 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2162,6 +2163,11 @@ bool SwTransferable::PasteFileContent( 
TransferableDataHelper& rData,
 rSh.SetChgLnk( Link() );
 
 const SwPosition& rInsPos = *rSh.GetCursor()->Start();
+
+// Reader might need to know if we are pasting into an existing 
document, or initializing
+// a new document; e.g. initializing document setting could be skipped 
when pasting.
+css::uno::ContextLayer 
layer(comphelper::NewFlagContext("InPasteFromClipboard"));
+
 SwReader aReader(*pStream, OUString(), OUString(), *rSh.GetCursor());
 rSh.SaveTableBoxContent( &rInsPos );
 
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 005cbdeece7f..2e5b33f97d2b 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -266,7 +267,7 @@ 
RTFDocumentImpl::RTFDocumentImpl(uno::Reference const& x
 , m_pMapperStream(nullptr)
 , m_aDefaultState(this)
 , m_bSkipUnknown(false)
-, m_bFirstRun(true)
+, m_bFirstRun(!comphelper::IsContextFlagActive("InPasteFromClipboard"))
 , m_bFirstRunException(false)
 , m_bNeedPap(true)
 , m_bNeedCr(false)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-05 Thread Caolán McNamara (via logerrit)
 emfio/source/reader/emfreader.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit b5602d5c853ce9479b2920743667e5af1cd63037
Author: Caolán McNamara 
AuthorDate: Mon Apr 5 17:04:47 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 5 20:37:32 2021 +0200

ofz: skip slow path when fuzzing

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

diff --git a/emfio/source/reader/emfreader.cxx 
b/emfio/source/reader/emfreader.cxx
index 7dbfd58a09de..3c40e3a6f914 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -359,6 +360,8 @@ bool ImplReadRegion( tools::PolyPolygon& rPolyPoly, 
SvStream& rStream, sal_uInt3
 if (nLen < nSize)
 return false;
 
+bool bIsFuzzing = utl::ConfigManager::IsFuzzing();
+
 for (sal_uInt32 i = 0; i < nCountRects; ++i)
 {
 rStream.ReadInt32(nLeft);
@@ -367,6 +370,10 @@ bool ImplReadRegion( tools::PolyPolygon& rPolyPoly, 
SvStream& rStream, sal_uInt3
 rStream.ReadInt32(nBottom);
 
 SAL_INFO("emfio", "\t\tLeft: " << nLeft << ", top: " << nTop << ", 
right: " << nRight << ", bottom: " << nBottom);
+
+if (bIsFuzzing && i) // GetUnion is super slow, when fuzzing skip 
after first rect
+continue;
+
 tools::PolyPolygon aPolyPolyOr1(tools::Polygon(tools::Rectangle(nLeft, 
nTop, nRight, nBottom)));
 rPolyPoly.GetUnion(aPolyPolyOr1, rPolyPoly);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-05 Thread Caolán McNamara (via logerrit)
 vcl/workben/commonfuzzer.hxx |1 -
 vcl/workben/fftester.cxx |1 -
 2 files changed, 2 deletions(-)

New commits:
commit 768f09cfe416340839ea66081c805527bf6c7289
Author: Caolán McNamara 
AuthorDate: Mon Apr 5 16:59:18 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 5 18:19:16 2021 +0200

SAL_WMF_COMPLEXCLIP_VIA_REGION is gone now

since...

commit aa17ea3d36b8f1ea8cd3d2fb215e80051547439d
Date:   Fri Apr 2 16:06:11 2021 +0200

tdf#37281 tdf#45820 tdf#48916 tdf#55058 EMF Implement complex clipping

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

diff --git a/vcl/workben/commonfuzzer.hxx b/vcl/workben/commonfuzzer.hxx
index 6a5aa079a2a3..fb8f874a0f74 100644
--- a/vcl/workben/commonfuzzer.hxx
+++ b/vcl/workben/commonfuzzer.hxx
@@ -91,7 +91,6 @@ void CommonInitialize(int *argc, char ***argv)
 setenv("JPEGMEM", "768M", 1);
 setenv("SC_MAX_MATRIX_ELEMENTS", "6000", 1);
 setenv("SC_NO_THREADED_CALCULATION", "1", 1);
-setenv("SAL_WMF_COMPLEXCLIP_VIA_REGION", "1", 1);
 setenv("SAL_DISABLE_PRINTERLIST", "1", 1);
 setenv("SAL_DISABLE_DEFAULTPRINTER", "1", 1);
 setenv("SAL_NO_FONT_LOOKUP", "1", 1);
diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx
index 7ac5a3b234b6..c9c792cbe340 100644
--- a/vcl/workben/fftester.cxx
+++ b/vcl/workben/fftester.cxx
@@ -92,7 +92,6 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
 setenv("JPEGMEM", "768M", 1);
 setenv("SC_MAX_MATRIX_ELEMENTS", "6000", 1);
 setenv("SC_NO_THREADED_CALCULATION", "1", 1);
-setenv("SAL_WMF_COMPLEXCLIP_VIA_REGION", "1", 1);
 setenv("SAL_DISABLE_PRINTERLIST", "1", 1);
 setenv("SAL_DISABLE_DEFAULTPRINTER", "1", 1);
 setenv("SAL_NO_FONT_LOOKUP", "1", 1);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - vcl/ios

2021-04-05 Thread Tor Lillqvist (via logerrit)
 vcl/ios/DataFlavorMapping.cxx |8 
 vcl/ios/DataFlavorMapping.hxx |2 +-
 vcl/ios/clipboard.cxx |7 ++-
 vcl/ios/clipboard.hxx |1 -
 vcl/ios/iOSTransferable.cxx   |   14 +-
 vcl/ios/iOSTransferable.hxx   |3 +--
 6 files changed, 13 insertions(+), 22 deletions(-)

New commits:
commit d1810a4d737480ddfaae1796eddcdb4f34491aa1
Author: Tor Lillqvist 
AuthorDate: Wed Jan 13 00:31:43 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Apr 5 18:20:28 2021 +0300

We only use the systemwide general pasteboard

Simplify code to explicitly use it then instead of using variables.

Change-Id: I915a44cf7275fbf2140671a2edf1da29f1bf4e40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109202
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/ios/DataFlavorMapping.cxx b/vcl/ios/DataFlavorMapping.cxx
index 3579e382f342..a53cd8afdecb 100644
--- a/vcl/ios/DataFlavorMapping.cxx
+++ b/vcl/ios/DataFlavorMapping.cxx
@@ -425,13 +425,13 @@ NSString* 
DataFlavorMapper::openOfficeToSystemFlavor(const DataFlavor& oOOFlavor
 return sysFlavor;
 }
 
-NSString* DataFlavorMapper::openOfficeImageToSystemFlavor(UIPasteboard* 
pPasteboard)
+NSString* DataFlavorMapper::openOfficeImageToSystemFlavor()
 {
-if ([pPasteboard containsPasteboardTypes:@[ PBTYPE_PNG ]])
+if ([[UIPasteboard generalPasteboard] containsPasteboardTypes:@[ 
PBTYPE_PNG ]])
 return PBTYPE_PNG;
-else if ([pPasteboard containsPasteboardTypes:@[ PBTYPE_JPEG ]])
+else if ([[UIPasteboard generalPasteboard] containsPasteboardTypes:@[ 
PBTYPE_JPEG ]])
 return PBTYPE_JPEG;
-else if ([pPasteboard containsPasteboardTypes:@[ PBTYPE_PDF ]])
+else if ([[UIPasteboard generalPasteboard] containsPasteboardTypes:@[ 
PBTYPE_PDF ]])
 return PBTYPE_PDF;
 return @"";
 }
diff --git a/vcl/ios/DataFlavorMapping.hxx b/vcl/ios/DataFlavorMapping.hxx
index 7e527dc09c34..fa45be243e9e 100644
--- a/vcl/ios/DataFlavorMapping.hxx
+++ b/vcl/ios/DataFlavorMapping.hxx
@@ -80,7 +80,7 @@ public:
  If there is no suitable mapping available NULL will
  be returned.
   */
-static NSString* openOfficeImageToSystemFlavor(UIPasteboard* pPasteboard);
+static NSString* openOfficeImageToSystemFlavor();
 
 /* Get a data provider which is able to provide the data 'rTransferable' 
offers in a format that can
  be put on to the system clipboard.
diff --git a/vcl/ios/clipboard.cxx b/vcl/ios/clipboard.cxx
index ad0af57e3995..46dfa92bfcd7 100644
--- a/vcl/ios/clipboard.cxx
+++ b/vcl/ios/clipboard.cxx
@@ -36,9 +36,6 @@ iOSClipboard::iOSClipboard()
 mrXMimeCntFactory = 
css::datatransfer::MimeContentTypeFactory::create(xContext);
 
 mpDataFlavorMapper.reset(new DataFlavorMapper());
-
-mPasteboard = [UIPasteboard generalPasteboard];
-assert(mPasteboard != nil);
 }
 
 iOSClipboard::~iOSClipboard() {}
@@ -48,7 +45,7 @@ css::uno::Reference 
SAL_CALL iOSClipboard::get
 osl::MutexGuard aGuard(m_aMutex);
 
 return css::uno::Reference(
-new iOSTransferable(mrXMimeCntFactory, mpDataFlavorMapper, 
mPasteboard));
+new iOSTransferable(mrXMimeCntFactory, mpDataFlavorMapper));
 }
 
 void SAL_CALL iOSClipboard::setContents(
@@ -75,7 +72,7 @@ void SAL_CALL iOSClipboard::setContents(
 }
 }
 SAL_INFO("vcl.ios.clipboard", "Setting pasteboard items: " << 
NSDictionaryKeysToOUString(dict));
-[mPasteboard setItems:array options:@{}];
+[[UIPasteboard generalPasteboard] setItems:array options:@{}];
 
 // We don't keep a copy of the clipboard contents around in-process, so 
fire the lost clipboard
 // ownership event right away.
diff --git a/vcl/ios/clipboard.hxx b/vcl/ios/clipboard.hxx
index 144e9c3acdee..66a4dd1b5591 100644
--- a/vcl/ios/clipboard.hxx
+++ b/vcl/ios/clipboard.hxx
@@ -103,7 +103,6 @@ private:
 mClipboardListeners;
 css::uno::Reference 
mXClipboardOwner;
 std::shared_ptr mpDataFlavorMapper;
-UIPasteboard* mPasteboard;
 };
 
 #endif // INCLUDED_VCL_IOS_CLIPBOARD_HXX
diff --git a/vcl/ios/iOSTransferable.cxx b/vcl/ios/iOSTransferable.cxx
index 1ae2277014b6..6e1bd00b3a97 100644
--- a/vcl/ios/iOSTransferable.cxx
+++ b/vcl/ios/iOSTransferable.cxx
@@ -86,18 +86,14 @@ bool cmpAllContentTypeParameter(const 
Reference& xLhs,
 } // unnamed namespace
 
 iOSTransferable::iOSTransferable(const Reference& 
rXMimeCntFactory,
- std::shared_ptr 
pDataFlavorMapper,
- UIPasteboard* pasteboard)
+ std::shared_ptr 
pDataFlavorMapper)
 : mrXMimeCntFactory(rXMimeCntFactory)
 , mDataFlavorMapper(pDataFlavorMapper)
-, mPasteboard(pasteboard)
 {
-[mPasteboard retain];
-
 initClipboardItemList();
 }
 
-iOSTransferable::~iOSTransferable() { [mPasteboard release]; }
+iOSTransferable::~iOSTransferable() {}
 
 Any SAL_CALL iOSTransferable::getTransferData(const

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - vcl/ios

2021-04-05 Thread Tor Lillqvist (via logerrit)
 vcl/ios/DataFlavorMapping.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 76c34902ea57a63eb394c6759fc3b688d82cf31a
Author: Tor Lillqvist 
AuthorDate: Tue Jan 12 22:48:34 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Apr 5 18:19:42 2021 +0300

Log successful mapping from system pasteboard format to internal MIME type

Change-Id: I98bedc8fc07a56fbbf3e175277cc9846da46a8c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109201
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/ios/DataFlavorMapping.cxx b/vcl/ios/DataFlavorMapping.cxx
index dc0e5ba90a55..3579e382f342 100644
--- a/vcl/ios/DataFlavorMapping.cxx
+++ b/vcl/ios/DataFlavorMapping.cxx
@@ -559,6 +559,8 @@ DataFlavorMapper::typesArrayToFlavorSequence(NSArray* 
types) const
 {
 flavors.realloc(flavors.getLength() + 1);
 flavors[flavors.getLength() - 1] = oOOFlavor;
+SAL_INFO("vcl.ios.clipboard",
+ "Mapped " << [sysFormat UTF8String] << " to " << 
oOOFlavor.MimeType);
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - vcl/ios

2021-04-05 Thread Tor Lillqvist (via logerrit)
 vcl/ios/DataFlavorMapping.cxx |5 -
 vcl/ios/clipboard.cxx |1 +
 vcl/ios/iOSTransferable.cxx   |   13 +++--
 3 files changed, 8 insertions(+), 11 deletions(-)

New commits:
commit e5f4d42bd9baa801f203154c27cca9d4be4dfc72
Author: Tor Lillqvist 
AuthorDate: Mon Dec 21 15:18:21 2020 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Apr 5 18:19:05 2021 +0300

Improve SAL_INFO output for clipboard operations on iOS

Change-Id: Id9ed115067655c62346f765ddc3ed9bdce05ab9f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108101
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/ios/DataFlavorMapping.cxx b/vcl/ios/DataFlavorMapping.cxx
index 962e9c49af21..dc0e5ba90a55 100644
--- a/vcl/ios/DataFlavorMapping.cxx
+++ b/vcl/ios/DataFlavorMapping.cxx
@@ -559,8 +559,11 @@ DataFlavorMapper::typesArrayToFlavorSequence(NSArray* 
types) const
 {
 flavors.realloc(flavors.getLength() + 1);
 flavors[flavors.getLength() - 1] = oOOFlavor;
+}
+else
+{
 SAL_INFO("vcl.ios.clipboard",
- "Mapped " << [sysFormat UTF8String] << " to " << 
oOOFlavor.MimeType);
+ "Was not able to map " << [sysFormat UTF8String] << " to 
an internal flavour");
 }
 }
 
diff --git a/vcl/ios/clipboard.cxx b/vcl/ios/clipboard.cxx
index b60cda1bef4d..ad0af57e3995 100644
--- a/vcl/ios/clipboard.cxx
+++ b/vcl/ios/clipboard.cxx
@@ -74,6 +74,7 @@ void SAL_CALL iOSClipboard::setContents(
 dict[types[i]] = pBoardData;
 }
 }
+SAL_INFO("vcl.ios.clipboard", "Setting pasteboard items: " << 
NSDictionaryKeysToOUString(dict));
 [mPasteboard setItems:array options:@{}];
 
 // We don't keep a copy of the clipboard contents around in-process, so 
fire the lost clipboard
diff --git a/vcl/ios/iOSTransferable.cxx b/vcl/ios/iOSTransferable.cxx
index 9ec27867fb0b..1ae2277014b6 100644
--- a/vcl/ios/iOSTransferable.cxx
+++ b/vcl/ios/iOSTransferable.cxx
@@ -25,6 +25,8 @@
 #include 
 #include 
 
+#include 
+
 #include "iOSTransferable.hxx"
 
 #include "DataFlavorMapping.hxx"
@@ -143,16 +145,7 @@ void iOSTransferable::initClipboardItemList()
 throw RuntimeException("Cannot get clipboard data", 
static_cast(this));
 }
 
-#ifdef SAL_LOG_INFO
-NSString* types = @"";
-for (unsigned i = 0; i < [pboardFormats count]; i++)
-{
-if ([types length] > 0)
-types = [types stringByAppendingString:@", "];
-types = [types stringByAppendingString:[pboardFormats 
objectAtIndex:i]];
-}
-SAL_INFO("vcl.ios.clipboard", "Types on clipboard: " << [types 
UTF8String]);
-#endif
+SAL_INFO("vcl.ios.clipboard", "Types on clipboard: " << 
NSStringArrayToOUString(pboardFormats));
 
 mFlavorList = mDataFlavorMapper->typesArrayToFlavorSequence(pboardFormats);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - vcl/inc vcl/quartz

2021-04-05 Thread Tor Lillqvist (via logerrit)
 vcl/inc/quartz/utils.h |2 ++
 vcl/quartz/utils.cxx   |   26 ++
 2 files changed, 28 insertions(+)

New commits:
commit 4b4eb3c365bebdaa6b07551dd5f5db28d40b7f31
Author: Tor Lillqvist 
AuthorDate: Mon Dec 21 15:15:54 2020 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Apr 5 18:17:40 2021 +0300

Add two debug output helper functions

Change-Id: I38a234e6f4a3fc5e0f17cfd9a0068d2081b6c654
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108099
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/vcl/inc/quartz/utils.h b/vcl/inc/quartz/utils.h
index a2a39f2605d2..759e47f72f2b 100644
--- a/vcl/inc/quartz/utils.h
+++ b/vcl/inc/quartz/utils.h
@@ -38,6 +38,8 @@ OUString GetOUString( CFStringRef );
 OUString GetOUString( const NSString* );
 CFStringRef CreateCFString( const OUString& );
 NSString* CreateNSString( const OUString& );
+OUString NSStringArrayToOUString(NSArray* array);
+OUString NSDictionaryKeysToOUString(NSDictionary* dict);
 
 std::ostream &operator <<(std::ostream& s, const CGRect &rRect);
 std::ostream &operator <<(std::ostream& s, const CGPoint &rPoint);
diff --git a/vcl/quartz/utils.cxx b/vcl/quartz/utils.cxx
index cc18eb0d409f..0182ec118886 100644
--- a/vcl/quartz/utils.cxx
+++ b/vcl/quartz/utils.cxx
@@ -85,6 +85,32 @@ NSString* CreateNSString( const OUString& rStr )
 return [[NSString alloc] initWithCharacters: reinterpret_cast(rStr.getStr()) length: rStr.getLength()];
 }
 
+OUString NSStringArrayToOUString(NSArray* array)
+{
+OUString result = "[";
+OUString sep;
+for (unsigned i = 0; i < [array count]; i++)
+{
+result = result + sep + OUString::fromUtf8([[array objectAtIndex:i] 
UTF8String]);
+sep = ",";
+}
+result = result + "]";
+return result;
+}
+
+OUString NSDictionaryKeysToOUString(NSDictionary* dict)
+{
+OUString result = "{";
+OUString sep;
+for (NSString *key in dict)
+{
+result = result + sep + OUString::fromUtf8([key UTF8String]);
+sep = ",";
+}
+result = result + "}";
+return result;
+}
+
 std::ostream &operator <<(std::ostream& s, const CGRect &rRect)
 {
 #ifndef SAL_LOG_INFO
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - bridges/source

2021-04-05 Thread Tor Lillqvist (via logerrit)
 bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx |   24 +++-
 1 file changed, 11 insertions(+), 13 deletions(-)

New commits:
commit de2e167d4d8b822b6e046c64893006aa3b5a5c42
Author: Tor Lillqvist 
AuthorDate: Tue Mar 2 14:30:03 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Apr 5 18:16:31 2021 +0300

Handle floating-point return values correctly on iOS

The code did not work at all. The contents of register d0 that we
tried to access in MapReturn() was not what the called function had
stored there. Probably the clobber list in the __asm__ statement is
wrong? Anyway, simpler to fix it by explicitly storing d0, too, into a
variable after the call, like we do for x0 and x1, and then pass that
variable, too, to MapReturn().

Fixes https://github.com/CollaboraOnline/online/issues/1519 .

Change-Id: Id05c8c57209eb9ade4d67035830b2dec601bc046
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111826
Tested-by: Michael Meeks 
Tested-by: Tor Lillqvist 
Reviewed-by: Michael Meeks 
Reviewed-by: Tor Lillqvist 

diff --git a/bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx 
b/bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx
index eacd01332900..07ec8501f0df 100644
--- a/bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_ios/uno2cpp.cxx
@@ -77,7 +77,7 @@ namespace arm
 }
 }
 
-void MapReturn(sal_uInt64 x0, sal_uInt64 x1, typelib_TypeDescriptionReference 
*pReturnType, sal_uInt64 *pRegisterReturn)
+void MapReturn(sal_uInt64 x0, sal_uInt64 x1, double d0, 
typelib_TypeDescriptionReference *pReturnType, sal_uInt64 *pRegisterReturn)
 {
 switch( pReturnType->eTypeClass )
 {
@@ -96,18 +96,10 @@ void MapReturn(sal_uInt64 x0, sal_uInt64 x1, 
typelib_TypeDescriptionReference *p
 pRegisterReturn[0] = x0;
 break;
 case typelib_TypeClass_FLOAT:
-register float fret asm("s0");
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wuninitialized"
-*(float*)pRegisterReturn = fret;
-#pragma GCC diagnostic pop
+*(float*)pRegisterReturn = *(float*)&d0;
 break;
 case typelib_TypeClass_DOUBLE:
-register double dret asm("d0");
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wuninitialized"
-*(double*)pRegisterReturn = dret;
-#pragma GCC diagnostic pop
+*(double*)pRegisterReturn = d0;
 break;
 case typelib_TypeClass_STRUCT:
 case typelib_TypeClass_EXCEPTION:
@@ -153,9 +145,11 @@ void callVirtualMethod(
 // For value returned in registers
 sal_uInt64 x0;
 sal_uInt64 x1;
+double d0;
 
 __asm__ __volatile__
 (
+ // Assembly string
  "  ldp x0, x1, %[pgpr_0]\n"
  "  ldp x2, x3, %[pgpr_2]\n"
  "  ldp x4, x5, %[pgpr_4]\n"
@@ -168,7 +162,10 @@ void callVirtualMethod(
  "  blr %[pmethod]\n"
  "  str x0, %[x0]\n"
  "  str x1, %[x1]\n"
- : [x0]"=m" (x0), [x1]"=m" (x1)
+ "  str d0, %[d0]\n"
+ // Output operands
+ : [x0]"=m" (x0), [x1]"=m" (x1), [d0]"=m" (d0)
+ // Input operands
  : [pgpr_0]"m" (pGPR[0]),
[pgpr_2]"m" (pGPR[2]),
[pgpr_4]"m" (pGPR[4]),
@@ -179,10 +176,11 @@ void callVirtualMethod(
[pfpr_4]"m" (pFPR[4]),
[pfpr_6]"m" (pFPR[6]),
[pmethod]"r" (pMethod)
+ // Clobbers
  : "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "d0", "d1", "d2", 
"d3", "d4", "d5", "d6", "d7"
  );
 
-  MapReturn(x0, x1, pReturnType, (sal_uInt64 *) pRegisterReturn);
+MapReturn(x0, x1, d0, pReturnType, (sal_uInt64 *) pRegisterReturn);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 2 commits - sal/osl vcl/source

2021-04-05 Thread Tor Lillqvist (via logerrit)
 sal/osl/unx/backtrace.c  |   69 ---
 vcl/source/window/seleng.cxx |   15 +++--
 2 files changed, 13 insertions(+), 71 deletions(-)

New commits:
commit 02be3465334a733c7e52b352d021d810f52311c9
Author: Tor Lillqvist 
AuthorDate: Thu Mar 4 11:56:50 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Apr 5 18:03:31 2021 +0300

The backtrace() etc API is available on macOS and iOS, too

Change-Id: I9a62391c4d109cd2fd2ab60d92a9e3b631ee6773
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112157
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/sal/osl/unx/backtrace.c b/sal/osl/unx/backtrace.c
index a3aeb3dae3f8..26005f7715af 100644
--- a/sal/osl/unx/backtrace.c
+++ b/sal/osl/unx/backtrace.c
@@ -212,74 +212,7 @@ void backtrace_symbols_fd( void **buffer, int size, int fd 
)
 }
 }
 
-#elif defined( MACOSX )
-
-#include 
-#include 
-#include "backtrace.h"
-
-/* glib backtrace is only available on MacOsX 10.5 or higher
-   so we do it on our own */
-
-int backtrace( void **buffer, int max_frames )
-{
-void **frame = (void **)__builtin_frame_address(0);
-void **bp = ( void **)(*frame);
-void *ip = frame[1];
-int i;
-
-for ( i = 0; bp && ip && i < max_frames; i++ )
-{
-*(buffer++) = ip;
-
-ip = bp[1];
-bp = (void**)(bp[0]);
-}
-
-return i;
-}
-
-char ** backtrace_symbols(void * const * buffer, int size)
-{
-(void)buffer; (void)size;
-return NULL; /*TODO*/
-}
-
-void backtrace_symbols_fd( void **buffer, int size, int fd )
-{
-FILE*fp = fdopen( fd, "w" );
-
-if ( fp )
-{
-void **pFramePtr;
-
-for ( pFramePtr = buffer; size > 0 && pFramePtr && *pFramePtr; 
pFramePtr++, size-- )
-{
-Dl_info dli;
-
-if ( 0 != dladdr( *pFramePtr, &dli ) )
-{
-ptrdiff_t offset;
-
-if ( dli.dli_fname && dli.dli_fbase )
-{
-offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_fbase;
-fprintf( fp, "%s+0x%tx", dli.dli_fname, offset );
-}
-if ( dli.dli_sname && dli.dli_saddr )
-{
-offset = (ptrdiff_t)*pFramePtr - (ptrdiff_t)dli.dli_saddr;
-fprintf( fp, "(%s+0x%tx)", dli.dli_sname, offset );
-}
-}
-fprintf( fp, "[%p]\n", *pFramePtr );
-}
-
-fclose( fp );
-}
-}
-
-#elif !defined LINUX
+#elif !defined LINUX && !defined MACOSX && !defined IOS
 
 int backtrace( void **buffer, int max_frames )
 {
commit 34897c831c6451ef2cc3811c98b9d3a79ff4af40
Author: Tor Lillqvist 
AuthorDate: Wed Mar 10 13:06:54 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Apr 5 18:02:46 2021 +0300

Don't unselect an existing selection on (long) press on iOS and Android

A (long) press, also known as a long tap, in Collabora Online (as used
to bring up a context menu), shows up in core as a click of the right
mouse button. We don't want that to cause an existing selection to be
unselected.

This fixes https://github.com/CollaboraOnline/online/issues/1323

Why this problem happened only in presentation documents I have no
idea.

Change-Id: Iebbf71e75dcea7c39a92fd8d5dd07c368d92f163
Signed-off-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112261
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112264

diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx
index 78f071126ae5..4e311785090c 100644
--- a/vcl/source/window/seleng.cxx
+++ b/vcl/source/window/seleng.cxx
@@ -256,6 +256,12 @@ bool SelectionEngine::SelMouseButtonUp( const MouseEvent& 
rMEvt )
 if (!rMEvt.IsRight())
 ReleaseMouse();
 
+#if defined IOS || defined ANDROID
+const bool bDoMessWithSelection = !rMEvt.IsRight();
+#else
+constexpr bool bDoMessWithSelection = true;
+#endif
+
 if( (nFlags & SelectionEngineFlags::WAIT_UPEVT) && !(nFlags & 
SelectionEngineFlags::CMDEVT) &&
 eSelMode != SelectionMode::Single)
 {
@@ -271,13 +277,16 @@ bool SelectionEngine::SelMouseButtonUp( const MouseEvent& 
rMEvt )
 }
 pFunctionSet->DeselectAtPoint( aLastMove.GetPosPixel() );
 nFlags &= ~SelectionEngineFlags::HAS_ANCH; // uncheck anchor
-pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel(), true );
+if (bDoMessWithSelection)
+pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel(), true 
);
 }
 else
 {
-pFunctionSet->DeselectAll();
+if (bDoMessWithSelection)
+pFunctionSet->DeselectAll();
 nFlags &= ~SelectionEngineFlags::HAS_ANCH; // uncheck anchor
-pFunctionSet->SetCursorAtPoint( aLastMove.GetPos

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - lingucomponent/source

2021-04-05 Thread Tor Lillqvist (via logerrit)
 lingucomponent/source/spellcheck/macosxspell/macspellimp.mm |   25 
 1 file changed, 25 insertions(+)

New commits:
commit 06ee74dbd15282684e356ce25fbfbd5b52105170
Author: Tor Lillqvist 
AuthorDate: Thu Mar 18 13:45:18 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Apr 5 18:01:26 2021 +0300

Use the iOS fr_FR and it_IT dictionaries for other relevant countries, too

Fixes https://github.com/CollaboraOnline/online/issues/1463

Change-Id: I9fffd4bc9499aee2098258f5c3a9181330b339a1
Signed-off-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112670

diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm 
b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
index 75a1b04183a5..60db3ba3d409 100644
--- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
+++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
@@ -196,11 +196,36 @@ Sequence< Locale > SAL_CALL MacSpellChecker::getLocales()
 postspdict.push_back( pLangStr );
 }
 }
+#ifdef IOS
+else if ([pLangStr isEqualToString:@"fr_FR"])
+{
+const std::vector aFR
+{ @"BE", @"BF", @"BJ", @"CA", @"CH", @"CI", @"FR", @"LU", 
@"MC", @"ML",
+  @"MU", @"NE", @"SN", @"TG" };
+for (auto c: aFR)
+{
+pLangStr = [@"fr_" stringByAppendingString: c];
+postspdict.push_back( pLangStr );
+}
+}
+#endif
 else if ([pLangStr isEqualToString:@"it"])
 {
 postspdict.push_back( @"it_CH" );
 postspdict.push_back( @"it_IT" );
 }
+#ifdef IOS
+else if ([pLangStr isEqualToString:@"it_IT"])
+{
+const std::vector aIT
+{ @"CH", @"IT" };
+for (auto c: aIT)
+{
+pLangStr = [@"it_" stringByAppendingString: c];
+postspdict.push_back( pLangStr );
+}
+}
+#endif
 else if ([pLangStr isEqualToString:@"ko"])
 {
 postspdict.push_back( @"ko_KR" );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - vcl/ios

2021-04-05 Thread Tor Lillqvist (via logerrit)
 vcl/ios/DataFlavorMapping.cxx |   31 +++
 1 file changed, 15 insertions(+), 16 deletions(-)

New commits:
commit c225b0f273a4ccbf45214ff128187ec8b44149c8
Author: Tor Lillqvist 
AuthorDate: Wed Mar 24 16:09:05 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Apr 5 16:59:35 2021 +0200

tdf#141217: Improve plain text pasting on iOS

Handle public.utf8-plain-text. That is the actual concrete UTI for
UTF-8 text. For instance if you copy text from the Safari address bar,
public.utf8-plain-text is the only type put on the pasteboard.
Previously we were not able to paste than into the iOS app at all.

Change-Id: Idbdd3870431f3b9a312cc9b672ffe1f16d13edbd
Signed-off-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113042
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113045
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113609

diff --git a/vcl/ios/DataFlavorMapping.cxx b/vcl/ios/DataFlavorMapping.cxx
index 88b0e6199818..962e9c49af21 100644
--- a/vcl/ios/DataFlavorMapping.cxx
+++ b/vcl/ios/DataFlavorMapping.cxx
@@ -74,9 +74,7 @@ NSString* OUStringToNSString(const OUString& ustring)
 return [NSString stringWithCString:utf8Str.getStr() 
encoding:NSUTF8StringEncoding];
 }
 
-NSString* PBTYPE_PLAINTEXT = (__bridge NSString*)kUTTypePlainText;
-// Nope. See commented-out use below.
-// NSString* PBTYPE_UTF8PLAINTEXT = (__bridge NSString*)kUTTypeUTF8PlainText;
+NSString* PBTYPE_UTF8PLAINTEXT = (__bridge NSString*)kUTTypeUTF8PlainText;
 NSString* PBTYPE_RTF = (__bridge NSString*)kUTTypeRTF;
 NSString* PBTYPE_PNG = (__bridge NSString*)kUTTypePNG;
 NSString* PBTYPE_JPEG = (__bridge NSString*)kUTTypeJPEG;
@@ -124,9 +122,7 @@ struct FlavorMap
 };
 
 static const FlavorMap flavorMap[]
-= { { PBTYPE_PLAINTEXT, "text/plain;charset=utf-16", "Unicode Text 
(UTF-16)", true },
-// Nope. The LO code does not understand text/plain in UTF-8. Which is 
a shame.
-// PBTYPE_UTF8PLAINTEXT, "text/plain;charset=utf-8", "Unicode Text 
(UTF-8)", false },
+= { { PBTYPE_UTF8PLAINTEXT, "text/plain;charset=utf-16", "Unicode Text 
(UTF-16)", true },
 { PBTYPE_RTF, "text/rtf", "Rich Text Format", false },
 { PBTYPE_PNG, "image/png", "Portable Network Graphics", false },
 { PBTYPE_JPEG, "image/jpeg", "JPEG", false },
@@ -190,27 +186,27 @@ DataProviderBaseImpl::~DataProviderBaseImpl()
 }
 }
 
-class UniDataProvider : public DataProviderBaseImpl
+class Utf8DataProvider : public DataProviderBaseImpl
 {
 public:
-UniDataProvider(const Any& data);
-UniDataProvider(NSData* data);
+Utf8DataProvider(const Any& data);
+Utf8DataProvider(NSData* data);
 
 NSData* getSystemData() override;
 Any getOOoData() override;
 };
 
-UniDataProvider::UniDataProvider(const Any& data)
+Utf8DataProvider::Utf8DataProvider(const Any& data)
 : DataProviderBaseImpl(data)
 {
 }
 
-UniDataProvider::UniDataProvider(NSData* data)
+Utf8DataProvider::Utf8DataProvider(NSData* data)
 : DataProviderBaseImpl(data)
 {
 }
 
-NSData* UniDataProvider::getSystemData()
+NSData* Utf8DataProvider::getSystemData()
 {
 OUString ustr;
 mData >>= ustr;
@@ -221,7 +217,7 @@ NSData* UniDataProvider::getSystemData()
 return [NSData dataWithBytes:strUtf8.getStr() length:strUtf8.getLength()];
 }
 
-Any UniDataProvider::getOOoData()
+Any Utf8DataProvider::getOOoData()
 {
 Any oOOData;
 
@@ -459,7 +455,7 @@ DataFlavorMapper::getDataProvider(const NSString* 
systemFlavor,
 else // Must be OUString type
 {
 SAL_WARN_IF(!isOUStringType(data.getValueType()), "vcl", "must be 
OUString type");
-dp = DataProviderPtr_t(new UniDataProvider(data));
+dp = DataProviderPtr_t(new Utf8DataProvider(data));
 }
 }
 catch (UnsupportedFlavorException&)
@@ -476,9 +472,12 @@ DataProviderPtr_t DataFlavorMapper::getDataProvider(const 
NSString* systemFlavor
 {
 DataProviderPtr_t dp;
 
-if ([systemFlavor caseInsensitiveCompare:PBTYPE_PLAINTEXT] == 
NSOrderedSame)
+if (systemData == nil)
+return dp;
+
+if ([systemFlavor caseInsensitiveCompare:PBTYPE_UTF8PLAINTEXT] == 
NSOrderedSame)
 {
-dp = DataProviderPtr_t(new UniDataProvider(systemData));
+dp = DataProviderPtr_t(new Utf8DataProvider(systemData));
 }
 else if ([systemFlavor caseInsensitiveCompare:PBTYPE_HTML] == 
NSOrderedSame)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Kivader Matej license statement

2021-04-05 Thread Matej Kivader

Hi,

All of my past & future contributions to LibreOffice may be
   licensed under the MPLv2/LGPLv3+ dual license.

Regards,
Matej Kivader

--
Matej Kivader
+421 915 338 726



--
Táto správa bola skontrolovaná na prítomnosť vírusov programom Avast Antivirus.
https://www.avast.com/antivirus
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - ios/CustomTarget_iOS_setup.mk

2021-04-05 Thread Tor Lillqvist (via logerrit)
 ios/CustomTarget_iOS_setup.mk |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit e0493f7ddd2288493b8ffeec466b08a2a81a0b39
Author: Tor Lillqvist 
AuthorDate: Thu Mar 25 15:21:40 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Apr 5 16:52:00 2021 +0200

Fix editing mistake for iOS build

Spelling dictionaries go into a separate directory.

Change-Id: Ia8bc14d8e3320533c35a70884f7b4cf190e19fe4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113608
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/ios/CustomTarget_iOS_setup.mk b/ios/CustomTarget_iOS_setup.mk
index 8a082bcd5273..f44a154470bb 100644
--- a/ios/CustomTarget_iOS_setup.mk
+++ b/ios/CustomTarget_iOS_setup.mk
@@ -80,10 +80,10 @@ $(IOSGEN)/native-code.h: $(BUILDDIR)/config_host.mk \
# Install the Swiss German dictionary and use it for Liechtenstein, too.
# Install also thesauruses.
if test -d $(INSTDIR)/share/extensions/dict-de; then \
-   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.aff 
$(IOSRES)/share/thes/de_CH.aff; \
-   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.dic 
$(IOSRES)/share/thes/de_CH.dic; \
-   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.aff 
$(IOSRES)/share/thes/de_LI.aff; \
-   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.dic 
$(IOSRES)/share/thes/de_LI.dic; \
+   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.aff 
$(IOSRES)/share/spell/de_CH.aff; \
+   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.dic 
$(IOSRES)/share/spell/de_CH.dic; \
+   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.aff 
$(IOSRES)/share/spell/de_LI.aff; \
+   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.dic 
$(IOSRES)/share/spell/de_LI.dic; \
cp $(INSTDIR)/share/extensions/*/th_*_v2.* 
$(IOSRES)/share/thes; \
cp $(INSTDIR)/share/extensions/dict-en/th_en_US_v2.dat 
$(IOSRES)/share/thes/th_en_GB_v2.dat; \
cp $(INSTDIR)/share/extensions/dict-en/th_en_US_v2.idx 
$(IOSRES)/share/thes/th_en_GB_v2.idx; \
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - configure.ac ios/CustomTarget_iOS_setup.mk lingucomponent/Module_lingucomponent.mk lingucomponent/source postprocess/Rdb_services.mk

2021-04-05 Thread Tor Lillqvist (via logerrit)
 Repository.mk   |2 +-
 configure.ac|4 +---
 ios/CustomTarget_iOS_setup.mk   |   16 ++--
 lingucomponent/Module_lingucomponent.mk |2 +-
 lingucomponent/source/lingutil/lingutil.cxx |5 +
 postprocess/Rdb_services.mk |4 +---
 solenv/bin/native-code.py   |2 +-
 7 files changed, 20 insertions(+), 15 deletions(-)

New commits:
commit 5803599f48b6b102af25906c13d8cc9967f881cb
Author: Tor Lillqvist 
AuthorDate: Wed Mar 24 18:58:58 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Apr 5 16:51:40 2021 +0200

tdf#124173: Enable thesauruses in the iOS app

Build our lnth library and the external mythes library. Install
thesauruses for the app's Xcode project to pick up and include in the
app bundle. Look for them in the place where they will end up.

To get thesauruses you need to configure with --with-myspell-dicts.

Change-Id: I2d850ca3c821c5c764cb061340a265440d04e41b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113066
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113073
Tested-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113607

diff --git a/Repository.mk b/Repository.mk
index 049672c2c9b1..e056cbfce29f 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -379,7 +379,7 @@ $(eval $(call 
gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
localebe1 \
log \
lng \
-   $(if $(filter-out iOS,$(OS)),lnth) \
+   lnth \
$(if $(filter $(OS),MACOSX),macbe1) \
$(if $(MERGELIBS),merged) \
migrationoo2 \
diff --git a/configure.ac b/configure.ac
index 71230c077cf0..962c24516905 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10901,9 +10901,7 @@ dnl 
===
 dnl Checking for mythes
 dnl ===
 AC_MSG_CHECKING([which mythes to use])
-if test "$_os" = iOS; then
-   AC_MSG_RESULT([none])
-elif test "$with_system_mythes" = "yes"; then
+if test "$with_system_mythes" = "yes"; then
 AC_MSG_RESULT([external])
 SYSTEM_MYTHES=TRUE
 AC_LANG_PUSH([C++])
diff --git a/ios/CustomTarget_iOS_setup.mk b/ios/CustomTarget_iOS_setup.mk
index 95cf79abfe3f..8a082bcd5273 100644
--- a/ios/CustomTarget_iOS_setup.mk
+++ b/ios/CustomTarget_iOS_setup.mk
@@ -76,13 +76,17 @@ $(IOSGEN)/native-code.h: $(BUILDDIR)/config_host.mk \
mkdir -p $(IOSRES)/share/fonts
cp -R $(INSTDIR)/share/fonts/truetype $(IOSRES)/share/fonts
cp -R $(INSTDIR)/share/gallery $(IOSRES)/share
-   mkdir -p $(IOSRES)/share/spell
-   # Install the Swiss German dictionary and use it for Liechtenstein, too
+   mkdir -p $(IOSRES)/share/spell $(IOSRES)/share/thes
+   # Install the Swiss German dictionary and use it for Liechtenstein, too.
+   # Install also thesauruses.
if test -d $(INSTDIR)/share/extensions/dict-de; then \
-   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.aff 
$(IOSRES)/share/spell/de_CH.aff; \
-   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.dic 
$(IOSRES)/share/spell/de_CH.dic; \
-   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.aff 
$(IOSRES)/share/spell/de_LI.aff; \
-   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.dic 
$(IOSRES)/share/spell/de_LI.dic; \
+   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.aff 
$(IOSRES)/share/thes/de_CH.aff; \
+   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.dic 
$(IOSRES)/share/thes/de_CH.dic; \
+   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.aff 
$(IOSRES)/share/thes/de_LI.aff; \
+   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.dic 
$(IOSRES)/share/thes/de_LI.dic; \
+   cp $(INSTDIR)/share/extensions/*/th_*_v2.* 
$(IOSRES)/share/thes; \
+   cp $(INSTDIR)/share/extensions/dict-en/th_en_US_v2.dat 
$(IOSRES)/share/thes/th_en_GB_v2.dat; \
+   cp $(INSTDIR)/share/extensions/dict-en/th_en_US_v2.idx 
$(IOSRES)/share/thes/th_en_GB_v2.idx; \
fi
cp -R $(INSTDIR)/share/palette $(IOSRES)/share
cp -R $(INSTDIR)/share/fingerprint $(IOSRES)/share
diff --git a/lingucomponent/Module_lingucomponent.mk 
b/lingucomponent/Module_lingucomponent.mk
index 3f8bcb026fa2..2bde5d5391e5 100644
--- a/lingucomponent/Module_lingucomponent.mk
+++ b/lingucomponent/Module_lingucomponent.mk
@@ -13,7 +13,7 @@ $(eval $(call gb_Module_Module,lingucomponent))
 $(eval $(call gb_Module_add_targets,lingucomponent,\
Library_guesslang \
Library_hyphen \
-   $(if $(filter-out iOS,$(OS)),Library_lnth) \
+   Library_lnth \
$(if $(filter iOS MACOSX,$(OS)),Library_MacOSXSpell) \
Library_spell \
   

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - comphelper/source configure.ac ios/CustomTarget_iOS_setup.mk lingucomponent/Module_lingucomponent.mk lingucomponent/source postproce

2021-04-05 Thread Tor Lillqvist (via logerrit)
 Repository.mk   |2 -
 comphelper/source/misc/lok.cxx  |2 -
 configure.ac|4 ---
 ios/CustomTarget_iOS_setup.mk   |8 +++
 lingucomponent/Module_lingucomponent.mk |2 -
 lingucomponent/source/lingutil/lingutil.cxx |   13 +---
 lingucomponent/source/spellcheck/macosxspell/macspellimp.mm |7 +++---
 postprocess/Rdb_services.mk |2 -
 solenv/bin/native-code.py   |2 -
 9 files changed, 28 insertions(+), 14 deletions(-)

New commits:
commit 8f83c486d324629f3191ec8a528d6ba940e15fe0
Author: Tor Lillqvist 
AuthorDate: Wed Mar 17 11:50:23 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Apr 5 16:50:49 2021 +0200

tdf#124909: Use the myspell dictionary for Swiss German on iOS

The iOS system German dictionary is not good for Swiss German. (And it
doesn't even claim to be, it says it is for de_DE.) The system German
dictionary accepts 'ß' but that is not used in Swiss German, 'ss' is
always used instead.

Build the spell library for iOS, too, and don't assume that the system
de_DE dictionary would be usable for de_CH and de_LI. Copy those
dictionaries for inclusion in the iOS app bundle.

Change-Id: I0f8020812221024756c792bddc16a707de35b827
Signed-off-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112603
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112635
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113606

diff --git a/Repository.mk b/Repository.mk
index 9105eea5e29a..049672c2c9b1 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -413,7 +413,7 @@ $(eval $(call 
gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
simplecanvas \
slideshow \
sot \
-   $(if $(filter-out iOS,$(OS)),spell) \
+   spell \
$(if $(DISABLE_GUI),,spl) \
storagefd \
$(call gb_Helper_optional,SCRIPTING,stringresource) \
diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx
index c2a44872755f..796a3dc3b839 100644
--- a/comphelper/source/misc/lok.cxx
+++ b/comphelper/source/misc/lok.cxx
@@ -210,7 +210,7 @@ bool isAllowlistedLanguage(const OUString& lang)
 if (!isActive())
 return true;
 
-#ifdef ANDROID
+#if defined ANDROID || defined IOS
 (void) lang;
 return true;
 #else
diff --git a/configure.ac b/configure.ac
index 0a9757aab432..71230c077cf0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10753,9 +10753,7 @@ dnl 
===
 dnl Check for system hunspell
 dnl ===
 AC_MSG_CHECKING([which libhunspell to use])
-if test "$_os" = iOS; then
-   AC_MSG_RESULT([none])
-elif test "$with_system_hunspell" = "yes"; then
+if test "$with_system_hunspell" = "yes"; then
 AC_MSG_RESULT([external])
 SYSTEM_HUNSPELL=TRUE
 AC_LANG_PUSH([C++])
diff --git a/ios/CustomTarget_iOS_setup.mk b/ios/CustomTarget_iOS_setup.mk
index d417be34cfed..95cf79abfe3f 100644
--- a/ios/CustomTarget_iOS_setup.mk
+++ b/ios/CustomTarget_iOS_setup.mk
@@ -76,6 +76,14 @@ $(IOSGEN)/native-code.h: $(BUILDDIR)/config_host.mk \
mkdir -p $(IOSRES)/share/fonts
cp -R $(INSTDIR)/share/fonts/truetype $(IOSRES)/share/fonts
cp -R $(INSTDIR)/share/gallery $(IOSRES)/share
+   mkdir -p $(IOSRES)/share/spell
+   # Install the Swiss German dictionary and use it for Liechtenstein, too
+   if test -d $(INSTDIR)/share/extensions/dict-de; then \
+   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.aff 
$(IOSRES)/share/spell/de_CH.aff; \
+   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.dic 
$(IOSRES)/share/spell/de_CH.dic; \
+   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.aff 
$(IOSRES)/share/spell/de_LI.aff; \
+   cp $(INSTDIR)/share/extensions/dict-de/de_CH_frami.dic 
$(IOSRES)/share/spell/de_LI.dic; \
+   fi
cp -R $(INSTDIR)/share/palette $(IOSRES)/share
cp -R $(INSTDIR)/share/fingerprint $(IOSRES)/share
cp $(SRCDIR)/ios/welcome.odt $(IOSRES)
diff --git a/lingucomponent/Module_lingucomponent.mk 
b/lingucomponent/Module_lingucomponent.mk
index 9dabeb155673..3f8bcb026fa2 100644
--- a/lingucomponent/Module_lingucomponent.mk
+++ b/lingucomponent/Module_lingucomponent.mk
@@ -15,7 +15,7 @@ $(eval $(call gb_Module_add_targets,lingucomponent,\
Library_hyphen \
$(if $(filter-out iOS,$(OS)),Library_lnth) \
$(if $(filter iOS MACOSX,$(OS)),Library_MacOSXSpell) \
-   $(if $(filter-out iOS,$(OS)),Library_spell) \
+   Library_spell \
StaticLibrary_ulingu \
Library_numbertext \
 ))
diff --git a/lingucomponent/source/lingutil/l

[Libreoffice-commits] core.git: basic/qa basic/source

2021-04-05 Thread Andreas Heinisch (via logerrit)
 basic/qa/basic_coverage/test_mod_operator.vb |   25 +
 basic/source/comp/exprnode.cxx   |   13 +
 2 files changed, 34 insertions(+), 4 deletions(-)

New commits:
commit a9fcd2cf2bfb42693787e8c4197e5988e155e235
Author: Andreas Heinisch 
AuthorDate: Sun Apr 4 19:34:47 2021 +0200
Commit: Andreas Heinisch 
CommitDate: Mon Apr 5 16:38:44 2021 +0200

tdf#141201 - Round MOD literals to Integer values

(regression from commit I8dbfdf4bb2eceac0b5afbddd3f35e1dcde2db68b
"tdf#84435: Mod operator does not deal with decimals as described in help").

Change-Id: I74b231d3814148579a3be0a92b7602fa4387281f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113571
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/basic/qa/basic_coverage/test_mod_operator.vb 
b/basic/qa/basic_coverage/test_mod_operator.vb
new file mode 100644
index ..006d97558052
--- /dev/null
+++ b/basic/qa/basic_coverage/test_mod_operator.vb
@@ -0,0 +1,25 @@
+'
+' This file is part of the LibreOffice project.
+'
+' This Source Code Form is subject to the terms of the Mozilla Public
+' License, v. 2.0. If a copy of the MPL was not distributed with this
+' file, You can obtain one at http://mozilla.org/MPL/2.0/.
+'
+
+Function doUnitTest as Integer
+
+doUnitTest = 0
+
+Dim a As Double, b as Double
+a = 16.4
+b = 5.9
+
+' tdf#141201 - MOD operands are rounded to Integer values before the 
operation is performed
+if (a MOD b <> 4) Then Exit Function
+if (16.4 MOD 5.9 <> 4) Then Exit Function
+if (15.9 MOD 6.4 <> 4) Then Exit Function
+if (2147483647.4 MOD 4 <> 3) Then Exit Function
+
+doUnitTest = 1
+
+End Function
diff --git a/basic/source/comp/exprnode.cxx b/basic/source/comp/exprnode.cxx
index 02f8801f1aea..1771da0017f3 100644
--- a/basic/source/comp/exprnode.cxx
+++ b/basic/source/comp/exprnode.cxx
@@ -27,6 +27,8 @@
 
 #include 
 
+#include 
+
 SbiExprNode::SbiExprNode( std::unique_ptr l, SbiToken t, 
std::unique_ptr r ) :
 pLeft(std::move(l)),
 pRight(std::move(r)),
@@ -294,8 +296,13 @@ void SbiExprNode::FoldConstantsBinaryNode(SbiParser* 
pParser)
 {
 double nl = pLeft->nVal;
 double nr = pRight->nVal;
+// tdf#141201 - round MOD literals to Integer values
+if (eTok == MOD)
+{
+nl = rtl::math::round(nl);
+nr = rtl::math::round(nr);
+}
 tools::Long ll = 0, lr = 0;
-tools::Long llMod = 0, lrMod = 0;
 if( ( eTok >= AND && eTok <= IMP )
|| eTok == IDIV || eTok == MOD )
 {
@@ -322,8 +329,6 @@ void SbiExprNode::FoldConstantsBinaryNode(SbiParser* 
pParser)
 nr = SbxMINLNG;
 }
 ll = static_cast(nl); lr = 
static_cast(nr);
-llMod = static_cast(nl);
-lrMod = static_cast(nr);
 if( bErr )
 {
 pParser->Error( ERRCODE_BASIC_MATH_OVERFLOW );
@@ -388,7 +393,7 @@ void SbiExprNode::FoldConstantsBinaryNode(SbiParser* 
pParser)
 {
 pParser->Error( ERRCODE_BASIC_ZERODIV ); nVal = HUGE_VAL;
 bError = true;
-} else nVal = llMod - lrMod * (llMod/lrMod);
+} else nVal = ll - lr * (ll/lr);
 eType = SbxLONG; break;
 case AND:
 nVal = static_cast( ll & lr ); eType = SbxLONG; break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: helpcontent2

2021-04-05 Thread Rafael Lima (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 86764b0eb065f3e076462c8c25ebc15a3a4ff33d
Author: Rafael Lima 
AuthorDate: Mon Apr 5 16:33:15 2021 +0200
Commit: Gerrit Code Review 
CommitDate: Mon Apr 5 16:33:15 2021 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to ef7a4ac4e88c6142ed29acc15a6d28ec85e8b9ce
  - tdf#106944 Fix Basic examples using the Open statement

This patch also fixes some legacy issues:
- Use of  tags instead of text "Example", "Sintax", etc...
- Create  tags for functions
- Add relevant Related Topics section

Change-Id: I85c5508c9940a1b72c82c99c39387b95a3c6edea
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/113352
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index 215eec555622..ef7a4ac4e88c 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 215eec55562243262f2549e2071d8298a659057d
+Subproject commit ef7a4ac4e88c6142ed29acc15a6d28ec85e8b9ce
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - solenv/bin

2021-04-05 Thread Tor Lillqvist (via logerrit)
 solenv/bin/native-code.py |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 38b46275e40c47913328a7984d05f28da9c9568c
Author: Tor Lillqvist 
AuthorDate: Thu Mar 25 12:23:43 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Apr 5 16:33:14 2021 +0200

Include the pdfimport library constructor in the mobile apps if enabled

This is part of implementing
https://github.com/CollaboraOnline/online/issues/1824 .

Change-Id: I68dacc2de0dc1f09da03fa213d5cff56a2343c77
Signed-off-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113079
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113095
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113605

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 13a7e720be08..207a0d4b66a0 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -664,6 +664,12 @@ draw_constructor_list = [
 "css_comp_Impress_oox_PowerPointExport",
 # writerperfect/source/draw/wpftdraw.component
 "com_sun_star_comp_Draw_VisioImportFilter_get_implementation",
+# sdext/source/pdfimport/pdfimport.component
+"sdext_PDFIHybridAdaptor_get_implementation",
+"sdext_PDFIRawAdaptor_Writer_get_implementation",
+"sdext_PDFIRawAdaptor_Draw_get_implementation",
+"sdext_PDFIRawAdaptor_Impress_get_implementation",
+"sdext_PDFDetector_get_implementation",
 ]
 
 writer_factory_list = [
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] help.git: source/text

2021-04-05 Thread Rafael Lima (via logerrit)
 source/text/sbasic/shared/03010103.xhp |2 
 source/text/sbasic/shared/03020101.xhp |4 +
 source/text/sbasic/shared/03020102.xhp |   43 ---
 source/text/sbasic/shared/03020103.xhp |   84 +-
 source/text/sbasic/shared/03020104.xhp |   13 ++--
 source/text/sbasic/shared/03020201.xhp |   92 ++---
 source/text/sbasic/shared/03020202.xhp |   20 +++
 source/text/sbasic/shared/03020203.xhp |5 +
 source/text/sbasic/shared/03020205.xhp |   52 --
 source/text/sbasic/shared/03020301.xhp |   41 --
 source/text/sbasic/shared/03020303.xhp |   44 ---
 source/text/sbasic/shared/03020405.xhp |   28 ++
 source/text/sbasic/shared/03020410.xhp |   17 +++---
 source/text/sbasic/shared/03050500.xhp |   25 +++-
 14 files changed, 260 insertions(+), 210 deletions(-)

New commits:
commit ef7a4ac4e88c6142ed29acc15a6d28ec85e8b9ce
Author: Rafael Lima 
AuthorDate: Tue Mar 30 14:20:52 2021 +0200
Commit: Olivier Hallot 
CommitDate: Mon Apr 5 16:33:15 2021 +0200

tdf#106944 Fix Basic examples using the Open statement

This patch also fixes some legacy issues:
- Use of  tags instead of text "Example", "Sintax", etc...
- Create  tags for functions
- Add relevant Related Topics section

Change-Id: I85c5508c9940a1b72c82c99c39387b95a3c6edea
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/113352
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/source/text/sbasic/shared/03010103.xhp 
b/source/text/sbasic/shared/03010103.xhp
index f1f0c287a..c60a4925f 100644
--- a/source/text/sbasic/shared/03010103.xhp
+++ b/source/text/sbasic/shared/03010103.xhp
@@ -66,7 +66,7 @@
 Print 
"ABC"
 Print 
"ABC","123"
 i = 
FreeFile()
-Open 
"C:\Temp.txt" For Output As i
+Open 
"C:\Users\ThisUser\Temp.txt" For Output As i
 Print 
#i, "ABC"
 Close 
#i
 End 
Sub
diff --git a/source/text/sbasic/shared/03020101.xhp 
b/source/text/sbasic/shared/03020101.xhp
index 79247f40c..78cb1907f 100644
--- a/source/text/sbasic/shared/03020101.xhp
+++ b/source/text/sbasic/shared/03020101.xhp
@@ -52,5 +52,9 @@
 
 
 
+
+   
+   
+
 
 
\ No newline at end of file
diff --git a/source/text/sbasic/shared/03020102.xhp 
b/source/text/sbasic/shared/03020102.xhp
index 66160f95e..d906b6319 100644
--- a/source/text/sbasic/shared/03020102.xhp
+++ b/source/text/sbasic/shared/03020102.xhp
@@ -34,50 +34,31 @@
 
 
 
-FreeFile 
Function
+FreeFile 
Function
 Returns the 
next available file number for opening a file. Use this function to open a file 
using a file number that is not already in use by a currently open 
file.
 
 
-Syntax:
+
 
 FreeFile
 
 
-Return 
value:
+
 Integer
 
-Parameters:
+
 This function 
can only be used immediately in front of an Open statement. FreeFile returns 
the next available file number, but does not reserve it.
 
 
 
 
-Example:
-
-Sub ExampleWorkWithAFile
-Dim iNumber As Integer
-Dim sLine As String
-Dim aFile As String
-Dim sMsg As String
-aFile = "c:\data.txt"
-sMsg = ""
-iNumber = Freefile
-Open aFile For Output As #iNumber
-Print 
#iNumber, "First line of text"
-Print 
#iNumber, "Another line of text"
-Close #iNumber
-iNumber = Freefile
-Open aFile For Input As #iNumber
-While Not eof(#iNumber)
-Line Input #iNumber, sLine
-If sLine <>"" Then
-sMsg = sMsg & sLine & chr(13)
-End If
-Wend
-Close #iNumber
-MsgBox sMsg
-End Sub
-
-
+
+
 
+
+   
+   
+   
+
+
 
\ No newline at end of file
diff --git a/source/text/sbasic/shared/03020103.xhp 
b/source/text/sbasic/shared/03020103.xhp
index bb605bc89..ddf55d217 100644
--- a/source/text/sbasic/shared/03020103.xhp
+++ b/source/text/sbasic/shared/03020103.xhp
@@ -62,31 +62,67 @@
 
 
 
-
-Sub 
ExampleWorkWithAFile
-Dim iNumber 
As Integer
-Dim sLine As 
String
-Dim aFile As 
String
-Dim sMsg As 
String
-aFile = 
"c:\data.txt"
-iNumber 
= Freefile
-Open 
aFile For Output As #iNumber
-Print 
#iNumber, "This is a line of text"
-Print 
#iNumber, "This is another line of text"
-Close 
#iNumber
-iNumber 
= Freefile
-Open 
aFile For Input As iNumber
-While 
Not eof(iNumber)
-Line 
Input #iNumber, sLine
-If 
sLine <>"" Then
-
sMsg = sMsg & sLine & chr(13)
-End 
If
-
Wend
-Close 
#iNumber
-MsgBox 
sMsg
-End 
Sub
+
+
+  
+  Sub 
ExampleWorkWithAFile
+  Dim 
iNumber As Integer
+  Dim 
sLine As String
+  Dim 
aFile As String
+  Dim 
sMsg As String
+  aFile 
= "C:\Users\ThisUser\data.txt"
+  
iNumber = Freefile
+  Open 
aFile For Output As #iNumber
+  Print 
#iNumber, "This is a line of text"
+  Print 
#iNumber, "This is another line of text"
+  Close 
#iNumber
+  
iNumber = Freefile
+  Open 
aFile For Input As iNumber
+  While 
Not eof(iNumber)
+  
Line Input #iNumber, sLine
+  

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - configure.ac distro-configs/LibreOfficeiOS.conf external/pdfium

2021-04-05 Thread Tor Lillqvist (via logerrit)
 configure.ac |2 +-
 distro-configs/LibreOfficeiOS.conf   |2 +-
 external/pdfium/Library_pdfium.mk|   14 ++
 external/pdfium/UnpackedTarball_pdfium.mk|2 ++
 external/pdfium/cg-instead-of-carbon.patch.1 |   13 +
 5 files changed, 31 insertions(+), 2 deletions(-)

New commits:
commit 94919447a79cab8d822f0403dd444b1446db75af
Author: Tor Lillqvist 
AuthorDate: Tue Mar 16 12:21:44 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Mon Apr 5 16:32:44 2021 +0200

Do build Pdfium for iOS, too

For it to compile, the inclusion of  had to be
replaced with .

This fixes the crash in
https://github.com/CollaboraOnline/online/issues/1710 . I am not
entirely sure yet whether the actual PDF import functionality now then
works in the iOS app, though.

Change-Id: Ie25e7c58632c0fdddb569d58217f23b26d1e5937
Signed-off-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112572
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113604

diff --git a/configure.ac b/configure.ac
index 4bcf90d63ac5..0a9757aab432 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11616,7 +11616,7 @@ AC_SUBST([ENABLE_DCONF])
 # pdf import?
 AC_MSG_CHECKING([whether to build the PDF import feature])
 ENABLE_PDFIMPORT=
-if test $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes 
\); then
+if test -z "$enable_pdfimport" -o "$enable_pdfimport" = yes; then
 AC_MSG_RESULT([yes])
 ENABLE_PDFIMPORT=TRUE
 AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
diff --git a/distro-configs/LibreOfficeiOS.conf 
b/distro-configs/LibreOfficeiOS.conf
index 2fc9b2ddf1d8..2f54e1ada54e 100644
--- a/distro-configs/LibreOfficeiOS.conf
+++ b/distro-configs/LibreOfficeiOS.conf
@@ -22,7 +22,7 @@
 --disable-kf5
 --disable-odk
 --disable-openssl
---disable-pdfium
+--disable-poppler
 --disable-python
 
 --without-tls
diff --git a/external/pdfium/Library_pdfium.mk 
b/external/pdfium/Library_pdfium.mk
index f08ff51a31a3..900c21b349b5 100644
--- a/external/pdfium/Library_pdfium.mk
+++ b/external/pdfium/Library_pdfium.mk
@@ -670,6 +670,20 @@ $(eval $(call 
gb_Library_use_system_darwin_frameworks,pdfium,\
 ))
 endif
 
+ifeq ($(OS),iOS)
+# fxge
+$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
+UnpackedTarball/pdfium/core/fxge/apple/fx_apple_platform \
+UnpackedTarball/pdfium/core/fxge/apple/fx_mac_impl \
+UnpackedTarball/pdfium/core/fxge/apple/fx_quartz_device \
+))
+
+$(eval $(call gb_Library_use_system_darwin_frameworks,pdfium,\
+CoreGraphics \
+CoreFoundation \
+))
+endif
+
 ifeq ($(OS),ANDROID)
 # fxge
 $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
diff --git a/external/pdfium/UnpackedTarball_pdfium.mk 
b/external/pdfium/UnpackedTarball_pdfium.mk
index c0cc000e40be..6bd94b0788c5 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -18,6 +18,8 @@ pdfium_patches += AnnotationInkAndVertices.patch.1
 pdfium_patches += AnnotationBorderProperties.patch.1
 pdfium_patches += AnnotationLineStartAndEnd.patch.1
 pdfium_patches += SignatureGetDocMDPPermission.patch.1
+# Use CoreGraphics.h instead of Carbon.h
+pdfium_patches += cg-instead-of-carbon.patch.1
 
 # Work around  "c++20 
rewritten operator==
 # recursive call mixing friend and external operators for template class" in 
GCC with
diff --git a/external/pdfium/cg-instead-of-carbon.patch.1 
b/external/pdfium/cg-instead-of-carbon.patch.1
new file mode 100644
index ..bd29af1b95c2
--- /dev/null
+++ b/external/pdfium/cg-instead-of-carbon.patch.1
@@ -0,0 +1,13 @@
+-*- Mode: Diff -*-
+--- a/core/fxge/apple/fx_quartz_device.h
 b/core/fxge/apple/fx_quartz_device.h
+@@ -7,7 +7,7 @@
+ #ifndef CORE_FXGE_APPLE_FX_QUARTZ_DEVICE_H_
+ #define CORE_FXGE_APPLE_FX_QUARTZ_DEVICE_H_
+ 
+-#include 
++#include 
+ 
+ #include "core/fxcrt/fx_system.h"
+ #include "core/fxge/cfx_gemodule.h"
+
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/cib_contract138c' - 2 commits - sdext/source

2021-04-05 Thread Martin Whitaker (via logerrit)
 sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx |   11 ++-
 sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx |4 
 sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx|4 
 3 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit cc6d7cabda7a93dc6324b3d74bd601c15ff1758c
Author: Martin Whitaker 
AuthorDate: Fri May 8 21:47:25 2020 +0200
Commit: Vasily Melenchuk 
CommitDate: Mon Apr 5 17:16:57 2021 +0300

tdf#131353: Fix build with poppler 0.86.0

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93789
Tested-by: René Engelhard 
Tested-by: Jenkins
Reviewed-by: Tomáš Chvátal 
(cherry picked from commit b42ab78fb871924896b3cc38a7b2f1257151f711)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96639
Reviewed-by: Adolfo Jayme Barrientos 
(cherry picked from commit d40f36bf47814c324a1ec467c566255fb187444b)

Change-Id: I89b4635a6a3e3a5522172d6f4c3f14e6c14994b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108955
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index da8ded874aa5..58ed91529a22 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -562,7 +562,9 @@ void PDFOutDev::processLink(Link* link, Catalog*)
 LinkAction* pAction = link->getAction();
 if (pAction && pAction->getKind() == actionURI)
 {
-#if POPPLER_CHECK_VERSION(0, 72, 0)
+#if POPPLER_CHECK_VERSION(0, 86, 0)
+const char* pURI = static_cast(pAction)->getURI().c_str();
+#elif POPPLER_CHECK_VERSION(0, 72, 0)
 const char* pURI = static_cast(pAction)->getURI()->c_str();
 #else
 const char* pURI = 
static_cast(pAction)->getURI()->getCString();
commit 64c195b0414a343c864812f8ebb4f7f5c077a9ee
Author: Martin Milata 
AuthorDate: Wed Dec 4 02:37:40 2019 +0100
Commit: Vasily Melenchuk 
CommitDate: Mon Apr 5 17:16:41 2021 +0300

Fix build with poppler-0.83

Change-Id: I7a3684932b8f9c403a3368b42fa4d8039c67f1a9
Reviewed-on: https://gerrit.libreoffice.org/84384
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86905
Reviewed-by: Tomáš Chvátal 
Tested-by: Tomáš Chvátal 
(cherry picked from commit 035830400393e075fca364a444e04c40516730b2)

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index 410e5ad657b7..da8ded874aa5 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -491,11 +491,18 @@ void PDFOutDev::writeFontFile( GfxFont* gfxFont ) const
 gfree(pBuf);
 }
 
+#if POPPLER_CHECK_VERSION(0, 83, 0)
+void PDFOutDev::printPath( const GfxPath* pPath )
+#else
 void PDFOutDev::printPath( GfxPath* pPath )
+#endif
 {
 int nSubPaths = pPath ? pPath->getNumSubpaths() : 0;
 for( int i=0; igetSubpath( i );
 const int nPoints = pSub->getNumPoints();
 
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
index d2e2f18e9d62..b240ab42c479 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
@@ -149,7 +149,11 @@ namespace pdfi
 
 int  parseFont( long long nNewId, GfxFont* pFont, GfxState* state ) 
const;
 void writeFontFile( GfxFont* gfxFont ) const;
+#if POPPLER_CHECK_VERSION(0, 83, 0)
+static void printPath( const GfxPath* pPath );
+#else
 static void printPath( GfxPath* pPath );
+#endif
 
 public:
 explicit PDFOutDev( PDFDoc* pDoc );
diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
index b0a6ac41ba94..48f46961f07e 100644
--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
@@ -68,7 +68,11 @@ int main(int argc, char **argv)
 }
 
 // read config file
+#if POPPLER_CHECK_VERSION(0, 83, 0)
+globalParams = std::make_unique();
+#else
 globalParams = new GlobalParams();
+#endif
 globalParams->setErrQuiet(true);
 #if defined(_MSC_VER)
 globalParams->setupBaseFonts(nullptr);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: helpcontent2

2021-04-05 Thread Rafael Lima (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 172125200e252d8636faa2e4f0c3dd602234d579
Author: Rafael Lima 
AuthorDate: Mon Apr 5 16:03:34 2021 +0200
Commit: Gerrit Code Review 
CommitDate: Mon Apr 5 16:03:34 2021 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to 215eec55562243262f2549e2071d8298a659057d
  - tdf#141200 Improve Basic MOD operator help page

The help page needs to clarify that non-integer operands are rounded to 
integers before the MOD operation.

Change-Id: I96a13cd9381dea3f79606f4f8bf26af54763e76d
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/113475
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index 261cea76744f..215eec555622 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 261cea76744f8d238dc7276b3aab1ea60cd9ef6e
+Subproject commit 215eec55562243262f2549e2071d8298a659057d
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] help.git: source/text

2021-04-05 Thread Rafael Lima (via logerrit)
 source/text/sbasic/shared/03070600.xhp |   55 +
 1 file changed, 36 insertions(+), 19 deletions(-)

New commits:
commit 215eec55562243262f2549e2071d8298a659057d
Author: Rafael Lima 
AuthorDate: Thu Apr 1 21:24:21 2021 +0200
Commit: Olivier Hallot 
CommitDate: Mon Apr 5 16:03:34 2021 +0200

tdf#141200 Improve Basic MOD operator help page

The help page needs to clarify that non-integer operands are rounded to 
integers before the MOD operation.

Change-Id: I96a13cd9381dea3f79606f4f8bf26af54763e76d
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/113475
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/source/text/sbasic/shared/03070600.xhp 
b/source/text/sbasic/shared/03070600.xhp
index 42516188e..ed510a94c 100644
--- a/source/text/sbasic/shared/03070600.xhp
+++ b/source/text/sbasic/shared/03070600.xhp
@@ -27,40 +27,57 @@
 
 
 
-
 
 
   MOD  operator (mathematical)
 
 
-
-Mod 
Operator
-Returns the 
integer remainder of a division.
+Mod 
Operator
+The 
MOD operator takes in two numeric expressions and returns 
the remainder of the division.
 
+For example, 
the result of 21 MOD 6 is 3 because after 
dividing 21 by 6, the remainder of the division is 3.
+If the 
MOD operation involves non-integer values, both operands are 
rounded to the nearest integer values. Hence, the value returned by a 
MOD operation will always be an integer number.
+For example, the 
expression 16.4 MOD 5.9 is evaluated as follows:
+
+
+The value 16.4 
is rounded to 16.
+
+
+The value 5.9 is 
rounded to 6.
+
+
+The operation 
16 MOD 6 returns 4, which is the remainder after dividing 16 
by 6.
+
+
+Beware that Basic's MOD 
operator and Calc's MOD Function behave differently. In Calc, both 
operands can be decimal values and they're not rounded before division, thus 
the resulting remainder may be a decimal value.
 
-Syntax:
+
 
 Result = 
Expression1 MOD Expression2
 
 
-Return 
value:
+
 Integer
 
-Parameters:
- 
Result: Any numeric variable that contains the result of the MOD 
operation.
- 
Expression1, Expression2: Any numeric expressions that you want to 
divide.
+
+ 
Result: Any numeric variable that contains the result of the 
MOD operation.
+ 
Expression1, Expression2: Any numeric expressions for which you 
want to calculate the remainder after the division of 
Expression1 by Expression2.
 
-Example:
+
 
-Sub ExampleMod
-Print 10 Mod 
2.5 ' returns 0
-Print 10 / 
2.5 ' returns 4
-Print 10 Mod 
5 ' returns 0
-Print 10 / 5 
' returns 2
-Print 5 Mod 
10 ' returns 5
-Print 5 / 10 
' returns 0.5
-End Sub
+Sub 
ExampleMod
+Dim a As 
Double, b as Double
+a = 10 : b = 
4
+Print a Mod b 'Returns 
2
+a = 18 : b = 
3.2
+Print a Mod b 'Returns 
0
+a = 16.4 : b 
= 5.9
+Print a Mod b 'Returns 
4
+End 
Sub
 
-
 
+
+  MOD 
Function
+
+
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-05 Thread Caolán McNamara (via logerrit)
 sc/source/filter/excel/xistream.cxx |   14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit b356facc76ae31f82d2d0a68af152680cc003929
Author: Caolán McNamara 
AuthorDate: Wed Mar 31 09:54:15 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 5 15:26:42 2021 +0200

cid#1474256 silence Untrusted loop bound

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

diff --git a/sc/source/filter/excel/xistream.cxx 
b/sc/source/filter/excel/xistream.cxx
index e1126aaf2950..df5500cc376d 100644
--- a/sc/source/filter/excel/xistream.cxx
+++ b/sc/source/filter/excel/xistream.cxx
@@ -746,19 +746,21 @@ std::size_t XclImpStream::Read( void* pData, std::size_t 
nBytes )
 std::size_t XclImpStream::CopyToStream( SvStream& rOutStrm, std::size_t nBytes 
)
 {
 std::size_t nRet = 0;
-if( mbValid && (nBytes > 0) )
+if (mbValid && nBytes)
 {
 const std::size_t nMaxBuffer = 4096;
-std::unique_ptr pnBuffer(new sal_uInt8[ ::std::min( 
nBytes, nMaxBuffer ) ]);
+std::vector aBuffer(o3tl::sanitizing_min(nBytes, 
nMaxBuffer));
 std::size_t nBytesLeft = nBytes;
 
-while( mbValid && (nBytesLeft > 0) )
+while (mbValid)
 {
-std::size_t nReadSize = ::std::min( nBytesLeft, nMaxBuffer );
-nRet += Read( pnBuffer.get(), nReadSize );
+if (!nBytesLeft)
+break;
+std::size_t nReadSize = o3tl::sanitizing_min(nBytesLeft, 
nMaxBuffer);
+nRet += Read(aBuffer.data(), nReadSize);
 // writing more bytes than read results in invalid memory access
 SAL_WARN_IF(nRet != nReadSize, "sc", "read less bytes than 
requested");
-rOutStrm.WriteBytes(pnBuffer.get(), nReadSize);
+rOutStrm.WriteBytes(aBuffer.data(), nReadSize);
 nBytesLeft -= nReadSize;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: i18npool/source sc/source

2021-04-05 Thread Mike Kaganski (via logerrit)
 i18npool/source/search/levdis.cxx  |   62 +
 i18npool/source/search/levdis.hxx  |4 --
 sc/source/filter/html/htmlpars.cxx |   28 +---
 3 files changed, 11 insertions(+), 83 deletions(-)

New commits:
commit 995b3186fa2126d1b299052a90a75cf32d5bfa26
Author: Mike Kaganski 
AuthorDate: Mon Apr 5 15:12:04 2021 +0300
Commit: Mike Kaganski 
CommitDate: Mon Apr 5 15:16:23 2021 +0200

Use std algorithms here

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

diff --git a/i18npool/source/search/levdis.cxx 
b/i18npool/source/search/levdis.cxx
index 5842abd1eef5..dd9f8fbf587a 100644
--- a/i18npool/source/search/levdis.cxx
+++ b/i18npool/source/search/levdis.cxx
@@ -56,6 +56,7 @@
 */
 
 #include 
+#include 
 
 #include "levdis.hxx"
 
@@ -119,7 +120,7 @@ int WLevDistance::WLD( const sal_Unicode* cString, 
sal_Int32 nStringLen )
 nP = 0; // a '?' could be any character.
 else
 // Minimum of replacement and deletion+insertion weighting
-nP = Min3( nRepP0, nRepP0, nDelR0 + nInsQ0 );
+nP = std::min({ nRepP0, nRepP0, nDelR0 + nInsQ0 });
 npDistance[0] = nInsQ0; // start with simple insert
 npDistance[1] = nInsQ0;
 npDistance[2] = nInsQ0;
@@ -150,7 +151,7 @@ int WLevDistance::WLD( const sal_Unicode* cString, 
sal_Int32 nStringLen )
 }
 }
 }
-nSPMin = Min3( npDistance[0], npDistance[1], npDistance[2] );
+nSPMin = std::min({ npDistance[0], npDistance[1], npDistance[2] });
 }
 
 // calculate distance matrix
@@ -203,7 +204,7 @@ int WLevDistance::WLD( const sal_Unicode* cString, 
sal_Int32 nStringLen )
 // WLD( X(i), Y(j) ) = min( WLD( X(i-1), Y(j-1) ) + p(i,j) ,
 //  WLD( X(i)  , Y(j-1) ) + q  ,
 //  WLD( X(i-1), Y(j)   ) + r  )
-npDistance[i] = Min3( d1 + nPij, d2 + nQ, npDistance[i-1] + nR );
+npDistance[i] = std::min({ d1 + nPij, d2 + nQ, npDistance[i-1] + 
nR });
 if ( npDistance[i] < nSPMin )
 nSPMin = npDistance[i];
 if ( bSplitCount )
@@ -263,63 +264,27 @@ void WLevDistance::CalcLPQR( int nX, int nY, int nZ, bool 
bRelaxed )
 if ( nX < 0 ) nX = 0;   // only positive values
 if ( nY < 0 ) nY = 0;
 if ( nZ < 0 ) nZ = 0;
-if (0 == Min3( nX, nY, nZ ))// at least one 0
+if (0 == std::min({ nX, nY, nZ })) // at least one 0
 {
 int nMid, nMax;
-nMax = Max3( nX, nY, nZ );  // either 0 for three 0s or Max
+nMax = std::max({ nX, nY, nZ }); // either 0 for three 0s or Max
 if ( 0 == (nMid = Mid3( nX, nY, nZ )) ) // even two 0
 nLimit = nMax;  // either 0 or the only one >0
 else// one is 0
-nLimit = LCM( nMid, nMax );
+nLimit = std::lcm( nMid, nMax );
 }
 else// all three of them are not 0
-nLimit = LCM( LCM( nX, nY ), nZ );
+nLimit = std::lcm(std::lcm(nX, nY), nZ);
 nRepP0 = ( nX ? nLimit / nX : nLimit + 1 );
 nInsQ0 = ( nY ? nLimit / nY : nLimit + 1 );
 nDelR0 = ( nZ ? nLimit / nZ : nLimit + 1 );
 bSplitCount = bRelaxed;
 }
 
-// greatest common divisor according to Euklid (chaindivision)
-// special case: 0 plus anything produces 1
-int WLevDistance::GCD( int a, int b )
-{
-if ( !a || !b )
-return 1;
-if ( a < 0 ) a = -a;
-if ( b < 0 ) b = -b;
-do
-{
-if ( a > b )
-a -= int(a / b) * b;
-else
-b -= int(b / a) * a;
-} while ( a && b );
-return( a ? a : b);
-}
-
-// least common multiple : a * b / GCD(a,b)
-int WLevDistance::LCM( int a, int b )
-{
-if ( a > b )// decrease overflow chance
-return( (a / GCD(a,b)) * b );
-else
-return( (b / GCD(a,b)) * a );
-}
-
-// Minimum of three values
-inline int WLevDistance::Min3( int x, int y, int z )
-{
-if ( x < y )
-return std::min(x, z);
-else
-return std::min(y, z);
-}
-
 // The value in the middle
 int WLevDistance::Mid3( int x, int y, int z )
 {
-int min = Min3(x,y,z);
+int min = std::min({ x, y, z });
 if ( x == min )
 return std::min(y, z);
 else if ( y == min )
@@ -328,15 +293,6 @@ int WLevDistance::Mid3( int x, int y, int z )
 return std::min(x, y);
 }
 
-// Maximum of three values
-int WLevDistance::Max3( int x, int y, int z )
-{
-if ( x > y )
-return std::max(x, z);
-else
-return std::max(y, z);
-}
-
 // initialize data from CTOR
 void WLevDistance::InitData( const sal_Unicode* cPattern )
 {
diff --git a/i18npool/source/search/levdis.hxx 
b/i18npool

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source include/LibreOfficeKit

2021-04-05 Thread Henry Castro (via logerrit)
 desktop/source/lib/init.cxx   |   18 +-
 include/LibreOfficeKit/LibreOfficeKit.h   |5 +
 include/LibreOfficeKit/LibreOfficeKit.hxx |   11 +++
 3 files changed, 33 insertions(+), 1 deletion(-)

New commits:
commit dea03310cc257514ceaabc732461e9e976ba60ed
Author: Henry Castro 
AuthorDate: Fri Dec 25 17:30:42 2020 -0400
Commit: Tor Lillqvist 
CommitDate: Mon Apr 5 14:31:48 2021 +0200

lok: add lo_sendDialogEvent to post dialog events

When the "Macro Security Warning" is shown in client side,
the model/view/controller are not created yet. It is necessary
to create a function to posts a dialog event.

Change-Id: I2bfc9edecc708dc79da575ea515e3144e78c10e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108293
Tested-by: Jenkins
Reviewed-by: Henry Castro 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108678
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113599
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a302b5d46f76..6c4be59af5d6 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2087,6 +2087,10 @@ static void lo_runLoop(LibreOfficeKit* pThis,
LibreOfficeKitWakeCallback pWakeCallback,
void* pData);
 
+static void lo_sendDialogEvent(LibreOfficeKit* pThis,
+   unsigned long long int nLOKWindowId,
+   const char* pArguments);
+
 LibLibreOffice_Impl::LibLibreOffice_Impl()
 : m_pOfficeClass( gOfficeClass.lock() )
 , maThread(nullptr)
@@ -2111,6 +2115,7 @@ LibLibreOffice_Impl::LibLibreOffice_Impl()
 m_pOfficeClass->runMacro = lo_runMacro;
 m_pOfficeClass->signDocument = lo_signDocument;
 m_pOfficeClass->runLoop = lo_runLoop;
+m_pOfficeClass->sendDialogEvent = lo_sendDialogEvent;
 
 gOfficeClass = m_pOfficeClass;
 }
@@ -3710,7 +3715,7 @@ public:
 
 } // anonymous namespace
 
-static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned 
long long int nWindowId, const char* pArguments)
+static void lcl_sendDialogEvent(unsigned long long int nWindowId, const char* 
pArguments)
 {
 SolarMutexGuard aGuard;
 
@@ -3793,6 +3798,17 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* 
/*pThis*/, unsigned long
 pWindow->Resize();
 }
 
+
+static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned 
long long int nWindowId, const char* pArguments)
+{
+lcl_sendDialogEvent(nWindowId, pArguments);
+}
+
+static void lo_sendDialogEvent(LibreOfficeKit* /*pThis*/, unsigned long long 
int nWindowId, const char* pArguments)
+{
+lcl_sendDialogEvent(nWindowId, pArguments);
+}
+
 static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* 
pCommand, const char* pArguments, bool bNotifyWhenFinished)
 {
 comphelper::ProfileZone aZone("doc_postUnoCommand");
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index f4244def5a6b..2279260d0e90 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -110,6 +110,11 @@ struct _LibreOfficeKitClass
  LibreOfficeKitPollCallback pPollCallback,
  LibreOfficeKitWakeCallback pWakeCallback,
  void* pData);
+
+/// @see lok::Office::sendDialogEvent
+void (*sendDialogEvent) (LibreOfficeKit* pThis,
+unsigned long long int nLOKWindowId,
+const char* pArguments);
 };
 
 #define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) 
LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize)
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 23b79c742c09..962270452e20 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -979,6 +979,17 @@ public:
 {
 mpThis->pClass->runLoop(mpThis, pPollCallback, pWakeCallback, pData);
 }
+
+/**
+ * Posts a dialog event for the window with given id
+ *
+ * @param nWindowId id of the window to notify
+ * @param pArguments arguments of the event.
+ */
+void sendDialogEvent(unsigned long long int nWindowId, const char* 
pArguments = NULL)
+{
+mpThis->pClass->sendDialogEvent(mpThis, nWindowId, pArguments);
+}
 };
 
 /// Factory method to create a lok::Office instance.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-05 Thread Mike Kaganski (via logerrit)
 tools/source/generic/fract.cxx |   16 +++-
 1 file changed, 3 insertions(+), 13 deletions(-)

New commits:
commit d266373bbb48f1c4c481fac74727c7b17440f7bd
Author: Mike Kaganski 
AuthorDate: Mon Apr 5 13:43:28 2021 +0300
Commit: Mike Kaganski 
CommitDate: Mon Apr 5 13:43:55 2021 +0200

Use std::gcd instead of boost version

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

diff --git a/tools/source/generic/fract.cxx b/tools/source/generic/fract.cxx
index a76ce01e1f81..6e245530281a 100644
--- a/tools/source/generic/fract.cxx
+++ b/tools/source/generic/fract.cxx
@@ -26,13 +26,8 @@
 
 #include 
 #include 
+#include 
 
-#include 
-#if BOOST_VERSION >= 106700
-#include 
-#else
-#include 
-#endif
 #include 
 
 #ifdef _MSC_VER
@@ -172,13 +167,8 @@ namespace
 T den = r.denominator();
 
 // Avoid overflow and preserve normalization
-#if BOOST_VERSION >= 106700
-T gcd1 = boost::integer::gcd(i.numerator(), den);
-T gcd2 = boost::integer::gcd(num, i.denominator());
-#else
-T gcd1 = boost::math::gcd(i.numerator(), den);
-T gcd2 = boost::math::gcd(num, i.denominator());
-#endif
+T gcd1 = std::gcd(i.numerator(), den);
+T gcd2 = std::gcd(num, i.denominator());
 
 bool fail = false;
 fail |= o3tl::checked_multiply(i.numerator() / gcd1, num / gcd2, num);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-05 Thread Andrea Gelmini (via logerrit)
 wizards/source/scriptforge/python/scriptforge.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d67829bdd37631d4c986e2b2658ebee471974e4d
Author: Andrea Gelmini 
AuthorDate: Mon Apr 5 12:31:07 2021 +0200
Commit: Andrea Gelmini 
CommitDate: Mon Apr 5 13:28:14 2021 +0200

Fix variable name

Change-Id: Ida5172f860303fa9493dd3477a970d29f87444de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113596
Reviewed-by: Julien Nabet 
Reviewed-by: Jean-Pierre Ledure 
Tested-by: Jean-Pierre Ledure 
Tested-by: Jenkins

diff --git a/wizards/source/scriptforge/python/scriptforge.py 
b/wizards/source/scriptforge/python/scriptforge.py
index b0c6c53077d5..68446e53fcfc 100644
--- a/wizards/source/scriptforge/python/scriptforge.py
+++ b/wizards/source/scriptforge/python/scriptforge.py
@@ -1343,7 +1343,7 @@ class SFScriptForge:
 propertysynonyms = SFServices._getAttributeSynonyms(serviceproperties)
 
 # Class constants
-MACROEXECALWAYS, MAROEXECNEVER, MACROEXECNORMAL = 2, 1, 0
+MACROEXECALWAYS, MACROEXECNEVER, MACROEXECNORMAL = 2, 1, 0
 BASEDOCUMENT, CALCDOCUMENT, DRAWDOCUMENT, IMPRESSDOCUMENT, 
MATHDOCUMENT, WRITERDOCUMENT = \
 'Base', 'Calc', 'Draw', 'Impress', 'Math', 'Writer'
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/source

2021-04-05 Thread Dennis Francis (via logerrit)
 sc/source/ui/inc/output.hxx|2 -
 sc/source/ui/view/gridwin4.cxx |   10 ++--
 sc/source/ui/view/output.cxx   |   49 +++--
 3 files changed, 47 insertions(+), 14 deletions(-)

New commits:
commit e3fa896aa14c03165190f0fef304ff0e8074d619
Author: Dennis Francis 
AuthorDate: Thu Mar 25 20:57:18 2021 +0530
Commit: Michael Meeks 
CommitDate: Mon Apr 5 13:21:15 2021 +0200

lok: draw bgcolor lines for covering client grid...

... that are over merged cells area. This is needed as client has no
information about merged cells.

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

diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index 0053055b1265..a832ad9f2bb1 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -334,7 +334,7 @@ public:
 
 voidSetSnapPixel();
 
-voidDrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool 
bPage);
+voidDrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, bool 
bPage, bool bMergeCover = false);
 voidDrawStrings( bool bPixelToLogic = false );
 
 /// Draw all strings, or provide Rectangle where the text (defined by 
rAddress) would be drawn.
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 7fa1b6c0001c..dce3d4a6d5d4 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -818,8 +818,14 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
 
 aOutputData.DrawDocumentBackground();
 
-if (bGridFirst && (bGrid || bPage) && !bNoBackgroundAndGrid)
-aOutputData.DrawGrid(*pContentDev, bGrid, bPage);
+if (bGridFirst && (bGrid || bPage))
+{
+// Draw lines in background color cover over lok client grid lines in 
merged cell areas if bNoBackgroundAndGrid is set.
+if (bNoBackgroundAndGrid)
+aOutputData.DrawGrid(*pContentDev, false /* bGrid */, false /* 
bPage */, true /* bMergeCover */);
+else
+aOutputData.DrawGrid(*pContentDev, bGrid, bPage);
+}
 
 aOutputData.DrawBackground(*pContentDev);
 
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index ced84e795ecd..0aa76721e54a 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -286,8 +286,11 @@ void ScOutputData::SetSyntaxMode( bool bNewMode )
 }
 }
 
-void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, 
bool bPage)
+void ScOutputData::DrawGrid(vcl::RenderContext& rRenderContext, bool bGrid, 
bool bPage, bool bMergeCover)
 {
+// bMergeCover : Draw lines in sheet bgcolor to cover lok client grid 
lines in merged cell areas.
+// (Used when scNoGridBackground is set in lok mode.)
+
 SCCOL nX;
 SCROW nY;
 long nPosX;
@@ -323,11 +326,12 @@ void ScOutputData::DrawGrid(vcl::RenderContext& 
rRenderContext, bool bGrid, bool
 // break all the drawing by one change.
 // So until that happens, we need to special case.
 bool bWorksInPixels = bMetaFile;
+const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
+Color aSheetBGColor = rColorCfg.GetColorValue(::svtools::DOCCOLOR).nColor;
 
 if ( eType == OUTTYPE_WINDOW )
 {
 bWorksInPixels = true;
-const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
 aPageColor = 
rColorCfg.GetColorValue(svtools::CALCPAGEBREAKAUTOMATIC).nColor;
 aManualColor = 
rColorCfg.GetColorValue(svtools::CALCPAGEBREAKMANUAL).nColor;
 }
@@ -349,7 +353,11 @@ void ScOutputData::DrawGrid(vcl::RenderContext& 
rRenderContext, bool bGrid, bool
 long nLayoutSign = bLayoutRTL ? -1 : 1;
 long nSignedOneX = nOneX * nLayoutSign;
 
-rRenderContext.SetLineColor(aGridColor);
+if (bGrid)
+rRenderContext.SetLineColor(aGridColor);
+else if (bMergeCover)
+rRenderContext.SetLineColor(aSheetBGColor);
+
 ScGridMerger aGrid(&rRenderContext, nOneX, nOneY);
 
 // vertical lines
@@ -391,17 +399,22 @@ void ScOutputData::DrawGrid(vcl::RenderContext& 
rRenderContext, bool bGrid, bool
 aPageColor );
 bDashed = true;
 }
-else
+else if (bGrid)
 {
 rRenderContext.SetLineColor( aGridColor );
 bDashed = false;
 }
+else if (bMergeCover)
+{
+rRenderContext.SetLineColor(aSheetBGColor);
+bDashed = false;
+}
 
 nBreakOld = nBreak;
 }
 }
 
-bool bDraw = bGrid || nBreakOld != ScBreakType::NONE; 

[Libreoffice-commits] core.git: Branch 'feature/cib_contract138c' - external/nss

2021-04-05 Thread Jan-Marek Glogowski (via logerrit)
 external/nss/ExternalProject_nss.mk   |6 +++---
 external/nss/UnpackedTarball_nss.mk   |   19 ---
 external/nss/nsinstall.py |7 ++-
 external/nss/nss-3.13.5-zlib-werror.patch |7 ---
 external/nss/nss-win32-make.patch.1   |2 +-
 external/nss/nss.windows.patch|4 ++--
 6 files changed, 24 insertions(+), 21 deletions(-)

New commits:
commit 99176c094018685e4945109cbc19eb0c8cd4c5de
Author: Jan-Marek Glogowski 
AuthorDate: Wed Jun 26 18:09:19 2019 +0200
Commit: Vasily Melenchuk 
CommitDate: Mon Apr 5 13:26:00 2021 +0300

NSS: enable parallel build

Since NSS 3.53, the Makefile based build should be fixed (upstream
bug 290526). The only missing patch is a minimal NSPR fix for the
"NSPR, configure + make, parallel, Windows, MS VS, debug" build.
That patch isn't incuded in the NSPR 4.25 release (but it's already
in the mercurial repo for NSPR 4.26).

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95218
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 
(cherry picked from commit b56e8d6def26a0430853835e997f1be841840a61)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100419
Reviewed-by: Michael Stahl 
(cherry picked from commit c1bce55faebd9ad8751d7b6b9a7f77dff7b3d507)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100589
(cherry picked from commit 3e4dbb1708d4b3b7619602b63602b884a7bb2caa)

Change-Id: I8eaa3792a12bdff734e56ac3f552991478957e23

diff --git a/external/nss/ExternalProject_nss.mk 
b/external/nss/ExternalProject_nss.mk
index a270e1f7de87..b270ebd9fc74 100644
--- a/external/nss/ExternalProject_nss.mk
+++ b/external/nss/ExternalProject_nss.mk
@@ -19,11 +19,11 @@ ifeq ($(OS),WNT)
 $(call gb_ExternalProject_get_state_target,nss,build): $(call 
gb_ExternalExecutable_get_dependencies,python)
$(call gb_ExternalProject_run,build,\
$(if $(MSVC_USE_DEBUG_RUNTIME),USE_DEBUG_RTL=1,BUILD_OPT=1) \
-   MOZ_MSVCVERSION=9 OS_TARGET=WIN95 \
+   OS_TARGET=WIN95 \
$(if $(filter X86_64,$(CPUNAME)),USE_64=1) \
LIB="$(ILIB)" \
XCFLAGS="-arch:SSE $(SOLARINC)" \
-   $(MAKE) -j1 nss_build_all RC="rc.exe $(SOLARINC)" \
+   $(MAKE) nss_build_all RC="rc.exe $(SOLARINC)" \
NSINSTALL='$(call 
gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py' \
,nss)
 
@@ -45,7 +45,7 @@ $(call gb_ExternalProject_get_state_target,nss,build): $(call 
gb_ExternalExecuta
$(if $(filter iOS-ARM,$(OS)-$(CPUNAME)),CPU_ARCH=arm) \
NSPR_CONFIGURE_OPTS="--build=$(BUILD_PLATFORM) 
--host=$(HOST_PLATFORM)") \
NSDISTMODE=copy \
-   $(MAKE) -j1 AR="$(AR)" \
+   $(MAKE) AR="$(AR)" \
RANLIB="$(RANLIB)" \
NMEDIT="$(NM)edit" \
COMMA=$(COMMA) \
diff --git a/external/nss/UnpackedTarball_nss.mk 
b/external/nss/UnpackedTarball_nss.mk
index e579950183f7..fd0cfa56e1d3 100644
--- a/external/nss/UnpackedTarball_nss.mk
+++ b/external/nss/UnpackedTarball_nss.mk
@@ -12,14 +12,11 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,nss))
 $(eval $(call gb_UnpackedTarball_set_tarball,nss,$(NSS_TARBALL)))
 
 $(eval $(call gb_UnpackedTarball_add_patches,nss,\
-   external/nss/nss.patch \
-   external/nss/nss.aix.patch \
-   external/nss/nss-3.13.5-zlib-werror.patch \
-   external/nss/nss_macosx.patch \
-   external/nss/nss-win32-make.patch.1 \
-   $(if $(filter WNT,$(OS)),external/nss/nss.windows.patch \
-external/nss/nss.nowerror.patch \
-   external/nss/nss.vs2015.patch) \
+external/nss/nss.patch \
+external/nss/nss.aix.patch \
+external/nss/nss-3.13.5-zlib-werror.patch \
+external/nss/nss_macosx.patch \
+external/nss/nss-win32-make.patch.1 \
 external/nss/ubsan.patch.0 \
 external/nss/clang-cl.patch.0 \
 external/nss/nss.vs2015.patch \
@@ -30,8 +27,8 @@ $(eval $(call gb_UnpackedTarball_add_patches,nss,\
$(if $(filter MSC-INTEL,$(COM)-$(CPUNAME)), \
external/nss/nss.cygwin64.in32bit.patch) \
$(if $(filter WNT,$(OS)), \
-   external/nss/nss.vs2015.pdb.patch) \
-   $(if $(filter WNT,$(OS)), \
+external/nss/nss.windows.patch \
+external/nss/nss.nowerror.patch \
external/nss/nss.utf8bom.patch.1) \
$(if $(filter ANDROID,$(OS)), \
external/nss/nss-android.patch.1) \
@@ -40,7 +37,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,nss,\
 ifeq ($(COM_IS_CLANG),TRUE)
 ifneq ($(filter -fsanitize=%,$(CC)),)
 $(eval $(call gb_UnpackedTarball_add_patches,nss,\
-   external/nss/asan.patch.1 \
+external/nss/asan.patch.1 \
 ))
 endif
 endif
diff --git a/external/nss/nsinstall.py b/external/nss/nsins

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

2021-04-05 Thread Caolán McNamara (via logerrit)
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   52 +-
 writerfilter/source/dmapper/DomainMapper_Impl.hxx |2 
 2 files changed, 35 insertions(+), 19 deletions(-)

New commits:
commit 8109dd0217cb8d8faac185176d638d7af588a520
Author: Caolán McNamara 
AuthorDate: Sun Apr 4 20:01:13 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 5 12:18:50 2021 +0200

crashtesting: assert in fdo6872-1.docx in CopyImplImpl after SAXError 
exception

sw/source/core/doc/DocumentContentOperationsManager.cxx:5040
assert(pStt->nNode != pEnd->nNode);

presumably due to the error the positions are wrong when CopyImplImpl is
called in popping the context where the exception occured, so skip the
asserting operation if the document failed to load and will be thrown away

fixes fdo68738-1.docx, fdo46060-6.docx, fdo55725-1.docx, fdo68721-1.docx
but similar ooo127821-1.docx remains

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

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 44ab9fdf3b36..200cb75667be 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "DomainMapper_Impl.hxx"
 #include "ConversionHelper.hxx"
@@ -354,7 +355,8 @@ DomainMapper_Impl::DomainMapper_Impl(
 m_bParaAutoBefore(false),
 m_bFirstParagraphInCell(true),
 m_bSaveFirstParagraphInCell(false),
-m_bParaWithInlineObject(false)
+m_bParaWithInlineObject(false),
+m_bSaxError(false)
 
 {
 m_aBaseUrl = rMediaDesc.getUnpackedValueOrDefault(
@@ -2973,23 +2975,26 @@ void DomainMapper_Impl::PopFootOrEndnote()
 xFootnotes->getByIndex(1) >>= xFootnoteFirst;
 else
 xEndnotes->getByIndex(1) >>= xFootnoteFirst;
-uno::Reference< text::XText > xSrc( xFootnoteFirst, 
uno::UNO_QUERY_THROW );
-uno::Reference< text::XText > xDest( xFootnoteLast, 
uno::UNO_QUERY_THROW );
-uno::Reference< text::XTextCopy > xTxt, xTxt2;
-xTxt.set(  xSrc, uno::UNO_QUERY_THROW );
-xTxt2.set( xDest, uno::UNO_QUERY_THROW );
-xTxt2->copyText( xTxt );
-
-// copy its redlines
-std::vector redPos, redLen;
-sal_Int32 redIdx;
-enum StoredRedlines eType = IsInFootnote() ? 
StoredRedlines::FOOTNOTE : StoredRedlines::ENDNOTE;
-lcl_CopyRedlines(xSrc, m_aStoredRedlines[eType], redPos, redLen, 
redIdx);
-lcl_PasteRedlines(xDest, m_aStoredRedlines[eType], redPos, redLen, 
redIdx);
-
-// remove processed redlines
-for( size_t i = 0; redIdx > -1 && i <= 
sal::static_int_cast(redIdx) + 2; i++)
-m_aStoredRedlines[eType].pop_front();
+if (!m_bSaxError)
+{
+uno::Reference< text::XText > xSrc( xFootnoteFirst, 
uno::UNO_QUERY_THROW );
+uno::Reference< text::XText > xDest( xFootnoteLast, 
uno::UNO_QUERY_THROW );
+uno::Reference< text::XTextCopy > xTxt, xTxt2;
+xTxt.set(  xSrc, uno::UNO_QUERY_THROW );
+xTxt2.set( xDest, uno::UNO_QUERY_THROW );
+xTxt2->copyText( xTxt );
+
+// copy its redlines
+std::vector redPos, redLen;
+sal_Int32 redIdx;
+enum StoredRedlines eType = IsInFootnote() ? 
StoredRedlines::FOOTNOTE : StoredRedlines::ENDNOTE;
+lcl_CopyRedlines(xSrc, m_aStoredRedlines[eType], redPos, 
redLen, redIdx);
+lcl_PasteRedlines(xDest, m_aStoredRedlines[eType], redPos, 
redLen, redIdx);
+
+// remove processed redlines
+for( size_t i = 0; redIdx > -1 && i <= 
sal::static_int_cast(redIdx) + 2; i++)
+m_aStoredRedlines[eType].pop_front();
+}
 
 // remove temporary footnote
 xFootnoteFirst->getAnchor()->setString("");
@@ -7640,7 +7645,16 @@ void DomainMapper_Impl::substream(Id rName,
 PushAnnotation();
 break;
 }
-ref->resolve(m_rDMapper);
+
+try
+{
+ref->resolve(m_rDMapper);
+}
+catch (xml::sax::SAXException const&)
+{
+m_bSaxError = true;
+throw;
+}
 
 switch( rName )
 {
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 1b29e96cbc27..c4d9b5014c04 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -1144,6 +1144,8 @@ private:
 bool m_bSaveFirstParagraphInCell;
 /// Current paragraph had at least one inline o

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

2021-04-05 Thread Caolán McNamara (via logerrit)
 tools/source/generic/fract.cxx|6 ++
 vcl/qa/cppunit/graphicfilter/data/svm/pass/ofz32885-1.svm |binary
 2 files changed, 6 insertions(+)

New commits:
commit b4613a30fed86aa8eed45e1ecee13947a33ea81c
Author: Caolán McNamara 
AuthorDate: Sun Apr 4 20:34:30 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 5 12:18:31 2021 +0200

ofz#32885 regard as invalid fractions that will FPE boost::integer::gcd

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

diff --git a/tools/source/generic/fract.cxx b/tools/source/generic/fract.cxx
index b525d1de9896..a76ce01e1f81 100644
--- a/tools/source/generic/fract.cxx
+++ b/tools/source/generic/fract.cxx
@@ -64,6 +64,12 @@ Fraction::Fraction( sal_Int64 nNum, sal_Int64 nDen ) : 
mnNumerator(nNum), mnDeno
 SAL_WARN( "tools.fraction", "'Fraction(" << nNum << ",0)' invalid 
fraction created" );
 return;
 }
+if (nDen == -1 && nNum == std::numeric_limits::min())
+{
+mbValid = false;
+SAL_WARN("tools.fraction", "'Fraction(" << nNum << "," << nDen << ")' 
invalid fraction created");
+return;
+}
 }
 
 /**
diff --git a/vcl/qa/cppunit/graphicfilter/data/svm/pass/ofz32885-1.svm 
b/vcl/qa/cppunit/graphicfilter/data/svm/pass/ofz32885-1.svm
new file mode 100644
index ..b4d5126b95cf
Binary files /dev/null and 
b/vcl/qa/cppunit/graphicfilter/data/svm/pass/ofz32885-1.svm differ
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - 9 commits - basegfx/CppunitTest_basegfx.mk basegfx/test cui/source cui/uiconfig include/basegfx include/sfx2 include/vcl officecfg/

2021-04-05 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit 35d56b6c4a5519470376ca1c0b468c02bfc652f4
Author: Tomaž Vajngerl 
AuthorDate: Thu Mar 18 15:59:20 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Apr 5 16:54:33 2021 +0900

vcl: bring back RGB565 scanline transformer

While we don't support this as a Bitmap format anymore, we still
need to transform a buffer that is in RGB565 format in some cases.
For example backwards compatibility or if a certain bitmap format
supports such pixel format.
This change also simplifies some scanline transformers by removing
code duplication.

Change-Id: I64aa258b8b1fbebf0ed174c0d5fdd2f75f382b28

diff --git a/vcl/inc/bitmap/ScanlineTools.hxx b/vcl/inc/bitmap/ScanlineTools.hxx
index 98e702549f2b..fcb243e72014 100644
--- a/vcl/inc/bitmap/ScanlineTools.hxx
+++ b/vcl/inc/bitmap/ScanlineTools.hxx
@@ -16,7 +16,7 @@
 
 namespace vcl::bitmap
 {
-class ScanlineTransformer
+class IScanlineTransformer
 {
 public:
 virtual void startLine(sal_uInt8* pLine) = 0;
@@ -24,127 +24,163 @@ public:
 virtual Color readPixel() = 0;
 virtual void writePixel(Color nColor) = 0;
 
-virtual ~ScanlineTransformer() = default;
+virtual ~IScanlineTransformer() = default;
 };
 
-class ScanlineTransformer_ARGB final : public ScanlineTransformer
+class ScanlineTransformer_RGB565 : public IScanlineTransformer
 {
-private:
-sal_uInt8* pData;
+protected:
+sal_uInt16* mpData;
 
 public:
-virtual void startLine(sal_uInt8* pLine) override { pData = pLine; }
+void startLine(sal_uInt8* pLine) override { mpData = 
reinterpret_cast(pLine); }
 
-virtual void skipPixel(sal_uInt32 nPixel) override { pData += nPixel << 2; 
}
+void skipPixel(sal_uInt32 nPixel) override { mpData += nPixel; }
 
-virtual Color readPixel() override
+Color readPixel() override
 {
-const Color aColor(ColorTransparency, pData[4], pData[1], pData[2], 
pData[3]);
-pData += 4;
-return aColor;
+sal_uInt8 R = sal_uInt8((*mpData & 0xf800) >> 8);
+sal_uInt8 G = sal_uInt8((*mpData & 0x07e0) >> 3);
+sal_uInt8 B = sal_uInt8((*mpData & 0x001f) << 3);
+mpData++;
+return Color(R, G, B);
 }
 
-virtual void writePixel(Color nColor) override
+void writePixel(Color nColor) override
 {
-*pData++ = nColor.GetAlpha();
-*pData++ = nColor.GetRed();
-*pData++ = nColor.GetGreen();
-*pData++ = nColor.GetBlue();
+sal_uInt16 R = (nColor.GetRed() & 0xf8) << 8;
+sal_uInt16 G = (nColor.GetGreen() & 0xfc) << 3;
+sal_uInt16 B = (nColor.GetBlue() & 0xf8) >> 3;
+
+*mpData++ = R | G | B;
 }
 };
 
-class ScanlineTransformer_BGR final : public ScanlineTransformer
+class ScanlineTransformerBase : public IScanlineTransformer
 {
-private:
-sal_uInt8* pData;
+protected:
+sal_uInt8* mpData;
 
 public:
-virtual void startLine(sal_uInt8* pLine) override { pData = pLine; }
+ScanlineTransformerBase()
+: mpData(nullptr)
+{
+}
 
-virtual void skipPixel(sal_uInt32 nPixel) override { pData += (nPixel << 
1) + nPixel; }
+void startLine(sal_uInt8* pLine) override { mpData = pLine; }
+};
 
-virtual Color readPixel() override
+class ScanlineTransformer_ARGB final : public ScanlineTransformerBase
+{
+public:
+void skipPixel(sal_uInt32 nPixel) override { mpData += nPixel << 2; }
+
+Color readPixel() override
 {
-const Color aColor(pData[2], pData[1], pData[0]);
-pData += 3;
+const Color aColor(ColorTransparency, mpData[4], mpData[1], mpData[2], 
mpData[3]);
+mpData += 4;
 return aColor;
 }
 
-virtual void writePixel(Color nColor) override
+void writePixel(Color nColor) override
 {
-*pData++ = nColor.GetBlue();
-*pData++ = nColor.GetGreen();
-*pData++ = nColor.GetRed();
+*mpData++ = nColor.GetAlpha();
+*mpData++ = nColor.GetRed();
+*mpData++ = nColor.GetGreen();
+*mpData++ = nColor.GetBlue();
 }
 };
 
-class ScanlineTransformer_8BitPalette final : public ScanlineTransformer
+class ScanlineTransformer_BGR final : public ScanlineTransformerBase
 {
-private:
-sal_uInt8* pData;
+public:
+void skipPixel(sal_uInt32 nPixel) override { mpData += (nPixel << 1) + 
nPixel; }
+
+Color readPixel() override
+{
+const Color aColor(mpData[2], mpData[1], mpData[0]);
+mpData += 3;
+return aColor;
+}
+
+void writePixel(Color nColor) override
+{
+*mpData++ = nColor.GetBlue();
+*mpData++ = nColor.GetGreen();
+*mpData++ = nColor.GetRed();
+}
+};
+
+class ScanlineTransformerPaletteBase : public ScanlineTransformerBase
+{
+protected:
 const BitmapPalette& mrPalette;
 
 public:
-explicit ScanlineTransformer_8BitPalette(const BitmapPalette& rPalette)
-: pData(nullptr)
+ScanlineTransformerPaletteBase(const BitmapPal

[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - 9 commits - basegfx/CppunitTest_basegfx.mk basegfx/test cui/source cui/uiconfig include/basegfx include/sfx2 include/vcl officecfg/

2021-04-05 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit 81e1468e27ea4af2729201c4f9f05e8ee4d496ad
Author: Tomaž Vajngerl 
AuthorDate: Thu Mar 18 15:59:20 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Apr 5 16:43:27 2021 +0900

vcl: bring back RGB565 scanline transformer

While we don't support this as a Bitmap format anymore, we still
need to transform a buffer that is in RGB565 format in some cases.
For example backwards compatibility or if a certain bitmap format
supports such pixel format.
This change also simplifies some scanline transformers by removing
code duplication.

Change-Id: I64aa258b8b1fbebf0ed174c0d5fdd2f75f382b28

diff --git a/vcl/inc/bitmap/ScanlineTools.hxx b/vcl/inc/bitmap/ScanlineTools.hxx
index 98e702549f2b..fcb243e72014 100644
--- a/vcl/inc/bitmap/ScanlineTools.hxx
+++ b/vcl/inc/bitmap/ScanlineTools.hxx
@@ -16,7 +16,7 @@
 
 namespace vcl::bitmap
 {
-class ScanlineTransformer
+class IScanlineTransformer
 {
 public:
 virtual void startLine(sal_uInt8* pLine) = 0;
@@ -24,127 +24,163 @@ public:
 virtual Color readPixel() = 0;
 virtual void writePixel(Color nColor) = 0;
 
-virtual ~ScanlineTransformer() = default;
+virtual ~IScanlineTransformer() = default;
 };
 
-class ScanlineTransformer_ARGB final : public ScanlineTransformer
+class ScanlineTransformer_RGB565 : public IScanlineTransformer
 {
-private:
-sal_uInt8* pData;
+protected:
+sal_uInt16* mpData;
 
 public:
-virtual void startLine(sal_uInt8* pLine) override { pData = pLine; }
+void startLine(sal_uInt8* pLine) override { mpData = 
reinterpret_cast(pLine); }
 
-virtual void skipPixel(sal_uInt32 nPixel) override { pData += nPixel << 2; 
}
+void skipPixel(sal_uInt32 nPixel) override { mpData += nPixel; }
 
-virtual Color readPixel() override
+Color readPixel() override
 {
-const Color aColor(ColorTransparency, pData[4], pData[1], pData[2], 
pData[3]);
-pData += 4;
-return aColor;
+sal_uInt8 R = sal_uInt8((*mpData & 0xf800) >> 8);
+sal_uInt8 G = sal_uInt8((*mpData & 0x07e0) >> 3);
+sal_uInt8 B = sal_uInt8((*mpData & 0x001f) << 3);
+mpData++;
+return Color(R, G, B);
 }
 
-virtual void writePixel(Color nColor) override
+void writePixel(Color nColor) override
 {
-*pData++ = nColor.GetAlpha();
-*pData++ = nColor.GetRed();
-*pData++ = nColor.GetGreen();
-*pData++ = nColor.GetBlue();
+sal_uInt16 R = (nColor.GetRed() & 0xf8) << 8;
+sal_uInt16 G = (nColor.GetGreen() & 0xfc) << 3;
+sal_uInt16 B = (nColor.GetBlue() & 0xf8) >> 3;
+
+*mpData++ = R | G | B;
 }
 };
 
-class ScanlineTransformer_BGR final : public ScanlineTransformer
+class ScanlineTransformerBase : public IScanlineTransformer
 {
-private:
-sal_uInt8* pData;
+protected:
+sal_uInt8* mpData;
 
 public:
-virtual void startLine(sal_uInt8* pLine) override { pData = pLine; }
+ScanlineTransformerBase()
+: mpData(nullptr)
+{
+}
 
-virtual void skipPixel(sal_uInt32 nPixel) override { pData += (nPixel << 
1) + nPixel; }
+void startLine(sal_uInt8* pLine) override { mpData = pLine; }
+};
 
-virtual Color readPixel() override
+class ScanlineTransformer_ARGB final : public ScanlineTransformerBase
+{
+public:
+void skipPixel(sal_uInt32 nPixel) override { mpData += nPixel << 2; }
+
+Color readPixel() override
 {
-const Color aColor(pData[2], pData[1], pData[0]);
-pData += 3;
+const Color aColor(ColorTransparency, mpData[4], mpData[1], mpData[2], 
mpData[3]);
+mpData += 4;
 return aColor;
 }
 
-virtual void writePixel(Color nColor) override
+void writePixel(Color nColor) override
 {
-*pData++ = nColor.GetBlue();
-*pData++ = nColor.GetGreen();
-*pData++ = nColor.GetRed();
+*mpData++ = nColor.GetAlpha();
+*mpData++ = nColor.GetRed();
+*mpData++ = nColor.GetGreen();
+*mpData++ = nColor.GetBlue();
 }
 };
 
-class ScanlineTransformer_8BitPalette final : public ScanlineTransformer
+class ScanlineTransformer_BGR final : public ScanlineTransformerBase
 {
-private:
-sal_uInt8* pData;
+public:
+void skipPixel(sal_uInt32 nPixel) override { mpData += (nPixel << 1) + 
nPixel; }
+
+Color readPixel() override
+{
+const Color aColor(mpData[2], mpData[1], mpData[0]);
+mpData += 3;
+return aColor;
+}
+
+void writePixel(Color nColor) override
+{
+*mpData++ = nColor.GetBlue();
+*mpData++ = nColor.GetGreen();
+*mpData++ = nColor.GetRed();
+}
+};
+
+class ScanlineTransformerPaletteBase : public ScanlineTransformerBase
+{
+protected:
 const BitmapPalette& mrPalette;
 
 public:
-explicit ScanlineTransformer_8BitPalette(const BitmapPalette& rPalette)
-: pData(nullptr)
+ScanlineTransformerPaletteBase(const BitmapPal

[Libreoffice-commits] core.git: Branch 'private/tvajngerl/staging' - 148 commits - android/source basctl/source basegfx/CppunitTest_basegfx.mk basegfx/source basegfx/test basic/source canvas/source co

2021-04-05 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit cc8a45ec8701aae7e1bcc1b33653a76f0f397b7b
Author: Tomaž Vajngerl 
AuthorDate: Thu Mar 18 15:59:20 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Apr 5 11:07:52 2021 +0900

vcl: bring back RGB565 scanline transformer

While we don't support this as a Bitmap format anymore, we still
need to transform a buffer that is in RGB565 format in some cases.
For example backwards compatibility or if a certain bitmap format
supports such pixel format.
This change also simplifies some scanline transformers by removing
code duplication.

Change-Id: I64aa258b8b1fbebf0ed174c0d5fdd2f75f382b28

diff --git a/vcl/inc/bitmap/ScanlineTools.hxx b/vcl/inc/bitmap/ScanlineTools.hxx
index 98e702549f2b..fcb243e72014 100644
--- a/vcl/inc/bitmap/ScanlineTools.hxx
+++ b/vcl/inc/bitmap/ScanlineTools.hxx
@@ -16,7 +16,7 @@
 
 namespace vcl::bitmap
 {
-class ScanlineTransformer
+class IScanlineTransformer
 {
 public:
 virtual void startLine(sal_uInt8* pLine) = 0;
@@ -24,127 +24,163 @@ public:
 virtual Color readPixel() = 0;
 virtual void writePixel(Color nColor) = 0;
 
-virtual ~ScanlineTransformer() = default;
+virtual ~IScanlineTransformer() = default;
 };
 
-class ScanlineTransformer_ARGB final : public ScanlineTransformer
+class ScanlineTransformer_RGB565 : public IScanlineTransformer
 {
-private:
-sal_uInt8* pData;
+protected:
+sal_uInt16* mpData;
 
 public:
-virtual void startLine(sal_uInt8* pLine) override { pData = pLine; }
+void startLine(sal_uInt8* pLine) override { mpData = 
reinterpret_cast(pLine); }
 
-virtual void skipPixel(sal_uInt32 nPixel) override { pData += nPixel << 2; 
}
+void skipPixel(sal_uInt32 nPixel) override { mpData += nPixel; }
 
-virtual Color readPixel() override
+Color readPixel() override
 {
-const Color aColor(ColorTransparency, pData[4], pData[1], pData[2], 
pData[3]);
-pData += 4;
-return aColor;
+sal_uInt8 R = sal_uInt8((*mpData & 0xf800) >> 8);
+sal_uInt8 G = sal_uInt8((*mpData & 0x07e0) >> 3);
+sal_uInt8 B = sal_uInt8((*mpData & 0x001f) << 3);
+mpData++;
+return Color(R, G, B);
 }
 
-virtual void writePixel(Color nColor) override
+void writePixel(Color nColor) override
 {
-*pData++ = nColor.GetAlpha();
-*pData++ = nColor.GetRed();
-*pData++ = nColor.GetGreen();
-*pData++ = nColor.GetBlue();
+sal_uInt16 R = (nColor.GetRed() & 0xf8) << 8;
+sal_uInt16 G = (nColor.GetGreen() & 0xfc) << 3;
+sal_uInt16 B = (nColor.GetBlue() & 0xf8) >> 3;
+
+*mpData++ = R | G | B;
 }
 };
 
-class ScanlineTransformer_BGR final : public ScanlineTransformer
+class ScanlineTransformerBase : public IScanlineTransformer
 {
-private:
-sal_uInt8* pData;
+protected:
+sal_uInt8* mpData;
 
 public:
-virtual void startLine(sal_uInt8* pLine) override { pData = pLine; }
+ScanlineTransformerBase()
+: mpData(nullptr)
+{
+}
 
-virtual void skipPixel(sal_uInt32 nPixel) override { pData += (nPixel << 
1) + nPixel; }
+void startLine(sal_uInt8* pLine) override { mpData = pLine; }
+};
 
-virtual Color readPixel() override
+class ScanlineTransformer_ARGB final : public ScanlineTransformerBase
+{
+public:
+void skipPixel(sal_uInt32 nPixel) override { mpData += nPixel << 2; }
+
+Color readPixel() override
 {
-const Color aColor(pData[2], pData[1], pData[0]);
-pData += 3;
+const Color aColor(ColorTransparency, mpData[4], mpData[1], mpData[2], 
mpData[3]);
+mpData += 4;
 return aColor;
 }
 
-virtual void writePixel(Color nColor) override
+void writePixel(Color nColor) override
 {
-*pData++ = nColor.GetBlue();
-*pData++ = nColor.GetGreen();
-*pData++ = nColor.GetRed();
+*mpData++ = nColor.GetAlpha();
+*mpData++ = nColor.GetRed();
+*mpData++ = nColor.GetGreen();
+*mpData++ = nColor.GetBlue();
 }
 };
 
-class ScanlineTransformer_8BitPalette final : public ScanlineTransformer
+class ScanlineTransformer_BGR final : public ScanlineTransformerBase
 {
-private:
-sal_uInt8* pData;
+public:
+void skipPixel(sal_uInt32 nPixel) override { mpData += (nPixel << 1) + 
nPixel; }
+
+Color readPixel() override
+{
+const Color aColor(mpData[2], mpData[1], mpData[0]);
+mpData += 3;
+return aColor;
+}
+
+void writePixel(Color nColor) override
+{
+*mpData++ = nColor.GetBlue();
+*mpData++ = nColor.GetGreen();
+*mpData++ = nColor.GetRed();
+}
+};
+
+class ScanlineTransformerPaletteBase : public ScanlineTransformerBase
+{
+protected:
 const BitmapPalette& mrPalette;
 
 public:
-explicit ScanlineTransformer_8BitPalette(const BitmapPalette& rPalette)
-: pData(nullptr)
+ScanlineTransformerPaletteBase(const BitmapPal