[libreoffice] 01/01: git update; remove the obsolete arm patches
Rene Engelhard
rene at moszumanska.debian.org
Sat Oct 28 09:52:52 UTC 2017
This is an automated email from the git hooks/post-receive script.
rene pushed a commit to branch master
in repository libreoffice.
commit f69db8eb6e0d0160d3a49b8a2550634648847b66
Author: Rene Engelhard <rene at rene-engelhard.de>
Date: Fri Oct 27 18:26:37 2017 +0200
git update; remove the obsolete arm patches
---
changelog | 4 +-
.../arm64-bridges-no-stack-protector-strong.diff | 43 --
patches/arm64-disable-sc-functions-test.diff | 37 -
...ing-cpp-exceptions-across-libgpeg-c-frames.diff | 759 ---------------------
patches/series | 3 -
5 files changed, 3 insertions(+), 843 deletions(-)
diff --git a/changelog b/changelog
index 20fe27a..1b07fca 100644
--- a/changelog
+++ b/changelog
@@ -1,4 +1,6 @@
-libreoffice (1:5.4.3~rc1-3) UNRELEASED; urgency=medium
+libreoffice (1:5.4.3~rc2~git20171027-1) UNRELEASED; urgency=medium
+
+ * New upstream snapshot
* debian/rules:
- be consequent and enable the junit tests on armhf/arm64 now that
diff --git a/patches/arm64-bridges-no-stack-protector-strong.diff b/patches/arm64-bridges-no-stack-protector-strong.diff
deleted file mode 100644
index d3f7f9f..0000000
--- a/patches/arm64-bridges-no-stack-protector-strong.diff
+++ /dev/null
@@ -1,43 +0,0 @@
-From dddb527db1562f30a2a2b20338dfc8458086a4a9 Mon Sep 17 00:00:00 2001
-From: Stephan Bergmann <sbergman at redhat.com>
-Date: Thu, 19 Oct 2017 15:29:38 +0200
-Subject: Again, no -fstack-protector-strong for gcc3_linux_aarch64/cpp2uno.cxx
-
-8d12e4ec8b843d59661a12a7a92bfec7e4473e0f "No -fstack-protect-strong for
-gcc3_linux_aarch64/cpp2uno.cxx vtableSlotCall" had done that in the past (so
-that setting up the x0/x1 return registers in vtableSlotCall is not clobbered
-by the stack protector code), but gbuild details have apparently changed in the
-meantime, so that gb_CXXFLAGS_COMMON's -fstack-protector-strong now ends up on
-the compiler command line before what is covered by gb_Library_add_cxxobjects's
-argument, so didn't get subst'ed to -fstack-protector. That caused Flathub
-aarch64 builds to fail in CustomTarget_testtools/uno_test.
-
-However, if both -fstack-protector-strong and -fstack-protector are present on
-the command line, the second apparently wins, so use that hack for now.
-(-fstack-protector-strong is only available since GCC 4.9, but -fstack-protector
-is already available in our current baseline GCC 4.8.1, and even for a build on
-that baseline it wouldn't hurt if cpp2uno.cxx was explicitly built with
--fstack-protector even if none of the other files were built with
--fstack-protector-strong.)
-
-Change-Id: I9d78d2e5b08b7c0a4adb1531b482cd43617886f7
-
-diff --git a/bridges/Library_cpp_uno.mk b/bridges/Library_cpp_uno.mk
-index 8016677..22ce084 100644
---- a/bridges/Library_cpp_uno.mk
-+++ b/bridges/Library_cpp_uno.mk
-@@ -34,9 +34,8 @@ bridge_exception_objects := abi callvirtualfunction uno2cpp
-
- $(eval $(call gb_Library_add_cxxobjects,$(gb_CPPU_ENV)_uno, \
- bridges/source/cpp_uno/$(bridges_SELECTED_BRIDGE)/cpp2uno, \
-- $(subst -fstack-protector-strong,-fstack-protector, \
-- $(gb_LinkTarget_EXCEPTIONFLAGS) \
-- $(call gb_LinkTarget__get_cxxflags,$(gb_CPPU_ENV)_uno)) \
-+ $(gb_LinkTarget_EXCEPTIONFLAGS) \
-+ $(call gb_LinkTarget__get_cxxflags,$(gb_CPPU_ENV)_uno) -fstack-protector \
- ))
- endif
-
---
-cgit v0.10.2
-
diff --git a/patches/arm64-disable-sc-functions-test.diff b/patches/arm64-disable-sc-functions-test.diff
deleted file mode 100644
index 5e327f9..0000000
--- a/patches/arm64-disable-sc-functions-test.diff
+++ /dev/null
@@ -1,37 +0,0 @@
-From 6cb20e0b298f41fe88984aebfe5454f936a0ae3a Mon Sep 17 00:00:00 2001
-From: Stephan Bergmann <sbergman at redhat.com>
-Date: Fri, 20 Oct 2017 10:52:48 +0200
-Subject: Disable CppunitTset_sc_*_functions_test for linux_aarch64 for now,
- too
-
-> Oct 20 10:21:31 <sberg> erAck, when "Testing
-> file:///run/build/libreoffice/sc/qa/unit/data/functions/array/fods/linest.fods"
-> in CppunitTest_sc_array_functions_test fails with non-informative expected 1
-> vs. actual 0, how can I reasonably debug that? (and no, I don't have an X11
-> connection to the relevant machine, to see what opening that .fods with LO
-> would look like there)
-> Oct 20 10:25:04 <erAck> sberg: sigh.. we're still lacking an "analyze steps"
-> in the functions test loader, so far only loading the doc and inspecting
-> provides that; maybe getting individual cell results via UNO would work
-
-So disable these tests for aarch64 for now too, to get Flathub builds unstuck,
-until somebody finds a way to actually debug this.
-
-Change-Id: I9bf30d0d7185497f9ad4b04b60b6a67f34a8c44e
-
-diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
-index bd5b769..0b600f7 100644
---- a/sc/Module_sc.mk
-+++ b/sc/Module_sc.mk
-@@ -69,7 +69,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sc, \
- # point weirdness (x87, registers, compiler optimization, ... whatever),
- # disable them until someone finds a real cure.
-
--ifneq ($(PLATFORMID),linux_x86)
-+ifneq ($(filter-out linux_aarch64 linux_x86,$(PLATFORMID)),)
- $(eval $(call gb_Module_add_slowcheck_targets,sc, \
- CppunitTest_sc_functions_test_old \
- CppunitTest_sc_database_functions_test \
---
-cgit v0.10.2
-
diff --git a/patches/avoid-throwing-cpp-exceptions-across-libgpeg-c-frames.diff b/patches/avoid-throwing-cpp-exceptions-across-libgpeg-c-frames.diff
deleted file mode 100644
index 2d76d59..0000000
--- a/patches/avoid-throwing-cpp-exceptions-across-libgpeg-c-frames.diff
+++ /dev/null
@@ -1,759 +0,0 @@
-From cfbb8b5090537e79ba70e250ddee86d53facbe15 Mon Sep 17 00:00:00 2001
-From: Stephan Bergmann <sbergman at redhat.com>
-Date: Wed, 18 Oct 2017 13:02:28 +0200
-Subject: Avoid throwing C++ exception across libjpeg C frames
-
-It causes trouble at least for (non-debug) 32-bit ARM Flatpak builds, where
-CppunitTest_vcl_filters_test aborts with an uncaught css::uno::RuntimeException.
-
-This is a partial revert of 6889fa826eef6bd1074d77507818e71dfe8ba152 "rework
-jpeg error handling to throw rather than setjmp to avoid leaks", switching back
-to setjmp/longjmp but trying to keep the leaks fixed by introducing any relevant
-local variables before the setjmps.
-
-Change-Id: Ia5984528ea98be1c89a21aee800b247120f88a89
-Reviewed-on: https://gerrit.libreoffice.org/43494
-Tested-by: Jenkins <ci at libreoffice.org>
-Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
-
-diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx
-index 4305f06..86dd30b 100644
---- a/vcl/source/filter/jpeg/jpegc.cxx
-+++ b/vcl/source/filter/jpeg/jpegc.cxx
-@@ -21,6 +21,7 @@
-
- #include <stdio.h>
- #include <stdlib.h>
-+#include <setjmp.h>
- #include <jpeglib.h>
- #include <jerror.h>
-
-@@ -37,12 +38,28 @@ extern "C" {
- #include <vcl/bitmapaccess.hxx>
- #include <vcl/graphicfilter.hxx>
-
-+#ifdef _MSC_VER
-+#pragma warning(push, 1) /* disable to __declspec(align()) aligned warning */
-+#pragma warning (disable: 4324)
-+#endif
-+
-+struct ErrorManagerStruct
-+{
-+ jpeg_error_mgr pub;
-+ jmp_buf setjmp_buffer;
-+};
-+
-+#ifdef _MSC_VER
-+#pragma warning(pop)
-+#endif
-+
- extern "C" void errorExit (j_common_ptr cinfo)
- {
- char buffer[JMSG_LENGTH_MAX];
- (*cinfo->err->format_message) (cinfo, buffer);
- SAL_WARN("vcl.filter", "fatal failure reading JPEG: " << buffer);
-- throw css::uno::RuntimeException(OUString(buffer, strlen(buffer), RTL_TEXTENCODING_ASCII_US));
-+ ErrorManagerStruct * error = reinterpret_cast<ErrorManagerStruct *>(cinfo->err);
-+ longjmp(error->setjmp_buffer, 1);
- }
-
- extern "C" void outputMessage (j_common_ptr cinfo)
-@@ -55,226 +72,239 @@ extern "C" void outputMessage (j_common_ptr cinfo)
- class JpegDecompressOwner
- {
- public:
-- JpegDecompressOwner(jpeg_decompress_struct &cinfo) : m_cinfo(cinfo)
-+ void set(jpeg_decompress_struct *cinfo)
- {
-+ m_cinfo = cinfo;
- }
- ~JpegDecompressOwner()
- {
-- jpeg_destroy_decompress(&m_cinfo);
-+ if (m_cinfo != nullptr)
-+ {
-+ jpeg_destroy_decompress(m_cinfo);
-+ }
- }
- private:
-- jpeg_decompress_struct &m_cinfo;
-+ jpeg_decompress_struct *m_cinfo = nullptr;
- };
-
- class JpegCompressOwner
- {
- public:
-- JpegCompressOwner(jpeg_compress_struct &cinfo) : m_cinfo(cinfo)
-+ void set(jpeg_compress_struct *cinfo)
- {
-+ m_cinfo = cinfo;
- }
- ~JpegCompressOwner()
- {
-- jpeg_destroy_compress(&m_cinfo);
-+ if (m_cinfo != nullptr)
-+ {
-+ jpeg_destroy_compress(m_cinfo);
-+ }
- }
- private:
-- jpeg_compress_struct &m_cinfo;
-+ jpeg_compress_struct *m_cinfo = nullptr;
- };
-
- void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines,
- Size const & previewSize, GraphicFilterImportFlags nImportFlags,
- Bitmap::ScopedWriteAccess* ppAccess )
- {
-- try
-+ jpeg_decompress_struct cinfo;
-+ ErrorManagerStruct jerr;
-+
-+ JpegDecompressOwner aOwner;
-+ std::unique_ptr<Bitmap::ScopedWriteAccess> pScopedAccess;
-+ std::vector<sal_uInt8> pScanLineBuffer;
-+ std::vector<sal_uInt8> pCYMKBuffer;
-+
-+ if ( setjmp( jerr.setjmp_buffer ) )
-+ {
-+ return;
-+ }
-+
-+ cinfo.err = jpeg_std_error( &jerr.pub );
-+ jerr.pub.error_exit = errorExit;
-+ jerr.pub.output_message = outputMessage;
-+
-+ jpeg_create_decompress( &cinfo );
-+ aOwner.set(&cinfo);
-+ jpeg_svstream_src( &cinfo, pInputStream );
-+ SourceManagerStruct *source = reinterpret_cast<SourceManagerStruct*>(cinfo.src);
-+ jpeg_read_header( &cinfo, TRUE );
-+
-+ cinfo.scale_num = 1;
-+ cinfo.scale_denom = 1;
-+ cinfo.output_gamma = 1.0;
-+ cinfo.raw_data_out = FALSE;
-+ cinfo.quantize_colors = FALSE;
-+
-+ /* change scale for preview import */
-+ long nPreviewWidth = previewSize.Width();
-+ long nPreviewHeight = previewSize.Height();
-+ if( nPreviewWidth || nPreviewHeight )
- {
-- jpeg_decompress_struct cinfo;
-- jpeg_error_mgr jerr;
--
-- cinfo.err = jpeg_std_error( &jerr );
-- jerr.error_exit = errorExit;
-- jerr.output_message = outputMessage;
--
-- jpeg_create_decompress( &cinfo );
-- JpegDecompressOwner aOwner(cinfo);
-- jpeg_svstream_src( &cinfo, pInputStream );
-- SourceManagerStruct *source = reinterpret_cast<SourceManagerStruct*>(cinfo.src);
-- jpeg_read_header( &cinfo, TRUE );
--
-- cinfo.scale_num = 1;
-- cinfo.scale_denom = 1;
-- cinfo.output_gamma = 1.0;
-- cinfo.raw_data_out = FALSE;
-- cinfo.quantize_colors = FALSE;
--
-- /* change scale for preview import */
-- long nPreviewWidth = previewSize.Width();
-- long nPreviewHeight = previewSize.Height();
-- if( nPreviewWidth || nPreviewHeight )
-+ if( nPreviewWidth == 0 )
- {
-- if( nPreviewWidth == 0 )
-+ nPreviewWidth = ( cinfo.image_width * nPreviewHeight ) / cinfo.image_height;
-+ if( nPreviewWidth <= 0 )
- {
-- nPreviewWidth = ( cinfo.image_width * nPreviewHeight ) / cinfo.image_height;
-- if( nPreviewWidth <= 0 )
-- {
-- nPreviewWidth = 1;
-- }
-+ nPreviewWidth = 1;
- }
-- else if( nPreviewHeight == 0 )
-+ }
-+ else if( nPreviewHeight == 0 )
-+ {
-+ nPreviewHeight = ( cinfo.image_height * nPreviewWidth ) / cinfo.image_width;
-+ if( nPreviewHeight <= 0 )
- {
-- nPreviewHeight = ( cinfo.image_height * nPreviewWidth ) / cinfo.image_width;
-- if( nPreviewHeight <= 0 )
-- {
-- nPreviewHeight = 1;
-- }
-+ nPreviewHeight = 1;
- }
-+ }
-
-- for( cinfo.scale_denom = 1; cinfo.scale_denom < 8; cinfo.scale_denom *= 2 )
-- {
-- if( cinfo.image_width < nPreviewWidth * cinfo.scale_denom )
-- break;
-- if( cinfo.image_height < nPreviewHeight * cinfo.scale_denom )
-- break;
-- }
-+ for( cinfo.scale_denom = 1; cinfo.scale_denom < 8; cinfo.scale_denom *= 2 )
-+ {
-+ if( cinfo.image_width < nPreviewWidth * cinfo.scale_denom )
-+ break;
-+ if( cinfo.image_height < nPreviewHeight * cinfo.scale_denom )
-+ break;
-+ }
-
-- if( cinfo.scale_denom > 1 )
-- {
-- cinfo.dct_method = JDCT_FASTEST;
-- cinfo.do_fancy_upsampling = FALSE;
-- cinfo.do_block_smoothing = FALSE;
-- }
-+ if( cinfo.scale_denom > 1 )
-+ {
-+ cinfo.dct_method = JDCT_FASTEST;
-+ cinfo.do_fancy_upsampling = FALSE;
-+ cinfo.do_block_smoothing = FALSE;
- }
-+ }
-
-- jpeg_calc_output_dimensions(&cinfo);
-+ jpeg_calc_output_dimensions(&cinfo);
-
-- long nWidth = cinfo.output_width;
-- long nHeight = cinfo.output_height;
-+ long nWidth = cinfo.output_width;
-+ long nHeight = cinfo.output_height;
-
-- bool bGray = (cinfo.output_components == 1);
-+ bool bGray = (cinfo.output_components == 1);
-
-- JPEGCreateBitmapParam aCreateBitmapParam;
-+ JPEGCreateBitmapParam aCreateBitmapParam;
-
-- aCreateBitmapParam.nWidth = nWidth;
-- aCreateBitmapParam.nHeight = nHeight;
-+ aCreateBitmapParam.nWidth = nWidth;
-+ aCreateBitmapParam.nHeight = nHeight;
-
-- aCreateBitmapParam.density_unit = cinfo.density_unit;
-- aCreateBitmapParam.X_density = cinfo.X_density;
-- aCreateBitmapParam.Y_density = cinfo.Y_density;
-- aCreateBitmapParam.bGray = bGray;
-+ aCreateBitmapParam.density_unit = cinfo.density_unit;
-+ aCreateBitmapParam.X_density = cinfo.X_density;
-+ aCreateBitmapParam.Y_density = cinfo.Y_density;
-+ aCreateBitmapParam.bGray = bGray;
-
-- const auto bOnlyCreateBitmap = static_cast<bool>(nImportFlags & GraphicFilterImportFlags::OnlyCreateBitmap);
-- const auto bUseExistingBitmap = static_cast<bool>(nImportFlags & GraphicFilterImportFlags::UseExistingBitmap);
-- bool bBitmapCreated = bUseExistingBitmap;
-- if (!bBitmapCreated)
-- bBitmapCreated = pJPEGReader->CreateBitmap(aCreateBitmapParam);
-+ const auto bOnlyCreateBitmap = static_cast<bool>(nImportFlags & GraphicFilterImportFlags::OnlyCreateBitmap);
-+ const auto bUseExistingBitmap = static_cast<bool>(nImportFlags & GraphicFilterImportFlags::UseExistingBitmap);
-+ bool bBitmapCreated = bUseExistingBitmap;
-+ if (!bBitmapCreated)
-+ bBitmapCreated = pJPEGReader->CreateBitmap(aCreateBitmapParam);
-
-- if (bBitmapCreated && !bOnlyCreateBitmap)
-- {
-- std::unique_ptr<Bitmap::ScopedWriteAccess> pScopedAccess;
-+ if (bBitmapCreated && !bOnlyCreateBitmap)
-+ {
-+ if (nImportFlags & GraphicFilterImportFlags::UseExistingBitmap)
-+ // ppAccess must be set if this flag is used.
-+ assert(ppAccess);
-+ else
-+ pScopedAccess.reset(new Bitmap::ScopedWriteAccess(pJPEGReader->GetBitmap()));
-
-- if (nImportFlags & GraphicFilterImportFlags::UseExistingBitmap)
-- // ppAccess must be set if this flag is used.
-- assert(ppAccess);
-- else
-- pScopedAccess.reset(new Bitmap::ScopedWriteAccess(pJPEGReader->GetBitmap()));
-+ Bitmap::ScopedWriteAccess& pAccess = bUseExistingBitmap ? *ppAccess : *pScopedAccess.get();
-
-- Bitmap::ScopedWriteAccess& pAccess = bUseExistingBitmap ? *ppAccess : *pScopedAccess.get();
-+ if (pAccess)
-+ {
-+ int nPixelSize = 3;
-+ J_COLOR_SPACE best_out_color_space = JCS_RGB;
-+ ScanlineFormat eScanlineFormat = ScanlineFormat::N24BitTcRgb;
-+ ScanlineFormat eFinalFormat = pAccess->GetScanlineFormat();
-
-- if (pAccess)
-+ if (bGray)
-+ {
-+ best_out_color_space = JCS_GRAYSCALE;
-+ eScanlineFormat = ScanlineFormat::N8BitPal;
-+ nPixelSize = 1;
-+ }
-+ else if (eFinalFormat == ScanlineFormat::N32BitTcBgra)
-+ {
-+ best_out_color_space = JCS_EXT_BGRA;
-+ eScanlineFormat = eFinalFormat;
-+ nPixelSize = 4;
-+ }
-+ else if (eFinalFormat == ScanlineFormat::N32BitTcRgba)
-+ {
-+ best_out_color_space = JCS_EXT_RGBA;
-+ eScanlineFormat = eFinalFormat;
-+ nPixelSize = 4;
-+ }
-+ else if (eFinalFormat == ScanlineFormat::N32BitTcArgb)
- {
-- int nPixelSize = 3;
-- J_COLOR_SPACE best_out_color_space = JCS_RGB;
-- ScanlineFormat eScanlineFormat = ScanlineFormat::N24BitTcRgb;
-- ScanlineFormat eFinalFormat = pAccess->GetScanlineFormat();
-+ best_out_color_space = JCS_EXT_ARGB;
-+ eScanlineFormat = eFinalFormat;
-+ nPixelSize = 4;
-+ }
-
-- if (bGray)
-- {
-- best_out_color_space = JCS_GRAYSCALE;
-- eScanlineFormat = ScanlineFormat::N8BitPal;
-- nPixelSize = 1;
-- }
-- else if (eFinalFormat == ScanlineFormat::N32BitTcBgra)
-- {
-- best_out_color_space = JCS_EXT_BGRA;
-- eScanlineFormat = eFinalFormat;
-- nPixelSize = 4;
-- }
-- else if (eFinalFormat == ScanlineFormat::N32BitTcRgba)
-- {
-- best_out_color_space = JCS_EXT_RGBA;
-- eScanlineFormat = eFinalFormat;
-- nPixelSize = 4;
-- }
-- else if (eFinalFormat == ScanlineFormat::N32BitTcArgb)
-- {
-- best_out_color_space = JCS_EXT_ARGB;
-- eScanlineFormat = eFinalFormat;
-- nPixelSize = 4;
-- }
-+ if (cinfo.jpeg_color_space == JCS_YCCK)
-+ cinfo.out_color_space = JCS_CMYK;
-
-- if (cinfo.jpeg_color_space == JCS_YCCK)
-- cinfo.out_color_space = JCS_CMYK;
-+ if (cinfo.out_color_space != JCS_CMYK)
-+ cinfo.out_color_space = best_out_color_space;
-
-- if (cinfo.out_color_space != JCS_CMYK)
-- cinfo.out_color_space = best_out_color_space;
-+ jpeg_start_decompress(&cinfo);
-
-- jpeg_start_decompress(&cinfo);
-+ JSAMPLE* aRangeLimit = cinfo.sample_range_limit;
-
-- JSAMPLE* aRangeLimit = cinfo.sample_range_limit;
-+ pScanLineBuffer.resize(nWidth * nPixelSize);
-
-- std::vector<sal_uInt8> pScanLineBuffer(nWidth * nPixelSize);
-- std::vector<sal_uInt8> pCYMKBuffer;
-+ if (cinfo.out_color_space == JCS_CMYK)
-+ {
-+ pCYMKBuffer.resize(nWidth * 4);
-+ }
-
-- if (cinfo.out_color_space == JCS_CMYK)
-- {
-- pCYMKBuffer.resize(nWidth * 4);
-- }
-+ for (*pLines = 0; *pLines < nHeight && !source->no_data_available; (*pLines)++)
-+ {
-+ size_t yIndex = *pLines;
-+
-+ sal_uInt8* p = (cinfo.out_color_space == JCS_CMYK) ? pCYMKBuffer.data() : pScanLineBuffer.data();
-+ jpeg_read_scanlines(&cinfo, reinterpret_cast<JSAMPARRAY>(&p), 1);
-
-- for (*pLines = 0; *pLines < nHeight && !source->no_data_available; (*pLines)++)
-+ if (cinfo.out_color_space == JCS_CMYK)
- {
-- size_t yIndex = *pLines;
-+ // convert CMYK to RGB
-+ for (long cmyk = 0, x = 0; cmyk < nWidth * 4; cmyk += 4, ++x)
-+ {
-+ int color_C = 255 - pCYMKBuffer[cmyk + 0];
-+ int color_M = 255 - pCYMKBuffer[cmyk + 1];
-+ int color_Y = 255 - pCYMKBuffer[cmyk + 2];
-+ int color_K = 255 - pCYMKBuffer[cmyk + 3];
-
-- sal_uInt8* p = (cinfo.out_color_space == JCS_CMYK) ? pCYMKBuffer.data() : pScanLineBuffer.data();
-- jpeg_read_scanlines(&cinfo, reinterpret_cast<JSAMPARRAY>(&p), 1);
-+ sal_uInt8 cRed = aRangeLimit[255L - (color_C + color_K)];
-+ sal_uInt8 cGreen = aRangeLimit[255L - (color_M + color_K)];
-+ sal_uInt8 cBlue = aRangeLimit[255L - (color_Y + color_K)];
-
-- if (cinfo.out_color_space == JCS_CMYK)
-- {
-- // convert CMYK to RGB
-- for (long cmyk = 0, x = 0; cmyk < nWidth * 4; cmyk += 4, ++x)
-- {
-- int color_C = 255 - pCYMKBuffer[cmyk + 0];
-- int color_M = 255 - pCYMKBuffer[cmyk + 1];
-- int color_Y = 255 - pCYMKBuffer[cmyk + 2];
-- int color_K = 255 - pCYMKBuffer[cmyk + 3];
--
-- sal_uInt8 cRed = aRangeLimit[255L - (color_C + color_K)];
-- sal_uInt8 cGreen = aRangeLimit[255L - (color_M + color_K)];
-- sal_uInt8 cBlue = aRangeLimit[255L - (color_Y + color_K)];
--
-- pAccess->SetPixel(yIndex, x, BitmapColor(cRed, cGreen, cBlue));
-- }
-- }
-- else
-- {
-- pAccess->CopyScanline(yIndex, pScanLineBuffer.data(), eScanlineFormat, pScanLineBuffer.size());
-+ pAccess->SetPixel(yIndex, x, BitmapColor(cRed, cGreen, cBlue));
- }
--
-- /* PENDING ??? */
-- if (cinfo.err->msg_code == 113)
-- break;
- }
-+ else
-+ {
-+ pAccess->CopyScanline(yIndex, pScanLineBuffer.data(), eScanlineFormat, pScanLineBuffer.size());
-+ }
-+
-+ /* PENDING ??? */
-+ if (cinfo.err->msg_code == 113)
-+ break;
- }
-- }
-
-- if (bBitmapCreated && !bOnlyCreateBitmap)
-- {
-- jpeg_finish_decompress( &cinfo );
-- }
-- else
-- {
-- jpeg_abort_decompress( &cinfo );
-+ pScanLineBuffer.clear();
-+ pCYMKBuffer.clear();
- }
-+ pScopedAccess.reset();
- }
-- catch (const css::uno::RuntimeException&)
-+
-+ if (bBitmapCreated && !bOnlyCreateBitmap)
- {
-+ jpeg_finish_decompress( &cinfo );
-+ }
-+ else
-+ {
-+ jpeg_abort_decompress( &cinfo );
- }
- }
-
-@@ -283,165 +313,170 @@ bool WriteJPEG( JPEGWriter* pJPEGWriter, void* pOutputStream,
- long nQualityPercent, long aChromaSubsampling,
- css::uno::Reference<css::task::XStatusIndicator> const & status )
- {
-- try
-- {
-- jpeg_compress_struct cinfo;
-- jpeg_error_mgr jerr;
-- void* pScanline;
-- long nY;
--
-- cinfo.err = jpeg_std_error( &jerr );
-- jerr.error_exit = errorExit;
-- jerr.output_message = outputMessage;
--
-- jpeg_create_compress( &cinfo );
-- JpegCompressOwner aOwner(cinfo);
-- jpeg_svstream_dest( &cinfo, pOutputStream );
--
-- cinfo.image_width = (JDIMENSION) nWidth;
-- cinfo.image_height = (JDIMENSION) nHeight;
-- if ( bGreys )
-- {
-- cinfo.input_components = 1;
-- cinfo.in_color_space = JCS_GRAYSCALE;
-- }
-- else
-- {
-- cinfo.input_components = 3;
-- cinfo.in_color_space = JCS_RGB;
-- }
-+ jpeg_compress_struct cinfo;
-+ ErrorManagerStruct jerr;
-+ void* pScanline;
-+ long nY;
-
-- jpeg_set_defaults( &cinfo );
-- jpeg_set_quality( &cinfo, (int) nQualityPercent, FALSE );
-+ JpegCompressOwner aOwner;
-
-- cinfo.density_unit = 1;
-- cinfo.X_density = rPPI.getX();
-- cinfo.Y_density = rPPI.getY();
-+ if ( setjmp( jerr.setjmp_buffer ) )
-+ {
-+ return false;
-+ }
-
-- if ( ( nWidth > 128 ) || ( nHeight > 128 ) )
-- jpeg_simple_progression( &cinfo );
-+ cinfo.err = jpeg_std_error( &jerr.pub );
-+ jerr.pub.error_exit = errorExit;
-+ jerr.pub.output_message = outputMessage;
-
-- if (aChromaSubsampling == 1) // YUV 4:4:4
-- {
-- cinfo.comp_info[0].h_samp_factor = 1;
-- cinfo.comp_info[0].v_samp_factor = 1;
-- }
-- else if (aChromaSubsampling == 2) // YUV 4:2:2
-- {
-- cinfo.comp_info[0].h_samp_factor = 2;
-- cinfo.comp_info[0].v_samp_factor = 1;
-- }
-- else if (aChromaSubsampling == 3) // YUV 4:2:0
-- {
-- cinfo.comp_info[0].h_samp_factor = 2;
-- cinfo.comp_info[0].v_samp_factor = 2;
-- }
-+ jpeg_create_compress( &cinfo );
-+ aOwner.set(&cinfo);
-+ jpeg_svstream_dest( &cinfo, pOutputStream );
-
-- jpeg_start_compress( &cinfo, TRUE );
-+ cinfo.image_width = (JDIMENSION) nWidth;
-+ cinfo.image_height = (JDIMENSION) nHeight;
-+ if ( bGreys )
-+ {
-+ cinfo.input_components = 1;
-+ cinfo.in_color_space = JCS_GRAYSCALE;
-+ }
-+ else
-+ {
-+ cinfo.input_components = 3;
-+ cinfo.in_color_space = JCS_RGB;
-+ }
-
-- for( nY = 0; nY < nHeight; nY++ )
-- {
-- pScanline = pJPEGWriter->GetScanline( nY );
-+ jpeg_set_defaults( &cinfo );
-+ jpeg_set_quality( &cinfo, (int) nQualityPercent, FALSE );
-
-- if( pScanline )
-- {
-- jpeg_write_scanlines( &cinfo, reinterpret_cast<JSAMPARRAY>(&pScanline), 1 );
-- }
-+ cinfo.density_unit = 1;
-+ cinfo.X_density = rPPI.getX();
-+ cinfo.Y_density = rPPI.getY();
-
-- if( status.is() )
-- {
-- status->setValue( nY * 100L / nHeight );
-- }
-- }
-+ if ( ( nWidth > 128 ) || ( nHeight > 128 ) )
-+ jpeg_simple_progression( &cinfo );
-
-- jpeg_finish_compress(&cinfo);
-+ if (aChromaSubsampling == 1) // YUV 4:4:4
-+ {
-+ cinfo.comp_info[0].h_samp_factor = 1;
-+ cinfo.comp_info[0].v_samp_factor = 1;
- }
-- catch (const css::uno::RuntimeException&)
-+ else if (aChromaSubsampling == 2) // YUV 4:2:2
- {
-- return false;
-+ cinfo.comp_info[0].h_samp_factor = 2;
-+ cinfo.comp_info[0].v_samp_factor = 1;
- }
-- return true;
--}
--
--void Transform(void* pInputStream, void* pOutputStream, long nAngle)
--{
-- try
-+ else if (aChromaSubsampling == 3) // YUV 4:2:0
- {
-- jpeg_transform_info aTransformOption;
-- JCOPY_OPTION aCopyOption = JCOPYOPT_ALL;
-+ cinfo.comp_info[0].h_samp_factor = 2;
-+ cinfo.comp_info[0].v_samp_factor = 2;
-+ }
-
-- jpeg_decompress_struct aSourceInfo;
-- jpeg_compress_struct aDestinationInfo;
-- jpeg_error_mgr aSourceError;
-- jpeg_error_mgr aDestinationError;
-+ jpeg_start_compress( &cinfo, TRUE );
-
-- jvirt_barray_ptr* aSourceCoefArrays = nullptr;
-- jvirt_barray_ptr* aDestinationCoefArrays = nullptr;
-+ for( nY = 0; nY < nHeight; nY++ )
-+ {
-+ pScanline = pJPEGWriter->GetScanline( nY );
-
-- aTransformOption.force_grayscale = FALSE;
-- aTransformOption.trim = FALSE;
-- aTransformOption.perfect = FALSE;
-- aTransformOption.crop = FALSE;
-+ if( pScanline )
-+ {
-+ jpeg_write_scanlines( &cinfo, reinterpret_cast<JSAMPARRAY>(&pScanline), 1 );
-+ }
-
-- // Angle to transform option
-- // 90 Clockwise = 270 Counterclockwise
-- switch (nAngle)
-+ if( status.is() )
- {
-- case 2700:
-- aTransformOption.transform = JXFORM_ROT_90;
-- break;
-- case 1800:
-- aTransformOption.transform = JXFORM_ROT_180;
-- break;
-- case 900:
-- aTransformOption.transform = JXFORM_ROT_270;
-- break;
-- default:
-- aTransformOption.transform = JXFORM_NONE;
-+ status->setValue( nY * 100L / nHeight );
- }
-+ }
-
-- // Decompression
-- aSourceInfo.err = jpeg_std_error(&aSourceError);
-- aSourceInfo.err->error_exit = errorExit;
-- aSourceInfo.err->output_message = outputMessage;
-+ jpeg_finish_compress(&cinfo);
-
-- // Compression
-- aDestinationInfo.err = jpeg_std_error(&aDestinationError);
-- aDestinationInfo.err->error_exit = errorExit;
-- aDestinationInfo.err->output_message = outputMessage;
-+ return true;
-+}
-+
-+void Transform(void* pInputStream, void* pOutputStream, long nAngle)
-+{
-+ jpeg_transform_info aTransformOption;
-+ JCOPY_OPTION aCopyOption = JCOPYOPT_ALL;
-
-- aDestinationInfo.optimize_coding = TRUE;
-+ jpeg_decompress_struct aSourceInfo;
-+ jpeg_compress_struct aDestinationInfo;
-+ ErrorManagerStruct aSourceError;
-+ ErrorManagerStruct aDestinationError;
-
-- jpeg_create_decompress(&aSourceInfo);
-- JpegDecompressOwner aDecompressOwner(aSourceInfo);
-- jpeg_create_compress(&aDestinationInfo);
-- JpegCompressOwner aCompressOwner(aDestinationInfo);
-+ jvirt_barray_ptr* aSourceCoefArrays = nullptr;
-+ jvirt_barray_ptr* aDestinationCoefArrays = nullptr;
-
-- jpeg_svstream_src (&aSourceInfo, pInputStream);
-+ aTransformOption.force_grayscale = FALSE;
-+ aTransformOption.trim = FALSE;
-+ aTransformOption.perfect = FALSE;
-+ aTransformOption.crop = FALSE;
-
-- jcopy_markers_setup(&aSourceInfo, aCopyOption);
-- jpeg_read_header(&aSourceInfo, TRUE);
-- jtransform_request_workspace(&aSourceInfo, &aTransformOption);
-+ // Angle to transform option
-+ // 90 Clockwise = 270 Counterclockwise
-+ switch (nAngle)
-+ {
-+ case 2700:
-+ aTransformOption.transform = JXFORM_ROT_90;
-+ break;
-+ case 1800:
-+ aTransformOption.transform = JXFORM_ROT_180;
-+ break;
-+ case 900:
-+ aTransformOption.transform = JXFORM_ROT_270;
-+ break;
-+ default:
-+ aTransformOption.transform = JXFORM_NONE;
-+ }
-
-- aSourceCoefArrays = jpeg_read_coefficients(&aSourceInfo);
-- jpeg_copy_critical_parameters(&aSourceInfo, &aDestinationInfo);
-+ // Decompression
-+ aSourceInfo.err = jpeg_std_error(&aSourceError.pub);
-+ aSourceInfo.err->error_exit = errorExit;
-+ aSourceInfo.err->output_message = outputMessage;
-
-- aDestinationCoefArrays = jtransform_adjust_parameters(&aSourceInfo, &aDestinationInfo, aSourceCoefArrays, &aTransformOption);
-- jpeg_svstream_dest (&aDestinationInfo, pOutputStream);
-+ // Compression
-+ aDestinationInfo.err = jpeg_std_error(&aDestinationError.pub);
-+ aDestinationInfo.err->error_exit = errorExit;
-+ aDestinationInfo.err->output_message = outputMessage;
-
-- // Compute optimal Huffman coding tables instead of precomputed tables
-- aDestinationInfo.optimize_coding = TRUE;
-- jpeg_write_coefficients(&aDestinationInfo, aDestinationCoefArrays);
-- jcopy_markers_execute(&aSourceInfo, &aDestinationInfo, aCopyOption);
-- jtransform_execute_transformation(&aSourceInfo, &aDestinationInfo, aSourceCoefArrays, &aTransformOption);
-+ aDestinationInfo.optimize_coding = TRUE;
-
-- jpeg_finish_compress(&aDestinationInfo);
-+ JpegDecompressOwner aDecompressOwner;
-+ JpegCompressOwner aCompressOwner;
-
-- jpeg_finish_decompress(&aSourceInfo);
-- }
-- catch (const css::uno::RuntimeException&)
-+ if (setjmp(aSourceError.setjmp_buffer) || setjmp(aDestinationError.setjmp_buffer))
- {
-+ jpeg_destroy_decompress(&aSourceInfo);
-+ jpeg_destroy_compress(&aDestinationInfo);
-+ return;
- }
-+
-+ jpeg_create_decompress(&aSourceInfo);
-+ aDecompressOwner.set(&aSourceInfo);
-+ jpeg_create_compress(&aDestinationInfo);
-+ aCompressOwner.set(&aDestinationInfo);
-+
-+ jpeg_svstream_src (&aSourceInfo, pInputStream);
-+
-+ jcopy_markers_setup(&aSourceInfo, aCopyOption);
-+ jpeg_read_header(&aSourceInfo, TRUE);
-+ jtransform_request_workspace(&aSourceInfo, &aTransformOption);
-+
-+ aSourceCoefArrays = jpeg_read_coefficients(&aSourceInfo);
-+ jpeg_copy_critical_parameters(&aSourceInfo, &aDestinationInfo);
-+
-+ aDestinationCoefArrays = jtransform_adjust_parameters(&aSourceInfo, &aDestinationInfo, aSourceCoefArrays, &aTransformOption);
-+ jpeg_svstream_dest (&aDestinationInfo, pOutputStream);
-+
-+ // Compute optimal Huffman coding tables instead of precomputed tables
-+ aDestinationInfo.optimize_coding = TRUE;
-+ jpeg_write_coefficients(&aDestinationInfo, aDestinationCoefArrays);
-+ jcopy_markers_execute(&aSourceInfo, &aDestinationInfo, aCopyOption);
-+ jtransform_execute_transformation(&aSourceInfo, &aDestinationInfo, aSourceCoefArrays, &aTransformOption);
-+
-+ jpeg_finish_compress(&aDestinationInfo);
-+
-+ jpeg_finish_decompress(&aSourceInfo);
- }
-
- /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
---
-cgit v0.10.2
-
diff --git a/patches/series b/patches/series
index fa046b8..934c85b 100644
--- a/patches/series
+++ b/patches/series
@@ -35,6 +35,3 @@ gb_SUPPRESS_TESTS.diff
stop-shipping-mimelnk-desktop-files.diff
icu-no-icu-config.diff
ww8export-HAVE_MORE_FONTS.diff
-avoid-throwing-cpp-exceptions-across-libgpeg-c-frames.diff
-arm64-bridges-no-stack-protector-strong.diff
-arm64-disable-sc-functions-test.diff
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-openoffice/libreoffice.git
More information about the Pkg-openoffice-commits
mailing list