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

2022-09-13 Thread Noel Grandin (via logerrit)
 sfx2/source/control/itemdel.cxx |   47 +++-
 1 file changed, 13 insertions(+), 34 deletions(-)

New commits:
commit 57145acf9ec47c23e307b7a5c0029d21d937cc35
Author: Noel Grandin 
AuthorDate: Tue Sep 13 22:10:15 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 14 08:37:12 2022 +0200

simplify SfxItemDisruptor_Impl, just use Application::PostUserEvent

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

diff --git a/sfx2/source/control/itemdel.cxx b/sfx2/source/control/itemdel.cxx
index 2b8e7db73fc6..8182595acea2 100644
--- a/sfx2/source/control/itemdel.cxx
+++ b/sfx2/source/control/itemdel.cxx
@@ -22,56 +22,35 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
 class SfxItemDisruptor_Impl
 {
-std::unique_ptr pItem;
-Idle m_Idle;
-
-private:
-DECL_LINK(Delete, Timer*, void);
-
 public:
-explicit SfxItemDisruptor_Impl(std::unique_ptr 
pItemToDesrupt);
-void LaunchDeleteOnIdle();
-~SfxItemDisruptor_Impl();
-SfxItemDisruptor_Impl(const SfxItemDisruptor_Impl&) = delete;
-SfxItemDisruptor_Impl& operator=(const SfxItemDisruptor_Impl&) = delete;
+static void DeleteItemOnIdle(std::unique_ptr pItem)
+{
+pItem->SetKind(SfxItemKind::DeleteOnIdle);
+Application::PostUserEvent(LINK(nullptr, SfxItemDisruptor_Impl, 
Delete), pItem.release());
+// coverity[leaked_storage] - pDesruptor takes care of its own 
destruction at idle time
+}
+
+DECL_STATIC_LINK(SfxItemDisruptor_Impl, Delete, void*, void);
 };
 
-SfxItemDisruptor_Impl::SfxItemDisruptor_Impl(std::unique_ptr 
pItemToDisrupt)
-: pItem(std::move(pItemToDisrupt))
-, m_Idle("sfx::SfxItemDisruptor_Impl m_Idle")
-{
-m_Idle.SetInvokeHandler(LINK(this, SfxItemDisruptor_Impl, Delete));
-m_Idle.SetPriority(TaskPriority::DEFAULT_IDLE);
-
-DBG_ASSERT(0 == pItem->GetRefCount(), "disrupting pooled item");
-pItem->SetKind(SfxItemKind::DeleteOnIdle);
-}
-
-void SfxItemDisruptor_Impl::LaunchDeleteOnIdle() { m_Idle.Start(); }
-
-SfxItemDisruptor_Impl::~SfxItemDisruptor_Impl()
+IMPL_STATIC_LINK(SfxItemDisruptor_Impl, Delete, void*, p, void)
 {
-m_Idle.Stop();
-
+SfxPoolItem* pItem = static_cast(p);
 // reset RefCount (was set to SFX_ITEMS_SPECIAL before!)
 pItem->SetRefCount(0);
-
-pItem.reset();
+delete pItem;
 }
 
