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

2023-01-11 Thread Heiko Tietze (via logerrit)
 svx/source/tbxctrls/tbcontrl.cxx |   47 ++-
 1 file changed, 13 insertions(+), 34 deletions(-)

New commits:
commit 95756934cf56e4a9ff58464bc0ed6881c15fe411
Author: Heiko Tietze 
AuthorDate: Tue Jan 10 15:10:41 2023 +0100
Commit: Heiko Tietze 
CommitDate: Wed Jan 11 08:21:47 2023 +

Resolves tdf#152666 - Hide default styles for large lists

Show the default styles only if the number of items
are low and hide successively otherwise

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

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 4563010ac053..03b4f4706ce3 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3180,38 +3180,12 @@ void SvxStyleToolBoxControl::FillStyleBox()
 
 std::vector aStyles;
 
+// add used styles
+pStyle = xIter->Next();
+while ( pStyle )
 {
+aStyles.push_back(pStyle->GetName());
 pStyle = xIter->Next();
-
-if( pImpl->bSpecModeWriter || pImpl->bSpecModeCalc )
-{
-while ( pStyle )
-{
-// sort out default styles
-bool bInsert = true;
-OUString aName( pStyle->GetName() );
-for( auto const & _i: pImpl->aDefaultStyles )
-{
-if( _i.first == aName || _i.second == aName )
-{
-bInsert = false;
-break;
-}
-}
-
-if( bInsert )
-aStyles.push_back(aName);
-pStyle = xIter->Next();
-}
-}
-else
-{
-while ( pStyle )
-{
-aStyles.push_back(pStyle->GetName());
-pStyle = xIter->Next();
-}
-}
 }
 
 if (pImpl->bSpecModeWriter || pImpl->bSpecModeCalc)
@@ -3219,11 +3193,16 @@ void SvxStyleToolBoxControl::FillStyleBox()
 pBox->append_text(pImpl->aClearForm);
 pBox->insert_separator(1, "separator");
 
-// insert default styles
-for (const auto &rStyle : pImpl->aDefaultStyles)
-pBox->append_text(rStyle.second);
+// add default styles if less than 12 items
+for( const auto &rStyle : pImpl->aDefaultStyles )
+{
+if ( aStyles.size() + pBox->get_count() > 12)
+break;
+// insert default style only if not used (and added to rStyle 
before)
+if (std::find(aStyles.begin(), aStyles.end(), rStyle.second) >= 
aStyles.end())
+pBox->append_text(rStyle.second);
+}
 }
-
 std::sort(aStyles.begin(), aStyles.end());
 
 for (const auto& rStyle : aStyles)


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

2023-01-11 Thread Caolán McNamara (via logerrit)
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx |   28 ++
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx |   12 ++
 vcl/unx/generic/gdi/gdiimpl.cxx |  111 
 vcl/unx/generic/gdi/gdiimpl.hxx |   11 --
 4 files changed, 38 insertions(+), 124 deletions(-)

New commits:
commit f4b8dbe9c2d54494f2666df7eaeae19198158b9c
Author: Caolán McNamara 
AuthorDate: Tue Jan 10 14:08:36 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 11 08:47:43 2023 +

reuse CairoCommon copyArea from X11CairoSalGraphicsImpl

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

diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx 
b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
index c6c4af83039b..cdcaa291cfcf 100644
--- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
+++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
@@ -131,4 +131,32 @@ bool 
X11CairoSalGraphicsImpl::supportsOperation(OutDevSupportType eType) const
 return CairoCommon::supportsOperation(eType);
 }
 
+void X11CairoSalGraphicsImpl::copyArea(tools::Long nDestX, tools::Long nDestY, 
tools::Long nSrcX,
+   tools::Long nSrcY, tools::Long 
nSrcWidth,
+   tools::Long nSrcHeight, bool 
/*bWindowInvalidate*/)
+{
+SalTwoRect aTR(nSrcX, nSrcY, nSrcWidth, nSrcHeight, nDestX, nDestY, 
nSrcWidth, nSrcHeight);
+
+cairo_surface_t* source = mrCairoCommon.m_pSurface;
+mrCairoCommon.copyBitsCairo(aTR, source, getAntiAlias());
+}
+
+void X11CairoSalGraphicsImpl::copyBits(const SalTwoRect& rTR, SalGraphics* 
pSrcGraphics)
+{
+cairo_surface_t* source = nullptr;
+
+if (pSrcGraphics)
+{
+X11CairoSalGraphicsImpl* pSrc
+= static_cast(pSrcGraphics->GetImpl());
+source = pSrc->mrCairoCommon.m_pSurface;
+}
+else
+{
+source = mrCairoCommon.m_pSurface;
+}
+
+mrCairoCommon.copyBitsCairo(rTR, source, getAntiAlias());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx 
b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
index 08704a642659..8bf49ec423de 100644
--- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
+++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
@@ -132,9 +132,17 @@ public:
 
 void invert(sal_uInt32 nPoints, const Point* pPtAry, SalInvert nFlags) 
override;
 
-virtual bool hasFastDrawTransformedBitmap() const override;
+// CopyArea --> No RasterOp, but ClipRegion
+void copyArea(tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX, 
tools::Long nSrcY,
+  tools::Long nSrcWidth, tools::Long nSrcHeight, bool 
bWindowInvalidate) override;
 
-virtual bool supportsOperation(OutDevSupportType eType) const override;
+// CopyBits and DrawBitmap --> RasterOp and ClipRegion
+// CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
+void copyBits(const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics) 
override;
+
+bool hasFastDrawTransformedBitmap() const override;
+
+bool supportsOperation(OutDevSupportType eType) const override;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx
index 3e4256184674..bfe8995c025f 100644
--- a/vcl/unx/generic/gdi/gdiimpl.cxx
+++ b/vcl/unx/generic/gdi/gdiimpl.cxx
@@ -305,117 +305,6 @@ GC X11SalGraphicsImpl::SelectPen()
 return mpPenGC;
 }
 
-void X11SalGraphicsImpl::copyBits( const SalTwoRect& rPosAry,
-  SalGraphics  *pSSrcGraphics )
-{
-X11SalGraphics* pSrcGraphics = pSSrcGraphics
-? static_cast(pSSrcGraphics)
-: &mrParent;
-
-if( rPosAry.mnSrcWidth <= 0
-|| rPosAry.mnSrcHeight <= 0
-|| rPosAry.mnDestWidth <= 0
-|| rPosAry.mnDestHeight <= 0 )
-{
-return;
-}
-
-int n;
-if( pSrcGraphics == &mrParent )
-{
-n = 2;
-}
-else if( pSrcGraphics->bWindow_ )
-{
-// window or compatible virtual device
-if( pSrcGraphics->GetDisplay() == mrParent.GetDisplay() &&
-pSrcGraphics->m_nXScreen == mrParent.m_nXScreen &&
-pSrcGraphics->GetVisual().GetDepth() == 
mrParent.GetVisual().GetDepth()
-)
-n = 2; // same Display
-else
-n = 1; // printer or other display
-}
-else if( pSrcGraphics->bVirDev_ )
-{
-n = 1; // window or compatible virtual device
-}
-else
-n = 0;
-
-if( n == 2
-&& rPosAry.mnSrcWidth   == rPosAry.mnDestWidth
-&& rPosAry.mnSrcHeight == rPosAry.mnDestHeight
-)
-{
-// #i60699# Need to generate graphics exposures (to repaint
-// obscured areas beneath overlapping wi

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

2023-01-11 Thread Caolán McNamara (via logerrit)
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx |   22 ++
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx |   13 +
 vcl/unx/generic/gdi/gdiimpl.cxx |   21 -
 vcl/unx/generic/gdi/gdiimpl.hxx |   22 --
 4 files changed, 35 insertions(+), 43 deletions(-)

New commits:
commit 99240ec736524d1888fc12029851852a21fe2147
Author: Caolán McNamara 
AuthorDate: Tue Jan 10 14:23:04 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 11 08:48:34 2023 +

move unimplemented stubs to X11CairoSalGraphicsImpl

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

diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx 
b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
index cdcaa291cfcf..752e70cc3a99 100644
--- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
+++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
@@ -159,4 +159,26 @@ void X11CairoSalGraphicsImpl::copyBits(const SalTwoRect& 
rTR, SalGraphics* pSrcG
 mrCairoCommon.copyBitsCairo(rTR, source, getAntiAlias());
 }
 
+bool X11CairoSalGraphicsImpl::drawPolyLineBezier(sal_uInt32, const Point*, 
const PolyFlags*)
+{
+return false;
+}
+
+bool X11CairoSalGraphicsImpl::drawPolygonBezier(sal_uInt32, const Point*, 
const PolyFlags*)
+{
+return false;
+}
+
+bool X11CairoSalGraphicsImpl::drawPolyPolygonBezier(sal_uInt32, const 
sal_uInt32*,
+const Point* const*, const 
PolyFlags* const*)
+{
+return false;
+}
+
+bool X11CairoSalGraphicsImpl::drawEPS(tools::Long, tools::Long, tools::Long, 
tools::Long, void*,
+  sal_uInt32)
+{
+return false;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx 
b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
index 8bf49ec423de..b0a8a85e4f90 100644
--- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
+++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
@@ -140,6 +140,19 @@ public:
 // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
 void copyBits(const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics) 
override;
 
+bool drawPolyLineBezier(sal_uInt32 nPoints, const Point* pPtAry,
+const PolyFlags* pFlgAry) override;
+
+bool drawPolygonBezier(sal_uInt32 nPoints, const Point* pPtAry,
+   const PolyFlags* pFlgAry) override;
+
+bool drawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32* pPoints,
+   const Point* const* pPtAry,
+   const PolyFlags* const* pFlgAry) override;
+
+bool drawEPS(tools::Long nX, tools::Long nY, tools::Long nWidth, 
tools::Long nHeight,
+ void* pPtr, sal_uInt32 nSize) override;
+
 bool hasFastDrawTransformedBitmap() const override;
 
 bool supportsOperation(OutDevSupportType eType) const override;
diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx
index bfe8995c025f..a54977874eef 100644
--- a/vcl/unx/generic/gdi/gdiimpl.cxx
+++ b/vcl/unx/generic/gdi/gdiimpl.cxx
@@ -840,27 +840,6 @@ void X11SalGraphicsImpl::SetXORMode( bool bSet, bool )
 }
 }
 
