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

2023-01-06 Thread Caolán McNamara (via logerrit)
 vcl/headless/CairoCommon.cxx|   33 ---
 vcl/headless/SvpGraphicsBackend.cxx |   30 -
 vcl/inc/headless/CairoCommon.hxx|2 -
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx |   11 ---
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx |1 
 vcl/unx/generic/gdi/gdiimpl.cxx |   34 
 vcl/unx/generic/gdi/gdiimpl.hxx |2 +
 7 files changed, 65 insertions(+), 48 deletions(-)

New commits:
commit e8effd1c4c0a4dd389054d311f432c42f26a3a6b
Author: Caolán McNamara 
AuthorDate: Thu Jan 5 12:02:35 2023 +
Commit: Caolán McNamara 
CommitDate: Fri Jan 6 08:46:43 2023 +

Revert "move getPixel into CairoCommon and reuse from 
X11CairoSalGraphicsImpl"

This reverts commit 00b62877fa2f900d1c2dcf7b721f7a956408f8a0.

XIOError seen with vcldemo

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

diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx
index 39538a9f9f40..5781eff048e8 100644
--- a/vcl/headless/CairoCommon.cxx
+++ b/vcl/headless/CairoCommon.cxx
@@ -623,39 +623,6 @@ void CairoCommon::drawPixel(cairo_t* cr, 
basegfx::B2DRange* pExtents, const Colo
 *pExtents = getClippedFillDamage(cr);
 }
 