-IMPL_LINK_NOARG(SfxItemDisruptor_Impl, Delete, Timer*, void) { delete this; }
-
 void DeleteItemOnIdle(std::unique_ptr pItem)
 {
 DBG_ASSERT(0 == pItem->GetRefCount(), "deleting item in use");
-SfxItemDisruptor_Impl* pDesruptor = new 
SfxItemDisruptor_Impl(std::move(pItem));
-pDesruptor->LaunchDeleteOnIdle();
-// coverity[leaked_storage] - pDesruptor takes care of its own destruction 
at idle time
+SfxItemDisruptor_Impl::DeleteItemOnIdle(std::move(pItem));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


[Libreoffice-commits] core.git: accessibility/inc basctl/inc basic/inc basic/source chart2/inc chart2/source comphelper/Library_comphelper.mk comphelper/source connectivity/inc cui/inc desktop/inc des

2022-09-13 Thread Noel Grandin (via logerrit)
 accessibility/inc/pch/precompiled_acc.hxx   |2 
 basctl/inc/pch/precompiled_basctl.hxx   |2 
 basic/inc/basic.hrc |2 
 basic/inc/pch/precompiled_sb.hxx|2 
 basic/inc/sbxbase.hxx   |2 
 basic/source/classes/sbunoobj.cxx   |2 
 basic/source/inc/buffer.hxx |2 
 basic/source/inc/sbintern.hxx   |2 
 basic/source/inc/scanner.hxx|2 
 basic/source/runtime/ddectrl.cxx|2 
 basic/source/runtime/ddectrl.hxx|2 
 basic/source/runtime/dllmgr.hxx |2 
 basic/source/sbx/sbxbool.cxx|2 
 basic/source/sbx/sbxbyte.cxx|2 
 basic/source/sbx/sbxchar.cxx|2 
 basic/source/sbx/sbxdbl.cxx |2 
 basic/source/sbx/sbxint.cxx |2 
 basic/source/sbx/sbxlng.cxx |2 
 basic/source/sbx/sbxscan.cxx|2 
 basic/source/sbx/sbxsng.cxx |2 
 basic/source/sbx/sbxuint.cxx|2 
 basic/source/sbx/sbxulng.cxx|2 
 chart2/inc/pch/precompiled_chartcontroller.hxx  |2 
 chart2/inc/pch/precompiled_chartcore.hxx|2 
 chart2/source/model/inc/XMLFilter.hxx   |2 
 comphelper/Library_comphelper.mk|1 
 comphelper/source/misc/errcode.cxx  |  108 +++-
 connectivity/inc/pch/precompiled_dbase.hxx  |2 
 connectivity/inc/pch/precompiled_file.hxx   |2 
 cui/inc/pch/precompiled_cui.hxx |2 
 desktop/inc/pch/precompiled_sofficeapp.hxx  |2 
 desktop/source/lib/lokinteractionhandler.hxx|2 
 editeng/inc/pch/precompiled_editeng.hxx |2 
 forms/inc/pch/precompiled_frm.hxx   |2 
 framework/source/interaction/quietinteraction.cxx   |2 
 framework/source/loadenv/loadenv.cxx|2 
 framework/source/services/desktop.cxx   |2 
 include/IwyuFilter_include.yaml |2 
 include/basic/basmgr.hxx|2 
 include/basic/sberrors.hxx  |2 
 include/basic/sbmeth.hxx|2 
 include/comphelper/errcode.hxx  |   13 +-
 include/editeng/editeng.hxx |2 
 include/editeng/editerr.hxx |2 
 include/editeng/editview.hxx|2 
 include/editeng/outliner.hxx|2 
 include/filter/msfilter/msdffimp.hxx|2 
 include/filter/msfilter/svxmsbas.hxx|2 
 include/sfx2/app.hxx|2 
 include/sfx2/docinf.hxx |2 
 include/sfx2/docinsert.hxx  |2 
 include/sfx2/filedlghelper.hxx  |2 
 include/sfx2/ipclient.hxx   |2 
 include/sfx2/objsh.hxx  |2 
 include/sfx2/opengrf.hxx|2 
 include/sfx2/viewsh.hxx |2 
 include/sot/storage.hxx |2 
 include/svx/svxerr.hxx  |2 
 include/svx/xoutbmp.hxx |2 
 include/tools/stream.hxx|2 
 include/vbahelper/vbahelper.hxx |2 
 include/vcl/cvtgrf.hxx  |2 
 include/vcl/errinf.hxx  |2 
 include/vcl/graphicfilter.hxx   |2 
 include/vcl/print.hxx   |2 
 include/xmloff/xmlexp.hxx   |2 
 linguistic/source/dicimp.hxx|2 
 reportdesign/inc/pch/precompiled_rpt.hxx|2 
 reportdesign/inc/pch/precompiled_rptui.hxx  |2 
 sc/IwyuFilter_sc.yaml   |2 
 sc/inc/document.hxx |2 
 sc/inc/filter.hxx   |2 
 sc/inc/pch/precompiled_sc.hxx   |2 
 sc/inc/pch/precompiled_scfilt.hxx   |2 
 sc/inc/scerrors.hxx |2 
 sc/inc/xmlwrap.hxx  |2 
 sc/source/filter/inc/eeparser.hxx   |2 
 sc/source/filter/inc/qpro.hxx   |2 
 sd/IwyuFilter_sd.yaml   |2 
 sd/inc/errhdl.hrc   |2 
 sd/inc/pch/precompiled_sd.hxx   |2 
 sd/inc/pch/precompiled_sdui.hxx

[Libreoffice-commits] core.git: filter/Library_icg.mk filter/source include/filter sd/CppunitTest_sd_uimpress.mk sd/Library_sd.mk sd/source

2022-09-13 Thread Noel Grandin (via logerrit)
 filter/Library_icg.mk|4 +++
 filter/source/graphicfilter/icgm/cgm.cxx |4 +--
 include/filter/importcgm.hxx |   22 +
 sd/CppunitTest_sd_uimpress.mk|1 
 sd/Library_sd.mk |1 
 sd/source/filter/cgm/sdcgmfilter.cxx |   38 +++
 sd/source/filter/sdfilter.cxx|1 
 7 files changed, 34 insertions(+), 37 deletions(-)

New commits:
commit 5cc45f148dac2080d5cdc2d69db539d55b1ff816
Author: Noel Grandin 
AuthorDate: Tue Sep 13 14:33:09 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Sep 14 08:33:26 2022 +0200

no need to dynamically ImportCGM symbol

we are preloading this library anyway, so whatever benefit this might
have provided is long gone

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

diff --git a/filter/Library_icg.mk b/filter/Library_icg.mk
index 44cb742a6b98..113faa5a2503 100644
--- a/filter/Library_icg.mk
+++ b/filter/Library_icg.mk
@@ -25,6 +25,10 @@ $(eval $(call gb_Library_use_external,icg,boost_headers))
 
 $(eval $(call gb_Library_use_sdk_api,icg))
 
+$(eval $(call gb_Library_add_defs,icg,\
+   -DFILTER_DLLIMPLEMENTATION \
+))
+
 $(eval $(call gb_Library_use_libraries,icg,\
 comphelper \
 cppuhelper \
diff --git a/filter/source/graphicfilter/icgm/cgm.cxx 
b/filter/source/graphicfilter/icgm/cgm.cxx
index d97c8b6be646..62b3b8d67d00 100644
--- a/filter/source/graphicfilter/icgm/cgm.cxx
+++ b/filter/source/graphicfilter/icgm/cgm.cxx
@@ -17,9 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include 
 #include 
 #include 
+#include 
 #include 
 #include "bitmap.hxx"
 #include "chart.hxx"
@@ -683,7 +683,7 @@ bool CGM::Write( SvStream& rIStm )
 };
 
 // GraphicImport - the exported function
-extern "C" SAL_DLLPUBLIC_EXPORT sal_uInt32
+FILTER_DLLPUBLIC sal_uInt32
 ImportCGM(SvStream& rIn, uno::Reference< frame::XModel > const & rXModel, 
css::uno::Reference const & aXStatInd)
 {
 
diff --git a/include/filter/importcgm.hxx b/include/filter/importcgm.hxx
new file mode 100644
index ..a6782e1305a3
--- /dev/null
+++ b/include/filter/importcgm.hxx
@@ -0,0 +1,22 @@
+
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+#pragma once
+
+#include 
+#include 
+#include 
+
+class SvStream;
+
+FILTER_DLLPUBLIC sal_uInt32
+ImportCGM(SvStream& rIn, css::uno::Reference const& 
rXModel,
+  css::uno::Reference const& aXStatInd);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sd/CppunitTest_sd_uimpress.mk b/sd/CppunitTest_sd_uimpress.mk
index 63f143978231..4575a06107b5 100644
--- a/sd/CppunitTest_sd_uimpress.mk
+++ b/sd/CppunitTest_sd_uimpress.mk
@@ -31,6 +31,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sd_uimpress,\
 editeng \
 i18nlangtag \
 i18nutil \
+icg \
 msfilter \
 oox \
 sal \
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 8b441fe0542a..9d29b4063222 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -79,6 +79,7 @@ $(eval $(call gb_Library_use_libraries,sd,\
editeng \
i18nlangtag \
i18nutil \
+   icg \
msfilter \
oox \
sal \
diff --git a/sd/source/filter/cgm/sdcgmfilter.cxx 
b/sd/source/filter/cgm/sdcgmfilter.cxx
index 80b11519d45a..a605baec8d06 100644
--- a/sd/source/filter/cgm/sdcgmfilter.cxx
+++ b/sd/source/filter/cgm/sdcgmfilter.cxx
@@ -18,6 +18,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -36,14 +37,6 @@ using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::task;
 using namespace ::com::sun::star::frame;
 
-typedef sal_uInt32 ( *ImportCGMPointer )(SvStream&, Reference< XModel > const 
&, Reference< XStatusIndicator > const &);
-
-#ifdef DISABLE_DYNLOADING
-
-extern "C" sal_uInt32 ImportCGM(SvStream&, Reference< XModel > const &, 
Reference< XStatusIndicator > const &);
-
-#endif
-
 SdCGMFilter::SdCGMFilter( SfxMedium& rMedium, ::sd::DrawDocShell& rDocShell ) :
 SdFilter( rMedium, rDocShell )
 {
@@ -53,32 +46,11 @@ SdCGMFilter::~SdCGMFilter()
 {
 }
 
-namespace
-{
-class CGMPointer
-{
-ImportCGMPointer m_pPointer;
-public:
-CGMPointer()
-{
-#ifdef DISABLE_DYNLOADING
-m_pPointer = ImportCGM;
-#else
-m_pPointer = reinterpret_cast(
-SdFilter::GetLibrarySymbol("icg", "ImportCGM"));
-#endif
-}
-ImportCGMPointer get() { return m_pPointer; }
-};
-}
-
 bool

[Libreoffice-commits] core.git: editeng/source include/editeng include/svx include/xmloff offapi/com oox/inc oox/source schema/libreoffice sc/qa sd/qa svx/source sw/qa sw/source writerfilter/source xm

2022-09-13 Thread Regina Henschel (via logerrit)
 editeng/source/items/frmitems.cxx   |9 +
 include/editeng/editrids.hrc|1 
 include/editeng/frmdir.hxx  |5 
 include/editeng/frmdiritem.hxx  |2 
 include/svx/svddef.hxx  |7 
 include/svx/unoshprp.hxx|3 
 include/xmloff/xmltoken.hxx |1 
 offapi/com/sun/star/text/WritingMode2.idl   |   10 +
 oox/inc/drawingml/customshapeproperties.hxx |4 
 oox/inc/drawingml/textbodyproperties.hxx|2 
 oox/source/drawingml/customshapeproperties.cxx  |8 -
 oox/source/drawingml/shape.cxx  |9 -
 oox/source/drawingml/textbodyproperties.cxx |4 
 oox/source/drawingml/textbodypropertiescontext.cxx  |   22 ++
 oox/source/export/drawingml.cxx |   89 
 oox/source/export/vmlexport.cxx |   12 -
 oox/source/shape/WpsContext.cxx |   45 +++---
 sc/qa/unit/subsequent_filters_test2.cxx |   22 +-
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |1 
 sd/qa/unit/data/xml/n902652_0.xml   |4 
 sd/qa/unit/export-tests.cxx |   63 ++--
 sd/qa/unit/import-tests2.cxx|   26 +--
 svx/source/sdr/properties/customshapeproperties.cxx |1 
 svx/source/svdraw/svdattr.cxx   |5 
 svx/source/svdraw/svdoashp.cxx  |   31 +++-
 svx/source/unodraw/unoshape.cxx |   10 +
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx  |   12 -
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx   |4 
 sw/source/core/doc/textboxhelper.cxx|   11 +
 sw/source/core/layout/wsfrm.cxx |6 
 sw/source/filter/ww8/docxattributeoutput.cxx|   12 +
 sw/source/filter/ww8/docxsdrexport.cxx  |5 
 sw/source/filter/xml/xmlexpit.cxx   |   13 +
 sw/source/filter/xml/xmlimpit.cxx   |7 
 writerfilter/source/dmapper/DomainMapper.cxx|   37 +++-
 xmloff/inc/xmlsdtypes.hxx   |2 
 xmloff/source/core/xmltoken.cxx |1 
 xmloff/source/draw/sdpropls.cxx |   37 
 xmloff/source/draw/shapeexport.cxx  |   30 +++-
 xmloff/source/style/prhdlfac.cxx|3 
 xmloff/source/style/xmlexppr.cxx|3 
 xmloff/source/token/tokens.txt  |1 
 42 files changed, 436 insertions(+), 144 deletions(-)

New commits:
commit c70ee4a6b9071468255e5d4fdb893e9c9bdf4fad
Author: Regina Henschel 
AuthorDate: Wed Aug 17 02:31:44 2022 +0200
Commit: Miklos Vajna 
CommitDate: Wed Sep 14 08:32:08 2022 +0200

tdf#149551 use 'WritingMode' instead of TextPreRotateAngle

Commit 7e23cbdbb6ec0247a29ed8a8f744c01e10963ea0 changed the code so,
that TextPreRotateAngle is used to track ooxml vert attribute. This
patch changes it so, that the style attribute WritingMode is used.
Now text direction can be written in 'writing-mode' attribute in the
graphic properties in ODF, same for shapes as for frames.

The needed conversion from WritingMode BT-LR and TB_LR90 to
TextPreRotateAngle for rendering of text in custom shapes is now in
one place in class SdrObjectCustomshape. The shape edit engine
cannot yet render it itself.

Some unit tests are adapted to use WritingMode property instead of
TextPreRotateAngle.

The value text::WritingMode2::TB_RL90 is introduced, corresponding to
vert='vert' and textDirection='tbRl' or ='rl' in OOXML. It is used
for frames too, so that the original text direction is preserved and
vert='eaVert' can be distinguished from vert='vert'.

TextPreRotateAngle is currently still used in SmartArt import for
'upr' and 'grav' and in emulating 'upright' but no longer to
emulate text direction.

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

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 35e1be7b094c..890d74a75510 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3411,7 +3411,8 @@ TranslateId getFrmDirResId(size_t nIndex)
 RID_SVXITEMS_FRMDIR_VERT_TOP_RIGHT,
 RID_SVXITEMS_FRMDIR_VERT_TOP_LEFT,
 RID_SVXITEMS_FRMDIR_ENVIRONM

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

2022-09-13 Thread Miklos Vajna (via logerrit)
 download.lst   |4 +--
 external/pdfium/Library_pdfium.mk  |   11 +---
 external/pdfium/UnpackedTarball_pdfium.mk  |5 +--
 external/pdfium/abseil-trivial.patch   |6 +++-
 external/pdfium/build.patch.1  |   10 +++
 external/pdfium/c++20-comparison.patch |2 -
 external/pdfium/inc/pch/precompiled_pdfium.hxx |   13 ++
 external/pdfium/pdfium_arm64.patch.1   |   32 -
 8 files changed, 30 insertions(+), 53 deletions(-)

New commits:
commit c97c60f70e9e6de594f7e0e0b85f17944c640dcf
Author: Miklos Vajna 
AuthorDate: Tue Sep 13 20:26:53 2022 +0200
Commit: Miklos Vajna 
CommitDate: Wed Sep 14 08:27:59 2022 +0200

external: update pdfium to 5298

pdfium_arm64.patch.1 is now upstreamed as
.

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

diff --git a/download.lst b/download.lst
index aa8550fbd2ff..1bb6fb4b80bd 100644
--- a/download.lst
+++ b/download.lst
@@ -202,8 +202,8 @@ export ORCUS_SHA256SUM := 
2a86c405a5929f749b27637509596421d46805753364ab258b035f
 export ORCUS_TARBALL := liborcus-0.17.2.tar.bz2
 export PAGEMAKER_SHA256SUM := 
66adacd705a7d19895e08eac46d1e851332adf2e736c566bef1164e7a442519d
 export PAGEMAKER_TARBALL := libpagemaker-0.0.4.tar.xz
-export PDFIUM_SHA256SUM := 
04e0e3f90589250c1fa97cec543af6f5e6c8c2daa377d614ec1f04b061b86651
-export PDFIUM_TARBALL := pdfium-5187.tar.bz2
+export PDFIUM_SHA256SUM := 
ecb9c2a0d777196949994946e3f24ed251ae5d3db8a9fa1e2827ef857151db13
+export PDFIUM_TARBALL := pdfium-5298.tar.bz2
 export PIXMAN_SHA256SUM := 
6d200dec3740d9ec4ec8d1180e25779c00bc749f94278c8b9021f5534db223fc
 export PIXMAN_TARBALL := pixman-0.40.0.tar.gz
 export LIBPNG_SHA256SUM := 
505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca
diff --git a/external/pdfium/Library_pdfium.mk 
b/external/pdfium/Library_pdfium.mk
index 9ae166889b2c..c00a5f8f89e3 100644
--- a/external/pdfium/Library_pdfium.mk
+++ b/external/pdfium/Library_pdfium.mk
@@ -244,7 +244,6 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
 UnpackedTarball/pdfium/core/fpdfapi/render/charposlist \
 UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_devicebuffer \
 UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_docrenderdata \
-UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_imagecacheentry \
 UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_imageloader \
 UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_imagerenderer \
 UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_pagerendercache \
@@ -413,10 +412,8 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
 UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssoutputtextbuf \
 UnpackedTarball/pdfium/core/fxcrt/cfx_datetime \
 UnpackedTarball/pdfium/core/fxcrt/bytestring \
-UnpackedTarball/pdfium/core/fxcrt/cfx_binarybuf \
 UnpackedTarball/pdfium/core/fxcrt/cfx_bitstream \
 UnpackedTarball/pdfium/core/fxcrt/cfx_utf8decoder \
-UnpackedTarball/pdfium/core/fxcrt/cfx_widetextbuf \
 UnpackedTarball/pdfium/core/fxcrt/fx_random \
 UnpackedTarball/pdfium/core/fxcrt/fx_string \
 UnpackedTarball/pdfium/core/fxcrt/widestring \
@@ -424,9 +421,14 @@ $(eval $(call 
gb_Library_add_generated_exception_objects,pdfium,\
 UnpackedTarball/pdfium/core/fxcrt/fx_codepage \
 UnpackedTarball/pdfium/core/fxcrt/fx_number \
 UnpackedTarball/pdfium/core/fxcrt/cfx_utf8encoder \
-UnpackedTarball/pdfium/core/fxcrt/cfx_readonlymemorystream \
 UnpackedTarball/pdfium/core/fxcrt/observed_ptr \
 UnpackedTarball/pdfium/core/fxcrt/string_data_template \
+UnpackedTarball/pdfium/core/fxcrt/binary_buffer \
+UnpackedTarball/pdfium/core/fxcrt/cfx_read_only_span_stream \
+UnpackedTarball/pdfium/core/fxcrt/cfx_read_only_string_stream \
+UnpackedTarball/pdfium/core/fxcrt/cfx_read_only_vector_stream \
+UnpackedTarball/pdfium/core/fxcrt/fx_memory_malloc \
+UnpackedTarball/pdfium/core/fxcrt/widetext_buffer \
 ))
 
 # fxge
@@ -527,6 +529,7 @@ ifneq ($(SYSTEM_ABSEIL),TRUE)
 # third_party/abseil-cpp
 $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
 
UnpackedTarball/pdfium/third_party/abseil-cpp/absl/types/bad_optional_access \
+
UnpackedTarball/pdfium/third_party/abseil-cpp/absl/types/bad_variant_access \
 ))
 endif
 
diff --git a/external/pdfium/UnpackedTarball_pdfium.mk 
b/external/pdfium/UnpackedTarball_pdfium.mk
index e3b88adb5ab4..c1791ed8e823 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -14,8 +14,6 @@ pdfium_patches += build.patch.1
 # Avoids Windows 8 build dependency.
 pdfium_patches += windows7.patch.1
 pdfium_patches += c++20-comparison.patch
-# __popcnt not 

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

2022-09-13 Thread Szymon Kłos (via logerrit)
 sw/source/uibase/uiview/formatclipboard.cxx |   14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

New commits:
commit 259ed2e3a135a5650fd321f408382d6b1b86bcad
Author: Szymon Kłos 
AuthorDate: Thu Sep 1 16:37:30 2022 +0200
Commit: Szymon Kłos 
CommitDate: Wed Sep 14 08:25:09 2022 +0200

sw: fix format brush to override old format

It should not only add attributes but replace old direct
formatting with new one (character format).

Change-Id: Ieac5c3d8c00b93ee08c74a36ea2ce4938915a2b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139216
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/sw/source/uibase/uiview/formatclipboard.cxx 
b/sw/source/uibase/uiview/formatclipboard.cxx
index bcafb0bd3ce6..74fd772f5cfa 100644
--- a/sw/source/uibase/uiview/formatclipboard.cxx
+++ b/sw/source/uibase/uiview/formatclipboard.cxx
@@ -535,6 +535,12 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, 
SfxStyleSheetBasePool* pPo
 // copy the stored automatic text attributes in a temporary 
SfxItemSet
 pTemplateItemSet->Put( *m_pItemSet_TextAttr );
 
+// reset all direct formatting
+o3tl::sorted_vector aAttrs;
+for( sal_uInt16 nWhich = RES_CHRATR_BEGIN; nWhich < 
RES_CHRATR_END; nWhich++ )
+aAttrs.insert( nWhich );
+rWrtShell.ResetAttr( { aAttrs } );
+
 // only attributes that were not apply by named style 
attributes and automatic
 // paragraph attributes should be applied
 lcl_RemoveEqualItems( *pTemplateItemSet, aItemVector );
@@ -544,14 +550,6 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, 
SfxStyleSheetBasePool* pPo
 rWrtShell.SetFlyFrameAttr(*pTemplateItemSet);
 else if ( !bNoCharacterFormats )
 {
-const SfxPoolItem* pItem;
-SfxItemSetFixed aSet(rWrtShell.GetAttrPool());
-rWrtShell.GetCurAttr(aSet);
-if (!pTemplateItemSet->HasItem(RES_CHRATR_CROSSEDOUT, 
&pItem))
-{
-rWrtShell.ResetAttr({ RES_CHRATR_CROSSEDOUT });
-}
-
 rWrtShell.SetAttrSet(*pTemplateItemSet);
 }
 }


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

2022-09-13 Thread Luboš Luňák (via logerrit)
 vcl/inc/skia/salbmp.hxx |2 +-
 vcl/skia/salbmp.cxx |   30 +++---
 2 files changed, 20 insertions(+), 12 deletions(-)

New commits:
commit 20de4e3ca38e177ea61e818b32d82008758b8caa
Author: Luboš Luňák 
AuthorDate: Tue Sep 13 18:15:17 2022 +0200
Commit: Luboš Luňák 
CommitDate: Wed Sep 14 08:05:18 2022 +0200

do not check and refcount Info access to Skia bitmaps (tdf#150817)

VclCanvasBitmap keeps one around for no good reason, and I don't
feel like digging into it. Since there's no pixel data involved
in that case, let's assume the reader knows that the info about
the bitmap will not change. Making this difference is actually
what I suggested in 0e5b473a63409da2cdae4f4c60a91fcc93755ba5.

Change-Id: I302a9c2c63c8b9474a541a963928933e223f4b45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139873
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/inc/skia/salbmp.hxx b/vcl/inc/skia/salbmp.hxx
index 05e489643f88..e79fb1cc101d 100644
--- a/vcl/inc/skia/salbmp.hxx
+++ b/vcl/inc/skia/salbmp.hxx
@@ -211,7 +211,7 @@ private:
 // Erase() is delayed, just sets these two instead of filling the buffer.
 bool mEraseColorSet = false;
 Color mEraseColor;
-int mAnyAccessCount = 0; // number of any kind of AcquireAccess() that 
have not been released
+int mReadAccessCount = 0; // number of read AcquireAccess() that have not 
been released
 #ifdef DBG_UTIL
 int mWriteAccessCount = 0; // number of write AcquireAccess() that have 
not been released
 #endif
diff --git a/vcl/skia/salbmp.cxx b/vcl/skia/salbmp.cxx
index df3536b4de91..57cea14316c5 100644
--- a/vcl/skia/salbmp.cxx
+++ b/vcl/skia/salbmp.cxx
@@ -68,7 +68,7 @@ SkiaSalBitmap::SkiaSalBitmap(const sk_sp& image)
 #endif
 mSize = mPixelsSize = Size(image->width(), image->height());
 ComputeScanlineSize();
-mAnyAccessCount = 0;
+mReadAccessCount = 0;
 #ifdef DBG_UTIL
 mWriteAccessCount = 0;
 #endif
@@ -78,7 +78,7 @@ SkiaSalBitmap::SkiaSalBitmap(const sk_sp& image)
 bool SkiaSalBitmap::Create(const Size& rSize, vcl::PixelFormat ePixelFormat,
const BitmapPalette& rPal)
 {
-assert(mAnyAccessCount == 0);
+assert(mReadAccessCount == 0);
 ResetAllData();
 if (ePixelFormat == vcl::PixelFormat::INVALID)
 return false;
@@ -157,7 +157,7 @@ bool SkiaSalBitmap::Create(const SalBitmap& rSalBmp, 
SalGraphics* pGraphics)
 
 bool SkiaSalBitmap::Create(const SalBitmap& rSalBmp, vcl::PixelFormat 
eNewPixelFormat)
 {
-assert(mAnyAccessCount == 0);
+assert(mReadAccessCount == 0);
 assert(&rSalBmp != this);
 ResetAllData();
 const SkiaSalBitmap& src = static_cast(rSalBmp);
@@ -195,7 +195,7 @@ void SkiaSalBitmap::Destroy()
 #ifdef DBG_UTIL
 assert(mWriteAccessCount == 0);
 #endif
-assert(mAnyAccessCount == 0);
+assert(mReadAccessCount == 0);
 ResetAllData();
 }
 
@@ -274,7 +274,12 @@ BitmapBuffer* 
SkiaSalBitmap::AcquireBuffer(BitmapAccessMode nMode)
 abort();
 }
 buffer->mnFormat |= ScanlineFormat::TopDown;
-++mAnyAccessCount;
+// Refcount all read/write accesses, to catch problems with existing 
accesses while
+// a bitmap changes, and also to detect when we can free mBuffer if wanted.
+// Write mode implies also reading. It would be probably a good idea to 
count even
+// Info accesses, but VclCanvasBitmap keeps one around pointlessly, 
causing tdf#150817.
+if (nMode == BitmapAccessMode::Read || nMode == BitmapAccessMode::Write)
+++mReadAccessCount;
 #ifdef DBG_UTIL
 if (nMode == BitmapAccessMode::Write)
 ++mWriteAccessCount;
@@ -300,8 +305,11 @@ void SkiaSalBitmap::ReleaseBuffer(BitmapBuffer* pBuffer, 
BitmapAccessMode nMode,
 ResetToBuffer();
 DataChanged();
 }
-assert(mAnyAccessCount > 0);
---mAnyAccessCount;
+if (nMode == BitmapAccessMode::Read || nMode == BitmapAccessMode::Write)
+{
+assert(mReadAccessCount > 0);
+--mReadAccessCount;
+}
 // Are there any more ground movements underneath us ?
 assert(pBuffer->mnWidth == mSize.Width());
 assert(pBuffer->mnHeight == mSize.Height());
@@ -812,7 +820,7 @@ const sk_sp& SkiaSalBitmap::GetSkImage(DirectImage 
direct) const
 thisPtr->mImage = image;
 // The data is now stored both in the SkImage and in our mBuffer, so drop 
the buffer
 // if conserving memory. It'll be converted back by EnsureBitmapData() if 
needed.
-if (ConserveMemory() && mAnyAccessCount == 0)
+if (ConserveMemory() && mReadAccessCount == 0)
 {
 SAL_INFO("vcl.skia.trace", "getskimage(" << this << "): dropping 
buffer");
 thisPtr->ResetToSkImage(mImage);
@@ -968,7 +976,7 @@ const sk_sp& 
SkiaSalBitmap::GetAlphaSkImage(DirectImage direct) const
 // The data is now stored both in the SkImage and in our mBuffer, so drop 
the buffer
 // if conserving memory and the conversion b

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

2022-09-13 Thread Tor Lillqvist (via logerrit)
 external/boost/UnpackedTarball_boost.mk |2 ++
 external/boost/boost-ios.patch.0|   27 +++
 2 files changed, 29 insertions(+)

New commits:
commit 0bd72fe60dea0d14bec4b79fdfbeb8cc7a4004b1
Author: Tor Lillqvist 
AuthorDate: Tue Sep 13 09:36:03 2022 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Sep 14 06:54:55 2022 +0200

Fix build of boost for iOS

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

diff --git a/external/boost/UnpackedTarball_boost.mk 
b/external/boost/UnpackedTarball_boost.mk
index e8048a423268..9e5e277b0a2a 100644
--- a/external/boost/UnpackedTarball_boost.mk
+++ b/external/boost/UnpackedTarball_boost.mk
@@ -33,6 +33,8 @@ boost_patches += msvc2017.patch.0
 
 boost_patches += libc++.patch.0
 
+boost_patches += boost-ios.patch.0
+
 #  "Fix ill-formed 
constant expression
 # errors":
 boost_patches += constexpr.patch.0
diff --git a/external/boost/boost-ios.patch.0 b/external/boost/boost-ios.patch.0
new file mode 100644
index ..9457bf8c71d1
--- /dev/null
+++ b/external/boost/boost-ios.patch.0
@@ -0,0 +1,27 @@
+# -*- Mode: Diff -*-
+--- libs/filesystem/src/operations.cpp
 libs/filesystem/src/operations.cpp
+@@ -492,7 +492,11 @@
+ int err = invoke_statx(basedir_fd, p.c_str(), AT_NO_AUTOMOUNT, STATX_TYPE 
| STATX_MODE, &path_stat);
+ #elif defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
+ struct ::stat path_stat;
++#ifdef AT_NO_AUTOMOUNT
+ int err = ::fstatat(basedir_fd, p.c_str(), &path_stat, AT_NO_AUTOMOUNT);
++#else
++int err = ::fstatat(basedir_fd, p.c_str(), &path_stat, 0);
++#endif
+ #else
+ struct ::stat path_stat;
+ int err = ::stat(p.c_str(), &path_stat);
+@@ -553,7 +553,11 @@
+ int err = invoke_statx(basedir_fd, p.c_str(), AT_SYMLINK_NOFOLLOW | 
AT_NO_AUTOMOUNT, STATX_TYPE | STATX_MODE, &path_stat);
+ #elif defined(BOOST_FILESYSTEM_HAS_POSIX_AT_APIS)
+ struct ::stat path_stat;
++#ifdef AT_NO_AUTOMOUNT
+ int err = ::fstatat(basedir_fd, p.c_str(), &path_stat, 
AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT);
++#else
++int err = ::fstatat(basedir_fd, p.c_str(), &path_stat, 
AT_SYMLINK_NOFOLLOW);
++#endif
+ #else
+ struct ::stat path_stat;
+ int err = ::lstat(p.c_str(), &path_stat);


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

2022-09-13 Thread Andrea Gelmini (via logerrit)
 desktop/source/migration/migration.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0484d071bf9b7cf87521dbd57ad93fbea009ebf2
Author: Andrea Gelmini 
AuthorDate: Tue Sep 13 20:00:01 2022 +0200
Commit: Julien Nabet 
CommitDate: Wed Sep 14 06:46:14 2022 +0200

Fix typo

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

diff --git a/desktop/source/migration/migration.cxx 
b/desktop/source/migration/migration.cxx
index 0f8099278c0c..c8f00d03 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -640,7 +640,7 @@ void MigrationImpl::copyConfig()
 bool bRegistryModificationsXcuExists = false;
 OUString regFilePath = m_aInfo.userdata + 
"/user/registrymodifications.xcu";
 OUString sMigratedProductName = m_aInfo.productname;
-// remove version number from the end of pruduct name if exist
+// remove version number from the end of product name if there’s one
 if (isdigit(sMigratedProductName[sMigratedProductName.getLength() - 1]))
 sMigratedProductName = (sMigratedProductName.copy(0, 
m_aInfo.productname.getLength() - 1)).trim();
 File regFile(regFilePath);


Re: terminate called after throwing an instance of 'com::sun::star::deployment::DeploymentException'

2022-09-13 Thread Kevin Suo
> I find that this may be caused by some bug when handling the user 
profile. When I change the following line in 
/opt/libreofficedev7.3/program/bootstraprc:



Ops... That was a wrong observation bacause I ran a different normal 
installation after I changed the bootstraprc. Please ignore the below 
workaround message. The problem still exists when I change that.




*From: *Kevin Suo [mailto:suokunl...@126.com]
*Sent: *Wednesday, September 14, 2022 10:53 AM +08
*To: *libreoffice@lists.freedesktop.org
*Subject: *terminate called after throwing an instance of 
'com::sun::star::deployment::DeploymentException'


An update on this:


I find that this may be caused by some bug when handling the user 
profile. When I change the following line in 
/opt/libreofficedev7.3/program/bootstraprc:



from:

UserInstallation=$SYSUSERCONFIG/libreoffice/4


to:

UserInstallation=/home/suokunlong/.config/libreoffice/4


or:

UserInstallation=/tmp/libreoffice/4


then the application can run without any problem.


There will be no such error even if I then change it back to 
"UserInstallation=$SYSUSERCONFIG/libreoffice/4" after a successful run. 
The "DeploymentException" only occurs when I first run the rpm/deb 
installation.



Any idea on this?


*From: *Kevin Suo [mailto:suokunl...@126.com]
*Sent: *Monday, September 12, 2022 09:35 PM +08
*To: *libreoffice-dev
*Subject: *terminate called after throwing an instance of 
'com::sun::star::deployment::DeploymentException'


Dear devs:

I have compiled from souce code using the following autogen.input 
parameters:


--without-help
--without-helppack-integration
--with-lang=zh-CN zh-TW

--disable-online-update
--disable-breakpad
--disable-odk
--without-doxygen

--enable-epm
--with-package-format=rpm

--with-external-tar=/mnt/data/suokunlong/lo/external_tarballs
--without-java
--enable-firebird-sdbc
--without-system-firebird
--enable-python=internal

The build succeeded.  I can run the application from within the 
/instdir without any problem:


$ ./instdir/program/soffice

However, if I install the RPMs:

$ sudo dnf install 
./workdir/installation/LibreOfficeDev/rpm/install/LibreOfficeDev_7.3.7.0.0_Linux_x86-64_rpm/RPMS/*.rpm


and then run the installed application, I got the following error:

$ /opt/libreofficedev7.3/program/soffice.bin
terminate called after throwing an instance of 
'com::sun::star::deployment::DeploymentException'

Unspecified Application Error

The same happens on both Ubuntu 22.04 and Fedora 36, also on the 7.4 
branch. I remember I did install the rpms from my own build years ago 
and this issue did not happen. Not sure why it fails now. Am I missing 
something?


Thank you in advance.

Kevin Suo

Re: terminate called after throwing an instance of 'com::sun::star::deployment::DeploymentException'

2022-09-13 Thread Kevin Suo

An update on this:


I find that this may be caused by some bug when handling the user 
profile. When I change the following line in 
/opt/libreofficedev7.3/program/bootstraprc:



from:

UserInstallation=$SYSUSERCONFIG/libreoffice/4


to:

UserInstallation=/home/suokunlong/.config/libreoffice/4


or:

UserInstallation=/tmp/libreoffice/4


then the application can run without any problem.


There will be no such error even if I then change it back to 
"UserInstallation=$SYSUSERCONFIG/libreoffice/4" after a successful run. 
The "DeploymentException" only occurs when I first run the rpm/deb 
installation.



Any idea on this?


*From: *Kevin Suo [mailto:suokunl...@126.com]
*Sent: *Monday, September 12, 2022 09:35 PM +08
*To: *libreoffice-dev
*Subject: *terminate called after throwing an instance of 
'com::sun::star::deployment::DeploymentException'


Dear devs:

I have compiled from souce code using the following autogen.input 
parameters:


--without-help
--without-helppack-integration
--with-lang=zh-CN zh-TW

--disable-online-update
--disable-breakpad
--disable-odk
--without-doxygen

--enable-epm
--with-package-format=rpm

--with-external-tar=/mnt/data/suokunlong/lo/external_tarballs
--without-java
--enable-firebird-sdbc
--without-system-firebird
--enable-python=internal

The build succeeded.  I can run the application from within the 
/instdir without any problem:


$ ./instdir/program/soffice

However, if I install the RPMs:

$ sudo dnf install 
./workdir/installation/LibreOfficeDev/rpm/install/LibreOfficeDev_7.3.7.0.0_Linux_x86-64_rpm/RPMS/*.rpm


and then run the installed application, I got the following error:

$ /opt/libreofficedev7.3/program/soffice.bin
terminate called after throwing an instance of 
'com::sun::star::deployment::DeploymentException'

Unspecified Application Error

The same happens on both Ubuntu 22.04 and Fedora 36, also on the 7.4 
branch. I remember I did install the rpms from my own build years ago 
and this issue did not happen. Not sure why it fails now. Am I missing 
something?


Thank you in advance.

Kevin Suo

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

2022-09-13 Thread Satya (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf147646_mergedCellNumbering.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport18.cxx   |9 
+
 2 files changed, 9 insertions(+)

New commits:
commit 7e8ba44fed9a20b5d226b9d3733b79a35acbbe00
Author: Satya 
AuthorDate: Tue Sep 13 15:12:54 2022 +0530
Commit: Justin Luth 
CommitDate: Wed Sep 14 02:49:20 2022 +0200

tdf#147646 Add unit test

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

diff --git a/sw/qa/extras/ooxmlexport/data/tdf147646_mergedCellNumbering.docx 
b/sw/qa/extras/ooxmlexport/data/tdf147646_mergedCellNumbering.docx
new file mode 100644
index ..680144737685
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf147646_mergedCellNumbering.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
index 1bf487a1f3bc..c3b38758505e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
@@ -70,6 +70,15 @@ CPPUNIT_TEST_FIXTURE(Test, testCellSdtRedline)
 loadAndSave("cell-sdt-redline.docx");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf147646, "tdf147646_mergedCellNumbering.docx")
+{
+parseLayoutDump();
+//Without the fix in place, it would have failed with
+//- Expected: 2.
+//- Actual  : 4.
+
CPPUNIT_ASSERT_EQUAL(OUString("2."),parseDump("/root/page/body/tab/row[4]/cell/txt/Special[@nType='PortionType::Number']","rText"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2022-09-13 Thread Caolán McNamara (via logerrit)
 cui/source/dialogs/SpellDialog.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 61dae407d98d07a67e4eda63415cc8588e13c91d
Author: Caolán McNamara 
AuthorDate: Mon Sep 12 15:26:51 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Sep 14 00:18:10 2022 +0200

tdf#142631 use document background color in the spelling widget

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

diff --git a/cui/source/dialogs/SpellDialog.cxx 
b/cui/source/dialogs/SpellDialog.cxx
index a537e4060c99..5fb079395eb9 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1128,6 +1129,12 @@ void 
SentenceEditWindow_Impl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
 WeldEditView::SetDrawingArea(pDrawingArea);
 // tdf#132288 don't merge equal adjacent attributes
 m_xEditEngine->DisableAttributeExpanding();
+
+// tdf#142631 use document background color in this widget
+Color aBgColor = 
svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
+OutputDevice& rDevice = pDrawingArea->get_ref_device();
+rDevice.SetBackground(aBgColor);
+m_xEditView->SetBackgroundColor(aBgColor);
 }
 
 SentenceEditWindow_Impl::~SentenceEditWindow_Impl()


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

2022-09-13 Thread Caolán McNamara (via logerrit)
 cui/source/dialogs/SpellDialog.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 2ea790200f5d915f88c6f78014d978ce8d91e33f
Author: Caolán McNamara 
AuthorDate: Mon Sep 12 15:26:51 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Sep 14 00:10:10 2022 +0200

tdf#142631 use document background color in the spelling widget

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

diff --git a/cui/source/dialogs/SpellDialog.cxx 
b/cui/source/dialogs/SpellDialog.cxx
index a537e4060c99..5fb079395eb9 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1128,6 +1129,12 @@ void 
SentenceEditWindow_Impl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
 WeldEditView::SetDrawingArea(pDrawingArea);
 // tdf#132288 don't merge equal adjacent attributes
 m_xEditEngine->DisableAttributeExpanding();
+
+// tdf#142631 use document background color in this widget
+Color aBgColor = 
svtools::ColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
+OutputDevice& rDevice = pDrawingArea->get_ref_device();
+rDevice.SetBackground(aBgColor);
+m_xEditView->SetBackgroundColor(aBgColor);
 }
 
 SentenceEditWindow_Impl::~SentenceEditWindow_Impl()


[Libreoffice-commits] core.git: helpcontent2

2022-09-13 Thread Olivier Hallot (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 974c9825d339576c9438e7fc1309a059020ab50f
Author: Olivier Hallot 
AuthorDate: Tue Sep 13 18:32:24 2022 -0300
Commit: Gerrit Code Review 
CommitDate: Tue Sep 13 23:32:24 2022 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to 420d0094490be80dc2cc019bb7bfe2b2b79fe4c1
  - Fix icon size

+ refactor border page

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

diff --git a/helpcontent2 b/helpcontent2
index aefcd8e09453..420d0094490b 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit aefcd8e0945387c36ae5a80b6815763cae2a3022
+Subproject commit 420d0094490be80dc2cc019bb7bfe2b2b79fe4c1


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

2022-09-13 Thread Olivier Hallot (via logerrit)
 source/text/shared/00/0007.xhp |8 +-
 source/text/shared/01/05030500.xhp |   47 +++--
 source/text/shared/02/0313.xhp |8 +++---
 source/text/shared/02/0314.xhp |8 +++---
 4 files changed, 40 insertions(+), 31 deletions(-)

New commits:
commit 420d0094490be80dc2cc019bb7bfe2b2b79fe4c1
Author: Olivier Hallot 
AuthorDate: Tue Sep 13 15:33:00 2022 -0300
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Sep 13 23:32:22 2022 +0200

Fix icon size

+ refactor border page

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

diff --git a/source/text/shared/00/0007.xhp 
b/source/text/shared/00/0007.xhp
index d657f88ab..1b5236c22 100644
--- a/source/text/shared/00/0007.xhp
+++ b/source/text/shared/00/0007.xhp
@@ -1,6 +1,4 @@
 
-
-
 
-
-   
 
 
 
@@ -31,7 +27,7 @@
 
 
 
-Toolbars
+Toolbars
 Icon on the Tools bar: 
 
 Icon on the Formatting Bar: 
@@ -43,7 +39,7 @@
 This overview describes the default toolbar configuration 
for $[officename].
 
 
-Asian 
Language Support
+Asian Language Support
 
 These commands 
can only be accessed after you enable support for Asian languages in 
%PRODUCTNAME - 
PreferencesTools - 
Options - Language Settings - 
Languages.
 
diff --git a/source/text/shared/01/05030500.xhp 
b/source/text/shared/01/05030500.xhp
index 8053f617d..cc696c88c 100644
--- a/source/text/shared/01/05030500.xhp
+++ b/source/text/shared/01/05030500.xhp
@@ -38,7 +38,8 @@
   
 
 
-  To modify the 
border of an entire table, place the cursor in a table cell, right-click, 
choose Table, and then click the Borders tab. To 
modify the border of a table cell, select the cell, right-click, choose 
Table, and then click the Borders tab.
+  
+To modify the border of an entire 
table, place the cursor in a table cell, right-click, choose 
Table, and then click the Borders tab. To modify the 
border of a table cell, select the cell, right-click, choose 
Table, and then click the Borders tab.
   
 
   
@@ -53,44 +54,56 @@
 Read the help page User Defined Borders in Cells to 
learn more on how to define custom line arrangements.
   
 
-Line
+
+Line
 Click the border style that you want to 
apply. The style is applied to the borders selected in the 
preview.
 
 
 Select the line color that you want to use 
for the selected border(s).
 Padding
 Specify the 
amount of space that you want to leave between the border and the contents of 
the selection.
-Left
+
+Left
 Enter the distance that you want to have between 
the left border and the contents of the selection.
-Right
+
+Right
 Enter the distance that you want to have 
between the right border and the contents of the selection.
-Top
+
+Top
 Enter the distance that you want to have between 
the top border and the contents of the selection.
-Bottom
+
+Bottom
 Enter the distance that you want to have 
between the bottom border and the contents of the selection.
-Synchronize
+
+Synchronize
 Applies the same padding setting to 
all four borders when you enter a new distance.
-shadows; borders
+
+shadows; borders
 borders; shadows
 margins; shadows
 
-Shadow 
style
+Shadow style
 You can also 
apply a shadow effect to borders. For the best results, only apply this effect 
when all four borders are visible.
-Graphics or objects 
that are anchored to a frame in the document cannot exceed the size of the 
frame. If you apply a shadow to the borders of an object that fills an entire 
frame, the size of the object is reduced to display the shadows.
-Position
+Graphics or objects that are anchored to a frame in 
the document cannot exceed the size of the frame. If you apply a shadow to the 
borders of an object that fills an entire frame, the size of the object is 
reduced to display the shadows.
+
+Position
 Click a shadow style for the selected 
borders.
-Distance
+
+Distance
 Enter the width of the 
shadow.
-Color
+
+Color
 Select a color for the 
shadow.
 
-Properties
+Properties
 Specifies the 
properties for the current paragraph or the selected paragraphs.
-Merge with next paragraph
+
+Merge with next paragraph
 Merges the border style and the shadow 
style of the current paragraph with the next paragraph. These styles 
are only merged if the indent, border, and shadow styles of the next paragraph 
are the same as the current paragraph. This option is also available for 
Paragraph Styles.UFI: see spec 
"spec-merge-borders-and-shadow"
-Merge adjacent line styles
+
+Merge adjacent line styles
 Merges two different border styles of 
adjacent cells in a Writer table into one border style. This property is valid 
for a whole table in a Writer document.
-The rules can be 
condensed to the statement that the stronger attribute wins. If, for example, 
one cell has a red border of 2 point width, and the adjacent cell has a blue 
border of 3 point widt

[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - basctl/source include/sfx2 sc/source sd/source sfx2/source svx/source sw/inc sw/source

2022-09-13 Thread Noel Grandin (via logerrit)
 basctl/source/basicide/basides2.cxx |2 +-
 basctl/source/inc/basidesh.hxx  |2 +-
 include/sfx2/viewsh.hxx |3 ++-
 sc/source/ui/inc/tabvwsh.hxx|2 +-
 sc/source/ui/view/tabvwshe.cxx  |4 ++--
 sd/source/ui/inc/ViewShellBase.hxx  |2 +-
 sd/source/ui/view/ViewShellBase.cxx |2 +-
 sfx2/source/view/viewsh.cxx |3 ++-
 svx/source/dialog/fntctrl.cxx   |2 +-
 sw/inc/view.hxx |2 +-
 sw/source/uibase/uiview/view.cxx|2 +-
 11 files changed, 14 insertions(+), 12 deletions(-)

New commits:
commit 4cef3204e011b235b807d26ddb3c901690b633ff
Author: Noel Grandin 
AuthorDate: Thu Sep 1 16:29:15 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 13 23:08:19 2022 +0200

tdf#150712 limit the dialog to only a sample of the data

instead of the entire area, which makes the dialog pretty much
instantaneous

Change-Id: Icb08a09733ee872b67d5be00cb083139f05fba7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139214
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit b24eceb5178fda17fcc4b20c5286e8d27c5ae474)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139186

diff --git a/basctl/source/basicide/basides2.cxx 
b/basctl/source/basicide/basides2.cxx
index fedebcb1d98b..ca219f4c9059 100644
--- a/basctl/source/basicide/basides2.cxx
+++ b/basctl/source/basicide/basides2.cxx
@@ -56,7 +56,7 @@ bool Shell::HasSelection( bool /* bText */ ) const
 return false;
 }
 
-OUString Shell::GetSelectionText( bool bWholeWord )
+OUString Shell::GetSelectionText( bool bWholeWord, bool /*bOnlyASample*/ )
 {
 OUString aText;
 if (ModulWindow* pMCurWin = dynamic_cast(pCurWin.get()))
diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx
index 2d494cd8d4ee..5378a5228b26 100644
--- a/basctl/source/inc/basidesh.hxx
+++ b/basctl/source/inc/basidesh.hxx
@@ -169,7 +169,7 @@ public:
 // virtual sal_uInt16   Print( SfxProgress &rProgress, sal_Bool 
bIsAPI, PrintDialog *pPrintDialog = 0 );
 virtual SfxPrinter* GetPrinter( bool bCreate = false ) override;
 virtual sal_uInt16  SetPrinter( SfxPrinter *pNewPrinter, 
SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL ) override;
-virtual OUStringGetSelectionText( bool bCompleteWords = false ) 
override;
+virtual OUStringGetSelectionText( bool bCompleteWords = false, 
bool bOnlyASample = false ) override;
 virtual boolHasSelection( bool bText = true ) const override;
 
 voidGetState( SfxItemSet& );
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index ea7d966c8cc7..31fac39ee25b 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -224,9 +224,10 @@ public:
  * Initialize is called after the frame has been loaded and the controller
  * has been set.  By the time this is called the document has been fully
  * imported.
+ * @param bOnlyASample used by some dialogs to avoid constructing monster 
strings e.g. in calc
  */
 virtual boolPrepareClose( bool bUI = true );
-virtual OUStringGetSelectionText( bool bCompleteWords = false 
);
+virtual OUStringGetSelectionText( bool bCompleteWords = false, 
bool bOnlyASample = false );
 virtual boolHasSelection( bool bText = true ) const;
 virtual SdrView*GetDrawView() const;
 
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 91acb19d39a3..d1a7e5ef89d6 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -201,7 +201,7 @@ protected:
 
 virtual voidQueryObjAreaPixel( tools::Rectangle& rRect ) const 
override;
 
-virtual OUString GetSelectionText( bool bWholeWord = false ) override;
+virtual OUString GetSelectionText( bool bWholeWord = false, bool 
bOnlyASample = false ) override;
 virtual bool HasSelection( bool bText = true ) const override;
 
 virtual voidWriteUserData(OUString &, bool bBrowse = false) override;
diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx
index d32500b74800..7089c17aa7a2 100644
--- a/sc/source/ui/view/tabvwshe.cxx
+++ b/sc/source/ui/view/tabvwshe.cxx
@@ -39,7 +39,7 @@
 #include 
 #include 
 
-OUString ScTabViewShell::GetSelectionText( bool bWholeWord )
+OUString ScTabViewShell::GetSelectionText( bool bWholeWord, bool bOnlyASample )
 {
 OUString aStrSelection;
 
@@ -54,7 +54,7 @@ OUString ScTabViewShell::GetSelectionText( bool bWholeWord )
 if ( GetViewData().GetSimpleArea( aRange ) == SC_MARK_SIMPLE )
 {
 ScDocument& rDoc = GetViewData().GetDocument();
-if ( bInFormatDialog && aRange.aStart.Row() != aRange.aEnd.Row() )
+if ( (bOnlyASample || bInFormatDialog) && aRange.aStart.Row() != 
aRange.aEnd.Row() )
 {
 // limit range 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - configure.ac

2022-09-13 Thread Tor Lillqvist (via logerrit)
 configure.ac |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a47d18cc45904e5df15c1777a51a8427728338bb
Author: Tor Lillqvist 
AuthorDate: Tue Sep 13 09:16:30 2022 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Sep 13 21:50:32 2022 +0200

Bump minimum iOS runtime version to 14.5

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

diff --git a/configure.ac b/configure.ac
index 6303df071dde..121af3c74626 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3595,10 +3595,10 @@ if test $_os = iOS; then
 older_sdk_vers="15.6 15.5 15.4 15.2 15.0"
 if test "$enable_ios_simulator" = "yes"; then
 platform=iPhoneSimulator
-versionmin=-mios-simulator-version-min=13.6
+versionmin=-mios-simulator-version-min=14.5
 else
 platform=iPhoneOS
-versionmin=-miphoneos-version-min=13.6
+versionmin=-miphoneos-version-min=14.5
 fi
 xcode_developer=`xcode-select -print-path`
 


[Libreoffice-commits] core.git: configure.ac

2022-09-13 Thread Tor Lillqvist (via logerrit)
 configure.ac |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7653a5740e862ec51284225b8ec24977ea49b857
Author: Tor Lillqvist 
AuthorDate: Tue Sep 13 09:16:30 2022 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Sep 13 21:44:14 2022 +0200

Bump minimum iOS runtime version to 14.5

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

diff --git a/configure.ac b/configure.ac
index bb20611c862f..12cc87525782 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3660,10 +3660,10 @@ if test $_os = iOS; then
 older_sdk_vers="15.6"
 if test "$enable_ios_simulator" = "yes"; then
 platform=iPhoneSimulator
-versionmin=-mios-simulator-version-min=13.6
+versionmin=-mios-simulator-version-min=14.5
 else
 platform=iPhoneOS
-versionmin=-miphoneos-version-min=13.6
+versionmin=-miphoneos-version-min=14.5
 fi
 xcode_developer=`xcode-select -print-path`
 


[Libreoffice-commits] core.git: configure.ac

2022-09-13 Thread Tor Lillqvist (via logerrit)
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit eb07bbb7acf45f106d4c3b6a34faeb3a10ad0233
Author: Tor Lillqvist 
AuthorDate: Tue Sep 13 09:15:44 2022 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Sep 13 21:43:55 2022 +0200

Don't bother looking for so many old versions of the iOS SDK

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

diff --git a/configure.ac b/configure.ac
index 41d2c30a9816..bb20611c862f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3657,7 +3657,7 @@ dnl 
===
 if test $_os = iOS; then
 AC_MSG_CHECKING([what iOS SDK to use])
 current_sdk_ver=16.0
-older_sdk_vers="15.6 15.5 15.4 15.2 15.0 14.5"
+older_sdk_vers="15.6"
 if test "$enable_ios_simulator" = "yes"; then
 platform=iPhoneSimulator
 versionmin=-mios-simulator-version-min=13.6


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

2022-09-13 Thread Bjoern Michaelsen (via logerrit)
 sw/source/core/unocore/unoportenum.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 51c558930a261a5bd63569965fe360f316b9f3f4
Author: Bjoern Michaelsen 
AuthorDate: Sun Sep 11 17:30:32 2022 +0200
Commit: Caolán McNamara 
CommitDate: Tue Sep 13 20:54:10 2022 +0200

tdf#129163: GC cursor table at the end of the life of an portion enumeration

Change-Id: I864c0ba9ec43a5b164bb9a118911e0507f2a538a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139778
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 2bb92469c9f6074f7d969ebe0323b623631dd3e8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139836
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/core/unocore/unoportenum.cxx 
b/sw/source/core/unocore/unoportenum.cxx
index 30a24721b031..be3ee4491e9e 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -337,7 +337,11 @@ SwXTextPortionEnumeration::SwXTextPortionEnumeration(
 SwXTextPortionEnumeration::~SwXTextPortionEnumeration()
 {
 SolarMutexGuard aGuard;
-m_pUnoCursor.reset(nullptr);
+if( m_pUnoCursor )
+{
+m_pUnoCursor->GetDoc().cleanupUnoCursorTable();
+m_pUnoCursor.reset(nullptr);
+}
 }
 
 sal_Bool SwXTextPortionEnumeration::hasMoreElements()


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

2022-09-13 Thread Caolán McNamara (via logerrit)
 oox/source/export/shapes.cxx|   27 ++-
 oox/source/export/vmlexport.cxx |   15 +--
 2 files changed, 27 insertions(+), 15 deletions(-)

New commits:
commit 8e6df40db6e52b4ea657e5d81a32a7fdb006b00a
Author: Caolán McNamara 
AuthorDate: Tue Sep 13 15:55:34 2022 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 13 20:49:46 2022 +0200

crashtesting: FastSaxSerializer::endDocument assert on export

of ooo26868-1.doc to ooo26868-1.docx

since:

commit 17e27b4a19f22b912460f090b754d11f9a32fb7f
Date:   Tue Sep 6 14:28:22 2022 +0200

tdf#150756 - Assertion when opening report for editing

but that commit looks blameless to me. Avoid the problem by
checking for an empty Any for "TextBox" here as is common
elsewhere

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

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 90e4ad86926f..74dadd5da473 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -2010,21 +2010,30 @@ ShapeExport& ShapeExport::WriteShape( const Reference< 
XShape >& xShape )
 return *this;
 }
 
+static bool lcl_isTextBox(const Reference& xIface)
+{
+uno::Reference xPropertySet(xIface, uno::UNO_QUERY);
+if (!xPropertySet.is())
+return false;
+uno::Reference xPropertySetInfo = 
xPropertySet->getPropertySetInfo();
+if (!xPropertySetInfo->hasPropertyByName("TextBox"))
+   return false;
+css::uno::Any aTextBox(xPropertySet->getPropertyValue("TextBox"));
+if (!aTextBox.hasValue())
+   return false;
+return aTextBox.get();
+}
+
 ShapeExport& ShapeExport::WriteTextBox( const Reference< XInterface >& xIface, 
sal_Int32 nXmlNamespace, bool bWritePropertiesAsLstStyles )
 {
 // In case this shape has an associated textbox, then export that, and 
we're done.
 if (GetDocumentType() == DOCUMENT_DOCX && !mbUserShapes && GetTextExport())
 {
-uno::Reference xPropertySet(xIface, 
uno::UNO_QUERY);
-if (xPropertySet.is())
+if (lcl_isTextBox(xIface))
 {
-uno::Reference xPropertySetInfo = 
xPropertySet->getPropertySetInfo();
-if (xPropertySetInfo->hasPropertyByName("TextBox") && 
xPropertySet->getPropertyValue("TextBox").get())
-{
-
GetTextExport()->WriteTextBox(uno::Reference(xIface, 
uno::UNO_QUERY_THROW));
-WriteText( xIface, /*bBodyPr=*/true, /*bText=*/false, 
/*nXmlNamespace=*/nXmlNamespace );
-return *this;
-}
+
GetTextExport()->WriteTextBox(uno::Reference(xIface, 
uno::UNO_QUERY_THROW));
+WriteText( xIface, /*bBodyPr=*/true, /*bText=*/false, 
/*nXmlNamespace=*/nXmlNamespace );
+return *this;
 }
 }
 
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index fa21068cf4b6..5d6f244bb42f 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -1151,12 +1151,15 @@ static std::vector lcl_getShapeTypes()
 static bool lcl_isTextBox(const SdrObject* pSdrObject)
 {
 uno::Reference 
xPropertySet(const_cast(pSdrObject)->getUnoShape(), uno::UNO_QUERY);
-if (xPropertySet.is())
-{
-uno::Reference xPropertySetInfo = 
xPropertySet->getPropertySetInfo();
-return xPropertySetInfo->hasPropertyByName("TextBox") && 
xPropertySet->getPropertyValue("TextBox").get();
-}
-return false;
+if (!xPropertySet.is())
+return false;
+uno::Reference xPropertySetInfo = 
xPropertySet->getPropertySetInfo();
+if (!xPropertySetInfo->hasPropertyByName("TextBox"))
+   return false;
+css::uno::Any aTextBox(xPropertySet->getPropertyValue("TextBox"));
+if (!aTextBox.hasValue())
+   return false;
+return aTextBox.get();
 }
 
 static OUString lcl_getAnchorIdFromGrabBag(const SdrObject* pSdrObject)


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

2022-09-13 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk4/convert3to4.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 66517fda4c40d0c20b52a3110ee169353ff8c227
Author: Caolán McNamara 
AuthorDate: Tue Sep 13 17:11:23 2022 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 13 20:48:53 2022 +0200

gtk4: move ComboBox "items" to the start to get "active" property working

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

diff --git a/vcl/unx/gtk4/convert3to4.cxx b/vcl/unx/gtk4/convert3to4.cxx
index d7d348029c9d..415bcab3d880 100644
--- a/vcl/unx/gtk4/convert3to4.cxx
+++ b/vcl/unx/gtk4/convert3to4.cxx
@@ -1509,6 +1509,13 @@ ConvertResult Convert3To4(const 
css::uno::Reference& xNode
 }
 }
 }
+else if (xChild->getNodeName() == "items")
+{
+// gtk4-4.6.7 won't set an active item if the active item
+// property precedes the list of combobox items so if we
+// have "items" move them to the start
+insertAsFirstChild(xNode, xNode->removeChild(xChild));
+}
 
 xChild = xNextChild;
 }


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

2022-09-13 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk4/convert3to4.cxx |   16 
 1 file changed, 16 deletions(-)

New commits:
commit 8f4ca55bcea5234aa4979e526c06a64f71b56042
Author: Caolán McNamara 
AuthorDate: Tue Sep 13 17:03:43 2022 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 13 20:48:29 2022 +0200

drop gtk_check_version(4, 3, 2) checks now

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

diff --git a/vcl/unx/gtk4/convert3to4.cxx b/vcl/unx/gtk4/convert3to4.cxx
index 2c1554669119..d7d348029c9d 100644
--- a/vcl/unx/gtk4/convert3to4.cxx
+++ b/vcl/unx/gtk4/convert3to4.cxx
@@ -1519,22 +1519,6 @@ ConvertResult Convert3To4(const 
css::uno::Reference& xNode
 for (auto& xRemove : xRemoveList)
 xNode->removeChild(xRemove);
 
-// https://gitlab.gnome.org/GNOME/gtk/-/issues/4041 double encode 
ampersands if use-underline is used
-if (gtk_check_version(4, 3, 2) != nullptr)
-{
-if (xPropertyLabel)
-{
-auto xLabelText = xPropertyLabel->getFirstChild();
-if (xLabelText.is())
-{
-OString sText = xLabelText->getNodeValue().toUtf8();
-gchar* pText = g_markup_escape_text(sText.getStr(), 
sText.getLength());
-xLabelText->setNodeValue(OUString(pText, strlen(pText), 
RTL_TEXTENCODING_UTF8));
-g_free(pText);
-}
-}
-}
-
 return ConvertResult(bChildCanFocus, bHasVisible, bHasIconSize, 
bAlwaysShowImage, bUseUnderline,
  bVertOrientation, bXAlign, eImagePos, xPropertyLabel, 
xPropertyIconName);
 }


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

2022-09-13 Thread Szymon Kłos (via logerrit)
 desktop/qa/desktop_lib/test_desktop_lib.cxx   |   37 +++---
 desktop/source/lib/init.cxx   |   12 +++-
 include/sfx2/sidebar/SidebarDockingWindow.hxx |1 
 sfx2/source/sidebar/SidebarDockingWindow.cxx  |   14 -
 4 files changed, 51 insertions(+), 13 deletions(-)

New commits:
commit 74ff0462e4abf7ee7301286edbb3f33403c2d14a
Author: Szymon Kłos 
AuthorDate: Fri Sep 9 16:05:12 2022 +0200
Commit: Szymon Kłos 
CommitDate: Tue Sep 13 19:52:21 2022 +0200

lok: create sidebar on demand

Change-Id: I5393bba647aa4667643262e77acc6b6873afb571
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139729
Reviewed-by: Ashod Nakashian 
Tested-by: Jenkins CollaboraOffice 

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index ad0412251455..0475e6c460e4 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -46,6 +46,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -3267,10 +3269,35 @@ void DesktopLOKTest::testMultiDocuments()
 }
 }
 
+namespace
+{
+SfxChildWindow* lcl_initializeSidebar()
+{
+// in init.cxx we do setupSidebar which creaes the controller, do it 
here
+
+SfxViewShell* pViewShell = SfxViewShell::Current();
+CPPUNIT_ASSERT(pViewShell);
+
+SfxViewFrame* pViewFrame = pViewShell->GetViewFrame();
+CPPUNIT_ASSERT(pViewFrame);
+
+SfxChildWindow* pSideBar = pViewFrame->GetChildWindow(SID_SIDEBAR);
+CPPUNIT_ASSERT(pSideBar);
+
+auto pDockingWin = dynamic_cast(pSideBar->GetWindow());
+CPPUNIT_ASSERT(pDockingWin);
+
+pDockingWin->GetOrCreateSidebarController(); // just to create the 
controller
+
+return pSideBar;
+}
+};
+
 void DesktopLOKTest::testControlState()
 {
 LibLODocument_Impl* pDocument = loadDoc("search.ods");
 pDocument->pClass->postUnoCommand(pDocument, ".uno:StarShapes", nullptr, 
false);
+lcl_initializeSidebar();
 Scheduler::ProcessEventsToIdle();
 
 boost::property_tree::ptree aState;
@@ -3284,17 +3311,9 @@ void DesktopLOKTest::testMetricField()
 {
 LibLODocument_Impl* pDocument = loadDoc("search.ods");
 pDocument->pClass->postUnoCommand(pDocument, ".uno:StarShapes", nullptr, 
false);
+SfxChildWindow* pSideBar = lcl_initializeSidebar();
 Scheduler::ProcessEventsToIdle();
 
-SfxViewShell* pViewShell = SfxViewShell::Current();
-CPPUNIT_ASSERT(pViewShell);
-
-SfxViewFrame* pViewFrame = pViewShell->GetViewFrame();
-CPPUNIT_ASSERT(pViewFrame);
-
-SfxChildWindow* pSideBar = pViewFrame->GetChildWindow(SID_SIDEBAR);
-CPPUNIT_ASSERT(pSideBar);
-
 vcl::Window* pWin = pSideBar->GetWindow();
 CPPUNIT_ASSERT(pWin);
 
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c8f760fe4116..7342e57caeb8 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -879,13 +879,21 @@ void setupSidebar(std::u16string_view sidebarDeckId = u"")
 if (!pDockingWin)
 return;
 
+pViewFrame->ShowChildWindow( SID_SIDEBAR );
+
+const rtl::Reference& xController
+= pDockingWin->GetOrCreateSidebarController();
+
+xController->FadeIn();
+xController->RequestOpenDeck();
+
 if (!sidebarDeckId.empty())
 {
-pDockingWin->GetSidebarController()->SwitchToDeck(sidebarDeckId);
+xController->SwitchToDeck(sidebarDeckId);
 }
 else
 {
-pDockingWin->GetSidebarController()->SwitchToDefaultDeck();
+xController->SwitchToDefaultDeck();
 }
 
 pDockingWin->SyncUpdate();
diff --git a/include/sfx2/sidebar/SidebarDockingWindow.hxx 
b/include/sfx2/sidebar/SidebarDockingWindow.hxx
index 9bad1f5a8464..b22aefcb34a9 100644
--- a/include/sfx2/sidebar/SidebarDockingWindow.hxx
+++ b/include/sfx2/sidebar/SidebarDockingWindow.hxx
@@ -46,6 +46,7 @@ public:
 void SyncUpdate();
 
 auto& GetSidebarController() const { return mpSidebarController; }
+rtl::Reference& 
GetOrCreateSidebarController();
 using SfxDockingWindow::Close;
 
 private:
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx 
b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index c8f847fffb3b..ff7b3d270980 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -52,11 +52,21 @@ SidebarDockingWindow::SidebarDockingWindow(SfxBindings* 
pSfxBindings, SidebarChi
 OSL_ASSERT(pSfxBindings!=nullptr);
 OSL_ASSERT(pSfxBindings->GetDispatcher()!=nullptr);
 }
-else
+else if (!comphelper::LibreOfficeKit::isActive())
 {
-const SfxViewFrame* pViewFrame = 
pSfxBindings->GetDispatcher()->GetFrame();
+GetOrCreateSidebarController();
+}
+}
+
+rtl::Reference& 
SidebarDockingWindow::GetOrCreateS

[Libreoffice-commits] core.git: configmgr/Library_configmgr.mk configmgr/source desktop/source offapi/com

2022-09-13 Thread Balazs Varga (via logerrit)
 configmgr/Library_configmgr.mk|4 +++
 configmgr/source/components.cxx   |   32 +-
 configmgr/source/components.hxx   |5 ++--
 configmgr/source/data.cxx |   18 +-
 configmgr/source/data.hxx |2 -
 configmgr/source/parsemanager.cxx |6 ++--
 configmgr/source/parsemanager.hxx |3 +-
 configmgr/source/parser.hxx   |4 +--
 configmgr/source/update.cxx   |4 ++-
 configmgr/source/xcdparser.cxx|8 +++---
 configmgr/source/xcdparser.hxx|2 -
 configmgr/source/xcsparser.cxx|2 -
 configmgr/source/xcsparser.hxx|2 -
 configmgr/source/xcuparser.cxx|8 +++---
 configmgr/source/xcuparser.hxx|4 +--
 desktop/source/migration/migration.cxx|   31 +
 offapi/com/sun/star/configuration/XUpdate.idl |4 +--
 17 files changed, 97 insertions(+), 42 deletions(-)

New commits:
commit 583ea856f2aa227bb04581c5bcdc3a402f5a184f
Author: Balazs Varga 
AuthorDate: Thu Sep 8 16:04:10 2022 +0200
Commit: Balazs Varga 
CommitDate: Tue Sep 13 19:50:00 2022 +0200

Migrating product name related color schemes between different versions

Making work to migrate product name related color schemes
with different kind of product names. For example from a product
named by LibreOffice to a product named by LibreOfficeDev.

Change-Id: Iabef982216f126b781df122ed258816af2ae337c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139690
Tested-by: Jenkins
Tested-by: Gabor Kelemen 
Reviewed-by: Balazs Varga 

diff --git a/configmgr/Library_configmgr.mk b/configmgr/Library_configmgr.mk
index 11bba5f0f4cf..1c4b216a3740 100644
--- a/configmgr/Library_configmgr.mk
+++ b/configmgr/Library_configmgr.mk
@@ -51,6 +51,10 @@ $(eval $(call gb_Library_use_externals,configmgr, \
 dconf \
 ))
 
+$(eval $(call gb_Library_use_custom_headers,configmgr, \
+officecfg/registry \
+))
+
 $(eval $(call gb_Library_use_sdk_api,configmgr))
 
 $(eval $(call gb_Library_use_libraries,configmgr, \
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 3c35a258c12c..8d933d2c1651 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -95,23 +95,23 @@ typedef std::vector< UnresolvedVectorItem > 
UnresolvedVector;
 
 void parseXcsFile(
 OUString const & url, int layer, Data & data, Partial const * partial,
-Modifications * modifications, Additions * additions)
+Modifications * modifications, Additions * additions, OUString const & 
oldProductName)
 {
 assert(partial == nullptr && modifications == nullptr && additions == 
nullptr);
 (void) partial; (void) modifications; (void) additions;
 bool ok = rtl::Reference< ParseManager >(
-new ParseManager(url, new XcsParser(layer, data)))->parse(nullptr);
+new ParseManager(url, oldProductName, new XcsParser(layer, 
data)))->parse(nullptr);
 assert(ok);
 (void) ok; // avoid warnings
 }
 
 void parseXcuFile(
 OUString const & url, int layer, Data & data, Partial const * partial,
-Modifications * modifications, Additions * additions)
+Modifications * modifications, Additions * additions, OUString const & 
oldProductName)
 {
 bool ok = rtl::Reference< ParseManager >(
 new ParseManager(
-url,
+url, oldProductName,
 new XcuParser(layer, data, partial, modifications, additions)))->
 parse(nullptr);
 assert(ok);
@@ -214,7 +214,7 @@ rtl::Reference< Node > 
Components::resolvePathRepresentation(
 const
 {
 return data_.resolvePathRepresentation(
-pathRepresentation, canonicRepresentation, path, finalizedLayer);
+pathRepresentation, OUString(), canonicRepresentation, path, 
finalizedLayer);
 }
 
 rtl::Reference< Node > Components::getTemplate(OUString const & fullName) const
@@ -311,7 +311,7 @@ void Components::insertExtensionXcsFile(
 {
 int layer = getExtensionLayer(shared);
 try {
-parseXcsFile(fileUri, layer, data_, nullptr, nullptr, nullptr);
+parseXcsFile(fileUri, layer, data_, nullptr, nullptr, nullptr, 
OUString());
 } catch (css::container::NoSuchElementException & e) {
 throw css::uno::RuntimeException(
 "insertExtensionXcsFile does not exist: " + e.Message);
@@ -325,7 +325,7 @@ void Components::insertExtensionXcuFile(
 int layer = getExtensionLayer(shared) + 1;
 Additions * adds = data_.addExtensionXcuAdditions(fileUri, layer);
 try {
-parseXcuFile(fileUri, layer, data_, nullptr, modifications, adds);
+parseXcuFile(fileUri, layer, data_, nullptr, modifications, adds, 
OUString());
 } catch (css::container::NoSuchElementException & e) {
 data_.removeExtensionXcuAd

[Libreoffice-commits] core.git: include/osl

2022-09-13 Thread Stephan Bergmann (via logerrit)
 include/osl/time.h |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 5e192fab19e1f51a704a0c690af5343d43b8e724
Author: Stephan Bergmann 
AuthorDate: Tue Sep 13 17:17:10 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Sep 13 19:22:20 2022 +0200

Turn this into a doxygen comment

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

diff --git a/include/osl/time.h b/include/osl/time.h
index a906a15bfe8a..f2f5b7a4f8ed 100644
--- a/include/osl/time.h
+++ b/include/osl/time.h
@@ -39,9 +39,10 @@
 #   pragma pack(push, 8)
 #endif
 
-/* Time since Jan-01-1970
+/** Time since Jan-01-1970
 
-   TODO: sal_uInt32 TimeValue::Seconds is only large enough for representing 
dates until year 2106.
+@warning sal_uInt32 TimeValue::Seconds is only large enough for 
representing dates until year
+2106.
 */
 
 #if defined LIBO_INTERNAL_ONLY && defined __cplusplus


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

2022-09-13 Thread Miklos Vajna (via logerrit)
 include/vcl/filter/PDFiumLibrary.hxx |2 +
 include/vcl/pdf/PDFFormFieldType.hxx |   29 +++
 include/vcl/pdfwriter.hxx|2 -
 sw/qa/core/text/text.cxx |   37 +++
 sw/source/core/text/itrform2.cxx |   14 ++---
 vcl/source/pdf/PDFiumLibrary.cxx |   26 
 6 files changed, 106 insertions(+), 4 deletions(-)

New commits:
commit 9bad5be0ffdcdee92d40162b598ed2ab2815e5d5
Author: Miklos Vajna 
AuthorDate: Tue Sep 13 15:23:31 2022 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 13 18:43:09 2022 +0200

sw content controls, checkbox: add PDF export

Map this to vcl::PDFWriter::CheckBoxWidget, which uses the /FT/Btn
widget, i.e. a (toggle) button which is not a pushbutton or a
radiobutton).

Also avoid a border for content controls: it just cuts out some part of
the rich text/plain text content control filled in text + causes a
double border for checkboxes, so not useful.

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

diff --git a/include/vcl/filter/PDFiumLibrary.hxx 
b/include/vcl/filter/PDFiumLibrary.hxx
index 3a4d0d83faf6..8274ded92e1f 100644
--- a/include/vcl/filter/PDFiumLibrary.hxx
+++ b/include/vcl/filter/PDFiumLibrary.hxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class SvMemoryStream;
 
@@ -100,6 +101,7 @@ public:
 virtual size_t getAttachmentPointsCount() = 0;
 virtual std::vector getAttachmentPoints(size_t nIndex) 
= 0;
 virtual std::vector getLineGeometry() = 0;
+virtual PDFFormFieldType getFormFieldType(PDFiumDocument* pDoc) = 0;
 };
 
 class PDFiumTextPage;
diff --git a/include/vcl/pdf/PDFFormFieldType.hxx 
b/include/vcl/pdf/PDFFormFieldType.hxx
new file mode 100644
index ..96be9bffc188
--- /dev/null
+++ b/include/vcl/pdf/PDFFormFieldType.hxx
@@ -0,0 +1,29 @@
+/* -*- 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/.
+ *
+ */
+
+#pragma once
+
+namespace vcl::pdf
+{
+enum class PDFFormFieldType
+{
+Unknown = 0,
+PushButton = 1,
+CheckBox = 2,
+RadioButton = 3,
+ComboBox = 4,
+ListBox = 5,
+TextField = 6,
+Signature = 7
+};
+
+} // namespace vcl::pdf
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index cb008fcec280..8860675de688 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -334,7 +334,7 @@ public:
 }
 };
 
-struct CheckBoxWidget final : public AnyWidget
+struct VCL_DLLPUBLIC CheckBoxWidget final : public AnyWidget
 {
 boolChecked;
 OUStringOnValue; // the value of the checkbox if it is 
selected
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index 0e832f074cd9..e5d530af2531 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -656,6 +656,43 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPDF)
 CPPUNIT_ASSERT_EQUAL(1, pPage->getAnnotationCount());
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testCheckboxContentControlPDF)
+{
+// Given a file with a checkbox content control:
+SwDoc* pDoc = createSwDoc();
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+pWrtShell->InsertContentControl(SwContentControlType::CHECKBOX);
+
+// When exporting to PDF:
+uno::Reference xStorable(mxComponent, uno::UNO_QUERY);
+utl::MediaDescriptor aMediaDescriptor;
+aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
+xStorable->storeToURL(maTempFile.GetURL(), 
aMediaDescriptor.getAsConstPropertyValueList());
+
+// Then make sure that a checkbox form widget is emitted:
+SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
+SvMemoryStream aMemory;
+aMemory.WriteStream(aFile);
+std::shared_ptr pPDFium = vcl::pdf::PDFiumLibrary::get();
+if (!pPDFium)
+{
+return;
+}
+std::unique_ptr pPdfDocument
+= pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize(), 
OString());
+std::unique_ptr pPage = pPdfDocument->openPage(0);
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 0
+// i.e. the checkbox content control was just exported as normal text.
+CPPUNIT_ASSERT_EQUAL(1, pPage->getAnnotationCount());
+std::unique_ptr pAnnotation = 
pPage->getAnnotation(0);
+CPPUNIT_ASSERT_EQUAL(vcl::pdf::PDFAnnotationSubType::Widget, 
pAnnotation->getSubType());
+// Also 

[Libreoffice-commits] core.git: configure.ac download.lst

2022-09-13 Thread Taichi Haradaguchi (via logerrit)
 configure.ac |2 +-
 download.lst |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 849601bdec341eaee3cafc46fbe3cf223f06fb7d
Author: Taichi Haradaguchi <20001...@ymail.ne.jp>
AuthorDate: Sat Sep 10 17:20:58 2022 +0900
Commit: Caolán McNamara 
CommitDate: Tue Sep 13 17:51:02 2022 +0200

Python3: upgrade to release 3.8.14

Fixes CVE-2020-10735.

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

diff --git a/configure.ac b/configure.ac
index 0033ddc1b836..41d2c30a9816 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9984,7 +9984,7 @@ if test \( "$cross_compiling" = yes -a -z 
"$PYTHON_FOR_BUILD" \) -o "$enable_pyt
 SYSTEM_PYTHON=
 PYTHON_VERSION_MAJOR=3
 PYTHON_VERSION_MINOR=8
-PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.13
+PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.14
 if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
 AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in 
download.lst])
 fi
diff --git a/download.lst b/download.lst
index c6f95a10d6a2..aa8550fbd2ff 100644
--- a/download.lst
+++ b/download.lst
@@ -216,8 +216,8 @@ export POPPLER_DATA_SHA256SUM := 
2cec05cd1bb03af98a8b06a1e22f6e6e1a65b1e2f3816cb
 export POPPLER_DATA_TARBALL := poppler-data-0.4.11.tar.gz
 export POSTGRESQL_SHA256SUM := 
9b81067a55edbaabc418aacef457dd8477642827499560b00615a6ea6c13f6b3
 export POSTGRESQL_TARBALL := postgresql-13.5.tar.bz2
-export PYTHON_SHA256SUM := 
6f309077012040aa39fe8f0c61db8c0fa1c45136763299d375c9e5756f09cf57
-export PYTHON_TARBALL := Python-3.8.13.tar.xz
+export PYTHON_SHA256SUM := 
5d77e278271ba803e9909a41a4f3baca006181c93ada682a5e5fe8dc4a24c5f3
+export PYTHON_TARBALL := Python-3.8.14.tar.xz
 export QXP_SHA256SUM := 
e137b6b110120a52c98edd02ebdc4095ee08d0d5295a94316a981750095a945c
 export QXP_TARBALL := libqxp-0.0.2.tar.xz
 export RAPTOR_SHA256SUM := 
ada7f0ba54787b33485d090d3d2680533520cd4426d2f7fb4782dd4a6a1480ed


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

2022-09-13 Thread Caolán McNamara (via logerrit)
 chart2/source/controller/main/ChartTransferable.cxx |7 +++
 chart2/source/controller/main/ChartTransferable.hxx |2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit d2ecb536394f52f1fd7bce53d8feb202a3facfdd
Author: Caolán McNamara 
AuthorDate: Mon Sep 12 12:40:21 2022 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 13 17:50:28 2022 +0200

cid#1500679 Resource leak in object

to reproduce this in reality, insert a chart, activate it, select and
copy and paste something like a bar of a bar chart. Select that copy and
copy to clipboard again. reactivate chart, paste that element into the
surrounding spreadsheet, select and copy something else to clear the
chart transferrable and the model created by the chart transferrable
leaks.

there are an unrelated blizzard of a11y mutex deadlocks here btw :-(

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

diff --git a/chart2/source/controller/main/ChartTransferable.cxx 
b/chart2/source/controller/main/ChartTransferable.cxx
index 322e73be3aa8..2f27902ba1e3 100644
--- a/chart2/source/controller/main/ChartTransferable.cxx
+++ b/chart2/source/controller/main/ChartTransferable.cxx
@@ -49,8 +49,7 @@ ChartTransferable::ChartTransferable(
 SdrModel& rSdrModel,
 SdrObject* pSelectedObj,
 bool bDrawing)
-:   m_pMarkedObjModel( nullptr )
-,m_bDrawing( bDrawing )
+: m_bDrawing(bDrawing)
 {
 std::unique_ptr pExchgView(std::make_unique( 
rSdrModel ));
 SdrPageView* pPv = pExchgView->ShowSdrPage( rSdrModel.GetPage( 0 ));
@@ -62,7 +61,7 @@ ChartTransferable::ChartTransferable(
 m_xMetaFileGraphic.set( aGraphic.GetXGraphic());
 if ( m_bDrawing )
 {
-m_pMarkedObjModel = pExchgView->CreateMarkedObjModel().release();
+m_xMarkedObjModel = pExchgView->CreateMarkedObjModel();
 }
 }
 
@@ -89,7 +88,7 @@ bool ChartTransferable::GetData( const 
css::datatransfer::DataFlavor& rFlavor, c
 {
 if ( nFormat == SotClipboardFormatId::DRAWING )
 {
-bResult = SetObject( m_pMarkedObjModel, 
CHARTTRANSFER_OBJECTTYPE_DRAWMODEL, rFlavor );
+bResult = SetObject(m_xMarkedObjModel.get(), 
CHARTTRANSFER_OBJECTTYPE_DRAWMODEL, rFlavor);
 }
 else if ( nFormat == SotClipboardFormatId::GDIMETAFILE )
 {
diff --git a/chart2/source/controller/main/ChartTransferable.hxx 
b/chart2/source/controller/main/ChartTransferable.hxx
index 34567dceb6a9..fd782864bfc6 100644
--- a/chart2/source/controller/main/ChartTransferable.hxx
+++ b/chart2/source/controller/main/ChartTransferable.hxx
@@ -51,7 +51,7 @@ protected:
 
 private:
 css::uno::Reference< css::graphic::XGraphic > m_xMetaFileGraphic;
-SdrModel* m_pMarkedObjModel;
+std::unique_ptr m_xMarkedObjModel;
 bool m_bDrawing;
 };
 


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

2022-09-13 Thread Khaled Hosny (via logerrit)
 vcl/source/fontsubset/cff.cxx |   31 ++-
 1 file changed, 30 insertions(+), 1 deletion(-)

New commits:
commit a387f39de8e59d7542b74962242504b798af1362
Author: Khaled Hosny 
AuthorDate: Tue Sep 13 12:34:35 2022 +0200
Commit: خالد حسني 
CommitDate: Tue Sep 13 17:36:32 2022 +0200

tdf#126242: Handle fractional values when subsetting CFF

Instead of truncating the values, write the fraction using “div” operator.

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

diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index 379e239a5c76..198fc49b40cc 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -582,7 +582,30 @@ void CffSubsetterContext::writeType1Val( ValType aVal)
 {
 U8* pOut = mpWritePtr;
 
-int nInt = static_cast(aVal);
+// tdf#126242
+// Type2 has 16.16 fixed numbers, but Type1 does not. To represent values
+// with fractions we multiply it by a factor then use “div” operator to
+// divide it back and keep the fractions.
+// Code Adapted from:
+// 
https://github.com/fontforge/fontforge/blob/f152f12e567ea5bd737a2907c318ae26cfaabd08/fontforge/splinesave.c#L378
+int nDiv = 0;
+aVal = rint(aVal * 1024) / 1024;
+if (aVal != floor(aVal))
+{
+if (aVal == rint(aVal * 64) / 64)
+nDiv = 64;
+else
+nDiv = 1024;
+aVal *= nDiv;
+}
+
+int nInt = static_cast(rint(aVal));
+if (nDiv && floor(nInt) / nDiv == floor(nInt / nDiv))
+{
+nInt = rint(nInt / nDiv);
+nDiv = 0;
+}
+
 if( (nInt >= -107) && (nInt <= +107)) {
 *(pOut++) = static_cast(nInt + 139);// -107..+107
 } else if( (nInt >= -1131) && (nInt <= +1131)) {
@@ -602,6 +625,12 @@ void CffSubsetterContext::writeType1Val( ValType aVal)
 }
 
 mpWritePtr = pOut;
+
+if (nDiv)
+{
+writeType1Val(nDiv);
+writeTypeEsc(TYPE1OP::DIV);
+}
 }
 
 inline void CffSubsetterContext::writeTypeOp( int nTypeOp)


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

2022-09-13 Thread Luboš Luňák (via logerrit)
 vcl/source/outdev/bitmap.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit f28087140a79949b7ba38cd9a724438ea92a44e8
Author: Luboš Luňák 
AuthorDate: Tue Sep 13 10:47:06 2022 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 13 17:17:29 2022 +0200

do not assert on "failed" Skia call because of empty size (tdf#150821)

There's no problem if the output size is actually empty.

Change-Id: I680766919c65fcaad6687f09af28f6e95575c228
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139830
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 53a9f774b71d..f489efd7a038 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -347,7 +347,11 @@ void OutputDevice::DrawDeviceAlphaBitmap( const Bitmap& 
rBmp, const AlphaMask& r
 }
 
 // we need to make sure Skia never reaches this slow code path
-assert(!SkiaHelper::isVCLSkiaEnabled());
+// (but do not fail in no-op cases)
+assert(!SkiaHelper::isVCLSkiaEnabled()
+|| tools::Rectangle(Point(), rBmp.GetSizePixel())
+.Intersection(tools::Rectangle(rSrcPtPixel, 
rSrcSizePixel)).IsEmpty()
+|| 
mpAlphaVDev->LogicToPixel(mpAlphaVDev->GetOutputSizePixel()).IsEmpty());
 }
 
 tools::Rectangle aBmpRect(Point(), rBmp.GetSizePixel());


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - officecfg/registry

2022-09-13 Thread Gabor Kelemen (via logerrit)
 officecfg/registry/data/org/openoffice/Setup.xcu |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit db5d48d6a79ad1621c6049deed88c958ca08a8b7
Author: Gabor Kelemen 
AuthorDate: Mon Sep 12 23:41:22 2022 +0200
Commit: Gabor Kelemen 
CommitDate: Tue Sep 13 17:17:32 2022 +0200

Migration: move L10N settings as well

This is needed to keep UI language/locale settings
Without this the language settings were reset to
OS defaults in our rebranded version

Change-Id: I6c09370e0053cf5171e0ac959429ac7cef5261b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139821
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen 
(cherry picked from commit fa7da09ad4afef8d6ae2dc809c5b9f059a9974b1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139837
Tested-by: Gabor Kelemen 

diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu 
b/officecfg/registry/data/org/openoffice/Setup.xcu
index 56a1e2e12d73..76827585253e 100644
--- a/officecfg/registry/data/org/openoffice/Setup.xcu
+++ b/officecfg/registry/data/org/openoffice/Setup.xcu
@@ -966,7 +966,10 @@
   
   
 
-  /org.openoffice.Setup/Office/Factories
+  
+  /org.openoffice.Setup/Office/Factories
+  /org.openoffice.Setup/L10N
+  
 
   
   


[Libreoffice-commits] core.git: include/osl sal/osl ucb/source

2022-09-13 Thread Stephan Bergmann (via logerrit)
 include/osl/time.h |5 -
 sal/osl/unx/time.cxx   |2 ++
 ucb/source/ucp/gio/gio_content.cxx |2 ++
 3 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 2c8ced01216096dd03a4143fe41b4c5653deb67a
Author: Stephan Bergmann 
AuthorDate: Tue Sep 13 13:11:12 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Sep 13 17:14:26 2022 +0200

cid#1509290, cid#1509240: Silence "Use of 32-bit time_t (Y2K38_SAFETY)" for 
now

We'll eventually need to do something about the 32 bit TimeValue::Seconds, 
but
as it is unsigned we should be fine for another 80 years (until "06:28:15 
UTC on
Sunday, 7 February 2106", according to
).

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

diff --git a/include/osl/time.h b/include/osl/time.h
index 5c5096cada8a..a906a15bfe8a 100644
--- a/include/osl/time.h
+++ b/include/osl/time.h
@@ -39,7 +39,10 @@
 #   pragma pack(push, 8)
 #endif
 
-/* Time since Jan-01-1970 */
+/* Time since Jan-01-1970
+
+   TODO: sal_uInt32 TimeValue::Seconds is only large enough for representing 
dates until year 2106.
+*/
 
 #if defined LIBO_INTERNAL_ONLY && defined __cplusplus
 
diff --git a/sal/osl/unx/time.cxx b/sal/osl/unx/time.cxx
index a77015614e74..d6a2ca33ba6c 100644
--- a/sal/osl/unx/time.cxx
+++ b/sal/osl/unx/time.cxx
@@ -170,6 +170,8 @@ sal_Bool SAL_CALL osl_getTimeValueFromDateTime( const 
oslDateTime* pDateTime, Ti
 bias = aTime.tm_isdst > 0 ? timezone - 3600 : timezone;
 #endif
 
+// coverity[store_truncates_time_t] - TODO: sal_uInt32 
TimeValue::Seconds is only large
+// enough for integer time_t values < 2^32 representing dates until 
year 2106:
 pTimeVal->Seconds = nSeconds;
 pTimeVal->Nanosec = pDateTime->NanoSeconds;
 
diff --git a/ucb/source/ucp/gio/gio_content.cxx 
b/ucb/source/ucp/gio/gio_content.cxx
index fc31965a990f..5c225a951dbd 100644
--- a/ucb/source/ucp/gio/gio_content.cxx
+++ b/ucb/source/ucp/gio/gio_content.cxx
@@ -422,6 +422,8 @@ static css::util::DateTime getDateFromUnix (time_t t)
 {
 TimeValue tv;
 tv.Nanosec = 0;
+// coverity[store_truncates_time_t] - TODO: sal_uInt32 TimeValue::Seconds 
is only large enough
+// for integer time_t values < 2^32 representing dates until year 2106:
 tv.Seconds = t;
 oslDateTime dt;
 


[Libreoffice-commits] core.git: officecfg/registry

2022-09-13 Thread Gabor Kelemen (via logerrit)
 officecfg/registry/data/org/openoffice/Setup.xcu |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit fa7da09ad4afef8d6ae2dc809c5b9f059a9974b1
Author: Gabor Kelemen 
AuthorDate: Mon Sep 12 23:41:22 2022 +0200
Commit: Gabor Kelemen 
CommitDate: Tue Sep 13 17:08:08 2022 +0200

Migration: move L10N settings as well

This is needed to keep UI language/locale settings
Without this the language settings were reset to
OS defaults in our rebranded version

Change-Id: I6c09370e0053cf5171e0ac959429ac7cef5261b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139821
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen 

diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu 
b/officecfg/registry/data/org/openoffice/Setup.xcu
index 601efb5098df..dacedf277f93 100644
--- a/officecfg/registry/data/org/openoffice/Setup.xcu
+++ b/officecfg/registry/data/org/openoffice/Setup.xcu
@@ -966,7 +966,10 @@
   
   
 
-  /org.openoffice.Setup/Office/Factories
+  
+  /org.openoffice.Setup/Office/Factories
+  /org.openoffice.Setup/L10N
+  
 
   
   


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - configure.ac

2022-09-13 Thread Tor Lillqvist (via logerrit)
 configure.ac |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c9873a39cdc3e2a859f7728bc7b4c227501cfa1c
Author: Tor Lillqvist 
AuthorDate: Tue Sep 13 09:14:16 2022 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Sep 13 15:29:09 2022 +0200

Bump current iOS SDK to 16.0

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

diff --git a/configure.ac b/configure.ac
index 5bee3b43cbf7..6303df071dde 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3591,8 +3591,8 @@ dnl 
===
 
 if test $_os = iOS; then
 AC_MSG_CHECKING([what iOS SDK to use])
-current_sdk_ver=15.5
-older_sdk_vers="15.4 15.2 15.0"
+current_sdk_ver=16.0
+older_sdk_vers="15.6 15.5 15.4 15.2 15.0"
 if test "$enable_ios_simulator" = "yes"; then
 platform=iPhoneSimulator
 versionmin=-mios-simulator-version-min=13.6


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

2022-09-13 Thread Khaled Hosny (via logerrit)
 vcl/inc/sft.hxx  |3 +--
 vcl/source/font/PhysicalFontFace.cxx |5 +
 vcl/source/fontsubset/sft.cxx|   24 +---
 3 files changed, 15 insertions(+), 17 deletions(-)

New commits:
commit 196a8331ccb80fa7d79b74e827bf5433321b9815
Author: Khaled Hosny 
AuthorDate: Sun Sep 11 16:28:38 2022 +0200
Commit: خالد حسني 
CommitDate: Tue Sep 13 15:28:34 2022 +0200

vcl: Simplify calling FillFontSubsetInfo()

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

diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx
index ccadaeb8d0b5..9c73c8ace308 100644
--- a/vcl/inc/sft.hxx
+++ b/vcl/inc/sft.hxx
@@ -631,8 +631,7 @@ class TrueTypeFace;
   const sal_uInt8* pEncoding,
   int nGlyphCount, FontSubsetInfo& rInfo);
 
-VCL_DLLPUBLIC void FillFontSubsetInfo(const TTGlobalFontInfo& rTTInfo,
-  const OUString& pPSName,
+VCL_DLLPUBLIC void FillFontSubsetInfo(AbstractTrueTypeFont *ttf,
   FontSubsetInfo& rInfo);
 /**
  * Generates a new PostScript Type42 font and dumps it to outf file.
diff --git a/vcl/source/font/PhysicalFontFace.cxx 
b/vcl/source/font/PhysicalFontFace.cxx
index 245eab3ed88e..b8b0bf0316cd 100644
--- a/vcl/source/font/PhysicalFontFace.cxx
+++ b/vcl/source/font/PhysicalFontFace.cxx
@@ -307,10 +307,7 @@ bool PhysicalFontFace::CreateFontSubset(const OUString& 
rToFile, const sal_Glyph
 return false;
 
 // Get details about the subset font.
-TTGlobalFontInfo aTTInfo;
-GetTTGlobalFontInfo(&aSftFont, &aTTInfo);
-OUString aPSName(aTTInfo.psname, std::strlen(aTTInfo.psname), 
RTL_TEXTENCODING_UTF8);
-FillFontSubsetInfo(aTTInfo, aPSName, rInfo);
+FillFontSubsetInfo(&aSftFont, rInfo);
 
 // write subset into destination file
 return CreateTTFfontSubset(aSftFont, aToFile, pGlyphIds, pEncoding, 
nGlyphCount);
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 1e270805fb90..955e70b347c6 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -2348,27 +2348,29 @@ void GetTTGlobalFontInfo(AbstractTrueTypeFont *ttf, 
TTGlobalFontInfo *info)
 }
 }
 
-void FillFontSubsetInfo(const vcl::TTGlobalFontInfo& rTTInfo, const OUString& 
pPSName,
-FontSubsetInfo& rInfo)
+void FillFontSubsetInfo(AbstractTrueTypeFont *ttf, FontSubsetInfo& rInfo)
 {
-rInfo.m_aPSName = pPSName;
+TTGlobalFontInfo aTTInfo;
+GetTTGlobalFontInfo(ttf, &aTTInfo);
+
+rInfo.m_aPSName = OUString::fromUtf8(aTTInfo.psname);
 rInfo.m_nFontType = FontType::SFNT_TTF;
 rInfo.m_aFontBBox
-= tools::Rectangle(Point(rTTInfo.xMin, rTTInfo.yMin), 
Point(rTTInfo.xMax, rTTInfo.yMax));
-rInfo.m_nCapHeight = rTTInfo.yMax; // Well ...
-rInfo.m_nAscent = rTTInfo.winAscent;
-rInfo.m_nDescent = rTTInfo.winDescent;
+= tools::Rectangle(Point(aTTInfo.xMin, aTTInfo.yMin), 
Point(aTTInfo.xMax, aTTInfo.yMax));
+rInfo.m_nCapHeight = aTTInfo.yMax; // Well ...
+rInfo.m_nAscent = aTTInfo.winAscent;
+rInfo.m_nDescent = aTTInfo.winDescent;
 
 // mac fonts usually do not have an OS2-table
 // => get valid ascent/descent values from other tables
 if (!rInfo.m_nAscent)
-rInfo.m_nAscent = +rTTInfo.typoAscender;
+rInfo.m_nAscent = +aTTInfo.typoAscender;
 if (!rInfo.m_nAscent)
-rInfo.m_nAscent = +rTTInfo.ascender;
+rInfo.m_nAscent = +aTTInfo.ascender;
 if (!rInfo.m_nDescent)
-rInfo.m_nDescent = +rTTInfo.typoDescender;
+rInfo.m_nDescent = +aTTInfo.typoDescender;
 if (!rInfo.m_nDescent)
-rInfo.m_nDescent = -rTTInfo.descender;
+rInfo.m_nDescent = -aTTInfo.descender;
 }
 
 GlyphData *GetTTRawGlyphData(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID)


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

2022-09-13 Thread Khaled Hosny (via logerrit)
 vcl/inc/salgdi.hxx   |   15 -
 vcl/inc/sft.hxx  |   15 +
 vcl/source/font/PhysicalFontFace.cxx |8 +-
 vcl/source/fontsubset/sft.cxx|   96 +
 vcl/source/gdi/salgdilayout.cxx  |   99 ---
 5 files changed, 115 insertions(+), 118 deletions(-)

New commits:
commit 1bf6acf0fe438194d76e7fb2f605ed26c7914f55
Author: Khaled Hosny 
AuthorDate: Sun Sep 11 16:07:34 2022 +0200
Commit: خالد حسني 
CommitDate: Tue Sep 13 15:28:12 2022 +0200

vcl: Move subsetting helper functions to sft.cxx

No functional change.

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

diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index 4521785e3971..a0f8a22df7b3 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -44,7 +44,6 @@ namespace vcl::font {
 }
 class SalLayout;
 namespace tools { class Rectangle; }
-class FontSubsetInfo;
 class OutputDevice;
 class FreetypeFont;
 struct SystemGraphicsData;
@@ -630,20 +629,6 @@ protected:
 
 std::unique_ptr m_pWidgetDraw;
 vcl::WidgetDrawInterface* forWidget() { return m_pWidgetDraw ? 
m_pWidgetDraw.get() : this; }
-
-public:
-static bool CreateTTFfontSubset(vcl::AbstractTrueTypeFont& aTTF, const 
OString& rSysPath,
-const sal_GlyphId* pGlyphIds,
-const sal_uInt8* pEncoding,
-int nGlyphCount);
-
-static bool CreateCFFfontSubset(const unsigned char* pFontBytes, int 
nByteLength,
-const OString& rSysPath, const 
sal_GlyphId* pGlyphIds,
-const sal_uInt8* pEncoding,
-int nGlyphCount, FontSubsetInfo& rInfo);
-
-static void FillFontSubsetInfo(const vcl::TTGlobalFontInfo& rTTInfo, const 
OUString& pPSName,
-   FontSubsetInfo& rInfo);
 };
 
 bool SalGraphics::IsNativeControlSupported(ControlType eType, ControlPart 
ePart)
diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx
index 88fa729fe6b8..ccadaeb8d0b5 100644
--- a/vcl/inc/sft.hxx
+++ b/vcl/inc/sft.hxx
@@ -619,6 +619,21 @@ class TrueTypeFace;
   sal_uInt8 const *encoding,
   intnGlyphs);
 
+VCL_DLLPUBLIC bool CreateTTFfontSubset(AbstractTrueTypeFont& aTTF,
+  const OString& rSysPath,
+  const sal_GlyphId* pGlyphIds,
+  const sal_uInt8* pEncoding,
+  int nGlyphCount);
+
+VCL_DLLPUBLIC bool CreateCFFfontSubset(const unsigned char* pFontBytes,
+  int nByteLength,
+  const OString& rSysPath, const sal_GlyphId* 
pGlyphIds,
+  const sal_uInt8* pEncoding,
+  int nGlyphCount, FontSubsetInfo& rInfo);
+
+VCL_DLLPUBLIC void FillFontSubsetInfo(const TTGlobalFontInfo& rTTInfo,
+  const OUString& pPSName,
+  FontSubsetInfo& rInfo);
 /**
  * Generates a new PostScript Type42 font and dumps it to outf file.
  * This function substitutes glyph 0 for all glyphIDs that are not found in 
the font.
diff --git a/vcl/source/font/PhysicalFontFace.cxx 
b/vcl/source/font/PhysicalFontFace.cxx
index 10a1048dcf79..245eab3ed88e 100644
--- a/vcl/source/font/PhysicalFontFace.cxx
+++ b/vcl/source/font/PhysicalFontFace.cxx
@@ -298,8 +298,8 @@ bool PhysicalFontFace::CreateFontSubset(const OUString& 
rToFile, const sal_Glyph
 // Shortcut for CFF-subsetting.
 auto aData = GetRawFontData(T_CFF);
 if (!aData.empty())
-return SalGraphics::CreateCFFfontSubset(aData.data(), aData.size(), 
aToFile, pGlyphIds,
-pEncoding, nGlyphCount, rInfo);
+return CreateCFFfontSubset(aData.data(), aData.size(), aToFile, 
pGlyphIds, pEncoding,
+   nGlyphCount, rInfo);
 
 // Prepare data for font subsetter.
 TrueTypeFace aSftFont(*this);
@@ -310,10 +310,10 @@ bool PhysicalFontFace::CreateFontSubset(const OUString& 
rToFile, const sal_Glyph
 TTGlobalFontInfo aTTInfo;
 GetTTGlobalFontInfo(&aSftFont, &aTTInfo);
 OUString aPSName(aTTInfo.psname, std::strlen(aTTInfo.psname), 
RTL_TEXTENCODING_UTF8);
-SalGraphics::FillFontSubsetInfo(aTTInfo, aPSName, rInfo);
+FillFontSubsetInfo(aTTInfo, aPSName, rInfo);
 
 // write subset into destination file
-return SalGraphics::CreateTTFfontSubset(aSftFont, aToFile, pGlyphIds, 
pEncoding, nGlyphCount);
+return CreateTTFfontSubset(aSftFont, aToFile, pGlyphIds, pEncoding, 
nGlyphCount);
 }
 }
 
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fo

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

2022-09-13 Thread Miklos Vajna (via logerrit)
 writerfilter/qa/cppunittests/rtftok/data/duplicated-image.rtf |   41 ++
 writerfilter/qa/cppunittests/rtftok/rtfdocumentimpl.cxx   |   18 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx|2 
 3 files changed, 61 insertions(+)

New commits:
commit f07d4faac47cdf3cd09b036d07b03c6bb8d86372
Author: Miklos Vajna 
AuthorDate: Mon Sep 12 20:29:26 2022 +0200
Commit: Michael Stahl 
CommitDate: Tue Sep 13 15:27:37 2022 +0200

tdf#140302 RTF import: fix unexpected repeated image

The bugdoc has 2 images, but the resulting doc model had 3 images since
commit 7e863504854ae8ab286b32510aba8b363a8e314b (tdf#81943 sw RTF
import: fix missing wrap in background for in-table shape, 2018-07-16).

The trouble was that shape replay wants to access the current shape at
m_aStates.top().aShape, but we only set it, forgot to unset it after
replay was done, which can result in duplicated insertions.

Fix this by saving the old current shape on the stack, set the current
shape to the wanted value and then undo it after replay.

This only affects documents that have a \picprop group, since the
unwanted insertion happened when popping that group.

Change-Id: I088054de2332deb4b45f7e269672fa799dd49c2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139818
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 
(cherry picked from commit b9fcf43a38773f81ef1833897c4e36d8db16c0b1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139672
Reviewed-by: Michael Stahl 

diff --git a/writerfilter/qa/cppunittests/rtftok/data/duplicated-image.rtf 
b/writerfilter/qa/cppunittests/rtftok/data/duplicated-image.rtf
new file mode 100644
index ..f225ff1f248f
--- /dev/null
+++ b/writerfilter/qa/cppunittests/rtftok/data/duplicated-image.rtf
@@ -0,0 +1,41 @@
+{\rtf1
+before table\par
+\trowd\cellx4819\cellx9638\pard\plain\intbl
+A1
+\cell\pard\plain
+{\shp
+{\*\shpinst\shpwr1\shpbypara\shpbyignore\shptop113\shpbottom1352\shpbxcolumn\shpbxignore\shpleft-22\shpright4733
+{\sp
+{\sn shapeType}
+{\sv 75}
+}
+{\sp
+{\sn pib}
+{\sv
+{\pict\picscalex92\picscaley92\piccropl0\piccropr0\piccropt0\piccropb0\picw341\pich89\picwgoal5115\pichgoal1335\pngblip
+89504e470d0a1a0a000d4948445200100010040300eddde2520030504c54450080008000808000808000800080808080
+80c0c0c0ff00ff000000ff00ff7b1fb1c4005b49444154789c458db10ac03008445d33e5b71d04d764caef3808f99d0604ab
+b5a5b778dc933bf057f01bdd650ca98cf8d885ce240d0c3ecf40a41dc9097011f4d67a2ad18ac8f239af44f33255e19c1044ce42e39a60f9469fc06fa01a6b07
+bcd70bc749454e44ae426082
+}
+}
+}
+}
+}
+\cell\row
+\pard\plain after table\par
+\pard\plain
+{\*\shppict
+{\pict
+{\*\picprop
+}
+\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0\picw16\pich16\picwgoal240\pichgoal240\pngblip
+89504e470d0a1a0a000d4948445200100010040300eddde2520030504c54450080008000808000808000800080808080
+80c0c0c0ff00ff000000ff00ff7b1fb1c4005b49444154789c458db10ac03008445d33e5b71d04d764caef3808f99d0604ab
+b5a5b778dc933bf057f01bdd650ca98cf8d885ce240d0c3ecf40a41dc9097011f4d67a2ad18ac8f239af44f33255e19c1044ce42e39a60f9469fc06fa01a6b07
+bcd70bc749454e44ae426082
+}
+}
+end
+\par
+}
diff --git a/writerfilter/qa/cppunittests/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/qa/cppunittests/rtftok/rtfdocumentimpl.cxx
index 1898e0057695..6020453ba783 100644
--- a/writerfilter/qa/cppunittests/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/qa/cppunittests/rtftok/rtfdocumentimpl.cxx
@@ -101,6 +101,24 @@ CPPUNIT_TEST_FIXTURE(Test, testCharHiddenInTable)
 // hidden.
 CPPUNIT_ASSERT(bCharHidden);
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testDuplicatedImage)
+{
+// Given a document with 2 images:
+OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"duplicated-image.rtf";
+
+// When importing that document:
+getComponent() = loadFromDesktop(aURL);
+
+// Then make sure no duplicated images are created:
+uno::Reference xTextDocument(getComponent(), 
uno::UNO_QUERY);
+uno::Reference xDrawPage = 
xTextDocument->getDrawPage();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 2
+// - Actual  : 3
+// i.e. there was a 3rd, duplicated image.
+CPPUNIT_ASSERT_EQUAL(static_cast(2), xDrawPage->getCount());
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index ffcef6178a89..04ab247a540e 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1772,9 +1772,11 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer, 
RTFSprms* const pSprms,
 
 // Set current shape during replay, needed by e.g. wrap in
 // backgroun

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

2022-09-13 Thread Miklos Vajna (via logerrit)
 include/vcl/pdfwriter.hxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 01668b41c4140043f8a4fee18d01c0c4d85a5728
Author: Miklos Vajna 
AuthorDate: Tue Sep 13 10:34:55 2022 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 13 15:21:30 2022 +0200

vcl: fix mergelibs build

Seen the breakage at e.g.

.

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

diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 0c2cbb6294dd..cb008fcec280 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -220,7 +220,7 @@ public:
 Error_Signature_Failed,
 };
 
-struct UNLESS_MERGELIBS(VCL_DLLPUBLIC) AnyWidget
+struct VCL_DLLPUBLIC AnyWidget
 {
 WidgetType  Type;   // primitive RTTI
 public:
@@ -291,7 +291,7 @@ public:
 ,TabOrder( rSource.TabOrder )
 {
 }
-AnyWidget& operator=( const AnyWidget& );  // never implemented
+AnyWidget& operator=( const AnyWidget& ) = delete;  // never 
implemented
 };
 
 struct PushButtonWidget final : public AnyWidget
@@ -378,7 +378,7 @@ public:
 // in the group
 };
 
-struct EditWidget final : public AnyWidget
+struct VCL_DLLPUBLIC EditWidget final : public AnyWidget
 {
 boolMultiLine;  // whether multiple lines are allowed
 boolPassword;   // visible echo off


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sdext/source

2022-09-13 Thread Sam James (via logerrit)
 sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 89d2ecd6bc71fc6e581cff595b18ae67a13d8b11
Author: Sam James 
AuthorDate: Fri Sep 2 04:31:18 2022 +0100
Commit: Michael Stahl 
CommitDate: Tue Sep 13 14:11:59 2022 +0200

Fix build with Poppler 22.09.0

With Poppler 22.09.0, LO fails to build with:
```

/var/tmp/portage/app-office/libreoffice-7.3.5.2/work/libreoffice-7.3.5.2/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx:682:36:
 error: too many arguments to function call, expected single argument 'start', 
have 3 arguments
state->getLineDash(&dashArray, &arrayLen, &startOffset);
~~ ^~~
/usr/include/poppler/GfxState.h:1506:32: note: 'getLineDash' declared here
const std::vector &getLineDash(double *start)
   ^
1 error generated.
```

Poppler changed the getLineDash interface:
```
-void getLineDash(double **dash, int *length, double *start)
+const std::vector &getLineDash(double *start)
```

Signed-off-by: Sam James 
Change-Id: I29e18f20d7650a7fcac1bc8ab4aaa04aaa2ab8fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139249
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit b7d63694985bbb1cf86eb71769feadb28ce68c17)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139835

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index f12478cb2f4d..3ad139b65fa3 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -678,8 +678,15 @@ void PDFOutDev::updateLineDash(GfxState *state)
 return;
 assert(state);
 
-double* dashArray; int arrayLen; double startOffset;
+int arrayLen; double startOffset;
+#if POPPLER_CHECK_VERSION(22, 9, 0)
+const std::vector &dash = state->getLineDash(&startOffset);
+const double* dashArray = dash.data();
+arrayLen = dash.size();
+#else
+double* dashArray;
 state->getLineDash(&dashArray, &arrayLen, &startOffset);
+#endif
 
 printf( "updateLineDash" );
 if( arrayLen && dashArray )


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

2022-09-13 Thread Sam James (via logerrit)
 sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 89742b554f567f2567f365d28816e87d690ff78e
Author: Sam James 
AuthorDate: Fri Sep 2 04:31:18 2022 +0100
Commit: Michael Stahl 
CommitDate: Tue Sep 13 14:11:52 2022 +0200

Fix build with Poppler 22.09.0

With Poppler 22.09.0, LO fails to build with:
```

/var/tmp/portage/app-office/libreoffice-7.3.5.2/work/libreoffice-7.3.5.2/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx:682:36:
 error: too many arguments to function call, expected single argument 'start', 
have 3 arguments
state->getLineDash(&dashArray, &arrayLen, &startOffset);
~~ ^~~
/usr/include/poppler/GfxState.h:1506:32: note: 'getLineDash' declared here
const std::vector &getLineDash(double *start)
   ^
1 error generated.
```

Poppler changed the getLineDash interface:
```
-void getLineDash(double **dash, int *length, double *start)
+const std::vector &getLineDash(double *start)
```

Signed-off-by: Sam James 
Change-Id: I29e18f20d7650a7fcac1bc8ab4aaa04aaa2ab8fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139249
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 2c14c5885dae8c6e23e7bdde36a749c9febf62ac)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139834

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index f12478cb2f4d..3ad139b65fa3 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -678,8 +678,15 @@ void PDFOutDev::updateLineDash(GfxState *state)
 return;
 assert(state);
 
-double* dashArray; int arrayLen; double startOffset;
+int arrayLen; double startOffset;
+#if POPPLER_CHECK_VERSION(22, 9, 0)
+const std::vector &dash = state->getLineDash(&startOffset);
+const double* dashArray = dash.data();
+arrayLen = dash.size();
+#else
+double* dashArray;
 state->getLineDash(&dashArray, &arrayLen, &startOffset);
+#endif
 
 printf( "updateLineDash" );
 if( arrayLen && dashArray )


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

2022-09-13 Thread Bjoern Michaelsen (via logerrit)
 sw/source/core/unocore/unoportenum.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 769cefd9c49652f28ba58cd371bc60b9e1bd5bd0
Author: Bjoern Michaelsen 
AuthorDate: Sun Sep 11 17:30:32 2022 +0200
Commit: Michael Stahl 
CommitDate: Tue Sep 13 14:11:00 2022 +0200

tdf#129163: GC cursor table at the end of the life of an portion enumeration

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

diff --git a/sw/source/core/unocore/unoportenum.cxx 
b/sw/source/core/unocore/unoportenum.cxx
index be697524c11c..0e1e95053a3f 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -337,7 +337,11 @@ SwXTextPortionEnumeration::SwXTextPortionEnumeration(
 SwXTextPortionEnumeration::~SwXTextPortionEnumeration()
 {
 SolarMutexGuard aGuard;
-m_pUnoCursor.reset(nullptr);
+if( m_pUnoCursor )
+{
+m_pUnoCursor->GetDoc().cleanupUnoCursorTable();
+m_pUnoCursor.reset(nullptr);
+}
 }
 
 sal_Bool SwXTextPortionEnumeration::hasMoreElements()


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

2022-09-13 Thread Noel Grandin (via logerrit)
 include/svx/unoshape.hxx   |3 
 svx/source/unodraw/unoshap2.cxx|   20 ++--
 sw/inc/unodraw.hxx |   30 +-
 sw/inc/unotxdoc.hxx|4 
 sw/source/core/unocore/unodraw.cxx |  174 +++--
 sw/source/uibase/uno/unotxdoc.cxx  |   11 +-
 6 files changed, 85 insertions(+), 157 deletions(-)

New commits:
commit eae7a05b94fcfdf0ae48adab2006fe0b82c95921
Author: Noel Grandin 
AuthorDate: Tue Sep 13 09:56:15 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 13 13:53:24 2022 +0200

ofz#50767 docxfuzzer: Indirect-leak in rtl_allocateMemory

Two fixes required here

(1) the unnecessary use of aggregation in SwXDrawPage, which leads to a
very confusing cycle that I don't fully follow. No indication why this
is necessary in the git history, has been this way since initial commit

(2) a ref-counting cycle through SvxShapeGroup and SvxDrawPage, use a
weak reference here to break the ref-counting cycle.

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

diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx
index 0eb3ef33101c..862cbb1a0766 100644
--- a/include/svx/unoshape.hxx
+++ b/include/svx/unoshape.hxx
@@ -428,7 +428,8 @@ class SVXCORE_DLLPUBLIC SvxShapeGroup final : public 
SvxShapeGroupAnyD,
   public css::drawing::XShapes2
 {
 private:
-rtl::Reference< SvxDrawPage> mxPage;
+/// using a weak reference to prevent leaks via ref-counting cycles
+unotools::WeakReference< SvxDrawPage> mxWeakPage;
 
 void addUnoShape( const css::uno::Reference< css::drawing::XShape >& 
xShape, size_t nPos );
 void addShape(SvxShape& rShape, size_t nPos);
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index cf72530e6c7d..0315d2a5c74e 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -80,7 +80,7 @@ using namespace ::com::sun::star::container;
 
 SvxShapeGroup::SvxShapeGroup(SdrObject* pObj, SvxDrawPage* pDrawPage)
 : SvxShapeGroupAnyD(pObj, getSvxMapProvider().GetMap(SVXMAP_GROUP), 
getSvxMapProvider().GetPropertySet(SVXMAP_GROUP, 
SdrObject::GetGlobalDrawObjectItemPool()))
-, mxPage(pDrawPage)
+, mxWeakPage(pDrawPage)
 {
 }
 
@@ -91,7 +91,7 @@ SvxShapeGroup::~SvxShapeGroup() noexcept
 void SvxShapeGroup::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage )
 {
 SvxShape::Create( pNewObj, pNewPage );
-mxPage = pNewPage;
+mxWeakPage = pNewPage;
 }
 
 
@@ -185,7 +185,13 @@ void SvxShapeGroup::addShape( SvxShape& rShape )
 
 void SvxShapeGroup::addShape( SvxShape& rShape, size_t nPos )
 {
-if (!HasSdrObject() || !mxPage.is())
+SdrObject* pSdrObject = GetSdrObject();
+if (!pSdrObject)
+{
+return;
+}
+rtl::Reference xPage = mxWeakPage.get();
+if (!xPage)
 {
 OSL_FAIL("could not add XShape to group shape!");
 return;
@@ -193,12 +199,12 @@ void SvxShapeGroup::addShape( SvxShape& rShape, size_t 
nPos )
 
 rtl::Reference pSdrShape = rShape.GetSdrObject();
 if( pSdrShape == nullptr )
-pSdrShape = mxPage->CreateSdrObject_( &rShape );
+pSdrShape = xPage->CreateSdrObject_( &rShape );
 
 if( pSdrShape->IsInserted() )
 pSdrShape->getParentSdrObjListFromSdrObject()->RemoveObject( 
pSdrShape->GetOrdNum() );
 
-GetSdrObject()->GetSubList()->InsertObject(pSdrShape.get(), nPos);
+pSdrObject->GetSubList()->InsertObject(pSdrShape.get(), nPos);
 //  Was created using mpModel in CreateSdrObject_ above
 //  may be good to add an assertion here for the future
 // pSdrShape->SetModel(GetSdrObject()->GetModel());
@@ -214,9 +220,9 @@ void SvxShapeGroup::addShape( SvxShape& rShape, size_t nPos 
)
 // Establish connection between new SdrObject and its wrapper before
 // inserting the new shape into the group.  There a new wrapper
 // would be created when this connection would not already exist.
-rShape.Create( pSdrShape.get(), mxPage.get() );
+rShape.Create( pSdrShape.get(), xPage.get() );
 
-GetSdrObject()->getSdrModelFromSdrObject().SetChanged();
+pSdrObject->getSdrModelFromSdrObject().SetChanged();
 }
 
 // XShapes
diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index e252499f0453..d7a768317bbf 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -30,7 +30,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -40,12 +39,18 @@ class SdrView;
 class SwDoc;
 class SwXShape;
 
-class SwFmDrawPage final : public SvxFmDrawPage
+typedef cppu::ImplInheritanceHelper
+<
+SvxFmDrawPage,
+css::container::XEnumerationAccess
+> SwFmDrawPage_Base;
+class SwFmDrawPage final : public SwFmDrawPage_Base
 {
+SwDoc*  m_pDoc;
 SdrPageView*m_pPageView;
 std::vector> m_vShape

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

2022-09-13 Thread Samuel Mehrbrodt (via logerrit)
 sw/qa/extras/rtfexport/rtfexport5.cxx  |   16 +---
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   12 
 2 files changed, 13 insertions(+), 15 deletions(-)

New commits:
commit f2c4ecbd38a274ca36db21a61ef7712b3db8ca87
Author: Samuel Mehrbrodt 
AuthorDate: Mon Sep 12 13:39:40 2022 +0200
Commit: Michael Stahl 
CommitDate: Tue Sep 13 13:43:02 2022 +0200

tdf#150267 Import docvar value correctly

Change-Id: I388923e3f7bea35c1247f47812c158f5ab92fc0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139793
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
(cherry picked from commit bae62d8792d1ce31408ae101eeb305c302037849)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139667
Reviewed-by: Michael Stahl 

diff --git a/sw/qa/extras/rtfexport/rtfexport5.cxx 
b/sw/qa/extras/rtfexport/rtfexport5.cxx
index 59390a6fb5e0..2b7f37fc1a8b 100644
--- a/sw/qa/extras/rtfexport/rtfexport5.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport5.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -840,18 +841,11 @@ DECLARE_RTFEXPORT_TEST(testTdf150267, "tdf150267.rtf")
 uno::Reference xModel(mxComponent, uno::UNO_QUERY);
 uno::Reference xSupplier(xModel, 
uno::UNO_QUERY);
 uno::Reference xTextFieldMasters = 
xSupplier->getTextFieldMasters();
-uno::Sequence aMasterNames = 
xTextFieldMasters->getElementNames();
-bool bHasUnusedField = false;
-for (const auto& rMasterName : std::as_const(aMasterNames))
-{
-if (rMasterName == "com.sun.star.text.fieldmaster.User.Unused")
-{
-bHasUnusedField = true;
-break;
-}
-}
+CPPUNIT_ASSERT_EQUAL(sal_True,
+ 
xTextFieldMasters->hasByName("com.sun.star.text.fieldmaster.User.Unused"));
 
-CPPUNIT_ASSERT_EQUAL(true, bHasUnusedField);
+auto xFieldMaster = 
xTextFieldMasters->getByName("com.sun.star.text.fieldmaster.User.Unused");
+CPPUNIT_ASSERT_EQUAL(OUString("Hello World"), 
getProperty(xFieldMaster, "Content"));
 }
 
 DECLARE_RTFEXPORT_TEST(testTdf108416, "tdf108416.rtf")
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 5effc8d81bbf..ffcef6178a89 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -17,6 +17,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -3483,12 +3484,15 @@ void RTFDocumentImpl::afterPopState(RTFParserState& 
rState)
 }
 else
 {
-uno::Reference xMasterProperties(
+uno::Reference xMaster(
 
m_xModelFactory->createInstance("com.sun.star.text.FieldMaster.User"),
 uno::UNO_QUERY_THROW);
-xMasterProperties->setPropertyValue("Name",
-
uno::Any(m_aStates.top().getDocVarName()));
-xMasterProperties->setPropertyValue("Value", 
uno::Any(docvar));
+xMaster->setPropertyValue("Name", 
uno::Any(m_aStates.top().getDocVarName()));
+uno::Reference xField(
+
m_xModelFactory->createInstance("com.sun.star.text.TextField.User"),
+uno::UNO_QUERY);
+xField->attachTextFieldMaster(xMaster);
+xField->getTextFieldMaster()->setPropertyValue("Content", 
uno::Any(docvar));
 
 m_aStates.top().clearDocVarName();
 }


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - comphelper/source include/comphelper reportdesign/source

2022-09-13 Thread Julien Nabet (via logerrit)
 comphelper/source/misc/SelectionMultiplex.cxx |9 +
 include/comphelper/SelectionMultiplex.hxx |2 ++
 reportdesign/source/ui/dlg/Navigator.cxx  |1 +
 3 files changed, 12 insertions(+)

New commits:
commit a152b1fe7fc3056ff6444321a1cdf8c24b8c8a2f
Author: Julien Nabet 
AuthorDate: Wed Aug 24 16:42:54 2022 +0200
Commit: Michael Stahl 
CommitDate: Tue Sep 13 13:39:33 2022 +0200

tdf#150575: REPORTBUILDER: Crash when closing report when used report 
navigator

0  0x7fe062bdda64 in 
comphelper::OSelectionChangeMultiplexer::disposing(com::sun::star::lang::EventObject
 const&) (this=0x55fe72b7b680, _rSource=...) at 
comphelper/source/misc/SelectionMultiplex.cxx:82
1  0x7fdf90a97a6b in 
comphelper::OInterfaceContainerHelper3::disposeAndClear(com::sun::star::lang::EventObject
 const&) (this=0x55fe6c94b6d0, rEvt=...)
at include/comphelper/interfacecontainer3.hxx:362
2  0x7fdf90a6ace4 in rptui::OReportController::disposing() 
(this=0x55fe6c94b200) at reportdesign/source/ui/report/ReportController.cxx:341
3  0x7fe062539b5d in cppu::WeakComponentImplHelperBase::dispose() 
(this=0x55fe6c94b200) at cppuhelper/source/implbase.cxx:104
4  0x7fe0393b76e5 in 
cppu::PartialWeakComponentImplHelper::dispose() (this=0x55fe6c94b200) 
at include/cppuhelper/compbase.hxx:90
5  0x7fe0393af9d3 in dbaui::OGenericUnoController::dispose() 
(this=0x55fe6c94b200) at dbaccess/source/ui/browser/genericcontroller.cxx:1207

See full bt here:
https://bugs.documentfoundation.org/attachment.cgi?id=181994

"addSelectionChangeListener" is called when "OSelectionChangeMultiplexer" 
is instantiated in "NavigatorTree" ctr
225 m_pSelectionListener = new 
OSelectionChangeMultiplexer(this,&m_rController);

but "removeSelectionChangeListener" was never called so add the mechanism 
to call it.

Change-Id: I157b147f7a17244dbbfa7d12743fc7d48e7d5f7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138773
Reviewed-by: Julien Nabet 
(cherry picked from commit fb8c86d95a7d1c68b6dc0f5bb2e00db2f40f58ab)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138551
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 41d1e848677891d1451b2120763c7c069006b4a5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138832
Reviewed-by: Michael Stahl 

diff --git a/comphelper/source/misc/SelectionMultiplex.cxx 
b/comphelper/source/misc/SelectionMultiplex.cxx
index 267266388c71..e4fb824a0ba3 100644
--- a/comphelper/source/misc/SelectionMultiplex.cxx
+++ b/comphelper/source/misc/SelectionMultiplex.cxx
@@ -95,7 +95,16 @@ void SAL_CALL OSelectionChangeMultiplexer::selectionChanged( 
const  EventObject&
 m_pListener->_selectionChanged(_rEvent);
 }
 
+void OSelectionChangeMultiplexer::dispose()
+{
+osl_atomic_increment(&m_refCount);
+{
+Reference< XSelectionChangeListener> xPreventDelete(this);
+m_xSet->removeSelectionChangeListener(xPreventDelete);
+}
+osl_atomic_decrement(&m_refCount);
 }
 
+}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/SelectionMultiplex.hxx 
b/include/comphelper/SelectionMultiplex.hxx
index 00ba7f955b09..328a96e9370a 100644
--- a/include/comphelper/SelectionMultiplex.hxx
+++ b/include/comphelper/SelectionMultiplex.hxx
@@ -81,6 +81,8 @@ namespace comphelper
 voidunlock();
 /// get the lock count
 sal_Int32   locked() const { return m_nLockCount; }
+
+void dispose();
 };
 
 
diff --git a/reportdesign/source/ui/dlg/Navigator.cxx 
b/reportdesign/source/ui/dlg/Navigator.cxx
index 939a6abc8236..d6a5ac60059d 100644
--- a/reportdesign/source/ui/dlg/Navigator.cxx
+++ b/reportdesign/source/ui/dlg/Navigator.cxx
@@ -238,6 +238,7 @@ NavigatorTree::~NavigatorTree()
 delete pData;
 return false;
 });
+m_pSelectionListener->dispose();
 m_pReportListener->dispose();
 }
 


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

2022-09-13 Thread Eike Rathke (via logerrit)
 unotools/source/i18n/charclass.cxx |   19 +--
 1 file changed, 17 insertions(+), 2 deletions(-)

New commits:
commit c0d09eb46665a0b2ab86f263cc95662f406d83d2
Author: Eike Rathke 
AuthorDate: Tue Sep 13 11:04:20 2022 +0200
Commit: Eike Rathke 
CommitDate: Tue Sep 13 12:37:12 2022 +0200

Empty string has no characters of any type

Change-Id: Id7244032d52360d2b0ea57fba023dff162a29d95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139831
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 

diff --git a/unotools/source/i18n/charclass.cxx 
b/unotools/source/i18n/charclass.cxx
index 4573687c4d29..be3a9f4f0ee0 100644
--- a/unotools/source/i18n/charclass.cxx
+++ b/unotools/source/i18n/charclass.cxx
@@ -132,6 +132,9 @@ bool CharClass::isLetter( const OUString& rStr, sal_Int32 
nPos ) const
 
 bool CharClass::isLetter( const OUString& rStr ) const
 {
+if (rStr.isEmpty())
+return false;
+
 try
 {
 sal_Int32 nPos = 0;
@@ -170,6 +173,9 @@ bool CharClass::isDigit( const OUString& rStr, sal_Int32 
nPos ) const
 
 bool CharClass::isNumeric( const OUString& rStr ) const
 {
+if (rStr.isEmpty())
+return false;
+
 try
 {
 sal_Int32 nPos = 0;
@@ -226,6 +232,9 @@ bool CharClass::isLetterNumeric( const OUString& rStr, 
sal_Int32 nPos ) const
 
 bool CharClass::isLetterNumeric( const OUString& rStr ) const
 {
+if (rStr.isEmpty())
+return false;
+
 try
 {
 sal_Int32 nPos = 0;
@@ -264,10 +273,16 @@ bool CharClass::isUpper( const OUString& rStr, sal_Int32 
nPos ) const
 
 bool CharClass::isUpper( const OUString& rStr, sal_Int32 nPos, sal_Int32 
nCount ) const
 {
+if (rStr.isEmpty())
+return false;
+
+assert(nPos >= 0 && nPos < rStr.getLength() && nCount > 0);
+if (nPos < 0 || nPos >= rStr.getLength() || nCount == 0)
+return false;
+
 try
 {
-assert(nPos >= 0 && nCount >= 0);
-sal_Int32 nLen = std::min( nPos + nCount, rStr.getLength());
+const sal_Int32 nLen = std::min( nPos + nCount, rStr.getLength());
 while (nPos < nLen)
 {
 if (!isUpper( rStr, nPos))


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

2022-09-13 Thread Sam James (via logerrit)
 sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit b7d63694985bbb1cf86eb71769feadb28ce68c17
Author: Sam James 
AuthorDate: Fri Sep 2 04:31:18 2022 +0100
Commit: Michael Stahl 
CommitDate: Tue Sep 13 12:32:58 2022 +0200

Fix build with Poppler 22.09.0

With Poppler 22.09.0, LO fails to build with:
```

/var/tmp/portage/app-office/libreoffice-7.3.5.2/work/libreoffice-7.3.5.2/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx:682:36:
 error: too many arguments to function call, expected single argument 'start', 
have 3 arguments
state->getLineDash(&dashArray, &arrayLen, &startOffset);
~~ ^~~
/usr/include/poppler/GfxState.h:1506:32: note: 'getLineDash' declared here
const std::vector &getLineDash(double *start)
   ^
1 error generated.
```

Poppler changed the getLineDash interface:
```
-void getLineDash(double **dash, int *length, double *start)
+const std::vector &getLineDash(double *start)
```

Signed-off-by: Sam James 
Change-Id: I29e18f20d7650a7fcac1bc8ab4aaa04aaa2ab8fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139249
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 
b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index f12478cb2f4d..3ad139b65fa3 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -678,8 +678,15 @@ void PDFOutDev::updateLineDash(GfxState *state)
 return;
 assert(state);
 
-double* dashArray; int arrayLen; double startOffset;
+int arrayLen; double startOffset;
+#if POPPLER_CHECK_VERSION(22, 9, 0)
+const std::vector &dash = state->getLineDash(&startOffset);
+const double* dashArray = dash.data();
+arrayLen = dash.size();
+#else
+double* dashArray;
 state->getLineDash(&dashArray, &arrayLen, &startOffset);
+#endif
 
 printf( "updateLineDash" );
 if( arrayLen && dashArray )


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

2022-09-13 Thread Henry Castro (via logerrit)
 sw/source/uibase/uiview/formatclipboard.cxx |   10 ++
 1 file changed, 10 insertions(+)

New commits:
commit 576ba26d09448f8bc332acdf6d17061e8ad552a3
Author: Henry Castro 
AuthorDate: Thu Aug 25 11:56:16 2022 -0400
Commit: Gökay ŞATIR 
CommitDate: Tue Sep 13 11:25:19 2022 +0200

sw: fix format brush to reset the font strikeout attribute

The format brush always inserts attributes to a set,
it should be intersected. For a special use case,
ugly hack to reset the font strikeout attribute.

Signed-off-by: Henry Castro 
Change-Id: I94c172e61b3d6d3339b1243a9344952b5c59d872
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138839
Tested-by: Jenkins
Reviewed-by: Gökay ŞATIR 

diff --git a/sw/source/uibase/uiview/formatclipboard.cxx 
b/sw/source/uibase/uiview/formatclipboard.cxx
index b8c5023eac0d..bcafb0bd3ce6 100644
--- a/sw/source/uibase/uiview/formatclipboard.cxx
+++ b/sw/source/uibase/uiview/formatclipboard.cxx
@@ -543,7 +543,17 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, 
SfxStyleSheetBasePool* pPo
 if( nSelectionType & (SelectionType::Frame | 
SelectionType::Ole | SelectionType::Graphic) )
 rWrtShell.SetFlyFrameAttr(*pTemplateItemSet);
 else if ( !bNoCharacterFormats )
+{
+const SfxPoolItem* pItem;
+SfxItemSetFixed aSet(rWrtShell.GetAttrPool());
+rWrtShell.GetCurAttr(aSet);
+if (!pTemplateItemSet->HasItem(RES_CHRATR_CROSSEDOUT, 
&pItem))
+{
+rWrtShell.ResetAttr({ RES_CHRATR_CROSSEDOUT });
+}
+
 rWrtShell.SetAttrSet(*pTemplateItemSet);
+}
 }
 }
 }


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

2022-09-13 Thread Xisco Fauli (via logerrit)
 sc/qa/unit/uicalc/data/tdf150766.ods |binary
 sc/qa/unit/uicalc/uicalc.cxx |   25 +
 2 files changed, 25 insertions(+)

New commits:
commit 907ba54b0d557b89e7e0e6f6eb25470e743c1918
Author: Xisco Fauli 
AuthorDate: Mon Sep 12 11:05:31 2022 +0200
Commit: Xisco Fauli 
CommitDate: Tue Sep 13 11:13:05 2022 +0200

tdf#150766: sc_uicalc: Add unittest

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

diff --git a/sc/qa/unit/uicalc/data/tdf150766.ods 
b/sc/qa/unit/uicalc/data/tdf150766.ods
new file mode 100644
index ..64088d19d040
Binary files /dev/null and b/sc/qa/unit/uicalc/data/tdf150766.ods differ
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index bd175ec1bde5..710ea1d1013f 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -3024,6 +3024,31 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf107952)
 lcl_AssertCurrentCursorPosition(*pDoc, "B1");
 }
 
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf150766)
+{
+ScModelObj* pModelObj = createDoc("tdf150766.ods");
+ScDocument* pDoc = pModelObj->GetDocument();
+CPPUNIT_ASSERT(pDoc);
+
+goToCell("A3:C6");
+
+dispatchCommand(mxComponent, ".uno:SortDescending", {});
+
+insertStringToCell(*pModelObj, "B3", "10");
+
+CPPUNIT_ASSERT_EQUAL(12.0, pDoc->GetValue(ScAddress(2, 2, 0)));
+CPPUNIT_ASSERT_EQUAL(13.0, pDoc->GetValue(ScAddress(2, 3, 0)));
+CPPUNIT_ASSERT_EQUAL(14.0, pDoc->GetValue(ScAddress(2, 4, 0)));
+CPPUNIT_ASSERT_EQUAL(15.0, pDoc->GetValue(ScAddress(2, 5, 0)));
+
+// Without the fix in place, this test would have failed with
+// - Expected: 16
+// - Actual  : 7
+CPPUNIT_ASSERT_EQUAL(16.0, pDoc->GetValue(ScAddress(2, 6, 0)));
+CPPUNIT_ASSERT_EQUAL(17.0, pDoc->GetValue(ScAddress(2, 7, 0)));
+CPPUNIT_ASSERT_EQUAL(18.0, pDoc->GetValue(ScAddress(2, 8, 0)));
+}
+
 CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf144022)
 {
 ScModelObj* pModelObj = createDoc("tdf144022.ods");


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

2022-09-13 Thread Miklos Vajna (via logerrit)
 include/vcl/pdfwriter.hxx |6 -
 sw/inc/formatcontentcontrol.hxx   |2 
 sw/qa/core/text/text.cxx  |   33 +
 sw/source/core/text/itrform2.cxx  |   89 +-
 sw/source/core/txtnode/attrcontentcontrol.cxx |   30 
 5 files changed, 155 insertions(+), 5 deletions(-)

New commits:
commit b6496ce5718e90110a6a73d49e66a3969f8b6474
Author: Miklos Vajna 
AuthorDate: Mon Sep 12 09:30:38 2022 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 13 10:26:26 2022 +0200

sw content controls, rich text: add initial PDF export

Similar to how such form widgets are emitted for form shapes in

drawinglayer::processor2d::VclMetafileProcessor2D::processControlPrimitive2D().

This is just initial support for rich and plain text, the other types
from SwContentControlType are not yet handled.

(cherry picked from commit 82d90529dc2b3cb8359dec78852cbd910a66d275)

Conflicts:
sw/qa/core/text/text.cxx

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

diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 822b6870c89c..be15738fbd5d 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -215,7 +215,7 @@ public:
 Error_Signature_Failed,
 };
 
-struct UNLESS_MERGELIBS(VCL_DLLPUBLIC) AnyWidget
+struct VCL_DLLPUBLIC AnyWidget
 {
 WidgetType  Type;   // primitive RTTI
 public:
@@ -286,7 +286,7 @@ public:
 ,TabOrder( rSource.TabOrder )
 {
 }
-AnyWidget& operator=( const AnyWidget& );  // never implemented
+AnyWidget& operator=( const AnyWidget& ) = delete;  // never 
implemented
 };
 
 struct PushButtonWidget final : public AnyWidget
@@ -373,7 +373,7 @@ public:
 // in the group
 };
 
-struct EditWidget final : public AnyWidget
+struct VCL_DLLPUBLIC EditWidget final : public AnyWidget
 {
 boolMultiLine;  // whether multiple lines are allowed
 boolPassword;   // visible echo off
diff --git a/sw/inc/formatcontentcontrol.hxx b/sw/inc/formatcontentcontrol.hxx
index 6c1dffd240ae..d0c56b6ae326 100644
--- a/sw/inc/formatcontentcontrol.hxx
+++ b/sw/inc/formatcontentcontrol.hxx
@@ -319,6 +319,8 @@ public:
 void SetReadWrite(bool bReadWrite) { m_bReadWrite = bReadWrite; }
 
 bool GetReadWrite() const { return m_bReadWrite; }
+
+SwContentControlType GetType() const;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index a571ced2f289..ce1dab48f0cb 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 
 constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/text/data/";
 
@@ -534,6 +535,38 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testRedlineDelete)
  
pDoc->getIDocumentRedlineAccess().GetRedlineTable().size());
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testContentControlPDF)
+{
+// Given a file with a content control:
+SwDoc* pDoc = createSwDoc();
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+pWrtShell->InsertContentControl(SwContentControlType::RICH_TEXT);
+
+// When exporting to PDF:
+uno::Reference xStorable(mxComponent, uno::UNO_QUERY);
+utl::MediaDescriptor aMediaDescriptor;
+aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export");
+xStorable->storeToURL(maTempFile.GetURL(), 
aMediaDescriptor.getAsConstPropertyValueList());
+
+// Then make sure that a fillable form widget is emitted:
+SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
+SvMemoryStream aMemory;
+aMemory.WriteStream(aFile);
+std::shared_ptr pPDFium = vcl::pdf::PDFiumLibrary::get();
+if (!pPDFium)
+{
+return;
+}
+std::unique_ptr pPdfDocument
+= pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize(), 
OString());
+std::unique_ptr pPage = pPdfDocument->openPage(0);
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: 1
+// - Actual  : 0
+// i.e. the content control was just exported as normal text.
+CPPUNIT_ASSERT_EQUAL(1, pPage->getAnnotationCount());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 50fdf3f6acf5..1828967f8481 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -55,8 +55,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -866,9 +868,13 @@ public:
 /// A conten

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

2022-09-13 Thread Eike Rathke (via logerrit)
 include/unotools/charclass.hxx |   25 ++-
 linguistic/source/misc.cxx |4 -
 unotools/source/i18n/charclass.cxx |   83 -
 3 files changed, 80 insertions(+), 32 deletions(-)

New commits:
commit ab0adac692b67fe7b63dee665607400c6a7e6c01
Author: Eike Rathke 
AuthorDate: Mon Sep 12 17:14:24 2022 +0200
Commit: Eike Rathke 
CommitDate: Tue Sep 13 10:25:17 2022 +0200

Fix everything using XCharacterClassification::getStringType() and don't 
use it

See note in offapi/com/sun/star/i18n/XCharacterClassification.idl

The brain dead implementation is useless but API ... its use in
isAlphaNumericType() and similar never returned what would had
been expected.

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

diff --git a/include/unotools/charclass.hxx b/include/unotools/charclass.hxx
index c76c7ae35f0b..7cb35ba2a594 100644
--- a/include/unotools/charclass.hxx
+++ b/include/unotools/charclass.hxx
@@ -31,28 +31,29 @@
 namespace com::sun::star::uno { class XComponentContext; }
 namespace com::sun::star::i18n { class XCharacterClassification; }
 
-const sal_Int32 nCharClassAlphaType =
+inline constexpr sal_Int32 nCharClassAlphaType =
 css::i18n::KCharacterType::UPPER |
 css::i18n::KCharacterType::LOWER |
 css::i18n::KCharacterType::TITLE_CASE;
 
-const sal_Int32 nCharClassAlphaTypeMask =
+inline constexpr sal_Int32 nCharClassAlphaTypeMask =
 nCharClassAlphaType |
+css::i18n::KCharacterType::LETTER | // Alpha is also always a LETTER
 css::i18n::KCharacterType::PRINTABLE |
 css::i18n::KCharacterType::BASE_FORM;
 
-const sal_Int32 nCharClassLetterType =
+inline constexpr sal_Int32 nCharClassLetterType =
 nCharClassAlphaType |
 css::i18n::KCharacterType::LETTER;
 
-const sal_Int32 nCharClassLetterTypeMask =
+inline constexpr sal_Int32 nCharClassLetterTypeMask =
 nCharClassAlphaTypeMask |
 css::i18n::KCharacterType::LETTER;
 
-const sal_Int32 nCharClassNumericType =
+inline constexpr sal_Int32 nCharClassNumericType =
 css::i18n::KCharacterType::DIGIT;
 
-const sal_Int32 nCharClassNumericTypeMask =
+inline constexpr sal_Int32 nCharClassNumericTypeMask =
 nCharClassNumericType |
 css::i18n::KCharacterType::PRINTABLE |
 css::i18n::KCharacterType::BASE_FORM;
@@ -86,14 +87,14 @@ public:
 /// isalpha() on ascii values of entire string
 static bool isAsciiAlpha( std::u16string_view rStr );
 
-/// whether type is pure numeric or not, e.g. return of getStringType
+/// whether type is pure numeric or not, e.g. return of getCharacterType()
 static bool isNumericType( sal_Int32 nType )
 {
 return ((nType & nCharClassNumericType) != 0) &&
 ((nType & ~nCharClassNumericTypeMask) == 0);
 }
 
-/// whether type is pure alphanumeric or not, e.g. return of getStringType
+/// whether type is pure alphanumeric or not, e.g. return of 
getCharacterType()
 static bool isAlphaNumericType( sal_Int32 nType )
 {
 return ((nType & (nCharClassAlphaType |
@@ -102,14 +103,14 @@ public:
 nCharClassNumericTypeMask)) == 0);
 }
 
-/// whether type is pure letter or not, e.g. return of getStringType
+/// whether type is pure letter or not, e.g. return of getCharacterType()
 static bool isLetterType( sal_Int32 nType )
 {
 return ((nType & nCharClassLetterType) != 0) &&
 ((nType & ~nCharClassLetterTypeMask) == 0);
 }
 
-/// whether type is pure letternumeric or not, e.g. return of getStringType
+/// whether type is pure letternumeric or not, e.g. return of 
getCharacterType()
 static bool isLetterNumericType( sal_Int32 nType )
 {
 return ((nType & (nCharClassLetterType |
@@ -141,7 +142,6 @@ public:
 css::i18n::DirectionProperty getCharacterDirection( const OUString& rStr, 
sal_Int32 nPos ) const;
 css::i18n::UnicodeScript getScript( const OUString& rStr, sal_Int32 nPos ) 
const;
 sal_Int32 getCharacterType( const OUString& rStr, sal_Int32 nPos ) const;
-sal_Int32 getStringType( const OUString& rStr, sal_Int32 nPos, sal_Int32 
nCount ) const;
 
 css::i18n::ParseResult parseAnyToken(
 const OUString& rStr,
@@ -167,10 +167,13 @@ public:
 bool isDigit( const OUString& rStr, sal_Int32 nPos ) const;
 bool isAlphaNumeric( const OUString& rStr, sal_Int32 nPos ) const;
 bool isLetterNumeric( const OUString& rStr, sal_Int32 nPos ) const;
+bool isUpper( const OUString& rStr, sal_Int32 nPos ) const;
 bool isLetter( const OUString& rStr ) const;
 bool isNumeric( const OUString& rStr ) const;
 bool isLetterNumeric( const OUString& rStr ) const;
 
+bool isUpper( const OUString& rStr, sal_Int32 nPos, sal_Int32 nCount ) 
const;
+
 private:
 
 const css::lang::

[Libreoffice-commits] core.git: sal/osl

2022-09-13 Thread Caolán McNamara (via logerrit)
 sal/osl/unx/security.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit f0f0d385b91df30d4ec42a9f727cbdbe5ce0861f
Author: Caolán McNamara 
AuthorDate: Wed Sep 7 17:08:38 2022 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 13 09:56:12 2022 +0200

cid#1509232 silence Out-of-bounds access

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

diff --git a/sal/osl/unx/security.cxx b/sal/osl/unx/security.cxx
index 1b1f16a54edc..b15ec9e773b0 100644
--- a/sal/osl/unx/security.cxx
+++ b/sal/osl/unx/security.cxx
@@ -106,6 +106,8 @@ static oslSecurityImpl * growSecurityImpl(
 }
 p = static_cast(realloc(impl, n));
 if (p != nullptr) {
+// coverity[overrun-buffer-arg] - theoretically massive n is not 
due to
+// a negative parameter being interpreted as unsigned
 memset (p, 0, n);
 }
 }


[Libreoffice-commits] core.git: configure.ac

2022-09-13 Thread Tor Lillqvist (via logerrit)
 configure.ac |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2a5eed7d10c378f29e4de74934aff4c78fccbda6
Author: Tor Lillqvist 
AuthorDate: Tue Sep 13 09:14:16 2022 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Sep 13 09:10:25 2022 +0200

Bump current iOS SDK to 16.0

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

diff --git a/configure.ac b/configure.ac
index 067dbae1292e..0033ddc1b836 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3656,8 +3656,8 @@ dnl 
===
 
 if test $_os = iOS; then
 AC_MSG_CHECKING([what iOS SDK to use])
-current_sdk_ver=15.6
-older_sdk_vers="15.5 15.4 15.2 15.0 14.5"
+current_sdk_ver=16.0
+older_sdk_vers="15.6 15.5 15.4 15.2 15.0 14.5"
 if test "$enable_ios_simulator" = "yes"; then
 platform=iPhoneSimulator
 versionmin=-mios-simulator-version-min=13.6


[Libreoffice-commits] core.git: 2 commits - sc/source solenv/clang-format

2022-09-13 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/op_financial.cxx   |2 
 sc/source/core/opencl/op_financial_helpers.hxx   |  245 +-
 sc/source/core/opencl/op_math.cxx| 2429 ++-
 sc/source/core/opencl/op_math.hxx|  351 +--
 sc/source/core/opencl/op_math_helpers.hxx|   39 
 sc/source/core/opencl/op_statistical.cxx |2 
 sc/source/core/opencl/op_statistical_helpers.hxx |  153 -
 sc/source/core/opencl/opbase.cxx |9 
 sc/source/core/opencl/opbase.hxx |4 
 sc/source/core/opencl/utils.hxx  |5 
 solenv/clang-format/excludelist  |6 
 11 files changed, 1066 insertions(+), 2179 deletions(-)

New commits:
commit aa0d6cb52979e29830596ec5a4e8e625500d6cb9
Author: Luboš Luňák 
AuthorDate: Tue Sep 6 12:38:00 2022 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 13 09:05:34 2022 +0200

clean up opencl helper functions

It seems a bit wasteful to use std::string for const strings.

Change-Id: I31bb38f5cdcd0210f6f91144b3c37abae9301333
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139487
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/opencl/op_financial.cxx 
b/sc/source/core/opencl/op_financial.cxx
index 0840c334f7df..863fa2552cab 100644
--- a/sc/source/core/opencl/op_financial.cxx
+++ b/sc/source/core/opencl/op_financial.cxx
@@ -16,7 +16,7 @@ using namespace formula;
 
 namespace sc::opencl {
 // Definitions of inline functions
-#include "opinlinefun_finacial.cxx"
+#include "op_financial_helpers.hxx"
 
 void RRI::GenSlidingWindowFunction(
 outputstream &ss, const std::string &sSymName, SubArguments &vSubArguments)
diff --git a/sc/source/core/opencl/opinlinefun_finacial.cxx 
b/sc/source/core/opencl/op_financial_helpers.hxx
similarity index 94%
rename from sc/source/core/opencl/opinlinefun_finacial.cxx
rename to sc/source/core/opencl/op_financial_helpers.hxx
index dd12767cf93a..eaf688af91c1 100644
--- a/sc/source/core/opencl/opinlinefun_finacial.cxx
+++ b/sc/source/core/opencl/op_financial_helpers.hxx
@@ -7,19 +7,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef SC_OPENCL_OPINLINFUN_finacial
-#define SC_OPENCL_OPINLINFUN_finacial
+#pragma once
 
-std::string nCorrValDecl ="double constant nCorrVal[]"
+const char nCorrValDecl[] ="double constant nCorrVal[]"
 "= {0, 9e-1, 9e-2, 9e-3, 9e-4, 9e-5, 9e-6, 9e-7, "
 "9e-8,9e-9, 9e-10, 9e-11, 9e-12, 9e-13, 9e-14, 9e-15};\n";
 
-std::string SCdEpsilonDecl =
+const char SCdEpsilonDecl[] =
 "constant double SCdEpsilon = 1.0E-7;\n";
 
-std::string RoundDecl = "double  Round(double fValue);\n";
+const char RoundDecl[] = "double  Round(double fValue);\n";
 
-std::string Round =
+const char Round[] =
 "double  Round(double fValue)\n"
 "{\n"
 "if ( fValue == 0.0  )\n"
@@ -40,10 +39,10 @@ std::string Round =
 "return fValue;\n"
 "}\n";
 
-std::string GetPMT_newDecl =
+const char GetPMT_newDecl[] =
 "double GetPMT_new( double fRate, double fNper, double fPv, double fFv,"
 "int nPayType );\n";
-std::string GetPMT_new=
+const char GetPMT_new[] =
 "double GetPMT_new( double fRate, double fNper, double fPv, double fFv,"
 "int nPayType)\n"
 "{\n"
@@ -57,11 +56,11 @@ std::string GetPMT_new=
 "1.0 - 1.0 / fTerm);\n"
 "return -fPmt;\n"
 "}\n";
-std::string GetFVDecl =
+const char GetFVDecl[] =
 "double GetFV( double fRate, double fNper, double fPmt,"
 "double fPv, int nPayType );\n";
 
-std::string GetFV =
+const char GetFV[] =
 "double GetFV( double fRate, double fNper, double fPmt,"
 "double fPv, int nPayType )\n"
 "{\n"
@@ -80,11 +79,11 @@ std::string GetFV =
 "return -fFv;\n"
 "}\n";
 
-std::string GetFV_newDecl =
+const char GetFV_newDecl[] =
 "double GetFV_new( double fRate, double fNper, double fPmt,"
 "double fPv, int nPayType );\n";
 
-std::string GetFV_new =
+const char GetFV_new[] =
 "double GetFV_new( double fRate, double fNper, double fPmt,"
 "double fPv, int nPayType )\n"
 "{\n"
@@ -98,20 +97,20 @@ std::string GetFV_new =
 "return -fFv;\n"
 "}\n";
 
-std::string IsLeapYearDecl =
+const char IsLeapYearDecl[] =
 "bool IsLeapYear( int n );\n";
 
-std::string IsLeapYear =
+const char IsLeapYear[] =
 "bool IsLeapYear( int n )\n"
 "{\n"
 "return ( (( ( n % 4 ) == 0 ) && ( ( n % 100 ) != 0)) || ( ( n % 400 ) == "
 "0 ) );\n"
 "}\n";
 
-std::string DaysInMonthDecl=
+const char DaysInMonthDecl[] =
 "int DaysInMonth( int nMonth, int nYear );\n";
 
-std::string DaysInMonth =
+const char DaysInMonth[] =
 "int DaysInMonth( int nMonth, int nYear )\n"
 "{\n"
 "int aDaysInMonth[12] = { 31, 28, 31, 30, 31, 30,\n"
@@ -127,10 +126,10 @@ std::string DaysInMonth =
 "return aDaysInMonth[nMonth-1];\n"
 "}\n"
 "}\n";
-std::string DaysInMonth_newDecl=
+const char DaysInMonth_newDecl[] =
 "int DaysInMonth( int nMonth, int nYear );\n";
 
-std::string DaysInMonth_new =
+const char DaysInMonth_new[] =
 "int DaysInMonth( int nMonth, in

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

2022-09-13 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/formulagroupcl.cxx |   32 -
 sc/source/core/opencl/op_addin.cxx   |  124 -
 sc/source/core/opencl/op_array.cxx   |   33 -
 sc/source/core/opencl/op_database.cxx|  121 -
 sc/source/core/opencl/op_financial.cxx   |  586 -
 sc/source/core/opencl/op_logical.cxx |  346 +-
 sc/source/core/opencl/op_logical.hxx |   34 -
 sc/source/core/opencl/op_math.cxx|  657 
 sc/source/core/opencl/op_spreadsheet.cxx |   11 
 sc/source/core/opencl/op_statistical.cxx |  724 +--
 sc/source/core/opencl/opbase.cxx |   45 +
 sc/source/core/opencl/opbase.hxx |6 
 12 files changed, 466 insertions(+), 2253 deletions(-)

New commits:
commit 7ed959dfe96f3a4edc0ee00f23473aac28734e1f
Author: Luboš Luňák 
AuthorDate: Tue Sep 6 12:37:50 2022 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 13 09:05:06 2022 +0200

reduce opencl copy&paste in op_addin.cxx and op_logical.cxx

The svDoubleVectorRef stuff in OpAnd etc. didn't make sense, those
operators are required to do implicit intersection (which can be done
in sc core in ScCompiler::HandleIIOpCodeInternal()).

Change-Id: Ic970c8e649a651f6a804b5ed265fe2e08ff29681
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139485
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/opencl/op_addin.cxx 
b/sc/source/core/opencl/op_addin.cxx
index a9c2f9508ac8..602ed2dfb36d 100644
--- a/sc/source/core/opencl/op_addin.cxx
+++ b/sc/source/core/opencl/op_addin.cxx
@@ -23,69 +23,8 @@ void OpBesselj::GenSlidingWindowFunction(outputstream &ss,
 GenerateFunctionDeclaration( sSymName, vSubArguments, ss );
 ss << "{\n";
 ss << "int gid0 = get_global_id(0);\n";
-ss << "double x = 0.0;\n";
-ss << "double N = 0.0;\n";
-FormulaToken *tmpCur0 = vSubArguments[0]->GetFormulaToken();
-assert(tmpCur0);
-if(ocPush == vSubArguments[0]->GetFormulaToken()->GetOpCode())
-{
-if(tmpCur0->GetType() == formula::svSingleVectorRef)
-{
-const formula::SingleVectorRefToken*tmpCurSVR0 =
-static_cast(tmpCur0);
-ss << "if (gid0 < " << tmpCurSVR0->GetArrayLength() << ")\n";
-ss << "{\n";
-ss << "x = ";
-ss << vSubArguments[0]->GenSlidingWindowDeclRef() << ";\n";
-ss << "if (isnan(x))\n";
-ss << "x = 0.0;\n";
-ss << "}\n";
-}
-else if(tmpCur0->GetType() == formula::svDouble)
-{
-ss << "x = " << tmpCur0->GetDouble() << ";\n";
-}
-else
-{
-throw Unhandled(__FILE__, __LINE__);
-}
-}
-else
-{
-ss << "x = ";
-ss << vSubArguments[0]->GenSlidingWindowDeclRef() << ";\n";
-}
-
-FormulaToken *tmpCur1 = vSubArguments[1]->GetFormulaToken();
-assert(tmpCur1);
-if(ocPush == vSubArguments[1]->GetFormulaToken()->GetOpCode())
-{
-if(tmpCur1->GetType() == formula::svSingleVectorRef)
-{
-const formula::SingleVectorRefToken*tmpCurSVR1 =
-static_cast(tmpCur1);
-ss << "if (gid0 < " << tmpCurSVR1->GetArrayLength() << ")\n";
-ss << "{\n";
-ss << "N = ";
-ss << vSubArguments[1]->GenSlidingWindowDeclRef() << ";\n";
-ss << "if (isnan(N))\n";
-ss << "N = 0.0;\n";
-ss << "}\n";
-}
-else if(tmpCur1->GetType() == formula::svDouble)
-{
-ss << "N = " << tmpCur1->GetDouble() << ";\n";
-}
-else
-{
-throw Unhandled(__FILE__, __LINE__);
-}
-}
-else
-{
-ss << "N = ";
-ss << vSubArguments[1]->GenSlidingWindowDeclRef() << ";\n";
-}
+GenerateArg( "x", 0, vSubArguments, ss );
+GenerateArg( "N", 1, vSubArguments, ss );
 ss << "double f_2_DIV_PI = 2.0 / M_PI;\n";
 ss << "if( N < 0.0 )\n";
 ss << "return CreateDoubleError(IllegalArgument);\n";
@@ -170,44 +109,14 @@ void OpGestep::GenSlidingWindowFunction(
 outputstream &ss,const std::string &sSymName,
 SubArguments &vSubArguments)
 {
+CHECK_PARAMETER_COUNT( 2, 2 );
 GenerateFunctionDeclaration( sSymName, vSubArguments, ss );
 ss << "{\n";
-ss << "double tmp=0,tmp0 =0,tmp1 = 0;\n";
+ss << "double tmp=0;\n";
 ss << "int gid0=get_global_id(0);\n";
 ss <<"\n";
-for (size_t i = 0; i < vSubArguments.size(); i++)
-{
-FormulaToken *pCur = vSubArguments[i]->GetFormulaToken();
-assert(pCur);
-if (pCur->GetType() == formula::svSingleVectorRef)
-{
-const formula::SingleVectorRefToken& rSVR =
-dynamic_cast< const formula::SingleVectorRefTo