-bool X11SalGraphicsImpl::drawPolyLineBezier( sal_uInt32, const Point*, const 
PolyFlags* )
-{
-return false;
-}
-
-bool X11SalGraphicsImpl::drawPolygonBezier( sal_uInt32, const Point*, const 
PolyFlags* )
-{
-return false;
-}
-
-bool X11SalGraphicsImpl::drawPolyPolygonBezier( sal_uInt32, const sal_uInt32*,
-const Point* const*, const 
PolyFlags* const* )
-{
-return false;
-}
-
-bool X11SalGraphicsImpl::drawEPS( 
tools::Long,tools::Long,tools::Long,tools::Long,void*,sal_uInt32 )
-{
-return false;
-}
-
 tools::Long X11SalGraphicsImpl::GetGraphicsHeight() const
 {
 if( mrParent.m_pFrame )
diff --git a/vcl/unx/generic/gdi/gdiimpl.hxx b/vcl/unx/generic/gdi/gdiimpl.hxx
index 974a7d168423..af5f8b029849 100644
--- a/vcl/unx/generic/gdi/gdiimpl.hxx
+++ b/vcl/unx/generic/gdi/gdiimpl.hxx
@@ -129,22 +129,6 @@ public:
 // set fill color for raster operations
 virtual void SetROPFillColor( SalROPColor nROPColor ) override;
 
-virtual bool drawPolyLineBezier(
-sal_uInt32 nPoints,
-const Point* pPtAry,
-const PolyFlags* pFlgAry ) override;
-
-virtual bool drawPolygonBezier(
-sal_uInt32 nPoints,
-const Point* pPtAry,
-const PolyFlags* pFlgAry ) override;
-
-virtual bool drawPolyPolygonBezier(
-sal_uInt32 nPoly,
-const sal_uInt32* pPoints,
-const Point* const* pPtAry,
-const PolyFlags* const* pFlgAry ) override;
-
  

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

2023-01-11 Thread Caolán McNamara (via logerrit)
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx |   28 ---
 vcl/unx/generic/gdi/gdiimpl.cxx |  192 
 vcl/unx/generic/gdi/gdiimpl.hxx |   38 
 3 files changed, 7 insertions(+), 251 deletions(-)

New commits:
commit b8c66c7f9b25ff88994aef92f56f61f176dc8a6f
Author: Caolán McNamara 
AuthorDate: Tue Jan 10 14:35:52 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 11 08:49:02 2023 +

move getRenderBackendName to X11CairoSalGraphicsImpl

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

diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx 
b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
index 1b5867afe505..a70abab552c3 100644
--- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
+++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
@@ -32,6 +32,8 @@ private:
 public:
 X11CairoSalGraphicsImpl(X11SalGraphics& rParent, CairoCommon& 
rCairoCommon);
 
+virtual OUString getRenderBackendName() const override { return "gen"; }
+
 void ResetClipRegion() override
 {
 mrCairoCommon.m_aClipRegion.SetNull();
diff --git a/vcl/unx/generic/gdi/gdiimpl.hxx b/vcl/unx/generic/gdi/gdiimpl.hxx
index dfa55ae73c22..6832ddf61d09 100644
--- a/vcl/unx/generic/gdi/gdiimpl.hxx
+++ b/vcl/unx/generic/gdi/gdiimpl.hxx
@@ -77,8 +77,6 @@ public:
 
 virtual ~X11SalGraphicsImpl() override;
 
-virtual OUString getRenderBackendName() const override { return "gen"; }
-
 virtual void setClipRegion( const vcl::Region& ) override;
 //
 // get the depth of the device
commit 1293656284893209ca174f42d19b2fa72a40117a
Author: Caolán McNamara 
AuthorDate: Tue Jan 10 14:34:06 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 11 08:48:52 2023 +

drop recently unused code

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

diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx 
b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
index b0a8a85e4f90..1b5867afe505 100644
--- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
+++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
@@ -44,29 +44,13 @@ public:
 X11SalGraphicsImpl::setClipRegion(i_rClip);
 }
 
-void SetLineColor() override
-{
-mrCairoCommon.m_oLineColor = std::nullopt;
-X11SalGraphicsImpl::SetLineColor();
-}
+void SetLineColor() override { mrCairoCommon.m_oLineColor = std::nullopt; }
 
-void SetLineColor(Color nColor) override
-{
-mrCairoCommon.m_oLineColor = nColor;
-X11SalGraphicsImpl::SetLineColor(nColor);
-}
+void SetLineColor(Color nColor) override { mrCairoCommon.m_oLineColor = 
nColor; }
 
-void SetFillColor() override
-{
-mrCairoCommon.m_oFillColor = std::nullopt;
-X11SalGraphicsImpl::SetFillColor();
-}
+void SetFillColor() override { mrCairoCommon.m_oFillColor = std::nullopt; }
 
-void SetFillColor(Color nColor) override
-{
-mrCairoCommon.m_oFillColor = nColor;
-X11SalGraphicsImpl::SetFillColor(nColor);
-}
+void SetFillColor(Color nColor) override { mrCairoCommon.m_oFillColor = 
nColor; }
 
 void SetXORMode(bool bSet, bool bInvertOnly) override
 {
@@ -77,13 +61,11 @@ public:
 void SetROPLineColor(SalROPColor nROPColor) override
 {
 mrCairoCommon.SetROPLineColor(nROPColor);
-X11SalGraphicsImpl::SetROPLineColor(nROPColor);
 }
 
 void SetROPFillColor(SalROPColor nROPColor) override
 {
 mrCairoCommon.SetROPFillColor(nROPColor);
-X11SalGraphicsImpl::SetROPFillColor(nROPColor);
 }
 
 void clipRegion(cairo_t* cr) { CairoCommon::clipRegion(cr, 
mrCairoCommon.m_aClipRegion); }
diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx
index a54977874eef..e84ea8e1266e 100644
--- a/vcl/unx/generic/gdi/gdiimpl.cxx
+++ b/vcl/unx/generic/gdi/gdiimpl.cxx
@@ -95,21 +95,10 @@ namespace
 
 X11SalGraphicsImpl::X11SalGraphicsImpl(X11SalGraphics& rParent):
 mrParent(rParent),
-moBrushColor( std::in_place, 0xFF, 0xFF, 0XFF ),
-mpBrushGC(nullptr),
-mnBrushPixel(0),
-mbPenGC(false),
-mbBrushGC(false),
 mbCopyGC(false),
 mbInvertGC(false),
-mbInvert50GC(false),
 mbStippleGC(false),
-mbTrackingGC(false),
-mbDitherBrush(false),
 mbXORMode(false),
-mpPenGC(nullptr),
-moPenColor( std::in_place, 0x00, 0x00, 0x00 ),
-mnPenPixel(0),
 mpCopyGC(nullptr),
 mpInvertGC(nullptr),
 mpStippleGC(nullptr)
@@ -122,8 +111,6 @@ X11SalGraphicsImpl::~X11SalGraphicsImpl()
 
 void X11SalGraphicsImpl::Init()
 {
-mnPenPixel = moPenColor ? mrParent.GetPixel(*moPenColor) : 0;
-mnBrushPixel = moBrushColor ? mrParent.GetPixe

[Libreoffice-commits] core.git: canvas/source cppcanvas/qa desktop/source drawinglayer/source forms/source include/vcl oox/source sd/qa slideshow/source svx/source vcl/osx vcl/qa vcl/skia vcl/source v

2023-01-11 Thread Noel Grandin (via logerrit)
 canvas/source/directx/dx_vcltools.cxx|2 -
 cppcanvas/qa/unit/test.cxx   |2 -
 desktop/source/lib/init.cxx  |2 -
 drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx |6 ++--
 drawinglayer/source/primitive2d/softedgeprimitive2d.cxx  |2 -
 drawinglayer/source/processor2d/cairopixelprocessor2d.cxx|2 -
 drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx  |6 ++--
 drawinglayer/source/texture/texture3d.cxx|2 -
 forms/source/component/imgprod.cxx   |2 -
 include/vcl/bitmapex.hxx |2 -
 oox/source/drawingml/fillproperties.cxx  |2 -
 sd/qa/unit/PNGExportTests.cxx|4 +--
 slideshow/source/engine/shapes/gdimtftools.cxx   |6 ++--
 svx/source/dialog/_bmpmask.cxx   |4 +--
 svx/source/dialog/_contdlg.cxx   |4 +--
 vcl/osx/salinst.cxx  |2 -
 vcl/qa/cppunit/BitmapProcessorTest.cxx   |2 -
 vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx |2 -
 vcl/qa/cppunit/canvasbitmaptest.cxx  |4 +--
 vcl/qa/cppunit/graphicfilter/filters-webp-test.cxx   |4 +--
 vcl/qa/cppunit/png/PngFilterTest.cxx |2 -
 vcl/skia/osx/bitmap.cxx  |2 -
 vcl/source/bitmap/BitmapAlphaClampFilter.cxx |2 -
 vcl/source/bitmap/BitmapBasicMorphologyFilter.cxx|2 -
 vcl/source/bitmap/BitmapDisabledImageFilter.cxx  |2 -
 vcl/source/bitmap/BitmapEx.cxx   |   14 +--
 vcl/source/bitmap/BitmapFastScaleFilter.cxx  |2 -
 vcl/source/bitmap/BitmapFilterStackBlur.cxx  |2 -
 vcl/source/bitmap/BitmapLightenFilter.cxx|2 -
 vcl/source/bitmap/BitmapTools.cxx|   14 +--
 vcl/source/filter/egif/egif.cxx  |2 -
 vcl/source/filter/eps/eps.cxx|8 +++---
 vcl/source/filter/graphicfilter.cxx  |2 -
 vcl/source/filter/png/PngImageWriter.cxx |2 -
 vcl/source/filter/webp/writer.cxx|2 -
 vcl/source/filter/wmf/emfwr.cxx  |6 ++--
 vcl/source/filter/wmf/wmfwr.cxx  |6 ++--
 vcl/source/gdi/FileDefinitionWidgetDraw.cxx  |2 -
 vcl/source/gdi/gdimetafiletools.cxx  |2 -
 vcl/source/gdi/gdimtf.cxx|2 -
 vcl/source/gdi/pdfwriter_impl.cxx|6 ++--
 vcl/source/gdi/pdfwriter_impl2.cxx   |2 -
 vcl/source/gdi/print.cxx |2 -
 vcl/source/graphic/GraphicObject2.cxx|4 +--
 vcl/source/graphic/UnoGraphic.cxx|4 +--
 vcl/source/helper/canvasbitmap.cxx   |2 -
 vcl/source/image/Image.cxx   |2 -
 vcl/source/outdev/background.cxx |2 -
 vcl/source/outdev/bitmapex.cxx   |   10 +++
 vcl/source/outdev/textline.cxx   |2 -
 vcl/source/outdev/transparent.cxx|4 +--
 vcl/source/outdev/wallpaper.cxx  |2 -
 vcl/source/rendercontext/drawmode.cxx|4 +--
 vcl/unx/generic/window/salframe.cxx  |4 +--
 vcl/workben/vcldemo.cxx  |4 +--
 55 files changed, 97 insertions(+), 97 deletions(-)

New commits:
commit cfb2a587bc59d2a0ff520dd09393f898506055d6
Author: Noel Grandin 
AuthorDate: Mon Jan 9 15:58:59 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Jan 11 08:57:13 2023 +

rename BitmapEx::GetAlpha to GetAlphaMask

to ease the reading of code related to an upcoming patch to convert
transparency to alpha, since there is already a GetAlpha in Color.

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

diff --git a/canvas/source/directx/dx_vcltools.cxx 
b/canvas/source/directx/dx_vcltools.cxx
index 9d5d3e85834b..33c3bd275e62 100644
--- a/canvas/source/directx/dx_vcltools.cxx
+++ b/canvas/source/directx/dx_vcltools.cxx
@@ -165,7 +165,7 @@ namespace dxcanvas::tools
   "::dxcanvas::tools::bitmapFromVCLBitmapEx(): 
"
   "Unable to 

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

2023-01-11 Thread Julien Nabet (via logerrit)
 desktop/source/minidump/minidump.cxx |   34 +-
 1 file changed, 13 insertions(+), 21 deletions(-)

New commits:
commit cea290394ee1f02cfc10c1a801cdb6f6faa6d42d
Author: Julien Nabet 
AuthorDate: Sun Jan 8 14:08:53 2023 +0100
Commit: Xisco Fauli 
CommitDate: Wed Jan 11 09:04:24 2023 +

Fix deprecated Curl elements for minidump part

Change-Id: I43df411eed24e86f5d72982b5d24188e0cb7e507
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145177
Tested-by: Jenkins
Reviewed-by: Julien Nabet 
(cherry picked from commit 5c4fa7ddb0b12d30304bbc6119a0aa1d3d65b55d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145302
Reviewed-by: Xisco Fauli 

diff --git a/desktop/source/minidump/minidump.cxx 
b/desktop/source/minidump/minidump.cxx
index b6f52251206b..0bf20f2aa419 100644
--- a/desktop/source/minidump/minidump.cxx
+++ b/desktop/source/minidump/minidump.cxx
@@ -132,27 +132,21 @@ static bool uploadContent(std::map& parameters, std::s
 if (!ca_certificate_file.empty())
 curl_easy_setopt(curl, CURLOPT_CAINFO, ca_certificate_file.c_str());
 
-curl_httppost* formpost = nullptr;
-curl_httppost* lastptr = nullptr;
+curl_mime* mime = curl_mime_init(curl);
 std::string additional_data = generate_json(parameters);
-curl_formadd(&formpost, &lastptr,
-CURLFORM_COPYNAME, "AdditionalData",
-CURLFORM_COPYCONTENTS, additional_data.c_str(),
-CURLFORM_END);
+curl_mimepart* part = curl_mime_addpart(mime);
+curl_mime_name(part, "AdditionalData");
+curl_mime_data(part, additional_data.c_str(), CURL_ZERO_TERMINATED);
 
-curl_formadd(&formpost, &lastptr,
-CURLFORM_COPYNAME, "Version",
-CURLFORM_COPYCONTENTS, version.c_str(),
-CURLFORM_END);
+part = curl_mime_addpart(mime);
+curl_mime_name(part, "Version");
+curl_mime_data(part, version.c_str(), CURL_ZERO_TERMINATED);
 
-std::string response_body;
-long response_code;
-curl_formadd(&formpost, &lastptr,
-CURLFORM_COPYNAME, "upload_file_minidump",
-CURLFORM_FILE, file.c_str(),
-CURLFORM_END);
+part = curl_mime_addpart(mime);
+curl_mime_name(part, "upload_file_minidump");
+curl_mime_filedata(part, file.c_str());
 
-curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
+curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
 
 
 // Disable 100-continue header.
@@ -162,6 +156,7 @@ static bool uploadContent(std::map& parameters, std::s
 curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
 
 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
+std::string response_body;
 curl_easy_setopt(curl, CURLOPT_WRITEDATA,
 static_cast(&response_body));
 
@@ -169,6 +164,7 @@ static bool uploadContent(std::map& parameters, std::s
 curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
 
 CURLcode cc = curl_easy_perform(curl);
+long response_code;
 curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
 SAL_WARN_IF(cc != CURLE_OK, "desktop",
 "Failed to send http request to " <<
@@ -176,10 +172,6 @@ static bool uploadContent(std::map& parameters, std::s
 ", error: " <<
 curl_easy_strerror(cc));
 
-if (formpost != nullptr)
-{
-curl_formfree(formpost);
-}
 if (headerlist != nullptr)
 {
 curl_slist_free_all(headerlist);


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

2023-01-11 Thread Julien Nabet (via logerrit)
 desktop/source/app/updater.cxx  |2 +-
 extensions/source/update/check/download.cxx |8 
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit b0684feb0a1f012adaa9bb21bf730bf90601e9d9
Author: Julien Nabet 
AuthorDate: Mon Jan 9 09:01:41 2023 +0100
Commit: Xisco Fauli 
CommitDate: Wed Jan 11 09:46:31 2023 +

Fix deprecated Curl elements for update part

Change-Id: Ide008c8a80800b33c8104ec3d697e836fae73827
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145186
Tested-by: Jenkins
Reviewed-by: Julien Nabet 
(cherry picked from commit 6410fafc6f4d58062d82f86549303f4ae2eec32a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145223
Reviewed-by: Xisco Fauli 

diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index e0d5bcd832b5..9f60a64d7235 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -563,7 +563,7 @@ std::string download_content(const OString& rURL, bool 
bFile, OUString& rHash)
 curl_easy_setopt(curl.get(), CURLOPT_HTTPHEADER, headerlist);
 curl_easy_setopt(curl.get(), CURLOPT_FOLLOWLOCATION, 1); // follow 
redirects
 // only allow redirect to http:// and https://
-curl_easy_setopt(curl.get(), CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | 
CURLPROTO_HTTPS);
+curl_easy_setopt(curl.get(), CURLOPT_REDIR_PROTOCOLS_STR, CURLPROTO_HTTP | 
CURLPROTO_HTTPS);
 
 std::string response_body;
 utl::TempFileNamed aTempFile;
diff --git a/extensions/source/update/check/download.cxx 
b/extensions/source/update/check/download.cxx
index 387c1efd7a4f..3b76f9cc8a27 100644
--- a/extensions/source/update/check/download.cxx
+++ b/extensions/source/update/check/download.cxx
@@ -61,7 +61,7 @@ static void openFile( OutData& out )
 curl_easy_getinfo(out.curl, CURLINFO_EFFECTIVE_URL, &effective_url);
 
 double fDownloadSize;
-curl_easy_getinfo(out.curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, 
&fDownloadSize);
+curl_easy_getinfo(out.curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, 
&fDownloadSize);
 
 OString aURL(effective_url);
 
@@ -233,7 +233,7 @@ static bool curl_run(std::u16string_view rURL, OutData& 
out, const OString& aPro
 // enable redirection
 (void)curl_easy_setopt(pCURL, CURLOPT_FOLLOWLOCATION, 1);
 // only allow redirect to http:// and https://
-(void)curl_easy_setopt(pCURL, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP 
| CURLPROTO_HTTPS);
+(void)curl_easy_setopt(pCURL, CURLOPT_REDIR_PROTOCOLS_STR, 
CURLPROTO_HTTP | CURLPROTO_HTTPS);
 
 // write function
 (void)curl_easy_setopt(pCURL, CURLOPT_WRITEDATA, &out);
@@ -241,7 +241,7 @@ static bool curl_run(std::u16string_view rURL, OutData& 
out, const OString& aPro
 
 // progress handler - Condition::check unfortunately is not defined 
const
 (void)curl_easy_setopt(pCURL, CURLOPT_NOPROGRESS, 0);
-(void)curl_easy_setopt(pCURL, CURLOPT_PROGRESSFUNCTION, 
&progress_callback);
+(void)curl_easy_setopt(pCURL, CURLOPT_XFERINFOFUNCTION, 
&progress_callback);
 (void)curl_easy_setopt(pCURL, CURLOPT_PROGRESSDATA, &out);
 
 // proxy
@@ -275,7 +275,7 @@ static bool curl_run(std::u16string_view rURL, OutData& 
out, const OString& aPro
 // this sometimes happens, when a user throws away his user data, 
but has already
 // completed the download of an update.
 double fDownloadSize;
-curl_easy_getinfo( pCURL, CURLINFO_CONTENT_LENGTH_DOWNLOAD, 
&fDownloadSize );
+curl_easy_getinfo( pCURL, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, 
&fDownloadSize );
 if ( -1 == fDownloadSize )
 {
 out.Handler->downloadFinished(out.File);


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

2023-01-11 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/uiwriter/uiwriter5.cxx |   15 ---
 1 file changed, 15 deletions(-)

New commits:
commit 4a105e03f584b106fa392079dc0573c1806fdaa7
Author: Miklos Vajna 
AuthorDate: Tue Jan 10 19:55:44 2023 +0100
Commit: Miklos Vajna 
CommitDate: Wed Jan 11 09:50:18 2023 +

CppunitTest_sw_ooxmlexport5: remove unused preTest()

This was added by accident in commit
a2a2e07996a0e49164663eaec5d79481bf7bb3e0 (sw: split
CppunitTest_sw_uiwriter2 into uiwriter2 and uiwriter5, 2022-03-02).

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

diff --git a/sw/qa/extras/uiwriter/uiwriter5.cxx 
b/sw/qa/extras/uiwriter/uiwriter5.cxx
index 0ffd8213f06e..0e8974823c62 100644
--- a/sw/qa/extras/uiwriter/uiwriter5.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter5.cxx
@@ -62,21 +62,6 @@ public:
 {
 }
 
-virtual std::unique_ptr preTest(const char* filename) override
-{
-m_aSavedSettings = Application::GetSettings();
-if (OString(filename).indexOf("LocaleArabic") != -1)
-{
-std::unique_ptr pResetter(
-new Resetter([this]() { 
Application::SetSettings(this->m_aSavedSettings); }));
-AllSettings aSettings(m_aSavedSettings);
-aSettings.SetLanguageTag(LanguageTag("ar"));
-Application::SetSettings(aSettings);
-return pResetter;
-}
-return nullptr;
-}
-
 protected:
 AllSettings m_aSavedSettings;
 };


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

2023-01-11 Thread Caolán McNamara (via logerrit)
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx |   17 +
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx |   12 
 vcl/unx/generic/gdi/gdiimpl.cxx |   24 
 vcl/unx/generic/gdi/gdiimpl.hxx |   21 -
 4 files changed, 29 insertions(+), 45 deletions(-)

New commits:
commit 6314c6b33dbe29fcba9d92157eaed42772d9c1fc
Author: Caolán McNamara 
AuthorDate: Tue Jan 10 14:40:37 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 11 10:03:11 2023 +

move more unimplemented stubs to X11CairoSalGraphicsImpl

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

diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx 
b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
index 752e70cc3a99..d703a5e5c93f 100644
--- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
+++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
@@ -181,4 +181,21 @@ bool X11CairoSalGraphicsImpl::drawEPS(tools::Long, 
tools::Long, tools::Long, too
 return false;
 }
 
+bool X11CairoSalGraphicsImpl::blendBitmap(const SalTwoRect&, const SalBitmap&) 
{ return false; }
+
+bool X11CairoSalGraphicsImpl::blendAlphaBitmap(const SalTwoRect&, const 
SalBitmap&,
+   const SalBitmap&, const 
SalBitmap&)
+{
+return false;
+}
+
+bool X11CairoSalGraphicsImpl::drawTransformedBitmap(const basegfx::B2DPoint&,
+const basegfx::B2DPoint&,
+const basegfx::B2DPoint&, 
const SalBitmap&,
+const SalBitmap*, double)
+{
+// here direct support for transformed bitmaps can be implemented
+return false;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx 
b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
index a70abab552c3..49b60f4c05c4 100644
--- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
+++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
@@ -139,6 +139,18 @@ public:
 
 bool hasFastDrawTransformedBitmap() const override;
 
+/** draw transformed bitmap (maybe with alpha) where Null, X, Y define the 
coordinate system */
+bool drawTransformedBitmap(const basegfx::B2DPoint& rNull, const 
basegfx::B2DPoint& rX,
+   const basegfx::B2DPoint& rY, const SalBitmap& 
rSourceBitmap,
+   const SalBitmap* pAlphaBitmap, double fAlpha) 
override;
+
+/** Blend bitmap with color channels */
+bool blendBitmap(const SalTwoRect&, const SalBitmap& rBitmap) override;
+
+/** Render bitmap by blending using the mask and alpha channel */
+bool blendAlphaBitmap(const SalTwoRect&, const SalBitmap& rSrcBitmap,
+  const SalBitmap& rMaskBitmap, const SalBitmap& 
rAlphaBitmap) override;
+
 bool supportsOperation(OutDevSupportType eType) const override;
 };
 
diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx
index e84ea8e1266e..5413c2b69980 100644
--- a/vcl/unx/generic/gdi/gdiimpl.cxx
+++ b/vcl/unx/generic/gdi/gdiimpl.cxx
@@ -367,18 +367,6 @@ void X11SalGraphicsImpl::drawMaskedBitmap( const 
SalTwoRect& rPosAry,
 XFreePixmap( pXDisp, aBG );
 }
 
-bool X11SalGraphicsImpl::blendBitmap( const SalTwoRect&,
-const SalBitmap& )
-{
-return false;
-}
-
-bool X11SalGraphicsImpl::blendAlphaBitmap( const SalTwoRect&,
-const SalBitmap&, const SalBitmap&, const SalBitmap& )
-{
-return false;
-}
-
 bool X11SalGraphicsImpl::drawAlphaBitmap( const SalTwoRect& rTR,
 const SalBitmap& rSrcBitmap, const SalBitmap& rAlphaBmp )
 {
@@ -511,18 +499,6 @@ bool X11SalGraphicsImpl::drawAlphaBitmap( const 
SalTwoRect& rTR,
 return true;
 }
 
-bool X11SalGraphicsImpl::drawTransformedBitmap(
-const basegfx::B2DPoint&,
-const basegfx::B2DPoint&,
-const basegfx::B2DPoint&,
-const SalBitmap&,
-const SalBitmap*,
-double)
-{
-// here direct support for transformed bitmaps can be implemented
-return false;
-}
-
 void X11SalGraphicsImpl::drawMask( const SalTwoRect& rPosAry,
const SalBitmap &rSalBitmap,
Color nMaskColor )
diff --git a/vcl/unx/generic/gdi/gdiimpl.hxx b/vcl/unx/generic/gdi/gdiimpl.hxx
index 6832ddf61d09..771dcd039c9c 100644
--- a/vcl/unx/generic/gdi/gdiimpl.hxx
+++ b/vcl/unx/generic/gdi/gdiimpl.hxx
@@ -105,18 +105,6 @@ public:
 
 virtual std::shared_ptr getBitmap( tools::Long nX, tools::Long 
nY, tools::Long nWidth, tools::Long nHeight ) override;
 
-/** Blend bitmap with color channels */
-virtual bool blendBitmap(
-const SalTwoRect&,
-const SalBitmap& rBitmap ) override;
-
-/** R

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

2023-01-11 Thread Caolán McNamara (via logerrit)
 vcl/headless/CairoCommon.cxx|7 +++
 vcl/headless/SvpGraphicsBackend.cxx |7 +--
 vcl/inc/headless/CairoCommon.hxx|2 ++
 3 files changed, 10 insertions(+), 6 deletions(-)

New commits:
commit ef5eed8e85490c2f45700bbc31bff3f729966ab2
Author: Caolán McNamara 
AuthorDate: Tue Jan 10 15:42:42 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 11 10:03:54 2023 +

move GetBitCount into CairoCommon

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

diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx
index fe5f60021aa6..12f42313081b 100644
--- a/vcl/headless/CairoCommon.cxx
+++ b/vcl/headless/CairoCommon.cxx
@@ -400,6 +400,13 @@ cairo_user_data_key_t* CairoCommon::getDamageKey()
 return &aDamageKey;
 }
 
+sal_uInt16 CairoCommon::GetBitCount() const
+{
+if (cairo_surface_get_content(m_pSurface) != CAIRO_CONTENT_COLOR_ALPHA)
+return 1;
+return 32;
+}
+
 cairo_t* CairoCommon::getCairoContext(bool bXorModeAllowed, bool bAntiAlias) 
const
 {
 cairo_t* cr;
diff --git a/vcl/headless/SvpGraphicsBackend.cxx 
b/vcl/headless/SvpGraphicsBackend.cxx
index 9a4ef1fc734d..f6674925815e 100644
--- a/vcl/headless/SvpGraphicsBackend.cxx
+++ b/vcl/headless/SvpGraphicsBackend.cxx
@@ -41,12 +41,7 @@ void SvpGraphicsBackend::setClipRegion(const vcl::Region& 
i_rClip)
 
 void SvpGraphicsBackend::ResetClipRegion() { 
m_rCairoCommon.m_aClipRegion.SetNull(); }
 
-sal_uInt16 SvpGraphicsBackend::GetBitCount() const
-{
-if (cairo_surface_get_content(m_rCairoCommon.m_pSurface) != 
CAIRO_CONTENT_COLOR_ALPHA)
-return 1;
-return 32;
-}
+sal_uInt16 SvpGraphicsBackend::GetBitCount() const { return 
m_rCairoCommon.GetBitCount(); }
 
 tools::Long SvpGraphicsBackend::GetGraphicsWidth() const
 {
diff --git a/vcl/inc/headless/CairoCommon.hxx b/vcl/inc/headless/CairoCommon.hxx
index ea041a91187c..733118fbd0c0 100644
--- a/vcl/inc/headless/CairoCommon.hxx
+++ b/vcl/inc/headless/CairoCommon.hxx
@@ -143,6 +143,8 @@ struct VCL_DLLPUBLIC CairoCommon
 
 cairo_surface_t* getSurface() const { return m_pSurface; }
 
+sal_uInt16 GetBitCount() const;
+
 cairo_t* getCairoContext(bool bXorModeAllowed, bool bAntiAlias) const;
 void releaseCairoContext(cairo_t* cr, bool bXorModeAllowed,
  const basegfx::B2DRange& rExtents) const;


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

2023-01-11 Thread Rafael Lima (via logerrit)
 sfx2/uiconfig/ui/stylecontextmenu.ui |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0bd3600d9415c10891ea1d90dd598d827d1a9c48
Author: Rafael Lima 
AuthorDate: Tue Jan 10 14:30:56 2023 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Jan 11 10:07:42 2023 +

tdf#152905 Use "Edit Style" instead of "Modify" for consistency

As discussed in the bug report, the context menu in the "Styles" sidebar is 
the only place where the string "Modify..." is used to edit a style, whereas 
other places use "Edit Style...". Hence, let's use it here as well for 
consistency.

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

diff --git a/sfx2/uiconfig/ui/stylecontextmenu.ui 
b/sfx2/uiconfig/ui/stylecontextmenu.ui
index b667a2ef382f..4dfb520ecf95 100644
--- a/sfx2/uiconfig/ui/stylecontextmenu.ui
+++ b/sfx2/uiconfig/ui/stylecontextmenu.ui
@@ -17,7 +17,7 @@
   
 True
 False
-Modify...
+Edit Style...
 True
   
 


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

2023-01-11 Thread Caolán McNamara (via logerrit)
 sc/source/ui/dbgui/tpsort.cxx |   11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 9476a2c29baf8dc7880fc1ae7657a3a69df8b429
Author: Caolán McNamara 
AuthorDate: Tue Jan 10 10:32:10 2023 +
Commit: Xisco Fauli 
CommitDate: Wed Jan 11 10:09:39 2023 +

Resolves: tdf#152950 don't set_active while frozen

Change-Id: I7db73e37ed426aae2282a6bf1564e5d3843442cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145231
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 3455f11006cf..35a24e633058 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -813,6 +813,8 @@ void ScTabPageSortOptions::EdOutPosModHdl()
 
 void ScTabPageSortOptions::FillAlgor()
 {
+tools::Long nCount = 0;
+
 m_xLbAlgorithm->freeze();
 m_xLbAlgorithm->clear();
 
@@ -830,18 +832,19 @@ void ScTabPageSortOptions::FillAlgor()
 lang::Locale aLocale( LanguageTag::convertToLocale( eLang ));
 const uno::Sequence aAlgos = 
m_xColWrap->listCollatorAlgorithms( aLocale );
 
-tools::Long nCount = aAlgos.getLength();
+nCount = aAlgos.getLength();
 for (const OUString& sAlg : aAlgos)
 {
 OUString sUser = m_xColRes->GetTranslation( sAlg );
 m_xLbAlgorithm->append_text(sUser);
 }
-m_xLbAlgorithm->set_active(0);   // first entry is default
-m_xFtAlgorithm->set_sensitive(nCount > 1);  // enable only if 
there is a choice
-m_xLbAlgorithm->set_sensitive(nCount > 1);  // enable only if 
there is a choice
 }
 
 m_xLbAlgorithm->thaw();
+
+m_xLbAlgorithm->set_active(nCount ? 0 : -1);// first entry is default
+m_xFtAlgorithm->set_sensitive(nCount > 1);  // enable only if there is 
a choice
+m_xLbAlgorithm->set_sensitive(nCount > 1);  // enable only if there is 
a choice
 }
 
 IMPL_LINK_NOARG(ScTabPageSortOptions, FillAlgorHdl, weld::ComboBox&, void)


[Libreoffice-commits] core.git: desktop/source extensions/source

2023-01-11 Thread Julien Nabet (via logerrit)
 desktop/source/app/updater.cxx  |6 +-
 extensions/source/update/check/download.cxx |   22 +-
 2 files changed, 18 insertions(+), 10 deletions(-)

New commits:
commit 071c66521c6db7136ea7f4606d48ab9fbcc4c71d
Author: Julien Nabet 
AuthorDate: Mon Jan 9 13:54:45 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Jan 11 10:14:47 2023 +

Fix types for Curl elements (update part)

"CURLOPT_REDIR_PROTOCOLS_STR" has been added with Curl 7.85
so check if Curl version is 7.85 min or use the previous version 
"CURLOPT_REDIR_PROTOCOLS"

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

diff --git a/desktop/source/app/updater.cxx b/desktop/source/app/updater.cxx
index 9f60a64d7235..f74dfbeceb6e 100644
--- a/desktop/source/app/updater.cxx
+++ b/desktop/source/app/updater.cxx
@@ -563,7 +563,11 @@ std::string download_content(const OString& rURL, bool 
bFile, OUString& rHash)
 curl_easy_setopt(curl.get(), CURLOPT_HTTPHEADER, headerlist);
 curl_easy_setopt(curl.get(), CURLOPT_FOLLOWLOCATION, 1); // follow 
redirects
 // only allow redirect to http:// and https://
-curl_easy_setopt(curl.get(), CURLOPT_REDIR_PROTOCOLS_STR, CURLPROTO_HTTP | 
CURLPROTO_HTTPS);
+#if (LIBCURL_VERSION_MAJOR > 7) || (LIBCURL_VERSION_MAJOR == 7 && 
LIBCURL_VERSION_MINOR >= 85)
+curl_easy_setopt(curl.get(), CURLOPT_REDIR_PROTOCOLS_STR, "http,https");
+#else
+curl_easy_setopt(curl.get(), CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | 
CURLPROTO_HTTPS);
+#endif
 
 std::string response_body;
 utl::TempFileNamed aTempFile;
diff --git a/extensions/source/update/check/download.cxx 
b/extensions/source/update/check/download.cxx
index 3b76f9cc8a27..4ba5863930ba 100644
--- a/extensions/source/update/check/download.cxx
+++ b/extensions/source/update/check/download.cxx
@@ -60,8 +60,8 @@ static void openFile( OutData& out )
 char * effective_url;
 curl_easy_getinfo(out.curl, CURLINFO_EFFECTIVE_URL, &effective_url);
 
-double fDownloadSize;
-curl_easy_getinfo(out.curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, 
&fDownloadSize);
+curl_off_t nDownloadSize;
+curl_easy_getinfo(out.curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, 
&nDownloadSize);
 
 OString aURL(effective_url);
 
@@ -94,7 +94,7 @@ static void openFile( OutData& out )
 } while( osl_File_E_EXIST == rc );
 
 if( osl_File_E_None == rc )
-out.Handler->downloadStarted(out.File, 
static_cast(fDownloadSize));
+out.Handler->downloadStarted(out.File, 
static_cast(nDownloadSize));
 }
 }
 
@@ -140,7 +140,7 @@ write_function( void *ptr, size_t size, size_t nmemb, void 
*stream )
 
 
 static int
-progress_callback( void *clientp, double dltotal, double dlnow, 
SAL_UNUSED_PARAMETER double, SAL_UNUSED_PARAMETER double )
+progress_callback( void *clientp, curl_off_t dltotal, curl_off_t dlnow, 
SAL_UNUSED_PARAMETER curl_off_t, SAL_UNUSED_PARAMETER curl_off_t)
 {
 OutData *out = static_cast < OutData * > (clientp);
 
@@ -148,7 +148,7 @@ progress_callback( void *clientp, double dltotal, double 
dlnow, SAL_UNUSED_PARAM
 
 if (out && !out->StopCondition.check())
 {
-double fPercent = 0;
+float fPercent = 0;
 if ( dltotal + out->Offset )
 fPercent = (dlnow + out->Offset) * 100 / (dltotal + out->Offset);
 if( fPercent < 0 )
@@ -233,7 +233,11 @@ static bool curl_run(std::u16string_view rURL, OutData& 
out, const OString& aPro
 // enable redirection
 (void)curl_easy_setopt(pCURL, CURLOPT_FOLLOWLOCATION, 1);
 // only allow redirect to http:// and https://
-(void)curl_easy_setopt(pCURL, CURLOPT_REDIR_PROTOCOLS_STR, 
CURLPROTO_HTTP | CURLPROTO_HTTPS);
+#if (LIBCURL_VERSION_MAJOR > 7) || (LIBCURL_VERSION_MAJOR == 7 && 
LIBCURL_VERSION_MINOR >= 85)
+curl_easy_setopt(pCURL, CURLOPT_REDIR_PROTOCOLS_STR, "http,https");
+#else
+curl_easy_setopt(pCURL, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | 
CURLPROTO_HTTPS);
+#endif
 
 // write function
 (void)curl_easy_setopt(pCURL, CURLOPT_WRITEDATA, &out);
@@ -274,9 +278,9 @@ static bool curl_run(std::u16string_view rURL, OutData& 
out, const OString& aPro
 {
 // this sometimes happens, when a user throws away his user data, 
but has already
 // completed the download of an update.
-double fDownloadSize;
-curl_easy_getinfo( pCURL, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, 
&fDownloadSize );
-if ( -1 == fDownloadSize )
+curl_off_t nDownloadSize;
+curl_easy_getinfo( pCURL, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, 
&nDownloadSize );
+if ( -1 == nDownloadSize )
 {
 out.Handler->downloadFinished(out.File);
 ret = true;


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

2023-01-11 Thread Caolán McNamara (via logerrit)
 vcl/headless/CairoCommon.cxx|  226 
 vcl/headless/SvpGraphicsBackend.cxx |  207 ---
 vcl/inc/headless/CairoCommon.hxx|   12 
 vcl/unx/generic/app/salinst.cxx |5 
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx |   30 +
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx |   26 +
 vcl/unx/generic/gdi/gdiimpl.cxx |  434 
 vcl/unx/generic/gdi/gdiimpl.hxx |   36 -
 8 files changed, 299 insertions(+), 677 deletions(-)

New commits:
commit 6d1ba1877ac1e8d77748b238a7706e3a4f8d9ed4
Author: Caolán McNamara 
AuthorDate: Tue Jan 10 15:18:40 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 11 10:33:48 2023 +

use SvpSalBitmap for X11/gen also

and move bitmap draw/get into CairoCommon and reuse from
X11CairoSalGraphicsImpl

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

diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx
index 6552460cf5e6..0aaefff4ef52 100644
--- a/vcl/headless/CairoCommon.cxx
+++ b/vcl/headless/CairoCommon.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -1584,6 +1585,229 @@ void CairoCommon::invert(sal_uInt32 nPoints, const 
Point* pPtAry, SalInvert nFla
 invert(aPoly, nFlags, bAntiAlias);
 }
 
+void CairoCommon::drawBitmap(const SalTwoRect& rPosAry, const SalBitmap& 
rSalBitmap,
+ bool bAntiAlias)
+{
+// MM02 try to access buffered BitmapHelper
+std::shared_ptr aSurface;
+tryToUseSourceBuffer(rSalBitmap, aSurface);
+cairo_surface_t* source = aSurface->getSurface(rPosAry.mnDestWidth, 
rPosAry.mnDestHeight);
+
+if (!source)
+{
+SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawAlphaBitmap 
case");
+return;
+}
+
+#if 0 // LO code is not yet bitmap32-ready.
+// if m_bSupportsBitmap32 becomes true for Svp revisit this
+copyWithOperator(rPosAry, source, CAIRO_OPERATOR_OVER, bAntiAlias);
+#else
+copyWithOperator(rPosAry, source, CAIRO_OPERATOR_SOURCE, bAntiAlias);
+#endif
+}
+
+bool CairoCommon::drawAlphaBitmap(const SalTwoRect& rTR, const SalBitmap& 
rSourceBitmap,
+  const SalBitmap& rAlphaBitmap, bool 
bAntiAlias)
+{
+if (rAlphaBitmap.GetBitCount() != 8 && rAlphaBitmap.GetBitCount() != 1)
+{
+SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawAlphaBitmap alpha 
depth case: "
+<< rAlphaBitmap.GetBitCount());
+return false;
+}
+
+if (!rTR.mnSrcWidth || !rTR.mnSrcHeight)
+{
+SAL_WARN("vcl.gdi", "not possible to stretch nothing");
+return true;
+}
+
+// MM02 try to access buffered BitmapHelper
+std::shared_ptr aSurface;
+tryToUseSourceBuffer(rSourceBitmap, aSurface);
+cairo_surface_t* source = aSurface->getSurface(rTR.mnDestWidth, 
rTR.mnDestHeight);
+
+if (!source)
+{
+SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawAlphaBitmap 
case");
+return false;
+}
+
+// MM02 try to access buffered MaskHelper
+std::shared_ptr aMask;
+tryToUseMaskBuffer(rAlphaBitmap, aMask);
+cairo_surface_t* mask = aMask->getSurface(rTR.mnDestWidth, 
rTR.mnDestHeight);
+
+if (!mask)
+{
+SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawAlphaBitmap 
case");
+return false;
+}
+
+cairo_t* cr = getCairoContext(false, bAntiAlias);
+clipRegion(cr);
+
+cairo_rectangle(cr, rTR.mnDestX, rTR.mnDestY, rTR.mnDestWidth, 
rTR.mnDestHeight);
+
+basegfx::B2DRange extents = getClippedFillDamage(cr);
+
+cairo_clip(cr);
+
+cairo_pattern_t* maskpattern = cairo_pattern_create_for_surface(mask);
+cairo_translate(cr, rTR.mnDestX, rTR.mnDestY);
+double fXScale = static_cast(rTR.mnDestWidth) / rTR.mnSrcWidth;
+double fYScale = static_cast(rTR.mnDestHeight) / rTR.mnSrcHeight;
+cairo_scale(cr, fXScale, fYScale);
+cairo_set_source_surface(cr, source, -rTR.mnSrcX, -rTR.mnSrcY);
+
+cairo_pattern_t* sourcepattern = cairo_get_source(cr);
+
+//tdf#133716 borders of upscaled images should not be blurred
+//tdf#114117 when stretching a single or multi pixel width/height source 
to fit an area
+//the image will be extended into that size.
+cairo_pattern_set_extend(sourcepattern, CAIRO_EXTEND_PAD);
+cairo_pattern_set_extend(maskpattern, CAIRO_EXTEND_PAD);
+
+//this block is just "cairo_mask_surface", but we have to make it explicit
+//because of the cairo_pattern_set_filter etc we may want applied
+cairo_matrix_t matrix;
+cairo_matrix_init_translate(&matrix, rTR.mnSrcX, rTR.mnSrcY);
+cairo_pattern_set_matrix(maskpattern, &matrix);
+cairo_mask(cr, maskpatt

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

2023-01-11 Thread Andrea Gelmini (via logerrit)
 source/text/scalc/01/func_style.xhp |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c2c2305d0e47c043696be9a9130b8f585968f764
Author: Andrea Gelmini 
AuthorDate: Wed Jan 11 11:58:22 2023 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Jan 11 11:17:49 2023 +

Fix typo

Change-Id: I63f80ef205f901313d4b2c5ec54d7d4864b3cddd
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/145331
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/source/text/scalc/01/func_style.xhp 
b/source/text/scalc/01/func_style.xhp
index 7e1c168450..1961350de4 100644
--- a/source/text/scalc/01/func_style.xhp
+++ b/source/text/scalc/01/func_style.xhp
@@ -35,7 +35,7 @@
 Style is the name of the cell style to be applied to the 
cell. Style names are not case-sensitive and must be entered in quotation marks.
   
   
-Time is an optional time range in seconds. After this time is 
ellapsed, the style defined in Style2 is applied. Leave this 
parameter blank if you do not want the style to be changed.
+Time is an optional time range in seconds. After this time is 
elapsed, the style defined in Style2 is applied. Leave this 
parameter blank if you do not want the style to be changed.
   
   
 Style2 is the optional name of a cell style assigned to the 
cell after the time specified in the Time parameter has passed. If 
this parameter is missing the "Default" cell style is applied.
@@ -56,7 +56,7 @@
   
 ="Total"&T(STYLE("Result"))
   
-  Enters the text 
"Total" into the cell and applies the style named "Result". Note that this 
example deals with textual values, hence the output of the STYLE 
funcion needs to be appended to the text using the & operator. The function 
T() is used to prevent the number "0" being appended to the 
resulting text.
+  Enters the text 
"Total" into the cell and applies the style named "Result". Note that this 
example deals with textual values, hence the output of the STYLE 
function needs to be appended to the text using the & operator. The 
function T() is used to prevent the number "0" being appended to 
the resulting text.
 
   
   


[Libreoffice-commits] core.git: helpcontent2

2023-01-11 Thread Andrea Gelmini (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fc6e85d6b7ce1cff3d9ca54173b0f759c61fc4cb
Author: Andrea Gelmini 
AuthorDate: Wed Jan 11 12:17:49 2023 +0100
Commit: Gerrit Code Review 
CommitDate: Wed Jan 11 11:17:49 2023 +

Update git submodules

* Update helpcontent2 from branch 'master'
  to c2c2305d0e47c043696be9a9130b8f585968f764
  - Fix typo

Change-Id: I63f80ef205f901313d4b2c5ec54d7d4864b3cddd
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/145331
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/helpcontent2 b/helpcontent2
index a6bf263e06de..c2c2305d0e47 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit a6bf263e06de175a10e35bd6ba7ca51a1529812c
+Subproject commit c2c2305d0e47c043696be9a9130b8f585968f764


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

2023-01-11 Thread Andrea Gelmini (via logerrit)
 source/text/scalc/01/func_style.xhp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e933fe90675132335452d25f4ddb01d0798f3553
Author: Andrea Gelmini 
AuthorDate: Wed Jan 11 12:00:35 2023 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Jan 11 11:18:19 2023 +

Fix typo

Change-Id: I437e33f36455f4f9340051fe9d8a74d0f6d88d3e
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/145332
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/source/text/scalc/01/func_style.xhp 
b/source/text/scalc/01/func_style.xhp
index 1961350de4..2a4608ad20 100644
--- a/source/text/scalc/01/func_style.xhp
+++ b/source/text/scalc/01/func_style.xhp
@@ -51,7 +51,7 @@
   
 =A1*A2+STYLE(IF(CURRENT()<100,"Bad","Good"))
   
-  Enters the result of 
multiplying the values in cells A1 and A2 and applies the style "Bad" if the 
result is less than 100, otherwie the style "Good" is applied. Here the 
function CURRENT() is used to get the currently evaluated value of 
the function in the cell.
+  Enters the result of 
multiplying the values in cells A1 and A2 and applies the style "Bad" if the 
result is less than 100, otherwise the style "Good" is applied. Here the 
function CURRENT() is used to get the currently evaluated value of 
the function in the cell.
 
   
 ="Total"&T(STYLE("Result"))


[Libreoffice-commits] core.git: helpcontent2

2023-01-11 Thread Andrea Gelmini (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 158f77b7015fce8a327297736dc11b6a78b9b4d2
Author: Andrea Gelmini 
AuthorDate: Wed Jan 11 12:18:19 2023 +0100
Commit: Gerrit Code Review 
CommitDate: Wed Jan 11 11:18:19 2023 +

Update git submodules

* Update helpcontent2 from branch 'master'
  to e933fe90675132335452d25f4ddb01d0798f3553
  - Fix typo

Change-Id: I437e33f36455f4f9340051fe9d8a74d0f6d88d3e
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/145332
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/helpcontent2 b/helpcontent2
index c2c2305d0e47..e933fe906751 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit c2c2305d0e47c043696be9a9130b8f585968f764
+Subproject commit e933fe90675132335452d25f4ddb01d0798f3553


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

2023-01-11 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/odffmap.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit a4de9d2bb2f1aea011bd1652d72b349369da03a0
Author: Eike Rathke 
AuthorDate: Tue Jan 10 01:22:38 2023 +0100
Commit: Eike Rathke 
CommitDate: Wed Jan 11 11:59:27 2023 +

Related: tdf#152948 Align AddInMap English names to Add-In implementation

... of scaddins/source/analysis/analysishelper.cxx for the few (4)
functions with the _EXCEL2003 suffix. The compiler's symbol map
for English contained both, but the reverse map contained only the
(first added) ..._ADD name, so GCD_EXCEL2003() was displayed as
GCD_ADD(), that still worked but was unexpected.

Change-Id: I8c866dc73d0146d75b29f8212a7e561a3f38fce4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145247
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit f98d04571c99b70ff753d322b1f43adc8e0433ba)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145297

diff --git a/sc/source/core/tool/odffmap.cxx b/sc/source/core/tool/odffmap.cxx
index 1a469208fc35..7fc4ac5141e4 100644
--- a/sc/source/core/tool/odffmap.cxx
+++ b/sc/source/core/tool/odffmap.cxx
@@ -34,9 +34,9 @@ const ScCompiler::AddInMap ScCompiler::g_aAddInMap[] =
 { "WORKDAY", "WORKDAY", "com.sun.star.sheet.addin.Analysis.getWorkday", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETWORKDAY" },
 { "YEARFRAC", "YEARFRAC", "com.sun.star.sheet.addin.Analysis.getYearfrac", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETYEARFRAC" },
 { "EDATE", "EDATE", "com.sun.star.sheet.addin.Analysis.getEdate", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETEDATE" },
-{ "WEEKNUM", "WEEKNUM_ADD", 
"com.sun.star.sheet.addin.Analysis.getWeeknum", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETWEEKNUM" },
+{ "WEEKNUM", "WEEKNUM_EXCEL2003", 
"com.sun.star.sheet.addin.Analysis.getWeeknum", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETWEEKNUM" },
 { "EOMONTH", "EOMONTH", "com.sun.star.sheet.addin.Analysis.getEomonth", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETEOMONTH" },
-{ "NETWORKDAYS", "NETWORKDAYS_ADD", 
"com.sun.star.sheet.addin.Analysis.getNetworkdays", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETNETWORKDAYS" },
+{ "NETWORKDAYS", "NETWORKDAYS_EXCEL2003", 
"com.sun.star.sheet.addin.Analysis.getNetworkdays", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETNETWORKDAYS" },
 { "ISEVEN", "ISEVEN_ADD", "com.sun.star.sheet.addin.Analysis.getIseven", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETISEVEN" },
 { "ISODD", "ISODD_ADD", "com.sun.star.sheet.addin.Analysis.getIsodd", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETISODD" },
 { "MULTINOMIAL", "MULTINOMIAL", 
"com.sun.star.sheet.addin.Analysis.getMultinomial", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETMULTINOMIAL" },
@@ -45,8 +45,8 @@ const ScCompiler::AddInMap ScCompiler::g_aAddInMap[] =
 { "MROUND", "MROUND", "com.sun.star.sheet.addin.Analysis.getMround", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETMROUND" },
 { "SQRTPI", "SQRTPI", "com.sun.star.sheet.addin.Analysis.getSqrtpi", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETSQRTPI" },
 { "RANDBETWEEN", "RANDBETWEEN", 
"com.sun.star.sheet.addin.Analysis.getRandbetween", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETRANDBETWEEN" },
-{ "GCD", "GCD_ADD", "com.sun.star.sheet.addin.Analysis.getGcd", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETGCD" },
-{ "LCM", "LCM_ADD", "com.sun.star.sheet.addin.Analysis.getLcm", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETLCM" },
+{ "GCD", "GCD_EXCEL2003", "com.sun.star.sheet.addin.Analysis.getGcd", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETGCD" },
+{ "LCM", "LCM_EXCEL2003", "com.sun.star.sheet.addin.Analysis.getLcm", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETLCM" },
 { "BESSELI", "BESSELI", "com.sun.star.sheet.addin.Analysis.getBesseli", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETBESSELI" },
 { "BESSELJ", "BESSELJ", "com.sun.star.sheet.addin.Analysis.getBesselj", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETBESSELJ" },
 { "BESSELK", "BESSELK", "com.sun.star.sheet.addin.Analysis.getBesselk", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETBESSELK" },


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

2023-01-11 Thread Andras Timar (via logerrit)
 sw/qa/extras/htmlimport/data/green-highlight.html |1 
 sw/qa/extras/htmlimport/htmlimport.cxx|   12 ++
 sw/source/filter/html/parcss1.cxx |   26 +++---
 3 files changed, 36 insertions(+), 3 deletions(-)

New commits:
commit 3c42bc6c2bc6d2005d4b00451660cd2d604da623
Author: Andras Timar 
AuthorDate: Wed Jan 4 14:34:49 2023 +0100
Commit: Xisco Fauli 
CommitDate: Wed Jan 11 12:01:39 2023 +

import colors with transparency from html

The support is limited, but better than before.
Before: the color was not imported.
After: the color is imported as RGB, as if the background color was white.
It is pretty much common in Writer that the background is white. On the
other hand, transparency is not supported in many use cases, such as
character background in this example green-highlight.html.

Change-Id: Ia9449e2535ddfd8cd8c2672cb3bd32987083fdbb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145039
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit dd13717076e412d7b1079a12adaff01efebf0f80)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145218
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/htmlimport/data/green-highlight.html 
b/sw/qa/extras/htmlimport/data/green-highlight.html
new file mode 100644
index ..b8986e78ffd8
--- /dev/null
+++ b/sw/qa/extras/htmlimport/data/green-highlight.html
@@ -0,0 +1 @@
+Highlight green (transparency: 
0.5)
diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx 
b/sw/qa/extras/htmlimport/htmlimport.cxx
index b9d9595129f5..c97d4e4cbde4 100644
--- a/sw/qa/extras/htmlimport/htmlimport.cxx
+++ b/sw/qa/extras/htmlimport/htmlimport.cxx
@@ -562,6 +562,18 @@ CPPUNIT_TEST_FIXTURE(SwHtmlOptionsImportTest, testOleData2)
 CPPUNIT_ASSERT(getProperty(xShape, "HyperLinkURL").isEmpty());
 }
 
+CPPUNIT_TEST_FIXTURE(HtmlImportTest, testRGBAColor)
+{
+createSwWebDoc("green-highlight.html");
+const uno::Reference xPara = getParagraph(1);
+const uno::Reference xRun(getRun(xPara,1), 
uno::UNO_QUERY);
+const Color nBackColor(0xaed89a);
+
+// Without the accompanying fix in place, this test would have failed, the 
backround
+// color was not imported at all, when it was in hex RGBA format in HTML.
+CPPUNIT_ASSERT_EQUAL(nBackColor, getProperty(xRun, 
"CharBackColor"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/html/parcss1.cxx 
b/sw/source/filter/html/parcss1.cxx
index 50278e160483..0fa73d455fbc 100644
--- a/sw/source/filter/html/parcss1.cxx
+++ b/sw/source/filter/html/parcss1.cxx
@@ -530,11 +530,11 @@ CSS1Token CSS1Parser::GetNextToken()
 bool bEOFSave = m_bEOF;
 
 // first try to parse a hex digit
-OUStringBuffer sTmpBuffer(6);
+OUStringBuffer sTmpBuffer(8);
 do {
 sTmpBuffer.append( m_cNextCh );
 m_cNextCh = GetNextChar();
-} while( sTmpBuffer.getLength() < 7 &&
+} while( sTmpBuffer.getLength() < 9 &&
  ( ('0'<=m_cNextCh && '9'>=m_cNextCh) ||
('A'<=m_cNextCh && 'F'>=m_cNextCh) ||
('a'<=m_cNextCh && 'f'>=m_cNextCh) ) &&
@@ -542,7 +542,7 @@ CSS1Token CSS1Parser::GetNextToken()
 
 if( sTmpBuffer.getLength()==6 || sTmpBuffer.getLength()==3 )
 {
-// we found a color in hex
+// we found a color in hex (RGB)
 m_aToken += sTmpBuffer;
 nRet = CSS1_HEXCOLOR;
 bNextCh = false;
@@ -550,6 +550,26 @@ CSS1Token CSS1Parser::GetNextToken()
 break;
 }
 
+if( sTmpBuffer.getLength()==8 )
+{
+// we found a color in hex (RGBA)
+// we convert it to RGB assuming white background
+sal_uInt32 nColor = 
sTmpBuffer.makeStringAndClear().toUInt32(16);
+sal_uInt32 nRed = (nColor & 0xff00) >> 24;
+sal_uInt32 nGreen = (nColor & 0xff) >> 16;
+sal_uInt32 nBlue = (nColor & 0xff00) >> 8;
+double nAlpha = (nColor & 0xff) / 255.0;
+nRed = (1 - nAlpha) * 255 + nAlpha * nRed;
+nGreen = (1 - nAlpha) * 255 + nAlpha * nGreen;
+nBlue = (1 - nAlpha) * 255 + nAlpha * nBlue;
+nColor = (nRed << 16) + (nGreen << 8) + nBlue;
+m_aToken += OUString::number(nColor, 16);
+nRet = CSS1_HEXCOLOR;
+bNextCh = false;
+
+break;
+}
+
 // otherwise we try a number
 m_nInPos = nInPosSave;
 m_cNextCh

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

2023-01-11 Thread Julien Nabet (via logerrit)
 desktop/source/minidump/minidump.cxx |   34 +-
 1 file changed, 13 insertions(+), 21 deletions(-)

New commits:
commit 883b2d020c27275f9d3661686e426a18c515326e
Author: Julien Nabet 
AuthorDate: Sun Jan 8 14:08:53 2023 +0100
Commit: Xisco Fauli 
CommitDate: Wed Jan 11 12:07:33 2023 +

Fix deprecated Curl elements for minidump part

Change-Id: I43df411eed24e86f5d72982b5d24188e0cb7e507
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145177
Tested-by: Jenkins
Reviewed-by: Julien Nabet 
(cherry picked from commit 5c4fa7ddb0b12d30304bbc6119a0aa1d3d65b55d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145301
Reviewed-by: Xisco Fauli 

diff --git a/desktop/source/minidump/minidump.cxx 
b/desktop/source/minidump/minidump.cxx
index b6f52251206b..0bf20f2aa419 100644
--- a/desktop/source/minidump/minidump.cxx
+++ b/desktop/source/minidump/minidump.cxx
@@ -132,27 +132,21 @@ static bool uploadContent(std::map& parameters, std::s
 if (!ca_certificate_file.empty())
 curl_easy_setopt(curl, CURLOPT_CAINFO, ca_certificate_file.c_str());
 
-curl_httppost* formpost = nullptr;
-curl_httppost* lastptr = nullptr;
+curl_mime* mime = curl_mime_init(curl);
 std::string additional_data = generate_json(parameters);
-curl_formadd(&formpost, &lastptr,
-CURLFORM_COPYNAME, "AdditionalData",
-CURLFORM_COPYCONTENTS, additional_data.c_str(),
-CURLFORM_END);
+curl_mimepart* part = curl_mime_addpart(mime);
+curl_mime_name(part, "AdditionalData");
+curl_mime_data(part, additional_data.c_str(), CURL_ZERO_TERMINATED);
 
-curl_formadd(&formpost, &lastptr,
-CURLFORM_COPYNAME, "Version",
-CURLFORM_COPYCONTENTS, version.c_str(),
-CURLFORM_END);
+part = curl_mime_addpart(mime);
+curl_mime_name(part, "Version");
+curl_mime_data(part, version.c_str(), CURL_ZERO_TERMINATED);
 
-std::string response_body;
-long response_code;
-curl_formadd(&formpost, &lastptr,
-CURLFORM_COPYNAME, "upload_file_minidump",
-CURLFORM_FILE, file.c_str(),
-CURLFORM_END);
+part = curl_mime_addpart(mime);
+curl_mime_name(part, "upload_file_minidump");
+curl_mime_filedata(part, file.c_str());
 
-curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
+curl_easy_setopt(curl, CURLOPT_MIMEPOST, mime);
 
 
 // Disable 100-continue header.
@@ -162,6 +156,7 @@ static bool uploadContent(std::map& parameters, std::s
 curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
 
 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
+std::string response_body;
 curl_easy_setopt(curl, CURLOPT_WRITEDATA,
 static_cast(&response_body));
 
@@ -169,6 +164,7 @@ static bool uploadContent(std::map& parameters, std::s
 curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
 
 CURLcode cc = curl_easy_perform(curl);
+long response_code;
 curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
 SAL_WARN_IF(cc != CURLE_OK, "desktop",
 "Failed to send http request to " <<
@@ -176,10 +172,6 @@ static bool uploadContent(std::map& parameters, std::s
 ", error: " <<
 curl_easy_strerror(cc));
 
-if (formpost != nullptr)
-{
-curl_formfree(formpost);
-}
 if (headerlist != nullptr)
 {
 curl_slist_free_all(headerlist);


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

2023-01-11 Thread Caolán McNamara (via logerrit)
 vcl/Library_vclplug_gen.mk  |1 
 vcl/inc/unx/saldisp.hxx |3 
 vcl/inc/unx/salgdi.h|2 
 vcl/inc/unx/x11/xrender_peer.hxx|  165 
 vcl/unx/generic/app/saldisp.cxx |4 
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx |4 
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx |5 
 vcl/unx/generic/gdi/gdiimpl.cxx |  162 ---
 vcl/unx/generic/gdi/gdiimpl.hxx |   26 ---
 vcl/unx/generic/gdi/salgdi.cxx  |   19 --
 vcl/unx/generic/gdi/salgdi2.cxx |1 
 vcl/unx/generic/gdi/xrender_peer.cxx|   48 --
 12 files changed, 10 insertions(+), 430 deletions(-)

New commits:
commit 99bc5f777cb0af87366aa066a2559582bb9bd7ad
Author: Caolán McNamara 
AuthorDate: Tue Jan 10 15:57:09 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 11 12:12:35 2023 +

drop newly unused code

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

diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk
index ca29dca1bc9d..03b0158a8736 100644
--- a/vcl/Library_vclplug_gen.mk
+++ b/vcl/Library_vclplug_gen.mk
@@ -106,7 +106,6 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gen,\
 vcl/unx/generic/gdi/font \
 vcl/unx/generic/gdi/salgdi \
 vcl/unx/generic/gdi/salvd \
-vcl/unx/generic/gdi/xrender_peer \
 vcl/unx/generic/window/salframe \
 vcl/unx/generic/window/salobj \
 vcl/unx/x11/x11sys \
diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx
index 83f847d4d78c..eed51ef8b41f 100644
--- a/vcl/inc/unx/saldisp.hxx
+++ b/vcl/inc/unx/saldisp.hxx
@@ -230,9 +230,8 @@ public:
 struct RenderEntry
 {
 Pixmap  m_aPixmap;
-Picture m_aPicture;
 
-RenderEntry() : m_aPixmap( 0 ), m_aPicture( 0 ) {}
+RenderEntry() : m_aPixmap( 0 ) {}
 };
 
 typedef std::unordered_map RenderEntryMap;
diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h
index c146e4c40e85..ed0a9d10ad9e 100644
--- a/vcl/inc/unx/salgdi.h
+++ b/vcl/inc/unx/salgdi.h
@@ -101,7 +101,6 @@ public:
 virtual SalGraphicsImpl*GetImpl() const override;
 SalGeometryProvider*GetGeometryProvider() const;
 voidSetDrawable(Drawable d, cairo_surface_t* 
surface, SalX11Screen nXScreen);
-XRenderPictFormat*  GetXRenderFormat() const;
 voidSetXRenderFormat( XRenderPictFormat* 
pXRenderFormat ) { m_pXRenderFormat = pXRenderFormat; }
 
 const SalX11Screen& GetScreenNumber() const { return 
m_nXScreen; }
@@ -168,7 +167,6 @@ private:
 
 SalX11Screenm_nXScreen;
 mutable XRenderPictFormat*  m_pXRenderFormat;
-XID m_aXRenderPicture;
 
 Region  mpClipRegion;
 Pixmap  hBrush_;// Dither
diff --git a/vcl/inc/unx/x11/xrender_peer.hxx b/vcl/inc/unx/x11/xrender_peer.hxx
deleted file mode 100644
index e1006f88ed44..
--- a/vcl/inc/unx/x11/xrender_peer.hxx
+++ /dev/null
@@ -1,165 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_VCL_UNX_X11_XRENDER_PEER_HXX
-#define INCLUDED_VCL_UNX_X11_XRENDER_PEER_HXX
-
-#include 
-#include 
-struct _XTrap; // on some older systems this is not declared within Xrender.h
-#include 
-
-#include 
-
-
-class XRenderPeer
-{
-public:
-static XRenderPeer& GetInstance();
-
-private:
-XRenderPeer();
-voidInitRenderLib();
-
-Display*mpDisplay;
-XRenderPictFormat*  mpStandardFormatA8;
-
-public:
-XRenderPictFormat* GetStandardFormatA8() const;
-XRenderPictFormat* FindStandardFormat(int nFormat) const;
-
-// the methods below are thin wrappers for the XRENDER API
-XRenderPictFormat* FindVisualFo

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

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

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

remove defunct pXRenderFormat field

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

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

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

2023-01-11 Thread Caolán McNamara (via logerrit)
 vcl/inc/unx/salgdi.h   |2 -
 vcl/unx/generic/gdi/salgdi.cxx |   81 -
 2 files changed, 83 deletions(-)

New commits:
commit e713d1e08345f28d390a1a025768c6a36a1cc59e
Author: Caolán McNamara 
AuthorDate: Tue Jan 10 16:20:45 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 11 12:13:12 2023 +

drop unused X11SalGraphics::GetDitherPixmap

Change-Id: Ib3374242e5edd58ca5a1fa49017a1948e970e144
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145291
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 4302f849337a..9fa31a2295a2 100644
--- a/vcl/inc/unx/salgdi.h
+++ b/vcl/inc/unx/salgdi.h
@@ -154,7 +154,6 @@ public:
 private:
 using SalGraphics::GetPixel;
 voidSetClipRegion( GC pGC, Region pXReg = 
nullptr ) const;
-boolGetDitherPixmap ( Color nColor );
 
 voidfreeResources();
 
@@ -167,7 +166,6 @@ private:
 SalX11Screenm_nXScreen;
 
 Region  mpClipRegion;
-Pixmap  hBrush_;// Dither
 
 boolbWindow_ : 1;   // is Window
 boolbVirDev_ : 1;   // is VirDev
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index b4347c0dfa59..76f31e02d5cf 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -84,7 +84,6 @@ X11SalGraphics::X11SalGraphics():
 m_pVDev(nullptr),
 m_nXScreen( 0 ),
 mpClipRegion(nullptr),
-hBrush_(None),
 bWindow_(false),
 bVirDev_(false)
 {
@@ -111,8 +110,6 @@ X11SalGraphics::~X11SalGraphics() COVERITY_NOEXCEPT_FALSE
 
 void X11SalGraphics::freeResources()
 {
-Display *pDisplay = GetXDisplay();
-
 if( mpClipRegion )
 {
 XDestroyRegion( mpClipRegion );
@@ -121,11 +118,6 @@ void X11SalGraphics::freeResources()
 
 mxImpl->freeResources();
 
-if( hBrush_ )
-{
-XFreePixmap( pDisplay, hBrush_ );
-hBrush_ = None;
-}
 if( m_pDeleteColormap )
 {
 m_pDeleteColormap.reset();
@@ -212,79 +204,6 @@ void X11SalGraphics::SetClipRegion( GC pGC, Region pXReg ) 
const
 }
 }
 
-// Calculate a dither-pixmap and make a brush of it
-#define P_DELTA 51
-#define DMAP( v, m )((v % P_DELTA) > m ? (v / P_DELTA) + 1 : (v / P_DELTA))
-
-bool X11SalGraphics::GetDitherPixmap( Color nColor )
-{
-static const short nOrdDither8Bit[ 8 ][ 8 ] =
-{
-{ 0, 38,  9, 48,  2, 40, 12, 50},
-{25, 12, 35, 22, 28, 15, 37, 24},
-{ 6, 44,  3, 41,  8, 47,  5, 44},
-{32, 19, 28, 16, 34, 21, 31, 18},
-{ 1, 40, 11, 49,  0, 39, 10, 48},
-{27, 14, 36, 24, 26, 13, 36, 23},
-{ 8, 46,  4, 43,  7, 45,  4, 42},
-{33, 20, 30, 17, 32, 20, 29, 16}
-};
-
-// test for correct depth (8bit)
-if( GetColormap().GetVisual().GetDepth() != 8 )
-return false;
-
-charpBits[64];
-char   *pBitsPtr = pBits;
-
-// Set the palette-entries for the dithering tile
-sal_uInt8 nColorRed   = nColor.GetRed();
-sal_uInt8 nColorGreen = nColor.GetGreen();
-sal_uInt8 nColorBlue  = nColor.GetBlue();
-
-for(auto & nY : nOrdDither8Bit)
-{
-for( int nX = 0; nX < 8; nX++ )
-{
-short nMagic = nY[nX];
-sal_uInt8 nR   = P_DELTA * DMAP( nColorRed,   nMagic );
-sal_uInt8 nG   = P_DELTA * DMAP( nColorGreen, nMagic );
-sal_uInt8 nB   = P_DELTA * DMAP( nColorBlue,  nMagic );
-
-*pBitsPtr++ = GetColormap().GetPixel( Color( nR, nG, nB ) );
-}
-}
-
-// create the tile as ximage and an according pixmap -> caching
-XImage *pImage = XCreateImage( GetXDisplay(),
-   GetColormap().GetXVisual(),
-   8,
-   ZPixmap,
-   0,   // offset
-   pBits,   // data
-   8, 8,// width & height
-   8,   // bitmap_pad
-   0 ); // (default) bytes_per_line
-
-if( !hBrush_ )
-hBrush_ = limitXCreatePixmap( GetXDisplay(), GetDrawable(), 8, 8, 8 );
-
-// put the ximage to the pixmap
-XPutImage( GetXDisplay(),
-   hBrush_,
-   GetDisplay()->GetCopyGC( m_nXScreen ),
-   pImage,
-   0, 0,// Source
-   0, 0,// Destination
-   8, 8 );  // width & height
-
-// destroy image-frame but not palette-data
-pImage->data = nullptr;
-XDestroyImage( pImage );
-
-return true;

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

2023-01-11 Thread Noel Grandin (via logerrit)
 framework/source/fwe/helper/undomanagerhelper.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 92d9888e79b768996db5526eb3965259b38ced76
Author: Noel Grandin 
AuthorDate: Wed Jan 11 09:29:00 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Jan 11 12:25:23 2023 +

fix deadlock observed on jenkins

where we are locking SolarMutex and UndoManagerHelper_Impl::m_aMutex in
different orders in different code-paths, which is deadly when we call
into the same class recursively.

Thread 2 (Thread 0x7f5cf303b700 (LWP 22637)):
(this=0x7f5cf3037cd8) at include/vcl/svapp.hxx:1373
framework::UndoManagerHelper_Impl::impl_clear() (this=0x5f90d50) at
framework/source/fwe/helper/undomanagerhelper.cxx:691
  holds UndoManagerHelper_Impl::m_aMutex
  tries to acquire SolarMutex

framework::UndoManagerHelper_Impl::clear(framework::IMutexGuard&)::$_3::operator()()
const (this=0x5519040) at
framework/source/fwe/helper/undomanagerhelper.cxx:403

framework::UndoManagerHelper_Impl::clear(framework::IMutexGuard&)::$_3>::_M_invoke(std::_Any_data
const&) (__functor=...) at

/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/std_function.h:316
(this=0x5519040) at

/opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/../../../../include/c++/7/bits/std_function.h:706
namespace)::UndoManagerRequest::execute() (this=0x5519030) at
framework/source/fwe/helper/undomanagerhelper.cxx:160
framework::UndoManagerHelper_Impl::impl_processRequest(std::function const&, framework::IMutexGuard&) (this=0x5f90d50, i_request=...,
i_instanceLock=...) at
framework/source/fwe/helper/undomanagerhelper.cxx:490
framework::UndoManagerHelper_Impl::clear(framework::IMutexGuard&)
(this=0x5f90d50, i_instanceLock=...) at
framework/source/fwe/helper/undomanagerhelper.cxx:402
framework::UndoManagerHelper::clear(framework::IMutexGuard&)
(this=0x5f90c38, i_instanceLock=...) at
framework/source/fwe/helper/undomanagerhelper.cxx:999
at chart2/source/model/main/UndoManager.cxx:278
void*, _typelib_TypeDescriptionReference*, bool, unsigned long*,
unsigned int, unsigned long*, double*) (pThis=0x5f90bc8,
nVtableIndex=18, pRegisterReturn=0x0, pReturnTypeRef=0xa2dac0,
bSimpleReturn=true, pStack=0x7f5cf30380e0, nStack=0,
pGPR=0x7f5cf30383e0, pFPR=0x7f5cf30383a0) at
bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77
cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*,
bridges::cpp_uno::shared::VtableSlot,
_typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*,
void*, void**, _uno_Any**) (pThis=0x5e40ac0, aVtableSlot=...,
pReturnTypeRef=0xa2dac0, nParams=0, pParams=0x0, pUnoReturn=0x0,
pUnoArgs=0x0, ppUnoExc=0x7f5cf30388e0) at
bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:233
pMemberDescr=0x551dd30, pReturn=0x0, pArgs=0x0,
ppException=0x7f5cf30388e0) at
bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:413
binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*,
std::__debug::vector >*) const (this=0x28a3cc0,
returnValue=0x7f5cf3039040, outArguments=0x7f5cf3039008) at
binaryurp/source/incomingrequest.cxx:236
(this=0x28a3cc0) at binaryurp/source/incomingrequest.cxx:79

Thread 1 (Thread 0x7f5cfd03eec0 (LWP 22302)):
(this=0x7ffcdf1b1720, t=...) at include/osl/mutex.hxx:144

comphelper::OInterfaceContainerHelper3::addInterface(com::sun::star::uno::Reference
const&) (this=0x5f90da0, rListener=...) at
include/comphelper/interfacecontainer3.hxx:313
trying to acquire UndoManagerHelper_Impl::m_aMutex

framework::UndoManagerHelper_Impl::addModifyListener(com::sun::star::uno::Reference
const&) (this=0x5f90d50, i_listener=...) at
framework/source/fwe/helper/undomanagerhelper.cxx:286

framework::UndoManagerHelper::addModifyListener(com::sun::star::uno::Reference
const&) (this=0x5f90c38, i_listener=...) at
framework/source/fwe/helper/undomanagerhelper.cxx:1047

chart::UndoManager::addModifyListener(com::sun::star::uno::Reference
const&) (this=0x5f90bc0, i_listener=...) at
chart2/source/model/main/UndoManager.cxx:338
(this=0x1d470d0) at
chart2/source/controller/main/UndoCommandDispatch.cxx:57
chart::CommandDispatchContainer::getDispatchForURL(com::sun::star::util::URL
const&) (this=0x5f66e58, rURL=...) at
chart2/source/controller/main/CommandDispatchContainer.cxx:93
chart::ChartController::queryDispatch(com::sun::star::util::URL const&,
rtl::OUString const&, int) (this=0x5f66c50, rURL=...,
rTargetFrameName=...) at
chart2/source/controller/main/ChartController.cxx:1055
locks SolarMutex
chart::ChartController::queryDispatch(com::sun::star::util::URL const&,
rtl::OUString const&, int) () at

/home/tdf/lode/jenkins/workspace/lo_gerri

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

2023-01-11 Thread Miklos Vajna (via logerrit)
 sw/qa/uibase/uno/uno.cxx  |   28 ++
 sw/source/uibase/uno/loktxdoc.cxx |   40 --
 2 files changed, 66 insertions(+), 2 deletions(-)

New commits:
commit ca4f51aad22809d94ecb9e7e8f53227171dea79f
Author: Miklos Vajna 
AuthorDate: Mon Jan 9 13:53:35 2023 +0100
Commit: Miklos Vajna 
CommitDate: Wed Jan 11 12:46:15 2023 +

sw, lok: implement a getCommandValues(Sections)

There was no LOK API to get a list of all sections where the name
matches a certain prefix.

This is useful in case the API client wants to know what previously
inserted sections were deleted by the user as part of deleting text
content.

Add a new getCommandValues(".uno:Sections") that returns the names of
matching sections. Do not return the section text, assuming that would
be updated by the API client anyway.

In practice this is needed by Zotero in case it wants to model its
bibliography items with sections.

(cherry picked from commit 2ddd41b420cea7f1b988f0b8acbca564b2811382)

Change-Id: If4f02d2a27f2328020934b319d30561aeaaf6612
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145279
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Justin Luth 

diff --git a/sw/qa/uibase/uno/uno.cxx b/sw/qa/uibase/uno/uno.cxx
index 26e912fcfb2b..300278717664 100644
--- a/sw/qa/uibase/uno/uno.cxx
+++ b/sw/qa/uibase/uno/uno.cxx
@@ -308,6 +308,34 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testGetTextFormField)
  field.get("command"));
 }
 
+CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testGetSections)
+{
+// Given a document with a section:
+createSwDoc();
+uno::Sequence aArgs = {
+comphelper::makePropertyValue(
+"RegionName", uno::Any(OUString("ZOTERO_BIBL {} CSL_BIBLIOGRAPHY 
RNDRfiit6mXBc"))),
+comphelper::makePropertyValue("Content", 
uno::Any(OUString("aaabbb"))),
+};
+dispatchCommand(mxComponent, ".uno:InsertSection", aArgs);
+
+// When asking for a list of section names:
+tools::JsonWriter aJsonWriter;
+OString aCommand(".uno:Sections?namePrefix=ZOTERO_BIBL");
+auto pXTextDocument = dynamic_cast(mxComponent.get());
+pXTextDocument->getCommandValues(aJsonWriter, aCommand);
+
+// Make sure we find our just inserted section:
+std::unique_ptr 
pJSON(aJsonWriter.extractData());
+std::stringstream aStream(pJSON.get());
+boost::property_tree::ptree aTree;
+boost::property_tree::read_json(aStream, aTree);
+// Without the accompanying fix in place, this test would have failed with:
+// - No such node (sections)
+// i.e. the returned JSON was an empty object.
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
aTree.get_child("sections").count(""));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uno/loktxdoc.cxx 
b/sw/source/uibase/uno/loktxdoc.cxx
index d1b31238dff8..30722fb6af69 100644
--- a/sw/source/uibase/uno/loktxdoc.cxx
+++ b/sw/source/uibase/uno/loktxdoc.cxx
@@ -292,13 +292,44 @@ void GetFields(tools::JsonWriter& rJsonWriter, 
SwDocShell* pDocShell,
 rJsonWriter.put("name", pRefMark->GetRefName());
 }
 }
+
+/// Implements getCommandValues(".uno:Sections").
+///
+/// Parameters:
+///
+/// - namePrefix: field name prefix to not return all sections
+void GetSections(tools::JsonWriter& rJsonWriter, SwDocShell* pDocShell,
+ const std::map& rArguments)
+{
+OUString aNamePrefix;
+{
+auto it = rArguments.find("namePrefix");
+if (it != rArguments.end())
+{
+aNamePrefix = it->second;
+}
+}
+
+SwDoc* pDoc = pDocShell->GetDoc();
+tools::ScopedJsonWriterArray aBookmarks = 
rJsonWriter.startArray("sections");
+for (const auto& pSection : pDoc->GetSections())
+{
+if (!pSection->GetName().startsWith(aNamePrefix))
+{
+continue;
+}
+
+tools::ScopedJsonWriterStruct aProperty = rJsonWriter.startStruct();
+rJsonWriter.put("name", pSection->GetName());
+}
+}
 }
 
 bool SwXTextDocument::supportsCommandValues(const OUString& rCommand)
 {
 static const std::initializer_list vForward
-= { u"TextFormFields", u"TextFormField", u"SetDocumentProperties", 
u"Bookmarks",
-u"Fields" };
+= { u"TextFormFields", u"TextFormField", u"SetDocumentProperties",
+u"Bookmarks",  u"Fields",u"Sections" };
 
 return std::find(vForward.begin(), vForward.end(), rCommand) != 
vForward.end();
 }
@@ -312,6 +343,7 @@ void SwXTextDocument::getCommandValues(tools::JsonWriter& 
rJsonWriter, const OSt
 static constexpr OStringLiteral 
aSetDocumentProperties(".uno:SetDocumentProperties");
 static constexpr OStringLiteral aBookmarks(".uno:Bookmarks");
 static constexpr OStringLiteral aFields(".uno:Fields");
+static constexpr OStringLiteral

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - desktop/source include/vcl sw/inc sw/source

2023-01-11 Thread Miklos Vajna (via logerrit)
 desktop/source/lib/init.cxx   |2 +-
 include/vcl/ITiledRenderable.hxx  |2 +-
 sw/inc/unotxdoc.hxx   |2 +-
 sw/source/uibase/uno/loktxdoc.cxx |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit bc6048083aec4328ccec298a7388bb822062b4b8
Author: Miklos Vajna 
AuthorDate: Mon Jan 9 15:30:26 2023 +0100
Commit: Miklos Vajna 
CommitDate: Wed Jan 11 12:46:56 2023 +

vcl ITiledRenderable: rename supportsCommandValues() to supportsCommand()

It gets a single command (to determine if using it with
getCommandValues() is OK or not), so the plural was confusing, as
mentioned at

.

(cherry picked from commit 913b399a73c4d6dfd2c9f5983f56f612f3262fa7)

Conflicts:
include/vcl/ITiledRenderable.hxx
sw/inc/unotxdoc.hxx
sw/source/uibase/uno/loktxdoc.cxx

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c4aa15270fa3..75a0748fee84 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5890,7 +5890,7 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* 
pThis, const char* pCo
 {
 return getFontSubset(std::string_view(pCommand + 
aFontSubset.getLength()));
 }
-else if 
(pDoc->supportsCommandValues(INetURLObject(OUString::fromUtf8(aCommand)).GetURLPath()))
+else if 
(pDoc->supportsCommand(INetURLObject(OUString::fromUtf8(aCommand)).GetURLPath()))
 {
 tools::JsonWriter aJsonWriter;
 pDoc->getCommandValues(aJsonWriter, aCommand);
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index d0ce32d2753f..87975268c375 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -371,7 +371,7 @@ public:
 virtual void setPaintTextEdit(bool) {}
 
 /// Decides if it's OK to call getCommandValues(rCommand).
-virtual bool supportsCommandValues(const OUString& /*rCommand*/) { return 
false; }
+virtual bool supportsCommand(const OUString& /*rCommand*/) { return false; 
}
 
 /// Returns a json mapping of the possible values for the given command.
 virtual void getCommandValues(tools::JsonWriter& /*rJsonWriter*/, const 
OString& /*rCommand*/)
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 07c3f5b6e6e0..e2d3ac144992 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -462,7 +462,7 @@ public:
 void getCommandValues(tools::JsonWriter& rJsonWriter, const OString& 
rCommand) override;
 
 /// @see vcl::ITiledRenderable::supportsCommandValues().
-bool supportsCommandValues(const OUString& rCommand) override;
+bool supportsCommand(const OUString& rCommand) override;
 
 voidInvalidate();
 voidReactivate(SwDocShell* pNewDocShell);
diff --git a/sw/source/uibase/uno/loktxdoc.cxx 
b/sw/source/uibase/uno/loktxdoc.cxx
index 30722fb6af69..6d5ddd675c23 100644
--- a/sw/source/uibase/uno/loktxdoc.cxx
+++ b/sw/source/uibase/uno/loktxdoc.cxx
@@ -325,7 +325,7 @@ void GetSections(tools::JsonWriter& rJsonWriter, 
SwDocShell* pDocShell,
 }
 }
 
-bool SwXTextDocument::supportsCommandValues(const OUString& rCommand)
+bool SwXTextDocument::supportsCommand(const OUString& rCommand)
 {
 static const std::initializer_list vForward
 = { u"TextFormFields", u"TextFormField", u"SetDocumentProperties",


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

2023-01-11 Thread Miklos Vajna (via logerrit)
 sw/inc/IDocumentMarkAccess.hxx |2 +
 sw/qa/uibase/uno/uno.cxx   |   33 +++
 sw/source/core/doc/docbm.cxx   |   23 +++
 sw/source/core/inc/MarkManager.hxx |1 
 sw/source/uibase/uno/loktxdoc.cxx  |   44 +++--
 5 files changed, 101 insertions(+), 2 deletions(-)

New commits:
commit 4bcb66ec7b417fbe113267f2615e78fe47eb55ca
Author: Miklos Vajna 
AuthorDate: Wed Jan 11 10:38:05 2023 +0100
Commit: Miklos Vajna 
CommitDate: Wed Jan 11 13:13:48 2023 +

sw lok: expose name of bookmark under cursor

It was possible to get the names of all bookmarks, but you could not get
the name of the (innermost) bookmark under the current cursor.

Getting the name of the current bookmark is useful for Zotero: if we
already have a citation and want to insert one more, then we should turn
the current citation into a citation cluster.

Fix the problem by adding an API similar to what commit
bb20dee2ef1b0804065e1cda2c834d257fdd90ed (sw lok: expose field type &
command of fieldmark under cursor, 2023-01-05) did, but here we deal
with bookmarks, not fieldmarks.

Handle the actual bookmark lookup in MarkManager, such functionality
looks useful outside LOK as well.

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

diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx
index 93690fb2b305..20f876d16495 100644
--- a/sw/inc/IDocumentMarkAccess.hxx
+++ b/sw/inc/IDocumentMarkAccess.hxx
@@ -313,6 +313,8 @@ class IDocumentMarkAccess
 */
 virtual const_iterator_t findFirstBookmarkStartsAfter(const 
SwPosition& rPos) const =0;
 
+/// Get the innermost bookmark that contains rPos.
+virtual sw::mark::IMark* getBookmarkFor(const SwPosition& rPos) const 
= 0;
 
 // Fieldmarks
 /** returns a STL-like random access iterator to the begin of the 
sequence of fieldmarks.
diff --git a/sw/qa/uibase/uno/uno.cxx b/sw/qa/uibase/uno/uno.cxx
index 4b21bca0bb0c..d2be66457b81 100644
--- a/sw/qa/uibase/uno/uno.cxx
+++ b/sw/qa/uibase/uno/uno.cxx
@@ -442,6 +442,39 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testGetSections)
 CPPUNIT_ASSERT_EQUAL(static_cast(1), 
aTree.get_child("sections").count(""));
 }
 
+CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testGetBookmark)
+{
+// Given a document with a bookmark:
+createSwDoc();
+uno::Sequence aArgs = {
+comphelper::makePropertyValue("Bookmark", 
uno::Any(OUString("ZOTERO_BREF_1"))),
+comphelper::makePropertyValue("BookmarkText", 
uno::Any(OUString("aaabbb"))),
+};
+dispatchCommand(mxComponent, ".uno:InsertBookmark", aArgs);
+
+// When stepping into the bookmark with the cursor and getting the command 
value for
+// .uno:Bookmark:
+SwDoc* pDoc = getSwDoc();
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+pWrtShell->SttEndDoc(/*bStt=*/false);
+pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, 
/*bBasicCall=*/false);
+tools::JsonWriter aJsonWriter;
+std::string_view aCommand(".uno:Bookmark?namePrefix=ZOTERO_BREF_");
+auto pXTextDocument = dynamic_cast(mxComponent.get());
+pXTextDocument->getCommandValues(aJsonWriter, aCommand);
+
+// Then make sure we find the inserted bookmark:
+std::unique_ptr 
pJSON(aJsonWriter.extractData());
+std::stringstream aStream(pJSON.get());
+boost::property_tree::ptree aTree;
+boost::property_tree::read_json(aStream, aTree);
+boost::property_tree::ptree aBookmark = aTree.get_child("bookmark");
+// Without the accompanying fix in place, this test would have failed with:
+// - No such node (bookmark)
+// i.e. the returned JSON was an empty object.
+CPPUNIT_ASSERT_EQUAL(std::string("ZOTERO_BREF_1"), 
aBookmark.get("name"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 8e4d2ef72e95..7152c2a2314a 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1437,6 +1437,29 @@ namespace sw::mark
 return dynamic_cast(pFieldmark);
 }
 
+IMark* MarkManager::getBookmarkFor(const SwPosition& rPos) const
+{
+auto it = std::find_if(m_vBookmarks.begin(), m_vBookmarks.end(),
+   [&rPos](const sw::mark::MarkBase* pMark)
+   { return pMark->IsCoveringPosition(rPos); });
+if (it == m_vBookmarks.end())
+{
+return nullptr;
+}
+sw::mark::IMark* pBookmark = *it;
+for (; it != m_vBookmarks.end() && (*it)->GetMarkStart() <= rPos; ++it)
+{
+// Find the innermost bookmark.
+if (rPos < (*it)->GetMarkEnd()
+   

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

2023-01-11 Thread Pranam Lashkari (via logerrit)
 sw/inc/cmdid.h  |1 
 sw/qa/uibase/shells/shells.cxx  |   51 +
 sw/sdi/_textsh.sdi  |6 ++
 sw/sdi/swriter.sdi  |   14 ++
 sw/source/uibase/shells/textsh1.cxx |   73 
 5 files changed, 145 insertions(+)

New commits:
commit cc4f876d05837679caa8c86ffd8be8598b8f429e
Author: Pranam Lashkari 
AuthorDate: Wed Jan 11 08:14:55 2023 +0530
Commit: Miklos Vajna 
CommitDate: Wed Jan 11 13:28:47 2023 +

sw: rename .uno:UpdateSections command fields

renamed fields name in JSON to be consistent with section insertion and 
getter

Signed-off-by: Pranam Lashkari 
Change-Id: Icca0be155542b7dc6df1b29e6c7d4191db8659ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145315
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx
index 3a7f51f4b537..78a4f339c41b 100644
--- a/sw/qa/uibase/shells/shells.cxx
+++ b/sw/qa/uibase/shells/shells.cxx
@@ -619,11 +619,11 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, 
testUpdateSections)
 "type": "[][]com.sun.star.beans.PropertyValue",
 "value": [
 {
-"Section": {
+"RegionName": {
 "type": "string",
 "value": "ZOTERO_BIBL {} CSL_BIBLIOGRAPHY RNDnew"
 },
-"SectionText": {
+"Content": {
 "type": "string",
 "value": "new content"
 }
diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 1d367594d2a4..817eb6bc1b95 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -419,7 +419,7 @@ void UpdateSections(SfxRequest& rReq, SwWrtShell& rWrtSh)
 }
 
 comphelper::SequenceAsHashMap aMap(aSections[nSectionIndex++]);
-OUString aSectionName = aMap["Section"].get();
+OUString aSectionName = aMap["RegionName"].get();
 if (aSectionName != pFormat->GetName())
 {
 const_cast(pFormat)->SetName(aSectionName, 
/*bBroadcast=*/true);
@@ -440,7 +440,7 @@ void UpdateSections(SfxRequest& rReq, SwWrtShell& rWrtSh)
 rIDCO.DeleteAndJoin(*pCursorPos);
 rWrtSh.EndSelect();
 
-OUString aSectionText = aMap["SectionText"].get();
+OUString aSectionText = aMap["Content"].get();
 SwTranslateHelper::PasteHTMLToPaM(rWrtSh, pCursorPos, 
aSectionText.toUtf8(), true);
 }
 }
commit a6cb4d2e7b85727b5d7cb79359929b466d11c402
Author: Miklos Vajna 
AuthorDate: Tue Jan 10 08:16:47 2023 +0100
Commit: Miklos Vajna 
CommitDate: Wed Jan 11 13:28:36 2023 +

sw: add a new .uno:UpdateSections command

There was LOK API to insert a new section with provided HTML content and
to query it, but there was no LOK API to update such created section
with new names/contents.

This is needed in case Zotero wants to store citations with refmarks, in
which case it wants to store the bibliography with sections.

Introduce a .uno:UpdateSections UNO command that can do this: the
sections will be renamed if necessary & the content will be updated. The
content update is reasonably straightforward, because the section always
contains at least one empty paragraph, so there is no danger in simply
deleting the old content before inserting the new one.

This is similar to babba472391d26aed68d7ac31c7a918c08e65256 (sw,
UpdateFields: add new TypeName, NamePrefix and Fields parameters,
2023-01-04), but that was for refmarks / citations, this is for sections
/ bibliography.

(cherry picked from commit 71a479afb7e9762de930361e6089e23ab8d4af74)

Change-Id: Idde6d5ed1b0f25f40df502bb6b7e7ca590ef9151
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145281
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 7ae4a76c3bff..1d42d0113e41 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -312,6 +312,7 @@
 #define FN_TABLE_PASTE_ROW_BEFORE   (FN_INSERT2 + 31)  /* paste table as new 
table rows */
 #define FN_TABLE_PASTE_COL_BEFORE   (FN_INSERT2 + 32)  /* paste table as new 
table columns */
 #define FN_UPDATE_BOOKMARKS (FN_INSERT2 + 34)
+#define FN_UPDATE_SECTIONS (FN_INSERT2 + 35)
 
 // Region: Format
 #define FN_AUTOFORMAT_APPLY (FN_FORMAT + 1 ) /* apply autoformat options */
diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx
index 33f0d615b250..3a7f51f4b537 100644
--- a/sw/qa/uibase/shells/shells.cxx
+++ b/sw/qa/uibase/shells/shells.cxx
@@ -597,6 +597,57 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, 
testUpdateFieldmark)
 CPPUNIT_ASSERT_EQUAL(OUString("new result 1"), aAct

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

2023-01-11 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/odffmap.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit f388ea5b3734aca80d7c61c850413c649294c446
Author: Eike Rathke 
AuthorDate: Tue Jan 10 01:22:38 2023 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jan 11 13:45:47 2023 +

Related: tdf#152948 Align AddInMap English names to Add-In implementation

... of scaddins/source/analysis/analysishelper.cxx for the few (4)
functions with the _EXCEL2003 suffix. The compiler's symbol map
for English contained both, but the reverse map contained only the
(first added) ..._ADD name, so GCD_EXCEL2003() was displayed as
GCD_ADD(), that still worked but was unexpected.

Change-Id: I8c866dc73d0146d75b29f8212a7e561a3f38fce4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145247
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit f98d04571c99b70ff753d322b1f43adc8e0433ba)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145298
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/core/tool/odffmap.cxx b/sc/source/core/tool/odffmap.cxx
index 112854f4a71c..66756c0ab64f 100644
--- a/sc/source/core/tool/odffmap.cxx
+++ b/sc/source/core/tool/odffmap.cxx
@@ -34,9 +34,9 @@ const ScCompiler::AddInMap ScCompiler::g_aAddInMap[] =
 { "WORKDAY", "WORKDAY", "com.sun.star.sheet.addin.Analysis.getWorkday", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETWORKDAY" },
 { "YEARFRAC", "YEARFRAC", "com.sun.star.sheet.addin.Analysis.getYearfrac", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETYEARFRAC" },
 { "EDATE", "EDATE", "com.sun.star.sheet.addin.Analysis.getEdate", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETEDATE" },
-{ "WEEKNUM", "WEEKNUM_ADD", 
"com.sun.star.sheet.addin.Analysis.getWeeknum", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETWEEKNUM" },
+{ "WEEKNUM", "WEEKNUM_EXCEL2003", 
"com.sun.star.sheet.addin.Analysis.getWeeknum", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETWEEKNUM" },
 { "EOMONTH", "EOMONTH", "com.sun.star.sheet.addin.Analysis.getEomonth", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETEOMONTH" },
-{ "NETWORKDAYS", "NETWORKDAYS_ADD", 
"com.sun.star.sheet.addin.Analysis.getNetworkdays", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETNETWORKDAYS" },
+{ "NETWORKDAYS", "NETWORKDAYS_EXCEL2003", 
"com.sun.star.sheet.addin.Analysis.getNetworkdays", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETNETWORKDAYS" },
 { "ISEVEN", "ISEVEN_ADD", "com.sun.star.sheet.addin.Analysis.getIseven", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETISEVEN" },
 { "ISODD", "ISODD_ADD", "com.sun.star.sheet.addin.Analysis.getIsodd", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETISODD" },
 { "MULTINOMIAL", "MULTINOMIAL", 
"com.sun.star.sheet.addin.Analysis.getMultinomial", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETMULTINOMIAL" },
@@ -45,8 +45,8 @@ const ScCompiler::AddInMap ScCompiler::g_aAddInMap[] =
 { "MROUND", "MROUND", "com.sun.star.sheet.addin.Analysis.getMround", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETMROUND" },
 { "SQRTPI", "SQRTPI", "com.sun.star.sheet.addin.Analysis.getSqrtpi", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETSQRTPI" },
 { "RANDBETWEEN", "RANDBETWEEN", 
"com.sun.star.sheet.addin.Analysis.getRandbetween", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETRANDBETWEEN" },
-{ "GCD", "GCD_ADD", "com.sun.star.sheet.addin.Analysis.getGcd", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETGCD" },
-{ "LCM", "LCM_ADD", "com.sun.star.sheet.addin.Analysis.getLcm", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETLCM" },
+{ "GCD", "GCD_EXCEL2003", "com.sun.star.sheet.addin.Analysis.getGcd", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETGCD" },
+{ "LCM", "LCM_EXCEL2003", "com.sun.star.sheet.addin.Analysis.getLcm", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETLCM" },
 { "BESSELI", "BESSELI", "com.sun.star.sheet.addin.Analysis.getBesseli", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETBESSELI" },
 { "BESSELJ", "BESSELJ", "com.sun.star.sheet.addin.Analysis.getBesselj", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETBESSELJ" },
 { "BESSELK", "BESSELK", "com.sun.star.sheet.addin.Analysis.getBesselk", 
"COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETBESSELK" },


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

2023-01-11 Thread Tor Lillqvist (via logerrit)
 vcl/source/window/builder.cxx |   40 +++-
 1 file changed, 39 insertions(+), 1 deletion(-)

New commits:
commit e91663d7a7345eea45c56be99667afae6fa6a0ef
Author: Tor Lillqvist 
AuthorDate: Tue Jan 10 17:55:01 2023 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Jan 11 13:58:59 2023 +

Make the "custom widgets" for the notebookbar work in COWASM

Because building for WASM for some reason doesn't use the
native-code.py approach, we need to duplicate part of what that script
would produce.

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

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 55c5fca696ad..2463c68182a6 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1477,7 +1478,42 @@ void VclBuilderPreload()
 }
 
 #if defined DISABLE_DYNLOADING && !HAVE_FEATURE_DESKTOP
+
+// This ifdef branch is mainly for building for the Collabora Online
+// -based mobile apps for Android and iOS.
+
 extern "C" VclBuilder::customMakeWidget lo_get_custom_widget_func(const char* 
name);
+
+#elif defined EMSCRIPTEN && !ENABLE_QT5
+
+// This branch is mainly for building for WASM, and especially for
+// Collabora Online in the browser, where code from core and Collabora
+// Online is compiled to WASM and linked into a single WASM binary.
+// (Not for Allotropia's Qt-based LibreOffice in the browser.)
+
+// When building core for WASM it doesn't use the same
+// solenv/bin/native-code.py thing as the mobile apps, even if in both
+// cases everything is linked statically. So there is no generated
+// native-code.h, and we can't use lo_get_custom_widget_func() from
+// that. So cheat and duplicate the code from an existing generated
+// native-code.h. It's just a handful of lines anyway.
+
+extern "C" void makeNotebookbarTabControl(VclPtr &rRet, const 
VclPtr &pParent, VclBuilder::stringmap &rVec);
+extern "C" void makeNotebookbarToolBox(VclPtr &rRet, const 
VclPtr &pParent, VclBuilder::stringmap &rVec);
+
+static struct { const char *name; VclBuilder::customMakeWidget func; } 
custom_widgets[] = {
+{ "makeNotebookbarTabControl", makeNotebookbarTabControl },
+{ "makeNotebookbarToolBox", makeNotebookbarToolBox },
+};
+
+static VclBuilder::customMakeWidget lo_get_custom_widget_func(const char* name)
+{
+for (size_t i = 0; i < sizeof(custom_widgets) / sizeof(custom_widgets[0]); 
i++)
+if (strcmp(name, custom_widgets[i].name) == 0)
+return custom_widgets[i].func;
+return nullptr;
+}
+
 #endif
 
 namespace
@@ -1537,7 +1573,9 @@ VclBuilder::customMakeWidget GetCustomMakeWidget(const 
OString& rName)
 else
 pFunction = reinterpret_cast(
 aI->second->getFunctionSymbol(sFunction));
-#elif !HAVE_FEATURE_DESKTOP
+#elif !HAVE_FEATURE_DESKTOP || (defined EMSCRIPTEN && !ENABLE_QT5)
+// This ifdef branch is mainly for building for either the
+// Android or iOS apps, or the Collabora Online as WASM thing.
 pFunction = lo_get_custom_widget_func(sFunction.toUtf8().getStr());
 SAL_WARN_IF(!pFunction, "vcl.builder", "Could not find " << sFunction);
 assert(pFunction);


ESC meeting agenda: 2023-01-12 16:00 CET

2023-01-11 Thread Miklos Vajna

Hi,

The prototype agenda is below. Extra items are appreciated either in
this document or as a reply to this mail:

https://pad.documentfoundation.org/p/esc

You can join using Jitsi here:

https://jitsi.documentfoundation.org/esc

Regards,

Miklos

---

* Present:
+

* Completed Action Items:

* Pending Action Items:
  + backport the touchpad changes (Xisco)

* Release Engineering update (Cloph)
+ 7.4 status: 7.4.4 to be released this week?
+ 7.5 status: rc2 to be tagged this week?

* Documentation (Olivier)
+ Bugzilla Documentation statistics
248(248) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created 17(7)34(5)  94(2)  312(-4)
 commented 17(7)70(5) 291(5) 1144(-21)
  resolved  5(1)14(1)  46(-2) 193(-2)
+ top 10 contributors:
  Stéphane Guillou made 48 changes in 1 month, and 97 changes in 1 year
  Bogdan B made 28 changes in 1 month, and 178 changes in 1 year
  Ilmari Lauhakangas made 26 changes in 1 month, and 116 changes in 1 
year
  Olivier Hallot made 24 changes in 1 month, and 459 changes in 1 year
  Kaganski, Mike made 12 changes in 1 month, and 114 changes in 1 year
  Adolfo Jayme Barrientos made 7 changes in 1 month, and 38 changes in 
1 year
  Vernon, Stuart Foote made 7 changes in 1 month, and 16 changes in 1 
year
  Faure, Jean-Baptiste made 4 changes in 1 month, and 4 changes in 1 
year
  Dieter made 3 changes in 1 month, and 83 changes in 1 year
  Alain Romedenne made 2 changes in 1 month, and 33 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
282(282) (topicUI) bugs open, 69(69) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week   1 month3 months   12 months
 added  6(-1)18(-10)31(-9)  65(-8)
 commented 67(49)   217(-7)527(-5)2179(-68)
   removed  3(3)  5(1)  13(3)   40(3)
  resolved 10(8) 26(7)  68(1)  295(-5)
+ top 10 contributors:
  Heiko Tietze made 129 changes in 1 month, and 1509 changes in 1 year
  Stéphane Guillou made 60 changes in 1 month, and 89 changes in 1 year
  Vernon, Stuart Foote made 48 changes in 1 month, and 158 changes in 1 
year
  Eyal Rozenberg made 47 changes in 1 month, and 237 changes in 1 year
  Kaganski, Mike made 39 changes in 1 month, and 129 changes in 1 year
  maicol figueroa made 31 changes in 1 month, and 31 changes in 1 year
  Dieter made 28 changes in 1 month, and 207 changes in 1 year
  Ilmari Lauhakangas made 26 changes in 1 month, and 169 changes in 1 
year
  Rafael Lima made 16 changes in 1 month, and 222 changes in 1 year
  m.a.riosv made 10 changes in 1 month, and 33 changes in 1 year

* Crash Testing (Caolan)
+ 101(-4) import failure, 4(+1) export failures
+ ??? coverity issues
+ Google / ossfuzz: ?? fuzzers active now

* Crash Reporting (Xisco)
+ 7.4.0.322235(+697)
+ 7.4.1.226350(+867)
+ 7.4.2.328170(+1328)
+ 7.4.3.213478(+3120)

* Easyhack update / mentoring (Hossein)
  committer...   1 week 1 month 3 months12 months
  open  98(20) 147(-6) 151(-5)  160(-4)
   reviews 320(74)1288(14)2980(52)11678(-4)
merged 247(115)   1146(-23)   3351(10)14469(-27)
 abandoned  20(14)  43(1)  166(11)  826(6)
   own commits 153(60) 671(-34)   2367(-10)   10830(-81)
review commits  59(11) 283(4)  849(8)  2918(-2)
contributor...   1 week 1 month 3 months   12 months
  open  18(-26) 59(-8)  62(-7)  77(-7)
   reviews 772(234)   2862(-74)   7566(46)   31664(-128)
merged  28(17)  85(11) 266(18) 938(-10)
 abandoned   2(-7) 136(-6) 256(-1) 561(-7)
   own commits  28(7)  123(7)  373(6)  970(21)
review commits   0(0)0(0)0(0)0(0)
+ easyHack statistics:
   needsDevEval 9(9)   needsUXEval 1(1)   cleanup_comments 318(318)
   total 383(383)   assigned 19(19)   open 334(334)
+ top 10 contributors:
  Bogdan B made 12 patches in 1 month, and 86 patches in 1 year
  Patrick Luby made 12 patches in 1 month, and 16 patches in 1 year
  Paris Oplopoios made 9 patches in 1 month, and 92 patches in 1 year
  Povilas Kanapickas made 9 patches in 1 month, and 18 patches in 1 year
  Armin Le Grand (allotropia) made 7 patches in 1 month, and 37 patches 
in 1 year
made 6 patches in 1 month, and 27 patches in 1 year
  Stéphane Guillou made 4 patches 

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

2023-01-11 Thread László Németh (via logerrit)
 sw/qa/uitest/data/tdf146248.docx   |binary
 sw/qa/uitest/writer_tests4/insertPageHeader.py |   14 ++
 sw/source/core/unocore/unoobj2.cxx |3 +++
 3 files changed, 17 insertions(+)

New commits:
commit c617aafc370209b8807ba6e0eba2762595595a0f
Author: László Németh 
AuthorDate: Mon Jan 9 15:07:27 2023 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jan 11 16:07:57 2023 +

tdf#146248 sw: fix crash at Undo of hiding page header/footer

When Same content on first page is enabled, Undo could result
crashing after hiding header/footer with its local menu.

Note: the problem could occur in DOCX more frequently,
because of special handling of its header/footer,
see commit f5dc6b11d2218d94c9effe7a1ab418d0133da5e3
"tdf#140117 sw UI: keep headers/footers when inactive".

Manual test: load the unit test document, delete
the header with its blue local menu (not with the Page
Style dialog window!), and press Undo. (The Python
UITest does the same, but with dispatcher calls).

Regression from commit 65e52cb61d74b0c71b45b63b2da131bc6b621104
"tdf#141613 sw: fix crash at header/footer undo".

Change-Id: If89d5af2e0d123d6913dfc6a4bea1ddbaf3bd80b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145244
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit cec3c719303decd3b811a328fabd71d8c4e5ba3b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145300
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sw/qa/uitest/data/tdf146248.docx b/sw/qa/uitest/data/tdf146248.docx
new file mode 100644
index ..2b5ed2959f94
Binary files /dev/null and b/sw/qa/uitest/data/tdf146248.docx differ
diff --git a/sw/qa/uitest/writer_tests4/insertPageHeader.py 
b/sw/qa/uitest/writer_tests4/insertPageHeader.py
index 6516a31dab4d..406671021881 100644
--- a/sw/qa/uitest/writer_tests4/insertPageHeader.py
+++ b/sw/qa/uitest/writer_tests4/insertPageHeader.py
@@ -8,6 +8,7 @@
 #
 
 from uitest.framework import UITestCase
+from uitest.uihelper.common import get_url_for_data_file
 
 class WriterInsertPageHeader(UITestCase):
 
@@ -61,4 +62,17 @@ class WriterInsertPageHeader(UITestCase):
 
 self.delete_header()
 
+def test_tdf146248(self):
+with self.ui_test.load_file(get_url_for_data_file("tdf146248.docx")):
+
+self.delete_header()
+
+# crashed before
+self.xUITest.executeCommand(".uno:Undo")
+
+document = self.ui_test.get_component()
+self.assertEqual(
+document.StyleFamilies.PageStyles.Standard.HeaderIsOn, True)
+
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/source/core/unocore/unoobj2.cxx 
b/sw/source/core/unocore/unoobj2.cxx
index 538ea72430b0..e5fefbc0e376 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -1191,6 +1191,9 @@ lcl_IsStartNodeInFormat(const bool bHeader, SwStartNode 
const *const pSttNode,
 if (pHeadFootFormat)
 {
 const SwFormatContent& rFlyContent = pHeadFootFormat->GetContent();
+// tdf#146248 avoid Undo crash at shared first page
+if ( !rFlyContent.GetContentIdx() )
+return false;
 const SwNode& rNode = rFlyContent.GetContentIdx()->GetNode();
 SwStartNode const*const pCurSttNode = rNode.FindSttNodeByType(
 bHeader ? SwHeaderStartNode : SwFooterStartNode);


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

2023-01-11 Thread Eike Rathke (via logerrit)
 source/text/scalc/04/0102.xhp |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f36d8f6aea8b08f63e62a98f8ef76294e7cf7cec
Author: Eike Rathke 
AuthorDate: Wed Jan 11 17:07:10 2023 +0100
Commit: Eike Rathke 
CommitDate: Wed Jan 11 16:11:57 2023 +

Adjust End and Shift+End shortcut description to reality

It's the last column with data in any row, not the last cell with
data in the current row.

Change-Id: Ib5e719ed6b50c2c5f2b48a8d4cad8bd9f52a3cac
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/145355
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/source/text/scalc/04/0102.xhp 
b/source/text/scalc/04/0102.xhp
index 62e8ce37c3..ce6020f32c 100644
--- a/source/text/scalc/04/0102.xhp
+++ b/source/text/scalc/04/0102.xhp
@@ -82,7 +82,7 @@
   End
 
 
-  Moves the cursor to the last cell that contains values in the 
current row.
+  Moves the cursor to the last column that contains data in any 
row.
 
   
   
@@ -98,7 +98,7 @@
   Shift+End
 
 
-  Selects all cells from the current cell to the last cell that 
contains values in the current row.
+  Selects all cells from the current cell to the last column 
that contains data in any row.
 
   
   


[Libreoffice-commits] core.git: helpcontent2

2023-01-11 Thread Eike Rathke (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c4cdc2cb3323cbbff42e4410e4b3d0a1d4957504
Author: Eike Rathke 
AuthorDate: Wed Jan 11 17:11:57 2023 +0100
Commit: Gerrit Code Review 
CommitDate: Wed Jan 11 16:11:57 2023 +

Update git submodules

* Update helpcontent2 from branch 'master'
  to f36d8f6aea8b08f63e62a98f8ef76294e7cf7cec
  - Adjust End and Shift+End shortcut description to reality

It's the last column with data in any row, not the last cell with
data in the current row.

Change-Id: Ib5e719ed6b50c2c5f2b48a8d4cad8bd9f52a3cac
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/145355
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/helpcontent2 b/helpcontent2
index e933fe906751..f36d8f6aea8b 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit e933fe90675132335452d25f4ddb01d0798f3553
+Subproject commit f36d8f6aea8b08f63e62a98f8ef76294e7cf7cec


[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - formula/source include/formula sc/source

2023-01-11 Thread Eike Rathke (via logerrit)
 formula/source/core/api/FormulaCompiler.cxx |   14 --
 include/formula/FormulaCompiler.hxx |   16 +++-
 sc/source/core/tool/compiler.cxx|8 
 3 files changed, 27 insertions(+), 11 deletions(-)

New commits:
commit fdc28c4b2b42c2028f3a6bf7cfc18c94ee072969
Author: Eike Rathke 
AuthorDate: Sun Jan 1 15:35:16 2023 +0100
Commit: Mike Kaganski 
CommitDate: Wed Jan 11 16:31:06 2023 +

Resolves: tdf#151886 Use default locale with English function names again

Automatically switching to en-US locale when using English
function names caused too much confusion. There also might be the
possibility that the '.' dot decimal separator clashes with the
inline array column separator in some locales.

A proper solution would make this user-specified and if set also
adjust the separators to the common English ones. For now keep the
default locale again as it previously was the case.

Change-Id: Ic4712c6609c14f35cf0d1d842ac7443806a6e115
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144924
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit cf8cfee9d4e64dba6a14dde16f08a7699fdff863)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144906
Reviewed-by: Mike Kaganski 

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 192cb56173fc..b39e618a5b1e 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1313,7 +1313,17 @@ void FormulaCompiler::OpCodeMap::copyFrom( const 
OpCodeMap& r )
 maExternalHashMap = r.maExternalHashMap;
 maReverseExternalHashMap = r.maReverseExternalHashMap;
 mbCore = r.mbCore;
-mbEnglish = r.mbEnglish;
+if (mbEnglish != r.mbEnglish)
+{
+// For now keep mbEnglishLocale setting, which is false for a
+// non-English native map we're copying to.
+/* TODO:
+if (!mbEnglish && r.mbEnglish)
+mbEnglishLocale = "getUseEnglishLocaleFromConfiguration()";
+or set from outside i.e. via ScCompiler.
+*/
+mbEnglish = r.mbEnglish;
+}
 }
 }
 
@@ -2644,7 +2654,7 @@ const FormulaToken* 
FormulaCompiler::CreateStringFromToken( OUStringBuffer& rBuf
 
 void FormulaCompiler::AppendDouble( OUStringBuffer& rBuffer, double fVal ) 
const
 {
-if ( mxSymbols->isEnglish() )
+if ( mxSymbols->isEnglishLocale() )
 {
 ::rtl::math::doubleToUStringBuffer( rBuffer, fVal,
 rtl_math_StringFormat_Automatic,
diff --git a/include/formula/FormulaCompiler.hxx 
b/include/formula/FormulaCompiler.hxx
index d94dbd40d399..08710f561b5a 100644
--- a/include/formula/FormulaCompiler.hxx
+++ b/include/formula/FormulaCompiler.hxx
@@ -83,12 +83,13 @@ public:
 {
 OpCodeHashMap   maHashMap;  /// Hash map of 
symbols, OUString -> OpCode
 std::unique_ptr mpTable;/// Array of 
symbols, OpCode -> OUString, offset==OpCode
-ExternalHashMap maExternalHashMap; /// Hash map of 
ocExternal, Filter String -> AddIn String
-ExternalHashMap maReverseExternalHashMap;  /// Hash map of 
ocExternal, AddIn String -> Filter String
+ExternalHashMap maExternalHashMap;  /// Hash map of 
ocExternal, Filter String -> AddIn String
+ExternalHashMap maReverseExternalHashMap;   /// Hash map of 
ocExternal, AddIn String -> Filter String
 FormulaGrammar::Grammar meGrammar;  /// Grammar, 
language and reference convention
 sal_uInt16  mnSymbols;  /// Count of 
OpCode symbols
-boolmbCore  : 1;/// If mapping was 
setup by core, not filters
-boolmbEnglish   : 1;/// If English 
symbols and external names
+boolmbCore  : 1;/// If mapping was 
setup by core, not filters
+boolmbEnglish   : 1;/// If English 
symbols and external names
+boolmbEnglishLocale : 1;/// If English 
locale for numbers
 
 OpCodeMap( const OpCodeMap& ) = delete;
 OpCodeMap& operator=( const OpCodeMap& ) = delete;
@@ -101,7 +102,8 @@ public:
 meGrammar( eGrammar),
 mnSymbols( nSymbols),
 mbCore( bCore),
-mbEnglish ( FormulaGrammar::isEnglish(eGrammar) )
+mbEnglish ( FormulaGrammar::isEnglish(eGrammar) ),
+mbEnglishLocale ( mbEnglish )
 {
 }
 
@@ -145,6 +147,10 @@ public:
 be English as well)? */
 bool isEnglish() const { return mbEnglish; }
 
+/** Are inline numbers parsed/formatted in en-US locale, as opposed
+to default loca

Re: LibreOffice architecture support (was: Fwd: Plan to remove dead C++ UNO bridge implementations (bridges/source/cpp_uno/*))

2023-01-11 Thread John Paul Adrian Glaubitz

Hi Stephan!

On 1/11/23 08:21, Stephan Bergmann wrote:

On 10/01/2023 19:57, John Paul Adrian Glaubitz wrote:

(5) Presumably dead:
* gcc3_linux_alpha


=> https://buildd.debian.org/status/logs.php?pkg=libreoffice&arch=alpha


Thanks for those pointers.  Just to make sure, the latest line there being


1:6.4.5-1 (sid) Buildd exposure stats alpha Maybe-Failed 2020-07-03 
06:39:28 phys 18h 37m 9.48 GB


means that that's a build of LO 6.4.5, right?  Are all those Debian Ports 
builds consistently lagging behind current LO master by N years?


No, that's not a consistent state but rather was due to various resource 
problems in the past.

I have actually started working these issues out now and as a first result, the 
latest version
of the libreoffice package was already built successfully on 32-bit PowerPC:


https://buildd.debian.org/status/package.php?p=libreoffice&suite=sid


More architectures will follow within the next weeks. I will make use of the 
freed up time to work
on these issues to get LibreOffice building.

If it helps, please add myself as a code owner for the Debian Ports 
architectures. I am willing to
keep the stuff working together with the other maintainers in Debian Ports (and 
probably Gentoo).

Thanks,
Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



[Libreoffice-commits] core.git: solenv/gbuild

2023-01-11 Thread Tor Lillqvist (via logerrit)
 solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 67471b3a7fb33884e70e29163b4eddf47fa85115
Author: Tor Lillqvist 
AuthorDate: Wed Jan 11 17:39:06 2023 +0200
Commit: Tor Lillqvist 
CommitDate: Wed Jan 11 22:49:45 2023 +

Use gb_EMSCRIPTEN_QTDEFS only when building with Qt5

Move -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE to gb_EMSCRIPTEN_CPPFLAGS.

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

diff --git a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk 
b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
index b0629894a07e..8831aeeb5d54 100644
--- a/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/EMSCRIPTEN_INTEL_GCC.mk
@@ -18,7 +18,7 @@ gb_EMSCRIPTEN_PRE_JS_FILES = \
 
 gb_RUN_CONFIGURE := $(SRCDIR)/solenv/bin/run-configure
 # avoid -s SAFE_HEAP=1 - c.f. gh#8584 this breaks source maps
-gb_EMSCRIPTEN_CPPFLAGS := -pthread -s USE_PTHREADS=1
+gb_EMSCRIPTEN_CPPFLAGS := -pthread -s USE_PTHREADS=1 -D_LARGEFILE64_SOURCE 
-D_LARGEFILE_SOURCE
 gb_EMSCRIPTEN_LDFLAGS := $(gb_EMSCRIPTEN_CPPFLAGS)
 
 # Initial memory size and worker thread pool
@@ -28,7 +28,7 @@ gb_EMSCRIPTEN_LDFLAGS += -s TOTAL_MEMORY=1GB -s 
PTHREAD_POOL_SIZE=4
 # See emscripten.py, finalize_wasm, modify_wasm = True
 # So we need WASM_BIGINT=1 and ASSERTIONS=1 (2 implies STACK_OVERFLOW_CHECK)
 gb_EMSCRIPTEN_LDFLAGS += --bind -s FORCE_FILESYSTEM=1 -s WASM_BIGINT=1 -s 
ERROR_ON_UNDEFINED_SYMBOLS=1 -s FETCH=1 -s ASSERTIONS=1 -s EXIT_RUNTIME=0 -s 
EXPORTED_RUNTIME_METHODS=["UTF16ToString","stringToUTF16","UTF8ToString","allocateUTF8","printErr","ccall","cwrap"]
-gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS 
-DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG 
-DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
+gb_EMSCRIPTEN_QTDEFS := -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS 
-DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
 
 gb_Executable_EXT := .html
 ifeq ($(ENABLE_WASM_EXCEPTIONS),TRUE)
@@ -40,8 +40,12 @@ endif
 
 gb_CXXFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS)
 gb_LinkTarget_EXCEPTIONFLAGS += $(gb_EMSCRIPTEN_EXCEPT)
-gb_LinkTarget_CFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS) $(gb_EMSCRIPTEN_QTDEFS)
-gb_LinkTarget_CXXFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS) $(gb_EMSCRIPTEN_QTDEFS) 
$(gb_EMSCRIPTEN_EXCEPT)
+gb_LinkTarget_CFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS)
+gb_LinkTarget_CXXFLAGS += $(gb_EMSCRIPTEN_CPPFLAGS) $(gb_EMSCRIPTEN_EXCEPT)
+ifeq ($(ENABLE_QT5),TRUE)
+gb_LinkTarget_CFLAGS += $(gb_EMSCRIPTEN_QTDEFS)
+gb_LinkTarget_CXXFLAGS += $(gb_EMSCRIPTEN_QTDEFS)
+endif
 gb_LinkTarget_LDFLAGS += $(gb_EMSCRIPTEN_LDFLAGS) $(gb_EMSCRIPTEN_CPPFLAGS) 
$(gb_EMSCRIPTEN_EXCEPT)
 
 # Linker and compiler optimize + debug flags are handled in LinkTarget.mk


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

2023-01-11 Thread Miklos Vajna (via logerrit)
 sw/inc/cmdid.h  |1 
 sw/qa/uibase/shells/shells.cxx  |   51 +
 sw/sdi/_textsh.sdi  |5 ++
 sw/sdi/swriter.sdi  |   14 +
 sw/source/uibase/shells/textsh1.cxx |   86 
 5 files changed, 157 insertions(+)

New commits:
commit ea208f6004770eb4b81d28e6930cd0c7bd5d8f12
Author: Miklos Vajna 
AuthorDate: Wed Jan 11 15:56:31 2023 +0100
Commit: Miklos Vajna 
CommitDate: Wed Jan 11 22:54:33 2023 +

sw: add a new .uno:UpdateBookmark UNO command

It is possible to update all bookmarks (having a certain name prefix)
and their contet, but one can't update the bookmark under the cursor,
which is needed for Zotero citation clusters.

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

This can be implemented on top of the recently added
IDocumentMarkAccess::getBookmarkFor().

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: I3e750dfb637f50716be1155a94bc986131b84f20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145351
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index befe8e26d607..3baa2f050ecc 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -325,6 +325,7 @@ class SwUINumRuleItem;
 #define FN_UPDATE_BOOKMARKS (FN_INSERT2 + 34)
 #define FN_UPDATE_SECTIONS (FN_INSERT2 + 35)
 #define FN_DELETE_TEXT_FORMFIELDS (FN_INSERT2 + 36)
+#define FN_UPDATE_BOOKMARK (FN_INSERT2 + 37)
 
 // Region: Format
 #define FN_AUTOFORMAT_APPLY (FN_FORMAT + 1 ) /* apply autoformat options */
diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx
index edfe255f4ad7..b8f466b63a8e 100644
--- a/sw/qa/uibase/shells/shells.cxx
+++ b/sw/qa/uibase/shells/shells.cxx
@@ -758,6 +758,57 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, 
testDeleteFieldmarks)
 CPPUNIT_ASSERT_EQUAL(OUString("result 1result 2"), aActual);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testUpdateBookmark)
+{
+// Given a document with a bookmarks, covering "BC":
+createSwDoc();
+SwDoc* pDoc = getSwDoc();
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+pWrtShell->Insert("ABCD");
+pWrtShell->SttEndDoc(/*bStt=*/true);
+pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 1, 
/*bBasicCall=*/false);
+pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 2, 
/*bBasicCall=*/false);
+pWrtShell->SetBookmark(vcl::KeyCode(), "ZOTERO_BREF_old");
+
+// When updating the content of the bookmark under the cursor:
+pWrtShell->SttEndDoc(/*bStt=*/true);
+pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 2, 
/*bBasicCall=*/false);
+std::vector aArgsVec = 
comphelper::JsonToPropertyValues(R"json(
+{
+"BookmarkNamePrefix": {
+"type": "string",
+"value": "ZOTERO_BREF_"
+},
+"Bookmark": {
+"type": "[]com.sun.star.beans.PropertyValue",
+"value": {
+"Bookmark": {
+"type": "string",
+"value": "ZOTERO_BREF_new"
+},
+"BookmarkText": {
+"type": "string",
+"value": "new result"
+}
+}
+}
+}
+)json");
+uno::Sequence aArgs = 
comphelper::containerToSequence(aArgsVec);
+dispatchCommand(mxComponent, ".uno:UpdateBookmark", aArgs);
+
+// Then make sure that the only paragraph is updated correctly:
+SwCursor* pCursor = pWrtShell->GetCursor();
+OUString aActual = pCursor->GetPointNode().GetTextNode()->GetText();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: Anew resultD
+// - Actual  : ABCD
+// i.e. it was not possible to update just the bookmark under cursor.
+CPPUNIT_ASSERT_EQUAL(OUString("Anew resultD"), aActual);
+auto it = pDoc->getIDocumentMarkAccess()->findMark("ZOTERO_BREF_new");
+CPPUNIT_ASSERT(it != pDoc->getIDocumentMarkAccess()->getAllMarksEnd());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index 99f50c8e3b27..f08e0b21b675 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -152,6 +152,11 @@ interface BaseText
 StateMethod = GetState ;
 DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
 ]
+FN_UPDATE_BOOKMARK
+[
+ExecMethod = Execute ;
+DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
+]
 FN_UPDATE_SECTIONS
 [
 ExecMethod = Execute ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 76939d94c03a..ebded3b24b72 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -2600,6 +2600,20 @@ Sfx

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

2023-01-11 Thread Justin Luth (via logerrit)
 include/svx/nbdtmg.hxx|8 
 svx/source/sidebar/nbdtmg.cxx |8 
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 613baf1573757f8af594eda2460076b4eaad7c64
Author: Justin Luth 
AuthorDate: Sat Jan 7 07:24:30 2023 -0500
Commit: Justin Luth 
CommitDate: Wed Jan 11 23:57:01 2023 +

svx typo: RelplaceNumRule -> ReplaceNumRule

Change-Id: Ic11fcf35a7b1a6fb15a4046300639622095ed823
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145241
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/include/svx/nbdtmg.hxx b/include/svx/nbdtmg.hxx
index 5bbb310a9d74..81ef80223496 100644
--- a/include/svx/nbdtmg.hxx
+++ b/include/svx/nbdtmg.hxx
@@ -128,7 +128,7 @@ class SVX_DLLPUBLIC NBOTypeMgrBase
 virtual ~NBOTypeMgrBase() {}
 virtual void Init()=0;
 virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 
mLevel,sal_uInt16 nFromIndex=0) = 0;
-virtual void RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel) = 0;
+virtual void ReplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel) = 0;
 virtual void ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel, bool isDefault=false,bool isResetSize=false) = 0;
 virtual OUString GetDescription(sal_uInt16 nIndex, bool isDefault)=0;
 virtual bool IsCustomized(sal_uInt16 nIndex)=0;
@@ -160,7 +160,7 @@ class BulletsTypeMgr final : public NBOTypeMgrBase
 BulletsTypeMgr();
 virtual void Init() override;
 virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 
mLevel,sal_uInt16 nFromIndex=0) override;
-virtual void RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel) override;
+virtual void ReplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel) override;
 virtual void ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel, bool isDefault=false,bool isResetSize=false) override;
 virtual OUString GetDescription(sal_uInt16 nIndex, bool isDefault) 
override;
 virtual bool IsCustomized(sal_uInt16 nIndex) override;
@@ -176,7 +176,7 @@ class NumberingTypeMgr final : public NBOTypeMgrBase
 virtual ~NumberingTypeMgr() override;
 virtual void Init() override;
 virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 
mLevel,sal_uInt16 nFromIndex=0) override;
-virtual void RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel) override;
+virtual void ReplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel) override;
 virtual void ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel, bool isDefault=false,bool isResetSize=false) override;
 virtual OUString GetDescription(sal_uInt16 nIndex, bool isDefault) 
override;
 virtual bool IsCustomized(sal_uInt16 nIndex) override;
@@ -193,7 +193,7 @@ class OutlineTypeMgr final : public NBOTypeMgrBase
 OutlineTypeMgr();
 virtual void Init() override;
 virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 
mLevel,sal_uInt16 nFromIndex=0) override;
-virtual void RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel) override;
+virtual void ReplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel) override;
 virtual void ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel, bool isDefault=false,bool isResetSize=false) override;
 virtual OUString GetDescription(sal_uInt16 nIndex, bool isDefault) 
override;
 virtual bool IsCustomized(sal_uInt16 nIndex) override;
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index 3643976d2866..2519ece7e60c 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -206,7 +206,7 @@ void NBOTypeMgrBase::ImplLoad(std::u16string_view filename)
 aNum.SetLevel(i, aFmt);
 }
 }
-RelplaceNumRule(aNum,nNumIndex,0x1/*nLevel*/);
+ReplaceNumRule(aNum,nNumIndex,0x1/*nLevel*/);
 xIStm->ReadInt32( nNumIndex );
 }
 }
@@ -298,7 +298,7 @@ sal_uInt16 
BulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLe
 return sal_uInt16(0x);
 }
 
-void BulletsTypeMgr::RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel)
+void BulletsTypeMgr::ReplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel)
 {
 if ( mLevel == sal_uInt16(0x) || mLevel == 0)
 return;
@@ -468,7 +468,7 @@ sal_uInt16 
NumberingTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 m
 return sal_uInt16(0x);
 }
 
-void NumberingTypeMgr::RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel)
+void NumberingTypeMgr::ReplaceNumRul

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

2023-01-11 Thread Justin Luth (via logerrit)
 svx/source/tbxctrls/bulletsnumbering.cxx |7 +-
 sw/source/uibase/shells/txtnum.cxx   |   33 ---
 2 files changed, 6 insertions(+), 34 deletions(-)

New commits:
commit d07b1cc8148140bd3a78103da668d002b9d266ab
Author: Justin Luth 
AuthorDate: Mon Jan 9 14:18:15 2023 -0500
Commit: Justin Luth 
CommitDate: Thu Jan 12 00:04:06 2023 +

Revert "tdf#56258 svx SetOutline: convert to toggle"

This reverts 7.6 commit a9b666b6b839735919923d8911f7e1efe0eb87b0.

This causes too many unexpected things for the user.
The biggest problem is that it does not join
the previous list like the other numbering does.

I suppose I could fix that by first calling a UNO
command that joins/turns on numbering.

However, that is a bit more dangerous with outline,
since it modifies spacing / numbering on all levels,
and joining can unexpected skip empty paragraphs etc.

So best to just always treat the button as a dropdown
to indicate to the user that they are applying an outline change.

For the present I decided to leave the lighted-up
aspect in place, so show that the outline is in effect.

In terms of removing the list,
which was the main reason for the change in the first place,
there are several workarounds. The user has the option
to go to "more choices" and remove, or select an all-1s choice
and then remove that. Using the bullets button also is
an easy option since it seems less restricted than numbering.

The overall risk is no different from before,
except that it is easier to make those kinds of levels
now that the outline button is always available on the toolbar.

Change-Id: I64e13f203ae65b2d2b28560ba747ca99d1456578
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145240
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 

diff --git a/svx/source/tbxctrls/bulletsnumbering.cxx 
b/svx/source/tbxctrls/bulletsnumbering.cxx
index 413cbc183025..a9195cd5a695 100644
--- a/svx/source/tbxctrls/bulletsnumbering.cxx
+++ b/svx/source/tbxctrls/bulletsnumbering.cxx
@@ -215,7 +215,12 @@ void SAL_CALL NumberingToolBoxControl::initialize( const 
css::uno::Sequence< css
 ToolBox* pToolBox = nullptr;
 ToolBoxItemId nId;
 if (getToolboxId(nId, &pToolBox))
-pToolBox->SetItemBits(nId, pToolBox->GetItemBits(nId) | 
ToolBoxItemBits::DROPDOWN);
+{
+ToolBoxItemBits nBits = mePageType == NumberingPageType::OUTLINE
+? ToolBoxItemBits::DROPDOWNONLY
+: ToolBoxItemBits::DROPDOWN;
+pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | nBits );
+}
 }
 
 OUString SAL_CALL NumberingToolBoxControl::getImplementationName()
diff --git a/sw/source/uibase/shells/txtnum.cxx 
b/sw/source/uibase/shells/txtnum.cxx
index 3410d962ff79..34a95d13ee8e 100644
--- a/sw/source/uibase/shells/txtnum.cxx
+++ b/sw/source/uibase/shells/txtnum.cxx
@@ -17,8 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -312,37 +310,6 @@ void SwTextShell::ExecSetNumber(SfxRequest const &rReq)
 GetShell().SetCurNumRule( aNewNumRule, bCreateNewList );
 }
 }
-else if (nSlot == FN_SVX_SET_OUTLINE)
-{
-// FN_SVX_SET_NUMBER and FN_SVX_SET_BULLET are only dropdown 
actions,
-// but FN_SVX_SET_OUTLINE is different. It is also the button 
action,
-// which is what is being handled here..
-
-// Only toggle off if the current selection is a valid outline 
choice,
-// otherwise do nothing if other bullets/numbering are part of 
the selection.
-const SwNumRule* pNumRule = 
GetShell().GetNumRuleAtCurrentSelection();
-if (pNumRule)
-{
-SvxNumRule aSvxRule = pNumRule->MakeSvxNumRule();
-
-svx::sidebar::NBOTypeMgrBase* pOutline
-= svx::sidebar::NBOutlineTypeMgrFact::CreateInstance(
-svx::sidebar::NBOType::Outline);
-if (pOutline)
-{
-const sal_uInt16 nIndex = 
pOutline->GetNBOIndexForNumRule(aSvxRule, 0);
-if (nIndex < USHRT_MAX)
-comphelper::dispatchCommand(".uno:RemoveBullets", 
{});
-}
-}
-else if (!GetShell().GetNumRuleAtCurrCursorPos())
-{
-// No numbering yet. Just use the first locale-defined 
choice.
-auto aArgs(comphelper::InitPropertySequence(
-{ { "SetOutline", uno::Any(sal_uInt16(1)) } }));
-comphelper::dispatchCommand(".uno:SetOutline", aArgs);
-  

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

2023-01-11 Thread Pranam Lashkari (via logerrit)
 sw/qa/uibase/shells/shells.cxx  |4 ++--
 sw/source/uibase/shells/textsh1.cxx |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 92deea6301a02f5530f17263f58402344f82013c
Author: Pranam Lashkari 
AuthorDate: Wed Jan 11 08:14:55 2023 +0530
Commit: Pranam Lashkari 
CommitDate: Thu Jan 12 02:49:11 2023 +

sw: rename .uno:UpdateSections command fields

renamed fields name in JSON to be consistent with section insertion and 
getter

Signed-off-by: Pranam Lashkari 
Change-Id: Icca0be155542b7dc6df1b29e6c7d4191db8659ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145315
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
(cherry picked from commit cc4f876d05837679caa8c86ffd8be8598b8f429e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145308

diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx
index b8f466b63a8e..8a7d7fce4f87 100644
--- a/sw/qa/uibase/shells/shells.cxx
+++ b/sw/qa/uibase/shells/shells.cxx
@@ -684,11 +684,11 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, 
testUpdateSections)
 "type": "[][]com.sun.star.beans.PropertyValue",
 "value": [
 {
-"Section": {
+"RegionName": {
 "type": "string",
 "value": "ZOTERO_BIBL {} CSL_BIBLIOGRAPHY RNDnew"
 },
-"SectionText": {
+"Content": {
 "type": "string",
 "value": "new content"
 }
diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index c7fe4fc9c190..7e8edb2fc508 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -420,7 +420,7 @@ void UpdateSections(SfxRequest& rReq, SwWrtShell& rWrtSh)
 }
 
 comphelper::SequenceAsHashMap aMap(aSections[nSectionIndex++]);
-OUString aSectionName = aMap["Section"].get();
+OUString aSectionName = aMap["RegionName"].get();
 if (aSectionName != pFormat->GetName())
 {
 const_cast(pFormat)->SetFormatName(aSectionName, 
/*bBroadcast=*/true);
@@ -441,7 +441,7 @@ void UpdateSections(SfxRequest& rReq, SwWrtShell& rWrtSh)
 rIDCO.DeleteAndJoin(*pCursorPos);
 rWrtSh.EndSelect();
 
-OUString aSectionText = aMap["SectionText"].get();
+OUString aSectionText = aMap["Content"].get();
 SwTranslateHelper::PasteHTMLToPaM(rWrtSh, pCursorPos, 
aSectionText.toUtf8(), true);
 }
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 2 commits - editeng/source include/editeng sw/CppunitTest_sw_core_theme.mk sw/Module_sw.mk sw/qa sw/source writerfilter/source xmlo

2023-01-11 Thread Tomaž Vajngerl (via logerrit)
 editeng/source/items/textitem.cxx |   25 +++
 include/editeng/colritem.hxx  |   26 ---
 sw/CppunitTest_sw_core_theme.mk   |   62 ++
 sw/Module_sw.mk   |1 
 sw/qa/core/theme/ThemeTest.cxx|   31 +
 sw/qa/core/theme/data/ThemeColorInHeading.docx|binary
 sw/source/core/unocore/unomap.cxx |2 
 sw/source/core/unocore/unomap1.cxx|4 +
 sw/source/core/unocore/unomapproperties.hxx   |6 +
 sw/source/uibase/sidebar/ThemePanel.cxx   |   29 ++--
 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |   14 ++--
 writerfilter/source/dmapper/DomainMapper.cxx  |   16 
 writerfilter/source/dmapper/PropertyIds.cxx   |2 
 writerfilter/source/dmapper/PropertyIds.hxx   |2 
 writerfilter/source/dmapper/TDefTableHandler.cxx  |   44 
 writerfilter/source/dmapper/TDefTableHandler.hxx  |1 
 xmloff/inc/XMLThemeColorHandler.hxx   |   49 ++
 xmloff/inc/enummaps.hxx   |2 
 xmloff/source/draw/sdpropls.cxx   |3 
 xmloff/source/text/txtprhdl.cxx   |6 +
 20 files changed, 273 insertions(+), 52 deletions(-)

New commits:
commit 0ba2265645f884d9a3df89fb95e8695998e2a832
Author: Tomaž Vajngerl 
AuthorDate: Mon Dec 5 13:59:22 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jan 12 03:28:16 2023 +

editeng: move "tint or shade" variable into SvxThemeColor

Change-Id: Ia2094854a8275082cf7444307e17fe5449c43b3a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143698
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 6fb682487e355933d79a8ef74560ecf318b4f705)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145368
Tested-by: Jenkins CollaboraOffice 

diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index 72b982b73ff9..329af5edb076 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1353,9 +1353,10 @@ bool SvxContourItem::GetPresentation
 }
 
 SvxThemeColor::SvxThemeColor()
-: maThemeIndex(-1),
-mnLumMod(1),
-mnLumOff(0)
+: maThemeIndex(-1)
+, mnLumMod(1)
+, mnLumOff(0)
+, mnTintOrShade(0)
 {
 }
 
@@ -1363,7 +1364,8 @@ bool SvxThemeColor::operator==(const SvxThemeColor& 
rThemeColor) const
 {
 return maThemeIndex == rThemeColor.maThemeIndex &&
 mnLumMod == rThemeColor.mnLumMod &&
-mnLumOff == rThemeColor.mnLumOff;
+mnLumOff == rThemeColor.mnLumOff &&
+mnTintOrShade  == rThemeColor.mnTintOrShade;
 }
 
 void SvxThemeColor::dumpAsXml(xmlTextWriterPtr pWriter) const
@@ -1376,6 +1378,8 @@ void SvxThemeColor::dumpAsXml(xmlTextWriterPtr pWriter) 
const
   
BAD_CAST(OString::number(mnLumMod).getStr()));
 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("lum-off"),
   
BAD_CAST(OString::number(mnLumOff).getStr()));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("tint-or-shade"),
+  
BAD_CAST(OString::number(mnTintOrShade).getStr()));
 
 (void)xmlTextWriterEndElement(pWriter);
 }
@@ -1383,15 +1387,13 @@ void SvxThemeColor::dumpAsXml(xmlTextWriterPtr pWriter) 
const
 // class SvxColorItem 
 SvxColorItem::SvxColorItem( const sal_uInt16 nId ) :
 SfxPoolItem(nId),
-mColor( COL_BLACK ),
-maTintShade(0)
+mColor( COL_BLACK )
 {
 }
 
 SvxColorItem::SvxColorItem( const Color& rCol, const sal_uInt16 nId ) :
 SfxPoolItem( nId ),
-mColor( rCol ),
-maTintShade(0)
+mColor( rCol )
 {
 }
 
@@ -1405,8 +1407,7 @@ bool SvxColorItem::operator==( const SfxPoolItem& rAttr ) 
const
 const SvxColorItem& rColorItem = static_cast(rAttr);
 
 return mColor == rColorItem.mColor &&
-   maThemeColor == rColorItem.maThemeColor &&
-   maTintShade == rColorItem.maTintShade;
+   maThemeColor == rColorItem.maThemeColor;
 }
 
 bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
@@ -1432,7 +1433,7 @@ bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
 }
 case MID_COLOR_TINT_OR_SHADE:
 {
-rVal <<= maTintShade;
+rVal <<= maThemeColor.GetTintOrShade();
 break;
 }
 case MID_COLOR_LUM_MOD:
@@ -1488,7 +1489,7 @@ bool SvxColorItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
 sal_Int16 nTintShade = -1;
 if (!(rVal >>= nTintShade))
 return false;
-maTintShade = nTintShade;
+maThemeColor.SetTintOrShade(nTintShade);
 }
 break;
  

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

2023-01-11 Thread Shulhan (via logerrit)
 dictionaries|2 
 sw/qa/extras/ooxmlexport/data/tdf152425.docx|binary
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx  |8 
 sw/qa/extras/ooxmlexport/ooxmlexport16.cxx  |2 
 sw/qa/extras/ooxmlexport/ooxmlexport18.cxx  |   14 +
 sw/source/filter/inc/wwstyles.hxx   |1 
 sw/source/filter/ww8/docxattributeoutput.cxx|   16 -
 sw/source/filter/ww8/styles.cxx |  186 +--
 sw/source/filter/ww8/wrtw8sty.cxx   |  149 ---
 sw/source/filter/ww8/wrtww8.hxx |   10 -
 writerfilter/source/dmapper/StyleSheetTable.cxx |  232 +---
 11 files changed, 340 insertions(+), 280 deletions(-)

New commits:
commit 7f0b6db955ee52f4216416566e108245f2b3a821
Author: Shulhan 
AuthorDate: Thu Jan 12 11:34:31 2023 +0700
Commit: Gerrit Code Review 
CommitDate: Thu Jan 12 04:34:31 2023 +

Update git submodules

* Update dictionaries from branch 'master'
  to 40580c5dbb5b06fbf402b5864e736527b05cd2f5
  - id: sync dictionaries to version v2.3.0 (2022.09.21)

In the dictionary file we add 15773 new root words, sort them out to
simplify search and update in the future.

In the affix file we fix some format for Lucene.

The README updated to match with upstream [1].

[1] https://github.com/shuLhan/hunspell-id

Change-Id: Ie96776aba2399b90cfbc113782c720a157458bc3
Reviewed-on: https://gerrit.libreoffice.org/c/dictionaries/+/140263
Tested-by: Aron Budea 
Reviewed-by: Aron Budea 

diff --git a/dictionaries b/dictionaries
index f191df059976..40580c5dbb5b 16
--- a/dictionaries
+++ b/dictionaries
@@ -1 +1 @@
-Subproject commit f191df059976deba5f60983bb4a87ab184835fd4
+Subproject commit 40580c5dbb5b06fbf402b5864e736527b05cd2f5
commit 13d30067370353ae5a43c2f2cbd69bb824363815
Author: Mike Kaganski 
AuthorDate: Wed Jan 11 17:02:04 2023 +0300
Commit: Mike Kaganski 
CommitDate: Thu Jan 12 04:34:27 2023 +

tdf#152425 Synchronize import and export style names mapping

1. Make the mapping in StyleSheetTable::ConvertStyleName match the
   opposite direction mapping happening in MSWordStyles::GetWWId and
   ww::GetEnglishNameFromSti. Add missing styles, provide comments to
   clarify the process and find respective pool format ids.
2. Instead of appending " (user)" to conflicting style names, which
   is the method used by SwStyleNameMapper to disambiguate API names,
   append " (WW)", which allows to avoid unwanted merging conflicting
   styles.

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

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
index 92e13b4b7d3b..7b7213e0f019 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
@@ -264,17 +264,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf152425)
 
 // Check that "List Number" and "List 5" styles don't get merged
 const OUString Para3Style = getProperty(getParagraph(3), 
"ParaStyleName");
-CPPUNIT_ASSERT_EQUAL(OUString("List Number"), Para3Style);
+CPPUNIT_ASSERT_EQUAL(OUString("Numbering 1"), Para3Style);
 const OUString Para4Style = getProperty(getParagraph(4), 
"ParaStyleName");
-// Eventually, we need to check this:
-// CPPUNIT_ASSERT_EQUAL(OUString("List 5"), Para4Style);
-// But for now, just make sure that the style names differ
-CPPUNIT_ASSERT(Para4Style != Para3Style);
+CPPUNIT_ASSERT_EQUAL(OUString("List 5 (WW)"), Para4Style);
+// Also check that "List 5" and "List Bullet 5" styles don't get merged
 const OUString Para5Style = getProperty(getParagraph(5), 
"ParaStyleName");
-// Eventually, we need to check this:
-// CPPUNIT_ASSERT_EQUAL(OUString("List Bullet 5"), Para5Style);
-// But for now, just make sure that the style names differ
-CPPUNIT_ASSERT(Para5Style != Para4Style);
+CPPUNIT_ASSERT_EQUAL(OUString("List 5"), Para5Style);
 }
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/styles.cxx b/sw/source/filter/ww8/styles.cxx
index c7a28e77e60b..33d0ad3dec5f 100644
--- a/sw/source/filter/ww8/styles.cxx
+++ b/sw/source/filter/ww8/styles.cxx
@@ -23,6 +23,7 @@
 
 namespace
 {
+// Keep in sync with StyleSheetTable::ConvertStyleName
 const char **GetStiNames() noexcept
 {
 // Matches enum ww::sti in sw/source/filter/inc/wwstyles.hxx
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index 9f534b1b55d2..72fca1b3696f 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -200,6 +200,7 @@ static sal_uInt16 BuildGetSlot(const SwFormat& rFormat)
 }
 
 
+// Keep in sync with Sty

[Libreoffice-commits] dictionaries.git: Dictionary_id.mk id/description.xml id/id_ID.aff id/id_ID.dic id/README-dict.adoc id/README-dict.md

2023-01-11 Thread Shulhan (via logerrit)
 Dictionary_id.mk|2 
 id/README-dict.adoc |  137 
 id/README-dict.md   |   55 
 id/description.xml  |2 
 id/id_ID.aff|  107 
 id/id_ID.dic|19909 ++--
 6 files changed, 18036 insertions(+), 2176 deletions(-)

New commits:
commit 40580c5dbb5b06fbf402b5864e736527b05cd2f5
Author: Shulhan 
AuthorDate: Wed Sep 21 02:13:55 2022 +0700
Commit: Aron Budea 
CommitDate: Thu Jan 12 04:34:31 2023 +

id: sync dictionaries to version v2.3.0 (2022.09.21)

In the dictionary file we add 15773 new root words, sort them out to
simplify search and update in the future.

In the affix file we fix some format for Lucene.

The README updated to match with upstream [1].

[1] https://github.com/shuLhan/hunspell-id

Change-Id: Ie96776aba2399b90cfbc113782c720a157458bc3
Reviewed-on: https://gerrit.libreoffice.org/c/dictionaries/+/140263
Tested-by: Aron Budea 
Reviewed-by: Aron Budea 

diff --git a/Dictionary_id.mk b/Dictionary_id.mk
index c52c639..7f46144 100644
--- a/Dictionary_id.mk
+++ b/Dictionary_id.mk
@@ -14,7 +14,7 @@ $(eval $(call gb_Dictionary_add_root_files,dict-id,\
dictionaries/id/LICENSE-thes\
dictionaries/id/id_ID.aff \
dictionaries/id/id_ID.dic \
-   dictionaries/id/README-dict.md \
+   dictionaries/id/README-dict.adoc \
dictionaries/id/README-thes \
 ))
 
diff --git a/id/README-dict.adoc b/id/README-dict.adoc
new file mode 100644
index 000..e619633
--- /dev/null
+++ b/id/README-dict.adoc
@@ -0,0 +1,137 @@
+= hunspell-id
+:toc:
+:sectanchors:
+:sectlinks:
+
+Proyek ini adalah kelanjutan dari ekstensi Kamus Indonesia pada
+https://extensions.libreoffice.org/extension-center/indonesian-dictionary-kamus-indonesia-by-benitius/releases/2.0[LibreOffice^].
+
+== Unduh
+
+Unduh arsip zip yang terbaru lewat tautan berikut
+https://github.com/shuLhan/hunspell-id/archive/master.zip[master.zip^],
+atau salin dengan `git`
+
+
+$ git clone g...@github.com:shuLhan/hunspell-id.git
+
+
+Jika mengunduh arsip zip, ekstrak berkas zip tersebut.
+
+
+== Pasang
+
+=== Sistem Operasi GNU/Linux atau BSD
+
+Langkah pemasangan secara manual,
+
+   $ sudo make install
+
+Perintah tersebut juga mengikutkan pemasangan berkas eja untuk program myspell
+dan vim.
+
+Untuk menghapus kembali pemasangan, lakukan
+
+   $ sudo make uninstall
+
+Paket untuk GNU/Linux tersedia sebagai berikut.
+
+Arch Linux:: Pengguna Arch dapat memasang paket ini lewat
+git submodule dalam direktori AUR atau
+https://aur.archlinux.org/packages/hunspell-id-git/[AUR^].
+
+Debian (dan turunan):: Lihat dalam direktori debian.
+
+Solus:: Paket ini dapat dipasang dengan cara,
++
+--
+
+$ sudo eopkg it hunspell-id
+
+--
+
+=== Ekstensi LibreOffice
+
+Pindah ke direktori sumber repositori,
+
+
+$ cd hunspell-id
+
+
+Eksekusi skrip `build.sh` pada direktori sumber
+
+
+$ ./build.sh
+
+
+Skrip tersebut akan menghasilkan berkas `hunspell-id.oxt`.
+Buka pengatur berkas, dan klik dua kali pada berkas `hunspell-id.oxt`, nanti
+layanan pemasangan ekstensi LibreOffice akan muncul.
+
+=== Vim
+
+Buat direktori `$HOME/.vim/spell`, kemudian salin atau buat _symlink_ dari
+berkas `vim/id.utf-8.spl` ke dalam direktori tersebut.
+
+
+== Sejarah
+
+Versi 1.0, 1.1, dan 1.2 diciptakan tahun 2004 dengan bantuan Kurniadi dan
+Volker Mueller serta Arno Brevoort, yang menyumbangkan daftar kata mereka
+sebagai dasar penyusunan berkas tersebut bagi program MySpell, yang dipakai
+oleh OpenOffice.org.
+Sesudah itu bertahun-tahun lamanya tidak dikerjakan lagi.
+
+Tanggal 05 Mei 2009 Ammar Shadiq menuangkan berkas-berkas lama itu dalam
+bentuk ekstensi bagi OpenOffice.
+Ekstensi yang sama ini diunggah ke LibreOffice pada tanggal 19 Mei 2012
+sebagai Indonesian dictionary - Kamus Indonesia 1.0.
+Viko Adi Rahmawan kemudian menguji ekstensi ini kembali dan pada tanggal 16
+Mei 2014 diterbitkan sebagai Indonesian dictionary - Kamus Indonesia 1.1 bagi
+LibreOffice 4.0.
+
+Versi 2.0 merupakan pengerjaan ulang dari kedua berkas `id_ID.dic` dan
+`id_ID.aff` agar lebih sesuai dengan sifat Bahasa Indonesia.
+Berkas .aff (affiks) diperbaharui sehingga jauh lebih sesuai
+dengan sifat bahasa Indonesia dengan awalan, akhiran dan imbuhan.
+Berkas .dic (daftar kata) diperiksa dengan semua lemma dari Kamus Besar Bahasa
+Indonesia, edisi 3.
+Berkas hyphenator tidak mengalami perubahan.
+
+== Lisensi
+
+
+Copyright (C) 2004-2022 hunspell-id Authors
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version, with the additional exemption that
+compiling, linking, and/or using OpenSSL is allowed.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the impli

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 2 commits - include/svx oox/inc oox/source sd/source svx/source sw/source

2023-01-11 Thread Tomaž Vajngerl (via logerrit)
 include/svx/ColorSets.hxx|   48 ++-
 oox/inc/drawingml/textfont.hxx   |   10 +++---
 oox/source/drawingml/textfont.cxx|   20 
 sd/source/filter/eppt/pptx-epptooxml.cxx |3 +
 sd/source/ui/func/fuconstr.cxx   |2 -
 svx/source/styles/ColorSets.cxx  |   32 +---
 sw/source/uibase/sidebar/ThemePanel.cxx  |7 ++--
 7 files changed, 70 insertions(+), 52 deletions(-)

New commits:
commit 901dae3958f23006cf77b106c76f3b93e5b7460e
Author: Tomaž Vajngerl 
AuthorDate: Mon Dec 12 20:59:59 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jan 12 06:12:19 2023 +

svx: rename mnPitch to mnPitchFamily, add resolvePitchFamily

Rename mnPitch to mnPitchFamily as it contains both. Extract the
code to resolve what is pitch and what is family into its own
(static) function.

Change-Id: I0c17351ea690a85decefb8d73dd07644ce5c78d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143991
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 4ee7e71d850315f5ae4c3b763b0e80e8d83a6454)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145370
Tested-by: Jenkins CollaboraOffice 

diff --git a/oox/inc/drawingml/textfont.hxx b/oox/inc/drawingml/textfont.hxx
index 6bdf13ab890a..231b18cffecb 100644
--- a/oox/inc/drawingml/textfont.hxx
+++ b/oox/inc/drawingml/textfont.hxx
@@ -51,6 +51,8 @@ public:
 sal_Int16& rnFontFamily,
 const ::oox::core::XmlFilterBase& rFilter ) const;
 
+static void resolvePitch(sal_Int32 nOoxPitch, sal_Int16& rnFontPitch, 
sal_Int16& rnFontFamily);
+
 private:
 boolimplGetFontData(
 OUString& rFontName,
@@ -58,10 +60,10 @@ private:
 sal_Int16& rnFontFamily ) const;
 
 private:
-OUString maTypeface;
-OUString maPanose;
-sal_Int32   mnPitch;
-sal_Int32   mnCharset;
+OUString maTypeface;
+OUString maPanose;
+sal_Int32 mnPitchFamily;
+sal_Int32 mnCharset;
 };
 
 
diff --git a/oox/source/drawingml/textfont.cxx 
b/oox/source/drawingml/textfont.cxx
index 41dd0716a69a..ab50e821e5ec 100644
--- a/oox/source/drawingml/textfont.cxx
+++ b/oox/source/drawingml/textfont.cxx
@@ -48,7 +48,7 @@ sal_Int16 lclGetFontFamily( sal_Int32 nOoxValue )
 } // namespace
 
 TextFont::TextFont() :