-Color CairoCommon::getPixel(cairo_surface_t* pSurface, tools::Long nX, 
tools::Long nY)
-{
-cairo_surface_t* target
-= cairo_surface_create_similar_image(pSurface, CAIRO_FORMAT_ARGB32, 1, 
1);
-
-cairo_t* cr = cairo_create(target);
-
-cairo_rectangle(cr, 0, 0, 1, 1);
-cairo_set_source_surface(cr, pSurface, -nX, -nY);
-cairo_paint(cr);
-cairo_destroy(cr);
-
-cairo_surface_flush(target);
-#if !ENABLE_WASM_STRIP_PREMULTIPLY
-vcl::bitmap::lookup_table const& unpremultiply_table = 
vcl::bitmap::get_unpremultiply_table();
-#endif
-unsigned char* data = cairo_image_surface_get_data(target);
-sal_uInt8 a = data[SVP_CAIRO_ALPHA];
-#if ENABLE_WASM_STRIP_PREMULTIPLY
-sal_uInt8 b = vcl::bitmap::unpremultiply(a, data[SVP_CAIRO_BLUE]);
-sal_uInt8 g = vcl::bitmap::unpremultiply(a, data[SVP_CAIRO_GREEN]);
-sal_uInt8 r = vcl::bitmap::unpremultiply(a, data[SVP_CAIRO_RED]);
-#else
-sal_uInt8 b = unpremultiply_table[a][data[SVP_CAIRO_BLUE]];
-sal_uInt8 g = unpremultiply_table[a][data[SVP_CAIRO_GREEN]];
-sal_uInt8 r = unpremultiply_table[a][data[SVP_CAIRO_RED]];
-#endif
-Color aColor(ColorAlpha, a, r, g, b);
-cairo_surface_destroy(target);
-
-return aColor;
-}
-
 void CairoCommon::drawLine(cairo_t* cr, basegfx::B2DRange* pExtents, const 
Color& rLineColor,
bool bAntiAlias, tools::Long nX1, tools::Long nY1, 
tools::Long nX2,
tools::Long nY2)
diff --git a/vcl/headless/SvpGraphicsBackend.cxx 
b/vcl/headless/SvpGraphicsBackend.cxx
index efff52387575..84d6aa1dcd09 100644
--- a/vcl/headless/SvpGraphicsBackend.cxx
+++ b/vcl/headless/SvpGraphicsBackend.cxx
@@ -566,7 +566,35 @@ void SvpGraphicsBackend::drawBitmapBuffer(const 
SalTwoRect& rTR, const BitmapBuf
 
 Color SvpGraphicsBackend::getPixel(tools::Long nX, tools::Long nY)
 {
-return CairoCommon::getPixel(m_rCairoCommon.m_pSurface, nX, nY);
+cairo_surface_t* target
+= cairo_surface_create_similar_image(m_rCairoCommon.m_pSurface, 
CAIRO_FORMAT_ARGB32, 1, 1);
+
+cairo_t* cr = cairo_create(target);
+
+cairo_rectangle(cr, 0, 0, 1, 1);
+cairo_set_source_surface(cr, m_rCairoCommon.m_pSurface, -nX, -nY);
+cairo_paint(cr);
+cairo_destroy(cr);
+
+cairo_surface_flush(target);
+#if !ENABLE_WASM_STRIP_PREMULTIPLY
+vcl::bitmap::lookup_table const& unpremultiply_table = 
vcl::bitmap::get_unpremultiply_table();
+#endif
+unsigned char* data = cairo_image_surface_get_data(target);
+sal_uInt8 a = data[SVP_CAIRO_ALPHA];
+#if ENABLE_WASM_STRIP_PREMULTIPLY
+sal_uInt8 b = vcl::bitmap::unpremultiply(a, data[SVP_CAIRO_BLUE]);
+sal_uInt8 g = vcl::bitmap::unpremultiply(a, data[SVP_CAIRO_GREEN]);
+sal_uInt8 r = vcl::bitmap::unpremultiply(a, data[SVP_CAIRO_RED]);
+#else
+sal_uInt8 b = unpremultiply_table[a][data[SVP_CAIRO_BLUE]];
+sal_uInt8 g = unpremultiply_table[a][data[SVP_CAIRO_GREEN]];
+sal_uInt8 r = unpremultiply_table[a][data[SVP_CAIRO_RED]];
+#endif
+Color aColor(ColorAlpha, a, r, g, b);
+cairo_surface_destroy(target);
+
+return aColor;
 }
 
 void SvpGraphicsBackend::invert(tools::Long nX, tools::Long nY, tools::Long 
nWidth,
diff --git a/vcl/inc/headless/CairoCommon.hxx b/vcl/inc/headless/CairoCommon.hxx
index 3e78b435dbc5..743c962c9423 100644
--- a/vcl/inc/headless/CairoCommon.hxx
+++ b/vcl/inc/headless/CairoCommon.hxx
@@ -155,8 +155,6 @@ struct VCL_DLLPUBLIC CairoCommon
 static void drawPixel(cairo_t* cr, basegfx::B2DRange* pExtents, const 
Co

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

2023-01-06 Thread Caolán McNamara (via logerrit)
 vcl/inc/unx/salgdi.h|4 ++--
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx |   14 +++---
 vcl/unx/generic/gdi/gdiimpl.hxx |3 ++-
 vcl/unx/generic/gdi/salgdi.cxx  |   11 +++
 vcl/unx/generic/gdi/x11cairotextrender.cxx  |2 +-
 5 files changed, 19 insertions(+), 15 deletions(-)

New commits:
commit 1fd19c798243ee46606331ad96b9803b96581a2e
Author: Caolán McNamara 
AuthorDate: Thu Jan 5 16:40:27 2023 +
Commit: Caolán McNamara 
CommitDate: Fri Jan 6 08:47:00 2023 +

use current known geometry for surface size instead of SAL_MAX_INT16

which appears to be why getPixel failed

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

diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h
index 1e1a5971a7b6..ca4456a1c720 100644
--- a/vcl/inc/unx/salgdi.h
+++ b/vcl/inc/unx/salgdi.h
@@ -71,7 +71,7 @@ public:
 
 X11Common();
 
-cairo_t* getCairoContext();
+cairo_t* getCairoContext(const SalGeometryProvider* pGeom);
 
 static void releaseCairoContext(cairo_t* cr);
 
@@ -145,7 +145,7 @@ public:
  */
 voidYieldGraphicsExpose();
 
-cairo_t* getCairoContext();
+cairo_t* getCairoContext(const SalGeometryProvider* pGeom);
 static void releaseCairoContext(cairo_t* cr);
 
 
diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx 
b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
index f1b7f172150b..c45990b35263 100644
--- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
+++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
@@ -61,7 +61,7 @@ bool X11CairoSalGraphicsImpl::drawPolyPolygon(const 
basegfx::B2DHomMatrix& rObje
 aPolyPolygon = 
basegfx::utils::snapPointsOfHorizontalOrVerticalEdges(aPolyPolygon);
 }
 
-cairo_t* cr = mrX11Common.getCairoContext();
+cairo_t* cr = mrX11Common.getCairoContext(mrParent.GetGeometryProvider());
 clipRegion(cr);
 
 for (auto const& rPolygon : std::as_const(aPolyPolygon))
@@ -132,7 +132,7 @@ void X11CairoSalGraphicsImpl::drawPixel(tools::Long nX, 
tools::Long nY)
 
 void X11CairoSalGraphicsImpl::drawPixel(tools::Long nX, tools::Long nY, Color 
nColor)
 {
-cairo_t* cr = mrX11Common.getCairoContext();
+cairo_t* cr = mrX11Common.getCairoContext(mrParent.GetGeometryProvider());
 clipRegion(cr);
 
 CairoCommon::drawPixel(cr, nullptr, nColor, nX, nY);
@@ -143,7 +143,7 @@ void X11CairoSalGraphicsImpl::drawPixel(tools::Long nX, 
tools::Long nY, Color nC
 void X11CairoSalGraphicsImpl::drawLine(tools::Long nX1, tools::Long nY1, 
tools::Long nX2,
tools::Long nY2)
 {
-cairo_t* cr = mrX11Common.getCairoContext();
+cairo_t* cr = mrX11Common.getCairoContext(mrParent.GetGeometryProvider());
 clipRegion(cr);
 
 CairoCommon::drawLine(cr, nullptr, mnPenColor, getAntiAlias(), nX1, nY1, 
nX2, nY2);
@@ -163,7 +163,7 @@ bool X11CairoSalGraphicsImpl::drawPolyLine(const 
basegfx::B2DHomMatrix& rObjectT
 if (0 == rPolyLine.count() || fTransparency < 0.0 || fTransparency >= 1.0)
 return true;
 
-cairo_t* cr = mrX11Common.getCairoContext();
+cairo_t* cr = mrX11Common.getCairoContext(mrParent.GetGeometryProvider());
 clipRegion(cr);
 
 // Use the now available static drawPolyLine from the 
Cairo-Headless-Fallback
@@ -180,7 +180,7 @@ bool X11CairoSalGraphicsImpl::drawPolyLine(const 
basegfx::B2DHomMatrix& rObjectT
 bool X11CairoSalGraphicsImpl::drawAlphaRect(tools::Long nX, tools::Long nY, 
tools::Long nWidth,
 tools::Long nHeight, sal_uInt8 
nTransparency)
 {
-cairo_t* cr = mrX11Common.getCairoContext();
+cairo_t* cr = mrX11Common.getCairoContext(mrParent.GetGeometryProvider());
 clipRegion(cr);
 
 const bool bRetval(CairoCommon::drawAlphaRect(cr, nullptr, mnPenColor, 
mnFillColor, nX, nY,
@@ -194,7 +194,7 @@ bool X11CairoSalGraphicsImpl::drawAlphaRect(tools::Long nX, 
tools::Long nY, tool
 bool X11CairoSalGraphicsImpl::drawGradient(const tools::PolyPolygon& 
rPolyPolygon,
const Gradient& rGradient)
 {
-cairo_t* cr = mrX11Common.getCairoContext();
+cairo_t* cr = mrX11Common.getCairoContext(mrParent.GetGeometryProvider());
 clipRegion(cr);
 
 const bool bRetval(
@@ -208,7 +208,7 @@ bool X11CairoSalGraphicsImpl::drawGradient(const 
tools::PolyPolygon& rPolyPolygo
 bool X11CairoSalGraphicsImpl::implDrawGradient(basegfx::B2DPolyPolygon const& 
rPolyPolygon,
SalGradient const& rGradient)
 {
-cairo_t* cr = mrX11Common.getCairoContext();
+cairo_t* cr = mrX11Common.getCairoContext(mrParent.GetGeometryProvider());
 clipRegion(cr);
 
 const bool bRetval(
diff --git a/vcl/unx/generic/gdi/gdiimpl.hxx b/vc

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

2023-01-06 Thread Caolán McNamara (via logerrit)
 vcl/headless/CairoCommon.cxx|   33 +++
 vcl/headless/SvpGraphicsBackend.cxx |   30 -
 vcl/inc/headless/CairoCommon.hxx|2 +
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx |   11 +++
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx |1 
 vcl/unx/generic/gdi/gdiimpl.cxx |   34 
 vcl/unx/generic/gdi/gdiimpl.hxx |2 -
 7 files changed, 48 insertions(+), 65 deletions(-)

New commits:
commit ded5e68a58ae4837918e1a381d0c46cd69f7a06a
Author: Caolán McNamara 
AuthorDate: Thu Jan 5 16:41:17 2023 +
Commit: Caolán McNamara 
CommitDate: Fri Jan 6 08:47:52 2023 +

move getPixel into CairoCommon and reuse from X11CairoSalGraphicsImpl

2nd attempt. This reverts commit 8d0b7bdb8c9ae8254e5b77b533a158734affc4f5.

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

diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx
index 5781eff048e8..39538a9f9f40 100644
--- a/vcl/headless/CairoCommon.cxx
+++ b/vcl/headless/CairoCommon.cxx
@@ -623,6 +623,39 @@ void CairoCommon::drawPixel(cairo_t* cr, 
basegfx::B2DRange* pExtents, const Colo
 *pExtents = getClippedFillDamage(cr);
 }
 
+Color CairoCommon::getPixel(cairo_surface_t* pSurface, tools::Long nX, 
tools::Long nY)
+{
+cairo_surface_t* target
+= cairo_surface_create_similar_image(pSurface, CAIRO_FORMAT_ARGB32, 1, 
1);
+
+cairo_t* cr = cairo_create(target);
+
+cairo_rectangle(cr, 0, 0, 1, 1);
+cairo_set_source_surface(cr, pSurface, -nX, -nY);
+cairo_paint(cr);
+cairo_destroy(cr);
+
+cairo_surface_flush(target);
+#if !ENABLE_WASM_STRIP_PREMULTIPLY
+vcl::bitmap::lookup_table const& unpremultiply_table = 
vcl::bitmap::get_unpremultiply_table();
+#endif
+unsigned char* data = cairo_image_surface_get_data(target);
+sal_uInt8 a = data[SVP_CAIRO_ALPHA];
+#if ENABLE_WASM_STRIP_PREMULTIPLY
+sal_uInt8 b = vcl::bitmap::unpremultiply(a, data[SVP_CAIRO_BLUE]);
+sal_uInt8 g = vcl::bitmap::unpremultiply(a, data[SVP_CAIRO_GREEN]);
+sal_uInt8 r = vcl::bitmap::unpremultiply(a, data[SVP_CAIRO_RED]);
+#else
+sal_uInt8 b = unpremultiply_table[a][data[SVP_CAIRO_BLUE]];
+sal_uInt8 g = unpremultiply_table[a][data[SVP_CAIRO_GREEN]];
+sal_uInt8 r = unpremultiply_table[a][data[SVP_CAIRO_RED]];
+#endif
+Color aColor(ColorAlpha, a, r, g, b);
+cairo_surface_destroy(target);
+
+return aColor;
+}
+
 void CairoCommon::drawLine(cairo_t* cr, basegfx::B2DRange* pExtents, const 
Color& rLineColor,
bool bAntiAlias, tools::Long nX1, tools::Long nY1, 
tools::Long nX2,
tools::Long nY2)
diff --git a/vcl/headless/SvpGraphicsBackend.cxx 
b/vcl/headless/SvpGraphicsBackend.cxx
index 84d6aa1dcd09..efff52387575 100644
--- a/vcl/headless/SvpGraphicsBackend.cxx
+++ b/vcl/headless/SvpGraphicsBackend.cxx
@@ -566,35 +566,7 @@ void SvpGraphicsBackend::drawBitmapBuffer(const 
SalTwoRect& rTR, const BitmapBuf
 
 Color SvpGraphicsBackend::getPixel(tools::Long nX, tools::Long nY)
 {
-cairo_surface_t* target
-= cairo_surface_create_similar_image(m_rCairoCommon.m_pSurface, 
CAIRO_FORMAT_ARGB32, 1, 1);
-
-cairo_t* cr = cairo_create(target);
-
-cairo_rectangle(cr, 0, 0, 1, 1);
-cairo_set_source_surface(cr, m_rCairoCommon.m_pSurface, -nX, -nY);
-cairo_paint(cr);
-cairo_destroy(cr);
-
-cairo_surface_flush(target);
-#if !ENABLE_WASM_STRIP_PREMULTIPLY
-vcl::bitmap::lookup_table const& unpremultiply_table = 
vcl::bitmap::get_unpremultiply_table();
-#endif
-unsigned char* data = cairo_image_surface_get_data(target);
-sal_uInt8 a = data[SVP_CAIRO_ALPHA];
-#if ENABLE_WASM_STRIP_PREMULTIPLY
-sal_uInt8 b = vcl::bitmap::unpremultiply(a, data[SVP_CAIRO_BLUE]);
-sal_uInt8 g = vcl::bitmap::unpremultiply(a, data[SVP_CAIRO_GREEN]);
-sal_uInt8 r = vcl::bitmap::unpremultiply(a, data[SVP_CAIRO_RED]);
-#else
-sal_uInt8 b = unpremultiply_table[a][data[SVP_CAIRO_BLUE]];
-sal_uInt8 g = unpremultiply_table[a][data[SVP_CAIRO_GREEN]];
-sal_uInt8 r = unpremultiply_table[a][data[SVP_CAIRO_RED]];
-#endif
-Color aColor(ColorAlpha, a, r, g, b);
-cairo_surface_destroy(target);
-
-return aColor;
+return CairoCommon::getPixel(m_rCairoCommon.m_pSurface, nX, nY);
 }
 
 void SvpGraphicsBackend::invert(tools::Long nX, tools::Long nY, tools::Long 
nWidth,
diff --git a/vcl/inc/headless/CairoCommon.hxx b/vcl/inc/headless/CairoCommon.hxx
index 743c962c9423..3e78b435dbc5 100644
--- a/vcl/inc/headless/CairoCommon.hxx
+++ b/vcl/inc/headless/CairoCommon.hxx
@@ -155,6 +155,8 @@ struct VCL_DLLPUBLIC CairoCommon
 static void drawPixel(cairo_t* cr, basegfx::B2DRange* pExtents, const 
Color& rLineColor,

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

2023-01-06 Thread Caolán McNamara (via logerrit)
 vcl/headless/CairoCommon.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9eeacdd6cd5fa4ad0d29b530a627f398be763cc2
Author: Caolán McNamara 
AuthorDate: Thu Jan 5 17:23:26 2023 +
Commit: Caolán McNamara 
CommitDate: Fri Jan 6 08:48:17 2023 +

adjust bodge to be only for CAIRO_CONTENT_ALPHA

rather than specifically !CAIRO_CONTENT_COLOR_ALPHA

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

diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx
index 39538a9f9f40..f50705b91584 100644
--- a/vcl/headless/CairoCommon.cxx
+++ b/vcl/headless/CairoCommon.cxx
@@ -568,7 +568,7 @@ cairo_t* CairoCommon::createTmpCompatibleCairoContext() 
const
 
 void CairoCommon::applyColor(cairo_t* cr, Color aColor, double fTransparency)
 {
-if (cairo_surface_get_content(cairo_get_target(cr)) == 
CAIRO_CONTENT_COLOR_ALPHA)
+if (cairo_surface_get_content(cairo_get_target(cr)) != CAIRO_CONTENT_ALPHA)
 {
 cairo_set_source_rgba(cr, aColor.GetRed() / 255.0, aColor.GetGreen() / 
255.0,
   aColor.GetBlue() / 255.0, 1.0 - fTransparency);


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

2023-01-06 Thread Caolán McNamara (via logerrit)
 vcl/headless/CairoCommon.cxx|  101 ++
 vcl/headless/SvpGraphicsBackend.cxx |   89 +---
 vcl/inc/headless/CairoCommon.hxx|9 +
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx |   99 ++---
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx |4 
 vcl/unx/generic/gdi/gdiimpl.cxx |  172 
 vcl/unx/generic/gdi/gdiimpl.hxx |9 -
 7 files changed, 141 insertions(+), 342 deletions(-)

New commits:
commit 1bac4efd7c468179e7530546e1e4ee2ae1e4de54
Author: Caolán McNamara 
AuthorDate: Thu Jan 5 11:45:05 2023 +
Commit: Caolán McNamara 
CommitDate: Fri Jan 6 08:48:33 2023 +

move drawPolyPolygon into CairoCommon and reuse from X11CairoSalGraphicsImpl

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

diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx
index f50705b91584..291bc7e36380 100644
--- a/vcl/headless/CairoCommon.cxx
+++ b/vcl/headless/CairoCommon.cxx
@@ -687,6 +687,107 @@ void CairoCommon::drawLine(cairo_t* cr, 
basegfx::B2DRange* pExtents, const Color
 cairo_stroke(cr);
 }
 
+void CairoCommon::drawPolyPolygon(cairo_t* cr, basegfx::B2DRange* pExtents, 
const Color& rLineColor,
+  const Color& rFillColor, bool bAntiAlias, 
sal_uInt32 nPoly,
+  const sal_uInt32* pPointCounts, const 
Point** pPtAry)
+{
+basegfx::B2DPolyPolygon aPolyPoly;
+for (sal_uInt32 nPolygon = 0; nPolygon < nPoly; ++nPolygon)
+{
+sal_uInt32 nPoints = pPointCounts[nPolygon];
+if (nPoints)
+{
+const Point* pPoints = pPtAry[nPolygon];
+basegfx::B2DPolygon aPoly;
+aPoly.append(basegfx::B2DPoint(pPoints->getX(), pPoints->getY()), 
nPoints);
+for (sal_uInt32 i = 1; i < nPoints; ++i)
+aPoly.setB2DPoint(i, basegfx::B2DPoint(pPoints[i].getX(), 
pPoints[i].getY()));
+
+aPolyPoly.append(aPoly);
+}
+}
+
+drawPolyPolygon(cr, pExtents, rLineColor, rFillColor, bAntiAlias, 
basegfx::B2DHomMatrix(),
+aPolyPoly, 0.0);
+}
+
+bool CairoCommon::drawPolyPolygon(cairo_t* cr, basegfx::B2DRange* pExtents, 
const Color& rLineColor,
+  const Color& rFillColor, bool bAntiAlias,
+  const basegfx::B2DHomMatrix& rObjectToDevice,
+  const basegfx::B2DPolyPolygon& rPolyPolygon, 
double fTransparency)
+{
+const bool bHasFill(rFillColor != SALCOLOR_NONE);
+const bool bHasLine(rLineColor != SALCOLOR_NONE);
+
+if (0 == rPolyPolygon.count() || !(bHasFill || bHasLine) || fTransparency 
< 0.0
+|| fTransparency >= 1.0)
+{
+return true;
+}
+
+// don't bother trying to draw stuff which is effectively invisible
+basegfx::B2DRange aPolygonRange = rPolyPolygon.getB2DRange();
+aPolygonRange.transform(rObjectToDevice);
+if (aPolygonRange.getWidth() < 0.1 || aPolygonRange.getHeight() < 0.1)
+return true;
+
+// Set full (Object-to-Device) transformation - if used
+if (!rObjectToDevice.isIdentity())
+{
+cairo_matrix_t aMatrix;
+
+cairo_matrix_init(&aMatrix, rObjectToDevice.get(0, 0), 
rObjectToDevice.get(1, 0),
+  rObjectToDevice.get(0, 1), rObjectToDevice.get(1, 1),
+  rObjectToDevice.get(0, 2), rObjectToDevice.get(1, 
2));
+cairo_set_matrix(cr, &aMatrix);
+}
+
+if (bHasFill)
+{
+add_polygon_path(cr, rPolyPolygon, rObjectToDevice, !bAntiAlias);
+
+CairoCommon::applyColor(cr, rFillColor, fTransparency);
+if (pExtents)
+{
+// Get FillDamage (will be extended for LineDamage below)
+*pExtents = getClippedFillDamage(cr);
+}
+
+cairo_fill(cr);
+}
+
+if (bHasLine)
+{
+// PixelOffset used: Set PixelOffset as linear transformation
+cairo_matrix_t aMatrix;
+cairo_matrix_init_translate(&aMatrix, 0.5, 0.5);
+cairo_set_matrix(cr, &aMatrix);
+
+add_polygon_path(cr, rPolyPolygon, rObjectToDevice, !bAntiAlias);
+
+CairoCommon::applyColor(cr, rLineColor, fTransparency);
+
+if (pExtents)
+{
+// expand with possible StrokeDamage
+basegfx::B2DRange stroke_extents = getClippedStrokeDamage(cr);
+
stroke_extents.transform(basegfx::utils::createTranslateB2DHomMatrix(0.5, 0.5));
+pExtents->expand(stroke_extents);
+}
+
+cairo_stroke(cr);
+}
+
+if (pExtents)
+{
+// if transformation has been applied, transform also extents (ranges)
+// of damage so they can be correctly redrawn
+pExtents->transform(rObjectToD

[Libreoffice-commits] core.git: Branch 'distro/vector/vector-7.0' - sw/qa sw/source

2023-01-06 Thread Miklos Vajna (via logerrit)
 sw/qa/filter/html/html.cxx |   37 +
 sw/source/filter/html/htmltabw.cxx |2 +-
 2 files changed, 38 insertions(+), 1 deletion(-)

New commits:
commit 90441a276d14441f3f0c325f89338c535f6bdfbe
Author: Miklos Vajna 
AuthorDate: Thu Jan 5 13:56:23 2023 +0100
Commit: Miklos Vajna 
CommitDate: Fri Jan 6 10:04:14 2023 +0100

sw XHTML export: avoid sdnum and sdval attributes on table cells

These are not valid in XHTML, as the reqif validator points it out:

ERROR at 239: [XSD] cvc-complex-type.3.2.2: Attribute 'sdval' is not 
allowed to appear in element 'td'.
ERROR at 239: [XSD] cvc-complex-type.3.2.2: Attribute 'sdnum' is not 
allowed to appear in element 'td'.

The actual cell contents is already there, so just omit this unwanted
metadata in the XHTML case.

(cherry picked from commit b4c3291630610d38270d7d8ccda5f810b3e05d63)

Change-Id: I68804dd2ce45b0579287aeccbb550b174859f7ba

diff --git a/sw/qa/filter/html/html.cxx b/sw/qa/filter/html/html.cxx
index 5fb02c46e2c4..f3b31efa7fe6 100644
--- a/sw/qa/filter/html/html.cxx
+++ b/sw/qa/filter/html/html.cxx
@@ -16,6 +16,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 namespace
 {
@@ -144,6 +147,40 @@ CPPUNIT_TEST_FIXTURE(Test, testSvmImageExport)
 // i.e. we wrote both GIF and PNG, not just PNG for SVM images.
 assertXPath(pXmlDoc, "//reqif-xhtml:object", "type", "image/png");
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testTableCellFloatValueType)
+{
+// Given a document with a single table cell, its cell value is set to 
double:
+loadURL("private:factory/swriter", nullptr);
+auto pTextDocument = dynamic_cast(mxComponent.get());
+SwDoc* pDoc = pTextDocument->GetDocShell()->GetDoc();
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+SwInsertTableOptions aTableOptions(SwInsertTableFlags::DefaultBorder, 0);
+pWrtShell->InsertTable(aTableOptions, 1, 1);
+pWrtShell->MoveTable(GotoPrevTable, fnTableStart);
+SwTableNode* pTableNode = 
pWrtShell->GetCursor()->GetNode().FindTableNode();
+SwTable& rTable = pTableNode->GetTable();
+auto pBox = const_cast(rTable.GetTableBox("A1"));
+SwFrameFormat* pBoxFormat = pBox->ClaimFrameFormat();
+SwAttrSet aSet(pBoxFormat->GetAttrSet());
+SwTableBoxValue aBoxValue(42.0);
+aSet.Put(aBoxValue);
+pBoxFormat->GetDoc()->SetAttr(aSet, *pBoxFormat);
+
+// When exporting to XHTML:
+setFilterOptions("xhtmlns=reqif-xhtml");
+save("HTML (StarWriter)", maTempFile);
+
+// Then make sure that the sdval attribute is omitted, which is not in the 
XHTML spec:
+SvMemoryStream aStream;
+WrapReqifFromTempFile(aStream);
+xmlDocUniquePtr pXmlDoc = parseXmlStream(&aStream);
+// Without the accompanying fix in place, this test would have failed with:
+// - XPath '//reqif-xhtml:td' unexpected 'sdval' attribute
+// i.e. sdval was written in XHTML mode.
+assertXPathNoAttribute(pXmlDoc, "//reqif-xhtml:td", "sdval");
+assertXPathNoAttribute(pXmlDoc, "//reqif-xhtml:td", "sdnum");
+}
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/html/htmltabw.cxx 
b/sw/source/filter/html/htmltabw.cxx
index 81a7daf570a0..73c1e1336e98 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -455,7 +455,7 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt,
 nNumFormat = 
pBox->GetFrameFormat()->GetTableBoxNumFormat().GetValue();
 }
 
-if( bNumFormat || bValue )
+if ((bNumFormat || bValue) && !rWrt.mbXHTML)
 {
 sOut.append(HTMLOutFuncs::CreateTableDataOptionsValNum(bValue, nValue,
 nNumFormat, *rWrt.m_pDoc->GetNumberFormatter(), rWrt.m_eDestEnc,


[Libreoffice-commits] core.git: 2 commits - android/source

2023-01-06 Thread Michael Weghorn (via logerrit)
 android/source/gradle/wrapper/gradle-wrapper.jar|binary
 android/source/gradle/wrapper/gradle-wrapper.properties |4 
 android/source/gradlew  |  294 +---
 android/source/gradlew.bat  |   53 +-
 4 files changed, 210 insertions(+), 141 deletions(-)

New commits:
commit d6c54b3d4ee757958f9040a84dfbde0ab25f59bf
Author: Michael Weghorn 
AuthorDate: Thu Jan 5 21:00:58 2023 +0100
Commit: Michael Weghorn 
CommitDate: Fri Jan 6 09:06:36 2023 +

android: Enable checksum verification for gradle download

Follow the F-Droid Bot suggestion in [1] and set the checksum
from [2] in gradle-wrapper.properties, so a downloaded gradle
distribution will be verified against that, s. doc at [3].

Command used from within the `android/source` directory:

./gradlew wrapper --distribution-type all 
--gradle-distribution-sha256-sum 
cd5c2958a107ee7f0722004a12d0f8559b4564c34daad7df06cffd4d12a426d0

Note that this is the checksum for the gradle distribution,
not the gradle wrapper (which is mentioned in
Change-Id I3f466061aba55c5704fe251eee7e8c73f7d316aa instead.)

Also note that Android Studio does not fully support
the "distributionSha256Sum" attribute and requires
confirming in a message saying so that the checksum is correct
before syncing the project, s. [4].

[1] 
https://gitlab.com/fdroid/fdroiddata/-/merge_requests/12380#note_1229239229
[2] https://downloads.gradle-dn.com/distributions/gradle-7.4-all.zip.sha256
[3] 
https://docs.gradle.org/current/userguide/gradle_wrapper.html#configuring_checksum_verification
[4] https://issuetracker.google.com/issues/129261435#comment11

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

diff --git a/android/source/gradle/wrapper/gradle-wrapper.properties 
b/android/source/gradle/wrapper/gradle-wrapper.properties
index b1159fc54f39..dcf5e2cb7b3e 100644
--- a/android/source/gradle/wrapper/gradle-wrapper.properties
+++ b/android/source/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,6 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
+distributionSha256Sum=cd5c2958a107ee7f0722004a12d0f8559b4564c34daad7df06cffd4d12a426d0
 distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
commit 4a0dc0d63a204f7ed03b48debd439e0e81f1dfac
Author: Michael Weghorn 
AuthorDate: Thu Jan 5 17:51:41 2023 +0100
Commit: Michael Weghorn 
CommitDate: Fri Jan 6 09:06:28 2023 +

android: Update gradle wrapper to 7.4

Commit the result of running

./gradlew wrapper --distribution-type all --gradle-version 7.4

from within the `android/source` directory as described at [1].

Double-check that the sha256sum of the jar file matches what is listed on 
the
website [2] for v7.4:

$ sha256sum gradle/wrapper/gradle-wrapper.jar
575098db54a998ff1c6770b352c3b16766c09848bee7555dab09afc34e8cf590  
gradle/wrapper/gradle-wrapper.jar

(Interestingly, the sha256sum of the gradle-wrapper.jar
used so far, 
e2b82129ab64751fd40437007bd2f7f2afb3c6e41a9198e628650b22d5824a14,
is not the one of any listed versions there, which is what
the F-Droid bot marked as error in a MR to update LibreOffice Viewer [3]).

[1] 
https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:upgrading_wrapper
[2] https://gradle.org/release-checksums/
[3] 
https://gitlab.com/fdroid/fdroiddata/-/merge_requests/12380#note_1229239229

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

diff --git a/android/source/gradle/wrapper/gradle-wrapper.jar 
b/android/source/gradle/wrapper/gradle-wrapper.jar
index 8c0fb64a8698..41d9927a4d4f 100644
Binary files a/android/source/gradle/wrapper/gradle-wrapper.jar and 
b/android/source/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/android/source/gradle/wrapper/gradle-wrapper.properties 
b/android/source/gradle/wrapper/gradle-wrapper.properties
index e4ca53e04840..b1159fc54f39 100644
--- a/android/source/gradle/wrapper/gradle-wrapper.properties
+++ b/android/source/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
-#Tue Mar 03 14:01:57 CET 2020
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
diff --git a/android/source/gradlew b/android/source/gradlew
index b7029853b09f..1b6c787337ff 100755
--- a/android/source/gradlew
+++

[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - oox/source sd/qa

2023-01-06 Thread Attila Szűcs (via logerrit)
 oox/source/drawingml/shape.cxx   |6 +++
 sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx |binary
 sd/qa/unit/import-tests2.cxx |   25 +++
 3 files changed, 31 insertions(+)

New commits:
commit 2e3cf5e21c9a4aba8623e89e5e472efa6586619d
Author: Attila Szűcs 
AuthorDate: Thu Jan 5 13:29:32 2023 +0100
Commit: Andras Timar 
CommitDate: Fri Jan 6 09:29:32 2023 +

tdf#149588 pptx import: transparency at SolidFill

When copied color (RGB) property from text content to shape,
copy alpha component as well. (If text color have alpha component)

Change-Id: Ib86c48ab7b2d3c5f9491a2211b05e90b2c2ea10f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145079
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 1dd4eb319c26..8fefc18fdbf6 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -662,6 +662,12 @@ static void lcl_createPresetShape(const 
uno::Reference& xShape,
 const sal_Int32 aFillColor = static_cast(
 pProperties.maFillProperties.maFillColor.getColor( 
rGraphicHelper ).GetRGBColor() );
 xSet->setPropertyValue( UNO_NAME_FILLCOLOR, uno::Any( aFillColor ) 
);
+
+if (pProperties.maFillProperties.maFillColor.hasTransparency())
+{
+const sal_Int16 aTransparence = 
pProperties.maFillProperties.maFillColor.getTransparency();
+xSet->setPropertyValue(UNO_NAME_FILL_TRANSPARENCE, 
uno::Any(aTransparence));
+}
 }
 else
 {
diff --git a/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx 
b/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx
new file mode 100644
index ..8967590b9284
Binary files /dev/null and 
b/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 969eb250fb80..e9f2ce067740 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -141,6 +141,7 @@ public:
 void testTdf89928BlackWhiteThreshold();
 void testTdf151547TransparentWhiteText();
 void testTdf149961AutofitIndentation();
+void testTdf149588TransparentSolidFill();
 
 CPPUNIT_TEST_SUITE(SdImportTest2);
 
@@ -216,6 +217,7 @@ public:
 CPPUNIT_TEST(testTdf89928BlackWhiteThreshold);
 CPPUNIT_TEST(testTdf151547TransparentWhiteText);
 CPPUNIT_TEST(testTdf149961AutofitIndentation);
+CPPUNIT_TEST(testTdf149588TransparentSolidFill);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -2206,6 +2208,29 @@ void SdImportTest2::testTdf149961AutofitIndentation()
 }
 }
 
+void SdImportTest2::testTdf149588TransparentSolidFill()
+{
+sd::DrawDocShellRef xDocShRef = loadURL(
+
m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx"),
+PPTX);
+
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
+
+uno::Reference xShape(getShapeFromPage(6, 0, 
xDocShRef));
+uno::Reference xParagraph(getParagraphFromShape(0, 
xShape));
+uno::Reference xRun(getRunFromParagraph(0, xParagraph));
+uno::Reference xPropSet(xRun, uno::UNO_QUERY_THROW);
+
+Color nCharColor;
+xPropSet->getPropertyValue("CharColor") >>= nCharColor;
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: Color: R:99 G:99 B:99 A   51  (T:204)
+// - Actual  : Color: R:99 G:99 B:99 A: 255  (T:  0)
+CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0xCC636363), nCharColor);
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();


[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - oox/source sd/qa

2023-01-06 Thread Attila Szűcs (via logerrit)
 oox/source/drawingml/shape.cxx   |6 
 sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx |binary
 sd/qa/unit/import-tests2.cxx |   20 +++
 3 files changed, 26 insertions(+)

New commits:
commit c27ba904366a966c2f4cc8fe2a04d47a41b3cc1d
Author: Attila Szűcs 
AuthorDate: Wed Jan 4 00:40:23 2023 +0100
Commit: Andras Timar 
CommitDate: Fri Jan 6 09:29:22 2023 +

tdf#149588 pptx import: transparency at SolidFill

When copied color (RGB) property from text content to shape,
copy alpha component as well. (If text color have alpha component)

Change-Id: Ib86c48ab7b2d3c5f9491a2211b05e90b2c2ea10f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145031
Tested-by: Jenkins
Reviewed-by: Andras Timar 
(cherry picked from commit 0cc9aaae5dc6655490513e8e4a93967f6248e23c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145004

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index a9b869e86af2..059785edf6e5 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -852,6 +852,12 @@ static void lcl_copyCharPropsToShape(const 
uno::Reference& xSha
 aFillColor = static_cast(
 
rCharProps.maFillProperties.maFillColor.getColor(rFilter.getGraphicHelper())
 .GetRGBColor());
+if (rCharProps.maFillProperties.maFillColor.hasTransparency())
+{
+const sal_Int16 aTransparence
+= 
rCharProps.maFillProperties.maFillColor.getTransparency();
+xSet->setPropertyValue(UNO_NAME_FILL_TRANSPARENCE, 
uno::Any(aTransparence));
+}
 }
 xSet->setPropertyValue(UNO_NAME_FILLCOLOR, uno::Any(aFillColor));
 
diff --git a/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx 
b/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx
new file mode 100644
index ..8967590b9284
Binary files /dev/null and 
b/sd/qa/unit/data/pptx/tdf149588_transparentSolidFill.pptx differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index b258c535e2c6..5d5864a2891e 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -145,6 +145,7 @@ public:
 void testTdf89928BlackWhiteThreshold();
 void testTdf151547TransparentWhiteText();
 void testTdf149961AutofitIndentation();
+void testTdf149588TransparentSolidFill();
 
 CPPUNIT_TEST_SUITE(SdImportTest2);
 
@@ -223,6 +224,7 @@ public:
 CPPUNIT_TEST(testTdf89928BlackWhiteThreshold);
 CPPUNIT_TEST(testTdf151547TransparentWhiteText);
 CPPUNIT_TEST(testTdf149961AutofitIndentation);
+CPPUNIT_TEST(testTdf149588TransparentSolidFill);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -2009,6 +2011,24 @@ void SdImportTest2::testTdf149961AutofitIndentation()
 }
 }
 
+void SdImportTest2::testTdf149588TransparentSolidFill()
+{
+createSdImpressDoc("pptx/tdf149588_transparentSolidFill.pptx");
+saveAndReload("Impress MS PowerPoint 2007 XML");
+
+uno::Reference xShape(getShapeFromPage(6, 0));
+uno::Reference xParagraph(getParagraphFromShape(0, 
xShape));
+uno::Reference xRun(getRunFromParagraph(0, xParagraph));
+uno::Reference xPropSet(xRun, uno::UNO_QUERY_THROW);
+
+Color nCharColor;
+xPropSet->getPropertyValue("CharColor") >>= nCharColor;
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: Color: R:99 G:99 B:99 A   51  (T:204)
+// - Actual  : Color: R:99 G:99 B:99 A: 255  (T:  0)
+CPPUNIT_ASSERT_EQUAL(Color(ColorTransparency, 0xCC636363), nCharColor);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();


Re: request of uploading packages

2023-01-06 Thread taichi

Thank you.

On 2022/12/29 1:01, sbergman at redhat.com (Stephan Bergmann) wrote:

On 12/23/22 16:23, taichi wrote:

There is a mistake in the package list I sent you , so I corrected it.

* curl-7.87.0.tar.xz (https://curl.se/download/curl-7.87.0.tar.xz)
* libgpg-error-1.46.tar.bz2 
(https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.46.tar.bz2)
* Python-3.11.1.tar.xz 
(https://www.python.org/ftp/python/3.11.1/Python-3.11.1.tar.xz)

done


[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/qa writerfilter/source

2023-01-06 Thread László Németh (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf131203.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx|8 +++
 writerfilter/source/dmapper/DomainMapperTableManager.cxx |   17 +++
 3 files changed, 17 insertions(+), 8 deletions(-)

New commits:
commit e9a3755182db2a0e06278977e9d8af376ac4eefa
Author: László Németh 
AuthorDate: Thu Jan 5 10:21:10 2023 +0100
Commit: László Németh 
CommitDate: Fri Jan 6 10:32:36 2023 +

tdf#131203 DOCX import: fix lost table when w:tblGrid is missing

Load tables in case of incomplete text table definition, i.e.
missing w:tblGrid and its w:gridCol elements, like MSO does.

Note: Apache POI, and maybe old MSO versions generated such DOCX documents.

divide_by_zero() was thrown from 975884fbbc3f80a634258ee562037688a42027a9
"ofz#7110 ensure join is called on std::exceptions as well as 
uno::Exception".

See also commit 9279b0bb5397d0520b727ab0d271f328807c8749
"writerfilter: avoid divide by zero" and
commit 116cadb5d2582532c69677a2f8499e8e9b7b9b80
"tdf#59274 DOCX import: fix tables with incomplete grid".

Change-Id: I991807da13e22e551f81c3fb60580be7a9c0fb50
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145069
Tested-by: Jenkins
Reviewed-by: László Németh 
(cherry picked from commit e17b4df3fe5441ca66e4203c725a578eb1797eb2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145008
Reviewed-by: Michael Stahl 
Tested-by: László Németh 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf131203.docx 
b/sw/qa/extras/ooxmlexport/data/tdf131203.docx
new file mode 100644
index ..2fd0dcabded4
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf131203.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index d282675b07ad..f33013413a1c 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -249,6 +249,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf131959)
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblInd", "w", "360");
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf131203)
+{
+loadAndSave("tdf131203.docx");
+xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+// loading thrown divide_by_zero()
+assertXPath(pXmlDoc, "//w:tbl", 2);
+}
+
 CPPUNIT_TEST_FIXTURE(Test, testFDO76597)
 {
 loadAndSave("fdo76597.docx");
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx 
b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index bc8b59642714..004f34971b6a 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -807,15 +807,16 @@ void DomainMapperTableManager::endOfRowAction()
 nFullWidthRelative += nFixLastCellWidth - 
(*pCellWidths)[nWidthsBound];
 }
 
-if (nFullWidthRelative == 0)
-throw o3tl::divide_by_zero();
-
-for (size_t i = 0; i < nWidthsBound; ++i)
+// tdf#131203 handle missing w:tblGrid
+if (nFullWidthRelative > 0)
 {
-nSum += (*pCellWidths)[i];
-pSeparators[nPos].Position = (nSum * 1) / 
nFullWidthRelative; // Relative position
-pSeparators[nPos].IsVisible = true;
-nPos++;
+for (size_t i = 0; i < nWidthsBound; ++i)
+{
+nSum += (*pCellWidths)[i];
+pSeparators[nPos].Position = (nSum * 1) / 
nFullWidthRelative; // Relative position
+pSeparators[nPos].IsVisible = true;
+nPos++;
+}
 }
 }
 


Re: Re: request of uploading package

2023-01-06 Thread taichi

Thank you.

On 2022/12/29 1:08, sbergman at redhat.com (Stephan Bergmann) wrote:

On 12/26/22 14:19, taichi wrote:

could someone please upload "fontconfig-2.14.1.tar.xz" on dev-server ?

URL:
https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.14.1.tar.xz

done


[Libreoffice-commits] core.git: sw/qa

2023-01-06 Thread László Németh (via logerrit)
 sw/qa/uitest/writer_tests4/spellDialog.py |   15 ++-
 1 file changed, 6 insertions(+), 9 deletions(-)

New commits:
commit cfcd5aa6898654ad3b469ee23f2b27eef5e4a565
Author: László Németh 
AuthorDate: Fri Jan 6 10:29:30 2023 +0100
Commit: László Németh 
CommitDate: Fri Jan 6 11:26:33 2023 +

tdf#65535 sw spellDialog.py: fix lo-upsan build

Lo-upsan build didn't replace the bad word in the test,
maybe because of dictionary or timer problems. Skip
testing the (here: sometimes missing) text changes,
keep only testing of the remaining comment, which was
the target of the original fix.

This reverts commit d2614337e8291b9b6d114fda5ae914f6940c353a
"tdf#65535 sw spellDialog.py: add same latency to fix lo-upsan build"
and commit 81163c384364e4b5c99392b76f027f8c2b87c259
"tdf#65535 sw spellDialog.py: fix lo-upsan build better".

Change-Id: Ib5faa4e02bf6dd085d748ae76f67b4e07497
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145138
Tested-by: Jenkins
Reviewed-by: László Németh 

diff --git a/sw/qa/uitest/writer_tests4/spellDialog.py 
b/sw/qa/uitest/writer_tests4/spellDialog.py
index 2c84f03f8ec9..39ef8eaebe42 100644
--- a/sw/qa/uitest/writer_tests4/spellDialog.py
+++ b/sw/qa/uitest/writer_tests4/spellDialog.py
@@ -7,7 +7,7 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-import re, time
+import re
 from uitest.framework import UITestCase
 from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
 from uitest.uihelper.common import type_text
@@ -220,8 +220,8 @@ frog, dogg, catt"""
 
 # type a bad word after the word with comment
 cursor.goRight(5, False)
-type_text(xEdit, " baad ")
-cursor.goLeft(11, False)
+type_text(xEdit, " baad")
+cursor.goLeft(10, False)
 
 # fix the first word using the spelling dialog
 with 
self.ui_test.execute_modeless_dialog_through_command(".uno:SpellingAndGrammarDialog",
 close_button="close") as xDialog:
@@ -233,12 +233,9 @@ frog, dogg, catt"""
 change = xDialog.getChild('change')
 change.executeAction("CLICK", ())
 
-fixed_word = "Bad baad "
-while fixed_word != document.Text.getString():
-time.sleep(0.1)
-
-output_text = document.Text.getString()
-self.assertEqual(fixed_word, output_text)
+# FIXME: disabled for the sake of testing on lo-upsan build
+# output_text = document.Text.getString()
+# self.assertEqual(fixed_word, output_text)
 
 # check the original comment
 has_comment = False


[Libreoffice-commits] core.git: sw/inc sw/qa sw/sdi sw/source

2023-01-06 Thread Miklos Vajna (via logerrit)
 sw/inc/cmdid.h  |1 
 sw/qa/uibase/shells/shells.cxx  |   62 +
 sw/sdi/_textsh.sdi  |6 +++
 sw/sdi/swriter.sdi  |   14 +++
 sw/source/uibase/shells/textfld.cxx |   66 
 5 files changed, 149 insertions(+)

New commits:
commit 337416dafb66ed8f930d2d69e83fae438fc85f3c
Author: Miklos Vajna 
AuthorDate: Fri Jan 6 10:08:00 2023 +0100
Commit: Miklos Vajna 
CommitDate: Fri Jan 6 11:32:29 2023 +

sw: add a new .uno:UpdateTextFormField UNO command

It is possible to update all fieldsmarks (of a certion type, of a
certain field command prefix), but one can't update the fieldmark under
the cursor, which is needed for Zotero citation clusters.

To make this more complex, insertion inside an existing fieldmark is
explicitly not wanted, see commit
a178a2ac6df8dc63a7ab8d4a19b90ae8a17baca4 (sw UI: fix crash on inserting
a fieldmark inside a fieldmark, 2023-01-02).

Fix the problem by adding a new .uno:UpdateTextFormField UNO command
that can update the (innermost) fieldmark under the current cursor.

The uno command is intentionally hidden from the customize dialog since
it only makes sense to invoke it from a macro / API with parameters, not
interactively.

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

diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index dbb3a259b422..6f51a0e5e855 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -314,6 +314,7 @@ class SwUINumRuleItem;
 #define FN_PROTECT_BOOKMARKS(FN_INSERT2 + 27)
 
 #define FN_UPDATE_TEXT_FORMFIELDS   (FN_INSERT2 + 28)
+#define FN_UPDATE_TEXT_FORMFIELD(FN_INSERT2 + 29)
 
 // clipboard table content
 #define FN_PASTE_NESTED_TABLE   (FN_INSERT2 + 30)  /* instead of the 
cell-by-cell copy between source and target tables */
diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx
index ae2c0bf2fb5c..a394221997cb 100644
--- a/sw/qa/uibase/shells/shells.cxx
+++ b/sw/qa/uibase/shells/shells.cxx
@@ -595,6 +595,68 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, 
testUpdateRefmarks)
 CPPUNIT_ASSERT_EQUAL(OUString("new content"), pTextNode->GetText());
 }
 
+CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testUpdateFieldmark)
+{
+// Given a document with a fieldmark:
+createSwDoc();
+uno::Sequence aArgs = {
+comphelper::makePropertyValue("FieldType", 
uno::Any(OUString(ODF_UNHANDLED))),
+comphelper::makePropertyValue("FieldCommand",
+  uno::Any(OUString("ADDIN ZOTERO_ITEM old 
command 1"))),
+comphelper::makePropertyValue("FieldResult", uno::Any(OUString("old 
result 1"))),
+};
+dispatchCommand(mxComponent, ".uno:TextFormField", aArgs);
+
+// When updating that fieldmark to have new field command & result:
+SwDoc* pDoc = getSwDoc();
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+pWrtShell->SttEndDoc(/*bStt=*/false);
+pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, 
/*bBasicCall=*/false);
+std::vector aArgsVec = 
comphelper::JsonToPropertyValues(R"json(
+{
+"FieldType": {
+"type": "string",
+"value": "vnd.oasis.opendocument.field.UNHANDLED"
+},
+"FieldCommandPrefix": {
+"type": "string",
+"value": "ADDIN ZOTERO_ITEM"
+},
+"Field": {
+"type": "[]com.sun.star.beans.PropertyValue",
+"value": {
+"FieldType": {
+"type": "string",
+"value": "vnd.oasis.opendocument.field.UNHANDLED"
+},
+"FieldCommand": {
+"type": "string",
+"value": "ADDIN ZOTERO_ITEM new command 1"
+},
+"FieldResult": {
+"type": "string",
+"value": "new result 1"
+}
+}
+}
+}
+)json");
+aArgs = comphelper::containerToSequence(aArgsVec);
+dispatchCommand(mxComponent, ".uno:UpdateTextFormField", aArgs);
+
+// Then make sure that the document text is updated accordingly:
+SwCursor* pCursor = pWrtShell->GetCursor();
+OUString aActual = pCursor->Start()->GetNode().GetTextNode()->GetText();
+static sal_Unicode const aForbidden[]
+= { CH_TXT_ATR_FIELDSTART, CH_TXT_ATR_FIELDSEP, CH_TXT_ATR_FIELDEND, 0 
};
+aActual = comphelper::string::removeAny(aActual, aForbidden);
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: new result 1
+// - Actual  : old result 1
+// i.e. the document text was not updated.
+CPPUNIT_ASSERT_EQUAL(OUString("new result 1"), aActual);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/sdi/_textsh.s

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

2023-01-06 Thread Noel Grandin (via logerrit)
 include/vcl/salgtype.hxx|2 
 vcl/headless/CairoCommon.cxx|   45 ---
 vcl/headless/SvpGraphicsBackend.cxx |   69 +++-
 vcl/inc/headless/CairoCommon.hxx|   33 ++-
 vcl/inc/qt5/QtGraphics.hxx  |5 +
 vcl/inc/skia/gdiimpl.hxx|   35 ++--
 vcl/inc/unx/saldisp.hxx |2 
 vcl/qt5/QtGraphics_GDI.cxx  |   32 +--
 vcl/qt5/QtPainter.cxx   |8 +-
 vcl/skia/gdiimpl.cxx|   65 +++---
 vcl/skia/osx/gdiimpl.cxx|4 -
 vcl/unx/generic/app/saldisp.cxx |   10 ++-
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx |   16 ++---
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx |   12 ++--
 vcl/unx/generic/gdi/gdiimpl.cxx |   56 +--
 vcl/unx/generic/gdi/gdiimpl.hxx |5 +
 16 files changed, 205 insertions(+), 194 deletions(-)

New commits:
commit 89b1d41e0d2cd16a4088e095de0f673807c4adac
Author: Noel Grandin 
AuthorDate: Thu Jan 5 12:32:32 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Jan 6 11:34:20 2023 +

use std::optional for SALCOLOR_NONE

instead of re-using an actual real color value, because it will totally
not work when I convert vcl to use alpha instead of transparency

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

diff --git a/include/vcl/salgtype.hxx b/include/vcl/salgtype.hxx
index a6559d68da23..efd5cc8060d3 100644
--- a/include/vcl/salgtype.hxx
+++ b/include/vcl/salgtype.hxx
@@ -33,8 +33,6 @@ enum class DeviceFormat {
 #endif
 };
 
-constexpr ::Color SALCOLOR_NONE ( ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF );
-
 struct SalTwoRect
 {
 tools::LongmnSrcX;
diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx
index 291bc7e36380..0779cb65c564 100644
--- a/vcl/headless/CairoCommon.cxx
+++ b/vcl/headless/CairoCommon.cxx
@@ -609,14 +609,14 @@ void CairoCommon::clipRegion(cairo_t* cr, const 
vcl::Region& rClipRegion)
 
 void CairoCommon::clipRegion(cairo_t* cr) { CairoCommon::clipRegion(cr, 
m_aClipRegion); }
 
-void CairoCommon::drawPixel(cairo_t* cr, basegfx::B2DRange* pExtents, const 
Color& rLineColor,
-tools::Long nX, tools::Long nY)
+void CairoCommon::drawPixel(cairo_t* cr, basegfx::B2DRange* pExtents,
+const std::optional& rLineColor, 
tools::Long nX, tools::Long nY)
 {
-if (rLineColor == SALCOLOR_NONE)
+if (!rLineColor)
 return;
 
 cairo_rectangle(cr, nX, nY, 1, 1);
-CairoCommon::applyColor(cr, rLineColor, 0.0);
+CairoCommon::applyColor(cr, *rLineColor, 0.0);
 cairo_fill(cr);
 
 if (pExtents)
@@ -687,9 +687,11 @@ void CairoCommon::drawLine(cairo_t* cr, basegfx::B2DRange* 
pExtents, const Color
 cairo_stroke(cr);
 }
 
-void CairoCommon::drawPolyPolygon(cairo_t* cr, basegfx::B2DRange* pExtents, 
const Color& rLineColor,
-  const Color& rFillColor, bool bAntiAlias, 
sal_uInt32 nPoly,
-  const sal_uInt32* pPointCounts, const 
Point** pPtAry)
+void CairoCommon::drawPolyPolygon(cairo_t* cr, basegfx::B2DRange* pExtents,
+  const std::optional& rLineColor,
+  const std::optional& rFillColor, bool 
bAntiAlias,
+  sal_uInt32 nPoly, const sal_uInt32* 
pPointCounts,
+  const Point** pPtAry)
 {
 basegfx::B2DPolyPolygon aPolyPoly;
 for (sal_uInt32 nPolygon = 0; nPolygon < nPoly; ++nPolygon)
@@ -711,13 +713,14 @@ void CairoCommon::drawPolyPolygon(cairo_t* cr, 
basegfx::B2DRange* pExtents, cons
 aPolyPoly, 0.0);
 }
 
-bool CairoCommon::drawPolyPolygon(cairo_t* cr, basegfx::B2DRange* pExtents, 
const Color& rLineColor,
-  const Color& rFillColor, bool bAntiAlias,
+bool CairoCommon::drawPolyPolygon(cairo_t* cr, basegfx::B2DRange* pExtents,
+  const std::optional& rLineColor,
+  const std::optional& rFillColor, bool 
bAntiAlias,
   const basegfx::B2DHomMatrix& rObjectToDevice,
   const basegfx::B2DPolyPolygon& rPolyPolygon, 
double fTransparency)
 {
-const bool bHasFill(rFillColor != SALCOLOR_NONE);
-const bool bHasLine(rLineColor != SALCOLOR_NONE);
+const bool bHasFill(rFillColor.has_value());
+const bool bHasLine(rLineColor.has_value());
 
 if (0 == rPolyPolygon.count() || !(bHasFill || bHasLine) || fTransparency 
< 0.0
 || fTransparency >= 1.0)

[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/inc sw/source

2023-01-06 Thread Heiko Tietze (via logerrit)
 sw/inc/flddat.hxx |2 +-
 sw/source/uibase/fldui/fldmgr.cxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 1a7db8daf9da33133c49e803cb1b834d9351bf59
Author: Heiko Tietze 
AuthorDate: Thu Jan 5 13:36:13 2023 +
Commit: Heiko Tietze 
CommitDate: Fri Jan 6 12:13:59 2023 +

Revert "Relates tdf#139141 - Make variable date/time field the default"

This reverts commit b2c81dad3a0b72d305f1c6967ee4a8069ae11b45.

Reason for revert: tdf#152871

Change-Id: I56f42b4ce104dbb96d8fda1bc71af727fa46d536
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145007
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 
(cherry picked from commit d7514d34b67626ba0b7d1dc0e9acbdfc635fe0ac)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145117

diff --git a/sw/inc/flddat.hxx b/sw/inc/flddat.hxx
index 6c452072e926..39c00f68a235 100644
--- a/sw/inc/flddat.hxx
+++ b/sw/inc/flddat.hxx
@@ -30,8 +30,8 @@ namespace tools { class Time; }
 
 enum SwDateSubFormat
 {
-DATE_VAR,
 DATE_FIX,
+DATE_VAR
 };
 
 class SAL_DLLPUBLIC_RTTI SwDateTimeFieldType final : public SwValueFieldType
diff --git a/sw/source/uibase/fldui/fldmgr.cxx 
b/sw/source/uibase/fldui/fldmgr.cxx
index ec544bca99ac..a3158584a6e3 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -157,14 +157,14 @@ const TranslateId FMT_AUTHOR_ARY[] =
 
 const TranslateId FLD_DATE_ARY[] =
 {
-FLD_DATE_STD,
 FLD_DATE_FIX,
+FLD_DATE_STD,
 };
 
 const TranslateId FLD_TIME_ARY[] =
 {
-FLD_TIME_STD,
 FLD_TIME_FIX,
+FLD_TIME_STD
 };
 
 const TranslateId FMT_NUM_ARY[] =


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

2023-01-06 Thread Heiko Tietze (via logerrit)
 cui/uiconfig/ui/gradientpage.ui|  338 -
 cui/uiconfig/ui/transparencytabpage.ui |  294 ++--
 2 files changed, 315 insertions(+), 317 deletions(-)

New commits:
commit 660b7ed484efcac1e5b841e0b04f3c9628578448
Author: Heiko Tietze 
AuthorDate: Fri Jan 6 11:08:36 2023 +0100
Commit: Heiko Tietze 
CommitDate: Fri Jan 6 13:11:23 2023 +

Resolves tdf#101731 - Rename Border/Midpoint

Follow up to Icda875d3c6f03ffd29395ac5ce932475cc629361
changing "Midpoint" (formerly "Border") to "Transition start".
Using the same name for transparency.

Change-Id: I1f1c53ee357a9ead94100156598f43a0ac021d74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145141
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/cui/uiconfig/ui/gradientpage.ui b/cui/uiconfig/ui/gradientpage.ui
index e2ec661b3b7d..3630f6f5a006 100644
--- a/cui/uiconfig/ui/gradientpage.ui
+++ b/cui/uiconfig/ui/gradientpage.ui
@@ -1,91 +1,91 @@
 
-
+
 
   
   
 3
 256
-1
-10
+1
+10
   
   
 3
 256
 3
-1
-10
+1
+10
   
   
 100
-1
-10
+1
+10
   
   
 359
-15
+15
   
   
 359
-15
-15
+15
+15
   
   
 100
-5
+5
   
   
 100
-5
+5
   
   
 100
-5
+5
   
   
 100
-5
+5
   
   
 100
-5
+5
   
   
 True
-False
+False
 True
 True
-6
+6
 6
 
   
 True
-False
-0
-none
+False
+0
+none
 
   
 True
-False
-vertical
-6
+False
 12
 6
+vertical
+6
 
   
 True
-True
+True
 True
-never
-never
-in
+never
+never
+in
 
   
 True
-False
+False
 
   
 True
-True
+True
 GDK_BUTTON_MOTION_MASK | 
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_STRUCTURE_MASK
 True
   
@@ -102,16 +102,16 @@
 
   
 True
-False
+False
 center
 6
-start
+start
 
   
 _Add
 True
-True
-True
+True
+True
 True
 
   
@@ -129,9 +129,9 @@
   
 _Modify
 True
-True
-True
-True
+True
+True
+True
 
   
 Applies the 
current gradient properties to the selected gradient. If you want, you can save 
the gradient under a different name.
@@ -156,7 +156,7 @@
 
   
 True
-False
+False
 Gradient
 
   
@@ -173,36 +173,36 @@
 
   
 True
-False
+False
 True
 True
-0
-none
+0
+none
 
   
 True
-False
+False
 start
+12
+6
 True
 True
 vertical
 6
-12
-6
 
   
 True
-False
+False
 start
 vertical
 3
 
   
 True
-False
+False
 _Type:
-True
-gradienttypelb
+True
+gradienttypelb
 0
   
   
@@ -214,7 +214,7 @@
 
   
 True
-False
+False
 
   Linear
   Axial
@@ -243,54 +243,54 @@
   
 
 
-  
+  
   
 True
-False
+False
 start
-3
-6
+3
+6
 
   
   

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

2023-01-06 Thread Miklos Vajna (via logerrit)
 sw/qa/uibase/uno/uno.cxx  |   44 +++---
 sw/source/uibase/uno/loktxdoc.cxx |   18 ++-
 2 files changed, 53 insertions(+), 9 deletions(-)

New commits:
commit 5a2ee5ba893b6b8f4e7fd6623b7f10faf0bda509
Author: Miklos Vajna 
AuthorDate: Fri Jan 6 13:35:21 2023 +0100
Commit: Miklos Vajna 
CommitDate: Fri Jan 6 13:43:18 2023 +

sw lok: get all refmarks: sort the refmarks array

This was using the order used by GetItemSurrogates(), which is mostly by
pointer address.

We know that these pool items have a text attribute, which have a node
and a content index, sort by that.

In theory two refmark may start at the same doc model position, but
that's never the case when using Zotero, so don't worry about that for
now.

For a document with 5 refmarks, the original order I got was 2-3-5-4-1,
now it's property 1-2-3-4-5.

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

diff --git a/sw/qa/uibase/uno/uno.cxx b/sw/qa/uibase/uno/uno.cxx
index f15e2b654463..a23f6e0f4968 100644
--- a/sw/qa/uibase/uno/uno.cxx
+++ b/sw/qa/uibase/uno/uno.cxx
@@ -322,13 +322,21 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testGetFields)
 {
 // Given a document with a refmark:
 createSwDoc();
-uno::Sequence aArgs = {
-comphelper::makePropertyValue("TypeName", 
uno::Any(OUString("SetRef"))),
-comphelper::makePropertyValue(
-"Name", uno::Any(OUString("ZOTERO_ITEM CSL_CITATION {} 
RNDpyJknp173F"))),
-comphelper::makePropertyValue("Content", 
uno::Any(OUString("mycontent"))),
-};
-dispatchCommand(mxComponent, ".uno:InsertField", aArgs);
+SwDoc* pDoc = getSwDoc();
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+OUString aName("ZOTERO_ITEM CSL_CITATION {} ");
+for (int i = 0; i < 5; ++i)
+{
+uno::Sequence aArgs = {
+comphelper::makePropertyValue("TypeName", 
uno::Any(OUString("SetRef"))),
+comphelper::makePropertyValue("Name", uno::Any(aName + 
OUString::number(i + 1))),
+comphelper::makePropertyValue("Content", 
uno::Any(OUString("mycontent"))),
+};
+dispatchCommand(mxComponent, ".uno:InsertField", aArgs);
+pWrtShell->SttEndDoc(/*bStt=*/false);
+pWrtShell->SplitNode();
+pWrtShell->SttEndDoc(/*bStt=*/false);
+}
 
 // When getting the refmarks:
 tools::JsonWriter aJsonWriter;
@@ -344,7 +352,27 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testGetFields)
 // Without the accompanying fix in place, this test would have failed with:
 // - No such node (setRefs)
 // i.e. the returned JSON was just empty.
-CPPUNIT_ASSERT_EQUAL(static_cast(1), 
aTree.get_child("setRefs").count(""));
+CPPUNIT_ASSERT_EQUAL(static_cast(5), 
aTree.get_child("setRefs").count(""));
+auto it = aTree.get_child("setRefs").begin();
+boost::property_tree::ptree aRef = (it++)->second;
+CPPUNIT_ASSERT_EQUAL(std::string("ZOTERO_ITEM CSL_CITATION {} 1"),
+ aRef.get("name"));
+aRef = (it++)->second;
+CPPUNIT_ASSERT_EQUAL(std::string("ZOTERO_ITEM CSL_CITATION {} 2"),
+ aRef.get("name"));
+aRef = (it++)->second;
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: ZOTERO_ITEM CSL_CITATION {} 3
+// - Actual  : ZOTERO_ITEM CSL_CITATION {} 4
+// i.e. the output was unsorted.
+CPPUNIT_ASSERT_EQUAL(std::string("ZOTERO_ITEM CSL_CITATION {} 3"),
+ aRef.get("name"));
+aRef = (it++)->second;
+CPPUNIT_ASSERT_EQUAL(std::string("ZOTERO_ITEM CSL_CITATION {} 4"),
+ aRef.get("name"));
+aRef = (it++)->second;
+CPPUNIT_ASSERT_EQUAL(std::string("ZOTERO_ITEM CSL_CITATION {} 5"),
+ aRef.get("name"));
 }
 
 CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testGetTextFormField)
diff --git a/sw/source/uibase/uno/loktxdoc.cxx 
b/sw/source/uibase/uno/loktxdoc.cxx
index f0372b37438b..ec0e9303527d 100644
--- a/sw/source/uibase/uno/loktxdoc.cxx
+++ b/sw/source/uibase/uno/loktxdoc.cxx
@@ -36,6 +36,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -261,9 +263,23 @@ void GetFields(tools::JsonWriter& rJsonWriter, SwDocShell* 
pDocShell,
 
 SwDoc* pDoc = pDocShell->GetDoc();
 tools::ScopedJsonWriterArray aBookmarks = 
rJsonWriter.startArray("setRefs");
+std::vector aRefMarks;
 for (sal_uInt16 i = 0; i < pDoc->GetRefMarks(); ++i)
 {
-const SwFormatRefMark* pRefMark = pDoc->GetRefMark(i);
+aRefMarks.push_back(pDoc->GetRefMark(i));
+}
+// Sort the refmarks based on their start position.
+std::sort(aRefMarks.begin(), aRefMarks.end(),
+  [](const SwFormatRefMark* pMark1, const

[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - 2 commits - i18nlangtag/source include/i18nlangtag svtools/source

2023-01-06 Thread Eike Rathke (via logerrit)
 i18nlangtag/source/isolang/isolang.cxx  |3 ++-
 i18nlangtag/source/isolang/mslangid.cxx |2 ++
 include/i18nlangtag/lang.h  |3 ++-
 svtools/source/misc/langtab.cxx |8 +++-
 4 files changed, 9 insertions(+), 7 deletions(-)

New commits:
commit b959a2290f218dcae081d30e9da11c5a602ba5a5
Author: Eike Rathke 
AuthorDate: Thu Jan 5 18:12:59 2023 +0100
Commit: Eike Rathke 
CommitDate: Fri Jan 6 14:12:04 2023 +

Related: tdf#152781 Stab the 0xE40A {es} vs Latin America quirk

First, the LANGUAGE_SPANISH_LATIN_AMERICA 0xE40A is not a MS
system LCID, it is Spanish 0x00a with sublanguage 0x39 => user
defined (in the range 0x20 to 0x3f). Meanwhile MS reserved 0x580A
for {es-419}, so obsolete the legacy 0xE40A definition and replace
with 0x580A when encountered.

Second, due to the legacy plain {es} mapping being present, an
encountered 'es' (from our bundled dictionary extension) got
mapped to 0xE40A instead of 0xA and thus was added to the
character language listbox (that otherwise suppresses LCIDs
without sublanguage), resulting in a "Spanish {es}" entry.

Besides, it's currently not clear how to actually proceed with
such dictionary situation when, for example, both 'es-ES' and 'es'
dictionaries are present and the 'es' dictionary apparently is
meant as base and contains entries the 'es-ES' does not or 'es-ES'
overrides entries. It might be it's handled half-way in
linguistics, but maybe not even that, I didn't investigate.

Change-Id: Id859731ba5efa65d4a6de429b7f52027aa69327c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145093
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 375630ae76f46c096421dfadee8d37b406bc10c5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145114

diff --git a/i18nlangtag/source/isolang/isolang.cxx 
b/i18nlangtag/source/isolang/isolang.cxx
index c5259a53886d..2bd6b5e5e229 100644
--- a/i18nlangtag/source/isolang/isolang.cxx
+++ b/i18nlangtag/source/isolang/isolang.cxx
@@ -273,7 +273,6 @@ IsoLanguageCountryEntry const aImplIsoLangEntries[] =
 { LANGUAGE_SPANISH_NICARAGUA,   "es", "NI", k0},
 { LANGUAGE_SPANISH_PUERTO_RICO, "es", "PR", k0},
 { LANGUAGE_SPANISH_UNITED_STATES,   "es", "US", k0},
-{ LANGUAGE_SPANISH_LATIN_AMERICA,   "es", ""  , k0},
 { LANGUAGE_TURKISH, "tr", "TR", k0},
 { LANGUAGE_UKRAINIAN,   "uk", "UA", k0},
 { LANGUAGE_VIETNAMESE,  "vi", "VN", k0},
@@ -791,6 +790,8 @@ Bcp47CountryEntry const aImplBcp47CountryEntries[] =
 //  { LANGUAGE_YUE_CHINESE_HONGKONG, "zh-yue-HK", "HK", "", 0 },   // 
MS reserved, prefer yue-HK; do not add unless LanguageTag::simpleExtract() can 
handle it to not call liblangtag for rsc!
 { LANGUAGE_YIDDISH,  "yi-001",   "", "", k0 },  // 
MS since rev.15, was "yi-Hebr" reserved, "001"="World"
 { LANGUAGE_FRENCH_WEST_INDIES,   "fr-029",   "", "", k0 },  // 
MS since rev.15, was "Neither defined nor reserved", "029"="Caribbean"
+{ LANGUAGE_SPANISH_LATIN_AMERICA,"es-419",   "", "", k0 },  // 
MS reserved since rev.15, "419"="Latin America and the Caribbean"
+{ LANGUAGE_OBSOLETE_USER_SPANISH_LATIN_AMERICA, "es-419", "", "", 
LANGUAGE_SPANISH_LATIN_AMERICA },
 { LANGUAGE_USER_INTERSLAVIC_LATIN, "art-Latn-x-interslv", "", "", k0 },  
// see discussion in tdf#145853
 { LANGUAGE_USER_INTERSLAVIC_CYRILLIC, "art-Cyrl-x-interslv", "", "", k0 },
 { LANGUAGE_DONTKNOW,"", "", "", k0 }// marks end 
of table
diff --git a/i18nlangtag/source/isolang/mslangid.cxx 
b/i18nlangtag/source/isolang/mslangid.cxx
index 4e446d568858..cac12347fc54 100644
--- a/i18nlangtag/source/isolang/mslangid.cxx
+++ b/i18nlangtag/source/isolang/mslangid.cxx
@@ -567,6 +567,8 @@ LanguageType MsLangId::getReplacementForObsoleteLanguage( 
LanguageType nLang )
 nLang = LANGUAGE_KURDISH_ARABIC_IRAQ;
 else if (nLang == LANGUAGE_OBSOLETE_USER_SPANISH_CUBA)
 nLang = LANGUAGE_SPANISH_CUBA;
+else if (nLang == LANGUAGE_OBSOLETE_USER_SPANISH_LATIN_AMERICA)
+nLang = LANGUAGE_SPANISH_LATIN_AMERICA;
 
 // The following are not strictly obsolete but should be mapped to a
 // replacement locale when encountered.
diff --git a/include/i18nlangtag/lang.h b/include/i18nlangtag/lang.h
index 158a7c7fe5be..59e20669cddd 100644
--- a/include/i18nlangtag/lang.h
+++ b/include/i18nlangtag/lang.h
@@ -389,7 +389,6 @@ namespace o3tl
 #define LANGUAGE_SPANISH_EL_SALVADORLanguageType(0x440A)
 #define LANGUAGE_SPANISH_GUATEMALA  LanguageType(0x100A)
 #define LANGUAGE_SPANISH_HONDURAS   LanguageType(0x480A)
-#define LANGUAGE_SPANISH_LATIN_AMERICA  LanguageType(0xE40A)  /* no locale 
possible */
 #define LANGUAGE_SPANISH_MEXICAN 

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

2023-01-06 Thread Vasily Melenchuk (via logerrit)
 sw/qa/extras/rtfexport/data/tdf152784_1.rtf |   20 
 sw/qa/extras/rtfexport/rtfexport3.cxx   |9 +
 writerfilter/source/rtftok/rtfsprm.cxx  |4 ++--
 3 files changed, 31 insertions(+), 2 deletions(-)

New commits:
commit e8d18b471ea5063bc0b2c94afc1b94017e8e66bc
Author: Vasily Melenchuk 
AuthorDate: Tue Dec 27 15:31:37 2022 +0300
Commit: Miklos Vajna 
CommitDate: Fri Jan 6 14:47:23 2023 +

tdf#152784: RTF import: more default paragraph params

If numbering is not explicitly mentioned in para properties
it should not be used from referred paragraph style. So
default value of 0 (no numbering) is used by default.

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

diff --git a/sw/qa/extras/rtfexport/data/tdf152784_1.rtf 
b/sw/qa/extras/rtfexport/data/tdf152784_1.rtf
new file mode 100644
index ..19dcaa36e4df
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf152784_1.rtf
@@ -0,0 +1,20 @@
+{\rtf1
+
+{\stylesheet
+{\s3 \ls1\outlinelevel2  heading 3;}}
+{\*\listtable
+{\list\listtemplateid-374154644
+{\listlevel{\leveltext\'02\'00.;}{\levelnumbers\'01;}}
+{\listlevel{\leveltext\'02\'01.;}{\levelnumbers\'01;}}
+{\listlevel{\leveltext\'02\'02.;}{\levelnumbers\'01;}}
+{\listname ;}\listid773479173}
+}
+{\*\listoverridetable
+{\listoverride\listid773479173\listoverridecount0\ls1}
+}
+
+\pard\s3 Here should be no numbering!
+\par
+
+}
+
diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx 
b/sw/qa/extras/rtfexport/rtfexport3.cxx
index 6c1a4d524b7f..f12ab74bef59 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -523,6 +523,15 @@ DECLARE_RTFEXPORT_TEST(testInvalidParagraphStyle, 
"invalidParagraphStyle.rtf")
 CPPUNIT_ASSERT_EQUAL(style::NumberingType::ARABIC, numFormat);
 }
 
+DECLARE_RTFEXPORT_TEST(testTdf152784_1, "tdf152784_1.rtf")
+{
+// Ensure that paragraph having style with numbering does not have 
numbering
+// since it is not explitly defined in paragraph properties
+uno::Reference xPara(getParagraph(1, "Here should be 
no numbering!"),
+  uno::UNO_QUERY);
+CPPUNIT_ASSERT(getProperty(xPara, 
"NumberingStyleName").isEmpty());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfsprm.cxx 
b/writerfilter/source/rtftok/rtfsprm.cxx
index 90bc97001d27..7a3e4d454687 100644
--- a/writerfilter/source/rtftok/rtfsprm.cxx
+++ b/writerfilter/source/rtftok/rtfsprm.cxx
@@ -192,13 +192,13 @@ static RTFValue::Pointer_t getDefaultSPRM(Id const id, Id 
nStyleType)
 case NS_ooxml::LN_CT_Ind_right:
 case NS_ooxml::LN_CT_Ind_firstLine:
 return new RTFValue(0);
-
 case NS_ooxml::LN_CT_Spacing_lineRule:
 return new 
RTFValue(NS_ooxml::LN_Value_doc_ST_LineSpacingRule_auto);
 case NS_ooxml::LN_CT_Spacing_line:
 // presumably this means 100%, cf. static const int 
nSingleLineSpacing = 240;
 return new RTFValue(240);
-
+case NS_ooxml::LN_CT_NumPr_numId:
+return new RTFValue(0);
 case NS_ooxml::LN_CT_PrBase_pBdr:
 { // tdf#150382 default all paragraph borders to none
 RTFSprms attributes;


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

2023-01-06 Thread Caolán McNamara (via logerrit)
 vcl/headless/CairoCommon.cxx|   14 
 vcl/headless/SvpGraphicsBackend.cxx |   16 -
 vcl/inc/headless/CairoCommon.hxx|6 
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx |   10 
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx |4 
 vcl/unx/generic/gdi/gdiimpl.cxx |  351 
 vcl/unx/generic/gdi/gdiimpl.hxx |   17 -
 7 files changed, 36 insertions(+), 382 deletions(-)

New commits:
commit 498f0208f55a5b9ce8a130c940ddfcb9c36d6ff9
Author: Caolán McNamara 
AuthorDate: Fri Jan 6 09:04:41 2023 +
Commit: Caolán McNamara 
CommitDate: Fri Jan 6 14:49:31 2023 +

move drawPolyLine into CairoCommon and reuse from X11CairoSalGraphicsImpl

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

diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx
index 0779cb65c564..b0c7b505f7cc 100644
--- a/vcl/headless/CairoCommon.cxx
+++ b/vcl/headless/CairoCommon.cxx
@@ -791,6 +791,20 @@ bool CairoCommon::drawPolyPolygon(cairo_t* cr, 
basegfx::B2DRange* pExtents,
 return true;
 }
 
+void CairoCommon::drawPolyLine(cairo_t* cr, basegfx::B2DRange* pExtents, const 
Color& rLineColor,
+   bool bAntiAlias, sal_uInt32 nPoints, const 
Point* pPtAry)
+{
+basegfx::B2DPolygon aPoly;
+aPoly.append(basegfx::B2DPoint(pPtAry->getX(), pPtAry->getY()), nPoints);
+for (sal_uInt32 i = 1; i < nPoints; ++i)
+aPoly.setB2DPoint(i, basegfx::B2DPoint(pPtAry[i].getX(), 
pPtAry[i].getY()));
+aPoly.setClosed(false);
+
+drawPolyLine(cr, pExtents, rLineColor, bAntiAlias, 
basegfx::B2DHomMatrix(), aPoly, 0.0, 1.0,
+ nullptr, basegfx::B2DLineJoin::Miter, 
css::drawing::LineCap_BUTT,
+ basegfx::deg2rad(15.0) /*default*/, false);
+}
+
 bool CairoCommon::drawPolyLine(cairo_t* cr, basegfx::B2DRange* pExtents, const 
Color& rLineColor,
bool bAntiAlias, const basegfx::B2DHomMatrix& 
rObjectToDevice,
const basegfx::B2DPolygon& rPolyLine, double 
fTransparency,
diff --git a/vcl/headless/SvpGraphicsBackend.cxx 
b/vcl/headless/SvpGraphicsBackend.cxx
index bf79416d88b7..134c9fc221e0 100644
--- a/vcl/headless/SvpGraphicsBackend.cxx
+++ b/vcl/headless/SvpGraphicsBackend.cxx
@@ -209,16 +209,14 @@ void SvpGraphicsBackend::implDrawRect(double nX, double 
nY, double nWidth, doubl
 
 void SvpGraphicsBackend::drawPolyLine(sal_uInt32 nPoints, const Point* pPtAry)
 {
-basegfx::B2DPolygon aPoly;
-aPoly.append(basegfx::B2DPoint(pPtAry->getX(), pPtAry->getY()), nPoints);
-for (sal_uInt32 i = 1; i < nPoints; ++i)
-aPoly.setB2DPoint(i, basegfx::B2DPoint(pPtAry[i].getX(), 
pPtAry[i].getY()));
-aPoly.setClosed(false);
+cairo_t* cr = m_rCairoCommon.getCairoContext(false, getAntiAlias());
+basegfx::B2DRange aExtents;
+m_rCairoCommon.clipRegion(cr);
 
-drawPolyLine(basegfx::B2DHomMatrix(), aPoly, 0.0, 1.0,
- nullptr, // MM01
- basegfx::B2DLineJoin::Miter, css::drawing::LineCap_BUTT,
- basegfx::deg2rad(15.0) /*default*/, false);
+CairoCommon::drawPolyLine(cr, &aExtents, *m_rCairoCommon.m_oLineColor, 
getAntiAlias(), nPoints,
+  pPtAry);
+
+m_rCairoCommon.releaseCairoContext(cr, false, aExtents);
 }
 
 void SvpGraphicsBackend::drawPolygon(sal_uInt32 nPoints, const Point* pPtAry)
diff --git a/vcl/inc/headless/CairoCommon.hxx b/vcl/inc/headless/CairoCommon.hxx
index 7489ecaad969..75aec44a4ec7 100644
--- a/vcl/inc/headless/CairoCommon.hxx
+++ b/vcl/inc/headless/CairoCommon.hxx
@@ -173,9 +173,9 @@ struct VCL_DLLPUBLIC CairoCommon
 const basegfx::B2DHomMatrix& rObjectToDevice,
 const basegfx::B2DPolyPolygon&, double 
fTransparency);
 
-// need this static version of ::drawPolyLine for usage from
-// vcl/unx/generic/gdi/salgdi.cxx. It gets wrapped by
-// ::drawPolyLine with some added parameters (see there)
+static void drawPolyLine(cairo_t* cr, basegfx::B2DRange* pExtents, const 
Color& rLineColor,
+ bool bAntiAlias, sal_uInt32 nPoints, const Point* 
pPtAry);
+
 static bool drawPolyLine(cairo_t* cr, basegfx::B2DRange* pExtents, const 
Color& rLineColor,
  bool bAntiAlias, const basegfx::B2DHomMatrix& 
rObjectToDevice,
  const basegfx::B2DPolygon& rPolyLine, double 
fTransparency,
diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx 
b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
index 60cbf1230400..b1afbc25350f 100644
--- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
+++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
@@ -93,6 +93,16 @@ void X11CairoSalGraphicsImpl::drawLine(

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/qa sw/sdi sw/source

2023-01-06 Thread Miklos Vajna (via logerrit)
 sw/qa/uibase/shells/shells.cxx |   62 +
 sw/sdi/swriter.sdi |2 
 sw/source/uibase/shells/basesh.cxx |  109 +
 3 files changed, 172 insertions(+), 1 deletion(-)

New commits:
commit 87add1240a011b05f7501b902ae4edfa8fbe7367
Author: Miklos Vajna 
AuthorDate: Wed Jan 4 08:56:04 2023 +0100
Commit: Miklos Vajna 
CommitDate: Fri Jan 6 14:55:50 2023 +

sw, UpdateFields: add new TypeName, NamePrefix and Fields parameters

Currently the .uno:InsertField command allows inserting a refmark with a
provided name & content, but existing refmarks can't be updated
similarly. This is a problem in case Zotero citations are to be modeled
with refmarks.

Another trouble is that refmarks don't have dummy characters and have to
stay inside a single paragraph, so we need to be careful to replace the
content in a way that keeps the refmark alive, a naive delete + insert
will delete the refmark as well.

Fix the problem by extending the existing .uno:UpdateFields command with
3 new optional parameters, somewhat similar to what commit
724180ec495a696c79332653cb6fb52ecfbccc29 (sw: add a new
.uno:UpdateBookmarks UNO command, 2022-12-14) did.

As usual, the provided new text is meant to be HTML, which allows
formatted content.

(cherry picked from commit babba472391d26aed68d7ac31c7a918c08e65256)

Also contains:

sw update of refmarks: fix handling of ignored refmarks

As pointed out at

,
it's not correct that UpdateFieldConents() uses a single index into both
the provided fields/refmarks array and into the document's all refmarks
array.

We need a new index that counts the input fields/refmarks we got and
which is not incremented for ignored refmarks.

Extend the testcase to have 2 paragraphs in the document: the first
paragraph has a refmark that is to be ignored and the second para has a
refmark that is interesting to us. This makes the test fail.

Then fix up UpdateFieldConents() to properly count how we iterate
through all refmarks and the provided refmarks in parallel.

(cherry picked from commit 471804e251b4e15b37a10920bd4b88b40f97b227)

Conflicts:
sw/qa/uibase/shells/shells.cxx

Also contains:

sw: UpdateFieldContents: fix typos

- The function name itself had a typo, spotted at
  
.

- Also, if the # of provided fields and # of fields we find in the
  document don't match, we can give up, so no need to continue, the same
  condition would fail again, anyway.

(cherry picked from commit f83c1353b94fc7dec79d05ac45c11f40f497261d)

Change-Id: Ib0951aa1a39e1b47bcf8b47bc9d65c89e0853e96
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145036
Tested-by: Miklos Vajna 
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx
index 88324d12327e..ced0157284ae 100644
--- a/sw/qa/uibase/shells/shells.cxx
+++ b/sw/qa/uibase/shells/shells.cxx
@@ -469,6 +469,68 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, 
testInsertFieldmarkReadonly)
 CPPUNIT_ASSERT_EQUAL(static_cast(1), nActual);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testUpdateRefmarks)
+{
+// Given a document with two refmarks, one is not interesting the other is 
a citation:
+SwDoc* pDoc = createSwDoc();
+uno::Sequence aArgs = {
+comphelper::makePropertyValue("TypeName", 
uno::Any(OUString("SetRef"))),
+comphelper::makePropertyValue("Name", uno::Any(OUString("some other 
old refmark"))),
+comphelper::makePropertyValue("Content", uno::Any(OUString("some other 
old content"))),
+};
+dispatchCommand(mxComponent, ".uno:InsertField", aArgs);
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+pWrtShell->SttEndDoc(/*bStt=*/false);
+pWrtShell->SplitNode();
+pWrtShell->SttEndDoc(/*bStt=*/false);
+aArgs = {
+comphelper::makePropertyValue("TypeName", 
uno::Any(OUString("SetRef"))),
+comphelper::makePropertyValue(
+"Name", uno::Any(OUString("ZOTERO_ITEM CSL_CITATION {} old 
refmark"))),
+comphelper::makePropertyValue("Content", uno::Any(OUString("old 
content"))),
+};
+dispatchCommand(mxComponent, ".uno:InsertField", aArgs);
+
+// When updating that refmark:
+std::vector aArgsVec = 
comphelper::JsonToPropertyValues(R"json(
+{
+"TypeName": {
+"type": "string",
+"value": "SetRef"
+},
+"NamePrefix": {
+"type": "string",
+"value": "ZOTERO_ITEM CSL_CITATION"
+},
+"Fields": {
+"type": "[

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/qa sw/source

2023-01-06 Thread offtkp (via logerrit)
 sw/qa/uibase/wrtsh/wrtsh.cxx  |7 +++
 sw/source/core/txtnode/attrcontentcontrol.cxx |1 -
 sw/source/uibase/wrtsh/wrtsh1.cxx |   14 ++
 sw/source/uibase/wrtsh/wrtsh3.cxx |4 
 4 files changed, 21 insertions(+), 5 deletions(-)

New commits:
commit 06ff1602842197f045f953fd49e441f8f058d094
Author: offtkp 
AuthorDate: Mon Dec 12 13:03:43 2022 +0200
Commit: Tomaž Vajngerl 
CommitDate: Fri Jan 6 14:59:23 2023 +

docx: Do not remove showingPlcHdr until edit

When a placeholder has the showingPlcHdr attribute, the entire text is
selected upon click. This is no longer removed by selecting it once but
once the text has been edited.

Change-Id: I9a4d68289c8b95ab0098e55a5fa6edb1606c7df2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143985
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit 618cef756b87f9816d0dcbe04af163ccd06a986e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144307
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 

diff --git a/sw/qa/uibase/wrtsh/wrtsh.cxx b/sw/qa/uibase/wrtsh/wrtsh.cxx
index cbc31237d893..43fb355fa59b 100644
--- a/sw/qa/uibase/wrtsh/wrtsh.cxx
+++ b/sw/qa/uibase/wrtsh/wrtsh.cxx
@@ -387,6 +387,13 @@ CPPUNIT_TEST_FIXTURE(Test, 
testInsertPlainTextContentControl)
 // Without the accompanying fix in place, this test would have failed, 
there was no special
 // handling for plain text content controls.
 CPPUNIT_ASSERT(pContentControl->GetPlainText());
+
+CPPUNIT_ASSERT(pContentControl->GetShowingPlaceHolder());
+pWrtShell->GotoContentControl(rFormatContentControl);
+CPPUNIT_ASSERT(pContentControl->GetShowingPlaceHolder());
+pWrtShell->Insert("Foo");
+// No longer showing placeholder text, as it has been changed
+CPPUNIT_ASSERT(!pContentControl->GetShowingPlaceHolder());
 }
 
 CPPUNIT_TEST_FIXTURE(Test, testInsertComboBoxContentControl)
diff --git a/sw/source/core/txtnode/attrcontentcontrol.cxx 
b/sw/source/core/txtnode/attrcontentcontrol.cxx
index d324f52513a5..a54d4ef83429 100644
--- a/sw/source/core/txtnode/attrcontentcontrol.cxx
+++ b/sw/source/core/txtnode/attrcontentcontrol.cxx
@@ -754,7 +754,6 @@ void SwTextContentControl::Invalidate()
 pDocShell->GetWrtShell()->Push();
 
 // visit the control in the text (which makes any necessary visual changes)
-// NOTE: simply going to a control indicates cancelling 
ShowingPlaceHolder, unless bOnlyRefresh
 // NOTE: simply going to a checkbox causes a toggle, unless bOnlyRefresh
 auto& rFormatContentControl = 
static_cast(GetAttr());
 pDocShell->GetWrtShell()->GotoContentControl(rFormatContentControl, 
/*bOnlyRefresh=*/true);
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx 
b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 4983bb3dc30f..c0112556e9d9 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -116,6 +116,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace sw::mark;
 using namespace com::sun::star;
@@ -261,6 +262,19 @@ void SwWrtShell::Insert( const OUString &rStr )
 bCallIns ?
 SwEditShell::Insert2( rStr, bDeleted ) : SwEditShell::Overwrite( rStr 
);
 
+// Check whether node is content control
+SwTextContentControl* pTextContentControl = CursorInsideContentControl();
+if (pTextContentControl)
+{
+std::shared_ptr pContentControl =
+pTextContentControl->GetContentControl().GetContentControl();
+if (pContentControl)
+{
+// Set showingPlcHdr to false as node has been edited
+pContentControl->SetShowingPlaceHolder(false);
+}
+}
+
 if( bStarted )
 {
 EndUndo();
diff --git a/sw/source/uibase/wrtsh/wrtsh3.cxx 
b/sw/source/uibase/wrtsh/wrtsh3.cxx
index aa170d1374a4..4e80bfc1e3d1 100644
--- a/sw/source/uibase/wrtsh/wrtsh3.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh3.cxx
@@ -125,10 +125,6 @@ bool SwWrtShell::GotoContentControl(const 
SwFormatContentControl& rContentContro
 (this->*m_fnKillSel)(nullptr, false);
 
 bool bRet = SwCursorShell::GotoFormatContentControl(rContentControl);
-// Assume that once the placeholder is selected, the content is no longer 
the placeholder.
-if (!bOnlyRefresh && pContentControl)
-pContentControl->SetShowingPlaceHolder(false);
-
 
 if (bRet && pContentControl && pContentControl->GetCheckbox())
 {


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

2023-01-06 Thread Justin Luth (via logerrit)
 i18npool/source/localedata/data/locale.dtd |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 6cabd7d9bfed37799a344f872d5f8fcf3214116a
Author: Justin Luth 
AuthorDate: Fri Jan 6 09:03:20 2023 -0500
Commit: Eike Rathke 
CommitDate: Fri Jan 6 15:14:59 2023 +

tdf#56258 i18npool: add "adjust" to locale.dtd for outline numbering

Although Adjust was already defined in all of the code structures,
it was not defined in the dtd file.
Thanks to Eike for pointing out this requirement.

Change-Id: I43ed0c26ed5bccb2309a255db79f5afa32f78c38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145146
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Eike Rathke 

diff --git a/i18npool/source/localedata/data/locale.dtd 
b/i18npool/source/localedata/data/locale.dtd
index f713ccf6d8b4..a867215421bc 100644
--- a/i18npool/source/localedata/data/locale.dtd
+++ b/i18npool/source/localedata/data/locale.dtd
@@ -681,5 +681,6 @@
 
 
 
+
 
 


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

2023-01-06 Thread Armin Le Grand (Allotropia) (via logerrit)
 drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx  |  596 +++
 include/drawinglayer/processor2d/d2dpixelprocessor2d.hxx |   21 
 2 files changed, 320 insertions(+), 297 deletions(-)

New commits:
commit 7e07225a1b48f3f987a818213256d3cbb9266d87
Author: Armin Le Grand (Allotropia) 
AuthorDate: Fri Jan 6 12:16:10 2023 +0100
Commit: Armin Le Grand 
CommitDate: Fri Jan 6 15:24:39 2023 +

SDPR: Overhauled D2DRenderer to use sal::systools::COMReference

All stuff used from MS with names starting with ID2D1* is COM
API stuff, so referenced and interface-based. I thought about
making this more safe since a while (shared/unique_ptr, ...)
but found no good way to do it.
Also did not want to use CComPtr from MS and expand the devenv
we need on win, so was short before doing an own small smartptr
class. Luckily I asked sberg and he pointed me to the already
existing sal::systools::COMReference which exactly does what
I need here - thanks!
Unluckily I now had to change a lot of code - sigh. I wish
I had known earlier :-/
This change contains the renderer completely adapted to using
that much safer and better ressource control.
Plus I added (even more) comments to try to make more clear
in many plasces what's going on, what is done and why.

Change-Id: Ia2aa3223d0e5f7ec6569cde176cec1fadcd921dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145142
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
index 2ed7ea526959..04c6b400039b 100644
--- a/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
@@ -56,51 +56,44 @@ using namespace com::sun::star;
 
 namespace
 {
-class ID2D1FactoryProvider
+class ID2D1GlobalFactoryProvider
 {
-ID2D1Factory* mpD2DFactory;
+sal::systools::COMReference mpD2DFactory;
 
 public:
-ID2D1FactoryProvider()
+ID2D1GlobalFactoryProvider()
 : mpD2DFactory(nullptr)
 {
-HRESULT hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, 
__uuidof(ID2D1Factory),
-   nullptr, 
reinterpret_cast(&mpD2DFactory));
+const HRESULT hr(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED,
+   __uuidof(ID2D1Factory), nullptr,
+   
reinterpret_cast(&mpD2DFactory)));
 
 if (!SUCCEEDED(hr))
-mpD2DFactory = nullptr;
+mpD2DFactory.clear();
 }
 
-~ID2D1FactoryProvider()
-{
-if (mpD2DFactory)
-mpD2DFactory->Release();
-}
+~ID2D1GlobalFactoryProvider() {}
 
-ID2D1Factory* getID2D1Factory() const { return mpD2DFactory; }
+sal::systools::COMReference& getID2D1Factory() { return 
mpD2DFactory; }
 };
 
-ID2D1FactoryProvider aID2D1FactoryProvider;
+ID2D1GlobalFactoryProvider aID2D1GlobalFactoryProvider;
 
 class ID2D1GlobalRenderTargetProvider
 {
-ID2D1DCRenderTarget* mpID2D1DCRenderTarget;
+sal::systools::COMReference mpID2D1DCRenderTarget;
 
 public:
 ID2D1GlobalRenderTargetProvider()
-: mpID2D1DCRenderTarget(nullptr)
+: mpID2D1DCRenderTarget()
 {
 }
 
-~ID2D1GlobalRenderTargetProvider()
-{
-if (mpID2D1DCRenderTarget)
-mpID2D1DCRenderTarget->Release();
-}
+~ID2D1GlobalRenderTargetProvider() {}
 
-ID2D1DCRenderTarget* getID2D1DCRenderTarget() const
+sal::systools::COMReference& getID2D1DCRenderTarget()
 {
-if (nullptr == mpID2D1DCRenderTarget && 
aID2D1FactoryProvider.getID2D1Factory())
+if (!mpID2D1DCRenderTarget && 
aID2D1GlobalFactoryProvider.getID2D1Factory())
 {
 const D2D1_RENDER_TARGET_PROPERTIES 
aRTProps(D2D1::RenderTargetProperties(
 D2D1_RENDER_TARGET_TYPE_DEFAULT,
@@ -108,9 +101,8 @@ public:
   D2D1_ALPHA_MODE_IGNORE), 
//D2D1_ALPHA_MODE_PREMULTIPLIED),
 0, 0, D2D1_RENDER_TARGET_USAGE_NONE, 
D2D1_FEATURE_LEVEL_DEFAULT));
 
-const HRESULT 
hr(aID2D1FactoryProvider.getID2D1Factory()->CreateDCRenderTarget(
-&aRTProps,
-
&(const_cast(this)->mpID2D1DCRenderTarget)));
+const HRESULT 
hr(aID2D1GlobalFactoryProvider.getID2D1Factory()->CreateDCRenderTarget(
+&aRTProps, &mpID2D1DCRenderTarget));
 
 // interestingly this ID2D1DCRenderTarget already works and can 
hold
 // created ID2D1Bitmap(s) in RenderTarget-specific form, *without*
@@ -119,7 +111,7 @@ public:
 // to have a HDC that is valid during LO's lifetime.
 
 if (!SUCCEEDED(hr))
-
const_cast(this)->mpID2D1DCRenderTarget = 
nullptr;
+mpID2D1DCRenderTarget.clear();
 }
 
 return mpI

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

2023-01-06 Thread Caolán McNamara (via logerrit)
 vcl/headless/CairoCommon.cxx|   14 
 vcl/headless/SvpGraphicsBackend.cxx |   12 ++--
 vcl/inc/headless/CairoCommon.hxx|5 +
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx |   10 +++
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx |2 
 vcl/unx/generic/gdi/gdiimpl.cxx |   72 
 vcl/unx/generic/gdi/gdiimpl.hxx |3 -
 7 files changed, 38 insertions(+), 80 deletions(-)

New commits:
commit a6fe91f6e3ddbad65e534907d29243b138258f6c
Author: Caolán McNamara 
AuthorDate: Fri Jan 6 09:16:33 2023 +
Commit: Caolán McNamara 
CommitDate: Fri Jan 6 16:36:23 2023 +

move drawPolygon into CairoCommon and reuse from X11CairoSalGraphicsImpl

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

diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx
index b0c7b505f7cc..56293738d508 100644
--- a/vcl/headless/CairoCommon.cxx
+++ b/vcl/headless/CairoCommon.cxx
@@ -687,6 +687,20 @@ void CairoCommon::drawLine(cairo_t* cr, basegfx::B2DRange* 
pExtents, const Color
 cairo_stroke(cr);
 }
 
+void CairoCommon::drawPolygon(cairo_t* cr, basegfx::B2DRange* pExtents,
+  const std::optional& rLineColor,
+  const std::optional& rFillColor, bool 
bAntiAlias,
+  sal_uInt32 nPoints, const Point* pPtAry)
+{
+basegfx::B2DPolygon aPoly;
+aPoly.append(basegfx::B2DPoint(pPtAry->getX(), pPtAry->getY()), nPoints);
+for (sal_uInt32 i = 1; i < nPoints; ++i)
+aPoly.setB2DPoint(i, basegfx::B2DPoint(pPtAry[i].getX(), 
pPtAry[i].getY()));
+
+drawPolyPolygon(cr, pExtents, rLineColor, rFillColor, bAntiAlias, 
basegfx::B2DHomMatrix(),
+basegfx::B2DPolyPolygon(aPoly), 0.0);
+}
+
 void CairoCommon::drawPolyPolygon(cairo_t* cr, basegfx::B2DRange* pExtents,
   const std::optional& rLineColor,
   const std::optional& rFillColor, bool 
bAntiAlias,
diff --git a/vcl/headless/SvpGraphicsBackend.cxx 
b/vcl/headless/SvpGraphicsBackend.cxx
index 134c9fc221e0..87a5a14debd8 100644
--- a/vcl/headless/SvpGraphicsBackend.cxx
+++ b/vcl/headless/SvpGraphicsBackend.cxx
@@ -221,12 +221,14 @@ void SvpGraphicsBackend::drawPolyLine(sal_uInt32 nPoints, 
const Point* pPtAry)
 
 void SvpGraphicsBackend::drawPolygon(sal_uInt32 nPoints, const Point* pPtAry)
 {
-basegfx::B2DPolygon aPoly;
-aPoly.append(basegfx::B2DPoint(pPtAry->getX(), pPtAry->getY()), nPoints);
-for (sal_uInt32 i = 1; i < nPoints; ++i)
-aPoly.setB2DPoint(i, basegfx::B2DPoint(pPtAry[i].getX(), 
pPtAry[i].getY()));
+cairo_t* cr = m_rCairoCommon.getCairoContext(true, getAntiAlias());
+basegfx::B2DRange extents;
+m_rCairoCommon.clipRegion(cr);
 
-drawPolyPolygon(basegfx::B2DHomMatrix(), basegfx::B2DPolyPolygon(aPoly), 
0.0);
+CairoCommon::drawPolygon(cr, &extents, m_rCairoCommon.m_oLineColor, 
m_rCairoCommon.m_oFillColor,
+ getAntiAlias(), nPoints, pPtAry);
+
+m_rCairoCommon.releaseCairoContext(cr, true, extents);
 }
 
 void SvpGraphicsBackend::drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32* 
pPointCounts,
diff --git a/vcl/inc/headless/CairoCommon.hxx b/vcl/inc/headless/CairoCommon.hxx
index 75aec44a4ec7..73a00c54e7e0 100644
--- a/vcl/inc/headless/CairoCommon.hxx
+++ b/vcl/inc/headless/CairoCommon.hxx
@@ -162,6 +162,11 @@ struct VCL_DLLPUBLIC CairoCommon
  bool bAntiAlias, tools::Long nX1, tools::Long nY1, 
tools::Long nX2,
  tools::Long nY2);
 
+static void drawPolygon(cairo_t* cr, basegfx::B2DRange* pExtents,
+const std::optional& rLineColor,
+const std::optional& rFillColor, bool 
bAntiAlias,
+sal_uInt32 nPoints, const Point* pPtAry);
+
 static void drawPolyPolygon(cairo_t* cr, basegfx::B2DRange* pExtents,
 const std::optional& rLineColor,
 const std::optional& rFillColor, bool 
bAntiAlias,
diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx 
b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
index b1afbc25350f..1f900d91b688 100644
--- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
+++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
@@ -30,6 +30,16 @@ 
X11CairoSalGraphicsImpl::X11CairoSalGraphicsImpl(X11SalGraphics& rParent, X11Com
 {
 }
 
+void X11CairoSalGraphicsImpl::drawPolygon(sal_uInt32 nPoints, const Point* 
pPtAry)
+{
+cairo_t* cr = mrX11Common.getCairoContext(mrParent.GetGeometryProvider());
+clipRegion(cr);
+
+CairoCommon::drawPolygon(cr, nullptr, moPenColor, moFillColor, 
getAntiAlias(), nPoints, pPtAry);
+
+X11Common::releaseCairoCont

Re: Request for [API CHANGE] in spell checking: add new options to disable rule-based compounding

2023-01-06 Thread Németh László
Hi Stephan, Hi All,

Stephan Bergmann  ezt írta (időpont: 2023. jan. 5.,
Cs, 10:32):

> On 04/01/2023 14:18, Németh László wrote:
> > I've started to add two new spell checking options to
> > css.linguistic2.XLinguProperties
> [...]
> > Commit:
> https://git.libreoffice.org/core/+/57d79744c77eef96b4c2bd3b16e0a04317ffcf9e%5E%21
> <
> https://git.libreoffice.org/core/+/57d79744c77eef96b4c2bd3b16e0a04317ffcf9e%5E%21
> >
>
> So this is about the addition of
>
> > /** defines whether spell checking should be accept rule-based
> >  closed compounding of dictionary words.
> >
> > @since LibreOffice 7.6
> > */
> > [attribute] boolean IsSpellClosedCompound;
> >
> > /** defines whether spell checking should be accept rule-based
> >  hyphenated compounding of dictionary words.
> >
> > @since LibreOffice 7.6
> > */
> > [attribute] boolean IsSpellHyphenatedCompound;
>
> to the published interface css.linguistic2.XLinguProperties in
> <
> https://git.libreoffice.org/core/+/57d79744c77eef96b4c2bd3b16e0a04317ffcf9e%5E%21>
>
> "tdf#136306 offapi linguistic: add options to disable rule-based
> compounding", which is an ABI-breaking change.
>
> But looking closer, when
> <
> https://git.libreoffice.org/core/+/ef0af5032ad283ffb3b4521eb097a118d58f332a%5E!/>
>
> "fdo#46808, Convert linguistic2::LingProperties to new style" introduced
> that css.linguistic2.XLinguProperties interface, it gave it various
> interface attributes (IsUseDictionaryList, IsIgnoreControlCharacters,
> IsSpellUpperCase, etc.) for no compelling reason:  XLinguProperties is
> meant to be the implementation interface of the service LinguProperties,
> which was changed by that commit from an old-style to a new-style
> service.  The original old-style service implemented XPropertySet and
> listed a number of supported properties.  The XLinguProperties interface
> also inherits from XPropertySet, and that should arguably have been all
> that is necessary to make LinguProperties a new-style service.  But that
> commit also added (some of) the properties of the old-style
> LinguProperties service as attributes to XLinguProperties, for no
> compelling reason.  All those entities should be available through the
> XPropertySet interface, so there is no need to also have them available
> through attribute getters and setters.
>
> Thus I would suggest to:
>
> * Revert the addition of the two new attributes, instead adding
> documentation to offapi/com/sun/star/linguistic2/XLinguProperties.idl
> that those two properties are available through the XPropertySet
> interface since LibreOffice 7.6.
>
> * Optionally, also mark all the other attributes of XLinguProperties as
> deprecated, stating in the documentation that they should instead be
> accessed via the XPropertySet interface.
>

Ah, OK. So I only missed the proposed API. I'm going to make the proposed
changes.

Many thanks for the detailed description!

Best regards,
László


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

2023-01-06 Thread Julien Nabet (via logerrit)
 dbaccess/source/ui/misc/WCPage.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5effc24969e5f326ef094419631d14d4d3030ed6
Author: Julien Nabet 
AuthorDate: Fri Jan 6 17:11:47 2023 +0100
Commit: Julien Nabet 
CommitDate: Fri Jan 6 17:02:44 2023 +

tdf#152900: "Create new field as primary key" disabled...

when pasting data as new table

Regression from 3f8e50f9b2fb35db190ce0204981f3f02d1d5ae6 (05/2021)
"merge handlers into single toggle handler"

Change-Id: I05376f288c1687978225bd98da21a5e21810292a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145151
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/dbaccess/source/ui/misc/WCPage.cxx 
b/dbaccess/source/ui/misc/WCPage.cxx
index 738c85124708..602edd2d6e24 100644
--- a/dbaccess/source/ui/misc/WCPage.cxx
+++ b/dbaccess/source/ui/misc/WCPage.cxx
@@ -106,8 +106,8 @@ IMPL_LINK(OCopyTable, RadioChangeHdl, weld::Toggleable&, 
rButton, void)
 SetAppendDataRadio();
 return;
 }
-m_pParent->EnableNextButton(m_xRB_View->get_active());
-bool bKey = m_bPKeyAllowed && m_xRB_View->get_active();
+m_pParent->EnableNextButton(!m_xRB_View->get_active());
+bool bKey = m_bPKeyAllowed && !m_xRB_View->get_active();
 m_xFT_KeyName->set_sensitive(bKey && m_xCB_PrimaryColumn->get_active());
 m_xEdKeyName->set_sensitive(bKey && m_xCB_PrimaryColumn->get_active());
 m_xCB_PrimaryColumn->set_sensitive(bKey);


[Libreoffice-commits] core.git: sw/qa

2023-01-06 Thread Andrea Gelmini (via logerrit)
 sw/qa/extras/rtfexport/rtfexport3.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fba845287d1734dd0d4ce2e4a69800441a973b05
Author: Andrea Gelmini 
AuthorDate: Fri Jan 6 17:22:23 2023 +0100
Commit: Julien Nabet 
CommitDate: Fri Jan 6 17:08:53 2023 +

Fix typo

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

diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx 
b/sw/qa/extras/rtfexport/rtfexport3.cxx
index f12ab74bef59..55f5a0362174 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -526,7 +526,7 @@ DECLARE_RTFEXPORT_TEST(testInvalidParagraphStyle, 
"invalidParagraphStyle.rtf")
 DECLARE_RTFEXPORT_TEST(testTdf152784_1, "tdf152784_1.rtf")
 {
 // Ensure that paragraph having style with numbering does not have 
numbering
-// since it is not explitly defined in paragraph properties
+// since it is not explicitly defined in paragraph properties
 uno::Reference xPara(getParagraph(1, "Here should be 
no numbering!"),
   uno::UNO_QUERY);
 CPPUNIT_ASSERT(getProperty(xPara, 
"NumberingStyleName").isEmpty());


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

2023-01-06 Thread Andrea Gelmini (via logerrit)
 drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 2eefb695c0bfd00abd22e17e64ab2a1692fe2af4
Author: Andrea Gelmini 
AuthorDate: Fri Jan 6 17:22:05 2023 +0100
Commit: Julien Nabet 
CommitDate: Fri Jan 6 17:09:54 2023 +

Fix typos

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

diff --git a/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
index 04c6b400039b..3bced719902c 100644
--- a/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx
@@ -1127,7 +1127,7 @@ void D2DPixelProcessor2D::processTransparencePrimitive2D(
 }
 
 // try to create directly, this needs the current mpRT to be a 
ID2D1DeviceContext/d2d1_1
-// what is not guarenteed but usually works for more modern windows (after 
7)
+// what is not guaranteed but usually works for more modern windows (after 
7)
 sal::systools::COMReference pAlphaBitmap(
 implCreateAlpha_Direct(rTransCandidate, aVisibleRange));
 D2D1_MATRIX_3X2_F aMaskScale(D2D1::Matrix3x2F::Identity());
@@ -1818,10 +1818,10 @@ void D2DPixelProcessor2D::processBasePrimitive2D(const 
primitive2d::BasePrimitiv
 // Embedding/groups that *have* to be processed
 //
 // These represent qualifiers for freely defined content, e.g. making
-// any combinatiopn of priitives freely transformed or transparent
+// any combination of primitives freely transformed or transparent
 // NOTE: PRIMITIVE2D_ID_MODIFIEDCOLORPRIMITIVE2D and
 //   PRIMITIVE2D_ID_TRANSFORMPRIMITIVE2D are pretty much default-
-//   implementations that cand and are re-used in all processors.
+//   implementations that can and are re-used in all processors.
 // So - with these and PRIMITIVE2D_ID_INVERTPRIMITIVE2D marked to
 // be removed in the future - just three really to be implemented
 // locally specifically
@@ -1892,14 +1892,14 @@ void D2DPixelProcessor2D::processBasePrimitive2D(const 
primitive2d::BasePrimitiv
 case PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D:
 {
 // fat and stroked lines - much better doable locally, would 
decompose
-// to the full line geometry creation (tesselation)
+// to the full line geometry creation (tessellation)
 processPolygonStrokePrimitive2D(
 static_cast(rCandidate));
 break;
 }
 case PRIMITIVE2D_ID_LINERECTANGLEPRIMITIVE2D:
 {
-// simple primitve to support future fast callbacks from 
OutputDevice
+// simple primitive to support future fast callbacks from 
OutputDevice
 // (see 'Example POC' in Gerrit), decomposes to polygon primitive
 processLineRectanglePrimitive2D(
 static_cast(rCandidate));
@@ -1907,7 +1907,7 @@ void D2DPixelProcessor2D::processBasePrimitive2D(const 
primitive2d::BasePrimitiv
 }
 case PRIMITIVE2D_ID_FILLEDRECTANGLEPRIMITIVE2D:
 {
-// simple primitve to support future fast callbacks from 
OutputDevice
+// simple primitive to support future fast callbacks from 
OutputDevice
 // (see 'Example POC' in Gerrit), decomposes to filled polygon 
primitive
 processFilledRectanglePrimitive2D(
 static_cast(rCandidate));
@@ -1915,7 +1915,7 @@ void D2DPixelProcessor2D::processBasePrimitive2D(const 
primitive2d::BasePrimitiv
 }
 case PRIMITIVE2D_ID_SINGLELINEPRIMITIVE2D:
 {
-// simple primitve to support future fast callbacks from 
OutputDevice
+// simple primitive to support future fast callbacks from 
OutputDevice
 // (see 'Example POC' in Gerrit), decomposes to polygon primitive
 processSingleLinePrimitive2D(
 static_cast(rCandidate));


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

2023-01-06 Thread Regina Henschel (via logerrit)
 oox/qa/unit/data/tdf152896_WordArt_color_darken.docx |binary
 oox/qa/unit/shape.cxx|   21 +++
 oox/source/shape/WpsContext.cxx  |  106 ++-
 3 files changed, 79 insertions(+), 48 deletions(-)

New commits:
commit 81e6d47635656297cdddc9030f4422c0bcc203f9
Author: Regina Henschel 
AuthorDate: Fri Jan 6 16:02:31 2023 +0100
Commit: Regina Henschel 
CommitDate: Fri Jan 6 17:53:01 2023 +

tdf#152896 do not apply color shading twice

If a character theme color is shaded, Word writes this as w:themeShade
attribute of the w:color element. If the character also has
transparency, Word writes an additional w14:textFill element with
a w14:lumMod child element. In such cases the w14:textFill element
supersedes the w:color element.

The initial implementation of Fontwork import in commit
cbf30153a5c776e6d1ee26f2f83c8f77503eceb9 does it wrong. It replaces the
color itself but not the color transformation, so that the shading was
applied twice, once from w:themeShade attribute and the other time from
w14:lumMod.

The solution here is to reverse the order so that w:color is only
evaluated if w14:textFill is not present. Another solution would have
been to clear the color transformation vector before adding the values
from w14:textFill. I use reverse order here because it more clearly
reflects that w14:textFill supersedes w:color.

Change-Id: I3e700795167a34238ea619b9c4a691c10da357f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145150
Tested-by: Jenkins
Reviewed-by: Regina Henschel 

diff --git a/oox/qa/unit/data/tdf152896_WordArt_color_darken.docx 
b/oox/qa/unit/data/tdf152896_WordArt_color_darken.docx
new file mode 100644
index ..1f8f8e4e0edf
Binary files /dev/null and 
b/oox/qa/unit/data/tdf152896_WordArt_color_darken.docx differ
diff --git a/oox/qa/unit/shape.cxx b/oox/qa/unit/shape.cxx
index 89a6da6905d2..b03266b553f6 100644
--- a/oox/qa/unit/shape.cxx
+++ b/oox/qa/unit/shape.cxx
@@ -559,6 +559,27 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, 
testWriterShapeFillNonAccentColor)
 uno::Reference xShape3Props(xDrawPage->getByIndex(3), 
uno::UNO_QUERY);
 CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int16(2)), 
xShape3Props->getPropertyValue(u"FillColorTheme"));
 }
+
+CPPUNIT_TEST_FIXTURE(OoxShapeTest, testWriterFontworkDarkenTransparency)
+{
+loadFromURL(u"tdf152896_WordArt_color_darken.docx");
+// The file contains a WordArt shape with theme colors "Background 2", 
shading mode "Darken 25%"
+// and "20% Transparency". Word writes this as w:color element with 
additional w14:textFill
+// element. In such case the w14:textFill element supersedes the w:color 
element. Error was, that
+// the darkening was applied twice, once from w:color and the other time 
from w14:textFill.
+
+uno::Reference 
xDrawPagesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0),
+ uno::UNO_QUERY);
+
+uno::Reference xShapeProps(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+// Without the fix in place the test would have failed with
+// Expected: 13676402 (= 0xD0AF72 = rgb(208, 175, 114) => luminance 63.14%)
+// Actual: 11897660 (= 0xB58B3C = rgb(181, 139, 60) => luminance 47.25% )
+// The original "Background 2" is 0xEBDDC3 = rgb(235, 221, 195) => 
luminance 84.31%
+CPPUNIT_ASSERT_EQUAL(uno::Any(Color(208, 175, 114)),
+ xShapeProps->getPropertyValue(u"FillColor"));
+}
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx
index 767f3807607f..9fb3812923b2 100644
--- a/oox/source/shape/WpsContext.cxx
+++ b/oox/source/shape/WpsContext.cxx
@@ -381,62 +381,72 @@ lcl_generateFillPropertiesFromTextProps(const 
comphelper::SequenceAsHashMap& rTe
 {
 oox::drawingml::FillProperties aFillProperties;
 aFillProperties.moFillType = oox::XML_solidFill; // default
-sal_Int32 aCharColor = 0;
-if (rTextPropMap.getValue(u"CharColor") >>= aCharColor)
-aFillProperties.maFillColor.setSrgbClr(aCharColor);
-else
-aFillProperties.maFillColor.setUnused();
-
-// Theme color superseds direct color. textFill superseds theme color. 
Theme color and textfill
-// are in CharInteropGrabBag
+// Theme color supersedes direct color. textFill supersedes theme color. 
Theme color and textFill
+// are in CharInteropGrabBag.
 uno::Sequence aCharInteropGrabBagSeq;
-if (!((rTextPropMap.getValue(u"CharInteropGrabBag") >>= 
aCharInteropGrabBagSeq)
-  && aCharInteropGrabBagSeq.hasElements()))
-return aFillProperties;
-comphelper::SequenceAsHashMap 
aCharInteropGrabBagMap(aCharInteropGrabBagSeq);
-
-// Handle theme color, tint and shade.
-   

[Libreoffice-commits] core.git: sfx2/source svtools/source

2023-01-06 Thread Stephan Bergmann (via logerrit)
 sfx2/source/control/thumbnailviewacc.cxx |2 +-
 svtools/source/control/valueacc.cxx  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a2e0d46ec556382140069fe473d6e0018e1d2881
Author: Stephan Bergmann 
AuthorDate: Fri Jan 6 16:46:11 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Jan 6 19:01:27 2023 +

Fix copy/paste typos

...apparently introduced in 4883fd31141c3598b25a123033297f847cd18552 "weld
ScTabBgColorDlg" and 3e078e17ee2144fb976a7e6b9227152113cea0d4 "weld
SfxTemplateManagerDlg", resp.

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

diff --git a/sfx2/source/control/thumbnailviewacc.cxx 
b/sfx2/source/control/thumbnailviewacc.cxx
index 985a66fefa12..adc6b30f454f 100644
--- a/sfx2/source/control/thumbnailviewacc.cxx
+++ b/sfx2/source/control/thumbnailviewacc.cxx
@@ -131,7 +131,7 @@ sal_Int64 SAL_CALL 
ThumbnailViewAcc::getAccessibleIndexInParent()
 }
 catch (const uno::Exception&)
 {
-TOOLS_WARN_EXCEPTION( "sfx", 
"OAccessibleContextHelper::getAccessibleIndexInParent" );
+TOOLS_WARN_EXCEPTION( "sfx", 
"ThumbnailViewAcc::getAccessibleIndexInParent" );
 }
 
 return nRet;
diff --git a/svtools/source/control/valueacc.cxx 
b/svtools/source/control/valueacc.cxx
index 869724b36827..e6cc64411f1c 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -573,7 +573,7 @@ sal_Int64 SAL_CALL ValueSetAcc::getAccessibleIndexInParent()
 }
 catch (const uno::Exception&)
 {
-TOOLS_WARN_EXCEPTION( "svtools", 
"OAccessibleContextHelper::getAccessibleIndexInParent" );
+TOOLS_WARN_EXCEPTION( "svtools", 
"ValueSetAcc::getAccessibleIndexInParent" );
 }
 
 return nRet;


[Libreoffice-commits] core.git: accessibility/source basctl/source comphelper/Library_comphelper.mk comphelper/source compilerplugins/clang include/comphelper include/IwyuFilter_include.yaml solenv/cl

2023-01-06 Thread Stephan Bergmann (via logerrit)
 accessibility/source/extended/accessibleiconchoicectrl.cxx|1 
 accessibility/source/extended/accessiblelistbox.cxx   |1 
 accessibility/source/extended/accessibletabbar.cxx|1 
 accessibility/source/extended/accessibletabbarpage.cxx|1 
 accessibility/source/extended/accessibletabbarpagelist.cxx|1 
 accessibility/source/extended/textwindowaccessibility.cxx |1 
 accessibility/source/standard/accessiblemenubasecomponent.cxx |1 
 accessibility/source/standard/accessiblemenucomponent.cxx |1 
 accessibility/source/standard/accessiblemenuitemcomponent.cxx |1 
 accessibility/source/standard/svtaccessiblenumericfield.cxx   |1 
 accessibility/source/standard/vclxaccessiblebutton.cxx|1 
 accessibility/source/standard/vclxaccessiblecheckbox.cxx  |1 
 accessibility/source/standard/vclxaccessibleedit.cxx  |1 
 accessibility/source/standard/vclxaccessibleheaderbaritem.cxx |1 
 accessibility/source/standard/vclxaccessiblemenu.cxx  |1 
 accessibility/source/standard/vclxaccessiblemenubar.cxx   |1 
 accessibility/source/standard/vclxaccessiblemenuitem.cxx  |1 
 accessibility/source/standard/vclxaccessiblepopupmenu.cxx |1 
 accessibility/source/standard/vclxaccessibleradiobutton.cxx   |1 
 accessibility/source/standard/vclxaccessiblescrollbar.cxx |1 
 accessibility/source/standard/vclxaccessiblestatusbar.cxx |1 
 accessibility/source/standard/vclxaccessiblestatusbaritem.cxx |1 
 accessibility/source/standard/vclxaccessibletabcontrol.cxx|1 
 accessibility/source/standard/vclxaccessibletabpage.cxx   |1 
 accessibility/source/standard/vclxaccessibletabpagewindow.cxx |1 
 accessibility/source/standard/vclxaccessibletextcomponent.cxx |1 
 accessibility/source/standard/vclxaccessibletoolbox.cxx   |1 
 accessibility/source/standard/vclxaccessibletoolboxitem.cxx   |1 
 basctl/source/accessibility/accessibledialogcontrolshape.cxx  |1 
 basctl/source/accessibility/accessibledialogwindow.cxx|1 
 comphelper/Library_comphelper.mk  |1 
 comphelper/source/misc/accessiblecomponenthelper.cxx  |  206 
 comphelper/source/misc/accessiblecontexthelper.cxx|  248 --
 comphelper/source/misc/accessibleselectionhelper.cxx  |1 
 comphelper/source/misc/accessibletexthelper.cxx   |1 
 compilerplugins/clang/mergeclasses.results|1 
 include/IwyuFilter_include.yaml   |4 
 include/comphelper/accessiblecomponenthelper.hxx  |  117 
 include/comphelper/accessiblecontexthelper.hxx|  140 -
 solenv/clang-format/excludelist   |1 
 svx/source/accessibility/charmapacc.cxx   |1 
 svx/source/inc/charmapacc.hxx |4 
 toolkit/inc/controls/accessiblecontrolcontext.hxx |2 
 toolkit/source/awt/vclxaccessiblecomponent.cxx|1 
 toolkit/source/controls/accessiblecontrolcontext.cxx  |1 
 45 files changed, 366 insertions(+), 393 deletions(-)

New commits:
commit ec98e7769048d44c6d274e3edcac19d5cbc74348
Author: Stephan Bergmann 
AuthorDate: Fri Jan 6 18:43:28 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Jan 6 19:02:05 2023 +

Merge comphelper::OAccessibleContextHelper into 
comphelper::OCommonAccessibleComponent

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

diff --git a/accessibility/source/extended/accessibleiconchoicectrl.cxx 
b/accessibility/source/extended/accessibleiconchoicectrl.cxx
index 72ce9854e204..f9f3599bb4b4 100644
--- a/accessibility/source/extended/accessibleiconchoicectrl.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrl.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/accessibility/source/extended/accessiblelistbox.cxx 
b/accessibility/source/extended/accessiblelistbox.cxx
index df4a9a759c0f..d9507fefd4b3 100644
--- a/accessibility/source/extended/accessiblelistbox.cxx
+++ b/accessibility/source/extended/accessiblelistbox.cxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 
diff --git a/accessibility/source/extended/accessibletabbar.cxx 
b/accessibility/source/extended/accessibletabbar.cxx
index 8d192b9fe277..0a9747a3e708 100644
--- a/accessibility/source/extended/accessibletabbar.cxx
+++ b/accessibility/source/extended/accessibletabbar.cxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/accessibility/source/extended/accessibletabbarpage.cxx 
b/accessibility/source/extended/accessibletabbarpage.cxx
in

[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - vcl/inc vcl/osx

2023-01-06 Thread Patrick Luby (via logerrit)
 vcl/inc/osx/salframeview.h |2 
 vcl/osx/salframeview.mm|  157 ++---
 2 files changed, 151 insertions(+), 8 deletions(-)

New commits:
commit d8f358656e1c78c479a417adab12eaee190d3fe7
Author: Patrick Luby 
AuthorDate: Tue Dec 20 10:30:00 2022 -0500
Commit: Caolán McNamara 
CommitDate: Fri Jan 6 20:41:32 2023 +

tdf#42437 Enable press-and-hold special character input method

The first step to enable this input method is to always return a valid 
selected
range location. -[NSResponder interpretKeyEvents:] will not call
[self firstRectForCharacterRange:actualRange:] if the selected range 
location
is NSNotFound so that is what was disabling display of the press-and-hold
input method popup.

Once [self firstRectForCharacterRange:actualRange:] is called, emulate the
press-and-hold behavior of the TextEdit application by setting the marked 
text
to the last key down event's characters. The characters will already have 
been
committed by the special character input method so set the
mbTextInputWantsNonRepeatKeyDown flag to indicate that the characters need 
to
be deleted if the input method replaces the committed characters.

Also, emulate the press-and-hold behavior of the TextEdit application by
committing any uncommitted text when either the escape or the return key is
pressed while the press-and-hold input method popup is displayed.

Lastly, handle repeat key events by explicitly inserting the text if there 
is
no uncommitted text before -[NSResponder interpretKeyEvents:] is called.

Change-Id: I104b3d64a8c66fef3a5a1cec0fba1daa553cd9a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144630
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 1e4ef6d69b22f6674aefb415edf2e8e7ca78ff2d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145009
Reviewed-by: Patrick Luby 
Reviewed-by: Caolán McNamara 

diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index 4ec0b6c06651..2fcff0d1c1e5 100644
--- a/vcl/inc/osx/salframeview.h
+++ b/vcl/inc/osx/salframeview.h
@@ -86,6 +86,7 @@ enum class SalEvent;
 BOOLmbInEndExtTextInput;
 BOOLmbInCommitMarkedText;
 NSAttributedString* mpLastMarkedText;
+BOOLmbTextInputWantsNonRepeatKeyDown;
 }
 +(void)unsetMouseFrame: (AquaSalFrame*)pFrame;
 -(id)initWithSalFrame: (AquaSalFrame*)pFrame;
@@ -217,6 +218,7 @@ enum class SalEvent;
 
 -(void)endExtTextInput;
 -(void)endExtTextInput:(EndExtTextInputFlags)nFlags;
+-(void)deleteTextInputWantsNonRepeatKeyDown;
 
 @end
 
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 546c2a85d24e..355fc84a76b4 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -512,6 +512,7 @@ static AquaSalFrame* getMouseContainerFrame()
 mbInEndExtTextInput = NO;
 mbInCommitMarkedText = NO;
 mpLastMarkedText = nil;
+mbTextInputWantsNonRepeatKeyDown = NO;
 }
 
 return self;
@@ -998,8 +999,52 @@ static AquaSalFrame* getMouseContainerFrame()
 
 if( ! [self handleKeyDownException: pEvent] )
 {
+sal_uInt16 nKeyCode = ImplMapKeyCode( [pEvent keyCode] );
+if ( nKeyCode == KEY_DELETE && mbTextInputWantsNonRepeatKeyDown )
+{
+// tdf#42437 Enable press-and-hold special character input 
method
+// Emulate the press-and-hold behavior of the TextEdit
+// application by deleting the marked text when only the
+// Delete key is pressed and keep the marked text when the
+// Backspace key or Fn-Delete keys are pressed.
+if ( [pEvent keyCode] == 51 )
+{
+[self deleteTextInputWantsNonRepeatKeyDown];
+}
+else
+{
+[self unmarkText];
+mbKeyHandled = true;
+mbInKeyInput = false;
+}
+
+[self endExtTextInput];
+return;
+}
+
 NSArray* pArray = [NSArray arrayWithObject: pEvent];
 [self interpretKeyEvents: pArray];
+
+// Handle repeat key events by explicitly inserting the text if
+// -[NSResponder interpretKeyEvents:] does not insert or mark any
+// text. Note: do not do this step if there is uncommitted text.
+if ( !mpLastMarkedText && mpLastEvent && [mpLastEvent type] == 
NSEventTypeKeyDown && [mpLastEvent isARepeat] )
+{
+NSString *pChars = [mpLastEvent characters];
+[self insertText:pChars replacementRange:NSMakeRange( 0, 
[pChars length] )];
+}
+// tdf#42437 Enable press-and-hold special character input method
+// Emulate the press-and-hold behavior of

[Libreoffice-commits] core.git: external/openssl

2023-01-06 Thread Taichi Haradaguchi (via logerrit)
 external/openssl/0001-x509-fix-double-locking-problem.patch.1 |   39 ++
 external/openssl/UnpackedTarball_openssl.mk   |1 
 2 files changed, 40 insertions(+)

New commits:
commit f41966222f05ab327550dc7a5cf9ad40052124b3
Author: Taichi Haradaguchi <20001...@ymail.ne.jp>
AuthorDate: Sat Dec 24 16:34:15 2022 +0900
Commit: Caolán McNamara 
CommitDate: Fri Jan 6 20:42:54 2023 +

openssl3: add patch for CVE-2022-3996

Severity: Low

backport 
.

OpenSSL 1.1.1 series are not affected by this vulnerability.

Security Advisary: https://www.openssl.org/news/secadv/20221213.txt

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

diff --git a/external/openssl/0001-x509-fix-double-locking-problem.patch.1 
b/external/openssl/0001-x509-fix-double-locking-problem.patch.1
new file mode 100644
index ..ec289215e1a5
--- /dev/null
+++ b/external/openssl/0001-x509-fix-double-locking-problem.patch.1
@@ -0,0 +1,39 @@
+From 7725e7bfe6f2ce8146b6552b44e0d226be7638e7 Mon Sep 17 00:00:00 2001
+From: Pauli 
+Date: Fri, 11 Nov 2022 09:40:19 +1100
+Subject: [PATCH] x509: fix double locking problem
+
+This reverts commit 9aa4be691f5c73eb3c68606d824c104550c053f7 and removed the
+redundant flag setting.
+
+Fixes #19643
+
+Fixes LOW CVE-2022-3996
+
+Reviewed-by: Dmitry Belyavskiy 
+Reviewed-by: Tomas Mraz 
+(Merged from https://github.com/openssl/openssl/pull/19652)
+
+(cherry picked from commit 4d0340a6d2f327700a059f0b8f954d6160f8eef5)
+---
+ crypto/x509/pcy_map.c | 4 
+ 1 file changed, 4 deletions(-)
+
+diff --git a/crypto/x509/pcy_map.c b/crypto/x509/pcy_map.c
+index 05406c6493..60dfd1e320 100644
+--- a/crypto/x509/pcy_map.c
 b/crypto/x509/pcy_map.c
+@@ -73,10 +73,6 @@ int ossl_policy_cache_set_mapping(X509 *x, POLICY_MAPPINGS 
*maps)
+ 
+ ret = 1;
+  bad_mapping:
+-if (ret == -1 && CRYPTO_THREAD_write_lock(x->lock)) {
+-x->ex_flags |= EXFLAG_INVALID_POLICY;
+-CRYPTO_THREAD_unlock(x->lock);
+-}
+ sk_POLICY_MAPPING_pop_free(maps, POLICY_MAPPING_free);
+ return ret;
+ 
+-- 
+2.39.0
+
diff --git a/external/openssl/UnpackedTarball_openssl.mk 
b/external/openssl/UnpackedTarball_openssl.mk
index 2a8f3bb3f905..7ee91bb43425 100644
--- a/external/openssl/UnpackedTarball_openssl.mk
+++ b/external/openssl/UnpackedTarball_openssl.mk
@@ -12,6 +12,7 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,openssl))
 $(eval $(call 
gb_UnpackedTarball_set_tarball,openssl,$(OPENSSL_TARBALL),,openssl))
 
 $(eval $(call gb_UnpackedTarball_add_patches,openssl,\
+   external/openssl/0001-x509-fix-double-locking-problem.patch.1 \
external/openssl/openssl-no-multilib.patch.0 \
external/openssl/configurable-z-option.patch.0 \
external/openssl/openssl-no-ipc-cmd.patch.0 \


[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - external/openssl

2023-01-06 Thread Taichi Haradaguchi (via logerrit)
 external/openssl/0001-x509-fix-double-locking-problem.patch.1 |   39 ++
 external/openssl/UnpackedTarball_openssl.mk   |1 
 2 files changed, 40 insertions(+)

New commits:
commit 81af43499fab2cec69b593c599374e2b455dbf67
Author: Taichi Haradaguchi <20001...@ymail.ne.jp>
AuthorDate: Sat Dec 24 16:34:15 2022 +0900
Commit: Caolán McNamara 
CommitDate: Fri Jan 6 20:43:01 2023 +

openssl3: add patch for CVE-2022-3996

Severity: Low

backport 
.

OpenSSL 1.1.1 series are not affected by this vulnerability.

Security Advisary: https://www.openssl.org/news/secadv/20221213.txt

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

diff --git a/external/openssl/0001-x509-fix-double-locking-problem.patch.1 
b/external/openssl/0001-x509-fix-double-locking-problem.patch.1
new file mode 100644
index ..ec289215e1a5
--- /dev/null
+++ b/external/openssl/0001-x509-fix-double-locking-problem.patch.1
@@ -0,0 +1,39 @@
+From 7725e7bfe6f2ce8146b6552b44e0d226be7638e7 Mon Sep 17 00:00:00 2001
+From: Pauli 
+Date: Fri, 11 Nov 2022 09:40:19 +1100
+Subject: [PATCH] x509: fix double locking problem
+
+This reverts commit 9aa4be691f5c73eb3c68606d824c104550c053f7 and removed the
+redundant flag setting.
+
+Fixes #19643
+
+Fixes LOW CVE-2022-3996
+
+Reviewed-by: Dmitry Belyavskiy 
+Reviewed-by: Tomas Mraz 
+(Merged from https://github.com/openssl/openssl/pull/19652)
+
+(cherry picked from commit 4d0340a6d2f327700a059f0b8f954d6160f8eef5)
+---
+ crypto/x509/pcy_map.c | 4 
+ 1 file changed, 4 deletions(-)
+
+diff --git a/crypto/x509/pcy_map.c b/crypto/x509/pcy_map.c
+index 05406c6493..60dfd1e320 100644
+--- a/crypto/x509/pcy_map.c
 b/crypto/x509/pcy_map.c
+@@ -73,10 +73,6 @@ int ossl_policy_cache_set_mapping(X509 *x, POLICY_MAPPINGS 
*maps)
+ 
+ ret = 1;
+  bad_mapping:
+-if (ret == -1 && CRYPTO_THREAD_write_lock(x->lock)) {
+-x->ex_flags |= EXFLAG_INVALID_POLICY;
+-CRYPTO_THREAD_unlock(x->lock);
+-}
+ sk_POLICY_MAPPING_pop_free(maps, POLICY_MAPPING_free);
+ return ret;
+ 
+-- 
+2.39.0
+
diff --git a/external/openssl/UnpackedTarball_openssl.mk 
b/external/openssl/UnpackedTarball_openssl.mk
index 2a8f3bb3f905..7ee91bb43425 100644
--- a/external/openssl/UnpackedTarball_openssl.mk
+++ b/external/openssl/UnpackedTarball_openssl.mk
@@ -12,6 +12,7 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,openssl))
 $(eval $(call 
gb_UnpackedTarball_set_tarball,openssl,$(OPENSSL_TARBALL),,openssl))
 
 $(eval $(call gb_UnpackedTarball_add_patches,openssl,\
+   external/openssl/0001-x509-fix-double-locking-problem.patch.1 \
external/openssl/openssl-no-multilib.patch.0 \
external/openssl/configurable-z-option.patch.0 \
external/openssl/openssl-no-ipc-cmd.patch.0 \


[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/source

2023-01-06 Thread Michael Stahl (via logerrit)
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   12 +++-
 sw/source/core/doc/doccorr.cxx  |5 -
 2 files changed, 15 insertions(+), 2 deletions(-)

New commits:
commit e8d36908ca57af37dfea747d32356d3175e2a9b0
Author: Michael Stahl 
AuthorDate: Thu Jan 5 12:32:09 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jan 6 20:45:25 2023 +

tdf#152710 sw: invalidate SwUnoCursors properly in DeleteRangeImpl()

This crashes with:

 list.cxx:44: corrupt document structure, bailing out of infinite loop
 ndtxt.cxx:5437: void SwTextNode::TriggerNodeUpdate(const 
sw::LegacyModifyHint&): Assertion `dynamic_cast(static_cast(pOldValue)->pChangedFormat)' failed.

Because the redline from 7 to 9 is deleted, but then some cursor ends up
on node 10 which is invalid as it is an end node.

[   6] 0x60666a0StartNode ,
[   7]  0x61195e0   StartNode ,
[   8]   0x61197a8   TextNode "tainment",
[   9]  0x6119670 EndNode ,
[  10] 0x6066730  EndNode ,

The first problem is that DeleteRangeImpl() uses the point node as the
target position for PaMCorrAbs(), but in this case the point node will
be deleted.

PaMCorrAbs() has a check to invalidate SwUnoCursors that would be moved
out of their parent sections, but due to the first problem it can't
check it, and the second problem is that lcl_FindUnoCursorSection()
doesn't work on redline sections, as those have node type
SwNormalStartNode.

After fixing the invalidation, subsequent access to the SwXTextCursor
throws exceptions and importing the file fails.

(regression from commit 477e489e71b4a96ff10d9f2d2b802d91dec3e319)

Thanks to Dave Gilbert for identifying the problematic DeleteRange()
call.

Change-Id: I48a373cc122073b82bc47513fdae684f45b0efb8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145077
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 8e05bdd26f21fc304978ff3b454cf355841ec75f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145010
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 94f3baf31907..f50308cd03af 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -4242,7 +4242,17 @@ bool 
DocumentContentOperationsManager::DeleteRangeImpl(SwPaM & rPam, SwDeleteFla
 // Move all cursors out of the deleted range, but first copy the
 // passed PaM, because it could be a cursor that would be moved!
 SwPaM aDelPam( *rPam.GetMark(), *rPam.GetPoint() );
-::PaMCorrAbs( aDelPam, *aDelPam.GetPoint() );
+{
+// tdf#152710 target position must be on node that survives deletion
+// so that PaMCorrAbs can invalidate SwUnoCursors properly
+SwPosition const pos(aDelPam.GetPoint()->GetNode().IsContentNode()
+? *aDelPam.GetPoint()
+: aDelPam.GetMark()->GetNode().IsContentNode()
+? *aDelPam.GetMark()
+// this would be the result in SwNodes::RemoveNode()
+: SwPosition(aDelPam.End()->GetNode(), SwNodeOffset(+1)));
+::PaMCorrAbs(aDelPam, pos);
+}
 
 bool const bSuccess( DeleteRangeImplImpl(aDelPam, flags) );
 if (bSuccess)
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index 8cf23cc43ab5..c26bced7ac00 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -37,8 +37,11 @@ namespace
 const SwStartNode* pStartNode = rNode.StartOfSectionNode();
 while( ( pStartNode != nullptr ) &&
( pStartNode->StartOfSectionNode() != pStartNode ) &&
-   ( pStartNode->GetStartNodeType() == SwNormalStartNode ) )
+   // section node is only start node allowing overlapped delete
+   pStartNode->IsSectionNode() )
+{
 pStartNode = pStartNode->StartOfSectionNode();
+}
 
 return pStartNode;
 }


[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/source

2023-01-06 Thread Michael Stahl (via logerrit)
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   26 +---
 sw/source/core/doc/doccorr.cxx  |2 -
 sw/source/filter/xml/XMLRedlineImportHelper.cxx |5 +--
 3 files changed, 19 insertions(+), 14 deletions(-)

New commits:
commit e073e4afe5eb460083944eb22dc8d87ad334877a
Author: Michael Stahl 
AuthorDate: Thu Jan 5 13:17:17 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jan 6 20:46:03 2023 +

tdf#152710 sw: call and fix DeleteSection() instead

Turns out there's a function to delete a complete nodes array section -
and it has the same problem?  Why does it move indexes only from
startnode + 1?  Let's try to fix it to be more consistent.

Change-Id: Iedacc10e29c1646c4ccc85e53a479b0351f5cfcc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145078
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 475e59d29b7a6cc7f058af8ff863b3bb1a2a84a5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145011
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index f50308cd03af..21f67d9a9774 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -2070,6 +2070,18 @@ DocumentContentOperationsManager::CopyRange( SwPaM& 
rPam, SwPosition& rPos,
 return bRet;
 }
 
+static auto GetCorrPosition(SwPaM const& rPam) -> SwPosition
+{
+// tdf#152710 target position must be on node that survives deletion
+// so that PaMCorrAbs can invalidate SwUnoCursors properly
+return rPam.GetPoint()->GetNode().IsContentNode()
+? *rPam.GetPoint()
+: rPam.GetMark()->GetNode().IsContentNode()
+? *rPam.GetMark()
+// this would be the result in SwNodes::RemoveNode()
+: SwPosition(rPam.End()->GetNode(), SwNodeOffset(+1));
+}
+
 /// Delete a full Section of the NodeArray.
 /// The passed Node is located somewhere in the designated Section.
 void DocumentContentOperationsManager::DeleteSection( SwNode *pNode )
@@ -2087,8 +2099,9 @@ void DocumentContentOperationsManager::DeleteSection( 
SwNode *pNode )
 
 {
 // move all Cursor/StackCursor/UnoCursor out of the to-be-deleted area
-SwNodeIndex aMvStt( aSttIdx, 1 );
-SwDoc::CorrAbs( aMvStt, aEndIdx, SwPosition( aSttIdx ), true );
+SwPaM const range(aSttIdx, aEndIdx);
+SwPosition const pos(GetCorrPosition(range));
+::PaMCorrAbs(range, pos);
 }
 
 m_rDoc.GetNodes().DelNodes( aSttIdx, aEndIdx.GetIndex() - 
aSttIdx.GetIndex() + 1 );
@@ -4243,14 +4256,7 @@ bool 
DocumentContentOperationsManager::DeleteRangeImpl(SwPaM & rPam, SwDeleteFla
 // passed PaM, because it could be a cursor that would be moved!
 SwPaM aDelPam( *rPam.GetMark(), *rPam.GetPoint() );
 {
-// tdf#152710 target position must be on node that survives deletion
-// so that PaMCorrAbs can invalidate SwUnoCursors properly
-SwPosition const pos(aDelPam.GetPoint()->GetNode().IsContentNode()
-? *aDelPam.GetPoint()
-: aDelPam.GetMark()->GetNode().IsContentNode()
-? *aDelPam.GetMark()
-// this would be the result in SwNodes::RemoveNode()
-: SwPosition(aDelPam.End()->GetNode(), SwNodeOffset(+1)));
+SwPosition const pos(GetCorrPosition(aDelPam));
 ::PaMCorrAbs(aDelPam, pos);
 }
 
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index c26bced7ac00..783e1aa2346f 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -34,7 +34,7 @@ namespace
 /// returns NULL if no restrictions apply
 const SwStartNode* lcl_FindUnoCursorSection( const SwNode& rNode )
 {
-const SwStartNode* pStartNode = rNode.StartOfSectionNode();
+const SwStartNode* pStartNode = rNode.IsStartNode() ? 
rNode.GetStartNode() : rNode.StartOfSectionNode();
 while( ( pStartNode != nullptr ) &&
( pStartNode->StartOfSectionNode() != pStartNode ) &&
// section node is only start node allowing overlapped delete
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 268ddd5cdf25..6d3bb6007ae6 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -718,9 +718,8 @@ void 
XMLRedlineImportHelper::InsertIntoDocument(RedlineInfo* pRedlineInfo)
 SAL_WARN("sw.xml", "Recursive change tracking, removing");
 // reuse aPaM to remove it from nodes that will be deleted
 aPaM.GetPoint()->Assign(pRedlineInfo->pContentIndex->GetNode());
-aPaM.SetMark();
-
aPaM.GetMark()->Assign(*pRedlineInfo->pContentIndex->GetNod

[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - xmloff/source

2023-01-06 Thread Michael Stahl (via logerrit)
 xmloff/source/text/XMLChangedRegionImportContext.cxx |   11 ---
 xmloff/source/text/txtparai.cxx  |   17 +
 2 files changed, 21 insertions(+), 7 deletions(-)

New commits:
commit af920245710d1a51d98bba2c18b7002a32865e0b
Author: Michael Stahl 
AuthorDate: Thu Jan 5 18:07:03 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jan 6 20:46:30 2023 +

tdf#152710 xmloff: ignore exception in XMLChangedRegionImportContext

The xOldCursor must be restored in all cases.

Also XMLParaContext triggers an exception which ends up aborting the
import.

Change-Id: I8f4785e0e9bde4c8c484954a4d66f3b82d6ca28c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145094
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit e5b5d9c8d33b1dd87e5a50856ad02f21df59dc5b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145012
Reviewed-by: Caolán McNamara 

diff --git a/xmloff/source/text/XMLChangedRegionImportContext.cxx 
b/xmloff/source/text/XMLChangedRegionImportContext.cxx
index 4d43a8de3027..fe00c4a058b9 100644
--- a/xmloff/source/text/XMLChangedRegionImportContext.cxx
+++ b/xmloff/source/text/XMLChangedRegionImportContext.cxx
@@ -122,9 +122,14 @@ void 
XMLChangedRegionImportContext::endFastElement(sal_Int32 )
 {
 // delete last paragraph
 // (one extra paragraph was inserted in the beginning)
-rtl::Reference rHelper =
-GetImport().GetTextImport();
-rHelper->DeleteParagraph();
+try
+{
+GetImport().GetTextImport()->DeleteParagraph();
+}
+catch (uno::Exception const&)
+{   // cursor may be disposed - must reset to old cursor!
+SAL_INFO("xmloff.text", "XMLChangedRegionImportContext: delete 
paragraph failed");
+}
 
 GetImport().GetTextImport()->SetCursor(xOldCursor);
 xOldCursor = nullptr;
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx
index 9844e2628c89..5fffc202612a 100644
--- a/xmloff/source/text/txtparai.cxx
+++ b/xmloff/source/text/txtparai.cxx
@@ -1688,10 +1688,19 @@ void XMLParaContext::endFastElement(sal_Int32 )
 {
 rtl::Reference < XMLTextImportHelper > xTxtImport(
 GetImport().GetTextImport());
-Reference < XTextRange > xCrsrRange( xTxtImport->GetCursorAsRange() );
-if( !xCrsrRange.is() )
-return; // Robust (defective file)
-Reference < XTextRange > xEnd(xCrsrRange->getStart());
+Reference xEnd;
+try
+{
+Reference const xCrsrRange(xTxtImport->GetCursorAsRange());
+if (!xCrsrRange.is())
+return; // Robust (defective file)
+xEnd = xCrsrRange->getStart();
+}
+catch (uno::Exception const&)
+{
+SAL_INFO("xmloff.text", "XMLParaContext: cursor disposed?");
+return;
+}
 
 // if we have an id set for this paragraph, get a cursor for this
 // paragraph and register it with the given identifier


[Libreoffice-commits] core.git: download.lst external/curl

2023-01-06 Thread Taichi Haradaguchi (via logerrit)
 download.lst  |4 ++--
 external/curl/asan-poison-nsspem.patch.0  |2 +-
 external/curl/curl-msvc-disable-protocols.patch.1 |2 +-
 external/curl/curl-nss.patch.1|2 +-
 external/curl/zlib.patch.0|   12 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 5a1ddc1a92a7883597ab7d825408a1f0adc2ec6e
Author: Taichi Haradaguchi <20001...@ymail.ne.jp>
AuthorDate: Fri Dec 30 21:29:58 2022 +0900
Commit: Caolán McNamara 
CommitDate: Fri Jan 6 20:48:41 2023 +

curl: upgrade to release 7.87.0

Fixes CVE-2022-43551 and CVE-2022-43552.

https://curl.se/docs/CVE-2022-43551.html
https://curl.se/docs/CVE-2022-43552.html

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

diff --git a/download.lst b/download.lst
index c41e59d336fb..cd75552a37f0 100644
--- a/download.lst
+++ b/download.lst
@@ -75,8 +75,8 @@ CPPUNIT_TARBALL := cppunit-1.15.1.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-CURL_SHA256SUM := 
2d61116e5f485581f6d59865377df4463f2e788677ac43222b496d4e49fb627b
-CURL_TARBALL := curl-7.86.0.tar.xz
+CURL_SHA256SUM := 
ee5f1a1955b0ed413435ef79db28b834ea5f0fb7c8cfb1ce47175cc3bee08fff
+CURL_TARBALL := curl-7.87.0.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
diff --git a/external/curl/asan-poison-nsspem.patch.0 
b/external/curl/asan-poison-nsspem.patch.0
index 8675f06e6b8b..1f490bd6bf86 100644
--- a/external/curl/asan-poison-nsspem.patch.0
+++ b/external/curl/asan-poison-nsspem.patch.0
@@ -1,6 +1,6 @@
 --- lib/vtls/nss.c
 +++ lib/vtls/nss.c
-@@ -1942,7 +1942,7 @@
+@@ -1945,7 +1945,7 @@
  
PK11_SetPasswordFunc(nss_get_password);
  
diff --git a/external/curl/curl-msvc-disable-protocols.patch.1 
b/external/curl/curl-msvc-disable-protocols.patch.1
index 89c4ff576f85..71ff0c01a028 100644
--- a/external/curl/curl-msvc-disable-protocols.patch.1
+++ b/external/curl/curl-msvc-disable-protocols.patch.1
@@ -2,7 +2,7 @@ disable protocols nobody needs in MSVC build
 
 --- curl/lib/config-win32.h.orig   2017-08-09 16:43:29.46400 +0200
 +++ curl/lib/config-win32.h2017-08-09 16:47:38.54920 +0200
-@@ -616,4 +616,20 @@
+@@ -654,4 +654,20 @@
  #  define ENABLE_IPV6 1
  #endif
  
diff --git a/external/curl/curl-nss.patch.1 b/external/curl/curl-nss.patch.1
index 5ef25748d7eb..2128849369e7 100644
--- a/external/curl/curl-nss.patch.1
+++ b/external/curl/curl-nss.patch.1
@@ -1,7 +1,7 @@
 diff -ur curl.org/configure curl/configure
 --- curl.org/configure 2016-03-13 15:14:07.17776 +0100
 +++ curl/configure 2016-03-13 15:16:44.13276 +0100
-@@ -27985,7 +27985,12 @@
+@@ -28230,7 +28230,12 @@
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Using hard-wired 
libraries and compilation flags for NSS." >&5
  printf "%s\n" "$as_me: WARNING: Using hard-wired libraries and compilation 
flags for NSS." >&2;}
addld="-L$OPT_NSS/lib"
diff --git a/external/curl/zlib.patch.0 b/external/curl/zlib.patch.0
index b8e242a3aaea..b4442ba262d1 100644
--- a/external/curl/zlib.patch.0
+++ b/external/curl/zlib.patch.0
@@ -1,6 +1,6 @@
 --- configure
 +++ configure
-@@ -22808,7 +22808,6 @@
+@@ -23035,7 +23035,6 @@
  clean_CPPFLAGS=$CPPFLAGS
  clean_LDFLAGS=$LDFLAGS
  clean_LIBS=$LIBS
@@ -8,7 +8,7 @@
  
  # Check whether --with-zlib was given.
  if test ${with_zlib+y}
-@@ -22818,6 +22818,7 @@
+@@ -23045,6 +23044,7 @@
  
  
  if test "$OPT_ZLIB" = "no" ; then
@@ -16,7 +16,7 @@
  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: zlib disabled" >&5
  printf "%s\n" "$as_me: WARNING: zlib disabled" >&2;}
  else
-@@ -22825,6 +825,21 @@
+@@ -23052,6 +23052,21 @@
  OPT_ZLIB=""
fi
  
@@ -38,7 +38,7 @@
if test -z "$OPT_ZLIB" ; then
  
  if test -n "$PKG_CONFIG"; then
-@@ -23120,6 +23120,7 @@
+@@ -23344,6 +23359,7 @@
  printf "%s\n" "$as_me: found both libz and libz.h header" >&6;}
  curl_zlib_msg="enabled"
fi
@@ -48,7 +48,7 @@
   if test x"$AMFIXLIB" = x1; then
 --- configure.ac
 +++ configure.ac
-@@ -1222,19 +1222,30 @@
+@@ -1243,19 +1243,30 @@
  clean_CPPFLAGS=$CPPFLAGS
  clean_LDFLAGS=$LDFLAGS
  clean_LIBS=$LIBS
@@ -80,7 +80,7 @@
if test -z "$OPT_ZLIB" ; then
  CURL_CHECK_PKGCONFIG(zlib)
  
-@@ -1316,6 +1316,7 @@
+@@ -1336,6 +1347,7 @@
  AC_MSG_NOTICE([found both libz and libz.h header])
  curl_zlib_msg="enabled"
fi


[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - download.lst external/curl

2023-01-06 Thread Taichi Haradaguchi (via logerrit)
 download.lst  |4 ++--
 external/curl/asan-poison-nsspem.patch.0  |2 +-
 external/curl/curl-msvc-disable-protocols.patch.1 |2 +-
 external/curl/curl-nss.patch.1|2 +-
 external/curl/zlib.patch.0|   12 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit ed949a4b07a20a006ffefefdb3dd35272c636e5d
Author: Taichi Haradaguchi <20001...@ymail.ne.jp>
AuthorDate: Fri Dec 30 21:29:58 2022 +0900
Commit: Caolán McNamara 
CommitDate: Fri Jan 6 20:48:48 2023 +

curl: upgrade to release 7.87.0

Fixes CVE-2022-43551 and CVE-2022-43552.

https://curl.se/docs/CVE-2022-43551.html
https://curl.se/docs/CVE-2022-43552.html

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

diff --git a/download.lst b/download.lst
index abfe6e9eaedc..eb47d84258e5 100644
--- a/download.lst
+++ b/download.lst
@@ -75,8 +75,8 @@ CPPUNIT_TARBALL := cppunit-1.15.1.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-CURL_SHA256SUM := 
2d61116e5f485581f6d59865377df4463f2e788677ac43222b496d4e49fb627b
-CURL_TARBALL := curl-7.86.0.tar.xz
+CURL_SHA256SUM := 
ee5f1a1955b0ed413435ef79db28b834ea5f0fb7c8cfb1ce47175cc3bee08fff
+CURL_TARBALL := curl-7.87.0.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
diff --git a/external/curl/asan-poison-nsspem.patch.0 
b/external/curl/asan-poison-nsspem.patch.0
index 8675f06e6b8b..1f490bd6bf86 100644
--- a/external/curl/asan-poison-nsspem.patch.0
+++ b/external/curl/asan-poison-nsspem.patch.0
@@ -1,6 +1,6 @@
 --- lib/vtls/nss.c
 +++ lib/vtls/nss.c
-@@ -1942,7 +1942,7 @@
+@@ -1945,7 +1945,7 @@
  
PK11_SetPasswordFunc(nss_get_password);
  
diff --git a/external/curl/curl-msvc-disable-protocols.patch.1 
b/external/curl/curl-msvc-disable-protocols.patch.1
index 89c4ff576f85..71ff0c01a028 100644
--- a/external/curl/curl-msvc-disable-protocols.patch.1
+++ b/external/curl/curl-msvc-disable-protocols.patch.1
@@ -2,7 +2,7 @@ disable protocols nobody needs in MSVC build
 
 --- curl/lib/config-win32.h.orig   2017-08-09 16:43:29.46400 +0200
 +++ curl/lib/config-win32.h2017-08-09 16:47:38.54920 +0200
-@@ -616,4 +616,20 @@
+@@ -654,4 +654,20 @@
  #  define ENABLE_IPV6 1
  #endif
  
diff --git a/external/curl/curl-nss.patch.1 b/external/curl/curl-nss.patch.1
index 5ef25748d7eb..2128849369e7 100644
--- a/external/curl/curl-nss.patch.1
+++ b/external/curl/curl-nss.patch.1
@@ -1,7 +1,7 @@
 diff -ur curl.org/configure curl/configure
 --- curl.org/configure 2016-03-13 15:14:07.17776 +0100
 +++ curl/configure 2016-03-13 15:16:44.13276 +0100
-@@ -27985,7 +27985,12 @@
+@@ -28230,7 +28230,12 @@
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Using hard-wired 
libraries and compilation flags for NSS." >&5
  printf "%s\n" "$as_me: WARNING: Using hard-wired libraries and compilation 
flags for NSS." >&2;}
addld="-L$OPT_NSS/lib"
diff --git a/external/curl/zlib.patch.0 b/external/curl/zlib.patch.0
index b8e242a3aaea..b4442ba262d1 100644
--- a/external/curl/zlib.patch.0
+++ b/external/curl/zlib.patch.0
@@ -1,6 +1,6 @@
 --- configure
 +++ configure
-@@ -22808,7 +22808,6 @@
+@@ -23035,7 +23035,6 @@
  clean_CPPFLAGS=$CPPFLAGS
  clean_LDFLAGS=$LDFLAGS
  clean_LIBS=$LIBS
@@ -8,7 +8,7 @@
  
  # Check whether --with-zlib was given.
  if test ${with_zlib+y}
-@@ -22818,6 +22818,7 @@
+@@ -23045,6 +23044,7 @@
  
  
  if test "$OPT_ZLIB" = "no" ; then
@@ -16,7 +16,7 @@
  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: zlib disabled" >&5
  printf "%s\n" "$as_me: WARNING: zlib disabled" >&2;}
  else
-@@ -22825,6 +825,21 @@
+@@ -23052,6 +23052,21 @@
  OPT_ZLIB=""
fi
  
@@ -38,7 +38,7 @@
if test -z "$OPT_ZLIB" ; then
  
  if test -n "$PKG_CONFIG"; then
-@@ -23120,6 +23120,7 @@
+@@ -23344,6 +23359,7 @@
  printf "%s\n" "$as_me: found both libz and libz.h header" >&6;}
  curl_zlib_msg="enabled"
fi
@@ -48,7 +48,7 @@
   if test x"$AMFIXLIB" = x1; then
 --- configure.ac
 +++ configure.ac
-@@ -1222,19 +1222,30 @@
+@@ -1243,19 +1243,30 @@
  clean_CPPFLAGS=$CPPFLAGS
  clean_LDFLAGS=$LDFLAGS
  clean_LIBS=$LIBS
@@ -80,7 +80,7 @@
if test -z "$OPT_ZLIB" ; then
  CURL_CHECK_PKGCONFIG(zlib)
  
-@@ -1316,6 +1316,7 @@
+@@ -1336,6 +1347,7 @@
  AC_MSG_NOTICE([found both libz and libz.h header])
  curl_zlib_msg="enabled"
fi


[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - download.lst external/curl

2023-01-06 Thread Taichi Haradaguchi (via logerrit)
 download.lst  |4 ++--
 external/curl/asan-poison-nsspem.patch.0  |2 +-
 external/curl/curl-msvc-disable-protocols.patch.1 |2 +-
 external/curl/curl-nss.patch.1|2 +-
 external/curl/zlib.patch.0|   12 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 181806115a694ade32c7bba1abd9aa931b1a93b9
Author: Taichi Haradaguchi <20001...@ymail.ne.jp>
AuthorDate: Fri Dec 30 21:29:58 2022 +0900
Commit: Caolán McNamara 
CommitDate: Fri Jan 6 20:48:56 2023 +

curl: upgrade to release 7.87.0

Fixes CVE-2022-43551 and CVE-2022-43552.

https://curl.se/docs/CVE-2022-43551.html
https://curl.se/docs/CVE-2022-43552.html

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

diff --git a/download.lst b/download.lst
index 428b1fcba7e7..5e908dd72ada 100644
--- a/download.lst
+++ b/download.lst
@@ -75,8 +75,8 @@ CPPUNIT_TARBALL := cppunit-1.15.1.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-CURL_SHA256SUM := 
2d61116e5f485581f6d59865377df4463f2e788677ac43222b496d4e49fb627b
-CURL_TARBALL := curl-7.86.0.tar.xz
+CURL_SHA256SUM := 
ee5f1a1955b0ed413435ef79db28b834ea5f0fb7c8cfb1ce47175cc3bee08fff
+CURL_TARBALL := curl-7.87.0.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
diff --git a/external/curl/asan-poison-nsspem.patch.0 
b/external/curl/asan-poison-nsspem.patch.0
index 8675f06e6b8b..1f490bd6bf86 100644
--- a/external/curl/asan-poison-nsspem.patch.0
+++ b/external/curl/asan-poison-nsspem.patch.0
@@ -1,6 +1,6 @@
 --- lib/vtls/nss.c
 +++ lib/vtls/nss.c
-@@ -1942,7 +1942,7 @@
+@@ -1945,7 +1945,7 @@
  
PK11_SetPasswordFunc(nss_get_password);
  
diff --git a/external/curl/curl-msvc-disable-protocols.patch.1 
b/external/curl/curl-msvc-disable-protocols.patch.1
index 89c4ff576f85..71ff0c01a028 100644
--- a/external/curl/curl-msvc-disable-protocols.patch.1
+++ b/external/curl/curl-msvc-disable-protocols.patch.1
@@ -2,7 +2,7 @@ disable protocols nobody needs in MSVC build
 
 --- curl/lib/config-win32.h.orig   2017-08-09 16:43:29.46400 +0200
 +++ curl/lib/config-win32.h2017-08-09 16:47:38.54920 +0200
-@@ -616,4 +616,20 @@
+@@ -654,4 +654,20 @@
  #  define ENABLE_IPV6 1
  #endif
  
diff --git a/external/curl/curl-nss.patch.1 b/external/curl/curl-nss.patch.1
index 5ef25748d7eb..2128849369e7 100644
--- a/external/curl/curl-nss.patch.1
+++ b/external/curl/curl-nss.patch.1
@@ -1,7 +1,7 @@
 diff -ur curl.org/configure curl/configure
 --- curl.org/configure 2016-03-13 15:14:07.17776 +0100
 +++ curl/configure 2016-03-13 15:16:44.13276 +0100
-@@ -27985,7 +27985,12 @@
+@@ -28230,7 +28230,12 @@
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Using hard-wired 
libraries and compilation flags for NSS." >&5
  printf "%s\n" "$as_me: WARNING: Using hard-wired libraries and compilation 
flags for NSS." >&2;}
addld="-L$OPT_NSS/lib"
diff --git a/external/curl/zlib.patch.0 b/external/curl/zlib.patch.0
index b8e242a3aaea..b4442ba262d1 100644
--- a/external/curl/zlib.patch.0
+++ b/external/curl/zlib.patch.0
@@ -1,6 +1,6 @@
 --- configure
 +++ configure
-@@ -22808,7 +22808,6 @@
+@@ -23035,7 +23035,6 @@
  clean_CPPFLAGS=$CPPFLAGS
  clean_LDFLAGS=$LDFLAGS
  clean_LIBS=$LIBS
@@ -8,7 +8,7 @@
  
  # Check whether --with-zlib was given.
  if test ${with_zlib+y}
-@@ -22818,6 +22818,7 @@
+@@ -23045,6 +23044,7 @@
  
  
  if test "$OPT_ZLIB" = "no" ; then
@@ -16,7 +16,7 @@
  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: zlib disabled" >&5
  printf "%s\n" "$as_me: WARNING: zlib disabled" >&2;}
  else
-@@ -22825,6 +825,21 @@
+@@ -23052,6 +23052,21 @@
  OPT_ZLIB=""
fi
  
@@ -38,7 +38,7 @@
if test -z "$OPT_ZLIB" ; then
  
  if test -n "$PKG_CONFIG"; then
-@@ -23120,6 +23120,7 @@
+@@ -23344,6 +23359,7 @@
  printf "%s\n" "$as_me: found both libz and libz.h header" >&6;}
  curl_zlib_msg="enabled"
fi
@@ -48,7 +48,7 @@
   if test x"$AMFIXLIB" = x1; then
 --- configure.ac
 +++ configure.ac
-@@ -1222,19 +1222,30 @@
+@@ -1243,19 +1243,30 @@
  clean_CPPFLAGS=$CPPFLAGS
  clean_LDFLAGS=$LDFLAGS
  clean_LIBS=$LIBS
@@ -80,7 +80,7 @@
if test -z "$OPT_ZLIB" ; then
  CURL_CHECK_PKGCONFIG(zlib)
  
-@@ -1316,6 +1316,7 @@
+@@ -1336,6 +1347,7 @@
  AC_MSG_NOTICE([found both libz and libz.h header])
  curl_zlib_msg="enabled"
fi


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

2023-01-06 Thread Eike Rathke (via logerrit)
 i18nlangtag/source/isolang/isolang.cxx |7 ++-
 include/i18nlangtag/lang.h |6 ++
 2 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 54d25b36c0bf3dcc715f2098ad658bb113e868ec
Author: Eike Rathke 
AuthorDate: Fri Jan 6 18:53:11 2023 +0100
Commit: Eike Rathke 
CommitDate: Sat Jan 7 02:20:26 2023 +

Related: tdf#152781 Pin some known on-the-fly langtags to user-defined LCIDs

These are pulled in by either our own bundled extension
dictionaries (es-*, ca-*), or hunspell dictionary (en-AG), but
have no language listbox entry (and don't need one until someone
insists) thus are generated.

So if selected and in case stored in binary MS file formats ensure
a stable back-and-forth conversion. The on-the-fly 0x7e1, 0x7e2,
... are generated arbitrarily in order as encountered.

Change-Id: I0dc72bf1301b26d5b82e1b271c58fc77c82eea0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145161
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/i18nlangtag/source/isolang/isolang.cxx 
b/i18nlangtag/source/isolang/isolang.cxx
index 2bd6b5e5e229..d64b00f0694a 100644
--- a/i18nlangtag/source/isolang/isolang.cxx
+++ b/i18nlangtag/source/isolang/isolang.cxx
@@ -343,7 +343,9 @@ IsoLanguageCountryEntry const aImplIsoLangEntries[] =
 { LANGUAGE_SINDHI,  "sd", "IN", kSAME },// 
Devanagari script
 { LANGUAGE_BELARUSIAN,  "be", "BY", k0},
 { LANGUAGE_CATALAN, "ca", "ES", k0},// Spain 
(default)
-{ LANGUAGE_CATALAN, "ca", "AD", k0},// Andorra
+{ LANGUAGE_USER_CATALAN_ANDORRA,"ca", "AD", k0},
+{ LANGUAGE_USER_CATALAN_FRANCE, "ca", "FR", k0},
+{ LANGUAGE_USER_CATALAN_ITALY,  "ca", "IT", k0},
 //LANGUAGE_CATALAN_VALENCIAN ca-ES-valencia Bcp47CountryEntry takes 
precedence
 { LANGUAGE_CATALAN_VALENCIAN,   "ca", "XV", kSAME },// XV: ISO 
3166 user-assigned; old workaround for UI localization only, in case it escaped 
to document content
 { LANGUAGE_CATALAN_VALENCIAN,  "qcv", "ES", kSAME },// qcv: 
ISO 639-3 reserved-for-local-use; old UI localization quirk only, in case it 
escaped to document content
@@ -674,6 +676,9 @@ IsoLanguageCountryEntry const aImplIsoLangEntries[] =
 { LANGUAGE_USER_ENGLISH_ISRAEL, "en", "IL", k0},
 { LANGUAGE_USER_PENNSYLVANIA_DUTCH,"pdc", "US", k0},
 { LANGUAGE_USER_PORTUGUESE_MOZAMBIQUE,  "pt", "MZ", k0},
+{ LANGUAGE_USER_SPANISH_EQUATORIAL_GUINEA, "es", "GQ", k0},
+{ LANGUAGE_USER_SPANISH_PHILIPPINES,"es", "PH", k0},
+{ LANGUAGE_USER_ENGLISH_ANTIGUA_BARBUDA,"en", "AG", k0},
 // Add new languages ^^^ there.
 { LANGUAGE_MULTIPLE,   "mul", ""  , k0},// 
multiple languages, many languages are used
 { LANGUAGE_UNDETERMINED,   "und", ""  , k0},// 
undetermined language, language cannot be identified
diff --git a/include/i18nlangtag/lang.h b/include/i18nlangtag/lang.h
index 59e20669cddd..55be18878209 100644
--- a/include/i18nlangtag/lang.h
+++ b/include/i18nlangtag/lang.h
@@ -776,6 +776,12 @@ namespace o3tl
 #define LANGUAGE_USER_INTERSLAVIC_CYRILLIC  LanguageType(0x06AE)
 #define LANGUAGE_USER_PENNSYLVANIA_DUTCHLanguageType(0x06AF)
 #define LANGUAGE_USER_PORTUGUESE_MOZAMBIQUE LanguageType(0x8416)  /* 
makeLangID( 0x21, getPrimaryLanguage( LANGUAGE_PORTUGUESE)) */
+#define LANGUAGE_USER_SPANISH_EQUATORIAL_GUINEA LanguageType(0x840A)  /* 
makeLangID( 0x21, getPrimaryLanguage( LANGUAGE_SPANISH)) */
+#define LANGUAGE_USER_SPANISH_PHILIPPINES   LanguageType(0x880A)  /* 
makeLangID( 0x22, getPrimaryLanguage( LANGUAGE_SPANISH)) */
+#define LANGUAGE_USER_CATALAN_ANDORRA   LanguageType(0x8403)  /* 
makeLangID( 0x21, getPrimaryLanguage( LANGUAGE_CATALAN)) */
+#define LANGUAGE_USER_CATALAN_FRANCELanguageType(0x8803)  /* 
makeLangID( 0x22, getPrimaryLanguage( LANGUAGE_CATALAN)) */
+#define LANGUAGE_USER_CATALAN_ITALY LanguageType(0x8C03)  /* 
makeLangID( 0x23, getPrimaryLanguage( LANGUAGE_CATALAN)) */
+#define LANGUAGE_USER_ENGLISH_ANTIGUA_BARBUDA LanguageType(0xB809)  /* 
makeLangID( 0x2E, getPrimaryLanguage( LANGUAGE_ENGLISH_UK)) */
 
 
 /* XXX Add new user defined LCIDs ^^^ there.