-mnPitch( 0 ),
+mnPitchFamily(0),
 mnCharset( WINDOWS_CHARSET_ANSI )
 {
 }
@@ -56,16 +56,16 @@ TextFont::TextFont() :
 void TextFont::setAttributes( const AttributeList& rAttribs )
 {
 maTypeface = rAttribs.getString( XML_typeface, OUString() );
-maPanose   = rAttribs.getString( XML_panose, OUString() );
-mnPitch= rAttribs.getInteger( XML_pitchFamily, 0 );
-mnCharset  = rAttribs.getInteger( XML_charset, WINDOWS_CHARSET_DEFAULT );
+maPanose = rAttribs.getString( XML_panose, OUString() );
+mnPitchFamily = rAttribs.getInteger( XML_pitchFamily, 0 );
+mnCharset = rAttribs.getInteger( XML_charset, WINDOWS_CHARSET_DEFAULT );
 }
 
 void TextFont::setAttributes( const OUString& sFontName )
 {
 maTypeface = sFontName;
 maPanose.clear();
-mnPitch = 0;
+mnPitchFamily = 0;
 mnCharset = WINDOWS_CHARSET_DEFAULT;
 }
 
@@ -86,11 +86,17 @@ bool TextFont::getFontData( OUString& rFontName, sal_Int16& 
rnFontPitch, sal_Int
 bool TextFont::implGetFontData( OUString& rFontName, sal_Int16& rnFontPitch, 
sal_Int16& rnFontFamily ) const
 {
 rFontName = maTypeface;
-rnFontPitch = lclGetFontPitch( extractValue< sal_Int16 >( mnPitch, 0, 4 ) 
);
-rnFontFamily = lclGetFontFamily( extractValue< sal_Int16 >( mnPitch, 4, 4 
) );
+resolvePitch(mnPitchFamily, rnFontPitch, rnFontFamily);
 return !rFontName.isEmpty();
 }
 
+void TextFont::resolvePitch(sal_Int32 nOoxPitchFamily, sal_Int16& rnFontPitch, 
sal_Int16& rnFontFamily)
+{
+rnFontPitch = lclGetFontPitch(extractValue(nOoxPitchFamily, 0, 
4));
+rnFontFamily = lclGetFontFamily(extractValue(nOoxPitchFamily, 
4, 4));
+}
+
+
 } // namespace oox::drawingml
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit a047aabb2756d143c8e01c1625ef435188af3085
Author: Tomaž Vajngerl 
AuthorDate: Mon Dec 12 20:17:09 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jan 12 06:12:10 2023 +

svx: rename ThemeColorType enum values, use enum instead of index

Change-Id: I81c1553205365c4076562474078b3b0aa834b249
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143990
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 1386e26b2d7fc5173266ffbfb94bc82b1d3f7bb9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145369
Tested-by: Jenkins CollaboraOffice 

diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx
index 6ad59a50c064..d76bf754acc1 100644
--- a/include/svx/ColorSets.hxx
+++ b/in

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - include/oox include/svx oox/source

2023-01-11 Thread Tomaž Vajngerl (via logerrit)
 include/oox/drawingml/clrscheme.hxx |3 +++
 include/svx/ColorSets.hxx   |2 +-
 oox/source/drawingml/clrscheme.cxx  |   27 +++
 oox/source/drawingml/theme.cxx  |   30 --
 4 files changed, 51 insertions(+), 11 deletions(-)

New commits:
commit a55c32f955dae641a7167d8fda52ed9d25a22c2d
Author: Tomaž Vajngerl 
AuthorDate: Mon Dec 12 21:13:07 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jan 12 06:12:28 2023 +

oox: set svx::Theme directly to a SdrPage when importing

Bypass the need to set the theme data (svx::Theme) throught UNO
as multiple nested properties. Much more properties will be added
to the svx::Theme and this will simplify handling a lot.

Change-Id: I0b54628ff22c7c823a999de257fd5bb45e736bdb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143992
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit a6253e13e0f3f866ab47e4271db9a80d8cbce708)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145371
Tested-by: Jenkins CollaboraOffice 

diff --git a/include/oox/drawingml/clrscheme.hxx 
b/include/oox/drawingml/clrscheme.hxx
index a4f0b653441a..fd7662511a88 100644
--- a/include/oox/drawingml/clrscheme.hxx
+++ b/include/oox/drawingml/clrscheme.hxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace oox::drawingml {
 
@@ -94,6 +95,8 @@ public:
 const OUString& GetName() const { return maName; }
 
 void ToAny(css::uno::Any& rVal) const;
+void fill(svx::ColorSet& rColorSet) const;
+
 };
 
 }
diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx
index d76bf754acc1..b9c79eb23bf6 100644
--- a/include/svx/ColorSets.hxx
+++ b/include/svx/ColorSets.hxx
@@ -50,7 +50,7 @@ constexpr ThemeColorType convertToThemeColorType(sal_Int32 
nIndex)
 return static_cast(nIndex);
 }
 
-class ColorSet
+class SVXCORE_DLLPUBLIC ColorSet
 {
 OUString maColorSetName;
 std::vector maColors;
diff --git a/oox/source/drawingml/clrscheme.cxx 
b/oox/source/drawingml/clrscheme.cxx
index 19c0afd44900..225faf81eecf 100644
--- a/oox/source/drawingml/clrscheme.cxx
+++ b/oox/source/drawingml/clrscheme.cxx
@@ -120,6 +120,33 @@ void ClrScheme::ToAny(css::uno::Any& rVal) const
 rVal <<= comphelper::containerToSequence(aRet);
 }
 
+void ClrScheme::fill(svx::ColorSet& rColorSet) const
+{
+for (const auto& [nToken, rColor] : maClrScheme)
+{
+switch (nToken)
+{
+case XML_tx1:
+case XML_dk1: rColorSet.add(0, rColor); break;
+case XML_bg1:
+case XML_lt1: rColorSet.add(1, rColor); break;
+case XML_tx2:
+case XML_dk2: rColorSet.add(2, rColor); break;
+case XML_bg2:
+case XML_lt2: rColorSet.add(3, rColor); break;
+case XML_accent1: rColorSet.add(4, rColor); break;
+case XML_accent2: rColorSet.add(5, rColor); break;
+case XML_accent3: rColorSet.add(6, rColor); break;
+case XML_accent4: rColorSet.add(7, rColor); break;
+case XML_accent5: rColorSet.add(8, rColor); break;
+case XML_accent6: rColorSet.add(9, rColor); break;
+case XML_hlink: rColorSet.add(10, rColor); break;
+case XML_folHlink: rColorSet.add(11, rColor); break;
+default: break;
+}
+}
+}
+
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/theme.cxx b/oox/source/drawingml/theme.cxx
index 56df9941169c..18f80e56ee97 100644
--- a/oox/source/drawingml/theme.cxx
+++ b/oox/source/drawingml/theme.cxx
@@ -24,6 +24,11 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
 
 using namespace com::sun::star;
 
@@ -105,16 +110,21 @@ const TextFont* Theme::resolveFont( const OUString& rName 
) const
 
 void Theme::addTheme(const css::uno::Reference& 
xDrawPage) const
 {
-beans::PropertyValue aColorScheme;
-aColorScheme.Name = "ColorScheme";
-maClrScheme.ToAny(aColorScheme.Value);
-beans::PropertyValues aValues = {
-comphelper::makePropertyValue("Name", maThemeName),
-comphelper::makePropertyValue("ColorSchemeName", 
maClrScheme.GetName()),
-aColorScheme,
-};
-uno::Reference xPropertySet(xDrawPage, 
uno::UNO_QUERY);
-xPropertySet->setPropertyValue("Theme", uno::makeAny(aValues));
+SAL_WARN_IF(!xDrawPage.is(), "oox", "DrawPage is not set");
+
+SdrPage* pPage = GetSdrPageFromXDrawPage(xDrawPage);
+
+SAL_WARN_IF(!pPage, "oox", "Can't get SdrPage from XDrawPage");
+
+if (!pPage)
+return;
+
+auto pTheme = std::make_unique(maThemeName);
+auto pColorSet = std::make_unique(maClrScheme.GetName());
+maClrScheme.fill(*pColorSet);
+pTheme->SetColorSet(std::move(pColorSet));
+
+pPage->getSdrPageProperties().SetTheme(std::move(pTheme));
 }
 
 } // namespace oox::drawingml


[Libreoffice-commits] core.git: 2 commits - avmedia/source cppcanvas/source desktop/qa drawinglayer/source emfio/source filter/source forms/source include/vcl lotuswordpro/source svx/source vcl/headle

2023-01-11 Thread Noel Grandin (via logerrit)
 avmedia/source/gstreamer/gstframegrabber.cxx  |2 
 cppcanvas/source/mtfrenderer/implrenderer.cxx |2 
 desktop/qa/desktop_lib/test_desktop_lib.cxx   |4 
 drawinglayer/source/tools/wmfemfhelper.cxx|2 
 emfio/source/reader/wmfreader.cxx |6 
 filter/source/msfilter/msdffimp.cxx   |2 
 forms/source/component/imgprod.cxx|2 
 include/vcl/BitmapTools.hxx   |2 
 include/vcl/bitmap/BitmapTypes.hxx|4 
 include/vcl/bitmapex.hxx  |4 
 lotuswordpro/source/filter/lwpbackgroundstuff.cxx |2 
 svx/source/gallery2/galobj.cxx|2 
 svx/source/sdr/primitive2d/sdrprimitivetools.cxx  |2 
 vcl/headless/BitmapHelper.cxx |   57 ++-
 vcl/headless/CairoCommon.cxx  |3 
 vcl/headless/svpbmp.cxx   |3 
 vcl/inc/qt5/QtTools.hxx   |2 
 vcl/qa/cppunit/BitmapTest.cxx |   13 -
 vcl/qa/cppunit/BmpFilterTest.cxx  |2 
 vcl/qa/cppunit/XpmFilterTest.cxx  |2 
 vcl/qa/cppunit/canvasbitmaptest.cxx   |6 
 vcl/qa/cppunit/png/PngFilterTest.cxx  |   65 
 vcl/qa/cppunit/svm/svmtest.cxx|   23 +--
 vcl/qt5/QtBitmap.cxx  |2 
 vcl/source/bitmap/BitmapEx.cxx|   27 ---
 vcl/source/bitmap/BitmapMonochromeFilter.cxx  |2 
 vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx |6 
 vcl/source/bitmap/BitmapTools.cxx |  105 ++
 vcl/source/bitmap/bitmap.cxx  |   32 
 vcl/source/bitmap/bitmappaint.cxx |   10 -
 vcl/source/bitmap/dibtools.cxx|   94 +++-
 vcl/source/filter/igif/gifread.cxx|2 
 vcl/source/filter/ixbm/xbmread.cxx|4 
 vcl/source/filter/ixpm/xpmread.cxx|6 
 vcl/source/filter/jpeg/JpegReader.cxx |2 
 vcl/source/gdi/mtfxmldump.cxx |1 
 vcl/source/gdi/pdfwriter_impl.cxx |   34 +---
 vcl/source/gdi/pdfwriter_impl2.cxx|6 
 vcl/source/gdi/print.cxx  |6 
 vcl/source/helper/canvastools.cxx |5 
 vcl/source/rendercontext/drawmode.cxx |3 
 vcl/unx/generic/gdi/salbmp.cxx|3 
 42 files changed, 165 insertions(+), 397 deletions(-)

New commits:
commit c68606ca09d22caea7c37417d97c076524fecb38
Author: Noel Grandin 
AuthorDate: Mon Jan 9 21:59:27 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 12 06:52:55 2023 +

maAlphaMask in BitmapEx should be AlphaMask

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

diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index 7ec4dbf7d3c0..45f54d016a74 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -67,7 +67,7 @@ public:
 const Bitmap&   GetBitmap() const;
 
 boolIsAlpha() const;
-AlphaMask   GetAlphaMask() const;
+const AlphaMask &   GetAlphaMask() const { return maAlphaMask; }
 
 const Size& GetSizePixel() const { return maBitmapSize; }
 voidSetSizePixel(const Size& rNewSize);
@@ -462,7 +462,7 @@ private:
 void  loadFromIconTheme( const OUString& rIconName );
 
 Bitmap  maBitmap;
-Bitmap  maAlphaMask;
+AlphaMask   maAlphaMask;
 SizemaBitmapSize;
 };
 
diff --git a/vcl/qa/cppunit/canvasbitmaptest.cxx 
b/vcl/qa/cppunit/canvasbitmaptest.cxx
index 32481620d2dc..d45cd20dff04 100644
--- a/vcl/qa/cppunit/canvasbitmaptest.cxx
+++ b/vcl/qa/cppunit/canvasbitmaptest.cxx
@@ -758,7 +758,8 @@ void CanvasBitmapTest::runTest()
 {
 Bitmap aBitmap = aBmp.GetBitmap();
 BitmapReadAccess* pBmpAcc   = aBitmap.AcquireReadAccess();
-BitmapReadAccess* pAlphaAcc = aBmp.GetAlphaMask().AcquireReadAccess();
+AlphaMask aBitmapAlpha = aBmp.GetAlphaMask();
+BitmapReadAccess* pAlphaAcc = aBitmapAlpha.AcquireReadAccess();
 
 CPPUNIT_ASSERT_MESSAGE( "Bitmap has invalid BitmapReadAccess",
 pBmpAcc);
@@ -778,7 +779,7 @@ void CanvasBitmapTest::runTest()
 CPPUNIT_ASSERT_EQUAL_MESSAGE("(9,2) correct alpha content",
Bit

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

2023-01-11 Thread Noel Grandin (via logerrit)
 animations/source/animcore/animcore.cxx  |   23 
 sd/source/ui/framework/tools/FrameworkHelper.cxx |   33 ++-
 sd/source/ui/inc/framework/FrameworkHelper.hxx   |1 
 3 files changed, 23 insertions(+), 34 deletions(-)

New commits:
commit a54172be5a8ec756586fbb5c463364e084aac079
Author: Noel Grandin 
AuthorDate: Wed Jan 11 15:04:08 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 12 06:53:18 2023 +

tsan:lock-order-inversion in FrameworkHelper

simplify initialisation using a regular mutex, which avoids the global
mutex and thus a potential lock ordering issue

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

diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx 
b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index d712445c25b3..2a10ead3f674 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -39,8 +39,6 @@
 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -282,32 +280,21 @@ public:
 FrameworkHelper::ViewURLMap FrameworkHelper::maViewURLMap;
 
 FrameworkHelper::InstanceMap FrameworkHelper::maInstanceMap;
+osl::Mutex FrameworkHelper::maInstanceMapMutex;
 
 ::std::shared_ptr FrameworkHelper::Instance (ViewShellBase& 
rBase)
 {
-
-::std::shared_ptr pHelper;
+::osl::MutexGuard aGuard(maInstanceMapMutex);
 
 InstanceMap::const_iterator iHelper (maInstanceMap.find(&rBase));
-if (iHelper == maInstanceMap.end())
-{
-::osl::GetGlobalMutex aMutexFunctor;
-::osl::MutexGuard aGuard (aMutexFunctor());
-if (iHelper == maInstanceMap.end())
-{
-pHelper = ::std::shared_ptr(
-new FrameworkHelper(rBase),
-FrameworkHelper::Deleter());
-pHelper->Initialize();
-OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
-maInstanceMap[&rBase] = pHelper;
-}
-}
-else
-{
-OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
-pHelper = iHelper->second;
-}
+if (iHelper != maInstanceMap.end())
+return iHelper->second;
+
+::std::shared_ptr pHelper(
+new FrameworkHelper(rBase),
+FrameworkHelper::Deleter());
+pHelper->Initialize();
+maInstanceMap[&rBase] = pHelper;
 
 return pHelper;
 }
diff --git a/sd/source/ui/inc/framework/FrameworkHelper.hxx 
b/sd/source/ui/inc/framework/FrameworkHelper.hxx
index c9bf981bb2a6..4d8278d90ed0 100644
--- a/sd/source/ui/inc/framework/FrameworkHelper.hxx
+++ b/sd/source/ui/inc/framework/FrameworkHelper.hxx
@@ -293,6 +293,7 @@ private:
 static InstanceMap maInstanceMap;
 class ViewURLMap;
 static ViewURLMap maViewURLMap;
+static osl::Mutex maInstanceMapMutex;
 
 ViewShellBase& mrBase;
 css::uno::Reference
commit 91c954f53f223bcdcfb33fc3625082f05234e16d
Author: Noel Grandin 
AuthorDate: Wed Jan 11 13:20:58 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 12 06:53:05 2023 +

tsan:lock-order-inversion in AnimationNode

make -j 24 -rs -f /home/noel/libo-tsan/Makefile.gbuild
CppunitTest_filter_svg
[build CUT] filter_svg
==
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
(pid=1138169)
Cycle in lock order graph: M0 (0x7b0c0043c8c0) => M1 (0x7b0c00459090)
=> M0

  Mutex M1 acquired here while holding mutex M0 in main thread:

/home/noel/llvm-project/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_common_interceptors.inc:4481
(cppunittester+0x9b4c2)
#1 osl_acquireMutex ??:? (libuno_sal.so.3+0x783ca)

namespace)::AnimationNode::setParent(com::sun::star::uno::Reference
const&) animcore.cxx:? (libanimcorelo.so+0x1d34f)
M1 try to lock

namespace)::AnimationNode::setParent(com::sun::star::uno::Reference
const&) animcore.cxx:? (libanimcorelo.so+0x33bf2)

namespace)::AnimationNode::appendChild(com::sun::star::uno::Reference
const&) animcore.cxx:? (libanimcorelo.so+0x27312)
M0 locked

namespace)::AnimationNode::appendChild(com::sun::star::uno::Reference
const&) animcore.cxx:? (libanimcorelo.so+0x34d29)

xmloff::AnimationNodeContext::AnimationNodeContext(com::sun::star::uno::Reference
const&, SvXMLImport&, int,
com::sun::star::uno::Reference
const&, std::shared_ptr const&)
animationimport.cxx:? (libxolo.so+0x338060)
com::sun::star::uno::Reference
const&) animationimport.cxx:? (libxolo.so+0x33e010)
com::sun::star::uno::Reference
const&) ??:? (libxolo.so+0x2ca188)
com::sun::star::uno::Reference
const&) ??:? (libxolo.so+0x2cb106)
namespace)::Event const*) fastparser.cxx:? (libexpwraplo.so+0x4731a)

sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax

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

2023-01-11 Thread Noel Grandin (via logerrit)
 sd/source/ui/sidebar/MasterPageObserver.cxx |   34 +---
 1 file changed, 7 insertions(+), 27 deletions(-)

New commits:
commit 244803ee2bcdfd4c4244f0c8a0654dab25fbc34d
Author: Noel Grandin 
AuthorDate: Wed Jan 11 15:02:59 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 12 06:53:29 2023 +

tsan:lock-order-inversion in MasterPageObserver

simply the initialisation using a function local static

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

diff --git a/sd/source/ui/sidebar/MasterPageObserver.cxx 
b/sd/source/ui/sidebar/MasterPageObserver.cxx
index 017a0bcdf991..724b7b5e8f86 100644
--- a/sd/source/ui/sidebar/MasterPageObserver.cxx
+++ b/sd/source/ui/sidebar/MasterPageObserver.cxx
@@ -38,11 +38,6 @@ class MasterPageObserver::Implementation
 : public SfxListener
 {
 public:
-/** The single instance of this class.  It is created on demand when
-Instance() is called for the first time.
-*/
-static MasterPageObserver* mpInstance;
-
 /** The master page observer will listen to events of this document and
 detect changes of the use of master pages.
 */
@@ -91,33 +86,18 @@ private:
 void SendEvent (MasterPageObserverEvent& rEvent);
 };
 
-MasterPageObserver* MasterPageObserver::Implementation::mpInstance = nullptr;
-
 //= MasterPageObserver 
 
 MasterPageObserver&  MasterPageObserver::Instance()
 {
-if (Implementation::mpInstance == nullptr)
+static MasterPageObserver* gInstance = []()
 {
-::osl::GetGlobalMutex aMutexFunctor;
-::osl::MutexGuard aGuard (aMutexFunctor());
-if (Implementation::mpInstance == nullptr)
-{
-MasterPageObserver* pInstance = new MasterPageObserver ();
-SdGlobalResourceContainer::Instance().AddResource (
-::std::unique_ptr(pInstance));
-OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
-Implementation::mpInstance = pInstance;
-}
-}
-else
-{
-OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
-}
-
-DBG_ASSERT(Implementation::mpInstance!=nullptr,
-"MasterPageObserver::Instance(): instance is NULL");
-return *Implementation::mpInstance;
+MasterPageObserver* pInstance = new MasterPageObserver ();
+SdGlobalResourceContainer::Instance().AddResource (
+::std::unique_ptr(pInstance));
+return pInstance;
+}();
+return *gInstance;
 }
 
 void MasterPageObserver::RegisterDocument (SdDrawDocument& rDocument)


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

2023-01-11 Thread Miklos Vajna (via logerrit)
 include/vcl/bitmapex.hxx |2 ++
 vcl/qa/cppunit/png/PngFilterTest.cxx |   16 
 vcl/source/bitmap/BitmapEx.cxx   |   12 
 3 files changed, 30 insertions(+)

New commits:
commit 53603317af854a352e75fd2c5f0f0eeaacc5293c
Author: Miklos Vajna 
AuthorDate: Wed Jan 11 20:17:58 2023 +0100
Commit: Noel Grandin 
CommitDate: Thu Jan 12 06:54:30 2023 +

vcl: introduce a BitmapEx::DumpAsPng()

This is mostly useful for ad-hoc debugging, so you don't need to
manually create an SvFileStream, a vcl::PngImageWriter & connect them,
but you can step through code in the debugger and call DumpAsPng() at
random code locations.

The filename type is intentionally a 'const char*', so you can call
DumpAsPng(0) from gdb; that would not be possible for a 'const
OUString&' parameter type.

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

diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index 45f54d016a74..5838ef8d6e40 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -449,6 +449,8 @@ public:
 
 SAL_DLLPRIVATE std::shared_ptr const & ImplGetBitmapSalBitmap() 
const { return maBitmap.ImplGetSalBitmap(); }
 
+/// Dumps the pixels as PNG in bitmap.png.
+void DumpAsPng(const char* pFileName = nullptr) const;
 
 private:
 friend class ImpGraphic;
diff --git a/vcl/qa/cppunit/png/PngFilterTest.cxx 
b/vcl/qa/cppunit/png/PngFilterTest.cxx
index fd5747d8e9c8..dae007eb7898 100644
--- a/vcl/qa/cppunit/png/PngFilterTest.cxx
+++ b/vcl/qa/cppunit/png/PngFilterTest.cxx
@@ -176,6 +176,7 @@ public:
 void testPngRoundtrip24_8();
 void testPngRoundtrip32();
 void testPngWrite8BitRGBPalette();
+void testDump();
 
 CPPUNIT_TEST_SUITE(PngFilterTest);
 CPPUNIT_TEST(testPng);
@@ -186,6 +187,7 @@ public:
 CPPUNIT_TEST(testPngRoundtrip24_8);
 CPPUNIT_TEST(testPngRoundtrip32);
 CPPUNIT_TEST(testPngWrite8BitRGBPalette);
+CPPUNIT_TEST(testDump);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -1956,6 +1958,20 @@ void PngFilterTest::testPngWrite8BitRGBPalette()
 }
 }
 
+void PngFilterTest::testDump()
+{
+utl::TempFileNamed aTempFile;
+Bitmap aBitmap(Size(1, 1), vcl::PixelFormat::N24_BPP);
+{
+BitmapScopedWriteAccess pWriteAccessBitmap(aBitmap);
+pWriteAccessBitmap->SetPixel(0, 0, BitmapColor());
+}
+BitmapEx aBitmapEx(aBitmap);
+aBitmapEx.DumpAsPng(aTempFile.GetURL().toUtf8().getStr());
+SvStream* pStream = aTempFile.GetStream(StreamMode::READ);
+CPPUNIT_ASSERT_GREATER(static_cast(0), 
pStream->remainingSize());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(PngFilterTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx
index b8f96acbcfbd..cc3988abf333 100644
--- a/vcl/source/bitmap/BitmapEx.cxx
+++ b/vcl/source/bitmap/BitmapEx.cxx
@@ -41,6 +41,8 @@
 #include 
 
 #include 
+#include 
+#include 
 
 #include 
 
@@ -1482,4 +1484,14 @@ void  BitmapEx::GetColorModel(css::uno::Sequence< 
sal_Int32 >& rRGBPalette,
 rnBitCount = pReadAccess->GetBitCount();
 }
 
+void BitmapEx::DumpAsPng(const char* pFileName) const
+{
+SvFileStream aStream(pFileName ? OUString::fromUtf8(pFileName)
+   : OUString("file:///tmp/bitmap.png"),
+ StreamMode::STD_READWRITE | StreamMode::TRUNC);
+assert(aStream.good());
+vcl::PngImageWriter aWriter(aStream);
+aWriter.write(*this);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-01-11 Thread Xisco Fauli (via logerrit)
 sc/qa/uitest/calc_tests8/tdf152717.py |   30 ++
 1 file changed, 30 insertions(+)

New commits:
commit f65d7fb18c5b850a381727a67c97fc94128082d2
Author: Xisco Fauli 
AuthorDate: Wed Jan 11 20:32:08 2023 +0100
Commit: Xisco Fauli 
CommitDate: Thu Jan 12 06:59:14 2023 +

tdf#152717: sc: Add UItest

I tried to implement this as a CppUnittest but =DDE formula
returns nothing

Change-Id: I4649a7842de516fc1867ddd214b323ff77f66317
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145362
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/uitest/calc_tests8/tdf152717.py 
b/sc/qa/uitest/calc_tests8/tdf152717.py
new file mode 100644
index ..7083c651ae79
--- /dev/null
+++ b/sc/qa/uitest/calc_tests8/tdf152717.py
@@ -0,0 +1,30 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_url_for_data_file
+from uitest.uihelper.calc import enter_text_to_cell
+from libreoffice.calc.document import get_cell_by_position
+
+class tdf152717(UITestCase):
+
+def test_tdf152717(self):
+
+with self.ui_test.create_doc_in_start_center("calc") as calc_document:
+calcDoc = self.xUITest.getTopFocusWindow()
+
+xGridWindow = calcDoc.getChild("grid_window")
+
+# Use an existing document
+enter_text_to_cell(xGridWindow, "A1", "=DDE(\"soffice\";\"" + 
get_url_for_data_file("tdf119954.ods") + "\";\"Sheet1.A1\")")
+
+# Without the fix in place, this test would have failed with
+# AssertionError: 1.0 != 0.0
+self.assertEqual(1.0, get_cell_by_position(calc_document, 0, 0, 
0).getValue())
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:


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

2023-01-11 Thread Miklos Vajna (via logerrit)
 sw/sdi/_textsh.sdi |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 200e2a3c28bdeec785ac389473f5fca6576071a0
Author: Miklos Vajna 
AuthorDate: Wed Jan 11 14:24:50 2023 +0100
Commit: Miklos Vajna 
CommitDate: Thu Jan 12 07:19:51 2023 +

sw, UpdateSections: remove not needed StateMethod

SwTextShell::GetState() doesn't handle FN_UPDATE_SECTIONS at the moment,
so this is unused.

Noticed by Justin at

.

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

diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index f08e0b21b675..e1b64a45e5d1 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -160,7 +160,6 @@ interface BaseText
 FN_UPDATE_SECTIONS
 [
 ExecMethod = Execute ;
-StateMethod = GetState ;
 DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
 ]
 FN_SET_REMINDER


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

2023-01-11 Thread Dennis Francis (via logerrit)
 sw/qa/extras/tiledrendering/data/savedauthorfield.odt |binary
 sw/qa/extras/tiledrendering/tiledrendering.cxx|   16 
 sw/source/uibase/uno/unotxdoc.cxx |   16 +++-
 3 files changed, 31 insertions(+), 1 deletion(-)

New commits:
commit c33e60dd5d5aa8dd585afc9498f87d17ab22fb27
Author: Dennis Francis 
AuthorDate: Mon Jan 9 14:14:02 2023 +0530
Commit: Miklos Vajna 
CommitDate: Thu Jan 12 07:22:05 2023 +

sw: lok: use redline author for saved author fields

Without the fix author fields will expand to "Unknown author" when
loading files which have author fields in them. But only update the
fields when the first view joins and not for later view joins.

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

diff --git a/sw/qa/extras/tiledrendering/data/savedauthorfield.odt 
b/sw/qa/extras/tiledrendering/data/savedauthorfield.odt
new file mode 100644
index ..a060c5892f12
Binary files /dev/null and 
b/sw/qa/extras/tiledrendering/data/savedauthorfield.odt differ
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx 
b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 88b4dcc95d7f..3330e419dc8b 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -3791,6 +3791,22 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, 
testAuthorField)
 assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "rText", 
sAuthor);
 }
 
+CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testSavedAuthorField)
+{
+SwXTextDocument* pXTextDocument = createDoc("savedauthorfield.odt");
+const OUString sAuthor("XYZ ABCD");
+uno::Sequence 
aPropertyValues1(comphelper::InitPropertySequence(
+{
+{".uno:Author", uno::makeAny(sAuthor)},
+}));
+pXTextDocument->initializeForTiledRendering(aPropertyValues1);
+
+Scheduler::ProcessEventsToIdle();
+
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/Special[1]", "rText", 
sAuthor);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index f91fe5626f1b..05bddd1f5747 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3570,6 +3570,9 @@ void SwXTextDocument::initializeForTiledRendering(const 
css::uno::SequenceGetRedlineAuthor(SW_MOD()->GetRedlineAuthor());
+OUString sAuthor;
+
 for (const beans::PropertyValue& rValue : rArguments)
 {
 if (rValue.Name == ".uno:HideWhitespace" && rValue.Value.has())
@@ -3578,8 +3581,9 @@ void SwXTextDocument::initializeForTiledRendering(const 
css::uno::Sequence());
 else if (rValue.Name == ".uno:Author" && rValue.Value.has())
 {
+sAuthor = rValue.Value.get();
 // Store the author name in the view.
-pView->SetRedlineAuthor(rValue.Value.get());
+pView->SetRedlineAuthor(sAuthor);
 // Let the actual author name pick up the value from the current
 // view, which would normally happen only during the next view
 // switch.
@@ -3589,6 +3593,16 @@ void SwXTextDocument::initializeForTiledRendering(const 
css::uno::Sequence());
 }
 
+if (!sAuthor.isEmpty() && sAuthor != sOrigAuthor)
+{
+SwView* pFirstView = static_cast(SfxViewShell::GetFirst());
+if (pFirstView && SfxViewShell::GetNext(*pFirstView) == nullptr)
+{
+if (SwViewShell* pShell = &pFirstView->GetWrtShell())
+pShell->UpdateFields(true);
+}
+}
+
 // Set the initial zoom value to 1; usually it is set in setClientZoom and
 // SwViewShell::PaintTile; zoom value is used for chart in place
 // editing, see postMouseEvent and setGraphicSelection methods.